Merge pull request #299 from owncloud/fix-non-root-public-link
Use getPath instead of shareInfo
This commit is contained in:
commit
8295b9fc3f
@ -153,11 +153,13 @@ class File {
|
|||||||
$rootLinkItem = \OCP\Share::resolveReShare($this->sharing[0]);
|
$rootLinkItem = \OCP\Share::resolveReShare($this->sharing[0]);
|
||||||
if (isset($rootLinkItem['uid_owner'])){
|
if (isset($rootLinkItem['uid_owner'])){
|
||||||
$owner = $rootLinkItem['uid_owner'];
|
$owner = $rootLinkItem['uid_owner'];
|
||||||
|
\OCP\JSON::checkUserExists($rootLinkItem['uid_owner']);
|
||||||
|
\OC_Util::tearDownFS();
|
||||||
|
\OC_Util::setupFS($rootLinkItem['uid_owner']);
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception($this->fileId . ' is a broken share');
|
throw new \Exception($this->fileId . ' is a broken share');
|
||||||
}
|
}
|
||||||
$view = new View('/' . $owner . '/files');
|
$view = new View('/' . $owner . '/files');
|
||||||
$path = $rootLinkItem['file_target'];
|
|
||||||
} else {
|
} else {
|
||||||
$owner = \OCP\User::getUser();
|
$owner = \OCP\User::getUser();
|
||||||
$root = '/' . $owner;
|
$root = '/' . $owner;
|
||||||
@ -165,9 +167,9 @@ class File {
|
|||||||
$root .= '/' . 'files';
|
$root .= '/' . 'files';
|
||||||
}
|
}
|
||||||
$view = new View($root);
|
$view = new View($root);
|
||||||
$path = $view->getPath($this->fileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$path = $view->getPath($this->fileId);
|
||||||
if (!$path){
|
if (!$path){
|
||||||
throw new \Exception($this->fileId . ' can not be resolved');
|
throw new \Exception($this->fileId . ' can not be resolved');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user