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.3.4RC2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f719d3707d5b26709dd85f67de82a7c33781e2e3;p=php Fixed bug #52656 (DOMCdataSection does not work with splitText). --- diff --git a/NEWS b/NEWS index c38a1184f6..5eef9f2958 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ . Fixed bug #52828 (curl_setopt does not accept persistent streams). (Gustavo, Ilia) +- DOM extension: + . Fixed bug #52656 (DOMCdataSection does not work with splitText). (Ilia) + - Hash extension: . Fixed bug #51003 (unaligned memory access in ext/hash/hash_tiger.c). (Mike, Ilia) 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; }