]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow passing null to PublicKeyToken::setScope, fixes tests 41017/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 23 Oct 2023 13:52:07 +0000 (15:52 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 23 Oct 2023 13:52:07 +0000 (15:52 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/Authentication/Token/PublicKeyToken.php

index 198990cdd950bce9409e4741baa0c779c23dfa82..b77a856589de84d9c74411569c145ba43e1f74ff 100644 (file)
@@ -187,11 +187,11 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
                return $scope;
        }
 
-       public function setScope(string|array $scope): void {
+       public function setScope(array|string|null $scope): void {
                if (is_array($scope)) {
                        parent::setScope(json_encode($scope));
                } else {
-                       parent::setScope($scope);
+                       parent::setScope((string)$scope);
                }
        }