Skip to content
Permalink
Browse files

Media: Simplify upload error message construction.

Built from https://develop.svn.wordpress.org/trunk@40736


git-svn-id: http://core.svn.wordpress.org/trunk@40594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
swissspidy committed May 16, 2017
1 parent 38347d7 commit 8c7ea71edbbffca5d9766b7bea7c7f3722ffafa6
Showing with 20 additions and 11 deletions.
  1. +18 −9 wp-includes/js/plupload/handlers.js
  2. +1 −1 wp-includes/js/plupload/handlers.min.js
  3. +1 −1 wp-includes/version.php
@@ -328,15 +328,24 @@ function uploadError(fileObj, errorCode, message, uploader) {
}
}

function uploadSizeError( up, file, over100mb ) {
var message;

if ( over100mb )
message = pluploadL10n.big_upload_queued.replace('%s', file.name) + ' ' + pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>');
else
message = pluploadL10n.file_exceeds_size_limit.replace('%s', file.name);

jQuery('#media-items').append('<div id="media-item-' + file.id + '" class="media-item error"><p>' + message + '</p></div>');
function uploadSizeError( up, file ) {
var message, errorDiv;

message = pluploadL10n.file_exceeds_size_limit.replace('%s', file.name);

// Construct the error div.
errorDiv = jQuery( '<div />' )
.attr( {
'id': 'media-item-' + file.id,
'class': 'media-item error'
} )
.append(
jQuery( '<p />' )
.text( message )
);

// Append the error.
jQuery('#media-items').append( errorDiv );
up.removeFile(file);
}

Oops, something went wrong.

1 comment on commit 8c7ea71

@r00tSD

This comment has been minimized.

Copy link

r00tSD commented on 8c7ea71 Oct 29, 2017

how do i exploit it

Please sign in to comment.
You can’t perform that action at this time.