aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-03-25 21:46:50 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-03-27 19:19:16 +0100
commit2a2d409733dfb339dac49cfdddc2a627d4e5d581 (patch)
tree18c89c35530027dfa4de2586e5317a17c5500542
parent1d676fb0e63ce7bd2a303335fc9dd484846d91f8 (diff)
downloadnextcloud-server-2a2d409733dfb339dac49cfdddc2a627d4e5d581.tar.gz
nextcloud-server-2a2d409733dfb339dac49cfdddc2a627d4e5d581.zip
Only prepare an SQL statement once.
-rw-r--r--lib/files/cache/legacy.php5
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'], '"');