1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1841 from turingmachine/patch-1

quote data in regex
This commit is contained in:
Dan Peterson 2013-05-29 04:54:28 -07:00
commit c716044ed3

View file

@ -31,7 +31,7 @@ module Fog
dc_root_folder = dc.vmFolder dc_root_folder = dc.vmFolder
# Filter the root path for this datacenter not to be used." # Filter the root path for this datacenter not to be used."
dc_root_folder_path=dc_root_folder.path.map { | id, name | name }.join("/") dc_root_folder_path=dc_root_folder.path.map { | id, name | name }.join("/")
paths = path.sub(/^\/?#{dc_root_folder_path}\/?/, '').split('/') paths = path.sub(/^\/?#{Regex.quote(dc_root_folder_path)}\/?/, '').split('/')
return dc_root_folder if paths.empty? return dc_root_folder if paths.empty?
# Walk the tree resetting the folder pointer as we go # Walk the tree resetting the folder pointer as we go