Restrict unicode chars allowed to what php core allows, refs #1361
parent
2d7c3c9d27
commit
5a01ada383
|
@ -125,10 +125,10 @@ class ClassMapGenerator
|
||||||
|
|
||||||
preg_match_all('{
|
preg_match_all('{
|
||||||
(?:
|
(?:
|
||||||
\b(?<![\$:>])(?<type>class|interface'.$traits.') \s+ (?<name>[^\s\{]+)
|
\b(?<![\$:>])(?<type>class|interface'.$traits.') \s+ (?<name>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
|
||||||
| \b(?<![\$:>])(?<ns>namespace) (?<nsname>\s+[^\s;{}\\\\]+(?:\s*\\\\\s*[^\s;{}\\\\]+)*)? \s*[\{;]
|
| \b(?<![\$:>])(?<ns>namespace) (?<nsname>\s+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\s*\\\\\s*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*)? \s*[\{;]
|
||||||
)
|
)
|
||||||
}iux', $contents, $matches);
|
}ix', $contents, $matches);
|
||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$namespace = '';
|
$namespace = '';
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||||
'Foo\\LargeClass' => realpath(__DIR__).'/Fixtures/classmap/LargeClass.php',
|
'Foo\\LargeClass' => realpath(__DIR__).'/Fixtures/classmap/LargeClass.php',
|
||||||
'Foo\\LargeGap' => realpath(__DIR__).'/Fixtures/classmap/LargeGap.php',
|
'Foo\\LargeGap' => realpath(__DIR__).'/Fixtures/classmap/LargeGap.php',
|
||||||
'Foo\\MissingSpace' => realpath(__DIR__).'/Fixtures/classmap/MissingSpace.php',
|
'Foo\\MissingSpace' => realpath(__DIR__).'/Fixtures/classmap/MissingSpace.php',
|
||||||
'Unicode\\↑' => realpath(__DIR__).'/Fixtures/classmap/Unicode.php',
|
'Unicode\\↑\\↑' => realpath(__DIR__).'/Fixtures/classmap/Unicode.php',
|
||||||
)),
|
)),
|
||||||
array(__DIR__.'/Fixtures/template', array()),
|
array(__DIR__.'/Fixtures/template', array()),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Unicode;
|
namespace Unicode\↑;
|
||||||
|
|
||||||
class ↑{
|
class ↑{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue