Merge "[FileBackend] Work-around low header value limits in Swift."
authorCatrope <roan.kattouw@gmail.com>
Thu, 6 Sep 2012 17:33:20 +0000 (17:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 6 Sep 2012 17:33:20 +0000 (17:33 +0000)
RELEASE-NOTES-1.20
includes/IP.php
includes/api/ApiMove.php
includes/api/ApiQuery.php
includes/specials/SpecialLog.php

index b5892f6..51798c7 100644 (file)
@@ -234,6 +234,9 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 39284) jquery.tablesorter should not consider "."" or "?"" to be a currency.
 * (bug 39273) "Show changes" should not be incorrectly displayed in the Live Preview state.
 * Made body-content lang attribute honor the variant language when it is set.
+* (bug 36761) "Mark pages as visited" now submits previously established filter options.
+* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error.
+* (bug 36329) Accesskey tooltips for Firefox 14 on Mac should use "ctrl-option-" prefix.
 
 === API changes in 1.20 ===
 * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
@@ -250,7 +253,6 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 34927) Output media_type for list=filearchive.
 * (bug 28814) add properties to output of action=parse.
 * (bug 33224) add variants of content language to meta=siteinfo.
-* (bug 36761) "Mark pages as visited" now submits previously established filter options.
 * (bug 32643) action=purge with forcelinkupdate no longer crashes when ratelimit is reached.
 * The paraminfo module now also contains result properties for most modules.
 * (bug 32348) Allow descending order for list=alllinks.
@@ -271,8 +273,8 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 38904) prop=revisions&rvstart=... no longer blows up when continuing.
 * (bug 39032) ApiQuery generates help in constructor.
 * (bug 11142) Improve file extension blacklist error reporting in API upload.
-* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error.
-* (bug 36329) Accesskey tooltips for Firefox 14 on Mac should use "ctrl-option-" prefix.
+* (bug 39665) Cache AllowedGenerator array so it doesn't autoload all query classes
+  on every request.
 
 === Languages updated in 1.20 ===
 
index 1828249..10c707e 100644 (file)
@@ -714,6 +714,7 @@ class IP {
         * @return String: valid dotted quad IPv4 address or null
         */
        public static function canonicalize( $addr ) {
+               $addr = preg_replace( '/\%.*/','', $addr ); // remove zone info (bug 35738)
                if ( self::isValid( $addr ) ) {
                        return $addr;
                }
index 55148b1..9d73562 100644 (file)
@@ -75,6 +75,7 @@ class ApiMove extends ApiBase {
                }
 
                // Move the page
+               $toTitleExists = $toTitle->exists();
                $retval = $fromTitle->moveTo( $toTitle, true, $params['reason'], !$params['noredirect'] );
                if ( $retval !== true ) {
                        $this->dieUsageMsg( reset( $retval ) );
@@ -84,13 +85,20 @@ class ApiMove extends ApiBase {
                if ( !$params['noredirect'] || !$user->isAllowed( 'suppressredirect' ) ) {
                        $r['redirectcreated'] = '';
                }
+               if( $toTitleExists ) {
+                       $r['moveoverredirect'] = '';
+               }
 
                // Move the talk page
                if ( $params['movetalk'] && $fromTalk->exists() && !$fromTitle->isTalkPage() ) {
+                       $toTalkExists = $toTalk->exists();
                        $retval = $fromTalk->moveTo( $toTalk, true, $params['reason'], !$params['noredirect'] );
                        if ( $retval === true ) {
                                $r['talkfrom'] = $fromTalk->getPrefixedText();
                                $r['talkto'] = $toTalk->getPrefixedText();
+                               if( $toTalkExists ) {
+                                       $r['talkmoveoverredirect'] = '';
+                               }
                        } else {
                                // We're not gonna dieUsage() on failure, since we already changed something
                                $parsed = $this->parseMsg( reset( $retval ) );
@@ -231,6 +239,7 @@ class ApiMove extends ApiBase {
                                'to' => 'string',
                                'reason' => 'string',
                                'redirectcreated' => 'boolean',
+                               'moveoverredirect' => 'boolean',
                                'talkfrom' => array(
                                        ApiBase::PROP_TYPE => 'string',
                                        ApiBase::PROP_NULLABLE => true
@@ -239,6 +248,7 @@ class ApiMove extends ApiBase {
                                        ApiBase::PROP_TYPE => 'string',
                                        ApiBase::PROP_NULLABLE => true
                                ),
+                               'talkmoveoverredirect' => 'boolean',
                                'talkmove-error-code' => array(
                                        ApiBase::PROP_TYPE => 'string',
                                        ApiBase::PROP_NULLABLE => true
index 7823e2f..9c932a2 100644 (file)
@@ -111,7 +111,8 @@ class ApiQuery extends ApiBase {
                parent::__construct( $main, $action );
 
                // Allow custom modules to be added in LocalSettings.php
-               global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules;
+               global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules,
+                       $wgMemc, $wgAPICacheHelpTimeout;
                self::appendUserModules( $this->mQueryPropModules, $wgAPIPropModules );
                self::appendUserModules( $this->mQueryListModules, $wgAPIListModules );
                self::appendUserModules( $this->mQueryMetaModules, $wgAPIMetaModules );
@@ -120,8 +121,22 @@ class ApiQuery extends ApiBase {
                $this->mListModuleNames = array_keys( $this->mQueryListModules );
                $this->mMetaModuleNames = array_keys( $this->mQueryMetaModules );
 
+               // Get array of query generators from cache if present
+               $key = wfMemcKey( 'apiquerygenerators', SpecialVersion::getVersion( 'nodb' ) );
+
+               if ( $wgAPICacheHelpTimeout > 0 ) {
+                       $cached = $wgMemc->get( $key );
+                       if ( $cached ) {
+                               $this->mAllowedGenerators = $cached;
+                               return;
+                       }
+               }
                $this->makeGeneratorList( $this->mQueryPropModules );
                $this->makeGeneratorList( $this->mQueryListModules );
+
+               if ( $wgAPICacheHelpTimeout > 0 ) {
+                       $wgMemc->set( $key, $this->mAllowedGenerators, $wgAPICacheHelpTimeout );
+               }
        }
 
        /**
index 8ab0976..7800e56 100644 (file)
@@ -33,7 +33,7 @@ class SpecialLog extends SpecialPage {
        /**
         * List log type for which the target is a user
         * Thus if the given target is in NS_MAIN we can alter it to be an NS_USER
-        * Title user instead. 
+        * Title user instead.
         */
        private $typeOnUser = array(
                'block',
@@ -47,7 +47,7 @@ class SpecialLog extends SpecialPage {
 
        public function execute( $par ) {
                global $wgLogRestrictions;
-               
+
                $this->setHeaders();
                $this->outputHeader();
 
@@ -65,7 +65,7 @@ class SpecialLog extends SpecialPage {
 
                // Set values
                $opts->fetchValuesFromRequest( $this->getRequest() );
-               if ( $par ) {
+               if ( $par !== null ) {
                        $this->parseParams( $opts, (string)$par );
                }