From: Felipe Pena Date: Tue, 16 Nov 2010 22:16:44 +0000 (+0000) Subject: - Fixed bug #53319 (strip_tags() may strip '
' incorrectly) X-Git-Tag: php-5.4.0alpha1~191^2~660 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e42d64007aea4e116948e105599508bda991bec;p=php - Fixed bug #53319 (strip_tags() may strip '
' incorrectly) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index abd33d6ee8..e39b0cb6ec 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4210,9 +4210,8 @@ int php_tag_find(char *tag, int len, char *set) { if (!isspace((int)c)) { if (state == 0) { state=1; - if (c != '/') - *(n++) = c; - } else { + } + if (c != '/') { *(n++) = c; } } else { diff --git a/ext/standard/tests/strings/bug53319.phpt b/ext/standard/tests/strings/bug53319.phpt new file mode 100644 index 0000000000..0bcc06d5ec --- /dev/null +++ b/ext/standard/tests/strings/bug53319.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #53319 (Strip_tags() may strip '
' incorrectly) +--FILE-- +
USD
CDN
'; +var_dump(strip_tags($str, '')); +var_dump(strip_tags($str, '
') === $str); +var_dump(strip_tags($str)); +var_dump(strip_tags('', '')); + +?> +--EXPECTF-- +string(47) "USDCDN" +bool(true) +string(6) "USDCDN" +string(0) ""