DBConnectionError: Expand {{SITENAME}} in pagetitle with Message::text()
authorKevin Israel <pleasestand@live.com>
Mon, 26 May 2014 17:40:34 +0000 (13:40 -0400)
committerKevin Israel <pleasestand@live.com>
Mon, 26 May 2014 17:40:34 +0000 (13:40 -0400)
Follows-up 485ff9ead94b by making the same change in DBConnectionError,
which overrides MWException::msg() to not use database messages.

Bug: 58447
Change-Id: Iafa9dd741f1f099a4a6cfb8cf655b7d5f504011a

includes/db/DatabaseError.php

index 4d5c3dc..8229c99 100644 (file)
@@ -133,17 +133,13 @@ class DBConnectionError extends DBExpectedError {
         * @return string Unprocessed plain error text with parameters replaced
         */
        function msg( $key, $fallback /*[, params...] */ ) {
-               global $wgLang;
-
                $args = array_slice( func_get_args(), 2 );
 
                if ( $this->useMessageCache() ) {
-                       $message = $wgLang->getMessage( $key );
+                       return wfMessage( $key, $args )->useDatabase( false )->text();
                } else {
-                       $message = $fallback;
+                       return wfMsgReplaceArgs( $fallback, $args );
                }
-
-               return wfMsgReplaceArgs( $message, $args );
        }
 
        /**