Ensure the errors array is always defined so as to always have something to return

git-svn-id: https://develop.svn.wordpress.org/trunk@11492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2009-05-30 09:55:32 +00:00
parent a1c608f42d
commit 6e481f5d1e
1 changed files with 2 additions and 2 deletions

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 )