Annotation of embedaddon/php/ext/simplexml/tests/bug38354.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #38354 (Unwanted reformatting of XML when using AsXML)
3: --SKIPIF--
4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: $xml = simplexml_load_string(
9: '<code>
10: <a href="javascript:alert(\'1\');"><strong>Item Two</strong></a>
11: </code>'
12: );
13:
14: foreach ($xml->xpath("//*") as $element) {
15: var_dump($element->asXML());
16: }
17:
18: echo "Done\n";
19: ?>
20: --EXPECTF--
21: string(101) "<?xml version="1.0"?>
22: <code>
23: <a href="javascript:alert('1');"><strong>Item Two</strong></a>
24: </code>
25: "
26: string(62) "<a href="javascript:alert('1');"><strong>Item Two</strong></a>"
27: string(25) "<strong>Item Two</strong>"
28: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>