trim path before checking, fixes #927

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-04-04 16:10:17 +02:00
parent faa8169964
commit 95efc2f3a7

View File

@@ -25,18 +25,16 @@
* @author Florian Lippert <flo@syscp.org>
*/
function makeCorrectDir($dir)
{
if(substr($dir, -1, 1) != '/')
{
function makeCorrectDir($dir) {
$dir = trim($dir);
if (substr($dir, -1, 1) != '/') {
$dir.= '/';
}
if(substr($dir, 0, 1) != '/')
{
if (substr($dir, 0, 1) != '/') {
$dir = '/' . $dir;
}
$dir = makeSecurePath($dir);
return $dir;
}