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
This commit is contained in:
westi 2009-05-30 09:55:32 +00:00
parent a83b4269a7
commit 0de9090898

View File

@ -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 )