Revision: 43621
Author:   brion
Date:     2008-11-17 18:51:21 +0000 (Mon, 17 Nov 2008)

Log Message:
-----------
* Safer handling of non-MediaWiki exceptions -- now obeys our settings for 
formatting and path exposure.

Applying Tim's fixes...

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/Exception.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2008-11-17 18:48:49 UTC (rev 43620)
+++ trunk/phase3/RELEASE-NOTES  2008-11-17 18:51:21 UTC (rev 43621)
@@ -344,7 +344,10 @@
 * (bug 5530) Consistency between character encoding in {{PAGENAMEE}},
   {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}}
 * API siteinfo query no longer throws an exception for empty sifilter 
parameter.
+* Safer handling of non-MediaWiki exceptions -- now obeys our settings for
+  formatting and path exposure.
 
+
 === API changes in 1.14 ===
 
 * Registration time of users registered before the DB field was created is now

Modified: trunk/phase3/includes/Exception.php
===================================================================
--- trunk/phase3/includes/Exception.php 2008-11-17 18:48:49 UTC (rev 43620)
+++ trunk/phase3/includes/Exception.php 2008-11-17 18:51:21 UTC (rev 43621)
@@ -283,7 +283,16 @@
                         }
                 }
         } else {
-                echo $e->__toString();
+                $message = "Unexpected non-MediaWiki exception encountered, of 
type \"" . get_class( $e ) . "\"\n" .
+                        $e->__toString() . "\n";
+                if ( $GLOBALS['wgShowExceptionDetails'] ) {
+                        $message .= "\n" . $e->getTraceAsString() ."\n";
+                }
+                if ( !empty( $GLOBALS['wgCommandLineMode'] ) ) {
+                        wfPrintError( $message );
+                } else {
+                        echo nl2br( htmlspecialchars( $message ) ). "\n";
+                }
         }
 }
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to