Page MenuHomePhabricator

D20688.id49341.diff
No OneTemporary

D20688.id49341.diff

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

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)

Event Timeline