Merge "Rename lessc->embeddedImages to lessc->embeddedFiles"
authorBrion VIBBER <brion@wikimedia.org>
Thu, 26 Sep 2013 00:38:59 +0000 (00:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Sep 2013 00:38:59 +0000 (00:38 +0000)
14 files changed:
RELEASE-NOTES-1.22
includes/GlobalFunctions.php
includes/OutputPage.php
includes/SpecialPage.php
includes/api/ApiEditPage.php
includes/filerepo/file/File.php
includes/filerepo/file/ForeignDBFile.php
includes/filerepo/file/LocalFile.php
includes/installer/MysqlInstaller.php
includes/libs/lessc.inc.php
languages/Language.php
languages/classes/LanguageEo.php
maintenance/refreshLinks.php
resources/mediawiki/mediawiki.js

index 44b1d36..957ee64 100644 (file)
@@ -312,6 +312,8 @@ production.
 * (bug 26811) On DB error pages, server hostnames are now hidden when both
   $wgShowHostnames and $wgShowSQLErrors are false.
 * (bug 6200) line breaks in <blockquote> are handled like they are in <div>
+* (bug 14931) Default character set now set to 'utf8' when a new MySQL
+  database is created.
 
 === API changes in 1.22 ===
 * (bug 25553) The JSON output formatter now leaves forward slashes unescaped
@@ -368,6 +370,8 @@ production.
 * (bug 49090) Token-getting functions will fail when using jsonp callbacks.
 * (bug 52699) action=upload returns normalized file name on warning
   "exists-normalized" instead of filename to be uploaded to.
+* (bug 53884) action=edit will now return an error when the specified section
+  does not exist in the page.
 
 === Languages updated in 1.22===
 
index 0c92ab6..414c822 100644 (file)
@@ -2032,6 +2032,10 @@ function wfEscapeWikiText( $text ) {
                        "\n*" => "\n&#42;", "\r*" => "\r&#42;",
                        "\n:" => "\n&#58;", "\r:" => "\r&#58;",
                        "\n " => "\n&#32;", "\r " => "\r&#32;",
+                       "\n\n" => "\n&#10;", "\r\n" => "&#13;\n",
+                       "\n\r" => "\n&#13;", "\r\r" => "\r&#13;",
+                       "\n\t" => "\n&#9;", "\r\t" => "\r&#9;", // "\n\t\n" is treated like "\n\n"
+                       "\n----" => "\n&#45;---", "\r----" => "\r&#45;---",
                        '__' => '_&#95;', '://' => '&#58;//',
                );
 
index 1d0c930..e628834 100644 (file)
@@ -1721,6 +1721,7 @@ class OutputPage extends ContextSource {
                                array(
                                        "{$wgCookiePrefix}Token",
                                        "{$wgCookiePrefix}LoggedOut",
+                                       "forceHTTPS",
                                        session_name()
                                ),
                                $wgCacheVaryCookies
index 94782db..61630a9 100644 (file)
@@ -1229,6 +1229,15 @@ class SpecialCreateAccount extends SpecialRedirectToSpecial {
        function __construct() {
                parent::__construct( 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) );
        }
+
+       // No reason to hide this link on Special:Specialpages
+       public function isListed() {
+               return true;
+       }
+
+       protected function getGroupName() {
+               return 'login';
+       }
 }
 /**
  * SpecialMypage, SpecialMytalk and SpecialMycontributions special pages
index d14219f..bd61895 100644 (file)
@@ -280,6 +280,10 @@ class ApiEditPage extends ApiBase {
                        if ( $section == 0 && $params['section'] != '0' && $params['section'] != 'new' ) {
                                $this->dieUsage( "The section parameter must be set to an integer or 'new'", "invalidsection" );
                        }
+                       $content = $pageObj->getContent();
+                       if ( $section !== 0 && ( !$content || !$content->getSection( $section ) ) ) {
+                               $this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
+                       }
                        $requestArray['wpSection'] = $params['section'];
                } else {
                        $requestArray['wpSection'] = '';
index 05cb000..ec5f927 100644 (file)
@@ -1657,18 +1657,22 @@ abstract class File {
        /**
         * Get the HTML text of the description page, if available
         *
+        * @param $lang Language Optional language to fetch description in
         * @return string
         */
-       function getDescriptionText() {
+       function getDescriptionText( $lang = false ) {
                global $wgMemc, $wgLang;
                if ( !$this->repo || !$this->repo->fetchDescription ) {
                        return false;
                }
-               $renderUrl = $this->repo->getDescriptionRenderUrl( $this->getName(), $wgLang->getCode() );
+               if ( !$lang ) {
+                       $lang = $wgLang;
+               }
+               $renderUrl = $this->repo->getDescriptionRenderUrl( $this->getName(), $lang->getCode() );
                if ( $renderUrl ) {
                        if ( $this->repo->descriptionCacheExpiry > 0 ) {
                                wfDebug( "Attempting to get the description from cache..." );
-                               $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', 'url', $wgLang->getCode(),
+                               $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', 'url', $lang->getCode(),
                                                                        $this->getName() );
                                $obj = $wgMemc->get( $key );
                                if ( $obj ) {
index ee5883c..01d6b0f 100644 (file)
@@ -120,10 +120,11 @@ class ForeignDBFile extends LocalFile {
        }
 
        /**
+        * @param $lang Language Optional language to fetch description in.
         * @return string
         */
-       function getDescriptionText() {
+       function getDescriptionText( $lang = false ) {
                // Restore remote behavior
-               return File::getDescriptionText();
+               return File::getDescriptionText( $lang );
        }
 }
index 91dacf8..4edcebf 100644 (file)
@@ -1672,9 +1672,11 @@ class LocalFile extends File {
         * Get the HTML text of the description page
         * This is not used by ImagePage for local files, since (among other things)
         * it skips the parser cache.
+        *
+        * @param $lang Language What language to get description in (Optional)
         * @return bool|mixed
         */
-       function getDescriptionText() {
+       function getDescriptionText( $lang = null ) {
                $revision = Revision::newFromTitle( $this->title, false, Revision::READ_NORMAL );
                if ( !$revision ) {
                        return false;
@@ -1683,7 +1685,7 @@ class LocalFile extends File {
                if ( !$content ) {
                        return false;
                }
-               $pout = $content->getParserOutput( $this->title, null, new ParserOptions() );
+               $pout = $content->getParserOutput( $this->title, null, new ParserOptions( null, $lang ) );
                return $pout->getText();
        }
 
index e0bf3d7..c0b5243 100644 (file)
@@ -89,8 +89,10 @@ class MysqlInstaller extends DatabaseInstaller {
                return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
-                       $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
-                       $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) .
+                       $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ),
+                               $this->parent->getHelpBox( 'config-db-name-help' ) ) .
+                       $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ),
+                               $this->parent->getHelpBox( 'config-db-prefix-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
                        $this->getInstallUserBox();
        }
@@ -475,7 +477,7 @@ class MysqlInstaller extends DatabaseInstaller {
                $conn = $status->value;
                $dbName = $this->getVar( 'wgDBname' );
                if ( !$conn->selectDB( $dbName ) ) {
-                       $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ), __METHOD__ );
+                       $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ) . "CHARACTER SET utf8", __METHOD__ );
                        $conn->selectDB( $dbName );
                }
                $this->setupSchemaVars();
index a767edc..6db21be 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * lessphp v0.4.0
+ * lessphp v0.4.0@785ad53840
  * http://leafo.net/lessphp
  *
  * LESS css compiler, adapted from http://lesscss.org
@@ -11,7 +11,7 @@
  *
  * MIT LICENSE
  *
- * Copyright (c) 2010-2012 Leaf Corcoran, http://leafo.net/lessphp
+ * Copyright 2013, Leaf Corcoran <leafot@gmail.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -1037,8 +1037,14 @@ class lessc {
        }
 
        protected function lib_round($arg) {
-               $value = $this->assertNumber($arg);
-               return array("number", round($value), $arg[2]);
+               if($arg[0] != "list") {
+                       $value = $this->assertNumber($arg);
+                       return array("number", round($value), $arg[2]);
+               } else {
+                       $value = $this->assertNumber($arg[2][0]);
+                       $precision = $this->assertNumber($arg[2][1]);
+                       return array("number", round($value, $precision), $arg[2][0][2]);
+               }
        }
 
        protected function lib_unit($arg) {
index 20bef5d..f1b7fa6 100644 (file)
@@ -3068,7 +3068,7 @@ class Language {
         * Normally we output all numbers in plain en_US style, that is
         * 293,291.235 for twohundredninetythreethousand-twohundredninetyone
         * point twohundredthirtyfive. However this is not suitable for all
-        * languages, some such as Pakaran want ੨੯੩,੨੯੫.੨੩੫ and others such as
+        * languages, some such as Punjabi want ੨੯੩,੨੯੫.੨੩੫ and others such as
         * Icelandic just want to use commas instead of dots, and dots instead
         * of commas like "293.291,235".
         *
index 39bdfb5..0e2d8b4 100644 (file)
@@ -114,30 +114,6 @@ class LanguageEo extends Language {
                return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu );
        }
 
-       /**
-        * @param $s string
-        * @return string
-        */
-       function checkTitleEncoding( $s ) {
-               # Check for X-system backwards-compatibility URLs
-               $ishigh = preg_match( '/[\x80-\xff]/', $s );
-               $isutf = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
-                       '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
-
-               if ( $ishigh and !$isutf ) {
-                       # Assume Latin1
-                       $s = utf8_encode( $s );
-               } elseif ( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' .
-                               '|\xc5[\x9c\x9d\xac\xad])/', $s )
-               ) {
-                       return $s;
-               }
-
-               // if( preg_match( '/[cghjsu]x/i', $s ) )
-               //      return $this->iconv( 'x', 'utf-8', $s );
-               return $s;
-       }
-
        function initEncoding() {
                global $wgEditEncoding;
                $wgEditEncoding = 'x';
index 0e6725c..98ea930 100644 (file)
@@ -160,7 +160,7 @@ class RefreshLinks extends Maintenance {
                        }
 
                        if ( !$redirectsOnly ) {
-                               $this->output( "Refreshing links table.\n" );
+                               $this->output( "Refreshing links tables.\n" );
                                $this->output( "Starting from page_id $start of $end.\n" );
 
                                for ( $id = $start; $id <= $end; $id++ ) {
index 741e231..d1a541e 100644 (file)
@@ -1205,6 +1205,16 @@ var mw = ( function ( $, undefined ) {
 
                        /* Public Methods */
                        return {
+                               /**
+                                * The module registry is exposed as an aid for debugging and inspecting page
+                                * state; it is not a public interface for modifying the registry.
+                                *
+                                * @see #registry
+                                * @property
+                                * @private
+                                */
+                               moduleRegistry: registry,
+
                                /**
                                 * @inheritdoc #newStyleTag
                                 * @method