summaryrefslogtreecommitdiff
path: root/ext/dom/processinginstruction.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2004-05-27 11:15:45 +0000
committerRob Richards <rrichards@php.net>2004-05-27 11:15:45 +0000
commitedae935c266fe883a0adeff005d843b70eb2ea66 (patch)
tree31bf44fac6441b22935cb0b71e9d45173f6c44b9 /ext/dom/processinginstruction.c
parent7f887852a64875722f96eeb549b337f94500d739 (diff)
downloadphp-git-edae935c266fe883a0adeff005d843b70eb2ea66.tar.gz
namespace/tagname validation fixes (Adam Trachtenberg)
added new test
Diffstat (limited to 'ext/dom/processinginstruction.c')
-rw-r--r--ext/dom/processinginstruction.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index b0b4cb275b..c3b85a4445 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -48,7 +48,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
- int name_len, value_len;
+ int name_len, value_len, name_valid;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
@@ -57,7 +57,9 @@ PHP_METHOD(domprocessinginstruction, __construct)
}
php_std_error_handling();
- if (name_len == 0) {
+
+ name_valid = xmlValidateName((xmlChar *) name, 0);
+ if (name_valid != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}