From:             php at benjaminschulz dot com
Operating system: osx
PHP version:      5.3CVS-2008-04-16 (CVS)
PHP Bug Type:     DOM XML related
Bug description:  dom mangles returns (\r)

Description:
------------
If you load a xml document that contains \r they are silently replaced by
\n, even in CDATAs.
No matter to what ignoreWhiteSpace is set.

Reproduce code:
---------------
<?php
$doc = new DomDocument;
$xml = "<?xml version=\"1.0\"?><foo>\r \r\n <![CDATA[\r]]></foo>";
$doc->loadXml($xml);
var_dump(substr_count($doc->saveXml(), "\r"));
var_dump(substr_count($doc->saveXml(), "\n"));

Expected result:
----------------
int(3) int(1) 

This is the output of:
var_dump(substr_count($xml, "\r"));
var_dump(substr_count($xml, "\n"));

Actual result:
--------------
int(0) int(5) 

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

Reply via email to