From 5bab3555d77ecf5b0caf22869c21cf18aa3483cb Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 29 Feb 2012 20:46:41 +0000 Subject: [PATCH] Use correct variable; return correct value for get_screenshot() when value is uncached. see #20103. git-svn-id: https://develop.svn.wordpress.org/trunk@20045 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-theme.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 9ea18eb6b9..4df884b07d 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -458,7 +458,7 @@ final class WP_Theme implements ArrayAccess { if ( ! isset( $this->headers_sanitized ) ) { $this->headers_sanitized = $this->cache_get( 'headers' ); if ( ! is_array( $this->headers_sanitized ) ) - $headers = array(); + $this->headers_sanitized = array(); } if ( isset( $this->headers_sanitized[ $header ] ) ) @@ -807,9 +807,9 @@ final class WP_Theme implements ArrayAccess { foreach ( array( 'png', 'gif', 'jpg', 'jpeg' ) as $ext ) { if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext" ) ) { $this->cache_add( 'screenshot', 'screenshot.' . $ext ); - if ( 'absolute' == $uri ) - return $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext; - return 'screenshot.' . $ext; + if ( 'relative' == $uri ) + return 'screenshot.' . $ext; + return $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext; } }