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

Cli multisite #690

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

timotei-litespeed
Copy link
Contributor

Fixed cli command:
wp --url=http://test.com/url litespeed-purge url

When using Multisite and behind LiteSpeed Web ADC

cli/purge.cls.php Outdated Show resolved Hide resolved
@hi-hai
Copy link
Collaborator

hi-hai commented Jun 27, 2024

Have you tested your change?

@timotei-litespeed
Copy link
Contributor Author

timotei-litespeed commented Jun 28, 2024

Made changes to the validation:

  • tested other actions from CLI and they were failing because of the parameter. Added test to skip validation for others than Core::ACTION_QS_PURGE
  • changed the hash to use Router::get_hash() (saw it in the code and I think it fits better)

@timotei-litespeed
Copy link
Contributor Author

@hi-hai please review the last push "Router - Get hash improvement"
Scope of the change is to allow new hashes to be generated and easy to use in future needs

src/router.cls.php Outdated Show resolved Hide resolved
src/router.cls.php Outdated Show resolved Hide resolved
CLI Purge URL - Rewrote code to check for blog to switch before sending purge request
Change hash function to allow blog switching
cli/purge.cls.php Outdated Show resolved Hide resolved
}

// Test if link can be found.
if (get_blog_id_from_url($deconstructed['host'], $path) === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if can be moved to be under line 187's else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for test if subdomain install has the domain url sent

@hi-hai hi-hai changed the base branch from dev to v6.4 July 11, 2024 20:17
Debug2::debug('[Router] LSCWP_CTRL query string - did not match admin IP: ' . $action);
return;
}

$hash = Router::get_hash(self::VALIDATE_PURGE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under the cond $action == Core::ACTION_QS_PURGE, otherwise it will update hash value for all verify_action()

@hi-hai hi-hai changed the base branch from v6.4 to dev August 6, 2024 22:25
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.

3 participants