From 1b1fbc51dec8953901113344b2be0fad8fd0dc1d Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Sat, 7 Dec 2024 18:56:58 +0000 Subject: [PATCH] Update to MW 1.42 --- includes/IsekaiOIDCAuth.php | 10 ++++------ includes/SpecialIsekaiOIDCCallback.php | 2 +- lib/openid-connect-php/OpenIDConnectClient.php | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/includes/IsekaiOIDCAuth.php b/includes/IsekaiOIDCAuth.php index 130ad24..cb9d2ab 100644 --- a/includes/IsekaiOIDCAuth.php +++ b/includes/IsekaiOIDCAuth.php @@ -266,13 +266,11 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider { } if ( isset( $config['scope'] ) ) { $scope = $config['scope']; - if ( is_array( $scope ) ) { - foreach ( $scope as $s ) { - $oidc->addScope( $s ); - } - } else { - $oidc->addScope( $scope ); + if ( ! is_array( $scope ) ) { + $scope = [ $scope ]; } + + $oidc->addScope( $scope ); } if ( isset( $config['proxy'] ) ) { $oidc->setHttpProxy( $config['proxy'] ); diff --git a/includes/SpecialIsekaiOIDCCallback.php b/includes/SpecialIsekaiOIDCCallback.php index c735b40..87eff4d 100644 --- a/includes/SpecialIsekaiOIDCCallback.php +++ b/includes/SpecialIsekaiOIDCCallback.php @@ -35,7 +35,7 @@ class SpecialIsekaiOIDCCallback extends LoginSignupSpecialPage { } public function getDescription() { - return $this->msg( 'login' )->text(); + return $this->msg( 'login' ); } public function setHeaders() { diff --git a/lib/openid-connect-php/OpenIDConnectClient.php b/lib/openid-connect-php/OpenIDConnectClient.php index ac6bf18..3e91d3d 100644 --- a/lib/openid-connect-php/OpenIDConnectClient.php +++ b/lib/openid-connect-php/OpenIDConnectClient.php @@ -967,7 +967,7 @@ class OpenIDConnectClient } // Convert token params to string format - $post_params = http_build_query($post_data, null, '&', $this->encType); + $post_params = http_build_query($post_data, '', '&', $this->encType); return json_decode($this->fetchURL($token_endpoint, $post_params, $headers), false); }