mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-26 09:53:20 +01:00
"fix concat to allow filenames containing \"..\""
This commit is contained in:
parent
3927555c22
commit
cc9d7445c3
@ -1004,14 +1004,12 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
$url = ($relative === '' || $relative[0] == '/' ? $url.$relative : $url.'/'.$relative);
|
||||
|
||||
// now normalize the path (remove "/something/..")
|
||||
while (strpos($url,'..') !== false)
|
||||
while (strpos($url,'/../') !== false)
|
||||
{
|
||||
list($a,$b) = explode('..',$url,2);
|
||||
list($a,$b) = explode('/../',$url,2);
|
||||
$a = explode('/',$a);
|
||||
array_pop($a);
|
||||
array_pop($a);
|
||||
$b = explode('/',$b);
|
||||
if ($b[0] === '') array_shift($b);
|
||||
$url = implode('/',array_merge($a,$b));
|
||||
}
|
||||
return $url.($query ? '?'.$query : '');
|
||||
|
Loading…
Reference in New Issue
Block a user