Bug #66111 [Com]: strip_tags strip <=

From: Date: Tue, 19 Nov 2013 13:10:31 +0000
Subject: Bug #66111 [Com]: strip_tags strip <=
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182825@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66111&edit=1

 ID:                 66111
 Comment by:         anon at anon dot anon
 Reported by:        22rist at gmail dot com
 Summary:            strip_tags strip <=
 Status:             Open
 Type:               Bug
 Package:            Filter related
 Operating System:   windows 7 x64
 PHP Version:        5.5Git-2013-11-18 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

strip_tags converts HTML to plain text. If you're typing "Mileage <= 15000",
that's not HTML, it's text, so strip_tags is the wrong function. Use htmlspecialchars.


Previous Comments:
------------------------------------------------------------------------
[2013-11-18 08:33:10] 22rist at gmail dot com

Description:
------------
Very hard to explain copywriter, that he should not use "<=" in his text for security
purposes.

Test script:
---------------
$text = "Mileage <= 15000";
print_r(strip_tags($text));
//print: Mileage

Expected result:
----------------
Mileage <= 15000

Actual result:
--------------
Mileage


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66111&edit=1


Thread (13 messages)

« previous php.bugs (#182825) next »