Updated regex for BuildList#prepare_extra_params
This commit is contained in:
parent
e4f5af6707
commit
3ac550d7a1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue