WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#25291 closed defect (bug) (fixed)

get_*_template() functions are way too presumptuous

Reported by: wonderboymusic Owned by: wonderboymusic
Milestone: 3.7 Priority: normal
Severity: normal Version: 1.5
Component: Template Keywords:
Focuses: Cc:
PR Number:

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 6 years ago.

Download all attachments as: .zip

Change History (3)

@wonderboymusic
6 years ago

#1 @wonderboymusic
6 years ago

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

#2 @wonderboymusic
6 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.