Bug #78003 [NEW]: strip_tags output change since PHP 7.3
| From: | alex at buayacorp dot com | Date: | Sat, 11 May 2019 12:27:30 +0000 |
| Subject: | Bug #78003 [NEW]: strip_tags output change since PHP 7.3 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-220816@lists.php.net to get a copy of this message | ||
From: alex at buayacorp dot com
Operating system:
PHP version: 7.3.5
Package: *General Issues
Bug Type: Bug
Bug description:strip_tags output change since PHP 7.3
Description:
------------
While doing the migration from PHP 7.2 to PHP 7.3, we noticed an output
change of strip_tags which broke some text parsing related code in our
application. Since the release notes from PHP 7.3 only mentions the
deprecation of strip tags stream filtering [1], we are wondering if this
output change was an intended or not.
You can see the different output in https://3v4l.org/lE5Vb
[1]
https://php.net/manual/en/migration73.deprecated.php#migration73.deprecated.core.strip-tags-streaming
Test script:
---------------
<?php
$s=<<<FOO
<script>if (i<j.length);</script>
hola<a href="foo">demo</a>
<script>
/* <![CDATA[ */
/* ]]> */
if(a>2);
</script>
demo
bar
FOO;
var_dump(strip_tags( $s, '<a>' ));
Expected result:
----------------
string(18) "if (i2);
demo
bar"
Actual result:
--------------
string(26) "if (i */
if(a2);
demo
bar"
--
Edit bug report at https://bugs.php.net/bug.php?id=78003&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78003&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78003&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78003&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78003&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78003&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78003&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78003&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78003&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78003&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78003&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78003&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78003&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78003&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78003&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78003&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78003&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78003&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78003&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78003&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78003&r=mysqlcfg