r50229 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50228‎ | r50229 | r50230 >
Date:18:43, 5 May 2009
Author:ialex
Status:ok
Tags:
Comment:
Added $wgErrorHandlerReportAfterOutput, to hide errors that occured after output (to avoid XHTML errors if it happens)
Modified paths:
  • /trunk/extensions/ErrorHandler/ErrorHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ErrorHandler/ErrorHandler.php
@@ -40,6 +40,11 @@
4141 $wgErrorHandlerAlwaysReport = false;
4242
4343 /**
 44+ * Whether to report even after output
 45+ */
 46+$wgErrorHandlerReportAfterOutput = true;
 47+
 48+/**
4449 * Log errors?
4550 * if true, this will in php error log and if it's a string and the file exists
4651 * it'll be in that file
@@ -79,9 +84,9 @@
8085 global $wgErrorHandlerErrors, $wgErrorHandlerOutputDone,
8186 $wgErrorHandlerShowBackTrace, $wgErrorHandlerReport,
8287 $wgErrorHandlerMaxStringSize, $wgErrorHandlerAlwaysReport,
83 - $wgErrorHandlerLog;
 88+ $wgErrorHandlerReportAfterOutput, $wgErrorHandlerLog;
8489 global $IP, $wgCommandLineMode;
85 - static $errorsMap = array (
 90+ static $errorsMap = array(
8691 E_ERROR => 'fatal',
8792 E_WARNING => 'warning',
8893 E_PARSE => 'parse',
@@ -187,7 +192,8 @@
188193 echo $errText;
189194 } else {
190195 if( $wgErrorHandlerOutputDone )
191 - echo efErrorGetText( $err );
 196+ if( $wgErrorHandlerReportAfterOutput )
 197+ echo efErrorGetText( $err );
192198 else
193199 $wgErrorHandlerErrors[] = $err;
194200 }

Status & tagging log