From: taavi at meos dot ee
Operating system: Linux 2.6.9
PHP version: 5.0.3
PHP Bug Type: *XML functions
Bug description: XML Parser can't handle htmlspecialchars
Description:
------------
XML file contains html: <a href="hello">tere</a> which is encoded and sent
as $data to parsing function:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<lahendus>
<L>1</L>
<lNimetus>Baaslahendus</lNimetus>
<lKirjeldus>Minu seaded, kasutajakontod, s�steemi seaded</lKirjeldus>
<lVersioon>2.0.0</lVersioon>
<lMemo><a href="hello">tere</a></lMemo>
</lahendus>
Reproduce code:
---------------
... /* more code here, not that important now */
$parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING,'ISO-8859-1');
xml_parse_into_struct($parser, $data, $values, $tags);
... /* more code here, not that important now */
$xml = new tmc_xml;
$asjad = $xml->loe_andmed('lahendus.xml','lahendus');
echo $asjad[0]['lMemo'];
Expected result:
----------------
<a href="hello">tere</a>
Actual result:
--------------
/*
nothing here, only: <html><body></body></html>
Some remarks: this code works perfectly in php 5.0.2
So, i unlinked php 5.0.3 and recompiled php 5.0.2 with same
options - no problems - acts as expected:
*/
--
Edit bug report at http://bugs.php.net/?id=31208&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31208&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31208&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31208&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31208&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31208&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31208&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31208&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31208&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31208&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31208&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31208&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31208&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31208&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31208&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31208&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31208&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31208&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31208&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31208&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31208&r=mysqlcfg