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:
@@ -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 {
|
||||
|
||||
@@ -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) ""
|
||||
Reference in New Issue
Block a user