mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 22:26:26 +08:00
11 lines
220 B
Ruby
11 lines
220 B
Ruby
module WildcardUrlChecker
|
|
|
|
def self.check_url(url, url_to_check)
|
|
escaped_url = Regexp.escape(url).sub("\\*", '\S*')
|
|
url_regex = Regexp.new("^#{escaped_url}$", 'i')
|
|
|
|
url_to_check.match(url_regex)
|
|
end
|
|
|
|
end
|