From: Michael M Slusarz Date: Tue, 7 Jul 2009 21:57:30 +0000 (-0600) Subject: Bug #8413: Fix regex to capture some malformed img tags X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9fcdba88dd23b8980d634b5d39d4af9499041235;p=horde.git Bug #8413: Fix regex to capture some malformed img tags --- diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index 9fe00cafa..62313f0cd 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -32,13 +32,13 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html # match 1 ( # tags - ]+src= + ]+?src= # tags - |]*src= + |]+?src= # "background" attributes - |]*background=|]*background=|]*background= + |]+?background=|]*background=|]*background= # "style" attributes; match 2; quotes: match 3 - |(style=\s*("|\')?[^>]*background(?:-image)?:(?(3)[^"\']|[^>])*?url\s*\() + |(style=\s*("|\')?[^>]*?background(?:-image)?:(?(3)[^"\']|[^>])*?url\s*\() ) # whitespace \s* @@ -57,7 +57,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html (?(2) # closing parenthesis \s*\) - # remainder of the "style" attribute; match 5 + # remainder of the "style" attribute; match 6 ((?(3)[^"\'>]*|[^\s>]*)) ) /isx';