Add a UI for allowed redirect domains
Whitelisted redirect domains are defined via a filter right now. It'd be useful to have a UI for this to remove the need for developer involvement to unblock marketing teams.
As an aside we could look at filtering the allowed domains just in time based on the redirect target. From a security standpoint if a bad actor is able to create a redirect they would presumably be able to update a stored domain whitelist as well unless we create a custom permission for admins / super admins only.
We should probably also display in the UI if a redirect won't be handled because the URL doesn't validate.
IMO, we should disable the domain validation entirely.
It'd make life a lot easier for marketing team members. There is the security trade off to consider though, perhaps we can build that part into Altis using a notification - if a new domain is added a site admin is asked to approve it by clicking a notification action.
I don't think there's a huge security concern, IMO.
wp_validate_redirect (and its counterpart, wp_safe_redirect) are specifically for the places in WP where open redirects exist. wp-login.php for example takes a redirect_to query param that could be used to send you anywhere.
In our case though, redirects have to be created by people with the capability to do so, and are static, so I don't think we need this strict validation.
I'm inclined to agree but there may be things we haven't considered like compliance / findings from ethical hacking audits - @fklein-lu made it this way originally for a reason.
In my experience of using it so far, I get tripped up every time it doesn't actually redirect.
I'm going to remove the use of wp_validate_redirect per above, as it's not the appropriate function to use here.
Hit by this, and by the fact the find-domains only lists the found domains, not trusts them, so the redirect doesn't work. Will use the workaround.