cvs: php4(PHP_4_0_7) /ext/domxml php_domxml.c
| From: | Sterling Hughes | Date: | Sun, 09 Sep 2001 09:45:16 +0000 |
| Subject: | cvs: php4(PHP_4_0_7) /ext/domxml php_domxml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7322@lists.php.net to get a copy of this message | ||
sterling Sun Sep 9 05:45:16 2001 EDT
Modified files: (Branch: PHP_4_0_7)
/php4/ext/domxml php_domxml.c
Log:
MFH
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.67.2.3 php4/ext/domxml/php_domxml.c:1.67.2.4
--- php4/ext/domxml/php_domxml.c:1.67.2.3 Wed Aug 29 18:26:53 2001
+++ php4/ext/domxml/php_domxml.c Sun Sep 9 05:45:10 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.c,v 1.67.2.3 2001/08/29 22:26:53 joey Exp $ */
+/* $Id: php_domxml.c,v 1.67.2.4 2001/09/09 09:45:10 sterling Exp $ */
#ifdef HAVE_CONFIG_H
@@ -393,16 +393,19 @@
TSRMLS_FETCH();
if (Z_TYPE_P(wrapper) != IS_OBJECT) {
- php_error(E_ERROR, "Wrapper is not an object");
+ php_error(E_WARNING, "Wrapper is not an object");
+ return NULL;
}
if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) {
- php_error(E_ERROR, "Underlying object missing");
+ php_error(E_WARNING, "Underlying object missing");
+ return NULL;
}
obj = zend_list_find(Z_LVAL_PP(handle), &type);
if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) {
- php_error(E_ERROR, "Underlying object missing or of invalid type");
+ php_error(E_WARNING, "Underlying object missing or of invalid type");
+ return NULL;
}
return obj;
@@ -493,17 +496,20 @@
int type;
if (Z_TYPE_P(wrapper) != IS_OBJECT) {
- php_error(E_ERROR, "Wrapper is not an object");
+ php_error(E_WARNING, "Wrapper is not an object");
+ return NULL;
}
if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) ==
FAILURE) {
- php_error(E_ERROR, "Underlying object missing");
+ php_error(E_WARNING, "Underlying object missing");
+ return NULL;
}
obj = zend_list_find(Z_LVAL_PP(handle), &type);
if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) {
- php_error(E_ERROR, "Underlying object missing or of invalid type");
+ php_error(E_WARNING, "Underlying object missing or of invalid type");
+ return NULL;
}
return obj;
@@ -591,18 +597,21 @@
int type;
if (Z_TYPE_P(wrapper) != IS_OBJECT) {
- php_error(E_ERROR, "Wrapper is not an object");
+ php_error(E_WARNING, "Wrapper is not an object");
+ return NULL;
}
if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) {
- php_error(E_ERROR, "Underlying object missing");
+ php_error(E_WARNING, "Underlying object missing");
+ return NULL;
}
obj = zend_list_find(Z_LVAL_PP(handle), &type);
/* The following test should be replaced with search in all parents */
if (!obj) { /* || ((type != rsrc_type1) && (type != rsrc_type2))) { */
- php_error(E_ERROR, "Underlying object missing or of invalid type");
+ php_error(E_WARNING, "Underlying object missing or of invalid type");
+ return NULL;
}
return obj;
@@ -953,6 +962,9 @@
id = getThis();
attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
+ if (!attrp) {
+ RETURN_FALSE;
+ }
RETURN_STRING((char *) (attrp->name), 1);
}
@@ -2560,9 +2572,8 @@
int ret;
id = getThis();
-
if (!id) {
- php_error(E_ERROR, "Invalid object");
+ php_error(E_WARNING, "Invalid object");
RETURN_FALSE;
}
@@ -2637,6 +2648,9 @@
ctxp = php_xpath_get_context(id, le_xpathctxp, 0 TSRMLS_CC);
+ if (!ctxp) {
+ RETURN_FALSE;
+ }
convert_to_string(str);
if (contextnode) {