diff options
-rw-r--r-- | it_html.class | 2 | ||||
-rwxr-xr-x | test/it_html.t | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class index 913d018..5a2fb68 100644 --- a/it_html.class +++ b/it_html.class @@ -409,7 +409,7 @@ static function sanitize($html) $html = it::replace(array('[\0\s]+' => " "), $html); # \s also matches \r and \n $urlpattern = 'https?://[^">]+'; - if ($tag = it::match("(.*)<(div|p|i|b|strong|h[1-6])\b[^>]*>(.*?)</\\2>(.*)", $html)) + if ($tag = it::match("(.*?)<(div|p|i|b|strong|h[1-6])\b[^>]*>(.*?)</\\2>(.*)", $html)) { # Simple tags with content, no attributes kept list($head, $tagname, $content, $tail) = $tag; diff --git a/test/it_html.t b/test/it_html.t index aa734c0..ae11ad1 100755 --- a/test/it_html.t +++ b/test/it_html.t @@ -225,7 +225,7 @@ is( <P><a href="javascript:window.close()" title="Wolken"><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" width="240" height="180" alt="Wolken" style="border: 1px solid #ddd;" /></a></p> '), - ' <a href="http://www.flickr.com/people/swisspics%25/">swisspics</a> posted < < ä & yesterday a <i>photo</i> <i>tag missmatch</i>:<br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" alt="" /></p> ', + ' <p><a href="http://www.flickr.com/people/swisspics%25/">swisspics</a> posted < < ä & yesterday <b>a <i>photo</i></b> <b>tag missmatch</b>:</p><br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" alt="" /></p> ', 'it_html::sanitize tag soup' ); |