@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+15 -13
+3 -3
src/applications/phame/application/PhabricatorPhameApplication.php
··· 42 42 43 43 // NOTE: The live routes include an initial "/", so leave it off 44 44 // this route. 45 - '(?P<live>live)/(?P<blogID>[^/]+)' => $this->getLiveRoutes(), 45 + '(?P<live>live)/(?P<blogID>\d+)' => $this->getLiveRoutes(), 46 46 'post/' => array( 47 47 '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController', 48 48 'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController', ··· 61 61 '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhameBlogListController', 62 62 'archive/(?P<id>[^/]+)/' => 'PhameBlogArchiveController', 63 63 'edit/(?P<id>[^/]+)/' => 'PhameBlogEditController', 64 - 'view/(?P<blogID>[^/]+)/' => 'PhameBlogViewController', 64 + 'view/(?P<blogID>\d+)/' => 'PhameBlogViewController', 65 65 'manage/(?P<id>[^/]+)/' => 'PhameBlogManageController', 66 66 'feed/(?P<id>[^/]+)/' => 'PhameBlogFeedController', 67 67 'new/' => 'PhameBlogEditController', ··· 92 92 return array( 93 93 '/' => array( 94 94 '' => 'PhameBlogViewController', 95 - 'post/(?P<id>[^/]+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController', 95 + 'post/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController', 96 96 ), 97 97 ); 98 98 }
+12 -10
src/applications/phame/controller/PhameLiveController.php
··· 163 163 164 164 $crumbs->setBorder(true); 165 165 166 - if ($post) { 167 - if ($is_live) { 168 - if ($is_external) { 169 - $blog_uri = $blog->getExternalLiveURI(); 166 + if ($blog) { 167 + if ($post) { 168 + if ($is_live) { 169 + if ($is_external) { 170 + $blog_uri = $blog->getExternalLiveURI(); 171 + } else { 172 + $blog_uri = $blog->getInternalLiveURI(); 173 + } 170 174 } else { 171 - $blog_uri = $blog->getInternalLiveURI(); 175 + $blog_uri = $blog->getViewURI(); 172 176 } 173 177 } else { 174 - $blog_uri = $blog->getViewURI(); 178 + $blog_uri = null; 175 179 } 176 - } else { 177 - $blog_uri = null; 180 + 181 + $crumbs->addTextCrumb($blog->getName(), $blog_uri); 178 182 } 179 - 180 - $crumbs->addTextCrumb($blog->getName(), $blog_uri); 181 183 182 184 if ($post) { 183 185 $crumbs->addTextCrumb($post->getTitle());