diff options
-rw-r--r-- | lib/files/cache/legacy.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php index ddee75e972b..f114cf0c837 100644 --- a/lib/files/cache/legacy.php +++ b/lib/files/cache/legacy.php @@ -91,11 +91,14 @@ class Legacy { * @return string */ function getEtag($path) { + static $query = null; list(, $user, , $relativePath) = explode('/', $path, 4); if (is_null($relativePath)) { $relativePath = ''; } - $query = \OC_DB::prepare('SELECT `propertyvalue` FROM `*PREFIX*properties` WHERE `userid` = ? AND propertypath = ? AND propertyname = "{DAV:}getetag"'); + if(is_null($query)){ + $query = \OC_DB::prepare('SELECT `propertyvalue` FROM `*PREFIX*properties` WHERE `userid` = ? AND propertypath = ? AND propertyname = "{DAV:}getetag"'); + } $result = $query->execute(array($user, '/' . $relativePath)); if ($row = $result->fetchRow()) { return trim($row['propertyvalue'], '"'); |