Prevent error if previously cached data doesn't have an etag

This commit is contained in:
Robin Appelman 2014-04-22 15:24:38 +02:00
parent 3821a09689
commit b42ce6c30a
2 changed files with 5 additions and 3 deletions

View File

@ -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) {

View File

@ -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']) {