Index: trunk/phase3/includes/CryptRand.php |
— | — | @@ -187,9 +187,8 @@ |
188 | 188 | * @return String A hash algorithm |
189 | 189 | */ |
190 | 190 | protected function hashAlgo() { |
191 | | - static $algo; |
192 | | - if ( !is_null( $algo ) ) { |
193 | | - return $algo; |
| 191 | + if ( !is_null( $this->algo ) ) { |
| 192 | + return $this->algo; |
194 | 193 | } |
195 | 194 | |
196 | 195 | $algos = hash_algos(); |
— | — | @@ -197,9 +196,9 @@ |
198 | 197 | |
199 | 198 | foreach ( $preference as $algorithm ) { |
200 | 199 | if ( in_array( $algorithm, $algos ) ) { |
201 | | - $algo = $algorithm; # assign to static |
202 | | - wfDebug( __METHOD__ . ": Using the $algo hash algorithm.\n" ); |
203 | | - return $algo; |
| 200 | + $this->algo = $algorithm; |
| 201 | + wfDebug( __METHOD__ . ": Using the {$this->algo} hash algorithm.\n" ); |
| 202 | + return $this->algo; |
204 | 203 | } |
205 | 204 | } |
206 | 205 | |
— | — | @@ -218,11 +217,10 @@ |
219 | 218 | * @return int Number of bytes the hash outputs |
220 | 219 | */ |
221 | 220 | protected function hashLength() { |
222 | | - static $hashLength; |
223 | | - if ( is_null( $hashLength ) ) { |
224 | | - $hashLength = strlen( $this->hash( '' ) ); |
| 221 | + if ( is_null( $this->hashLength ) ) { |
| 222 | + $this->hashLength = strlen( $this->hash( '' ) ); |
225 | 223 | } |
226 | | - return $hashLength; |
| 224 | + return $this->hashLength; |
227 | 225 | } |
228 | 226 | |
229 | 227 | /** |