Skip to content
Browse files

PEAR #4950: Incorrect CDATA serializing

git-svn-id: http://svn.php.net/repository/pear/packages/XML_Util/trunk@259105 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent c5a0f73 commit 8a06c14c390e78d03e7e939f9364b1a4c903ccd7 Chuck Burgess committed May 5, 2008
Showing with 3 additions and 2 deletions.
  1. +2 −1 Util.php
  2. +1 −1 tests/testBug_4950.phpt
View
3 Util.php
@@ -765,7 +765,8 @@ function createComment($content)
function createCDataSection($data)
{
return sprintf("<![CDATA[%s]]>",
- preg_replace('/\]\]>/', "]]>]]&gt;<![CDATA[", strval($data)));
+ preg_replace('/\]\]>/', "]]]]><![CDATA[>", strval($data)));
+
}
/**
View
2 tests/testBug_4950.phpt
@@ -14,4 +14,4 @@ echo XML_Util::createTag("test", array(), "Content ]]></test> here!",
?>
--EXPECT--
TEST: test case provided in bug report
-<test><![CDATA[Content ]]>]]&gt;<![CDATA[</test> here!]]></test>
+<test><![CDATA[Content ]]]]><![CDATA[></test> here!]]></test>

0 comments on commit 8a06c14

Please sign in to comment.
Something went wrong with that request. Please try again.