mirror of https://github.com/digint/btrbk
btrbk: sanitize url on PRINT
For consistency with PATH and URL, $vol->{PRINT} was not sanitized (trailing "//" if parent is "/"). This is now dropped, as this is more confusing than useful.pull/334/head
parent
936f88a68f
commit
c11ab1507d
4
btrbk
4
btrbk
|
@ -2446,6 +2446,7 @@ sub vinfo($$)
|
|||
}
|
||||
}
|
||||
|
||||
# Note that PATH and URL have no trailing slash, except if "/".
|
||||
return {
|
||||
HOST => $host, # hostname|<undef>
|
||||
PORT => $port, # port|<undef>
|
||||
|
@ -2470,13 +2471,12 @@ sub vinfo_child($$;$)
|
|||
$subvol_dir = $1 if($name =~ s/^(.*)\///);
|
||||
|
||||
# Note that PATH and URL intentionally contain "//" if $parent->{PATH} = "/".
|
||||
# For consistency reasons (not required), we dont sanitize PRINT either.
|
||||
my $vinfo = {
|
||||
HOST => $parent->{HOST},
|
||||
PORT => $parent->{PORT},
|
||||
NAME => $name,
|
||||
PATH => "$parent->{PATH}/$rel_path",
|
||||
PRINT => "$parent->{PRINT}/$rel_path",
|
||||
PRINT => "$parent->{PRINT}" . ($parent->{PRINT} =~ /\/$/ ? "" : "/") . $rel_path,
|
||||
URL => "$parent->{URL}/$rel_path",
|
||||
URL_PREFIX => $parent->{URL_PREFIX},
|
||||
MACHINE_ID => $parent->{MACHINE_ID},
|
||||
|
|
Loading…
Reference in New Issue