php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51102 strip_tags wraps around on tags longer than 1023 characters
Submitted: 2010-02-20 22:12 UTC Modified: 2010-02-20 23:07 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tolkad dot freenode at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.1 OS: N/A
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: tolkad dot freenode at gmail dot com
New email:
PHP Version: OS:

 

 [2010-02-20 22:12 UTC] tolkad dot freenode at gmail dot com
Description:
------------
If there are allowed tags, strip_tags will wrap around tags greater than 1023 (PHP_TAG_BUF_SIZE) characters.

If this is absolutely necessary it should at least be documented.

Also, why does strip_tags strip null bytes and why isn't this documented?

Reproduce code:
---------------
<?php
$str = "<a" . str_repeat(' ', 1021) . ">";
echo strip_tags($str, "<a>");


Expected result:
----------------
<a(1021 spaces)>

Actual result:
--------------
>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-20 22:15 UTC] tolkad dot freenode at gmail dot com
fixed email address
 [2010-02-20 23:07 UTC] pajoye@php.net
Already reported and fixed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 02 03:00:02 2025 UTC