strlen - 1. Props mdawaffe. see #6146
git-svn-id: http://svn.automattic.com/wordpress/trunk@7802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cad2447ddc
commit
0101f8809d
|
@ -1167,7 +1167,7 @@ function wp_generate_password($length = 12) {
|
||||||
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
|
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
|
||||||
$password = '';
|
$password = '';
|
||||||
for ( $i = 0; $i < $length; $i++ )
|
for ( $i = 0; $i < $length; $i++ )
|
||||||
$password .= substr($chars, mt_rand(0, strlen($chars)), 1);
|
$password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
|
||||||
return $password;
|
return $password;
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
Loading…
Reference in New Issue