From 5ceb7642fac777226ca0462bb74c299dd2e397b9 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 4 Nov 2008 14:01:58 +0000 Subject: Simplify regex and make sure test catches CR --- it_html.class | 2 +- tests/it_html.t | 2 +- 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)[^>]*>(.*?)(.*)", $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('

swisspics posted < < ä & yesterday a photo tag missmatch:



+ it_html::sanitize(" \r \n " . '

swisspics posted < < ä & yesterday a photo tag missmatch:



Wolken

'), -- cgit v1.2.3