r41149 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41148‎ | r41149 | r41150 >
Date:12:41, 22 September 2008
Author:aaron
Status:old
Tags:
Comment:
Use IP::isIPAddress() to catch ranges and therefore show block/log links. (bug 13156)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -326,12 +326,13 @@
327327 if( $talk ) {
328328 # Talk page link
329329 $tools[] = $sk->makeLinkObj( $talk, wfMsgHtml( 'talkpagelinktext' ) );
330 - if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
 330+ if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
331331 # Block link
332332 if( $wgUser->isAllowed( 'block' ) )
333333 $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
334334 # Block log link
335 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
 335+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
 336+ wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
336337 }
337338 # Other logs link
338339 $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );