Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#31587 closed defect (bug) (duplicate)

Network functions used before they are intialized in default-filters.php, cause Notice

Reported by: rleeson's profile rleeson Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

"Notice: Trying to get property of non-object in C:\vm\share\vanguard\trunk\wp-includes\functions.php on line 3834"

Revision 31682 introduced a notice, by using is_main_site() prior to the network/multisite initialization. This forces the notice when is_main_site() attempts a comparison on line 3834 against $current_site which is uninitialized at this point in execution.

includes/default-filters.php is loaded just before the Multisite initialization in wp-settings.php on line 89.

It appears the purpose of this revision was to stop loading the enclosed update filters on AJAX requests.

1) Are the network/site checks appropriate/required at this point? (I imagine this is intended as a catch all in case the filters don't properly include permission checks)
2) If so, can the filters be moved to a later/new included file after the network initialization? Any modification to is_main_site() would be indeterminant, and undermine the point of the check.
3) If not, simplify the conditional to only check if the request is AJAX related.

Change History (4)

#1 @danielbachhuber
10 years ago

  • Keywords needs-patch dev-feedback added
  • Milestone changed from Awaiting Review to 4.2

Bug confirmed.

#3 @rachelbaker
10 years ago

  • Milestone 4.2 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #30947.

#4 @ocean90
10 years ago

  • Keywords needs-patch dev-feedback removed
Note: See TracTickets for help on using tickets.