Ticket #48379: 48379.diff
File 48379.diff, 3.1 KB (added by , 5 years ago) |
---|
-
src/js/_enqueues/vendor/plupload/handlers.js
427 427 }); 428 428 429 429 // Attempt to create image sub-sizes when an image was uploaded successfully 430 // but the server responded with an HTTP 5 00 or 502error.430 // but the server responded with an HTTP 5xx error. 431 431 tryAgain = function( up, error ) { 432 432 var file = error.file; 433 433 var times; … … 465 465 } 466 466 }); 467 467 468 if ( error.message && error.status !== 500 && error.status !== 502) {468 if ( error.message && ( error.status < 500 || error.status >= 600 ) ) { 469 469 wpQueueError( error.message ); 470 470 } else { 471 471 wpQueueError( pluploadL10n.http_error_image ); … … 504 504 wpQueueError( message || pluploadL10n.http_error_image ); 505 505 } 506 506 }).fail( function( jqXHR ) { 507 // If another HTTP 5 00error, try try again...508 if ( jqXHR.status === 500 || jqXHR.status === 502) {507 // If another HTTP 5xx error, try try again... 508 if ( jqXHR.status >= 500 && jqXHR.status < 600 ) { 509 509 tryAgain( up, error ); 510 510 return; 511 511 } … … 582 582 var isImage = error.file && error.file.type && error.file.type.indexOf( 'image/' ) === 0; 583 583 var status = error && error.status; 584 584 585 // If the file is an image and the error is HTTP 5 00 or 502try to create sub-sizes again.586 if ( ( status === 500 || status === 502 ) && isImage) {585 // If the file is an image and the error is HTTP 5xx try to create sub-sizes again. 586 if ( isImage && status >= 500 && status < 600 ) { 587 587 tryAgain( up, error ); 588 588 return; 589 589 } -
src/js/_enqueues/vendor/plupload/wp-plupload.js
109 109 110 110 /** 111 111 * Attempt to create image sub-sizes when an image was uploaded successfully 112 * but the server responded with HTTP 5 00 or 502error.112 * but the server responded with HTTP 5xx error. 113 113 * 114 114 * @since 5.3.0 115 115 * … … 184 184 error( message, data, file, 'no-retry' ); 185 185 } 186 186 }).fail( function( jqXHR ) { 187 // If another HTTP 5 00 or 502error, try try again...188 if ( jqXHR.status === 500 || jqXHR.status === 502) {187 // If another HTTP 5xx error, try try again... 188 if ( jqXHR.status >= 500 && jqXHR.status < 600 ) { 189 189 tryAgain( message, data, file ); 190 190 return; 191 191 } … … 209 209 var isImage = file.type && file.type.indexOf( 'image/' ) === 0; 210 210 var status = data && data.status; 211 211 212 // If the file is an image and the error is HTTP 5 00 or 502try to create sub-sizes again.213 if ( retry !== 'no-retry' && isImage && ( status === 500 || status === 502 )) {212 // If the file is an image and the error is HTTP 5xx try to create sub-sizes again. 213 if ( retry !== 'no-retry' && isImage && status >= 500 && status < 600 ) { 214 214 tryAgain( message, data, file ); 215 215 return; 216 216 }