namespace/tagname validation fixes (Adam Trachtenberg)

added new test
This commit is contained in:
Rob Richards 2004-05-27 11:15:45 +00:00
parent 7f887852a6
commit edae935c26
6 changed files with 489 additions and 47 deletions

View file

@ -48,7 +48,7 @@ PHP_METHOD(domentityreference, __construct)
xmlNodePtr oldnode = NULL;
dom_object *intern;
char *name;
int name_len;
int name_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", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
@ -57,7 +57,9 @@ PHP_METHOD(domentityreference, __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;
}