WordPress.org

Make WordPress Core

Ticket #47092: 47092-2.diff

File 47092-2.diff, 836 bytes (added by roytanck, 10 months ago)

This patch adds the $length parameter too. You get the number by using mb_strlen() on the password, but simply providing it makes more sense.

  • wp-includes/pluggable.php

     
    23882388                 * @since 3.0.0
    23892389                 *
    23902390                 * @param string $password The generated password.
     2391                 * @param int  $length              Optional. The length of password to generate.
     2392                 * @param bool $special_chars       Optional. Whether to include standard special characters.
     2393                 * @param bool $extra_special_chars Optional. Whether to include other special characters.
     2394                 *                                  Used when generating secret keys and salts.
    23912395                 */
    2392                 return apply_filters( 'random_password', $password );
     2396                return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars );
    23932397        }
    23942398endif;
    23952399