From 91e0c6a98c7820752388fcd1e219f01fda26b89f Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 19 Feb 2010 00:03:36 +0000 Subject: [PATCH] Allow more special characters in wp_generate_password() second pass. props sivel, see #12159 git-svn-id: http://svn.automattic.com/wordpress/trunk@13206 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 124af5e942..0a55f285cf 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1462,17 +1462,16 @@ if ( !function_exists('wp_generate_password') ) : * * @param int $length The length of password to generate * @param bool $special_chars Whether to include standard special characters. Default true. - * @param bool $extra_special_chars Whether to include more special characters. Used - * when generating secret keys and salts. Default false. + * @param bool $extra_special_chars Whether to include other special characters. Used when + * generating secret keys and salts. Default false. * @return string The random password **/ function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; - if ( $special_chars ) { + if ( $special_chars ) $chars .= '!@#$%^&*()'; - if ( $extra_special_chars ) - $chars .= '-_ []{}<>~`+=,.;:/?|'; - } + if ( $extra_special_chars ) + $chars .= '-_ []{}<>~`+=,.;:/?|'; $password = ''; for ( $i = 0; $i < $length; $i++ ) {