mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-02 14:18:46 +02:00
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:
parent
27c70de07e
commit
6921b5e1c1
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user