BUGFIX: Allow execution of actions (such as Page's search) on ErrorPage; limit the 404 display to the index() action

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75096 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-04-24 04:46:40 +00:00
parent 8a1d21b8af
commit 35a3cd9257
2 changed files with 2 additions and 4 deletions

View File

@ -133,7 +133,7 @@ class RequestHandler extends ViewableData {
// But if we have more content on the URL and we don't know what to do with it, return an error.
} else {
return $this->httpError(400, "I can't handle sub-URLs of a $this->class object.");
return $this->httpError(404, "I can't handle sub-URLs of a $this->class object.");
}
return $this;

View File

@ -183,9 +183,7 @@ class ErrorPage extends Page {
* @package cms
*/
class ErrorPage_Controller extends Page_Controller {
public function init() {
parent::init();
public function index() {
Director::set_status_code($this->failover->ErrorCode ? $this->failover->ErrorCode : 404);
}
}