[wp-trac] [WordPress Trac] #19856: wp_get_referer() doesn't return false when the referer URL is the same as the current URL

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 6 22:30:56 UTC 2012


#19856: wp_get_referer() doesn't return false when the referer URL is the same as
the current URL
--------------------------+-----------------------------
 Reporter:  garyc40       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  General       |     Version:  3.3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------------
Changes (by bpetty):

 * keywords:  has-patch needs-unit-tests => has-patch


Comment:

 The original patch here breaks referer URLs from different query
 variables, and also doesn't account for URLs from the different servers,
 but (coincidentally) the same resource.

 If we use get_site_url() in wp_get_referer() for comparison instead, it
 fixes this and accounts for query variables and different servers.

 I've also attached unit tests for this.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19856#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list