diff --git a/core/model/RedirectorPage.php b/core/model/RedirectorPage.php index 5bd025c7c..a5dcab223 100755 --- a/core/model/RedirectorPage.php +++ b/core/model/RedirectorPage.php @@ -111,21 +111,24 @@ class RedirectorPage_Controller extends Page_Controller { if($this->RedirectionType == 'External') { if($this->ExternalURL) { Director::redirect($this->ExternalURL); - } else { - echo "

" . - _t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') . - "

"; } } else { $linkTo = DataObject::get_by_id("SiteTree", $this->LinkToID); if($linkTo) { Director::redirect($linkTo->Link(), 301); - } else { - echo "

" . _t('RedirectorPage.HASBEENSETUP') . "

"; } } parent::init(); } + + /** + * If we ever get this far, it means that the redirection failed. + */ + function index() { + return "

" . + _t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') . + "

"; + } } ?> \ No newline at end of file