WordPress.org

Ready to get started?Download WordPress

Forums

Exclude @ from generated passwords (1 post)

  1. modifiedcontent
    Member
    Posted 4 years ago #

    I noticed my email client turned WP-generated passwords into email links, because they contained a '@' symbol. That's annoying.

    Is there a way to exclude '@' from password generation?

    I see the function is here:

    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, wp_rand(0, strlen($chars) - 1), 1);
    	return $password;
    }

    So can you turn off the special_chars somewhere in an admin area? Or could I turn 'true' to 'false'?

    I'll remove the @ anyway...

Topic Closed

This topic has been closed to new replies.

About this Topic