From:             jlim at natsoft dot com
Operating system: Windows
PHP version:      5.2.6
PHP Bug Type:     Strings related
Bug description:  strip_tags and <?XML tag

Description:
------------
This is related to bug #12860. The HTML tags are not stripped properly
because of <?XML.

Bugfix #12860 fixes the problem of strip_tags parsing <?xml but not <?XML

I don't have control over the HTML I am stripping because it is from
MS-Outlook generated HTML (ugh).

Regards, John Lim

Reproduce code:
---------------
<?php

# DOES NOT WORK
$s =<<< EOD
This text is shown <?XML:NAMESPACE PREFIX = ST1 /><b>This Text
disappears</b>
EOD;

$s = strip_tags($s);
echo htmlspecialchars($s),"<hr>";


# WORKS

$s =<<< EOD
This text is shown <?xml:NAMESPACE PREFIX = ST1 /><b>This Text
disappears</b>
EOD;

$s = strip_tags($s);
echo htmlspecialchars($s),"<br>";
?>

Expected result:
----------------
This text is shown This Text disappears
------
This text is shown This Text disappears

Actual result:
--------------
This text is shown 
------
This text is shown This Text disappears

-- 
Edit bug report at http://bugs.php.net/?id=45485&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45485&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45485&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45485&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45485&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45485&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45485&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45485&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45485&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45485&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45485&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45485&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45485&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45485&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45485&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45485&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45485&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45485&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45485&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45485&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45485&r=mysqlcfg

Reply via email to