Index: trunk/phase3/includes/Skin.php |
— | — | @@ -917,8 +917,13 @@ |
918 | 918 | } |
919 | 919 | |
920 | 920 | 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" : '' ); |
921 | 926 | return "<p>" . $this->printSource() . |
922 | | - "</p>\n\n<p>" . $this->pageStats() . "</p>\n"; |
| 927 | + "</p>\n\n" . $stats; |
923 | 928 | } |
924 | 929 | |
925 | 930 | /** overloaded by derived classes */ |