Merge "Changed wfMessage() usage to call directly MessageCache::get() so that its...
authorDemon <chadh@wikimedia.org>
Mon, 2 Apr 2012 15:23:56 +0000 (15:23 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 Apr 2012 15:23:56 +0000 (15:23 +0000)
22 files changed:
.gitignore
HISTORY
RELEASE-NOTES-1.19
RELEASE-NOTES-1.20
docs/html/.gitignore [new file with mode: 0644]
includes/EditPage.php
includes/Export.php
includes/specials/SpecialContributions.php
includes/specials/SpecialExport.php
includes/specials/SpecialPasswordReset.php
includes/upload/UploadBase.php
languages/Language.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiPurgeTest.php
tests/phpunit/includes/api/ApiQueryTest.php
tests/phpunit/includes/api/ApiTest.php
tests/phpunit/includes/api/ApiUploadTest.php
tests/phpunit/includes/api/ApiWatchTest.php

index 7b3ec46..2ffdb88 100644 (file)
@@ -1,6 +1,7 @@
 .svn
 *~
 *.kate-swp
+.*.swp
 .classpath
 .idea
 .metadata*
diff --git a/HISTORY b/HISTORY
index 3dc2e9a..408ae38 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,7 @@ Change notes from older releases. For current info see RELEASE-NOTES-1.20.
 === Changes since 1.18.2 ===
 * (bug 35446) Using "{{nse:}}" with an invalid namespace name no longer throws
   a PHP warning.
+* (bug 35567) The whole password reminder e-mail is now sent in the same language.
 
 == MediaWiki 1.18.2 ==
 2012-03-21
index fa98036..94f034c 100644 (file)
@@ -386,6 +386,7 @@ changes to languages because of Bugzilla reports.
   amount of user/site scripts that are lacking dependency information. In the short to
   medium term these user/site scripts should be fixed by adding the used modules to the
   dependencies in the module registry and/or wrapping them in a callback to mw.loader.using.
+* MediaWiki now requires MySQL 5.0.2 or later when using a MySQL database.
 
 == Compatibility ==
 
index 5e42184..b358e79 100644 (file)
@@ -25,6 +25,7 @@ production.
 * Introduce a cryptographic random number generator source api for use when
   generating various tokens.
 * (bug 30963) Option on Special:Prefixindex and Special:Allpages to not show redirects.
+* (bug 18062) new message when edit or create the local page of a shared file
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
diff --git a/docs/html/.gitignore b/docs/html/.gitignore
new file mode 100644 (file)
index 0000000..f847620
--- /dev/null
@@ -0,0 +1,3 @@
+*
+!README
+!.gitignore
index 31e6626..052a783 100644 (file)
@@ -1634,6 +1634,24 @@ class EditPage {
                if ( $namespace == NS_MEDIAWIKI ) {
                        # Show a warning if editing an interface message
                        $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1\n</div>", 'editinginterface' );
+               } else if( $namespace == NS_FILE ) {
+                       # Show a hint to shared repo
+                       $file = wfFindFile( $this->mTitle );
+                       if( $file && !$file->isLocal() ) {
+                               $descUrl = $file->getDescriptionUrl();
+                               # there must be a description url to show a hint to shared repo
+                               if( $descUrl ) {
+                                       if( !$this->mTitle->exists() ) {
+                                               $wgOut->wrapWikiMsg( "<div class=\"mw-sharedupload-desc-create\">\n$1\n</div>", array (
+                                                                       'sharedupload-desc-create', $file->getRepo()->getDisplayName(), $descUrl
+                                               ) );
+                                       } else {
+                                               $wgOut->wrapWikiMsg( "<div class=\"mw-sharedupload-desc-edit\">\n$1\n</div>", array(
+                                                                       'sharedupload-desc-edit', $file->getRepo()->getDisplayName(), $descUrl
+                                               ) );
+                                       }
+                               }
+                       }
                }
 
                # Show a warning message when someone creates/edits a user (talk) page but the user does not exist
index 0bddd4c..9a44260 100644 (file)
@@ -308,9 +308,6 @@ class WikiExporter {
                        $wrapper = $this->db->resultObject( $result );
                        # Output dump results
                        $this->outputPageStream( $wrapper );
-                       if ( $this->list_authors ) {
-                               $this->outputPageStream( $wrapper );
-                       }
 
                        if ( $this->buffer == WikiExporter::STREAM ) {
                                $this->db->bufferResults( $prev );
index c598457..03dd522 100644 (file)
@@ -189,18 +189,20 @@ class SpecialContributions extends SpecialPage {
                        }
                        $out->preventClickjacking( $pager->getPreventClickjacking() );
 
+
                        # Show the appropriate "footer" message - WHOIS tools, etc.
-                       if ( $this->opts['contribs'] != 'newbie' ) {
+                       if ( $this->opts['contribs'] == 'newbie' ) {
+                               $message = 'sp-contributions-footer-newbies';
+                       } elseif( IP::isIPAddress( $target ) ) {
+                               $message = 'sp-contributions-footer-anon';
+                       } elseif( $userObj->isAnon() ) {
+                               // No message for non-existing users
+                               $message = '';
+                       } else {
                                $message = 'sp-contributions-footer';
-                               if ( IP::isIPAddress( $target ) ) {
-                                       $message = 'sp-contributions-footer-anon';
-                               } else {
-                                       if ( $userObj->isAnon() ) {
-                                               // No message for non-existing users
-                                               return;
-                                       }
-                               }
+                       }
 
+                       if( $message ) {
                                if ( !$this->msg( $message, $target )->isDisabled() ) {
                                        $out->wrapWikiMsg(
                                                "<div class='mw-contributions-footer'>\n$1\n</div>",
index 360d2d2..b00eec8 100644 (file)
@@ -93,6 +93,13 @@ class SpecialExport extends SpecialPage {
                elseif( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
                        $this->doExport = true;
                        $exportall = true;
+
+                       /* Although $page and $history are not used later on, we
+                       nevertheless set them to avoid that PHP notices about using
+                       undefined variables foul up our XML output (see call to
+                       doExport(...) further down) */
+                       $page = '';
+                       $history = '';
                }
                elseif( $request->wasPosted() && $par == '' ) {
                        $page = $request->getText( 'pages' );
index 683a714..f140546 100644 (file)
@@ -229,18 +229,19 @@ class SpecialPasswordReset extends FormSpecialPage {
                        ? 'passwordreset-emailtext-ip'
                        : 'passwordreset-emailtext-user';
 
+               // Send in the user's language; which should hopefully be the same
+               $userLanguage = $firstUser->getOption( 'language' );
+
                $passwords = array();
                foreach ( $users as $user ) {
                        $password = $user->randomPassword();
                        $user->setNewpassword( $password );
                        $user->saveSettings();
-                       $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password )->plain(); // We'll escape the whole thing later
+                       $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password
+                               )->inLanguage( $userLanguage )->plain(); // We'll escape the whole thing later
                }
                $passwordBlock = implode( "\n\n", $passwords );
 
-               // Send in the user's language; which should hopefully be the same
-               $userLanguage = $firstUser->getOption( 'language' );
-
                $this->email = $this->msg( $msg )->inLanguage( $userLanguage );
                $this->email->params(
                        $username,
index 81143d2..f6078dc 100644 (file)
@@ -714,26 +714,6 @@ abstract class UploadBase {
                return $this->mLocalFile;
        }
 
-       /**
-        * NOTE: Probably should be deprecated in favor of UploadStash, but this is sometimes
-        * called outside that context.
-        *
-        * Stash a file in a temporary directory for later processing
-        * after the user has confirmed it.
-        *
-        * If the user doesn't explicitly cancel or accept, these files
-        * can accumulate in the temp directory.
-        *
-        * @param $saveName String: the destination filename
-        * @param $tempSrc String: the source temporary file to save
-        * @return String: full path the stashed file, or false on failure
-        */
-       protected function saveTempUploadedFile( $saveName, $tempSrc ) {
-               $repo = RepoGroup::singleton()->getLocalRepo();
-               $status = $repo->storeTemp( $saveName, $tempSrc );
-               return $status;
-       }
-
        /**
         * If the user does not supply all necessary information in the first upload form submission (either by accident or
         * by design) then we may want to stash the file temporarily, get more information, and publish the file later.
index d705b49..1ef5a74 100644 (file)
@@ -2597,16 +2597,35 @@ class Language {
        }
 
        /**
-        * A hidden direction mark (LRM or RLM), depending on the language direction
+        * A hidden direction mark (LRM or RLM), depending on the language direction.
+        * Unlike getDirMark(), this function returns the character as an HTML entity.
+        * This function should be used when the output is guaranteed to be HTML,
+        * because it makes the output HTML source code more readable. When
+        * the output is plain text or can be escaped, getDirMark() should be used.
+        *
+        * @param $opposite Boolean Get the direction mark opposite to your language
+        * @return string
+        */
+       function getDirMarkEntity( $opposite = false ) {
+               if ( $opposite ) { return $this->isRTL() ? '&lrm;' : '&rlm;'; }
+               return $this->isRTL() ? '&rlm;' : '&lrm;';
+       }
+
+       /**
+        * A hidden direction mark (LRM or RLM), depending on the language direction.
+        * This function produces them as invisible Unicode characters and
+        * the output may be hard to read and debug, so it should only be used
+        * when the output is plain text or can be escaped. When the output is
+        * HTML, use getDirMarkEntity() instead.
         *
         * @param $opposite Boolean Get the direction mark opposite to your language
         * @return string
         */
        function getDirMark( $opposite = false ) {
-               $rtl = "\xE2\x80\x8F";
-               $ltr = "\xE2\x80\x8E";
-               if ( $opposite ) { return $this->isRTL() ? $ltr : $rtl; }
-               return $this->isRTL() ? $rtl : $ltr;
+               $lrm = "\xE2\x80\x8E"; # LEFT-TO-RIGHT MARK, commonly abbreviated LRM
+               $rlm = "\xE2\x80\x8F"; # RIGHT-TO-LEFT MARK, commonly abbreviated RLM
+               if ( $opposite ) { return $this->isRTL() ? $lrm : $rlm; }
+               return $this->isRTL() ? $rlm : $lrm;
        }
 
        /**
index 2f3cc12..c0f63ed 100644 (file)
@@ -1372,7 +1372,7 @@ Custom .css and .js pages use a lowercase title, e.g. {{ns:user}}:Foo/vector.css
 'updated'                          => '(Updated)',
 'note'                             => "'''Note:'''",
 'previewnote'                      => "'''Remember that this is only a preview.'''
-Your changes have not yet been saved!",
+Your changes have not yet been saved! [[#editform|→ Continue editing]]",
 'previewconflict'                  => 'This preview reflects the text in the upper text editing area as it will appear if you choose to save.',
 'session_fail_preview'             => "'''Sorry! We could not process your edit due to a loss of session data.'''
 Please try again.
@@ -2404,6 +2404,10 @@ A [[Special:WhatLinksHere/$2|full list]] is available.',
 Please see the [$2 file description page] for further information.',
 'sharedupload-desc-here'            => 'This file is from $1 and may be used by other projects.
 The description on its [$2 file description page] there is shown below.',
+'sharedupload-desc-edit'            => 'This file is from $1 and may be used by other projects.
+Maybe you want edit the description on its [$2 file description page] there.',
+'sharedupload-desc-create'          => 'This file is from $1 and may be used by other projects.
+Maybe you want edit the description on its [$2 file description page] there.',
 'shareddescriptionfollows'          => '-', # do not translate or duplicate this message to other languages
 'filepage-nofile'                   => 'No file by this name exists.',
 'filepage-nofile-link'              => 'No file by this name exists, but you can [$1 upload it].',
@@ -3069,6 +3073,7 @@ The latest block log entry is provided below for reference:',
 'sp-contributions-explain'             => '', # only translate this message to other languages if you have to change it
 'sp-contributions-footer'              => '-', # do not translate or duplicate this message to other languages
 'sp-contributions-footer-anon'         => '-', # do not translate or duplicate this message to other languages
+'sp-contributions-footer-newbies'      => '-', # do not translate or duplicate this message to other languages
 
 # What links here
 'whatlinkshere'            => 'What links here',
index 0f57a4e..4eb4b0d 100644 (file)
@@ -2066,6 +2066,8 @@ Example: [[:Image:Addon-icn.png]]',
 {{doc-important|Do not customise this message. Just translate it.|Customisation should be done by local wikis.}}',
 'sharedupload-desc-there'           => ':See also: {{msg-mw|Sharedupload}}',
 'sharedupload-desc-here'            => ':See also: {{msg-mw|Sharedupload}}',
+'sharedupload-desc-edit'            => ':See also: {{msg-mw|Sharedupload}}',
+'sharedupload-desc-create'          => ':See also: {{msg-mw|Sharedupload}}',
 'filepage-nofile'                   => "This message appears when visiting a File page for which there's no file, if the user cannot upload files, or file uploads are disabled. (Otherwise, see {{msg-mw|Filepage-nofile-link}})
 
 Filepage-nofile and Filepage-nofile-link message deprecate {{msg-mw|Noimage}}",
index cc34d48..c61ae39 100644 (file)
@@ -136,6 +136,7 @@ $wgIgnoredMessages = array(
        'sitetitle',
        'sp-contributions-footer',
        'sp-contributions-footer-anon',
+       'sp-contributions-footer-newbies',
        'statistics-summary',
        'statistics-footer',
        'talkpagetext',
index 093305e..29c5c05 100644 (file)
@@ -1494,6 +1494,8 @@ $wgMessageStructure = array(
                'sharedupload',
                'sharedupload-desc-there',
                'sharedupload-desc-here',
+               'sharedupload-desc-edit',
+               'sharedupload-desc-create',
                'shareddescriptionfollows',
                'filepage-nofile',
                'filepage-nofile-link',
@@ -1748,6 +1750,7 @@ $wgMessageStructure = array(
                'allpagesprefix',
                'allpagesbadtitle',
                'allpages-bad-ns',
+               'allpages-hide-redirects',
        ),
        'categories' => array(
                'categories',
@@ -2080,6 +2083,7 @@ $wgMessageStructure = array(
                'sp-contributions-explain',
                'sp-contributions-footer',
                'sp-contributions-footer-anon',
+               'sp-contributions-footer-newbies',
        ),
        'whatlinkshere' => array(
                'whatlinkshere',
index 514da42..d9ea7b5 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 /**
+ * @group API
  * @group Database
  */
 class ApiBlockTest extends ApiTestCase {
index 70c2074..2566c6c 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 /**
+ * @group API
  * @group Database
  */
 class ApiPurgeTest extends ApiTestCase {
index ae05a30..a4b9dc7 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 /**
+ * @group API
  * @group Database
  */
 class ApiQueryTest extends ApiTestCase {
index 1d9c323..c3eacd5 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 /**
+ * @group API
  * @group Database
  */
 class ApiTest extends ApiTestCase {
index b780374..d2c742a 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 
 /**
+ * @group API
  * @group Database
- * @todo This test suite is severly broken and need a full review 
+ * @todo This test suite is severly broken and need a full review
  */
 class ApiWatchTest extends ApiTestCase {
 
@@ -10,7 +11,7 @@ class ApiWatchTest extends ApiTestCase {
                parent::setUp();
                $this->doLogin();
        }
-       
+
        function getTokens() {
                return $this->getTokenList( self::$users['sysop'] );
        }
@@ -19,9 +20,9 @@ class ApiWatchTest extends ApiTestCase {
         * @group Broken
         */
        function testWatchEdit() {
-               
+
                $data = $this->getTokens();
-               
+
                $keys = array_keys( $data[0]['query']['pages'] );
                $key = array_pop( $keys );
                $pageinfo = $data[0]['query']['pages'][$key];
@@ -44,7 +45,7 @@ class ApiWatchTest extends ApiTestCase {
         * @group Broken
         */
        function testWatchClear() {
-       
+
                $data = $this->doApiRequest( array(
                        'action' => 'query',
                        'list' => 'watchlist' ), $data );
@@ -71,11 +72,11 @@ class ApiWatchTest extends ApiTestCase {
 
        /**
         * @group Broken
-        */      
+        */
        function testWatchProtect() {
-               
+
                $data = $this->getTokens();
-               
+
                $keys = array_keys( $data[0]['query']['pages'] );
                $key = array_pop( $keys );
                $pageinfo = $data[0]['query']['pages'][$key];
@@ -97,9 +98,9 @@ class ApiWatchTest extends ApiTestCase {
         * @group Broken
         */
        function testGetRollbackToken() {
-               
+
                $data = $this->getTokens();
-               
+
                if ( !Title::newFromText( 'UTPage' )->exists() ) {
                        $this->markTestIncomplete( "The article [[UTPage]] does not exist" );
                }
@@ -159,9 +160,9 @@ class ApiWatchTest extends ApiTestCase {
         * @group Broken
         */
        function testWatchDelete() {
-               
+
                $data = $this->getTokens();
-               
+
                $keys = array_keys( $data[0]['query']['pages'] );
                $key = array_pop( $keys );
                $pageinfo = $data[0]['query']['pages'][$key];