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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 01 17:01:32 2024 UTC