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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andrey at itime dot ru
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC