|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-11-18 08:33 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 12:00:02 2025 UTC |
The subject is that you're misusing the function. strip_tags removes tags from HTML. This is not valid HTML: Mileage <= 15000 Now read the warning in the documentation: Because strip_tags() does not actually validate the HTML, partial or broken tags can result in the removal of more text/data than expected. I.e., garbage in = garbage out.