mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
slightly shorter regexp for OptimizedImage.safe_path?
This commit is contained in:
parent
d8be3e8bb1
commit
c4552ef8c1
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ class OptimizedImage < ActiveRecord::Base
|
||||||
# this matches instructions which call #to_s
|
# this matches instructions which call #to_s
|
||||||
path = path.to_s
|
path = path.to_s
|
||||||
return false if path != File.expand_path(path)
|
return false if path != File.expand_path(path)
|
||||||
return false if path !~ /\A[_\-a-zA-Z0-9\.\/]+\z/m
|
return false if path !~ /\A[\w\-\.\/]+\z/m
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue