php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31964 strip_tags truncates strings at '<<'
Submitted: 2005-02-14 09:51 UTC Modified: 2005-02-14 10:29 UTC
From: tom at designsolution dot co dot uk Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.3.10 OS: OS X 10.3.8
Private report: No CVE-ID: None
 [2005-02-14 09:51 UTC] tom at designsolution dot co dot uk
Description:
------------
When running strip_tags on a string containing '<<', the string is truncated at the '<<'.

Reproduce code:
---------------
<?php
$test = "testing << testing testing 1 2 3";
print(strip_tags($test));
?>



Expected result:
----------------
Probably should return the complete string eg:

testing << testing testing 1 2 3

At the worst I would have expected it without the << but certainly containing the rest.

Actual result:
--------------
testing

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-14 10:29 UTC] tony2001@php.net
This behaviour is documented:
"Because strip_tags() does not actually validate the HTML, partial, or broken tags can result in the removal of more text/data than expected."
Your HTML is undoubtfully broken.
See http://php.net/strip_tags
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 22:01:30 2024 UTC