Followup r114233, define the method static variables to be used
authorSam Reed <reedy@users.mediawiki.org>
Tue, 20 Mar 2012 14:16:46 +0000 (14:16 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 20 Mar 2012 14:16:46 +0000 (14:16 +0000)
includes/CryptRand.php

index ef425cb..37f5ed7 100644 (file)
@@ -187,6 +187,7 @@ class MWCryptRand {
         * @return String A hash algorithm
         */
        protected function hashAlgo() {
+               static $algo;
                if ( !is_null( $algo ) ) {
                        return $algo;
                }
@@ -217,6 +218,7 @@ class MWCryptRand {
         * @return int Number of bytes the hash outputs
         */
        protected function hashLength() {
+               static $hashLength;
                if ( is_null( $hashLength ) ) {
                        $hashLength = strlen( $this->hash( '' ) );
                }