slightly shorter regexp for OptimizedImage.safe_path?

This commit is contained in:
Régis Hanol 2017-01-02 16:28:14 +01:00
parent d8be3e8bb1
commit c4552ef8c1
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ class OptimizedImage < ActiveRecord::Base
# this matches instructions which call #to_s
path = path.to_s
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
end