avoid calling things on $wgTitle that might be not yet initialized
authorDomas Mituzas <midom@users.mediawiki.org>
Sun, 13 Jan 2008 12:29:43 +0000 (12:29 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sun, 13 Jan 2008 12:29:43 +0000 (12:29 +0000)
includes/OutputPage.php

index 7c5af28..a0f3fca 100644 (file)
@@ -825,9 +825,9 @@ class OutputPage {
         */
        public function showErrorPage( $title, $msg, $params = array() ) {
                global $wgTitle;
-
-               $this->mDebugtext .= 'Original title: ' .
-               $wgTitle->getPrefixedText() . "\n";
+               if ( isset($wgTitle) ) {
+                       $this->mDebugtext .= 'Original title: ' . $wgTitle->getPrefixedText() . "\n";
+               }
                $this->setPageTitle( wfMsg( $title ) );
                $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
                $this->setRobotpolicy( 'noindex,nofollow' );