Parameters Removed from Redirect URL Target
-
I need someone with many years of WordPress experience to suggest why passing a very long URL with multiple parameters to wp_safe_redirect() results in being taken to the dashboard and none of those parameters being in the address bar.
I’m desperate for help on this after days spent on it so massive thanks in advice for any tips that help me to make progress.
Works In Some Blogs
This happens in my client’s site and not in my own sites. All plugins are disabled and logging is in play and yet we do not arrive where we are meant to. I have logged the URL on the line before wp_safe_redirect() is called and you can be sure that the URL is as expected.As I said it works on my blog.
TwitchPress Plugin
My user enters Twitch.tv API application credentials and on the submission they are sent to Twitch.tv to complete the oAuth2 procedure. This step involves a use of wp_safe_redirect() to send the user there.
On returning the plugin detects oAuth credentials in URL (code, scope, state) and processes them accordingly. That all works great and is confirmed by admin notices. The plugin then attempts to send the user back to the original admin view they were on before they were sent to Twitch.tv. This is so that they can continue the setup procedure.
The URL passed to wp_safe_redirect is always correct and yet the actual destination is not. I have tested for days with all plugins disabled and endless approaches to logging. Logging all redirects using the filter hook shows me nothing but the intended target URL.
No Extra Redirects in Log
Logically we might think there is another redirect after my one. The problem with that is I setup logging on all WordPress redirects and there were no logs after the expect one. Without a lot of experience, I would say it sounds like a server behavior, maybe security related.Example
Example URLOn my site I would arrive on the page. On my clients site I arrive at wp-admin (dashboard) because the page value and all others is removed.
- The topic ‘Parameters Removed from Redirect URL Target’ is closed to new replies.