php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27374 strip_tags() does illegal strips
Submitted: 2004-02-24 02:45 UTC Modified: 2004-02-24 16:47 UTC
From: andrey at itime dot ru Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
 [2004-02-24 02:45 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-24 02:57 UTC] derick@php.net
Actually your HTML code is what is broken here, you should use this:
<a href="&gt;">123</a>


 [2004-02-24 03:11 UTC] 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 16:47 UTC] iliaa@php.net
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. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 19:01:31 2024 UTC