Fix resolve path

This commit is contained in:
Roeland Jago Douma 2016-04-15 12:40:15 +02:00
parent 92abb5f23d
commit c98fef8a51
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
3 changed files with 8 additions and 15 deletions

View File

@ -45,8 +45,7 @@ class SharedScanner extends Scanner {
if ($data === null) {
return null;
}
$sourcePath = '/' . $this->storage->getOwner($path) . '/' . $this->storage->getSourcePath($path);
list($sourceStorage, $internalPath) = \OC\Files\Filesystem::resolvePath($sourcePath);
list($sourceStorage, $internalPath) = $this->storage->resolvePath($path);
$data['permissions'] = $sourceStorage->getPermissions($internalPath);
return $data;
}

View File

@ -349,17 +349,6 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
return true;
}
/**
* Resolve the path for the source of the share
*
* @param string $path
* @return array
*/
public function resolvePath($path) {
$source = '/' . $this->newShare->getShareOwner() . '/' . $this->getSourcePath($path);
return \OC\Files\Filesystem::resolvePath($source);
}
/**
* @param string $path
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE

View File

@ -451,8 +451,13 @@ class Jail extends Wrapper {
$this->storage->changeLock($this->getSourcePath($path), $type, $provider);
}
/**
* Resolve the path for the source of the share
*
* @param string $path
* @return array
*/
public function resolvePath($path) {
$path = $this->getSourcePath($path);
return \OC\Files\Filesystem::resolvePath($path);
return [$this->storage, $this->getSourcePath($path)];
}
}