Commit bb4a0279

mo khan <mo@mokhan.ca>
2014-07-16 18:15:57
downcase pathname before whitelist check.
1 parent 21f8493
Changed files (1)
app
services
infrastructure
app/services/infrastructure/image.rb
@@ -95,7 +95,7 @@ class Image
   end
 
   def ensure_in_whitelist!(path)
-    unless %w(.jpg .jpeg .gif .png .bmp .tif).include?(File.extname(path))
+    unless %w(.jpg .jpeg .gif .png .bmp .tif).include?(File.extname(path).downcase)
       raise StandardError.new("This file is not in the whitelist. #{path}")
     end
   end