* (bug 3922) Further tweaks to bidi overrides in category list for old
versions of Safari and Konqueror
* Don't die() when update.php reaches the end of the warning count
+* (bug 4071) Generate passwords long enough for $wgMinimalPasswordLength
=== Caveats ===
* @todo Check what is doing really [AV]
*/
function randomPassword() {
+ global $wgMinimalPasswordLength;
$pwchars = 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz';
$l = strlen( $pwchars ) - 1;
- $np = $pwchars{mt_rand( 0, $l )} . $pwchars{mt_rand( 0, $l )} .
- $pwchars{mt_rand( 0, $l )} . chr( mt_rand(48, 57) ) .
- $pwchars{mt_rand( 0, $l )} . $pwchars{mt_rand( 0, $l )} .
- $pwchars{mt_rand( 0, $l )};
+ $pwlength = max( 7, $wgMinimalPasswordLength );
+ $digit = mt_rand(0, $pwlength - 1);
+ $np = '';
+ for ( $i = 0; $i < $pwlength; $i++ ) {
+ $np .= $i == $digit ? chr( mt_rand(48, 57) ) : $pwchars{ mt_rand(0, $l)};
+ }
return $np;
}