[wp-trac] [WordPress Trac] #33877: Initialise $_SERVER[ 'REMOTE_ADDR' ] in the unit test bootstrap

WordPress Trac noreply at wordpress.org
Tue Sep 15 07:52:31 UTC 2015


#33877: Initialise $_SERVER[ 'REMOTE_ADDR' ] in the unit test bootstrap
------------------------------+-----------------
 Reporter:  johnbillion       |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  4.4
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------
 In various tests, `$_SERVER[ 'REMOTE_ADDR' ]` is given a value in order to
 prevent PHP notices being triggered by functions such as
 `wpmu_log_new_registrations()` which use the superglobal without
 validating it first.

 `$_SERVER[ 'REMOTE_ADDR' ]` should be initialised with a dummy value in
 the unit test bootstrap so individual tests don't need to.

 I had this patch applied while running the tests for #25162, which is why
 the failures were missed.

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


More information about the wp-trac mailing list