Commit 6f99a5b5 authored by Cool Fire's avatar Cool Fire
Browse files

Use .start_with rather than constructing a regex

parent 91da09ba
Pipeline #2647 passed with stage
in 1 minute and 35 seconds
...@@ -126,7 +126,7 @@ class Manager2Api < Sinatra::Base ...@@ -126,7 +126,7 @@ class Manager2Api < Sinatra::Base
end end
if params.key? 'documentroot' if params.key? 'documentroot'
unless params['documentroot'].match?(%r{^/home/#{params['username']}/}) unless params['documentroot'].start_with?("/home/#{params['username']}/")
halt erb :error, locals: { code: 400, message: 'Documentroot cannot be outside of users home' } halt erb :error, locals: { code: 400, message: 'Documentroot cannot be outside of users home' }
end end
data[params['username']]['properties']['apache_vhosts']\ data[params['username']]['properties']['apache_vhosts']\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment