mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-12 00:26:13 +01:00
03e54afc14
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
43 lines
863 B
PHP
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();
|
|
}
|
|
|
|
}
|