php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39434 strip_tags() fails with greater than in attribute
Submitted: 2006-11-08 17:27 UTC Modified: 2007-05-04 10:33 UTC
From: geoffers at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.4.4 OS: Mac OS 10.4.8
Private report: No CVE-ID: None
 [2006-11-08 17:27 UTC] geoffers at gmail dot com
Description:
------------
I'm well aware that this an unclear in the HTML specification, 
but this would bring PHP inline with IE/Fx/Saf/Op as well as 
the W3C Validator.

Reproduce code:
---------------
<?php

echo strip_tags('<span title="test > all">this</span>');

?>

Expected result:
----------------
this

Actual result:
--------------
 all">this

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-08 17:48 UTC] tony2001@php.net
To process HTML broken in every possible way we would need to implement a browser in PHP, which is definitely not our goal.
 [2007-05-04 10:33 UTC] geoffers at gmail dot com
This _isn't_ broken HTML. It is completely and utterly valid.

Resubmitted as #40432, and fixed in 5.2.2.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Aug 26 10:00:03 2025 UTC