FU r99323: spread blocks for edit/move attempts via the API (which uses these functions)
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 9 Oct 2011 12:30:13 +0000 (12:30 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 9 Oct 2011 12:30:13 +0000 (12:30 +0000)
includes/EditPage.php
includes/Title.php

index e5b0fbf..cece348 100644 (file)
@@ -947,6 +947,8 @@ class EditPage {
                }
 
                if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
+                       // Auto-block user's IP if the account was "hard" blocked
+                       $wgUser->spreadAnyEditBlock();
                        # Check block state against master, thus 'false'.
                        $status->setResult( false, self::AS_BLOCKED_PAGE_FOR_USER );
                        wfProfileOut( __METHOD__ . '-checks' );
index 7bcde18..84a88e3 100644 (file)
@@ -3151,8 +3151,11 @@ class Title {
         * @return Mixed true on success, getUserPermissionsErrors()-like array on failure
         */
        public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true ) {
+               global $wgUser;
                $err = $this->isValidMoveOperation( $nt, $auth, $reason );
                if ( is_array( $err ) ) {
+                       // Auto-block user's IP if the account was "hard" blocked
+                       $wgUser->spreadAnyEditBlock();
                        return $err;
                }