mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-15 19:23:37 +00:00
Fixing issue where changing the case for an action in the url would allow the action in the AuthComponent making it accessible to not-logged in users
This commit is contained in:
parent
2bffd4c26d
commit
f6534d2962
2 changed files with 8 additions and 3 deletions
lib/Cake/Controller/Component
|
@ -268,8 +268,8 @@ class AuthComponent extends Component {
|
|||
return true;
|
||||
}
|
||||
|
||||
$methods = array_flip($controller->methods);
|
||||
$action = $controller->request->params['action'];
|
||||
$methods = array_flip(array_map('strtolower', $controller->methods));
|
||||
$action = strtolower($controller->request->params['action']);
|
||||
|
||||
$isMissingAction = (
|
||||
$controller->scaffold === false &&
|
||||
|
@ -296,7 +296,7 @@ class AuthComponent extends Component {
|
|||
$allowedActions = $this->allowedActions;
|
||||
$isAllowed = (
|
||||
$this->allowedActions == array('*') ||
|
||||
in_array($action, $allowedActions)
|
||||
in_array($action, array_map('strtolower', $allowedActions))
|
||||
);
|
||||
|
||||
if ($loginAction != $url && $isAllowed) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue