From 76e525c50f363dd57f43e7b91d564a7bc80ad214 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 7 May 2009 17:28:51 +0000 Subject: [PATCH] Cast to string in array_key_exists() in media.php, props lusuonline, fixes #9749 git-svn-id: https://develop.svn.wordpress.org/trunk@11233 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index c7f5b01957..32d7983630 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -747,10 +747,10 @@ function media_upload_library() { * @param unknown_type $checked * @return unknown */ -function image_align_input_fields($post, $checked='') { +function image_align_input_fields( $post, $checked = '' ) { $alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right')); - if ( !array_key_exists($checked, $alignments) ) + if ( !array_key_exists( (string) $checked, $alignments ) ) $checked = 'none'; $out = array(); @@ -772,12 +772,12 @@ function image_align_input_fields($post, $checked='') { * @param unknown_type $checked * @return unknown */ -function image_size_input_fields($post, $checked='') { +function image_size_input_fields( $post, $checked = '' ) { // get a list of the actual pixel dimensions of each possible intermediate version of this image $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); - foreach ( $size_names as $size => $name) { + foreach ( $size_names as $size => $name ) { $downsize = image_downsize($post->ID, $size); // is this size selectable?