r22992 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22991‎ | r22992 | r22993 >
Date:18:02, 14 June 2007
Author:aaron
Status:old
Tags:
Comment:
*For range blocks, make the block log link for the range not the user
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -368,16 +368,20 @@
369369 $s .= ' (' . $wgLang->timeanddate( $users_first[$name] ) . ' -- ' . $wgLang->timeanddate( $users_last[$name] ) . ') ';
370370 $s .= ' [<strong>' . $count . '</strong>]<br/>';
371371 # Check if this user or IP is blocked
 372+ # If so, give a link to the block log
372373 $block = new Block();
373374 $block->fromMaster( false ); // use slaves
374375 $ip = IP::isIPAddress( $name ) ? $name : ''; // only check IP blocks if we have an IP
375376 if( $block->load( $ip, $users_ids[$name] ) ) {
376 - $userpage = Title::makeTitle( NS_USER, $name );
377 - $blocklog = $sk->makeKnownLinkObj( $logs, wfMsgHtml('blockedtitle'), 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) );
378 - if( IP::isIPAddress($block->mAddress) && strpos($block->mAddress,'/') )
 377+ if( IP::isIPAddress($block->mAddress) && strpos($block->mAddress,'/') ) {
 378+ $userpage = Title::makeTitle( NS_USER, $block->mAddress );
 379+ $blocklog = $sk->makeKnownLinkObj( $logs, wfMsgHtml('blockedtitle'), 'type=block&page=' . $userpage->getPrefixedText() );
379380 $s .= '<strong>(' . $blocklog . ' - ' . $block->mAddress . ')</strong><br/>';
380 - else
 381+ } else {
 382+ $userpage = Title::makeTitle( NS_USER, $name );
 383+ $blocklog = $sk->makeKnownLinkObj( $logs, wfMsgHtml('blockedtitle'), 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) );
381384 $s .= '<strong>(' . $blocklog . ')</strong><br/>';
 385+ }
382386 }
383387 $s .= '<ol>';
384388 # List out each IP/XFF combo for this username, and add the user agent for each

Status & tagging log