diff options
5 files changed, 8 insertions, 8 deletions
diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php index 4d33367b345..614ddabb7ef 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php @@ -76,7 +76,7 @@ class AppleProvisioningNode implements INode, IProperties { return [ '{DAV:}getcontentlength' => 42, - '{DAV:}getlastmodified' => $datetime->format(\DateTime::RFC2822), + '{DAV:}getlastmodified' => $datetime->format(\DateTimeInterface::RFC2822), ]; } diff --git a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php index dd3f202b6c1..4ebdf10f403 100644 --- a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php +++ b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php @@ -46,7 +46,7 @@ class NotModifiedMiddleware extends Middleware { } $modifiedSinceHeader = $this->request->getHeader('IF_MODIFIED_SINCE'); - if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTime::RFC2822)) { + if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC2822)) { $response->setStatus(Http::STATUS_NOT_MODIFIED); return $response; } diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php index ec2e6bbe3ac..1e5ef697835 100644 --- a/lib/private/Files/ObjectStore/S3Signature.php +++ b/lib/private/Files/ObjectStore/S3Signature.php @@ -129,7 +129,7 @@ class S3Signature implements SignatureInterface { ) { $modify = [ 'remove_headers' => ['X-Amz-Date'], - 'set_headers' => ['Date' => gmdate(\DateTime::RFC2822)] + 'set_headers' => ['Date' => gmdate(\DateTimeInterface::RFC2822)] ]; // Add the security token header if one is being used by the credentials diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index e28fa0b2c81..ee10d483b25 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -115,7 +115,7 @@ class Response { $time = \OC::$server->query(ITimeFactory::class); $expires->setTimestamp($time->getTime()); $expires->add(new \DateInterval('PT'.$cacheSeconds.'S')); - $this->addHeader('Expires', $expires->format(\DateTime::RFC2822)); + $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); unset($this->headers['Expires'], $this->headers['Pragma']); @@ -244,7 +244,7 @@ class Response { if ($this->lastModified) { $mergeWith['Last-Modified'] = - $this->lastModified->format(\DateTime::RFC2822); + $this->lastModified->format(\DateTimeInterface::RFC2822); } $this->headers['Content-Security-Policy'] = $this->getContentSecurityPolicy()->buildPolicy(); diff --git a/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php b/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php index 3cd3921ce45..c62384302fb 100644 --- a/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php @@ -61,13 +61,13 @@ class NotModifiedMiddlewareTest extends \Test\TestCase { [null, '"etag"', null, '', false], ['etag', '"etag"', null, '', true], - [null, '', $now, $now->format(\DateTime::RFC2822), true], + [null, '', $now, $now->format(\DateTimeInterface::RFC2822), true], [null, '', $now, $now->format(\DateTimeInterface::ATOM), false], - [null, '', null, $now->format(\DateTime::RFC2822), false], + [null, '', null, $now->format(\DateTimeInterface::RFC2822), false], [null, '', $now, '', false], ['etag', '"etag"', $now, $now->format(\DateTimeInterface::ATOM), true], - ['etag', '"etag"', $now, $now->format(\DateTime::RFC2822), true], + ['etag', '"etag"', $now, $now->format(\DateTimeInterface::RFC2822), true], ]; } |