From: Aaron Schulz Date: Wed, 8 Oct 2008 20:55:35 +0000 (+0000) Subject: Show contribs link only if it applies X-Git-Tag: 1.31.0-rc.0~44839 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=80da6cb3f3dee40aaaa0e37562444464c4843481;p=lhc%2Fweb%2Fwiklou.git Show contribs link only if it applies --- diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 402ffe608d..e449b6e3bb 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -479,13 +479,25 @@ class IPBlockForm { private function getConvenienceLinks() { global $wgUser; $skin = $wgUser->getSkin(); - $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->BlockAddress ); - $links[] = $skin->link( $contribsPage, wfMsgHtml( 'ipb-blocklist-contribs', $this->BlockAddress ) ); + if( $this->BlockAddress ) + $links[] = $this->getContribsLink( $skin ); $links[] = $this->getUnblockLink( $skin ); $links[] = $this->getBlockListLink( $skin ); $links[] = $skin->makeLink ( 'MediaWiki:Ipbreason-dropdown', wfMsgHtml( 'ipb-edit-dropdown' ) ); return ''; } + + /** + * Build a convenient link to a user or IP's contribs + * form + * + * @param $skin Skin to use + * @return string + */ + private function getContribsLink( $skin ) { + $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->BlockAddress ); + return $skin->link( $contribsPage, wfMsgHtml( 'ipb-blocklist-contribs', $this->BlockAddress ) ); + } /** * Build a convenient link to unblock the given username or IP