\r
/**\r
* @brief mark file as renamed so that we know the original source after the file was renamed\r
- * @param string $path\r
+ * @param array $params with the old path and the new path\r
*/\r
public static function preRename($params) {\r
$util = new Util(new \OC_FilesystemView('/'), \OCP\User::getUser());\r
$userId = \OCP\User::getUser();\r
$util = new Util($view, $userId);\r
\r
- $ownerOld = self::$renamedFiles[$params['oldpath']]['uid'];\r
- $pathOld = self::$renamedFiles[$params['oldpath']]['path'];\r
+ if (isset(self::$renamedFiles[$params['oldpath']]['uid']) &&\r
+ isset(self::$renamedFiles[$params['oldpath']]['path'])) {\r
+ $ownerOld = self::$renamedFiles[$params['oldpath']]['uid'];\r
+ $pathOld = self::$renamedFiles[$params['oldpath']]['path'];\r
+ } else {\r
+ \OCP\Util::writeLog('Encryption library', "can't get path and owner from the file before it was renamed", \OCP\Util::ERROR);\r
+ return false;\r
+ }\r
+\r
list($ownerNew, $pathNew) = $util->getUidAndFilename($params['newpath']);\r
\r
// Format paths to be relative to user files dir\r