[wp-trac] Re: [WordPress Trac] #2858: Problem with wp_get_referer()
WordPress Trac
wp-trac at lists.automattic.com
Sat Jun 24 16:12:44 GMT 2006
#2858: Problem with wp_get_referer()
----------------------------+-----------------------------------------------
Reporter: tereshchenko | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.0.4
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by tereshchenko):
Actually it is even worse, check wp_referer_field() function:
{{{
$ref = ( false === wp_get_referer() ) ? $_SERVER['REQUEST_URI'] :
wp_get_referer();
}}}
it will almost always output the return of wp_get_referer(), which in turn
will be referer to the page that made the request. So even with my
proposed fix it will redirect to the previous page if
$_SERVER['HTTP_REFERER'] is not available (and will ignore
$_SERVER['REQUEST_URI']).
It is very confusing actually: the field _wp_http_referer should contain
the referer, and probably wp_get_referer() should used some other first,
which should contain $_SERVER['REQUEST_URI'] (since our goal is to get
page URI, not the URI that referred to it).
--
Ticket URL: <http://trac.wordpress.org/ticket/2858>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list