Strip HTML tags from multisite user signup validation errors#596
Merged
swissspidy merged 5 commits intomainfrom Mar 16, 2026
Merged
Strip HTML tags from multisite user signup validation errors#596swissspidy merged 5 commits intomainfrom
swissspidy merged 5 commits intomainfrom
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error message for existing email in multisite user creation
Strip HTML tags from multisite user signup validation errors
Mar 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves WP-CLI multisite user creation/import UX by sanitizing HTML markup returned by wpmu_validate_user_signup() so terminal output stays plain text.
Changes:
- Strip HTML tags from multisite signup validation error messages in
wp user create. - Strip HTML tags from multisite signup validation warnings in
wp user import-csv. - Add Behat coverage asserting duplicate-email errors contain no
<characters (with version-specific expectations).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/User_Command.php |
Sanitizes WP_Error messages from multisite signup validation before emitting errors/warnings. |
features/user.feature |
Adds multisite scenarios ensuring duplicate-email validation output is plain text (no markup). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
wpmu_validate_user_signup()returns error messages with embedded HTML (e.g.<strong>Error:</strong> This email address is already registered. <a href="...">Log in</a>), which WP-CLI displayed verbatim — leaking markup into the terminal output.Changes
User_Command::create()— applywp_strip_all_tags()to each message from theWP_Errorbefore passing toWP_CLI::error()User_Command::import_csv()— same treatment before passing toWP_CLI::warning()features/user.feature— new multisite scenario asserting the duplicate-email error is plain text and contains no<charactersBefore:
After:
Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.