mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-24 14:14:02 +00:00
TitleBlacklistPreAuthenticationProvider: Add null assert
$req can legitimately be null, so we need to add null to the assert as well, so the code doesn't stop immediately. This is a follow-up for I83f9374b2f3236097860f4aecc694326b891905b Change-Id: I85dbc1b4c1452d0671879e6cc02c5411090b1d1d
This commit is contained in:
parent
56f94c4d71
commit
63ae71c8f9
|
@ -34,9 +34,13 @@ class TitleBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationP
|
|||
$req = AuthenticationRequest::getRequestByClass( $reqs,
|
||||
TitleBlacklistAuthenticationRequest::class );
|
||||
// For phan check, to ensure that $req is instance of \TitleBlacklistAuthenticationRequest
|
||||
assert( $req instanceof TitleBlacklistAuthenticationRequest );
|
||||
// or null
|
||||
if ( $req instanceof TitleBlacklistAuthenticationRequest ) {
|
||||
$override = $req->ignoreTitleBlacklist;
|
||||
} else {
|
||||
$override = false;
|
||||
}
|
||||
|
||||
$override = $req && $req->ignoreTitleBlacklist;
|
||||
return TitleBlacklistHooks::testUserName( $user->getName(), $creator, $override, true );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue