From f6f110f7dedc7dd40b2956ba907466369c92c143 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 24 Apr 2008 01:13:35 +0000 Subject: [PATCH] strlen - 1. Props mdawaffe. see #6146 git-svn-id: https://develop.svn.wordpress.org/trunk@7802 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;