From 64100e8783f791dd60f39a65da33c53433288c6e Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 16 Jul 2010 09:40:09 +0000 Subject: [PATCH] Fix the theme compat file require paths to be fully absolute so they don't rely on a particular php path to work. Fixes #14315 for trunk props dougal. git-svn-id: http://svn.automattic.com/wordpress/trunk@15433 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 2 +- wp-includes/general-template.php | 6 +++--- wp-includes/theme.php | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 4eb7a2c7a0..7ce38a8f83 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -920,7 +920,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false elseif ( file_exists( TEMPLATEPATH . $file ) ) require( TEMPLATEPATH . $file ); else // Backward compat code will be removed in a future release - require( WPINC . '/theme-compat/comments.php'); + require( ABSPATH . WPINC . '/theme-compat/comments.php'); } /** diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 306c9a092f..d599532255 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -32,7 +32,7 @@ function get_header( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/header.php'); + load_template( ABSPATH . WPINC . '/theme-compat/header.php'); } /** @@ -61,7 +61,7 @@ function get_footer( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/footer.php'); + load_template( ABSPATH . WPINC . '/theme-compat/footer.php'); } /** @@ -90,7 +90,7 @@ function get_sidebar( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/sidebar.php'); + load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); } /** diff --git a/wp-includes/theme.php b/wp-includes/theme.php index ae12f992d8..4a01fb5470 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1023,7 +1023,7 @@ function get_comments_popup_template() { // Backward compat code will be removed in a future release if ('' == $template) - $template = WPINC . '/theme-compat/comments-popup.php'; + $template = ABSPATH . WPINC . '/theme-compat/comments-popup.php'; return apply_filters('comments_popup_template', $template); } @@ -1082,6 +1082,8 @@ function load_template( $_template_file, $require_once = true ) { if ( is_array( $wp_query->query_vars ) ) extract( $wp_query->query_vars, EXTR_SKIP ); + error_log( $_template_file ); + if ( $require_once ) require_once( $_template_file ); else