diff --git a/lib/functions/filedir/function.mkDirWithCorrectOwnership.php b/lib/functions/filedir/function.mkDirWithCorrectOwnership.php index 4acc30fd..97e739ba 100644 --- a/lib/functions/filedir/function.mkDirWithCorrectOwnership.php +++ b/lib/functions/filedir/function.mkDirWithCorrectOwnership.php @@ -47,7 +47,7 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeind if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir) { - $subdir = substr($dirToCreate, strlen($homeDir)); + $subdir = substr($dirToCreate, strlen($homeDir) - 1); $within_homedir = true; } else