mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:
committed by
GitHub
parent
f7907a3645
commit
666536cbd1
@@ -83,7 +83,7 @@ class TopicsController < ApplicationController
|
||||
|
||||
# Special case: a slug with a number in front should look by slug first before looking
|
||||
# up that particular number
|
||||
if params[:id] && params[:id] =~ /^\d+[^\d\\]+$/
|
||||
if params[:id] && params[:id] =~ /\A\d+[^\d\\]+\z/
|
||||
topic = Topic.find_by_slug(params[:id])
|
||||
return redirect_to_correct_topic(topic, opts[:post_number]) if topic
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user