WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/25/2008 05:12:56 PM (10 years ago)
Author:
ryan
Message:

Add arg to make special chars optional when generating passwords. fixes #6842 for 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-includes/pluggable.php

    r7822 r7837  
    11691169 * @return string The random password
    11701170 **/
    1171 function wp_generate_password($length = 12) {
    1172     $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
     1171function wp_generate_password($length = 12, $special_chars = true) {
     1172    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
     1173    if ( $special_chars )
     1174        $chars .= '!@#$%^&*()';
     1175
    11731176    $password = '';
    11741177    for ( $i = 0; $i < $length; $i++ )
Note: See TracChangeset for help on using the changeset viewer.