diff --git a/program/lib/washtml.php b/program/lib/washtml.php index 8bbc136e1..f8c3251ad 100644 --- a/program/lib/washtml.php +++ b/program/lib/washtml.php @@ -168,7 +168,7 @@ class washtml || ($src = $this->config['cid_map'][$this->config['base_url'].$match[2]])) { $value .= ' url('.htmlspecialchars($src, ENT_QUOTES) . ')'; } - else if (preg_match('/^(http|https|ftp):.*$/i', $match[2], $url)) { + else if (preg_match('!^(https?:)?//[a-z0-9/._+-]+$!i', $match[2], $url)) { if ($this->config['allow_remote']) $value .= ' url('.htmlspecialchars($url[0], ENT_QUOTES).')'; else diff --git a/tests/src/BID-26800.txt b/tests/src/BID-26800.txt index 513516c09..e4e2fe795 100644 --- a/tests/src/BID-26800.txt +++ b/tests/src/BID-26800.txt @@ -10,13 +10,14 @@

2 test

<div> block

valid css
+

3 test

Inject comment text

-
+

4 test

Using reverse solid to directe the codepoint