Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/17/2015 07:42:31 PM (5 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 trunk)

File:
1 edited

Legend:

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

    r9466 r9497  
    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.