FIX: Don't use backticks that take in inputs.

This commit is contained in:
Guo Xiang Tan
2017-03-17 14:21:30 +08:00
parent b49bf889f6
commit e7c972ac89
11 changed files with 51 additions and 57 deletions

View File

@ -215,8 +215,7 @@ class OptimizedImage < ActiveRecord::Base
end
def self.convert_with(instructions, to)
`#{instructions.join(" ")} &> /dev/null`
return false if $?.exitstatus != 0
return false unless system(instructions.join(" "), '&> /dev/null')
ImageOptim.new.optimize_image!(to)
true