mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Better 404 for Phame
Summary: "Fixes" fatals on phacility.com blog. If post_id is either `0` or any other integer not in the blog system, show a normal Phame 404 with crumbs. Test Plan: http://local.blog.phacility.com/post/0/last_published/, http://local.blog.phacility.com/post/999999/last_published/ Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16192
This commit is contained in:
parent
bf1352c0e4
commit
2b76785a13
1 changed files with 3 additions and 1 deletions
|
@ -87,7 +87,7 @@ abstract class PhameLiveController extends PhameController {
|
||||||
$this->isExternal = $is_external;
|
$this->isExternal = $is_external;
|
||||||
$this->isLive = $is_live;
|
$this->isLive = $is_live;
|
||||||
|
|
||||||
if ($post_id) {
|
if (strlen($post_id)) {
|
||||||
$post_query = id(new PhamePostQuery())
|
$post_query = id(new PhamePostQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($post_id));
|
->withIDs(array($post_id));
|
||||||
|
@ -104,6 +104,8 @@ abstract class PhameLiveController extends PhameController {
|
||||||
|
|
||||||
$post = $post_query->executeOne();
|
$post = $post_query->executeOne();
|
||||||
if (!$post) {
|
if (!$post) {
|
||||||
|
// Not a valid Post
|
||||||
|
$this->blog = $blog;
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue