We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bb1a7d commit c407546Copy full SHA for c407546
src/Element/AbstractElement.php
@@ -51,11 +51,11 @@ public function getName()
51
*/
52
public static function nameIsValid($name, $allowBackslash = false)
53
{
54
- $pattern = '/^[a-zA-Z_][a-zA-Z0-9_]*$/D';
+ $pattern = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/';
55
if ($allowBackslash === true) {
56
- $pattern = '/^[a-zA-Z_\\\][a-zA-Z0-9_\\\]*$/D';
+ $pattern = '/[a-zA-Z_\x7f-\xff\\\][a-zA-Z0-9_\x7f-\xff\\\]*/';
57
}
58
- return preg_match($pattern, $name) === 1;
+ return preg_match($pattern, $name);
59
60
/**
61
* @param mixed $string
0 commit comments