Follow up r64936. Even better, provide the bug number and imagemagick doc page.
[lhc/web/wiklou.git] / includes / Exception.php
index dc5b72d..ddcd739 100644 (file)
@@ -8,13 +8,13 @@
  * @ingroup Exception
  */
 class MWException extends Exception {
-
        /**
         * Should the exception use $wgOut to output the error ?
         * @return bool
         */
        function useOutputPage() {
-               return !empty( $GLOBALS['wgFullyInitialised'] ) &&
+               return $this->useMessageCache() &&
+                       !empty( $GLOBALS['wgFullyInitialised'] ) &&
                        ( !empty( $GLOBALS['wgArticle'] ) || ( !empty( $GLOBALS['wgOut'] ) && !$GLOBALS['wgOut']->isArticle() ) ) &&
                        !empty( $GLOBALS['wgTitle'] );
        }
@@ -25,15 +25,20 @@ class MWException extends Exception {
         */
        function useMessageCache() {
                global $wgLang;
+               foreach ( $this->getTrace() as $frame ) {
+                       if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) {
+                               return false;
+                       }
+               }
                return is_object( $wgLang );
        }
 
        /**
         * Run hook to allow extensions to modify the text of the exception
         *
-        * @param String $name class name of the exception
-        * @param Array $args arguments to pass to the callback functions
-        * @return mixed string to output or null if any hook has been called
+        * @param $name String: class name of the exception
+        * @param $args Array: arguments to pass to the callback functions
+        * @return Mixed: string to output or null if any hook has been called
         */
        function runHooks( $name, $args = array() ) {
                global $wgExceptionHooks;
@@ -58,9 +63,9 @@ class MWException extends Exception {
        /**
         * Get a message from i18n
         *
-        * @param String $key message name
-        * @param String $fallback default message if the message cache can't be
-        *                         called by the exception
+        * @param $key String: message name
+        * @param $fallback String: default message if the message cache can't be
+        *                  called by the exception
         * The function also has other parameters that are arguments for the message
         * @return String message with arguments replaced
         */
@@ -122,7 +127,7 @@ class MWException extends Exception {
         * Return the requested URL and point to file and line number from which the
         * exception occured
         *
-        * @return string
+        * @return String
         */
        function getLogMessage() {
                global $wgRequest;