From: Sam Reed Date: Thu, 16 Feb 2012 00:54:34 +0000 (+0000) Subject: Fix user related direct member variable access X-Git-Tag: 1.31.0-rc.0~24682 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=c8eb4467f195f3c117b629c80812373ac4a34f58;p=lhc%2Fweb%2Fwiklou.git Fix user related direct member variable access --- diff --git a/includes/Action.php b/includes/Action.php index 60b399125f..84c0f808e7 100644 --- a/includes/Action.php +++ b/includes/Action.php @@ -277,7 +277,7 @@ abstract class Action { } if ( $this->requiresUnblock() && $user->isBlocked() ) { - $block = $user->mBlock; + $block = $user->getBlock(); throw new UserBlockedError( $block ); } diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index e9463972fb..d3aec74319 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -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 { diff --git a/includes/EditPage.php b/includes/EditPage.php index 88a5c1c779..59c987159c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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() ); } /** diff --git a/includes/Export.php b/includes/Export.php index 73fa39ea26..35a1b5b51e 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -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 .= " \n"; } - + if ( $row->page_restrictions != '' ) { $out .= ' ' . Xml::element( 'restrictions', array(), strval( $row->page_restrictions ) ) . "\n"; diff --git a/includes/Preferences.php b/includes/Preferences.php index 3fe6a8cc0e..2b4d352dd0 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -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" ); diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 749b1c54bd..5ecd013795 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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 ); } diff --git a/includes/Title.php b/includes/Title.php index f72a5eac88..6485228452 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 3711a6ac15..de8ed7efcd 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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 diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index e2e0f38b53..5835c6ce78 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -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(); diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index ec2f4a314a..d07763ec2c 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -297,6 +297,9 @@ abstract class Maintenance { return rtrim( $input ); } + /** + * @return bool + */ public function isQuiet() { return $this->mQuiet; }