]> granicus.if.org Git - php/commitdiff
Fixed bug #52656 (DOMCdataSection does not work with splitText).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 29 Nov 2010 14:48:53 +0000 (14:48 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 29 Nov 2010 14:48:53 +0000 (14:48 +0000)
NEWS
ext/dom/tests/bug52656.phpt [new file with mode: 0644]
ext/dom/text.c

diff --git a/NEWS b/NEWS
index c38a1184f689a71af4bc59341ce4b1778932dc13..5eef9f2958ea12b8ae7bc4d5b37c2dd42b155e74 100644 (file)
--- 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 (file)
index 0000000..860ef99
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Bug #52656 (DOMCdataSection does not work with splitText).
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$CData = new DOMCdataSection('splithere!');
+$CDataSplit = $CData->splitText(5);
+var_dump($CDataSplit, $CDataSplit->data);
+?>
+--EXPECT--
+object(DOMText)#2 (0) {
+}
+string(5) "here!"
index 88cbe5377ff10541c24b8208c8ae1716f859c86f..c8a39515cac4a81a25a69f845fb35109701c3987 100644 (file)
@@ -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;
        }