-
Notifications
You must be signed in to change notification settings - Fork 82
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
Bugfix: Issue 208 wildcard redirects #217
Bugfix: Issue 208 wildcard redirects #217
Conversation
@amyevans many thanks for the PR, its greatly appreciated! We'll do a review on this and get back to you with any questions/concerns, but otherwise I've milestoned this for our next release. |
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.
Thank @amyevans so much! Tested and this PR worked as expected! I only have a question about the unit test. Otherwise, this one is looking good to me.
tests/php/test-core.php
Outdated
srm_create_redirect( '/one/*', $redirect_to ); | ||
add_action( | ||
'srm_do_redirect', | ||
function( $requested_path, $redirected_to, $status_code ) use ( &$redirect_to, &$redirected, &$expected ) { |
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.
Can you explain why you pass $redirect_to
and $expected
here? I don't see the usage of these variables.
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.
@amyevans are you able to explain those variables?
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.
Good catch, they aren't used, just relics from copy/pasting another test as a starting point. I'll push up a new commit removing them.
I don't know if this is related, but the following redirect rule Notice the missing slash. |
@picocodes the issue you mentioned is fixed by this PR |
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.
LGTM 🎉
Description of the Change
Fixes #208.
This PR fixes a regression introduced in 1.9.3 that caused paths to match erroneously against a rule ending in
/*
.Alternate Designs
None.
Benefits
Possible Drawbacks
Verification Process
Checklist:
Applicable Issues
#208
Changelog Entry