Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14075709
D20688.id49341.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20688.id49341.diff
View Options
diff --git a/src/applications/phame/controller/PhameLiveController.php b/src/applications/phame/controller/PhameLiveController.php
--- a/src/applications/phame/controller/PhameLiveController.php
+++ b/src/applications/phame/controller/PhameLiveController.php
@@ -93,10 +93,6 @@
->needHeaderImage(true)
->withIDs(array($post_id));
- if ($blog) {
- $post_query->withBlogPHIDs(array($blog->getPHID()));
- }
-
// Only show published posts on external domains.
if ($is_external) {
$post_query->withVisibility(
@@ -123,10 +119,15 @@
$this->post = $post;
// If we have a post, canonicalize the URI to the post's current slug and
- // redirect the user if it isn't correct.
+ // redirect the user if it isn't correct. Likewise, canonicalize the URI
+ // if the blog ID is wrong. See T13353.
if ($post) {
$slug = $request->getURIData('slug');
- if ($post->getSlug() != $slug) {
+
+ $wrong_slug = ($post->getSlug() !== $slug);
+ $wrong_blog = ($post->getBlog()->getID() !== $blog->getID());
+
+ if ($wrong_slug || $wrong_blog) {
if ($is_live) {
if ($is_external) {
$uri = $post->getExternalLiveURI();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 12:59 PM (15 h, 58 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6774843
Default Alt Text
D20688.id49341.diff (1 KB)
Attached To
Mode
D20688: When users visit a Phame post URI with an old blog ID, canonicalize the URI instead of 404'ing
Attached
Detach File
Event Timeline
Log In to Comment