Bug->Req #78364 [Opn]: strip_tags should not remove \x00
| From: | requinix@php.net | Date: | Thu, 01 Aug 2019 21:55:35 +0000 |
| Subject: | Bug->Req #78364 [Opn]: strip_tags should not remove \x00 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222054@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78364&edit=1
ID: 78364
Updated by: requinix@php.net
Reported by: bkfake-php at yahoo dot com
-Summary: strip_tags removes \x00
+Summary: strip_tags should not remove \x00
Status: Open
-Type: Bug
+Type: Feature/Change Request
-Package: Unknown/Other Function
+Package: Strings related
Operating System: osx
PHP Version: 7.3.8
Block user comment: N
Private report: N
New Comment:
Undocumented? Are you sure about that?
Previous Comments:
------------------------------------------------------------------------
[2019-08-01 21:50:50] bkfake-php at yahoo dot com
Description:
------------
strip_tags strips the null character \x00 from the string
this is neither documented nor desired behavior
tested on v5.6.40 and 7.1.25 - 7.4.0beta1
Test script:
---------------
// outputs "where'd null go?"
$str = "hello\x00world";
$strAfter = strip_tags($str);
if ($str == $strAfter) {
echo 'all is well';
} else {
echo "where'd null go?";
}
Expected result:
----------------
null char should remain and output "all is well"
Actual result:
--------------
outputs "where'd null go?"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78364&edit=1