rrichards Sat Sep 16 13:54:52 2006 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/dom/tests bug38850.phpt
Modified files:
/php-src/ext/dom characterdata.c node.c
Log:
implement workaround for bug #38823 (DOMComment->appendData does nothing)
fix bug #38850 (lookupNamespaceURI doesn't return default namespace)
add test
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/characterdata.c?r1=1.15.2.1&r2=1.15.2.1.2.1&diff_format=u
Index: php-src/ext/dom/characterdata.c
diff -u php-src/ext/dom/characterdata.c:1.15.2.1
php-src/ext/dom/characterdata.c:1.15.2.1.2.1
--- php-src/ext/dom/characterdata.c:1.15.2.1 Sun Jan 1 12:50:06 2006
+++ php-src/ext/dom/characterdata.c Sat Sep 16 13:54:52 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: characterdata.c,v 1.15.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: characterdata.c,v 1.15.2.1.2.1 2006/09/16 13:54:52 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -207,9 +207,19 @@
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
-
+#if LIBXML_VERSION < 20627
+/* Implement logic from libxml xmlTextConcat to add suport for comments and PI
*/
+ if ((nodep->content == (xmlChar *) &(nodep->properties)) ||
+ ((nodep->doc != NULL) && (nodep->doc->dict != NULL) &&
+ xmlDictOwns(nodep->doc->dict, nodep->content))) {
+ nodep->content = xmlStrncatNew(nodep->content, arg, arg_len);
+ } else {
+ nodep->content = xmlStrncat(nodep->content, arg, arg_len);
+ }
+ nodep->properties = NULL;
+#else
xmlTextConcat(nodep, arg, arg_len);
-
+#endif
RETURN_TRUE;
}
/* }}} end dom_characterdata_append_data */
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/node.c?r1=1.37.2.3.2.4&r2=1.37.2.3.2.5&diff_format=u
Index: php-src/ext/dom/node.c
diff -u php-src/ext/dom/node.c:1.37.2.3.2.4 php-src/ext/dom/node.c:1.37.2.3.2.5
--- php-src/ext/dom/node.c:1.37.2.3.2.4 Mon Aug 7 20:23:35 2006
+++ php-src/ext/dom/node.c Sat Sep 16 13:54:52 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: node.c,v 1.37.2.3.2.4 2006/08/07 20:23:35 tony2001 Exp $ */
+/* $Id: node.c,v 1.37.2.3.2.5 2006/09/16 13:54:52 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1610,19 +1610,17 @@
dom_object *intern;
xmlNsPtr nsptr;
int prefix_len = 0;
- char *prefix;
+ char *prefix=NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Os", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- if (prefix_len > 0) {
- nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
- if (nsptr && nsptr->href != NULL) {
- RETURN_STRING((char *) nsptr->href, 1);
- }
+ nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
+ if (nsptr && nsptr->href != NULL) {
+ RETURN_STRING((char *) nsptr->href, 1);
}
RETURN_NULL();
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug38850.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/bug38850.phpt
+++ php-src/ext/dom/tests/bug38850.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php