summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-08-06 20:10:19 +0000
committerAntony Dovgal <tony2001@php.net>2006-08-06 20:10:19 +0000
commit1a58ec5156a7fbf627a2b49dc4ab6294fc9f1899 (patch)
tree994e57a1921bbddb92c3d6cc0f3e59038bb146ac /ext/simplexml
parent42982ac3a1c3af8499bb69657985bd7dbc957384 (diff)
downloadphp-git-1a58ec5156a7fbf627a2b49dc4ab6294fc9f1899.tar.gz
add test
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/tests/bug38354.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/simplexml/tests/bug38354.phpt b/ext/simplexml/tests/bug38354.phpt
new file mode 100644
index 0000000000..8b3b2a2a61
--- /dev/null
+++ b/ext/simplexml/tests/bug38354.phpt
@@ -0,0 +1,30 @@
+--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