[wp-trac] [WordPress Trac] #25878: wp_referer_field not includes base URL from general settings

WordPress Trac noreply at wordpress.org
Fri Nov 8 11:08:26 UTC 2013


#25878: wp_referer_field not includes base URL from general settings
---------------------------+-----------------------------
 Reporter:  hectorlinares  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:
 Severity:  normal         |   Keywords:
---------------------------+-----------------------------
 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):
 {{{
 #!php
 $referer_field = '<input type="hidden" name="_wp_http_referer" value="' .
 esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
 }}}

 Use:
 {{{
 #!php
 $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.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25878>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list