summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorDavid Flatz2024-04-29 08:38:04 +0200
committerDavid Flatz2024-04-29 08:38:04 +0200
commitb0a622196a793a36bdf77f79185acea85ba39730 (patch)
treef940ba5f709864d1c32e3c5d62ae3261b4728a7f /it_html.class
parent1750fccd215ed2606053fdc804420469b42758c1 (diff)
downloaditools-b0a622196a793a36bdf77f79185acea85ba39730.tar.gz
itools-b0a622196a793a36bdf77f79185acea85ba39730.tar.bz2
itools-b0a622196a793a36bdf77f79185acea85ba39730.zip
Handle whitespace between attribute name and value also for img tags
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class2
1 files changed, 1 insertions, 1 deletions
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) . '<a href="' . it_html::Q(it_html::U(html_entity_decode($href, ENT_COMPAT, $charset))) . '">' . it_html::sanitize($content) . "</a>" . it_html::sanitize($tail);
}
- else if ($tag = it::match('(.*)<img\b[^>]+?src="(' . $urlpattern . ')"[^>]*?>(.*)', $html))
+ else if ($tag = it::match('(.*)<img\b[^>]+?\bsrc\s*=\s*"(' . $urlpattern . ')"[^>]*?>(.*)', $html))
{
# Image tags, keeps only src attribute
list($head, $src, $tail) = $tag;