r45204 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45203‎ | r45204 | r45205 >
Date:21:34, 30 December 2008
Author:brion
Status:ok
Tags:
Comment:
Revert r45038 "only call pageStats function in Skin::printFooter if $wgArticle is an object. this might not always be the case (tested with a custom skin extending the Skin class) and if so, a fatal error is shown on the page (tested with Special: pages) and footer won't be rendered"
Skin::pageStats() has checks meant to catch this already. If they're faulty, fix them there.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -917,13 +917,8 @@
918918 }
919919
920920 function printFooter() {
921 - global $wgArticle;
922 - // Under certain conditions, $wgArticle might not be an object which would cause a fatal error like this:
923 - // Fatal error: Call to a member function getID() on a non-object in ../includes/Skin.php on line 1270
924 - // To prevent this, we'll check first if $wgArticle is an object and if that's the case, then we'll load the page stats.
925 - $stats = ( is_object( $wgArticle ) ? "<p>" . $this->pageStats() . "</p>\n" : '' );
926921 return "<p>" . $this->printSource() .
927 - "</p>\n\n" . $stats;
 922+ "</p>\n\n<p>" . $this->pageStats() . "</p>\n";
928923 }
929924
930925 /** overloaded by derived classes */

Follow-up revisions

RevisionCommit summaryAuthorDate
r45247check that $wgArticle is an instance of the Article class in Skin::pageStats(...ashley19:30, 31 December 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45038only call pageStats function in Skin::printFooter if $wgArticle is an object....ashley18:47, 25 December 2008

Status & tagging log