fix escaping of spaces in dir/filename

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-04-06 18:57:49 +02:00
parent 3f738f6ecd
commit 090d4a6835

View File

@@ -24,9 +24,8 @@
* @return string The corrected path
* @author Florian Lippert <flo@syscp.org>
*/
function makeSecurePath($path) {
function makeSecurePath($path)
{
$search = Array(
'#/+#',
'#\.+#',
@@ -38,6 +37,9 @@ function makeSecurePath($path)
''
);
$path = preg_replace($search, $replace, $path);
// don't just replace a space with an escaped space
// it might be escaped already
$path = str_replace("\ ", " ", $path);
$path = str_replace(" ", "\ ", $path);
return $path;
}