Jump to content

Wikia code/includes/Exception.php

From mediawiki.org
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\Exception.php	2011-07-18 22:31:28.372070300 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\Exception.php	2011-08-17 15:28:46.765625000 +0100
@@ -152,6 +152,7 @@
 		if ( $this->useOutputPage() ) {
 			$wgOut->setPageTitle( $this->getPageTitle() );
 			$wgOut->setRobotPolicy( "noindex,nofollow" );
+			$wgOut->setStatusCode( 500 );
 			$wgOut->setArticleRelated( false );
 			$wgOut->enableClientCache( false );
 			$wgOut->redirect( '' );
@@ -207,9 +208,24 @@
 			header( 'Pragma: nocache' );
 		}
 		$title = $this->getPageTitle();
+
+$js = <<<EOD
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-288915-41");
+pageTracker._trackPageview("/error/MWException");
+pageTracker._trackEvent("error", "MWException");
+} catch(err) {}</script>
+EOD;
+
 		return "<html>
 		<head>
 		<title>$title</title>
+		$js
 		</head>
 		<body>
 		<h1><img src='$wgLogo' style='float:left;margin-right:1em' alt=''/>$title</h1>