From b0a622196a793a36bdf77f79185acea85ba39730 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Mon, 29 Apr 2024 08:38:04 +0200 Subject: Handle whitespace between attribute name and value also for img tags --- it_html.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index 44a2137..af2ef8c 100644 --- a/it_html.class +++ b/it_html.class @@ -421,7 +421,7 @@ static function sanitize($html) list($head, $href, $content, $tail) = $tag; $result .= it_html::sanitize($head) . '' . it_html::sanitize($content) . "" . it_html::sanitize($tail); } - else if ($tag = it::match('(.*)]+?src="(' . $urlpattern . ')"[^>]*?>(.*)', $html)) + else if ($tag = it::match('(.*)]+?\bsrc\s*=\s*"(' . $urlpattern . ')"[^>]*?>(.*)', $html)) { # Image tags, keeps only src attribute list($head, $src, $tail) = $tag; -- cgit v1.2.3