From c7397495c69bd96be34dd1ae7dbf88573e6933c2 Mon Sep 17 00:00:00 2001 From: jamsinclair Date: Thu, 29 Nov 2018 16:50:14 +0900 Subject: [PATCH] Escape pathnames for shell command - Allows spaces and special chars to be used with site path namespaces --- lib/wraith/compare_images.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wraith/compare_images.rb b/lib/wraith/compare_images.rb index dd78088e..fd89f5a1 100644 --- a/lib/wraith/compare_images.rb +++ b/lib/wraith/compare_images.rb @@ -31,7 +31,7 @@ def percentage(img_size, px_value, info) end def compare_task(base, compare, output, info) - cmdline = "compare -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base} #{compare.shellescape} #{output}" + cmdline = "compare -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base.shellescape} #{compare.shellescape} #{output.shellescape}" px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f begin img_size = ImageSize.path(output).size.inject(:*)