From 3ac550d7a11a30f17e7c3ae2c421c8d6b202dca1 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 23 Oct 2014 22:52:38 +0400 Subject: [PATCH] Updated regex for BuildList#prepare_extra_params --- app/models/build_list.rb | 2 +- spec/models/build_list_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 9d3a5301e..d608be2ad 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -748,7 +748,7 @@ class BuildList < ActiveRecord::Base params = extra_params.slice(*BuildList::EXTRA_PARAMS) params.update(params) do |k,v| v.strip.gsub(I18n.t("activerecord.attributes.build_list.extra_params.#{k}"), ''). - gsub(/[^\w\s\-["']]/, '') + gsub(/[^\w\s\-["]]/, '') end self.extra_params = params.select{ |k,v| v.present? } end diff --git a/spec/models/build_list_spec.rb b/spec/models/build_list_spec.rb index b53b01291..48a156bda 100644 --- a/spec/models/build_list_spec.rb +++ b/spec/models/build_list_spec.rb @@ -343,7 +343,7 @@ describe BuildList do it 'removes unsafe symbols' do build_list.extra_params = { 'build_rpm' => '--test \'001\' --define "cross armv7hl"{(@' } build_list.send :prepare_extra_params - expect(build_list.extra_params['build_rpm']).to eq '--test \'001\' --define "cross armv7hl"' + expect(build_list.extra_params['build_rpm']).to eq '--test 001 --define "cross armv7hl"' end end