From b62699707d275d1bf349587030ccd4e77d9052e8 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 10 Sep 2014 18:10:27 -0700 Subject: [PATCH] FIX: Unknown /posts/id.json should 404 --- app/controllers/posts_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 410898bb9cf..0b6684019fc 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -382,6 +382,7 @@ class PostsController < ApplicationController # Include deleted posts if the user is staff finder = finder.with_deleted if current_user.try(:staff?) post = finder.first + raise Discourse::NotFound unless post # load deleted topic post.topic = Topic.with_deleted.find(post.topic_id) if current_user.try(:staff?) guardian.ensure_can_see!(post)