| | 1788 | |
| | 1789 | /** |
| | 1790 | * Filters a password before hashing it. |
| | 1791 | * |
| | 1792 | * @since 5.7.3 |
| | 1793 | * |
| | 1794 | * @param string $userdata['user_pass'] The user's password. |
| | 1795 | */ |
| | 1796 | $pre_hash_password = apply_filters( 'pre_hash_password', $userdata['user_pass'] ); |
| | 1797 | |
| | 1798 | if ( empty( $pre_hash_password ) ) { |
| | 1799 | return new WP_Error( 'empty_pre_hash_password', __( 'Cannot create a user with an empty password.' ) ); |
| | 1800 | } |
| | 1801 | |
| | 1802 | if ( false !== strpos( $pre_hash_password, '\\' ) ) { |
| | 1803 | return new WP_Error( 'illegal_pre_hash_password', __( 'Passwords may not contain the character "\\".' ) ); |
| | 1804 | } |
| | 1805 | |
| | 2220 | |
| | 2221 | /** This filter is documented in wp-includes/user.php */ |
| | 2222 | $pre_hash_password = apply_filters( 'pre_hash_password', $userdata['user_pass'] ); |
| | 2223 | |
| | 2224 | if ( empty( $pre_hash_password ) ) { |
| | 2225 | return new WP_Error( 'empty_pre_hash_password', __( 'Empty password.' ) ); |
| | 2226 | } |
| | 2227 | |
| | 2228 | if ( false !== strpos( $pre_hash_password, '\\' ) ) { |
| | 2229 | return new WP_Error( 'illegal_pre_hash_password', __( 'Passwords may not contain the character "\\".' ) ); |
| | 2230 | } |
| | 2231 | |