mirror of
https://github.com/php/php-src.git
synced 2026-04-05 15:12:39 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78814: strip_tags allows / in tag name => whitelist bypass
This commit is contained in:
@@ -4893,7 +4893,7 @@ int php_tag_find(char *tag, size_t len, const char *set) {
|
||||
if (state == 0) {
|
||||
state=1;
|
||||
}
|
||||
if (c != '/') {
|
||||
if (c != '/' || (*(t-1) != '<' && *(t+1) != '>')) {
|
||||
*(n++) = c;
|
||||
}
|
||||
} else {
|
||||
|
||||
8
ext/standard/tests/strings/bug78814.phpt
Normal file
8
ext/standard/tests/strings/bug78814.phpt
Normal file
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Bug #78814 (strip_tags allows / in tag name => whitelist bypass)
|
||||
--FILE--
|
||||
<?php
|
||||
echo strip_tags("<s/trong>b</strong>", "<strong>");
|
||||
?>
|
||||
--EXPECT--
|
||||
b</strong>
|
||||
Reference in New Issue
Block a user