File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,15 @@ private function checkUriForMethod(string $method): void
519519 return ;
520520 }
521521
522- if (! in_array ($ method , get_class_methods ($ this ->controller ), true )) {
522+ // If `getSomeMethod()` exists, only `controller/some-method` should be
523+ // accessible. But if a visitor navigates to `controller/somemethod`,
524+ // `getSomemethod()` will be checked, and method_exists() will return true.
525+ if (
526+ method_exists ($ this ->controller , $ method )
527+ // We do not permit `controller/somemethod`, so check the exact method
528+ // name.
529+ && ! in_array ($ method , get_class_methods ($ this ->controller ), true )
530+ ) {
523531 throw new PageNotFoundException (
524532 '" ' . $ this ->controller . ':: ' . $ method . '()" is not found. '
525533 );
You can’t perform that action at this time.
0 commit comments