From a0c495b953b84d90f5c87f089eaefbf310b9dfeb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Jul 2012 13:48:07 +0000 Subject: Displays thumbnails of attached images of the issue view (#1006). This behaviour can be turned on/off in Settings -> Display (off by default). Thumbnail size can be configured there too. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9933 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/utils.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/redmine/utils.rb') diff --git a/lib/redmine/utils.rb b/lib/redmine/utils.rb index 3e44b6359..cfdb4d15d 100644 --- a/lib/redmine/utils.rb +++ b/lib/redmine/utils.rb @@ -41,5 +41,15 @@ module Redmine SecureRandom.hex(n) end end + + module Shell + def shell_quote(str) + if Redmine::Platform.mswin? + '"' + str.gsub(/"/, '\\"') + '"' + else + "'" + str.gsub(/'/, "'\"'\"'") + "'" + end + end + end end end -- cgit v1.2.3