From 3f111808839d01cc6b4ecf94b79097b6a22f3d2f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 7 Mar 2012 00:24:23 +0000 Subject: [PATCH] Fetch the raw 'Template' header in the WP_Theme constructor. By passing sanitization routines (which are unnecessary for this header), we prevent a persistent themes cache from sanitizing the headers of every theme until/unless they actually need a real header like Name. Note that if WP_Theme was instantiated through get_themes(), this will have no effect, as get_themes() does ask for Name for the keys to return. see #20103. git-svn-id: https://develop.svn.wordpress.org/trunk@20132 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 00573a6f87..17d303ba18 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -199,7 +199,7 @@ final class WP_Theme implements ArrayAccess { } // (If template is set from cache, we know it's good.) - if ( ! $this->template && ! ( $this->template = $this->get('Template') ) ) { + if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) { if ( file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) { $this->template = $this->stylesheet; } else {