mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 11:32:11 +08:00
FIX: Category.find_by_slug
find_by_slug should ensure that the parent actually exists when its looking for a parent.
This commit is contained in:
@ -206,6 +206,9 @@ class CategoriesController < ApplicationController
|
||||
def find_by_slug
|
||||
params.require(:category_slug)
|
||||
@category = Category.find_by_slug(params[:category_slug], params[:parent_category_slug])
|
||||
|
||||
raise Discourse::NotFound unless @category.present?
|
||||
|
||||
if !guardian.can_see?(@category)
|
||||
if SiteSetting.detailed_404 && group = @category.access_category_via_group
|
||||
raise Discourse::InvalidAccess.new(
|
||||
|
Reference in New Issue
Block a user