summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-11-23 15:41:20 +0100
committerGitHub <noreply@github.com>2021-11-23 15:41:20 +0100
commitfd487c1a43874bf7eaeebe2ff822e18978b6d1e1 (patch)
treea69c74aa76577beac40700eaf47d28b5e8bd1af9 /core
parent20dd46fcaed56b7df151fe1a5273cdadc22a583e (diff)
parent18a91f02fadf108bfa1a60f258ebacd2f802224b (diff)
downloadnextcloud-server-fd487c1a43874bf7eaeebe2ff822e18978b6d1e1.tar.gz
nextcloud-server-fd487c1a43874bf7eaeebe2ff822e18978b6d1e1.zip
Merge pull request #29432 from nextcloud/fix/support-php-8.1
Support PHP 8.1 - First batch
Diffstat (limited to 'core')
-rw-r--r--core/Command/Broadcast/Test.php2
-rw-r--r--core/Controller/AvatarController.php5
2 files changed, 4 insertions, 3 deletions
diff --git a/core/Command/Broadcast/Test.php b/core/Command/Broadcast/Test.php
index 91050725e17..86cd30e4b4c 100644
--- a/core/Command/Broadcast/Test.php
+++ b/core/Command/Broadcast/Test.php
@@ -87,7 +87,7 @@ class Test extends Command {
];
}
- public function jsonSerialize() {
+ public function jsonSerialize(): array {
return [
'description' => 'this is a test event',
];
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 3b87bf15b2f..5acfe9cd404 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -283,11 +283,12 @@ class AvatarController extends Controller {
$image = new \OC_Image();
$image->loadFromData($tmpAvatar);
- $resp = new DataDisplayResponse($image->data(),
+ $resp = new DataDisplayResponse(
+ $image->data() ?? '',
Http::STATUS_OK,
['Content-Type' => $image->mimeType()]);
- $resp->setETag((string)crc32($image->data()));
+ $resp->setETag((string)crc32($image->data() ?? ''));
$resp->cacheFor(0);
$resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
return $resp;