- Using ->getName() without checking ->isTemp() will not distinguish between temporary and registered users. The ->getName() method will return the unique identifier for temporary users(which is different from their IP address.) making the result of this query: $ip == $user->getName() false for temporary users. This may not be useful for generating links or displaying labels. The code should now add another check for $user->isTemp(); to treat temp users differently from registered users or anon users.
See snippet below :
src/CheckUser/Pagers/AbstractCheckUserPager.php
$flags[] = $this->getBlockFlag( $block ); } elseif ( $ip == $user->getName() && ExtensionRegistry::getInstance()->isLoaded( 'GlobalBlocking' ) && GlobalBlocking::getUserBlock(
Example
if ( $user->isTemp() ) { // do Something for temporary users $name = $user->getName(); } elseif ( $user->isNamed() ) { // Use the user name for registered users $name = $user->getName(); } else { // Use the IP address for anonymous users $name = $ip; }