Setting options returns 404; ?update=true referer not passing properly
-
Hi guys,
I’ve successfully installed and used WordPress on two hosts in the past and have had no problems, however on a third I’m having trouble with the options area.
Basically, whenever I use the “Update Options” button on any of the options screens, I am sent to /wp-admin/updated=true (which brings up a WordPress 404). Clearly, I should be sent to something like /wp-admin/options-general.php?updated=true.
Now, I’ve had a quick look in the file where this problem seems to be originating: options.php. The following part is presumably causing the problem:
$referred = remove_query_arg('updated' , $_SERVER['HTTP_REFERER']);
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);I’ve concluded this as changing HTTP_REFERER to something like REQUEST_URI kind of fixes it, except it leaves me on options.php instead of the page I set the options on.
So, basically, I need to work out why $_SERVER[‘HTTP_REFERER’] just isn’t working, and if there’s a way I can fix it. I haven’t got mod_security enabled, and I’d really like to retain the intended behaviour of returning to the page where I set the option rather than hard coding in some other page for it to take me to.
Hope somebody can help!
- The topic ‘Setting options returns 404; ?update=true referer not passing properly’ is closed to new replies.