Pass message params as array to RawMessage
[lhc/web/wiklou.git] / includes / specialpage / AuthManagerSpecialPage.php
index c56cc65..65cd2d2 100644 (file)
@@ -157,7 +157,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage {
                                if ( $request->wasPosted() ) {
                                        // unique ID in case the same special page is open in multiple browser tabs
                                        $uniqueId = MWCryptRand::generateHex( 6 );
-                                       $key = $key . ':' . $uniqueId;
+                                       $key .= ':' . $uniqueId;
 
                                        $queryParams = [ 'authUniqueId' => $uniqueId ] + $queryParams;
                                        $authData = array_diff_key( $request->getValues(),
@@ -181,7 +181,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage {
 
                $uniqueId = $request->getVal( 'authUniqueId' );
                if ( $uniqueId ) {
-                       $key = $key . ':' . $uniqueId;
+                       $key .= ':' . $uniqueId;
                        $authData = $authManager->getAuthenticationSessionData( $key );
                        if ( $authData ) {
                                $authManager->removeAuthenticationSessionData( $key );
@@ -429,7 +429,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage {
                                // accidentally returning it so best check and fix
                                $status = Status::wrap( $status );
                        } elseif ( is_string( $status ) ) {
-                               $status = Status::newFatal( new RawMessage( '$1', $status ) );
+                               $status = Status::newFatal( new RawMessage( '$1', [ $status ] ) );
                        } elseif ( is_array( $status ) ) {
                                if ( is_string( reset( $status ) ) ) {
                                        $status = Status::newFatal( ...$status );
@@ -710,7 +710,6 @@ abstract class AuthManagerSpecialPage extends SpecialPage {
         * are shown closer to the bottom; weight defaults to 0. Negative weight is allowed.)
         * Keep order if weights are equal.
         * @param array &$formDescriptor
-        * @return array
         */
        protected static function sortFormDescriptorFields( array &$formDescriptor ) {
                $i = 0;