Make WordPress Core

Changeset 24616


Ignore:
Timestamp:
07/09/2013 08:31:04 PM (12 years ago)
Author:
nacin
Message:

In general template functions, cast to string then ensure we actually have a template name before proceeding. Affects get_sidebar(), get_header(), get_footer(), get_template_part().

props tivnet for initial patch.
fixes #24714.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r24559 r24616  
    2626
    2727    $templates = array();
    28     if ( isset($name) )
     28    $name = (string) $name;
     29    if ( '' !== $name )
    2930        $templates[] = "header-{$name}.php";
    3031
     
    5556
    5657    $templates = array();
    57     if ( isset($name) )
     58    $name = (string) $name;
     59    if ( null !== $name && false !== $name )
    5860        $templates[] = "footer-{$name}.php";
    5961
     
    8486
    8587    $templates = array();
    86     if ( isset($name) )
     88    $name = (string) $name;
     89    if ( '' !== $name )
    8790        $templates[] = "sidebar-{$name}.php";
    8891
     
    121124
    122125    $templates = array();
    123     if ( isset($name) )
     126    $name = (string) $name;
     127    if ( '' !== $name )
    124128        $templates[] = "{$slug}-{$name}.php";
    125129
Note: See TracChangeset for help on using the changeset viewer.