Page MenuHomePhabricator

SpecialOpenIDLogin.body.php:154 - get_class() expects parameter 1 to be object, null given
Open, Needs TriagePublic

Description

"PHP Warning: get_class() expects parameter 1 to be object, null given in /usr/share/webapps/mediawiki/extensions/OpenID/SpecialOpenIDLogin.body.php on line 154"

http://php.net/manual/en/function.get-class.php

"7.2.0 NULL was removed as the default value for object, and is no longer a valid input."

I think this fixes it:

...
    $class = is_null( $wgOpenIDForcedProvider ) ? get_class() : get_class($wgOpenIDForcedProvider);
 
    if ( $class == 'OpenIDProvider' ) {
       $inputFormHTML .= $wgOpenIDForcedProvider->getLoginFormHTML();
...

Details

Related Gerrit Patches:
mediawiki/extensions/OpenID : masterModified to check for a string

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 13 2018, 7:09 PM

Thanks for taking a look at the code and reporting this!

You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review them quickly and provide feedback.
If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

Reedy moved this task from Untriaged to Other on the PHP 7.2 support board.Aug 16 2018, 7:25 PM

TBH, I don't have the time or energy. If someone else could commit this fix, it would be greatly appreciated!

Hi, @MilkMiruku . Please could you give one or two steps for reproducing the error? Also, I tried to add an openID using my google account and got this error :

An unspecified authentication response/request error occurred during the verification of the OpenID URL https://www.google.com/accounts/o8/id.

Sorry please it is my fist time using this extension .

I tried the extension on a fresh MediaWiki install, albeit with the database copied over. The bug is with a feature that PHP 7.2 doesn't support any more (I'm using Arch Linux). I know that DreamWidth is a reliable OpenID provider still.

Change 489389 had a related patch set uploaded (by Gopavasanth; owner: Gopavasanth):
[mediawiki/extensions/OpenID@master] get_class() expects parameter 1 to be object, null given

https://gerrit.wikimedia.org/r/489389