Adjust get_file_description() to account for absolute paths. see #12843

git-svn-id: https://develop.svn.wordpress.org/trunk@13994 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-04-04 12:07:27 +00:00
parent 812222bac3
commit 4c2edbc0d7
1 changed files with 2 additions and 2 deletions

View File

@ -52,8 +52,8 @@ function get_file_description( $file ) {
if ( isset( $wp_file_descriptions[basename( $file )] ) ) {
return $wp_file_descriptions[basename( $file )];
}
elseif ( file_exists( WP_CONTENT_DIR . $file ) && is_file( WP_CONTENT_DIR . $file ) ) {
$template_data = implode( '', file( WP_CONTENT_DIR . $file ) );
elseif ( file_exists( $file ) && is_file( $file ) ) {
$template_data = implode( '', file( $file ) );
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ))
return _cleanup_header_comment($name[1]) . ' Page Template';
}