tony2001                Sun Aug  6 20:10:19 2006 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/simplexml/tests        bug38354.phpt 
  Log:
  add test
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug38354.phpt?view=markup&rev=1.1
Index: php-src/ext/simplexml/tests/bug38354.phpt
+++ php-src/ext/simplexml/tests/bug38354.phpt
--TEST--
Bug #38354 (Unwanted reformatting of XML when using AsXML)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php

$xml = simplexml_load_string(
'<code>
        <a href="javascript:alert(\'1\');"><strong>Item Two</strong></a>
</code>'
);
        
foreach ($xml->xpath("//*") as $element) {
        var_dump($element->asXML());
}

echo "Done\n";
?>
--EXPECTF--     
string(101) "<?xml version="1.0"?>
<code>
        <a href="javascript:alert('1');"><strong>Item Two</strong></a>
</code>
"
string(66) "<a href="javascript:alert('1');">
  <strong>Item Two</strong>
</a>"
string(25) "<strong>Item Two</strong>"
Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to