mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 05:41:39 +08:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:

committed by
GitHub

parent
f7907a3645
commit
666536cbd1
@ -473,7 +473,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def my_redirect
|
||||
raise Discourse::NotFound if params[:path] !~ %r{^[a-z_\-/]+$}
|
||||
raise Discourse::NotFound if params[:path] !~ %r{\A[a-z_\-/]+\z}
|
||||
|
||||
if current_user.blank?
|
||||
cookies[:destination_url] = path("/my/#{params[:path]}")
|
||||
|
Reference in New Issue
Block a user