php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20343 strip_tags strip not only VALID tags
Submitted: 2002-11-10 13:40 UTC Modified: 2002-11-10 13:42 UTC
From: atz at atz dot msk dot ru Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4CVS-2002-11-10 OS: FreeBSD 4.7-STABLE
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
9 + 29 = ?
Subscribe to this entry?

 
 [2002-11-10 13:40 UTC] atz at atz dot msk dot ru
For example:

PHP-code

<?
  header("Content-type: text/plain");
  echo strip_tags("the 5<6 but 5>4");
?>

will produce

the 54

I think, that strip_tags() "think", that "<6 but 5>" is normal HTML-tag, but this not true.

More examples:

echo strip_tags("start <32423423423> end");
echo strip_tags("start <????>not inside tag</????> end");

EXCLUSIVE example:
echo strip_tags('<IMG src="..." alt="next >>">');

It will produce
>">

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-10 13:42 UTC] derick@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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC