From 7771508b5d7dd86aaa026e1d34f17f6a0764fe73 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 19 Aug 2006 03:11:49 +0000 Subject: [PATCH] Made monobook work when $wgArticle is null, this is currently the case on a read access denied error. --- includes/SkinTemplate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 496219dbce..a3580d9146 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -320,7 +320,9 @@ class SkinTemplate extends Skin { $tpl->setRef( 'newtalk', $ntl ); $tpl->setRef( 'skin', $this); $tpl->set( 'logo', $this->logoText() ); - if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) { + if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and + $wgArticle and 0 != $wgArticle->getID() ) + { if ( !$wgDisableCounters ) { $viewcount = $wgLang->formatNum( $wgArticle->getCount() ); if ( $viewcount ) { @@ -814,7 +816,7 @@ class SkinTemplate extends Skin { // A print stylesheet is attached to all pages, but nobody ever // figures that out. :) Add a link... if( $this->iscontent && ($action == '' || $action == 'view' || $action == 'purge' ) ) { - $revid = $wgArticle->getLatest(); + $revid = $wgArticle ? $wgArticle->getLatest() : 0; if ( !( $revid == 0 ) ) $nav_urls['print'] = array( 'text' => wfMsg( 'printableversion' ), -- 2.20.1