Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25776 closed defect (bug) (fixed)

$is_nginx global not defined in vars.php

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by: nacin's profile nacin
Milestone: 3.8 Priority: normal
Severity: minor Version: 3.7
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by johnjamesjacoby)

vars.php defines environmental globals used throughout WordPress. When $is_nginx was added in r25456, it was not added to the global definitions at the top of vars.php.

See #18852, #25098.

Attachments (1)

25776.patch (415 bytes) - added by johnjamesjacoby 11 years ago.

Download all attachments as: .zip

Change History (6)

#1 @johnjamesjacoby
11 years ago

Because vars.php is included in the global scope and the only place that references the $is_nginx global directly (options-permalink.php) is also included in the global scope, this does not cause any problems. got_url_rewrite uses $GLOBALS['is_nginx'] rather than define the global, which is how it gets around it also.

Arguably, we could delete the definitions completely at the top of the file, since vars.php is only included directly via wp-settings.php in the global scope, meaning all variables in vars.php are considered global anyways.

Striving for consistency, would be nice to see it added. Additionally, the doc-block at the top of vars.php should be updated to include the nginx check.

#2 @johnjamesjacoby
11 years ago

  • Description modified (diff)

#3 @nacin
11 years ago

The definitions exist for when WordPress isn't loaded in global scope, like during unit tests.

#4 @nacin
11 years ago

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

In 25996:

Explicitly globalize $is_nginx in vars.php.

props johnjamesjacoby.
fixes #25776.

#5 @ocean90
11 years ago

  • Milestone changed from Awaiting Review to 3.8
Note: See TracTickets for help on using tickets.