Bug #80051 [NEW]: strip_tags clears string when starting with the lesser then or equal operator.
| From: | stefan at concera dot com | Date: | Thu, 03 Sep 2020 17:10:49 +0000 |
| Subject: | Bug #80051 [NEW]: strip_tags clears string when starting with the lesser then or equal operator. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228866@lists.php.net to get a copy of this message | ||
From: stefan at concera dot com
Operating system: Ubuntu 16.04.7 LTS x86_64
PHP version: 7.4.10
Package: Strings related
Bug Type: Bug
Bug description:strip_tags clears string when starting with the lesser then or equal operator.
Description:
------------
When executing the strip_tags function, using a string that starts with
the lesser then or equal operator, it will be deleted...
I accidentally found this out when stripping tags of an array with
values, used for a <select>-element. When I strip the string '<= (Less
then or equal)', it will result into an empty string.
I also tried to add it to the $allowable_tags parameter, like this
strip_tags('<= (Less then or equal)', '<=>'), but this doesn't
seem to
work either.
Test script:
---------------
<?php
$array = [
'= (Equal)',
'!= (Not equal)',
'> (Greater then)',
'>= (Greater then or equal)',
'< (Less then)',
'<= (Less then or equal)',
];
foreach( $array as $key => $value )
{
echo $key."\t=>\t".strip_tags($value)."\n";
}
Expected result:
----------------
0 => = (Equal)
1 => != (Not equal)
2 => > (Greater then)
3 => >= (Greater then or equal)
4 => < (Less then)
5 => <= (Less then or equal)
Actual result:
--------------
0 => = (Equal)
1 => != (Not equal)
2 => > (Greater then)
3 => >= (Greater then or equal)
4 => < (Less then)
5 =>
--
Edit bug report at https://bugs.php.net/bug.php?id=80051&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80051&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80051&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80051&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80051&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80051&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80051&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80051&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80051&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80051&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80051&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80051&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80051&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80051&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80051&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80051&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80051&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80051&r=mysqlcfg