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