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
 [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: Fri Aug 01 13:00:03 2025 UTC