svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/dom/tests/bug52656.phpt branches/PHP_5_3/ext/dom/text.c
trunk/ext/dom/tests/bug52656.phpt trunk/ext/dom/text.c
| From: | Ilia Alshanetsky | Date: | Mon, 29 Nov 2010 14:48:53 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/dom/tests/bug52656.phpt branches/PHP_5_3/ext/dom/text.c trunk/ext/dom/tests/bug52656.phpt trunk/ext/dom/text.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-63982@lists.php.net to get a copy of this message | ||
iliaa Mon, 29 Nov 2010 14:48:53 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=305837
Log:
Fixed bug #52656 (DOMCdataSection does not work with splitText).
Bug: http://bugs.php.net/52656 (Open)
DOMCdataSection::splitText broken
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
A php/php-src/branches/PHP_5_3/ext/dom/tests/bug52656.phpt
U php/php-src/branches/PHP_5_3/ext/dom/text.c
A php/php-src/trunk/ext/dom/tests/bug52656.phpt
U php/php-src/trunk/ext/dom/text.c
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2010-11-29 14:43:20 UTC (rev 305836)
+++ php/php-src/branches/PHP_5_3/NEWS 2010-11-29 14:48:53 UTC (rev 305837)
@@ -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)
Added: php/php-src/branches/PHP_5_3/ext/dom/tests/bug52656.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/dom/tests/bug52656.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/dom/tests/bug52656.phpt 2010-11-29 14:48:53 UTC (rev 305837)
@@ -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!"
Modified: php/php-src/branches/PHP_5_3/ext/dom/text.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/dom/text.c 2010-11-29 14:43:20 UTC (rev 305836)
+++ php/php-src/branches/PHP_5_3/ext/dom/text.c 2010-11-29 14:48:53 UTC (rev 305837)
@@ -160,7 +160,7 @@
}
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;
}
Added: php/php-src/trunk/ext/dom/tests/bug52656.phpt
===================================================================
--- php/php-src/trunk/ext/dom/tests/bug52656.phpt (rev 0)
+++ php/php-src/trunk/ext/dom/tests/bug52656.phpt 2010-11-29 14:48:53 UTC (rev 305837)
@@ -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!"
Modified: php/php-src/trunk/ext/dom/text.c
===================================================================
--- php/php-src/trunk/ext/dom/text.c 2010-11-29 14:43:20 UTC (rev 305836)
+++ php/php-src/trunk/ext/dom/text.c 2010-11-29 14:48:53 UTC (rev 305837)
@@ -160,7 +160,7 @@
}
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;
}