Fixed bug with 404 header (merged from branches/2.2.0@45907, r45616)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46109 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-12-02 21:33:59 +00:00
parent 27c70de07e
commit 6921b5e1c1
2 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,6 @@ class ModelAsController extends Controller implements NestedController {
$child = DataObject::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'");
}
if(!$child) {
Director::set_status_code(404);
$child = $this->get404Page();
}

View File

@ -106,6 +106,10 @@ class ErrorPage extends Page {
* Controller for ErrorPages.
*/
class ErrorPage_Controller extends Page_Controller {
public function init() {
parent::init();
Director::set_status_code($this->failover->ErrorCode ? $this->failover->ErrorCode : 404);
}
}