1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-12 00:26:13 +01:00
phorge-phorge/src/applications/phame/site/Phame404Response.php
epriestley 03e54afc14 Give Phame blogs an explicit 404 controller
Summary:
Ref T11076. Ref T9897. Bad links on Phame blogs are currently made worse because we try to prompt you to login on a non-cookie domain.

Instead, just 404 in a vanilla way. Do so cleanly on external domains.

Test Plan: {F1672399}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897, T11076

Differential Revision: https://secure.phabricator.com/D16010
2016-06-02 09:12:21 -07:00

43 lines
863 B
PHP

<?php
final class Phame404Response extends AphrontHTMLResponse {
private $page;
public function setPage(AphrontPageView $page) {
$this->page = $page;
return $this;
}
public function getPage() {
return $this->page;
}
public function getHTTPResponseCode() {
return 404;
}
public function buildResponseString() {
require_celerity_resource('phame-css');
$not_found = phutil_tag(
'div',
array(
'class' => 'phame-404',
),
array(
phutil_tag('strong', array(), pht('404 Not Found')),
phutil_tag('br'),
pht('Wherever you go, there you are.'),
phutil_tag('br'),
pht('But the page you seek is elsewhere.'),
));
$page = $this->getPage()
->setTitle(pht('404 Not Found'))
->appendChild($not_found);
return $page->render();
}
}