Make WordPress Core

Changeset 22822


Ignore:
Timestamp:
11/22/2012 12:18:17 PM (12 years ago)
Author:
koopersmith
Message:

Uploader: Display a more specific error message when a file exceeds the file size limit. see #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/plupload/wp-plupload.js

    r22818 r22822  
    227227                if ( pluploadError.code === plupload[ key ] ) {
    228228                    message = Uploader.errorMap[ key ];
     229                    if ( _.isFunction( message ) )
     230                        message = message( pluploadError.file, pluploadError );
    229231                    break;
    230232                }
     
    246248        'FAILED':                 pluploadL10n.upload_failed,
    247249        'FILE_EXTENSION_ERROR':   pluploadL10n.invalid_filetype,
    248         // 'FILE_SIZE_ERROR': '',
    249250        'IMAGE_FORMAT_ERROR':     pluploadL10n.not_an_image,
    250251        'IMAGE_MEMORY_ERROR':     pluploadL10n.image_memory_exceeded,
     
    253254        'IO_ERROR':               pluploadL10n.io_error,
    254255        'HTTP_ERROR':             pluploadL10n.http_error,
    255         'SECURITY_ERROR':         pluploadL10n.security_error
     256        'SECURITY_ERROR':         pluploadL10n.security_error,
     257
     258        'FILE_SIZE_ERROR': function( file ) {
     259            return pluploadL10n.file_exceeds_size_limit.replace('%s', file.name);
     260        }
    256261    };
    257262
Note: See TracChangeset for help on using the changeset viewer.