Skip to content
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: Validation for --url Parameter in Multisite Environment #5943

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shubham07kb
Copy link

@shubham07kb shubham07kb commented Apr 30, 2024

This pull request addresses issue #5716 by adding validation for the --url parameter in a Multisite environment. The validation checks the domain and path using the get_sites() function provided by WordPress.

Changes Made:

  • Added validation for the --url parameter to check the domain and path against Multisite installations using get_sites().
  • Ignored scheme check (HTTP and HTTPS) as the get_sites() function does not pass the scheme in CLI.
  • Added the validation logic after WordPress is loaded, as it requires the get_sites() function, which is a WordPress function.
  • This enhancement makes sure only correct site URL and path passes through --url.

Screenshot:
Screenshot 2024-04-30 at 11 52 57 AM
Similarly, work with subdirectory is we pass path.

Please review and let me know if any further changes are needed.

@shubham07kb shubham07kb requested a review from a team as a code owner April 30, 2024 06:04
@swissspidy
Copy link
Member

Thanks for the PR! 🥳
Is it possible to add some tests for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants