Merge "Revert "Localisation updates from https://translatewiki.net.""
authorL10n-bot <l10n-bot@translatewiki.net>
Wed, 1 Feb 2017 21:03:19 +0000 (21:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 1 Feb 2017 21:03:19 +0000 (21:03 +0000)
includes/api/ApiPurge.php
includes/api/ApiQueryAllUsers.php

index 324d030..3124638 100644 (file)
@@ -37,11 +37,6 @@ class ApiPurge extends ApiBase {
         * Purges the cache of a page
         */
        public function execute() {
-               $main = $this->getMain();
-               if ( !$main->isInternalMode() && !$main->getRequest()->wasPosted() ) {
-                       $this->addDeprecation( 'apiwarn-deprecation-purge-get', 'purge-via-GET' );
-               }
-
                $params = $this->extractRequestParams();
 
                $continuationManager = new ApiContinuationManager( $this, [], [] );
@@ -60,12 +55,8 @@ class ApiPurge extends ApiBase {
                        ApiQueryBase::addTitleInfo( $r, $title );
                        $page = WikiPage::factory( $title );
                        if ( !$user->pingLimiter( 'purge' ) ) {
-                               $flags = WikiPage::PURGE_ALL;
-                               if ( !$this->getRequest()->wasPosted() ) {
-                                       $flags ^= WikiPage::PURGE_GLOBAL_PCACHE; // skip DB_MASTER write
-                               }
                                // Directly purge and skip the UI part of purge()
-                               $page->doPurge( $flags );
+                               $page->doPurge( WikiPage::PURGE_ALL );
                                $r['purged'] = true;
                        } else {
                                $this->addWarning( 'apierror-ratelimited' );
@@ -157,20 +148,7 @@ class ApiPurge extends ApiBase {
        }
 
        public function mustBePosted() {
-               // Anonymous users are not allowed a non-POST request
-               return !$this->getUser()->isAllowed( 'purge' );
-       }
-
-       protected function getHelpFlags() {
-               $flags = parent::getHelpFlags();
-
-               // Claim that we must be posted for the purposes of help and paraminfo.
-               // @todo Remove this when self::mustBePosted() is updated for T145649
-               if ( !in_array( 'mustbeposted', $flags, true ) ) {
-                       $flags[] = 'mustbeposted';
-               }
-
-               return $flags;
+               return true;
        }
 
        public function getAllowedParams( $flags = 0 ) {
index 1c3b171..21db3ca 100644 (file)
@@ -147,7 +147,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addJoinConds( [ 'ug1' => [ 'LEFT OUTER JOIN',
                                array_merge( [
                                        'ug1.ug_user=user_id',
-                                       'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                                       $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                               '1' :
+                                               'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
                                ], $exclude )
                        ] ] );
                        $this->addWhere( 'ug1.ug_user IS NULL' );
@@ -163,7 +165,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addFields( [ 'groups' =>
                                $db->buildGroupConcatField( '|', 'user_groups', 'ug_group', [
                                        'ug_user=user_id',
-                                       'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                                       $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                               '1' :
+                                               'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
                                ] )
                        ] );
                }