Fixing UPDATE error in filecache table when renaming files by calling move(). Add storage id to the where clause to avoid updating entries of other users.

remotes/origin/stable6
Roland Hager 13 years ago
parent d590064fdf
commit 2ea2abf11e
  1. 4
      lib/files/cache/cache.php

@ -335,8 +335,8 @@ class Cache {
if ($sourceData['mimetype'] === 'httpd/unix-directory') {
//find all child entries
$query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?');
$result = $query->execute(array($source . '/%'));
$query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path` LIKE ?');
$result = $query->execute(array($this->getNumericStorageId(), $source . '/%'));
$childEntries = $result->fetchAll();
$sourceLength = strlen($source);
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');

Loading…
Cancel
Save