Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#25291 closed defect (bug) (fixed)

get_*_template() functions are way too presumptuous

Reported by: wonderboymusic's profile wonderboymusic Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.7 Priority: normal
Severity: normal Version: 1.5
Component: Template Keywords:
Focuses: Cc:

Description

Most of the get_*_template() functions blindly trust that the result of get_queried_object() is perfect when non-null. This is not the case, unit tests are blowing up when in debug mode because the queried object does not contain properties of the assumed context.

Attachments (1)

25291.diff (1.9 KB) - added by wonderboymusic 10 years ago.

Download all attachments as: .zip

Change History (3)

#1 @wonderboymusic
10 years ago

  • Summary changed from get_*_template() functions are way too presumptuos to get_*_template() functions are way too presumptuous

#2 @wonderboymusic
10 years ago

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

In 25386:

Add sanity checks to get_*_template() functions to ensure that the return value of get_queried_object() is compatible with the assumed context.

Fixes #25291.
See #25282.

Note: See TracTickets for help on using tickets.