summaryrefslogtreecommitdiffstats
path: root/wp-includes/pluggable.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/pluggable.php')
-rw-r--r--wp-includes/pluggable.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index eabf1ae..be7dda2 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -1175,8 +1175,11 @@ if ( !function_exists('wp_generate_password') ) :
*
* @return string The random password
**/
-function wp_generate_password($length = 12) {
- $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
+function wp_generate_password($length = 12, $special_chars = true) {
+ $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+ if ( $special_chars )
+ $chars .= '!@#$%^&*()';
+
$password = '';
for ( $i = 0; $i < $length; $i++ )
$password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);