|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21744 strip_tags misses exclamation marks in alt text
Submitted: 2003-01-19 04:39 UTC Modified: 2003-05-30 22:45 UTC
From: dan at freelancer dot net Assigned: rasmus (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 4.3.0 OS: Linux
Private report: No CVE-ID: None
 [2003-01-19 04:39 UTC] dan at freelancer dot net
The following code prints "!" (without the quotes):

print strip_tags('<IMG ALT="Bang Not Stripped!">');

I would expect it to print nothing.

Same thing happens here:

print strip_tags('<AREA ALT="Bang Not Stripped!">');

Here is an example copied from the command line:

[dan@192 v008]$ php
print strip_tags('<IMG ALT="Bang Not Stripped!">') . "\n";
[dan@192 v008]$ 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-19 04:58 UTC] dan at freelancer dot net
Tried the same using PHP 4.0.6 and did not get the problem:

[admin@labworks ukshopsearch]$ php
print strip_tags('<IMG ALT="Bang Not Stripped!">') . "\n";
X-Powered-By: PHP/4.0.6
Content-type: text/html

[admin@labworks ukshopsearch]$
 [2003-01-19 05:10 UTC]
Verified with HEAD
 [2003-01-19 05:13 UTC]
My fault.  I'll fix it soonish.
 [2003-01-19 05:34 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

 [2003-05-30 22:43 UTC] csnyder at chxo dot com
This bug is still present in 4.3.1 Linux.
 [2003-05-30 22:45 UTC]
It was fixed in 4.3.2 as 4.3.1 is essentially 4.3.0 (with the one small change to the CGI).
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Oct 02 01:01:25 2023 UTC