r96858 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96857‎ | r96858 | r96859 >
Date:16:25, 12 September 2011
Author:reedy
Status:reverted
Tags:
Comment:
1.17wmf1: MFT r96430, r96449, r96773
Modified paths:
  • /branches/wmf/1.17wmf1/includes/Linker.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/Linker.php
@@ -835,9 +835,9 @@
836836 * @param $userId Integer: user id in database.
837837 * @param $userText String: user name in database
838838 * @return String: HTML fragment
839 - * @private
840839 */
841 - function userLink( $userId, $userText ) {
 840+
 841+ public static function userLink( $userId, $userText ) {
842842 if ( $userId == 0 ) {
843843 $page = SpecialPage::getTitleFor( 'Contributions', $userText );
844844 } else {
@@ -860,8 +860,8 @@
861861 public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null ) {
862862 global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans, $wgLang;
863863 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
864 - $blockable = ( $wgSysopUserBans || 0 == $userId ) && !$flags & self::TOOL_LINKS_NOBLOCK;
865 - $addEmailLink = $flags & self::TOOL_LINKS_EMAIL;
 864+ $blockable = !( $flags & self::TOOL_LINKS_NOBLOCK );
 865+ $addEmailLink = $flags & self::TOOL_LINKS_EMAIL && $userId;
866866
867867 $items = array();
868868 if ( $talkable ) {
@@ -910,9 +910,8 @@
911911 * @param $userId Integer: user id in database.
912912 * @param $userText String: user name in database.
913913 * @return String: HTML fragment with user talk link
914 - * @private
915914 */
916 - function userTalkLink( $userId, $userText ) {
 915+ public static function userTalkLink( $userId, $userText ) {
917916 $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
918917 $userTalkLink = $this->link( $userTalkPage, wfMsgHtml( 'talkpagelinktext' ) );
919918 return $userTalkLink;
@@ -922,11 +921,11 @@
923922 * @param $userId Integer: userid
924923 * @param $userText String: user name in database.
925924 * @return String: HTML fragment with block link
926 - * @private
927925 */
928 - function blockLink( $userId, $userText ) {
929 - $blockPage = SpecialPage::getTitleFor( 'Blockip', $userText );
930 - $blockLink = $this->link( $blockPage, wfMsgHtml( 'blocklink' ) );
 926+
 927+ public static function blockLink( $userId, $userText ) {
 928+ $blockPage = SpecialPage::getTitleFor( 'Block', $userText );
 929+ $blockLink = self::link( $blockPage, wfMsgHtml( 'blocklink' ) );
931930 return $blockLink;
932931 }
933932
@@ -934,10 +933,9 @@
935934 * @param $userId Integer: userid
936935 * @param $userText String: user name in database.
937936 * @return String: HTML fragment with e-mail user link
938 - * @private
939937 */
940 - static function emailLink( $userId, $userText ) {
941 - $emailPage = SpecialPage::getTitleFor( 'EmailUser', $userText );
 938+ public static function emailLink( $userId, $userText ) {
 939+ $emailPage = SpecialPage::getTitleFor( 'Emailuser', $userText );
942940 $emailLink = self::link( $emailPage, wfMsgHtml( 'emaillink' ) );
943941 return $emailLink;
944942 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r96864Revert Linker.php in r96858, r96856...reedy16:49, 12 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96430Follow-up r96420: correct casing for special page to prevent "PHP Notice: Fo...siebrand13:35, 7 September 2011
r96449Mark userLink, userTalkLink, blockLink() and emailLink() as public static per...siebrand17:00, 7 September 2011
r96773* Follow-up r96420: don't show e-mail links to anon users...ialex08:14, 11 September 2011

Status & tagging log