rrichards               Wed Mar  3 15:59:03 2004 EDT

  Modified files:              
    /php-src/ext/dom    document.c 
  Log:
  Fix bug #27467: domDocument::load() called from class method crashes
  the methods can be called statically only from within classes which 
    are not extending DomDocument
  
http://cvs.php.net/diff.php/php-src/ext/dom/document.c?r1=1.49&r2=1.50&ty=u
Index: php-src/ext/dom/document.c
diff -u php-src/ext/dom/document.c:1.49 php-src/ext/dom/document.c:1.50
--- php-src/ext/dom/document.c:1.49     Mon Feb 16 08:06:33 2004
+++ php-src/ext/dom/document.c  Wed Mar  3 15:59:02 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: document.c,v 1.49 2004/02/16 13:06:33 rrichards Exp $ */
+/* $Id: document.c,v 1.50 2004/03/03 20:59:02 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1484,7 +1484,10 @@
        int source_len, refcount, ret;
 
        id = getThis();
-       
+       if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), 
dom_document_class_entry TSRMLS_CC)) {
+               id = NULL;
+       }
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, 
&source_len) == FAILURE) {
                return;
        }
@@ -1978,7 +1981,7 @@
        if (!newdoc)
                RETURN_FALSE;
 
-       if (id != NULL) {
+       if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry 
TSRMLS_CC)) {
                intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
                if (intern != NULL) {
                        docp = (xmlDocPtr) dom_object_get_node(intern);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to