summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-04-22 15:24:38 +0200
committerRobin Appelman <icewind@owncloud.com>2014-04-22 15:24:38 +0200
commitb42ce6c30a214c7089a84eb9c22c0bd576a15fe7 (patch)
tree7073f5cca5574570407a5fcfdd597f1db57efde5
parent3821a0968950c7320ed9bfa60a5c347060eaff0a (diff)
downloadnextcloud-server-b42ce6c30a214c7089a84eb9c22c0bd576a15fe7.tar.gz
nextcloud-server-b42ce6c30a214c7089a84eb9c22c0bd576a15fe7.zip
Prevent error if previously cached data doesn't have an etag
-rwxr-xr-xapps/files_encryption/tests/webdav.php1
-rw-r--r--lib/private/files/cache/scanner.php7
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index 1f23be3e79a..1fe4c13d59e 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -247,6 +247,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
$server->addPlugin(new OC_Connector_Sabre_QuotaPlugin($view));
$server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin());
+ $server->debugExceptions = true;
// And off we go!
if ($body) {
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 79159724d16..c0bdde06a75 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -115,11 +115,12 @@ class Scanner extends BasicEmitter {
}
if ($reuseExisting) {
// prevent empty etag
- $etag = $cacheData['etag'];
- $propagateETagChange = false;
- if (empty($etag)) {
+ if (empty($cacheData['etag'])) {
$etag = $data['etag'];
$propagateETagChange = true;
+ } else {
+ $etag = $cacheData['etag'];
+ $propagateETagChange = false;
}
// only reuse data if the file hasn't explicitly changed
if (isset($data['storage_mtime']) && isset($cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) {