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
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' }
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