diff options
author | Christian Stocker <chregu@php.net> | 2003-01-10 18:07:36 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2003-01-10 18:07:36 +0000 |
commit | 9234916fc83629a724b5aaf0e46aa6de882caa62 (patch) | |
tree | 0777651ed195aaab3d12760445d84a7c2afff294 /ext/domxml/php_domxml.c | |
parent | 53656f196b2d53c01f2775e20dfc2f4eec810e30 (diff) | |
download | php-git-9234916fc83629a724b5aaf0e46aa6de882caa62.tar.gz |
Throw error if object is not a XML_DOCUMENT_NODE in domxml_dump_node()
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index e3b6a6ea81..41f99e9cfd 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -3714,6 +3714,11 @@ PHP_FUNCTION(domxml_dump_node) RETURN_FALSE; } + if (docp->type != XML_DOCUMENT_NODE && docp->type != XML_HTML_DOCUMENT_NODE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has to be a DomDocument Node"); + RETURN_FALSE; + } + buf = xmlBufferCreate(); if (!buf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer"); |