Skip to content

Commit

Permalink
PEAR #4950: Incorrect CDATA serializing
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/XML_Util/trunk@259105 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
ashnazg committed May 5, 2008
1 parent c5a0f73 commit 8a06c14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Util.php
Expand Up @@ -765,7 +765,8 @@ function createComment($content)
function createCDataSection($data) function createCDataSection($data)
{ {
return sprintf("<![CDATA[%s]]>", return sprintf("<![CDATA[%s]]>",
preg_replace('/\]\]>/', "]]>]]&gt;<![CDATA[", strval($data))); preg_replace('/\]\]>/', "]]]]><![CDATA[>", strval($data)));

} }


/** /**
Expand Down
2 changes: 1 addition & 1 deletion tests/testBug_4950.phpt
Expand Up @@ -14,4 +14,4 @@ echo XML_Util::createTag("test", array(), "Content ]]></test> here!",
?> ?>
--EXPECT-- --EXPECT--
TEST: test case provided in bug report 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.