Merge pull request #1533 from nextcloud/stable10-redo-1517

[stable10] Only use realpath for real directories (#26060)
This commit is contained in:
Morris Jobke 2016-09-28 22:01:29 +02:00 committed by GitHub
commit 43aa114169
1 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,12 @@ class Local extends \OC\Files\Storage\Common {
throw new \InvalidArgumentException('No data directory set for local storage');
}
$this->datadir = $arguments['datadir'];
// some crazy code uses a local storage on root...
if ($this->datadir === '/') {
$this->realDataDir = $this->datadir;
} else {
$this->realDataDir = rtrim(realpath($this->datadir), '/') . '/';
}
if (substr($this->datadir, -1) !== '/') {
$this->datadir .= '/';
}