r27512 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r27511‎ | r27512 | r27513 >
Date:03:30, 15 November 2007
Author:brion
Status:old
Tags:
Comment:
* 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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -6251,7 +6251,7 @@
62526252 !! input
62536253 {{MSGNW:msg}}
62546254 !! result
6255 -<p>&#91;&#91;:Template:Msg]]
 6255+<p>&#91;&#91;:Template:Msg&#93;&#93;
62566256 </p>
62576257 !! end
62586258
Index: trunk/phase3/maintenance/language/messages.inc
@@ -2272,7 +2272,7 @@
22732273 ),
22742274 'signatures' => array(
22752275 'signature',
2276 - 'signature-ip',
 2276+ 'signature-anon',
22772277 ),
22782278 );
22792279 /** Comments for each block */
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -255,7 +255,7 @@
256256 'hebrew-calendar-m11-gen',
257257 'hebrew-calendar-m12-gen',
258258 'signature',
259 - 'signature-ip',
 259+ 'signature-anon',
260260 );
261261
262262 /** EXIF messages, which may be set as optional in several checks, but are generally mandatory */
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -889,8 +889,8 @@
890890 */
891891 function wfEscapeWikiText( $text ) {
892892 $text = str_replace(
893 - array( '[', '|', '\'', 'ISBN ', 'RFC ', '://', "\n=", '{{' ),
894 - array( '&#91;', '&#124;', '&#39;', 'ISBN&#32;', 'RFC&#32;', '&#58;//', "\n&#61;", '&#123;&#123;' ),
 893+ array( '[', '|', ']', '\'', 'ISBN ', 'RFC ', '://', "\n=", '{{' ),
 894+ array( '&#91;', '&#124;', '&#93;', '&#39;', 'ISBN&#32;', 'RFC&#32;', '&#58;//', "\n&#61;", '&#123;&#123;' ),
895895 htmlspecialchars($text) );
896896 return $text;
897897 }
Index: trunk/phase3/includes/Parser.php
@@ -3878,17 +3878,12 @@
38793879 $nickname = $this->cleanSigInSig( $nickname );
38803880
38813881 # If we're still here, make it a link to the user page
3882 - $userpage = $user->getUserPage();
 3882+ $userText = wfEscapeWikiText( $username );
 3883+ $nickText = wfEscapeWikiText( $nickname );
38833884 if ( $user->isAnon() ) {
3884 - $title = SpecialPage::getTitleFor('Contributions' );
3885 - return ( wfMsgForContent( 'signature-ip',
3886 - $title->getPrefixedText() . '/' . wfEscapeWikiText( $username ),
3887 - wfEscapeWikiText( $nickname ),
3888 - $userpage->getTalkPage(), wfMsgForContent('talkpagelinktext') ) );
 3885+ return wfMsgForContent( 'signature-anon', $userText, $nickText );
38893886 } else {
3890 - return ( wfMsgForContent( 'signature', $userpage->getPrefixedText(),
3891 - wfEscapeWikiText( $nickname ),
3892 - $userpage->getTalkPage(), wfMsgForContent('talkpagelinktext') ) );
 3887+ return wfMsgForContent( 'signature', $userText, $nickText );
38933888 }
38943889 }
38953890
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3045,7 +3045,7 @@
30463046 'hebrew-calendar-m12-gen' => 'Elul', # only translate this message to other languages if you have to change it
30473047
30483048 # Default signatures for all languages. Do not duplicate to other languages
3049 -'signature' => '[[$1|$2]] ([[$3|$4]])', # default signature for registered users
3050 -'signature-ip' => '[[$1|$2]] ([[$3|$4]])', # default signature for anonymous users
 3049+'signature' => '[[User:$1|$2]]', # default signature for registered users
 3050+'signature-anon' => '[[Special:Contributions/$1|$2]]', # default signature for anonymous users
30513051
30523052 );
Index: trunk/phase3/RELEASE-NOTES
@@ -60,7 +60,8 @@
6161 * Add ot=raw to Special:Allmessages
6262 * Support for Hebrew calendar
6363 * Support for Hebrew numerals in dates and times
64 -* (bug 11315) Signatures can be configured in [[MediaWiki:Signature]] and [[MediaWiki:Signature-ip]]
 64+* (bug 11315) Signatures can be configured in [[MediaWiki:Signature]] and
 65+ [[MediaWiki:Signature-anon]]
6566 * Signatures for anonymous users link to Special:Contributions page rather than user page
6667 * Added --override switch for disabled pages in updateSpecialPages.php
6768

Status & tagging log