20after4 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402120 )

Change subject: TitleBlacklistPreAuthenticationProvider: Add null assert
......................................................................

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
---
M TitleBlacklistPreAuthenticationProvider.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TitleBlacklist 
refs/changes/20/402120/1

diff --git a/TitleBlacklistPreAuthenticationProvider.php 
b/TitleBlacklistPreAuthenticationProvider.php
index aaea018..8c737ba 100644
--- a/TitleBlacklistPreAuthenticationProvider.php
+++ b/TitleBlacklistPreAuthenticationProvider.php
@@ -34,9 +34,13 @@
                $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 );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/402120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85dbc1b4c1452d0671879e6cc02c5411090b1d1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: wmf/1.31.0-wmf.15
Gerrit-Owner: 20after4 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to