Make WordPress Core

Ticket #29891: show-upload-errors.diff

File show-upload-errors.diff, 1.1 KB (added by aduth, 10 years ago)

Patch to display error response on a failed upload

  • src/wp-admin/includes/ms.php

     
    3636                $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
    3737        }
    3838        if ( $file['error'] != '0' && !isset($_POST['html-upload']) )
    39                 wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
     39                wp_die( $file['error'] );
    4040
    4141        return $file;
    4242}
  • src/wp-includes/js/plupload/wp-plupload.js

     
    226226                        try {
    227227                                response = JSON.parse( response.response );
    228228                        } catch ( e ) {
    229                                 return error( pluploadL10n.default_error, e, file );
     229                                return error( [ pluploadL10n.default_error, response.response ].join( ' ' ), e, file );
    230230                        }
    231231
    232232                        if ( ! _.isObject( response ) || _.isUndefined( response.success ) )