From: Ilia Alshanetsky Date: Mon, 29 Nov 2010 14:48:53 +0000 (+0000) Subject: Fixed bug #52656 (DOMCdataSection does not work with splitText). X-Git-Tag: php-5.4.0alpha1~191^2~587 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20f5f21a407599571a8355037bf6e42ee5d0b389;p=php Fixed bug #52656 (DOMCdataSection does not work with splitText). --- diff --git a/ext/dom/tests/bug52656.phpt b/ext/dom/tests/bug52656.phpt new file mode 100644 index 0000000000..860ef99f4f --- /dev/null +++ b/ext/dom/tests/bug52656.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #52656 (DOMCdataSection does not work with splitText). +--SKIPIF-- + +--FILE-- +splitText(5); +var_dump($CDataSplit, $CDataSplit->data); +?> +--EXPECT-- +object(DOMText)#2 (0) { +} +string(5) "here!" diff --git a/ext/dom/text.c b/ext/dom/text.c index 88cbe5377f..c8a39515ca 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -160,7 +160,7 @@ PHP_FUNCTION(dom_text_split_text) } DOM_GET_OBJ(node, id, xmlNodePtr, intern); - if (node->type != XML_TEXT_NODE) { + if (node->type != XML_TEXT_NODE && node->type != XML_CDATA_SECTION_NODE) { RETURN_FALSE; }