From: Chad Horohoe Date: Wed, 26 Jan 2011 17:06:18 +0000 (+0000) Subject: Last $wgArticle junk in Skin(Template). Just pass the article on hand to lastModified... X-Git-Tag: 1.31.0-rc.0~32347 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=90fdb46ae583f6fb35190a240c515ee0fef80196;p=lhc%2Fweb%2Fwiklou.git Last $wgArticle junk in Skin(Template). Just pass the article on hand to lastModified(). Nothing outside of here calls it anyway --- diff --git a/includes/Skin.php b/includes/Skin.php index a937b4cb81..b5309f412f 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1498,7 +1498,7 @@ class Skin extends Linker { if ( $wgMaxCredits != 0 ) { $s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax ); } else { - $s .= $this->lastModified(); + $s .= $this->lastModified( $article ); } if ( $wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) { @@ -1608,13 +1608,19 @@ class Skin extends Linker { return $text; } - function lastModified() { - global $wgLang, $wgArticle; + /** + * Get the timestamp of the latest revision, formatted in user language + * + * @param $article Article object. Used if we're working with the current revision + * @return String + */ + protected function lastModified( $article ) { + global $wgLang; if ( !$this->isRevisionCurrent() ) { $timestamp = Revision::getTimestampFromId( $this->mTitle, $this->mRevisionId ); } else { - $timestamp = $wgArticle->getTimestamp(); + $timestamp = $article->getTimestamp(); } if ( $timestamp ) { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index d074f1e981..752f4909dc 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -387,7 +387,7 @@ class SkinTemplate extends Skin { if( $wgMaxCredits != 0 ){ $this->credits = Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax ); } else { - $tpl->set( 'lastmod', $this->lastModified() ); + $tpl->set( 'lastmod', $this->lastModified( $article ) ); } $tpl->setRef( 'credits', $this->credits );