Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2021-08-24 18:18:40 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2021-08-24 18:18:40 +0300
commit8a9e28db495858272541f46e041e3f15744c03db (patch)
treece22451a5916d923baeb288316d9f9e14b9a165f /lib
parent4100581cc8fc21852d975c1dba278b14302fb96b (diff)
Set schema for url when empty. Schema is usually empty for relative urls (without a protocol).
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/HtmlPurify/TransformURLScheme.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Service/HtmlPurify/TransformURLScheme.php b/lib/Service/HtmlPurify/TransformURLScheme.php
index c7c4a2d81..5e073a6c4 100644
--- a/lib/Service/HtmlPurify/TransformURLScheme.php
+++ b/lib/Service/HtmlPurify/TransformURLScheme.php
@@ -71,6 +71,11 @@ class TransformURLScheme extends HTMLPurifier_URIFilter {
public function filter(&$uri, $config, $context) {
/** @var \HTMLPurifier_Context $context */
/** @var \HTMLPurifier_Config $config */
+
+ if ($uri->scheme === null) {
+ $uri->scheme = 'https';
+ }
+
// Only HTTPS and HTTP urls should get rewritten
if ($uri->scheme === 'https' || $uri->scheme === 'http' || $uri->scheme === 'ftp') {
$uri = $this->filterHttpFtp($uri, $context);