File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -519,13 +519,15 @@ private function checkUriForMethod(string $method): void
519519 return ;
520520 }
521521
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.
525522 if (
523+ // For example, if `getSomeMethod()` exists in the controller, only
524+ // the URI `controller/some-method` should be accessible. But if a
525+ // visitor navigates to the URI `controller/somemethod`, `getSomemethod()`
526+ // will be checked, and `method_exists()` will return true because
527+ // method names in PHP are case-insensitive.
526528 method_exists ($ this ->controller , $ method )
527- // We do not permit `controller/somemethod`, so check the exact method
528- // name.
529+ // But we do not permit `controller/somemethod`, so check the exact
530+ // method name.
529531 && ! in_array ($ method , get_class_methods ($ this ->controller ), true )
530532 ) {
531533 throw new PageNotFoundException (
You can’t perform that action at this time.
0 commit comments