diff options
Diffstat (limited to 'ext/dom')
| -rw-r--r-- | ext/dom/document.c | 12 | ||||
| -rw-r--r-- | ext/dom/php_dom.c | 5 | ||||
| -rw-r--r-- | ext/dom/php_dom.h | 2 |
3 files changed, 6 insertions, 13 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 4a6c178d71..288075c079 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -2221,17 +2221,11 @@ PHP_METHOD(domdocument, registerNodeClass) if (ce == NULL || instanceof_function(ce, basece)) { DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (dom_set_doc_classmap(intern->document, basece, ce) == FAILURE) { - zend_throw_error(zend_ce_error, "Class %s could not be registered.", ZSTR_VAL(ce->name)); - RETURN_FALSE; - } + dom_set_doc_classmap(intern->document, basece, ce); RETURN_TRUE; - } else { - zend_throw_error(zend_ce_error, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name)); - RETURN_FALSE; } - + + zend_throw_error(zend_ce_error, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name)); RETURN_FALSE; } /* }}} */ diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 517d645e74..6cb198db57 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -206,7 +206,7 @@ static void dom_copy_doc_props(php_libxml_ref_obj *source_doc, php_libxml_ref_ob } } -int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce) +void dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce) { dom_doc_propsptr doc_props; @@ -214,7 +214,7 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, doc_props = dom_get_doc_props(document); if (doc_props->classmap == NULL) { if (ce == NULL) { - return SUCCESS; + return; } ALLOC_HASHTABLE(doc_props->classmap); zend_hash_init(doc_props->classmap, 0, NULL, NULL, 0); @@ -225,7 +225,6 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_hash_del(doc_props->classmap, basece->name); } } - return SUCCESS; } zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece) diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index fdba616363..5e069529ba 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -125,7 +125,7 @@ xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce); +void dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce); zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv); int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty); |
