summaryrefslogtreecommitdiff
path: root/ext/dom/domexception.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2003-08-24 10:23:43 +0000
committerRob Richards <rrichards@php.net>2003-08-24 10:23:43 +0000
commit09481c642b59737096d25518a290d8a3bb710042 (patch)
tree2a65d6e1eb05bcd737da282fe1814294cd069066 /ext/dom/domexception.c
parentea1b33438a64413b82aef0aa197c8f44e4277e78 (diff)
downloadphp-git-09481c642b59737096d25518a290d8a3bb710042.tar.gz
implement stricterrorcheck
fix clonenode cleanup error routines
Diffstat (limited to 'ext/dom/domexception.c')
-rw-r--r--ext/dom/domexception.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index 377a7bc8fa..ed9a46310b 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -42,16 +42,11 @@ zend_function_entry php_dom_domexception_class_functions[] = {
};
/* {{{ php_dom_throw_error */
-void php_dom_throw_error(int error_code, zval **retval TSRMLS_DC)
+void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
{
zval *dom_exception;
char *error_message;
- ALLOC_ZVAL(dom_exception);
- Z_TYPE_P(dom_exception) = IS_OBJECT;
- object_init_ex(dom_exception, dom_domexception_class_entry);
- dom_exception->refcount = 1;
- dom_exception->is_ref = 1;
switch (error_code)
{
case INDEX_SIZE_ERR:
@@ -106,9 +101,18 @@ void php_dom_throw_error(int error_code, zval **retval TSRMLS_DC)
error_message = "Unhandled Error";
}
- add_property_long(dom_exception, "code", error_code);
- add_property_stringl(dom_exception, "message", error_message, strlen(error_message), 1);
- EG(exception) = dom_exception;
+ if (strict_error == 1) {
+ ALLOC_ZVAL(dom_exception);
+ Z_TYPE_P(dom_exception) = IS_OBJECT;
+ object_init_ex(dom_exception, dom_domexception_class_entry);
+ dom_exception->refcount = 1;
+ dom_exception->is_ref = 1;
+ add_property_long(dom_exception, "code", error_code);
+ add_property_stringl(dom_exception, "message", error_message, strlen(error_message), 1);
+ EG(exception) = dom_exception;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, error_message);
+ }
}
/* }}} end php_dom_throw_error */
#endif