mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a filter on wp_insert_user function regarding $user_pass (ticket #49639) #7384
Open
mklute101
wants to merge
8
commits into
WordPress:trunk
Choose a base branch
from
mklute101:fix-49639
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+48
−3
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
733682b
commiting track version
mklute101 8478f17
Replace usage of `strpos()` with `str_contains()`.
mklute101 549954b
removed use of wp_unslash as WordPress hasn't done any escaping to th…
mklute101 2d89001
update @ since tag to 6.7.0
mklute101 2a4dc77
test for empty pass and slash
mklute101 7c597dc
remove check for slash, as it seems to be allowed and caused this tes…
mklute101 7c00162
ran PHPCS
mklute101 4b0891e
remove the test for backslash
mklute101 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -2185,4 +2185,23 @@ public function export_additional_user_profile_data_with_dup_name() { | |
|
||
return $additional_profile_data; | ||
} | ||
|
||
/** | ||
* Test that an error is returned when the password is empty. | ||
* | ||
* @ticket 49639 | ||
*/ | ||
public function test_wp_insert_user_empty_password() { | ||
$user_data = array( | ||
'user_login' => 'test_user_empty', | ||
'user_email' => '[email protected]', | ||
'user_pass' => '', // Empty password | ||
); | ||
|
||
$create_user = wp_insert_user( $user_data ); | ||
|
||
$this->assertWPError( $create_user ); | ||
$this->assertSame( 'empty_pre_hash_password', $create_user->get_error_code() ); | ||
$this->assertSame( 'Cannot create a user with an empty password.', $create_user->get_error_message() ); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want the update and insert to match, so we should remove this block here as well.