mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
bd9f4fa676
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
46 lines
806 B
PHP
46 lines
806 B
PHP
--TEST--
|
|
Bug #44648 (Attribute names not checked for well formedness)
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
|
|
$doc = new DOMDocument();
|
|
$doc->loadXML('<root/>');
|
|
|
|
$root = $doc->documentElement;
|
|
|
|
try {
|
|
$attr = new DOMAttr('@acb', '123');
|
|
$root->setAttributeNode($attr);
|
|
} catch (DOMException $e) {
|
|
echo $e->getMessage()."\n";
|
|
}
|
|
|
|
try {
|
|
$root->setAttribute('@def', '456');
|
|
} catch (DOMException $e) {
|
|
echo $e->getMessage()."\n";
|
|
}
|
|
|
|
try {
|
|
$root->setAttributeNS(NULL, '@ghi', '789');
|
|
} catch (DOMException $e) {
|
|
echo $e->getMessage()."\n";
|
|
}
|
|
|
|
try {
|
|
$root->setAttributeNS('urn::test', 'a:g@hi', '789');
|
|
} catch (DOMException $e) {
|
|
echo $e->getMessage()."\n";
|
|
}
|
|
|
|
echo $doc->saveXML($root);
|
|
?>
|
|
--EXPECT--
|
|
Invalid Character Error
|
|
Invalid Character Error
|
|
Invalid Character Error
|
|
Namespace Error
|
|
<root/>
|