Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#33545 closed defect (bug) (fixed)

Check for existence of pagenow global

Reported by: KalenJohnson Owned by:
Priority: normal Milestone: 4.4
Component: Bootstrap/Load Version: 3.7
Severity: normal Keywords:
Cc: Focuses: template

Description

There are some plugins that call home_url() or get_home_url() without being in any type of hook, so it's happening right when the plugin get's loaded. It doesn't seem like this is always an issue, but I am seeing many warnings of an undefined index.

This patch I don't believe will break anything, since if things are being loaded before the $pagenow global exists, this check won't work anyways, so checking for it and removing a PHP warning seems like a win.

Attachments (1)

check_for_existence_of_pagenow_global.diff (605 bytes ) - added by KalenJohnson 11 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review4.4
  • Version 4.33.7

Introduced in [24844].

#2 @wonderboymusic
11 years ago

In 33736:

In get_home_url(), import the $pagenow global to avoid having to check if it exists before comparing against it.

Props KalenJohnson.
See #33545.

#3 @wonderboymusic
11 years ago

  • Resolutionfixed
  • Status newclosed
Note: See TracTickets for help on using tickets.