strlen - 1. Props mdawaffe. see #6146
git-svn-id: https://develop.svn.wordpress.org/trunk@7802 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a659bd3878
commit
f6f110f7de
@ -1167,7 +1167,7 @@ function wp_generate_password($length = 12) {
|
||||
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
|
||||
$password = '';
|
||||
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;
|
||||
}
|
||||
endif;
|
||||
|
Loading…
Reference in New Issue
Block a user