summaryrefslogtreecommitdiff
path: root/spec/models/wiki_page_spec.rb
diff options
context:
space:
mode:
authorNigel Kukard <nkukard@lbsd.net>2013-11-04 22:06:27 +0000
committerNigel Kukard <nkukard@lbsd.net>2013-11-04 22:09:03 +0000
commitc46eaca91247ccf8e6fb3b691dad028e1b084ae3 (patch)
treefaed085ef880760223d9b702ed7399fe84062b83 /spec/models/wiki_page_spec.rb
parentee0e9830c1c1e4c54fd0b18fadef50f76c3680a4 (diff)
downloadgitlab-ce-c46eaca91247ccf8e6fb3b691dad028e1b084ae3.tar.gz
More escaping
- Database name may contain characters which are not shell friendly - Database password could contain the same - While we at it there is no harm in escaping generated paths too - Refactored 2-line system(command) Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r--spec/models/wiki_page_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index 67f2a6da42d..b9883342c3a 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -1,11 +1,11 @@
require "spec_helper"
+require "shellwords"
describe WikiPage do
def create_temp_repo(path)
FileUtils.mkdir_p path
- command = "git init --quiet #{path};"
- system(command)
+ system("git init --quiet #{Shellwords.shellescape(path)}")
end
def remove_temp_repo(path)