Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#25291 closed defect (bug) (fixed)

get_*_template() functions are way too presumptuous

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

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

Download all attachments as: .zip

Change History (3)

#1 @wonderboymusic
13 years ago

  • Summary get_*_template() functions are way too presumptuos → get_*_template() functions are way too presumptuous

#2 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → 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.