1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

- Fixed bug #53319 (strip_tags() may strip '<br />' incorrectly)

This commit is contained in:
Felipe Pena
2010-11-16 22:16:44 +00:00
parent cb2bb12de5
commit 2e42d64007
2 changed files with 19 additions and 3 deletions
+2 -3
View File
@@ -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 {
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #53319 (Strip_tags() may strip '<br />' incorrectly)
--FILE--
<?php
$str = '<br /><br />USD<input type="text"/><br/>CDN<br><input type="text" />';
var_dump(strip_tags($str, '<input>'));
var_dump(strip_tags($str, '<br><input>') === $str);
var_dump(strip_tags($str));
var_dump(strip_tags('<a/b>', '<a>'));
?>
--EXPECTF--
string(47) "USD<input type="text"/>CDN<input type="text" />"
bool(true)
string(6) "USDCDN"
string(0) ""