.svn
*~
*.kate-swp
+.*.swp
.classpath
.idea
.metadata*
=== 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
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 ==
* 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.
--- /dev/null
+*
+!README
+!.gitignore
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
$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 );
}
$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>",
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' );
? '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,
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.
}
/**
- * 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() ? '‎' : '‏'; }
+ return $this->isRTL() ? '‏' : '‎';
+ }
+
+ /**
+ * 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;
}
/**
'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.
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].',
'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',
{{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}}",
'sitetitle',
'sp-contributions-footer',
'sp-contributions-footer-anon',
+ 'sp-contributions-footer-newbies',
'statistics-summary',
'statistics-footer',
'talkpagetext',
'sharedupload',
'sharedupload-desc-there',
'sharedupload-desc-here',
+ 'sharedupload-desc-edit',
+ 'sharedupload-desc-create',
'shareddescriptionfollows',
'filepage-nofile',
'filepage-nofile-link',
'allpagesprefix',
'allpagesbadtitle',
'allpages-bad-ns',
+ 'allpages-hide-redirects',
),
'categories' => array(
'categories',
'sp-contributions-explain',
'sp-contributions-footer',
'sp-contributions-footer-anon',
+ 'sp-contributions-footer-newbies',
),
'whatlinkshere' => array(
'whatlinkshere',
<?php
/**
+ * @group API
* @group Database
*/
class ApiBlockTest extends ApiTestCase {
<?php
/**
+ * @group API
* @group Database
*/
class ApiPurgeTest extends ApiTestCase {
<?php
/**
+ * @group API
* @group Database
*/
class ApiQueryTest extends ApiTestCase {
<?php
/**
+ * @group API
* @group Database
*/
class ApiTest extends ApiTestCase {
<?php
/**
+ * @group API
* @group Database
*/
<?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 {
parent::setUp();
$this->doLogin();
}
-
+
function getTokens() {
return $this->getTokenList( self::$users['sysop'] );
}
* @group Broken
*/
function testWatchEdit() {
-
+
$data = $this->getTokens();
-
+
$keys = array_keys( $data[0]['query']['pages'] );
$key = array_pop( $keys );
$pageinfo = $data[0]['query']['pages'][$key];
* @group Broken
*/
function testWatchClear() {
-
+
$data = $this->doApiRequest( array(
'action' => 'query',
'list' => 'watchlist' ), $data );
/**
* @group Broken
- */
+ */
function testWatchProtect() {
-
+
$data = $this->getTokens();
-
+
$keys = array_keys( $data[0]['query']['pages'] );
$key = array_pop( $keys );
$pageinfo = $data[0]['query']['pages'][$key];
* @group Broken
*/
function testGetRollbackToken() {
-
+
$data = $this->getTokens();
-
+
if ( !Title::newFromText( 'UTPage' )->exists() ) {
$this->markTestIncomplete( "The article [[UTPage]] does not exist" );
}
* @group Broken
*/
function testWatchDelete() {
-
+
$data = $this->getTokens();
-
+
$keys = array_keys( $data[0]['query']['pages'] );
$key = array_pop( $keys );
$pageinfo = $data[0]['query']['pages'][$key];