forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Login and Registration: Slash email address when updating an existing…
… user. Addresses an issue with password reset keys when the email address contains special characters such as apostrophes. Props emirpprime, rajinsharwar, fnpen, hellofromTonya, oglekler, nicolefurlan. Fixes #52529. git-svn-id: https://develop.svn.wordpress.org/trunk@57711 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
1 parent
55290ed
commit d1e7c85
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -838,6 +838,28 @@ static function ( $available, WP_User $user ) { | |
} | ||
} | ||
|
||
/** | ||
* @ticket 52529 | ||
*/ | ||
public function test_reset_password_with_apostrophe_in_email() { | ||
$user_args = array( | ||
'user_email' => "jo'[email protected]", | ||
'user_pass' => 'password', | ||
); | ||
|
||
$user_id = self::factory()->user->create( $user_args ); | ||
|
||
$user = get_userdata( $user_id ); | ||
$key = get_password_reset_key( $user ); | ||
|
||
// A correctly saved key should be accepted. | ||
$check = check_password_reset_key( $key, $user->user_login ); | ||
|
||
$this->assertNotWPError( $check ); | ||
$this->assertInstanceOf( 'WP_User', $check ); | ||
$this->assertSame( $user_id, $check->ID ); | ||
} | ||
|
||
public function data_application_passwords_can_use_capability_checks_to_determine_feature_availability() { | ||
return array( | ||
'allowed' => array( 'editor', true ), | ||
|