From 74e32967a2f45784f777a9d635ee4874e94dc27d Mon Sep 17 00:00:00 2001 From: Aditya Sastry Date: Fri, 11 Apr 2014 02:54:35 +0530 Subject: [PATCH] Display a warning when the user name looked up is not registered Changed the SpecialContributions.php and added a warning message to tell the user that the name he looked up isn't registered. Bug: 60524 Change-Id: Ie07001e75a9732f727930f8f367bba8feb395b3e --- includes/specials/SpecialContributions.php | 10 ++++++++++ languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + 3 files changed, 12 insertions(+) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 51606b72fb..f20355b743 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -244,6 +244,16 @@ class SpecialContributions extends IncludableSpecialPage { */ protected function contributionsSub( $userObj ) { if ( $userObj->isAnon() ) { + // Show a warning message that the user being searched for doesn't exists + if ( !User::isIP( $userObj ) ) { + $this->getOutput()->wrapWikiMsg( + "
\n\$1\n
", + array( + 'contributions-userdoesnotexist', + wfEscapeWikiText( $userObj->getName() ), + ) + ); + } $user = htmlspecialchars( $userObj->getName() ); } else { $user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 6dec0ef670..41c12b368c 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2006,6 +2006,7 @@ "contributions-title": "User contributions for $1", "mycontris": "Contributions", "contribsub2": "For {{GENDER:$3|$1}} ($2)", + "contributions-userdoesnotexist": "User account \"$1\" is not registered.", "nocontribs": "No changes were found matching these criteria.", "uctop": "(current)", "month": "From month (and earlier):", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index f788eaf2c6..ba64764e01 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2193,6 +2193,7 @@ "sp-contributions-footer": "{{ignored}}This is the footer for users that are not anonymous or newbie on [[Special:Contributions]].", "sp-contributions-footer-anon": "{{ignored}}This is the footer for anonymous users on [[Special:Contributions]].", "sp-contributions-footer-newbies": "{{ignored}}This is the footer for newbie users on [[Special:Contributions]].", + "contributions-userdoesnotexist": "This message is used in [[Special:Contributions]]. It is used to tell the user that the name he searched for doesn\\'t exists. Parameters: \n* $1 is the name that was searched for", "whatlinkshere": "The text of the link in the toolbox (on the left, below the search menu) going to [[Special:WhatLinksHere]].\n\nSee also:\n* {{msg-mw|Whatlinkshere}}\n* {{msg-mw|Accesskey-t-whatlinkshere}}\n* {{msg-mw|Tooltip-t-whatlinkshere}}", "whatlinkshere-title": "Title of the special page [[Special:WhatLinksHere]]. This page appears when you click on the 'What links here' button in the toolbox. $1 is the name of the page concerned.", "whatlinkshere-summary": "{{doc-specialpagesummary|whatlinkshere}}", -- 2.20.1