From 0de909089807790db6cb664e8e5b2049d414827d Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 30 May 2009 09:55:32 +0000 Subject: [PATCH] Ensure the errors array is always defined so as to always have something to return git-svn-id: http://svn.automattic.com/wordpress/trunk@11492 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index e9f8fffa68..ab7cc58b14 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -381,6 +381,8 @@ add_action('media_upload_media', 'media_upload_handler'); function media_upload_form_handler() { check_admin_referer('media-form'); + $errors = array(); + if ( isset($_POST['send']) ) { $keys = array_keys($_POST['send']); $send_id = (int) array_shift($keys); @@ -407,8 +409,6 @@ function media_upload_form_handler() { if ( isset($post['errors']) ) { $errors[$attachment_id] = $post['errors']; unset($post['errors']); - } else { - $errors = array(); } if ( $post != $_post )