404 older-style Phame URIs properly
Summary: Ref T9968. Some of the crumb/route handling wasn't quite tight enough and could hit a fatal. Test Plan: Hit previously-fataling URI, got a 404 instead. Reviewers: chad Reviewed By: chad Subscribers: starruler Maniphest Tasks: T9968 Differential Revision: https://secure.phabricator.com/D14747
This commit is contained in:
@@ -42,7 +42,7 @@ final class PhabricatorPhameApplication extends PhabricatorApplication {
|
|||||||
|
|
||||||
// NOTE: The live routes include an initial "/", so leave it off
|
// NOTE: The live routes include an initial "/", so leave it off
|
||||||
// this route.
|
// this route.
|
||||||
'(?P<live>live)/(?P<blogID>[^/]+)' => $this->getLiveRoutes(),
|
'(?P<live>live)/(?P<blogID>\d+)' => $this->getLiveRoutes(),
|
||||||
'post/' => array(
|
'post/' => array(
|
||||||
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController',
|
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController',
|
||||||
'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController',
|
'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController',
|
||||||
@@ -61,7 +61,7 @@ final class PhabricatorPhameApplication extends PhabricatorApplication {
|
|||||||
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhameBlogListController',
|
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhameBlogListController',
|
||||||
'archive/(?P<id>[^/]+)/' => 'PhameBlogArchiveController',
|
'archive/(?P<id>[^/]+)/' => 'PhameBlogArchiveController',
|
||||||
'edit/(?P<id>[^/]+)/' => 'PhameBlogEditController',
|
'edit/(?P<id>[^/]+)/' => 'PhameBlogEditController',
|
||||||
'view/(?P<blogID>[^/]+)/' => 'PhameBlogViewController',
|
'view/(?P<blogID>\d+)/' => 'PhameBlogViewController',
|
||||||
'manage/(?P<id>[^/]+)/' => 'PhameBlogManageController',
|
'manage/(?P<id>[^/]+)/' => 'PhameBlogManageController',
|
||||||
'feed/(?P<id>[^/]+)/' => 'PhameBlogFeedController',
|
'feed/(?P<id>[^/]+)/' => 'PhameBlogFeedController',
|
||||||
'new/' => 'PhameBlogEditController',
|
'new/' => 'PhameBlogEditController',
|
||||||
@@ -92,7 +92,7 @@ final class PhabricatorPhameApplication extends PhabricatorApplication {
|
|||||||
return array(
|
return array(
|
||||||
'/' => array(
|
'/' => array(
|
||||||
'' => 'PhameBlogViewController',
|
'' => 'PhameBlogViewController',
|
||||||
'post/(?P<id>[^/]+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
|
'post/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,21 +163,23 @@ abstract class PhameLiveController extends PhameController {
|
|||||||
|
|
||||||
$crumbs->setBorder(true);
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
if ($post) {
|
if ($blog) {
|
||||||
if ($is_live) {
|
if ($post) {
|
||||||
if ($is_external) {
|
if ($is_live) {
|
||||||
$blog_uri = $blog->getExternalLiveURI();
|
if ($is_external) {
|
||||||
|
$blog_uri = $blog->getExternalLiveURI();
|
||||||
|
} else {
|
||||||
|
$blog_uri = $blog->getInternalLiveURI();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$blog_uri = $blog->getInternalLiveURI();
|
$blog_uri = $blog->getViewURI();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$blog_uri = $blog->getViewURI();
|
$blog_uri = null;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$blog_uri = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$crumbs->addTextCrumb($blog->getName(), $blog_uri);
|
$crumbs->addTextCrumb($blog->getName(), $blog_uri);
|
||||||
|
}
|
||||||
|
|
||||||
if ($post) {
|
if ($post) {
|
||||||
$crumbs->addTextCrumb($post->getTitle());
|
$crumbs->addTextCrumb($post->getTitle());
|
||||||
|
|||||||
Reference in New Issue
Block a user