Mantis - Quercus
Viewing Issue Advanced Details
1388 minor always 10-03-06 09:59 10-06-06 15:21
ferg  
ferg  
normal  
closed 3.0.21  
fixed  
none    
none 3.1.0  
0001388: SimpleXMLElement bug
(rep by David Berry, see mail for attachment)

Found two more bugs. Here are the test files to duplicate the problem.

Problem 1: Empty elements return the value \\\\\\\"SimpleXMLElement Object\\\\\\\"

Problem 2: Elements that contain the \\\\\\\'@\\\\\\\' character get truncated at the \\\\\\\'@\\\\\\\'.
\\\\\\\"don\\\\\\\'t touch @ this\\\\\\\" becomes \\\\\\\"don\\\\\\\'t touch \\\\\\\". This happens even if the text
is wrapped with <![CDATA[]]>


I found these trying to chase down another bug. Perhaps you have heard of
this. I get a consistent error where the value of these xml elements becomes
\\\\\\\"ARRAY\\\\\\\". I have not been successful in duplicating this error. Have you
heard of any one else getting \\\\\\\"ARRAY\\\\\\\" when they are assigning a primitive
value to a variable.

Notes
(0001533)
emil   
10-03-06 17:07   
The following script outputs different values to the browser and the log, but shouldn\\\'t. This may have something to do which how echo is parsed: it splits append expressions, but normal functions evaluate them lazily.

<?php
$xmlstr = <<<XML
<?xml version=\\\'1.0\\\' standalone=\\\'yes\\\'?>
<a>
  &lt;b>
    <c>
    Sample data 1
    </c>
  
  &lt;b>
    <c>
    Sample data 2
    </c>
  
</a>
XML;

$xml = simplexml_load_string($xmlstr);

foreach ($xml->b as $b) {
  echo \\\"a->b: \\\" . $b->c . \\\"
\\\";
  syslog(STDERR, \\\"a->b: \\\" . $b->c);
}

?>

(0001535)
ferg   
10-06-06 15:21   
php/1x0b