WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#33877 closed enhancement (fixed)

Initialise $_SERVER[ 'REMOTE_ADDR' ] in the unit test bootstrap

Reported by: johnbillion Owned by: johnbillion
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:
PR Number:

Description

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.

Attachments (1)

33877.patch (6.4 KB) - added by johnbillion 4 years ago.

Download all attachments as: .zip

Change History (5)

@johnbillion
4 years ago

#1 @johnbillion
4 years ago

  • Keywords has-patch added

#2 @johnbillion
4 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 34172:

Initialise $_SERVER[ 'REMOTE_ADDR' ] during the test bootstrap so individual tests need not.

Fixes #33877
Fixes #25162

#3 @johnbillion
4 years ago

In 34173:

Missed files from [34172].

See #33877

#4 @johnbillion
4 years ago

In 34518:

Another missed file from [34172].

See #33877

Note: See TracTickets for help on using tickets.