Merge "SpecialBlock: Better handle null in getTargetUserTitle"
This commit is contained in:
commit
16c60f3ee8
1 changed files with 5 additions and 2 deletions
|
|
@ -709,15 +709,18 @@ class SpecialBlock extends FormSpecialPage {
|
|||
/**
|
||||
* Get a user page target for things like logs.
|
||||
* This handles account and IP range targets.
|
||||
* @param UserIdentity|string $target
|
||||
* @param UserIdentity|string|null $target
|
||||
* @return PageReference|null
|
||||
*/
|
||||
protected static function getTargetUserTitle( $target ): ?PageReference {
|
||||
if ( $target instanceof UserIdentity ) {
|
||||
return PageReferenceValue::localReference( NS_USER, $target->getName() );
|
||||
} elseif ( IPUtils::isIPAddress( $target ) ) {
|
||||
}
|
||||
|
||||
if ( is_string( $target ) && IPUtils::isIPAddress( $target ) ) {
|
||||
return PageReferenceValue::localReference( NS_USER, $target );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue