Use correct variable; return correct value for get_screenshot() when value is uncached. see #20103.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-02-29 20:46:41 +00:00
parent 8570f2dcd2
commit a48a695ba7

View File

@ -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;
}
}