equal
deleted
inserted
replaced
1 <?php |
1 <?php |
2 /** |
2 /** |
3 * Error Protection API: WP_Recovery_Mode_Key_Service class |
3 * Error Protection API: WP_Recovery_Mode_Key_Service class |
4 * |
4 * |
5 * @package WordPress |
5 * @package WordPress |
6 * @since 5.2.0 |
6 * @since 5.2.0 |
7 */ |
7 */ |
8 |
8 |
9 /** |
9 /** |
10 * Core class used to generate and validate keys used to enter Recovery Mode. |
10 * Core class used to generate and validate keys used to enter Recovery Mode. |
11 * |
11 * |
24 /** |
24 /** |
25 * Creates a recovery mode token. |
25 * Creates a recovery mode token. |
26 * |
26 * |
27 * @since 5.2.0 |
27 * @since 5.2.0 |
28 * |
28 * |
29 * @return string $token A random string to identify its associated key in storage. |
29 * @return string A random string to identify its associated key in storage. |
30 */ |
30 */ |
31 public function generate_recovery_mode_token() { |
31 public function generate_recovery_mode_token() { |
32 return wp_generate_password( 22, false ); |
32 return wp_generate_password( 22, false ); |
33 } |
33 } |
34 |
34 |
38 * @since 5.2.0 |
38 * @since 5.2.0 |
39 * |
39 * |
40 * @global PasswordHash $wp_hasher |
40 * @global PasswordHash $wp_hasher |
41 * |
41 * |
42 * @param string $token A token generated by {@see generate_recovery_mode_token()}. |
42 * @param string $token A token generated by {@see generate_recovery_mode_token()}. |
43 * @return string $key Recovery mode key. |
43 * @return string Recovery mode key. |
44 */ |
44 */ |
45 public function generate_and_store_recovery_mode_key( $token ) { |
45 public function generate_and_store_recovery_mode_key( $token ) { |
46 |
46 |
47 global $wp_hasher; |
47 global $wp_hasher; |
48 |
48 |