[wp-trac] [WordPress Trac] #57670: Invalid return type for wp_get_raw_referer()

WordPress Trac noreply at wordpress.org
Wed Feb 8 13:31:14 UTC 2023


#57670: Invalid return type for wp_get_raw_referer()
--------------------------+-----------------------------
 Reporter:  xknown        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  php81
  Focuses:                |
--------------------------+-----------------------------
 The return type for `wp_get_raw_referer` indicates it returns
 `string|false`. However, this is not the case if the user provided
 `$_REQUEST['_wp_http_referer']` variable is an array for example.

 This results in PHP 8.x fatals in code that assumes this function only
 returns strings/booleans.

 {{{
 strpos( wp_get_raw_referer(), 'foo' );
 }}}

 https://3v4l.org/CoekE

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57670>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list