mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 12:38:21 -05:00
Move logic to reject slugs that are just numbers into the slug module
This commit is contained in:
+2
-1
@@ -6,7 +6,8 @@
|
||||
module Slug
|
||||
|
||||
def self.for(string)
|
||||
string.parameterize.gsub("_", "-")
|
||||
slug = string.parameterize.gsub("_", "-")
|
||||
slug =~ /[^\d]/ ? slug : '' # Reject slugs that only contain numbers, because they would be indistinguishable from id's.
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user