diff options
author | Rob Richards <rrichards@php.net> | 2004-05-16 10:30:16 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2004-05-16 10:30:16 +0000 |
commit | 9e3956b313ef74f0e7c4881ca39c9395036d45bb (patch) | |
tree | f14ce42a575f226ac068b10f216df59c04c32896 /ext/dom/document.c | |
parent | 92c72cb8d85d9115c08f857f2237bd532848a786 (diff) | |
download | php-git-9e3956b313ef74f0e7c4881ca39c9395036d45bb.tar.gz |
constructors throw DOMException
add DOM_PHP_ERR DomException code
validate tagnames in constructors
use C style comments
update TODO
Diffstat (limited to 'ext/dom/document.c')
-rw-r--r-- | ext/dom/document.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 427e711447..5dbfaa8f3c 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -740,7 +740,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC) -/* {{{ proto domelement dom_document_create_element(string tagName); +/* {{{ proto domelement dom_document_create_element(string tagName [, string value]); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547 Since: */ @@ -1296,13 +1296,19 @@ PHP_METHOD(domdocument, __construct) char *encoding, *version = NULL; int encoding_len = 0, version_len = 0, refcount; + php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) { + php_std_error_handling(); return; } + php_std_error_handling(); docp = xmlNewDoc(version); - if (!docp) + + if (!docp) { + php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); RETURN_FALSE; + } if (encoding_len > 0) { docp->encoding = (const xmlChar*)xmlStrdup(encoding); |