[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom document.c
iliaa Sun Jun 14 13:13:35 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/domdocument.c Log: MFB: Fixed bug #48512 (DOMDocument::validate() fails with both a E_NOTICE and E_WARN if no DTD) http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.16&r2=1.68.2.3.2.5.2.17&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.16 php-src/ext/dom/document.c:1.68.2.3.2.5.2.17 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.16Tue Apr 7 15:32:12 2009 +++ php-src/ext/dom/document.c Sun Jun 14 13:13:35 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.16 2009/04/07 15:32:12 rrichards Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.17 2009/06/14 13:13:35 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1936,11 +1936,7 @@ } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (docp->intSubset == NULL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No DTD given in XML-Document"); - } - + cvp = xmlNewValidCtxt(); cvp->userData = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom document.c /ext/dom/tests bug47849.phpt
rrichards Tue Apr 7 15:32:13 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/dom/tests bug47849.phpt Modified files: /php-src/ext/domdocument.c Log: MFH: fix bug #47849 (Non-deep import loses the namespace) add test http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.15&r2=1.68.2.3.2.5.2.16&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.15 php-src/ext/dom/document.c:1.68.2.3.2.5.2.16 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.15Fri Mar 13 13:43:29 2009 +++ php-src/ext/dom/document.c Tue Apr 7 15:32:12 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.15 2009/03/13 13:43:29 rrichards Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.16 2009/04/07 15:32:12 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1196,6 +1196,9 @@ if (nodep->doc == docp) { retnodep = nodep; } else { + if ((recursive == 0) && (nodep->type == XML_ELEMENT_NODE)) { + recursive = 2; + } retnodep = xmlDocCopyNode(nodep, docp, recursive); if (!retnodep) { RETURN_FALSE; http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug47849.phpt?view=markup&rev=1.1 Index: php-src/ext/dom/tests/bug47849.phpt +++ php-src/ext/dom/tests/bug47849.phpt --TEST-- Bug #47849 (Non-deep import loses the namespace). --SKIPIF-- --FILE-- appendChild($aDOM->createElementNS('urn::root','r:root')); $fromdom= new DOMDocument(); $fromdom->loadXML('aaa'); $data= $fromdom->documentElement; $aDOM->documentElement->appendChild($aDOM->importNode($data)); echo $aDOM->saveXML(); ?> --EXPECT-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom document.c
rrichards Mon Jan 26 19:10:54 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/domdocument.c Log: MFH: fix bug #47220 (segfault in dom_document_parser in recovery mode) http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.13&r2=1.68.2.3.2.5.2.14&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.13 php-src/ext/dom/document.c:1.68.2.3.2.5.2.14 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.13Wed Dec 31 11:15:36 2008 +++ php-src/ext/dom/document.c Mon Jan 26 19:10:53 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.13 2008/12/31 11:15:36 sebastian Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.14 2009/01/26 19:10:53 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1625,7 +1625,7 @@ EG(error_reporting) = old_error_reporting; } /* If loading from memory, set the base reference uri for the document */ - if (ret->URL == NULL && ctxt->directory != NULL) { + if (ret && ret->URL == NULL && ctxt->directory != NULL) { ret->URL = xmlStrdup(ctxt->directory); } } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom document.c
rrichards Sun Sep 28 12:00:37 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/domdocument.c Log: MFH: fix bug #46191 (BC break: DOMDocument saveXML() doesn't accept null) http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.7&r2=1.68.2.3.2.5.2.8&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.7 php-src/ext/dom/document.c:1.68.2.3.2.5.2.8 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.7 Thu Aug 14 08:39:04 2008 +++ php-src/ext/dom/document.c Sun Sep 28 12:00:37 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.7 2008/08/14 08:39:04 tony2001 Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.8 2008/09/28 12:00:37 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -153,7 +153,7 @@ static ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savexml, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0) + ZEND_ARG_OBJ_INFO(0, node, DOMNode, 1) ZEND_END_ARG_INFO(); static -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom document.c /ext/dom/tests bug43364.phpt
rrichards Wed Nov 28 10:44:21 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/dom/tests bug43364.phpt Modified files: /php-src/ext/domdocument.c Log: MFH: Fix bug #43364 (recursive xincludes don't remove internal nodes properly) add test http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.2&r2=1.68.2.3.2.5.2.3&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.2 php-src/ext/dom/document.c:1.68.2.3.2.5.2.3 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.2 Sun Oct 7 05:22:04 2007 +++ php-src/ext/dom/document.c Wed Nov 28 10:44:21 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.2 2007/10/07 05:22:04 davidw Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.3 2007/11/28 10:44:21 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1737,6 +1737,10 @@ /* XML_XINCLUDE_END node will be a sibling of XML_XINCLUDE_START */ while(cur && cur->type != XML_XINCLUDE_END) { + /* remove xinclude processing nodes from recursive xincludes */ + if (cur->type == XML_ELEMENT_NODE) { + php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC); + } cur = cur->next; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug43364.phpt?view=markup&rev=1.1 Index: php-src/ext/dom/tests/bug43364.phpt +++ php-src/ext/dom/tests/bug43364.phpt --TEST-- Bug #43364 (recursive xincludes don't remove internal xml nodes properly) --FILE-- childNodes->length > 0) { $count += loopElements($node->childNodes); } } } return $count; } $xml = << http://www.w3.org/2001/XInclude";> ac1 ac2 DOC; $doc = new DomDocument(); $doc->loadXml($xml); $doc->xinclude(); $count = loopElements(array($doc->documentElement)); var_dump($count); ?> --EXPECT-- int(13) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php