php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40637 strip_tags does not handle single quotes correctly (regression)
Submitted: 2007-02-26 09:51 UTC Modified: 2007-02-27 00:15 UTC
From: email at steffenweber dot net Assigned: iliaa (profile)
Status: Closed Package: Strings related
PHP Version: 5.2.1 OS: Linux
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: email at steffenweber dot net
New email:
PHP Version: OS:

 

 [2007-02-26 09:51 UTC] email at steffenweber dot net
Description:
------------
The fix for bug #40432 (http://bugs.php.net/bug.php?id=40432) seems to have broken the strip_tags function.

I'm using PHP 5.2.1 and have additionally applied this patch: http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.39&r2=1.445.2.14.2.40&view=patch

Reproduce code:
---------------
<?php
$html = '<span title="Bug \' Trigger">Text</span>';
var_dump(strip_tags($html));
?>

Expected result:
----------------
Prints "Text".

Actual result:
--------------
Prints the empty string.

Notice that the following slightly modified code correctly prints "Text":

<?php
$html = '<span title="Foo">Text</span>';
var_dump(strip_tags($html));
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-27 00:15 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 21:01:35 2024 UTC