Merge "Replace $wiki with $domain in ILoadBalancer"
[lhc/web/wiklou.git] / includes / utils / MWCryptRand.php
index c5112ff..dd3ea1b 100644 (file)
@@ -67,7 +67,7 @@ class MWCryptRand {
                $state .= rand() . uniqid( mt_rand(), true );
 
                // Include some information about the filesystem's current state in the random state
-               $files = array();
+               $files = [];
 
                // We know this file is here so grab some info about ourselves
                $files[] = __FILE__;
@@ -324,7 +324,7 @@ class MWCryptRand {
                                ": Falling back to using a pseudo random state to generate randomness.\n" );
                }
                while ( strlen( $buffer ) < $bytes ) {
-                       $buffer .= MWCryptHash::hmac( $this->randomState(), mt_rand() );
+                       $buffer .= MWCryptHash::hmac( $this->randomState(), strval( mt_rand() ) );
                        // This code is never really cryptographically strong, if we use it
                        // at all, then set strong to false.
                        $this->strong = false;