summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/files/cache/upgrade.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php
index 4d98abb2f8d..811d82d7437 100644
--- a/lib/files/cache/upgrade.php
+++ b/lib/files/cache/upgrade.php
@@ -82,15 +82,9 @@ class Upgrade {
* @return bool
*/
function inCache($storage, $pathHash, $id) {
- $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?');
- $result = $query->execute(array($storage, $pathHash));
- if ($result->fetchRow()) {
- return true;
- } else {
- $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` = ?');
- $result = $query->execute(array($id));
- return (bool)$result->fetchRow();
- }
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = ? AND `path_hash` = ?) OR `fileid` = ?');
+ $result = $query->execute(array($storage, $pathHash, $id));
+ return (bool)$result->fetchRow();
}
/**