From 909e5b363cef10cbb9ecbfd68488350a720cbfaf Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 15 Nov 2007 03:30:03 +0000 Subject: [PATCH] * Changed signature-ip to signature-anon * Removed the hardcoding of the link parameter ($1), let the message control the destination. * Removed the hardcoded talk page links. They can be easily re-added if desired, though, and added per-wiki. * Removed the $3 and $4 parameters * Fixed wfEscapeWikiText() to do "]" as well as "[", so sigs with "]" won't break links * Updated a parser test case for the escaping change --- RELEASE-NOTES | 3 ++- includes/GlobalFunctions.php | 4 ++-- includes/Parser.php | 13 ++++--------- languages/messages/MessagesEn.php | 4 ++-- maintenance/language/messageTypes.inc | 2 +- maintenance/language/messages.inc | 2 +- maintenance/parserTests.txt | 2 +- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ad2cf089ff..00fec8dad3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -60,7 +60,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add ot=raw to Special:Allmessages * Support for Hebrew calendar * Support for Hebrew numerals in dates and times -* (bug 11315) Signatures can be configured in [[MediaWiki:Signature]] and [[MediaWiki:Signature-ip]] +* (bug 11315) Signatures can be configured in [[MediaWiki:Signature]] and + [[MediaWiki:Signature-anon]] * Signatures for anonymous users link to Special:Contributions page rather than user page * Added --override switch for disabled pages in updateSpecialPages.php diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a8fbb39853..008a6d2b4f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -889,8 +889,8 @@ function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) { */ function wfEscapeWikiText( $text ) { $text = str_replace( - array( '[', '|', '\'', 'ISBN ', 'RFC ', '://', "\n=", '{{' ), - array( '[', '|', ''', 'ISBN ', 'RFC ', '://', "\n=", '{{' ), + array( '[', '|', ']', '\'', 'ISBN ', 'RFC ', '://', "\n=", '{{' ), + array( '[', '|', ']', ''', 'ISBN ', 'RFC ', '://', "\n=", '{{' ), htmlspecialchars($text) ); return $text; } diff --git a/includes/Parser.php b/includes/Parser.php index 0ad8b82dfe..46687e61ec 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3878,17 +3878,12 @@ class Parser $nickname = $this->cleanSigInSig( $nickname ); # If we're still here, make it a link to the user page - $userpage = $user->getUserPage(); + $userText = wfEscapeWikiText( $username ); + $nickText = wfEscapeWikiText( $nickname ); if ( $user->isAnon() ) { - $title = SpecialPage::getTitleFor('Contributions' ); - return ( wfMsgForContent( 'signature-ip', - $title->getPrefixedText() . '/' . wfEscapeWikiText( $username ), - wfEscapeWikiText( $nickname ), - $userpage->getTalkPage(), wfMsgForContent('talkpagelinktext') ) ); + return wfMsgForContent( 'signature-anon', $userText, $nickText ); } else { - return ( wfMsgForContent( 'signature', $userpage->getPrefixedText(), - wfEscapeWikiText( $nickname ), - $userpage->getTalkPage(), wfMsgForContent('talkpagelinktext') ) ); + return wfMsgForContent( 'signature', $userText, $nickText ); } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 735a5fff27..c40117d455 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3045,7 +3045,7 @@ $1', 'hebrew-calendar-m12-gen' => 'Elul', # only translate this message to other languages if you have to change it # Default signatures for all languages. Do not duplicate to other languages -'signature' => '[[$1|$2]] ([[$3|$4]])', # default signature for registered users -'signature-ip' => '[[$1|$2]] ([[$3|$4]])', # default signature for anonymous users +'signature' => '[[User:$1|$2]]', # default signature for registered users +'signature-anon' => '[[Special:Contributions/$1|$2]]', # default signature for anonymous users ); diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 5bb967dc3c..6baf302bc4 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -255,7 +255,7 @@ $wgOptionalMessages = array( 'hebrew-calendar-m11-gen', 'hebrew-calendar-m12-gen', 'signature', - 'signature-ip', + 'signature-anon', ); /** EXIF messages, which may be set as optional in several checks, but are generally mandatory */ diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index c01f4e387e..3343ed5471 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2272,7 +2272,7 @@ $wgMessageStructure = array( ), 'signatures' => array( 'signature', - 'signature-ip', + 'signature-anon', ), ); /** Comments for each block */ diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 9b5d973ff3..8e84e961ca 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -6251,7 +6251,7 @@ MSGNW magic word !! input {{MSGNW:msg}} !! result -

[[:Template:Msg]] +

[[:Template:Msg]]

!! end -- 2.20.1