@@ -60,7 +60,7 @@ public function getPresenterClass(string &$name): string
6060 return $ this ->cache [$ name ];
6161 }
6262
63- if (!Nette \Utils \Strings::match ($ name , '#^[a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff:]*\z# ' )) {
63+ if (!Nette \Utils \Strings::match ($ name , '#^[a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff:]*$#D ' )) {
6464 throw new InvalidPresenterException ("Presenter name must be alphanumeric string, ' $ name' is invalid. " );
6565 }
6666
@@ -97,7 +97,7 @@ public function setMapping(array $mapping)
9797 {
9898 foreach ($ mapping as $ module => $ mask ) {
9999 if (is_string ($ mask )) {
100- if (!preg_match ('#^ \\\\?([\w \\\\]* \\\\)?(\w*\*\w*? \\\\)?([\w \\\\]*\*\w*)\z# ' , $ mask , $ m )) {
100+ if (!preg_match ('#^ \\\\?([\w \\\\]* \\\\)?(\w*\*\w*? \\\\)?([\w \\\\]*\*\w*)$#D ' , $ mask , $ m )) {
101101 throw new Nette \InvalidStateException ("Invalid mapping mask ' $ mask'. " );
102102 }
103103 $ this ->mapping [$ module ] = [$ m [1 ], $ m [2 ] ?: '*Module \\' , $ m [3 ]];
@@ -137,7 +137,7 @@ public function unformatPresenterClass(string $class): ?string
137137 {
138138 foreach ($ this ->mapping as $ module => $ mapping ) {
139139 $ mapping = str_replace (['\\' , '* ' ], ['\\\\' , '(\w+) ' ], $ mapping );
140- if (preg_match ("#^ \\\\? $ mapping [0 ]((?: $ mapping [1 ])*) $ mapping [2 ]\\ z#i " , $ class , $ matches )) {
140+ if (preg_match ("#^ \\\\? $ mapping [0 ]((?: $ mapping [1 ])*) $ mapping [2 ]$#Di " , $ class , $ matches )) {
141141 return ($ module === '* ' ? '' : $ module . ': ' )
142142 . preg_replace ("# $ mapping [1 ]#iA " , '$1: ' , $ matches [1 ]) . $ matches [3 ];
143143 }
0 commit comments