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

committed by
GitHub

parent
f7907a3645
commit
666536cbd1
@ -50,7 +50,7 @@ class AdminUserIndexQuery
|
||||
|
||||
custom_order = params[:order]
|
||||
if custom_order.present? &&
|
||||
without_dir = SORTABLE_MAPPING[custom_order.downcase.sub(/ (asc|desc)$/, "")]
|
||||
without_dir = SORTABLE_MAPPING[custom_order.downcase.sub(/ (asc|desc)\z/, "")]
|
||||
order << "#{without_dir} #{custom_direction}"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user