diff --git a/lib/functions/filedir/function.makeSecurePath.php b/lib/functions/filedir/function.makeSecurePath.php index 8e7b14cc..c46a693f 100644 --- a/lib/functions/filedir/function.makeSecurePath.php +++ b/lib/functions/filedir/function.makeSecurePath.php @@ -24,9 +24,8 @@ * @return string The corrected path * @author Florian Lippert */ +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; }