#31964 [Opn->Bgs]: strip_tags truncates strings at '<<'

From: Date: Mon, 14 Feb 2005 09:29:36 +0000
Subject: #31964 [Opn->Bgs]: strip_tags truncates strings at '<<'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74019@lists.php.net to get a copy of this message
 ID:               31964
 Updated by:       tony2001@php.net
 Reported By:      tom at designsolution dot co dot uk
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: OS X 10.3.8
 PHP Version:      4.3.10
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2005-02-14 09:51:09] 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


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


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


Thread (2 messages)

« previous php.bugs (#74019) next »