php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10362 strip_tags() strips round brackets inside allowed html tags
Submitted: 2001-04-17 12:02 UTC Modified: 2012-05-24 10:03 UTC
From: jo at feuersee dot de Assigned: johannes (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.4pl1 OS: Linux 2.4.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jo at feuersee dot de
New email:
PHP Version: OS:

Further comment on this bug is unnecessary.

 

 [2001-04-17 12:02 UTC] jo at feuersee dot de
When using strip_tags() with the optional conversion 
param, it still strips round brackets "()" from the input 
string.
Example:
<?php
$allowed = "<a>";
$tag = "<a href=\"$PHP_SELF\" "; 
$tag .= "onClick=\"alert('Hello')\">click</a>";
printf("%s", strip_tags($tag, $allowed));
?>
results in
<a href="whatever.php" onCLick="alert'Hello'">click</a>
missing brackets---------------------^-----^

and leaves the <a> Tag unuseable.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-28 19:13 UTC] elixer@php.net
Fixed in CVS.  It will be part of PHP4.0.6 when it is released.
 [2012-05-24 10:03 UTC] johannes@php.net
-Assigned To: +Assigned To: johannes -Block user comment: No +Block user comment: Yes
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 17:01:31 2024 UTC