Skip to content

Commit

Permalink
Docs: Improve the usefulness of docs for wp_generate_password() by …
Browse files Browse the repository at this point in the history
…noting the use of wp_rand() vs `rand()` or `mt_rand()`.

Props webdevmattcrom.
Fixes #42782.

Built from https://develop.svn.wordpress.org/trunk@42373


git-svn-id: http://core.svn.wordpress.org/trunk@42202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
DrewAPicture committed Dec 4, 2017
1 parent 39c7daf commit f4faaa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,9 @@ function wp_check_password( $password, $hash, $user_id = '' ) {
/**
* Generates a random password drawn from the defined set of characters.
*
* Uses wp_rand() is used to create passwords with far less predictability
* than similar native PHP functions like `rand()` or `mt_rand()`.
*
* @since 2.5.0
*
* @param int $length Optional. The length of password to generate. Default 12.
Expand Down Expand Up @@ -2348,7 +2351,7 @@ function wp_generate_password( $length = 12, $special_chars = true, $extra_speci

if ( ! function_exists( 'wp_rand' ) ) :
/**
* Generates a random number
* Generates a random number.
*
* @since 2.6.2
* @since 4.4.0 Uses PHP7 random_int() or the random_compat library if available.
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42368';
$wp_version = '5.0-alpha-42373';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit f4faaa5

Please sign in to comment.