Skip to:
Content

BuddyPress.org

Changeset 9498


Ignore:
Timestamp:
02/17/2015 07:44:16 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Check for existence of template before adding it to stack, to avoid accidentally including an unintended file. Props r-a-y. See #6190 (for 2.2 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/src/bp-templates/bp-legacy/buddypress-functions.php

    r9399 r9498  
    498498        // over the default hierarchy.
    499499        if ( ! empty( $page_template ) ) {
    500             array_unshift( $templates, $page_template );
     500
     501            /**
     502             * Check for existence of template before adding it to template
     503             * stack to avoid accidentally including an unintended file.
     504             *
     505             * @see: https://buddypress.trac.wordpress.org/ticket/6190
     506             */
     507            if ( '' !== locate_template( $page_template ) ) {
     508                array_unshift( $templates, $page_template );
     509            }
    501510        }
    502511
Note: See TracChangeset for help on using the changeset viewer.