Skip to content

Commit

Permalink
Fixing UPDATE error in filecache table when renaming files by calling…
Browse files Browse the repository at this point in the history
… move(). Add storage id to the where clause to avoid updating entries of other users.
  • Loading branch information
Roland Hager authored and Michael Gapczynski committed May 25, 2013
1 parent faad2d0 commit 07fb230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/files/cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ public function move($source, $target) {

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` = ?');
Expand Down

0 comments on commit 07fb230

Please sign in to comment.