Page MenuHomePhabricator

PluggableAuth PHP Warnings: Undefined array key "query"
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Wikis report PHP Warnings related to PluggableAuth with the following configuration:
wfLoadExtension( 'PluggableAuth' );
$wgPluggableAuth_Config['Log in using SAML'] = [
        'plugin' => 'SimpleSAMLphp',
        'data' => [
                'authSourceId' => 'test-sp',
                'usernameAttribute' => 'cn',
                'realNameAttribute' => 'givenName',
                'emailAttribute' => 'mail'
        ]
];

What happens?:

The following warnings occur:

PHP Warning:  Undefined array key "query" in /var/www/html/extensions/PluggableAuth/includes/PluggableAuthHooks.php on line 201
PHP Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/html/includes/GlobalFunctions.php on line 395

What should have happened instead?:

No warnings

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

MediaWiki 1.43.6
PHP 8.3.30
PluggableAuth 7.5.0

Other information (browser name/version, screenshots, etc.):

Event Timeline

Confirmed on:
MediaWiki 1.45.1
PHP 8.3.30 (apache2handler)

With:
PluggableAuth 7.5.0 (71aeb87)
OpenID Connect 8.3.0 (cde4bc1)

upon entering wiki/Special:UserLogin URL without any query, the following warning and deprecation notice is thrown multiple times on the page:

Warning: Undefined array key "query" in /var/www/html/extensions/PluggableAuth/includes/PluggableAuthHooks.php on line 201
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/html/includes/GlobalFunctions.php on line 385

Note that the following URL does not trigger the issue:
https://example.com/index.php?title=Special:UserLogin&returnto=Main+Page

While the following does:
https://example.com/wiki/Special:UserLogin

It seems that 648899e might have introduced it, but that's my uneducated shot.

And I have just confirmed this is fixed in d12c08ebd592ef1479263df5e58bee4bfe04e528 in response to T401769
I think it can be closed.

cicalese claimed this task.
cicalese subscribed.

And I have just confirmed this is fixed in d12c08ebd592ef1479263df5e58bee4bfe04e528 in response to T401769
I think it can be closed.

Thank you!