var $mInlineMsg = array();
var $mTemplateIds = array();
+ var $mImageTimeKeys = array();
# What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page?
# @see ResourceLoaderModule::$origin
}
/**
- * Filter an array of modules to remove insufficiently trustworthy members
+ * Filter an array of modules to remove insufficiently trustworthy members, and modules
+ * which are no longer registered (eg a page is cached before an extension is disabled)
* @param $modules Array
* @return Array
*/
$filteredModules = array();
foreach( $modules as $val ){
$module = $resourceLoader->getModule( $val );
- if( $module->getOrigin() <= $this->getAllowedModules( $type ) ) {
+ if( $module instanceof ResourceLoaderModule
+ && $module->getOrigin() <= $this->getAllowedModules( $type ) )
+ {
$filteredModules[] = $val;
}
}
$this->mNoGallery = $parserOutput->getNoGallery();
$this->mHeadItems = array_merge( $this->mHeadItems, $parserOutput->getHeadItems() );
$this->addModules( $parserOutput->getModules() );
- // Versioning...
- foreach ( (array)$parserOutput->mTemplateIds as $ns => $dbks ) {
+
+ // Template versioning...
+ foreach ( (array)$parserOutput->getTemplateIds() as $ns => $dbks ) {
if ( isset( $this->mTemplateIds[$ns] ) ) {
$this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
} else {
$this->mTemplateIds[$ns] = $dbks;
}
}
+ // File versioning...
+ foreach ( (array)$parserOutput->getImageTimeKeys() as $dbk => $data ) {
+ $this->mImageTimeKeys[$dbk] = $data;
+ }
// Hooks registered in the object
global $wgParserOutputHooks;
$this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false );
- $name = User::whoIs( $wgUser->blockedBy() );
+ $name = $wgUser->blockedBy();
$reason = $wgUser->blockedFor();
if( $reason == '' ) {
$reason = wfMsg( 'blockednoreason' );
$link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
- $blockid = $wgUser->mBlock->mId;
+ $blockid = $wgUser->mBlock->getId();
- $blockExpiry = $wgUser->mBlock->mExpiry;
- if ( $blockExpiry == 'infinity' ) {
- // Entry in database (table ipblocks) is 'infinity' but 'ipboptions' uses 'infinite' or 'indefinite'
- // Search for localization in 'ipboptions'
- $scBlockExpiryOptions = wfMsg( 'ipboptions' );
- foreach ( explode( ',', $scBlockExpiryOptions ) as $option ) {
- if ( strpos( $option, ':' ) === false ) {
- continue;
- }
- list( $show, $value ) = explode( ':', $option );
- if ( $value == 'infinite' || $value == 'indefinite' ) {
- $blockExpiry = $show;
- break;
- }
- }
- } else {
- $blockExpiry = $wgLang->timeanddate(
- wfTimestamp( TS_MW, $blockExpiry ),
- true
- );
- }
+ $blockExpiry = $wgLang->formatExpiry( $wgUser->mBlock->mExpiry );
if ( $wgUser->mBlock->mAuto ) {
$msg = 'autoblockedtext';
/* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
* This could be a username, an IP range, or a single IP. */
- $intended = $wgUser->mBlock->mAddress;
+ $intended = $wgUser->mBlock->getTarget();
$this->addWikiMsg(
$msg, $link, $reason, $ip, $name, $blockid, $blockExpiry,
}
continue;
}
- // Special handling for user and site groups; because users might change their stuff
- // on-wiki like site or user pages, or user preferences; we need to find the highest
+ // Special handling for the user group; because users might change their stuff
+ // on-wiki like user pages, or user preferences; we need to find the highest
// timestamp of these user-changable modules so we can ensure cache misses on change
- if ( $group === 'user' || $group === 'site' ) {
+ // This should NOT be done for the site group (bug 27564) because anons get that too
+ // and we shouldn't be putting timestamps in Squid-cached HTML
+ if ( $group === 'user' ) {
// Get the maximum timestamp
$timestamp = 1;
foreach ( $modules as $module ) {