]> source.dussan.org Git - nextcloud-server.git/commitdiff
DAV: Use fileinfo_cache for ETag
authorMarkus Goetz <markus@woboq.com>
Wed, 2 Oct 2013 14:47:21 +0000 (16:47 +0200)
committerMarkus Goetz <markus@woboq.com>
Thu, 3 Oct 2013 15:09:08 +0000 (17:09 +0200)
lib/private/connector/sabre/node.php

index 29b7f9e53a5ba8d569e6ce0762e28e47360ca6e6..e65ad7b8bef6d643f5c17bacbd814260203b784f 100644 (file)
@@ -207,7 +207,14 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                        while( $row = $result->fetchRow()) {
                                $this->property_cache[$row['propertyname']] = $row['propertyvalue'];
                        }
-                       $this->property_cache[self::GETETAG_PROPERTYNAME] = $this->getETagPropertyForPath($this->path);
+
+                       // Don't call the static getETagPropertyForPath, its result is not cached
+                       $this->getFileinfoCache();
+                       if ($this->fileinfo_cache['etag']) {
+                               $this->property_cache[self::GETETAG_PROPERTYNAME] = '"'.$this->fileinfo_cache['etag'].'"';
+                       } else {
+                               $this->property_cache[self::GETETAG_PROPERTYNAME] = null;
+                       }
                }
 
                // if the array was empty, we need to return everything