summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_html.class2
-rwxr-xr-xtests/it_html.t2
2 files changed, 2 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class
index 6da0b62..75ebe9b 100644
--- a/it_html.class
+++ b/it_html.class
@@ -374,7 +374,7 @@ function select($tags, $options, $selected = null)
function sanitize($html)
{
$result = "";
- $html = it::replace(array('[\0\n\r\s]+' => " "), $html);
+ $html = it::replace(array('[\0\s]+' => " "), $html); # \s also matches \r and \n
$urlpattern = 'https?://[^">]+';
if ($tag = it::match("(.*)<(div|p|i|b)[^>]*>(.*?)</\\2>(.*)", $html))
diff --git a/tests/it_html.t b/tests/it_html.t
index b560ed1..7426a0d 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -93,7 +93,7 @@ is(
);
is(
- it_html::sanitize(' <p><a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted < &lt; &auml; &amp; yesterday <b>a <i>photo</i></b> <b><i>tag missmatch</b></i>:</p><br><BR />
+ it_html::sanitize(" \r \n " . ' <p><a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted < &lt; &auml; &amp; yesterday <b>a <i>photo</i></b> <b><i>tag missmatch</b></i>:</p><br><BR />
<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>
'),