Fix user related direct member variable access
authorSam Reed <reedy@users.mediawiki.org>
Thu, 16 Feb 2012 00:54:34 +0000 (00:54 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 16 Feb 2012 00:54:34 +0000 (00:54 +0000)
includes/Action.php
includes/AjaxResponse.php
includes/EditPage.php
includes/Export.php
includes/Preferences.php
includes/SpecialPage.php
includes/Title.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserrights.php
maintenance/Maintenance.php

index 60b3991..84c0f80 100644 (file)
@@ -277,7 +277,7 @@ abstract class Action {
                }
 
                if ( $this->requiresUnblock() && $user->isBlocked() ) {
-                       $block = $user->mBlock;
+                       $block = $user->getBlock();
                        throw new UserBlockedError( $block );
                }
 
index e946397..d3aec74 100644 (file)
@@ -163,7 +163,7 @@ class AjaxResponse {
                }
 
                $timestamp = wfTimestamp( TS_MW, $timestamp );
-               $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->mTouched, $wgCacheEpoch ) );
+               $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->getTouched(), $wgCacheEpoch ) );
 
                if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
                        # IE sends sizes after the date like this:
@@ -181,11 +181,11 @@ class AjaxResponse {
                                $this->disable();
                                $this->mLastModified = $lastmod;
 
-                               wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+                               wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->getTouched() ; page: $timestamp ; site $wgCacheEpoch\n", false );
 
                                return true;
                        } else {
-                               wfDebug( "$fname: READY  client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+                               wfDebug( "$fname: READY  client: $ismodsince ; user: $wgUser->getTouched() ; page: $timestamp ; site $wgCacheEpoch\n", false );
                                $this->mLastModified = $lastmod;
                        }
                } else {
index 88a5c1c..59c9871 100644 (file)
@@ -1019,7 +1019,7 @@ class EditPage {
                                return false;
 
                        case self::AS_BLOCKED_PAGE_FOR_USER:
-                               throw new UserBlockedError( $wgUser->mBlock );
+                               throw new UserBlockedError( $wgUser->getBlock() );
 
                        case self::AS_IMAGE_REDIRECT_ANON:
                        case self::AS_IMAGE_REDIRECT_LOGGED:
@@ -2959,7 +2959,7 @@ HTML
                wfDeprecated( __METHOD__, '1.19' );
                global $wgUser;
 
-               throw new UserBlockedError( $wgUser->mBlock );
+               throw new UserBlockedError( $wgUser->getBlock() );
        }
 
        /**
index 73fa39e..35a1b5b 100644 (file)
@@ -486,13 +486,13 @@ class XmlDumpWriter {
                                $out .= '    ' . Xml::element( 'redirect', array( 'title' => self::canonicalTitle( $redirect ) ) ) . "\n";
                        }
                }
-               
+
                if ( $row->rev_sha1 ) {
-                       $out .= "      " . Xml::element('sha1', null, strval($row->rev_sha1) ) . "\n";
+                       $out .= "      " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
                } else {
                        $out .= "      <sha1/>\n";
                }
-               
+
                if ( $row->page_restrictions != '' ) {
                        $out .= '    ' . Xml::element( 'restrictions', array(),
                                strval( $row->page_restrictions ) ) . "\n";
index 3fe6a8c..2b4d352 100644 (file)
@@ -84,9 +84,9 @@ class Preferences {
                                // Already set, no problem
                                continue;
                        } elseif ( !is_null( $prefFromUser ) && // Make sure we're not just pulling nothing
-                                       $field->validate( $prefFromUser, $user->mOptions ) === true ) {
+                                       $field->validate( $prefFromUser, $user->getOptions() ) === true ) {
                                $info['default'] = $prefFromUser;
-                       } elseif ( $field->validate( $globalDefault, $user->mOptions ) === true ) {
+                       } elseif ( $field->validate( $globalDefault, $user->getOptions() ) === true ) {
                                $info['default'] = $globalDefault;
                        } else {
                                throw new MWException( "Global default '$globalDefault' is invalid for field $name" );
index 749b1c5..5ecd013 100644 (file)
@@ -891,7 +891,7 @@ abstract class FormSpecialPage extends SpecialPage {
                $this->checkPermissions();
 
                if ( $this->requiresUnblock() && $user->isBlocked() ) {
-                       $block = $user->mBlock;
+                       $block = $user->getBlock();
                        throw new UserBlockedError( $block );
                }
 
index f72a5ea..6485228 100644 (file)
@@ -1927,7 +1927,7 @@ class Title {
                        // Don't block the user from editing their own talk page unless they've been
                        // explicitly blocked from that too.
                } elseif( $user->isBlocked() && $user->mBlock->prevents( $action ) !== false ) {
-                       $block = $user->mBlock;
+                       $block = $user->getBlock();
 
                        // This is from OutputPage::blockedPage
                        // Copied at r23888 by werdna
@@ -1947,15 +1947,15 @@ class Title {
 
                        $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
                        $blockid = $block->getId();
-                       $blockExpiry = $user->mBlock->mExpiry;
-                       $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $user->mBlock->mTimestamp ), true );
+                       $blockExpiry = $block->getExpiry();
+                       $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $block->mTimestamp ), true );
                        if ( $blockExpiry == 'infinity' ) {
                                $blockExpiry = wfMessage( 'infiniteblock' )->text();
                        } else {
                                $blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true );
                        }
 
-                       $intended = strval( $user->mBlock->getTarget() );
+                       $intended = strval( $block->getTarget() );
 
                        $errors[] = array( ( $block->mAuto ? 'autoblockedtext' : 'blockedtext' ), $link, $reason, $ip, $name,
                                $blockid, $blockExpiry, $intended, $blockTimestamp );
index 3711a6a..de8ed7e 100644 (file)
@@ -157,7 +157,7 @@ class SpecialUpload extends SpecialPage {
 
                # Check blocks
                if( $user->isBlocked() ) {
-                       throw new UserBlockedError( $user->mBlock );
+                       throw new UserBlockedError( $user->getBlock() );
                }
 
                # Check whether we actually want to allow changing stuff
index e2e0f38..5835c6c 100644 (file)
@@ -72,7 +72,7 @@ class UserrightsPage extends SpecialPage {
                 * allow them to use Special:UserRights.
                 */
                if( $user->isBlocked() && !$user->isAllowed( 'userrights' ) ) {
-                       throw new UserBlockedError( $user->mBlock );
+                       throw new UserBlockedError( $user->getBlock() );
                }
 
                $request = $this->getRequest();
index ec2f4a3..d07763e 100644 (file)
@@ -297,6 +297,9 @@ abstract class Maintenance {
                return rtrim( $input );
        }
 
+       /**
+        * @return bool
+        */
        public function isQuiet() {
                return $this->mQuiet;
        }