From: kh dot wild at wicom dot li
Operating system: FreeBSD 6.4
PHP version: 5.2.10
PHP Bug Type: *XML functions
Bug description: XML Encoding differs when using XML with or without XML-Writer
Description:
------------
We had a problem with typo3 and templavoila after updateing to 5.2.10.
The problem was that the prevues given string with < and > was
removed in the current version.
We had the extensions
extension=eaccelerator.so
extension=zip.so
extension=simplexml.so
extension=session.so
extension=xml.so
extension=pcre.so
extension=filter.so
extension=gd.so
extension=json.so
extension=zlib.so
extension=bz2.so
extension=openssl.so
extension=ctype.so
extension=spl.so
extension=dom.so
extension=mysql.so
extension=mcrypt.so
installed
After XML-Write and XML-Reader the behavior becomes the same as with
the version 5.2.9.
extension=xmlwriter.so
extension=xmlreader.so
Reproduce code:
---------------
<?php
$data = '<?' . 'xml version="1.0" encoding="iso-8859-1"
standalone="yes" ?>
<field_content type="array">
<vDEF>Casestudy www.blah blah<br>
<br>
blah, Agentur für Werbung und Kommunikation GmbH<br>
<a href="http://www.blah blah/"
target="_blank" style="color: #000000;">www.blah
blah</a></vDEF>
</field_content>
</T3FlexForms>';
$parser = xml_parser_create();
$vals = $index = $match = Array();
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 0 );
xml_parser_set_option( $parser, XML_OPTION_TARGET_ENCODING,
'iso-8859-1' );
xml_parse_into_struct( $parser, $data, $vals, $index );
print_r( $vals );
xml_parser_free( $parser );
?>
Expected result:
----------------
Array
(
[0] => Array
(
[tag] => field_content
[type] => open
[level] => 1
[attributes] => Array
(
[type] => array
)
[value] =>
)
[1] => Array
(
[tag] => vDEF
[type] => complete
[level] => 2
[value] => Casestudy www.mohrenbrauerei.at<br>
<br>
blah, Agentur f<C3><BC>r Werbung und Kommunikation GmbH<br>
<a href="http://www.blah blah/" target="_blank" style="color:
#000000;">www.blah blah</a>
)
[2] => Array
(
[tag] => field_content
[value] =>
[type] => cdata
[level] => 1
)
[3] => Array
(
[tag] => field_content
[type] => close
[level] => 1
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[tag] => field_content
[type] => open
[level] => 1
[attributes] => Array
(
[type] => array
)
[value] =>
)
[1] => Array
(
[tag] => vDEF
[type] => complete
[level] => 2
[value] => Casestudy www blah blahbr
br
blah, Agentur f<C3><BC>r Werbung und Kommunikation GmbHbr
a href="http://www.blah blah/" target="_blank" style="color:
#000000;"www.blah blah/a
)
[2] => Array
(
[tag] => field_content
[value] =>
[type] => cdata
[level] => 1
)
[3] => Array
(
[tag] => field_content
[type] => close
[level] => 1
)
)
--
Edit bug report at http://bugs.php.net/?id=49002&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49002&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49002&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49002&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49002&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49002&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49002&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49002&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49002&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49002&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49002&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49002&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49002&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49002&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49002&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49002&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49002&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49002&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49002&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49002&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49002&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49002&r=mysqlcfg