mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix a case when the wrong topic is loaded because the slug starts with a number
This commit is contained in:
@@ -111,8 +111,8 @@ class ListController < ApplicationController
|
||||
private
|
||||
|
||||
def set_category
|
||||
category_slug = params.fetch(:category)
|
||||
@category = Category.where("slug = ? or id = ?", category_slug, category_slug.to_i).includes(:featured_users).first
|
||||
slug = params.fetch(:category)
|
||||
@category = Category.where("slug = ?", slug).includes(:featured_users).first || Category.where("id = ?", slug.to_i).includes(:featured_users).first
|
||||
end
|
||||
|
||||
def request_is_for_uncategorized?
|
||||
|
||||
Reference in New Issue
Block a user