Infocaster/UrlTracker

Any url redirects to target after changing from regex to old url

Closed this issue · 1 comments

Describe the bug
_Using version: 5.2.2
When changing a redirect from regex to old url, any url starts redirecting to this target

To Reproduce
Steps to reproduce the behavior:

  1. Create redirect with regex
  2. Submit
  3. Edit redirect, remove regex and enter old url
  4. Submit
  5. See the issue

Expected behavior
Only the url that matches the old url should redirect to the new url

Additional context
This method here only filters out redirects where sourceregex is null. It should also filter out source regex with empty string.
When editing redirects, empty strings should be converted to null

This issue is fixed in 5.2.3. The issue does not apply to version 10 or 11.