php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52011 strip_tags error
Submitted: 2010-06-06 22:01 UTC Modified: 2010-06-06 22:20 UTC
From: Hudson dot Atwell at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.13 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Hudson dot Atwell at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-06 22:01 UTC] Hudson dot Atwell at gmail dot com
Description:
------------
if <!--- comments --> are in the string then the strip_tags() output will be blank.

Test script:
---------------
if <!--- comments --> are in the string then the strip_tags() output will be blank.

Expected result:
----------------
if <!--- comments --> are in the string then the strip_tags() output will be blank.

Actual result:
--------------
if <!--- comments --> are in the string then the strip_tags() output will be blank.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-06 22:20 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2010-06-06 22:20 UTC] dtajchreber@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

david@beirut:~$ cat test.php 
<?php
var_dump(strip_tags('<h1>heading 1</h1><!-- asdfasdfasdf --><?php echo "cheese"; 
?><p>paragraph</p>'));
david@beirut:~$ php test.php 
string(18) "heading 1paragraph"

"Note: HTML comments and PHP tags are also stripped. This is hardcoded and can 
not be changed with allowable_tags."

I don't see anything unexpected on 5.2.13 or 5.3.3. The entire comment is 
stripped out as the manual says.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 24 04:03:41 2022 UTC