diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 8a205cdfca..c64b99dca6 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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;