rename $shareFilePath to $path to avoid confusions, it is not about paths to share files but about general path to files stored in ownCloud
This commit is contained in:
parent
40905c8941
commit
1df36e0c88
1 changed files with 8 additions and 8 deletions
|
@ -909,19 +909,19 @@ class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get uid of the owners of the file and the path to the file
|
* @brief get uid of the owners of the file and the path to the file
|
||||||
* @param $shareFilePath Path of the file to check
|
* @param $path Path of the file to check
|
||||||
* @note $shareFilePath must be relative to data/UID/files. Files
|
* @note $shareFilePath must be relative to data/UID/files. Files
|
||||||
* relative to /Shared are also acceptable
|
* relative to /Shared are also acceptable
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getUidAndFilename( $shareFilePath ) {
|
public function getUidAndFilename( $path ) {
|
||||||
|
|
||||||
$fileOwnerUid = \OC\Files\Filesystem::getOwner( $shareFilePath );
|
$fileOwnerUid = \OC\Files\Filesystem::getOwner( $path );
|
||||||
|
|
||||||
// Check that UID is valid
|
// Check that UID is valid
|
||||||
if ( ! \OCP\User::userExists( $fileOwnerUid ) ) {
|
if ( ! \OCP\User::userExists( $fileOwnerUid ) ) {
|
||||||
|
|
||||||
throw new \Exception( 'Could not find owner (UID = "' . var_export( $fileOwnerUid, 1 ) . '") of file "' . $shareFilePath . '"' );
|
throw new \Exception( 'Could not find owner (UID = "' . var_export( $fileOwnerUid, 1 ) . '") of file "' . $path . '"' );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,11 +932,11 @@ class Util {
|
||||||
if ( $fileOwnerUid == $this->userId ) {
|
if ( $fileOwnerUid == $this->userId ) {
|
||||||
|
|
||||||
// Assume the path supplied is correct
|
// Assume the path supplied is correct
|
||||||
$filename = $shareFilePath;
|
$filename = $path;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$info = \OC\Files\Filesystem::getFileInfo( $shareFilePath );
|
$info = \OC\Files\Filesystem::getFileInfo( $path );
|
||||||
$ownerView = new \OC\Files\View( '/' . $fileOwnerUid . '/files' );
|
$ownerView = new \OC\Files\View( '/' . $fileOwnerUid . '/files' );
|
||||||
|
|
||||||
// Fetch real file path from DB
|
// Fetch real file path from DB
|
||||||
|
@ -954,7 +954,7 @@ class Util {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
throw new \Exception( 'Supplied path could not be resolved "' . $shareFilePath . '"' );
|
throw new \Exception( 'Supplied path could not be resolved "' . $path . '"' );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue