diff --git a/wp-includes/js/plupload/changelog.txt b/wp-includes/js/plupload/changelog.txt index bec5aeef2..56947216d 100644 --- a/wp-includes/js/plupload/changelog.txt +++ b/wp-includes/js/plupload/changelog.txt @@ -1,3 +1,37 @@ +Version 1.5.4 (2012-04-12) + Flash: Disable scripting if swf was loaded from another domain. +Version 1.5.3 (2012-04-05) + HTML5: Check if xhr object is initialized, before calling abort() on it. + HTML4: Postpone form removal until uploaders state changes, to avoid error on resuming stopped uploads. + BrowserPlus: Fix mechanical typo, that caused error during mime type check. + BrowserPlus: browserPlus.Uploader.Cancel() has two required parameters, dies with the error if not passed. + Flash: Improve runtime's behaviour during upload cancellation. + Flash: Survive the case when GPSVersionID contains unexpected value. + Flash: Fix random freeze in Chrome's bundled Flash Player. + Flash: Avoid the silent break when URLStream not yet open, but close is called on it. + Flash: Move Destroy handler out of Flash:Init handler, since it might be called not only after Flash:Init but also before it. + Flash: Avoid warning during build with mxmlc. + Try removeEventListener first in IE and only if it fails - detachEvent. + Fix plupload.getPos to return proper value in IE8+. + Do not initiate plupload.STARTED state, if file queue is empty. + Additional language packs: Estonian, Polish, Korean, French-Canadian, Greek, Persian/Farsi. +Version 1.5.2 (2012-01-06) + UI Widget: Do not show UI if no runtime can be initialized. + UI Widget: Timely update file size and total size if resize in action. + UI Widget: Constrain renaming feature to queued files only. + UI Widget: Disable Add button properly, if requested, rather then just hide. + HTML4/HTML5/BrowserPlus: Avoid adding mime type twice to dialog trigger. + HTML5: fix regression, when unresized images were failing on FF3.6. + HTML5: Constrain Gecko 2,5,6 workaround to multipart mode only. + HTML5/Flash: Take into account weird possibilities of ExifVersion being a string, rather then standard Undefined. + Flash: Simplify event dispatching in BitmapDataUnlimited class, in order to avoid freezing on resizing in FP11. + Add ability to disable file dialog trigger on request (uploader.disableBrowse(true/false)). + Support for immediate abort of upload process, be it chunked upload or regular one. + Abort all activity, before destroying uploader. + Revive temporary file removal logic in upload.php. + Fix potential vulnerability in dump.php and upload.php. + Additional MIME types: application/vnd.openxmlformats-officedocument.*, application/x-javascript, application/json, text/css,css, application/vnd.oasis.opendocument.formula-templat. + Additional language packs: Hungarian, Croatian, Serbian, Romanian. Version 1.5.1.1 (2011-09-27) HTML5: Fix mechanical typo, that successfully broke drag and drop, wherever could. Version 1.5.1 (2011-09-26) diff --git a/wp-includes/js/plupload/handlers.dev.js b/wp-includes/js/plupload/handlers.dev.js index 0ca1006aa..81bce4a18 100644 --- a/wp-includes/js/plupload/handlers.dev.js +++ b/wp-includes/js/plupload/handlers.dev.js @@ -44,11 +44,20 @@ function fileUploading(up, file) { if ( max > hundredmb && file.size > hundredmb ) { setTimeout(function(){ - if ( file.status == 2 && file.loaded == 0 ) { // not uploading - wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '').replace('%2$s', '')); + var done; - if ( up.current && up.current.file.id == file.id && up.current.xhr.abort ) - up.current.xhr.abort(); + if ( file.status < 3 && file.loaded == 0 ) { // not uploading + wpFileError(file, pluploadL10n.big_upload_failed.replace('%1$s', '').replace('%2$s', '')); + up.stop(); // stops the whole queue + up.removeFile(file); + + for ( done in up.files ) { + // remove files that have been uploaded or have returned errors + if ( up.files[done].status > 2 ) + up.removeFile( up.files[done] ); + } + // restart the queue + up.start(); } }, 10000); // wait for 10 sec. for the file to start uploading } diff --git a/wp-includes/js/plupload/plupload.flash.js b/wp-includes/js/plupload/plupload.flash.js index 8dc2f55d0..aa87c6b84 100644 --- a/wp-includes/js/plupload/plupload.flash.js +++ b/wp-includes/js/plupload/plupload.flash.js @@ -1 +1 @@ -(function(f,b,d,e){var a={},g={};function c(){var h;try{h=navigator.plugins["Shockwave Flash"];h=h.description}catch(j){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){h="0.0"}}h=h.match(/\d+/g);return parseFloat(h[0]+"."+h[1])}d.flash={trigger:function(j,h,i){setTimeout(function(){var m=a[j],l,k;if(m){m.trigger("Flash:"+h,i)}},0)}};d.runtimes.Flash=d.addRuntime("flash",{getFeatures:function(){return{jpgresize:true,pngresize:true,maxWidth:8091,maxHeight:8091,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(m,o){var k,l,h=0,i=b.body;if(c()<10){o({success:false});return}g[m.id]=false;a[m.id]=m;k=b.getElementById(m.settings.browse_button);l=b.createElement("div");l.id=m.id+"_flash_container";d.extend(l.style,{position:"absolute",top:"0px",background:m.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"});l.className="plupload flash";if(m.settings.container){i=b.getElementById(m.settings.container);if(d.getStyle(i,"position")==="static"){i.style.position="relative"}}i.appendChild(l);(function(){var p,q;p='';if(d.ua.ie){q=b.createElement("div");l.appendChild(q);q.outerHTML=p;q=null}else{l.innerHTML=p}}());function n(){return b.getElementById(m.id+"_flash")}function j(){if(h++>5000){o({success:false});return}if(!g[m.id]){setTimeout(j,1)}}j();k=l=null;m.bind("Flash:Init",function(){var q={},p;n().setFileFilters(m.settings.filters,m.settings.multi_selection);if(g[m.id]){return}g[m.id]=true;m.bind("UploadFile",function(r,t){var u=r.settings,s=m.settings.resize||{};n().uploadFile(q[t.id],u.url,{name:t.target_name||t.name,mime:d.mimeTypes[t.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:u.chunk_size,width:s.width,height:s.height,quality:s.quality,multipart:u.multipart,multipart_params:u.multipart_params||{},file_data_name:u.file_data_name,format:/\.(jpg|jpeg)$/i.test(t.name)?"jpg":"png",headers:u.headers,urlstream_upload:u.urlstream_upload})});m.bind("Flash:UploadProcess",function(s,r){var t=s.getFile(q[r.id]);if(t.status!=d.FAILED){t.loaded=r.loaded;t.size=r.size;s.trigger("UploadProgress",t)}});m.bind("Flash:UploadChunkComplete",function(r,t){var u,s=r.getFile(q[t.id]);u={chunk:t.chunk,chunks:t.chunks,response:t.text};r.trigger("ChunkUploaded",s,u);if(s.status!=d.FAILED){n().uploadNextChunk()}if(t.chunk==t.chunks-1){s.status=d.DONE;r.trigger("FileUploaded",s,{response:t.text})}});m.bind("Flash:SelectFiles",function(r,u){var t,s,v=[],w;for(s=0;s';if(d.ua.ie){q=b.createElement("div");l.appendChild(q);q.outerHTML=p;q=null}else{l.innerHTML=p}}());function n(){return b.getElementById(m.id+"_flash")}function j(){if(h++>5000){o({success:false});return}if(g[m.id]===false){setTimeout(j,1)}}j();k=l=null;m.bind("Destroy",function(p){var q;d.removeAllEvents(b.body,p.id);delete g[p.id];delete a[p.id];q=b.getElementById(p.id+"_flash_container");if(q){i.removeChild(q)}});m.bind("Flash:Init",function(){var r={},q;try{n().setFileFilters(m.settings.filters,m.settings.multi_selection)}catch(p){o({success:false});return}if(g[m.id]){return}g[m.id]=true;m.bind("UploadFile",function(s,u){var v=s.settings,t=m.settings.resize||{};n().uploadFile(r[u.id],v.url,{name:u.target_name||u.name,mime:d.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:v.chunk_size,width:t.width,height:t.height,quality:t.quality,multipart:v.multipart,multipart_params:v.multipart_params||{},file_data_name:v.file_data_name,format:/\.(jpg|jpeg)$/i.test(u.name)?"jpg":"png",headers:v.headers,urlstream_upload:v.urlstream_upload})});m.bind("CancelUpload",function(){n().cancelUpload()});m.bind("Flash:UploadProcess",function(t,s){var u=t.getFile(r[s.id]);if(u.status!=d.FAILED){u.loaded=s.loaded;u.size=s.size;t.trigger("UploadProgress",u)}});m.bind("Flash:UploadChunkComplete",function(s,u){var v,t=s.getFile(r[u.id]);v={chunk:u.chunk,chunks:u.chunks,response:u.text};s.trigger("ChunkUploaded",t,v);if(t.status!==d.FAILED&&s.state!==d.STOPPED){n().uploadNextChunk()}if(u.chunk==u.chunks-1){t.status=d.DONE;s.trigger("FileUploaded",t,{response:u.text})}});m.bind("Flash:SelectFiles",function(s,v){var u,t,w=[],x;for(t=0;t