https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114283

Revision: 114283
Author:   dantman
Date:     2012-03-20 17:22:32 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
Backport r114272, Reedy's fix for r114233 to REL1_17, REL1_18, and REL1_19.

Modified Paths:
--------------
    branches/REL1_17/phase3/includes/CryptRand.php
    branches/REL1_18/phase3/includes/CryptRand.php
    branches/REL1_19/phase3/includes/CryptRand.php

Modified: branches/REL1_17/phase3/includes/CryptRand.php
===================================================================
--- branches/REL1_17/phase3/includes/CryptRand.php      2012-03-20 17:13:03 UTC 
(rev 114282)
+++ branches/REL1_17/phase3/includes/CryptRand.php      2012-03-20 17:22:32 UTC 
(rev 114283)
@@ -187,8 +187,8 @@
         * @return String A hash algorithm
         */
        protected function hashAlgo() {
-               if ( !is_null( $algo ) ) {
-                       return $algo;
+               if ( !is_null( $this->algo ) ) {
+                       return $this->algo;
                }
 
                $algos = hash_algos();
@@ -196,9 +196,9 @@
 
                foreach ( $preference as $algorithm ) {
                        if ( in_array( $algorithm, $algos ) ) {
-                               $algo = $algorithm; # assign to static
-                               wfDebug( __METHOD__ . ": Using the $algo hash 
algorithm.\n" );
-                               return $algo;
+                               $this->algo = $algorithm;
+                               wfDebug( __METHOD__ . ": Using the 
{$this->algo} hash algorithm.\n" );
+                               return $this->algo;
                        }
                }
 
@@ -217,10 +217,10 @@
         * @return int Number of bytes the hash outputs
         */
        protected function hashLength() {
-               if ( is_null( $hashLength ) ) {
-                       $hashLength = strlen( $this->hash( '' ) );
+               if ( is_null( $this->hashLength ) ) {
+                       $this->hashLength = strlen( $this->hash( '' ) );
                }
-               return $hashLength;
+               return $this->hashLength;
        }
 
        /**

Modified: branches/REL1_18/phase3/includes/CryptRand.php
===================================================================
--- branches/REL1_18/phase3/includes/CryptRand.php      2012-03-20 17:13:03 UTC 
(rev 114282)
+++ branches/REL1_18/phase3/includes/CryptRand.php      2012-03-20 17:22:32 UTC 
(rev 114283)
@@ -187,8 +187,8 @@
         * @return String A hash algorithm
         */
        protected function hashAlgo() {
-               if ( !is_null( $algo ) ) {
-                       return $algo;
+               if ( !is_null( $this->algo ) ) {
+                       return $this->algo;
                }
 
                $algos = hash_algos();
@@ -196,9 +196,9 @@
 
                foreach ( $preference as $algorithm ) {
                        if ( in_array( $algorithm, $algos ) ) {
-                               $algo = $algorithm; # assign to static
-                               wfDebug( __METHOD__ . ": Using the $algo hash 
algorithm.\n" );
-                               return $algo;
+                               $this->algo = $algorithm;
+                               wfDebug( __METHOD__ . ": Using the 
{$this->algo} hash algorithm.\n" );
+                               return $this->algo;
                        }
                }
 
@@ -217,10 +217,10 @@
         * @return int Number of bytes the hash outputs
         */
        protected function hashLength() {
-               if ( is_null( $hashLength ) ) {
-                       $hashLength = strlen( $this->hash( '' ) );
+               if ( is_null( $this->hashLength ) ) {
+                       $this->hashLength = strlen( $this->hash( '' ) );
                }
-               return $hashLength;
+               return $this->hashLength;
        }
 
        /**

Modified: branches/REL1_19/phase3/includes/CryptRand.php
===================================================================
--- branches/REL1_19/phase3/includes/CryptRand.php      2012-03-20 17:13:03 UTC 
(rev 114282)
+++ branches/REL1_19/phase3/includes/CryptRand.php      2012-03-20 17:22:32 UTC 
(rev 114283)
@@ -187,8 +187,8 @@
         * @return String A hash algorithm
         */
        protected function hashAlgo() {
-               if ( !is_null( $algo ) ) {
-                       return $algo;
+               if ( !is_null( $this->algo ) ) {
+                       return $this->algo;
                }
 
                $algos = hash_algos();
@@ -196,9 +196,9 @@
 
                foreach ( $preference as $algorithm ) {
                        if ( in_array( $algorithm, $algos ) ) {
-                               $algo = $algorithm; # assign to static
-                               wfDebug( __METHOD__ . ": Using the $algo hash 
algorithm.\n" );
-                               return $algo;
+                               $this->algo = $algorithm;
+                               wfDebug( __METHOD__ . ": Using the 
{$this->algo} hash algorithm.\n" );
+                               return $this->algo;
                        }
                }
 
@@ -217,10 +217,10 @@
         * @return int Number of bytes the hash outputs
         */
        protected function hashLength() {
-               if ( is_null( $hashLength ) ) {
-                       $hashLength = strlen( $this->hash( '' ) );
+               if ( is_null( $this->hashLength ) ) {
+                       $this->hashLength = strlen( $this->hash( '' ) );
                }
-               return $hashLength;
+               return $this->hashLength;
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to