Merge pull request #1741 from kinglozzer/1696_handlerequest_fix

Fix: RequestHandler not managing 404/403 errors correctly (fixes #1696)
This commit is contained in:
Ingo Schommer 2013-04-09 07:52:20 -07:00
commit 5fbf2e9303

View File

@ -180,15 +180,13 @@ class RequestHandler extends ViewableData {
$className = get_class($this); $className = get_class($this);
if(!$this->hasAction($action)) {
return new SS_HTTPResponse("Action '$action' isn't available on class $className.", 404);
}
if(!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'init'))) {
return new SS_HTTPResponse("Action '$action' isn't allowed on class $className.", 403);
}
try { try {
if(!$this->hasAction($action)) {
return $this->httpError(404, "Action '$action' isn't available on class $className.");
}
if(!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'init'))) {
return $this->httpError(403, "Action '$action' isn't allowed on class $className.");
}
$result = $this->handleAction($request, $action); $result = $this->handleAction($request, $action);
} }
catch (SS_HTTPResponse_Exception $e) { catch (SS_HTTPResponse_Exception $e) {