Opened 13 years ago
Closed 13 years ago
#25878 closed defect (bug) (worksforme)
wp_referer_field not includes base URL from general settings
| Reported by: | hectorlinares | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Im using the latest release version.
First you need to configure in general settings your wordpress url and website url to something like 'http://www.example.com/en/blog'.
Install some plugin with options panel.
Go to the plugin options panel and click in Save Settings.
You will be redirected to: http://www.example.com/wp-admin?... instead of http://www.example.com/en/blog/wp-admin?...
I have a solution, but i think its not the best one:
In wp_referer_field (wp-include/functions.php):
Change (line 1262):
$referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
Use:
$referer_field = '<input type="hidden" name="_wp_http_referer" value="'. site_url() . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
This solutions works fine, but uses absolute path instead of relative, attaching the full site url to the REQUEST_URI.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
$_SERVER['REQUEST_URI']in your case should always be set to a full path, that is,/en/blog/wp-admin/.....It sounds like the server has some kind of proxying setup which messes this up, or the request uri is only partially sent to PHP.. basically, I think the issue isn't WordPress, but your server configuration.