For clarity, initialize some arrays that previously were only assigned via short circuit in loops.

See #30799.

Built from https://develop.svn.wordpress.org/trunk@30982


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2014-12-20 22:47:22 +00:00
parent 2dbd0d0a8f
commit 5eb5afac34
15 changed files with 56 additions and 25 deletions

View File

@@ -586,6 +586,8 @@ function image_get_intermediate_size($post_id, $size='thumbnail') {
// get the best one for a specified set of dimensions
if ( is_array($size) && !empty($imagedata['sizes']) ) {
$areas = array();
foreach ( $imagedata['sizes'] as $_size => $data ) {
// already cropped to width or height; so use this size
if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) {