Merge pull request #8843 from dhensby/pulls/4.0/doinit-comparison

FIX doInit comparison should be lowercased
This commit is contained in:
Loz Calver 2019-03-06 09:53:51 +00:00 committed by GitHub
commit 80f83b9043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,7 +195,7 @@ class RequestHandler extends ViewableData
if (!$this->hasAction($action)) {
return $this->httpError(404, "Action '$action' isn't available $classMessage.");
}
if (!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'doInit'))) {
if (!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'doinit'))) {
return $this->httpError(403, "Action '$action' isn't allowed $classMessage.");
}
$result = $this->handleAction($request, $action);
@ -410,7 +410,7 @@ class RequestHandler extends ViewableData
$actionsWithoutExtra = $this->config()->get('allowed_actions', true);
if (!is_array($actions) || !$actionsWithoutExtra) {
if ($action != 'doInit' && $action != 'run' && method_exists($this, $action)) {
if (!in_array(strtolower($action), array('run', 'doinit')) && method_exists($this, $action)) {
return true;
}
}