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

prioritize redirect from_url validation to avoid duplicates #61

Merged
merged 1 commit into from
May 25, 2019
Merged

prioritize redirect from_url validation to avoid duplicates #61

merged 1 commit into from
May 25, 2019

Conversation

bdtech
Copy link
Contributor

@bdtech bdtech commented May 24, 2019

Issue: Currently a numeric redirect destination (based on post ID) is handled by validate_urls() before it is checked as an existing redirect $from_url. The return occurs prior to the duplicate check running.

Fix: This prioritizes validation rules to ensure we always check for possible duplicates first. Previously the array was returned if a post ID was provided before this check. Now it will display "Error: A redirect for this URI already exists" as expected.

OK (8 tests, 16 assertions). Also tested successfully based on the issue outlined by @GaryJones

@rebeccahum Issue #53

- Currently a numeric redirect destination (based on post ID) is handled by validate_urls() before it is checked as an existing URL. The return occurs prior to the duplicate check running.

- This fix prioritizes to make sure we check for possible duplicates first.
@GaryJones GaryJones added this to the 1.4.0 milestone May 25, 2019
@GaryJones GaryJones merged commit aa8ea13 into Automattic:develop May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants