#27374 [Opn->Bgs]: strip_tags() does illegal strips

From: Date: Tue, 24 Feb 2004 21:47:02 +0000
Subject: #27374 [Opn->Bgs]: strip_tags() does illegal strips
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55487@lists.php.net to get a copy of this message
 ID:               27374
 Updated by:       iliaa@php.net
 Reported By:      andrey at itime dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: any
 PHP Version:      Irrelevant
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

This is how strip_tags() works, get used to it. 


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

[2004-02-24 03:11:30] andrey at itime dot ru

But it's still valid html code, isn't it?
HTML 4 specification (http://www.w3.org/TR/REC-html40) allow to use "<"
and ">" within attribute values...

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

[2004-02-24 02:57:59] derick@php.net

Actually your HTML code is what is broken here, you should use this:
<a href="&gt;">123</a>



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

[2004-02-24 02:45:49] andrey at itime dot ru

Description:
------------
strip_tags don't accept quotes and double quotes inside html tags.



Reproduce code:
---------------
echo strip_tags('<a href=">">123</a>');

Expected result:
----------------
123

Actual result:
--------------
">123


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


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


Thread (4 messages)

« previous php.bugs (#55487) next »