Prevent error if previously cached data doesn't have an etag
This commit is contained in:
parent
3821a09689
commit
b42ce6c30a
|
@ -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) {
|
||||
|
|
|
@ -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']) {
|
||||
|
|
Loading…
Reference in New Issue