- 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 5ddbeffc6f
commit bbf58f9234
3 changed files with 20 additions and 3 deletions

1
NEWS
View File

@ -66,6 +66,7 @@
- Fixed bug #53323 (pdo_firebird getAttribute() crash).
(preeves at ibphoenix dot com)
- Fixed Bug #53319 (strip_tags() may strip '<br />' incorrectly). (Felipe)
- Fixed bug #53305 (E_NOTICE when defining a constant starts with
__COMPILER_HALT_OFFSET__). (Felipe)
- Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return

View File

@ -4211,9 +4211,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 {

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) ""