PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | modules/videopress/js/videopress-uploader.js +14 -14 13.5.2 → 16.3 View file →
@@ -8,9 +8,13 @@
8 8 /**
9 9 * This is the standard uploader response handler.
10 10 */
11 11 handleStandardResponse: function ( response, file ) {
12 - if ( ! _.isObject( response ) || _.isUndefined( response.success ) ) {
12 + if (
13 + response === null ||
14 + typeof response !== 'object' ||
15 + typeof response.success === 'undefined'
16 + ) {
13 17 return error( pluploadL10n.default_error, null, file );
14 18 } else if ( ! response.success ) {
15 19 return error( response.data && response.data.message, response.data, file );
16 20 }
@@ -133,23 +137,19 @@
133 137 response: response,
134 138 } );
135 139 cb( false );
136 140 } );
141 + } else if ( typeof file.size !== 'undefined' && maxSize && file.size > maxSize ) {
142 + // Invalid file size
143 + this.trigger( 'Error', {
144 + code: plupload.FILE_SIZE_ERROR,
145 + message: plupload.translate( 'File size error.' ),
146 + file: file,
147 + } );
148 + cb( false );
137 149 } else {
138 150 // Handles the normal max_file_size functionality.
139 - var undef;
140 -
141 - // Invalid file size
142 - if ( file.size !== undef && maxSize && file.size > maxSize ) {
143 - this.trigger( 'Error', {
144 - code: plupload.FILE_SIZE_ERROR,
145 - message: plupload.translate( 'File size error.' ),
146 - file: file,
147 - } );
148 - cb( false );
149 - } else {
150 - cb( true );
151 - }
151 + cb( true );
152 152 }
153 153 } );
154 154 }
155 155