Commit 8c70645077 for wordpress.org
commit 8c706450772c364a7d257b9c5699d0321236cb2e
Author: adamsilverstein <adamsilverstein@git.wordpress.org>
Date: Mon Nov 9 20:12:56 2026 +0000
Media: Keep non-image uploads on the classic upload path.
Fix an issue with the client-side media processing pipeline checking file types against the allowed mime types captured when the page rendered, not the uploader's own `filters.mime_types`. File types a plugin allows for a single frame, such as SVG and JSON, were rejected in the browser with "Sorry, you are not allowed to upload this file type." before reaching the server.
After this change, only images the pipeline can process (currently JPEG, PNG, GIF, WebP, AVIF and HEIC/HEIF) are routed to it. Everything else (audio, video, PDF, SVG, JSON, archives) uploads through `async-upload.php` as it did before the pipeline was added. An image whose type is missing from the render-time allowed mime types also stays on the classic path, so the server decides whether to accept it. HEIC files are matched by extension too, because browsers without a HEIC codec may give them no type.
Follow-up to [64588].
Props desrosj, andrewserong.
See #66490.
Built from https://develop.svn.wordpress.org/trunk@65356
git-svn-id: http://core.svn.wordpress.org/trunk@64496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/js/media-frame-upload.js b/wp-admin/js/media-frame-upload.js
index f5af17d799..464818e51e 100644
--- a/wp-admin/js/media-frame-upload.js
+++ b/wp-admin/js/media-frame-upload.js
@@ -202,16 +202,12 @@
/*
* Early mime type scanning for images, as wp-plupload.js does,
- * extended with the formats the client-side pipeline accepts.
+ * for the formats the pipeline processes.
*/
- const image = /(?:jpe?g|png|gif|webp|avif|heic|heif)$/i.exec(
- file.name
- );
- if ( image ) {
+ const subtype = pipeline.getImageSubtype( file.name );
+ if ( subtype ) {
attributes.type = 'image';
- // `jpg` is not a valid subtype, so map it to `jpeg`.
- const subtype = image[ 0 ].toLowerCase();
- attributes.subtype = 'jpg' === subtype ? 'jpeg' : subtype;
+ attributes.subtype = subtype;
}
const model = wp.media.model.Attachment.create( attributes );
diff --git a/wp-admin/js/media-frame-upload.min.js b/wp-admin/js/media-frame-upload.min.js
index f119011f5f..fdc40b2ef6 100644
--- a/wp-admin/js/media-frame-upload.min.js
+++ b/wp-admin/js/media-frame-upload.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(){if(!window.__wpMediaFrameUpload){const r=window.wp&&wp.mediaUploadPipeline;if(r&&"undefined"!=typeof plupload&&wp.Uploader&&wp.media&&r.configure()){window.__wpMediaFrameUpload=!0;const t=wp.Uploader.prototype.init;function d(){wp.Uploader.queue.all(function(e){return!e.get("uploading")})&&wp.Uploader.queue.reset()}function a(p,e,t){var n,a;if(a=(n=(n=e).settings||{}).multipart_params||{},n=new URL(n.url||"",location.href),"upload-attachment"===a.action&&n.pathname.endsWith("async-upload.php"))return a=e.settings&&e.settings.multipart_params||{},r.routeBatch(e,t,{postId:parseInt(a.post_id,10)||0,onQueue:function(e,o){var t={file:e,uploading:!0,date:new Date,filename:e.name,menuOrder:0,uploadedTo:wp.media.model.settings.post.id,loaded:e.loaded,size:e.size,percent:e.percent},e=/(?:jpe?g|png|gif|webp|avif|heic|heif)$/i.exec(e.name);e&&(t.type="image",e=e[0].toLowerCase(),t.subtype="jpg"===e?"jpeg":e);const i=wp.media.model.Attachment.create(t);return wp.Uploader.queue.add(i),p.added(i),{onSuccess:function(e){var t,n,a;t=p,n=i,a=e,n.set({id:a.id}),wp.media.model.Attachment.get(a.id,n),["file","loaded","size","percent"].forEach(function(e){n.unset(e,{silent:!0})}),n.set({uploading:!1},{silent:!0}),n.fetch().fail(function(){n.set(a)}).always(function(){d(),t.success(n)})},onError:function(e){var t,n,a;t=p,n=i,e=e,a=o.name,e=r.getErrorText(e,a),a={name:a},n.destroy(),wp.Uploader.errors.unshift({message:e,data:{},file:a}),d(),t.error(e,{},a)},onHandOff:function(){i.destroy()},onProgress:function(e){i.set({percent:e}),p.progress(i)}}}})}wp.Uploader.prototype.init=function(){t.apply(this,arguments);const n=this;var e=this.uploader;e&&!e.__wpMediaFrameUploadBound&&(e.__wpMediaFrameUploadBound=!0,e.bind("FilesAdded",function(e,t){return a(n,e,t)},this,100))}}}}();
\ No newline at end of file
+!function(){if(!window.__wpMediaFrameUpload){const r=window.wp&&wp.mediaUploadPipeline;if(r&&"undefined"!=typeof plupload&&wp.Uploader&&wp.media&&r.configure()){window.__wpMediaFrameUpload=!0;const t=wp.Uploader.prototype.init;function p(){wp.Uploader.queue.all(function(e){return!e.get("uploading")})&&wp.Uploader.queue.reset()}function a(d,e,t){var n,a;if(a=(n=(n=e).settings||{}).multipart_params||{},n=new URL(n.url||"",location.href),"upload-attachment"===a.action&&n.pathname.endsWith("async-upload.php"))return a=e.settings&&e.settings.multipart_params||{},r.routeBatch(e,t,{postId:parseInt(a.post_id,10)||0,onQueue:function(e,o){var t={file:e,uploading:!0,date:new Date,filename:e.name,menuOrder:0,uploadedTo:wp.media.model.settings.post.id,loaded:e.loaded,size:e.size,percent:e.percent},e=r.getImageSubtype(e.name);e&&(t.type="image",t.subtype=e);const i=wp.media.model.Attachment.create(t);return wp.Uploader.queue.add(i),d.added(i),{onSuccess:function(e){var t,n,a;t=d,n=i,a=e,n.set({id:a.id}),wp.media.model.Attachment.get(a.id,n),["file","loaded","size","percent"].forEach(function(e){n.unset(e,{silent:!0})}),n.set({uploading:!1},{silent:!0}),n.fetch().fail(function(){n.set(a)}).always(function(){p(),t.success(n)})},onError:function(e){var t,n,a;t=d,n=i,e=e,a=o.name,e=r.getErrorText(e,a),a={name:a},n.destroy(),wp.Uploader.errors.unshift({message:e,data:{},file:a}),p(),t.error(e,{},a)},onHandOff:function(){i.destroy()},onProgress:function(e){i.set({percent:e}),d.progress(i)}}}})}wp.Uploader.prototype.init=function(){t.apply(this,arguments);const n=this;var e=this.uploader;e&&!e.__wpMediaFrameUploadBound&&(e.__wpMediaFrameUploadBound=!0,e.bind("FilesAdded",function(e,t){return a(n,e,t)},this,100))}}}}();
\ No newline at end of file
diff --git a/wp-admin/js/media-upload-pipeline.js b/wp-admin/js/media-upload-pipeline.js
index 58dceae7af..bd25774d48 100644
--- a/wp-admin/js/media-upload-pipeline.js
+++ b/wp-admin/js/media-upload-pipeline.js
@@ -38,6 +38,13 @@ window.wp = window.wp || {};
const imageSizeCount = Object.keys( settings.allImageSizes || {} ).length;
+ /*
+ * Image subtypes the pipeline processes. Keep in sync with
+ * CLIENT_SIDE_SUPPORTED_MIME_TYPES and HEIC_MIME_TYPES in the
+ * upload-media package.
+ */
+ const IMAGE_SUBTYPES = [ 'jpeg', 'png', 'gif', 'webp', 'avif', 'heic', 'heif' ];
+
/**
* Recursively appends data to a FormData object, supporting nested objects.
*
@@ -412,16 +419,73 @@ window.wp = window.wp || {};
return configured && isStoreConfigured();
}
+ /**
+ * Gets the image subtype of a file name the pipeline can process.
+ *
+ * @param {string} fileName A file name.
+ * @return {string|null} The subtype, eg. `jpeg` for `photo.jpg`, or
+ * null when the pipeline does not process it.
+ */
+ function getImageSubtype( fileName ) {
+ const match = /\.([a-z0-9]+)$/i.exec( fileName || '' );
+ if ( ! match ) {
+ return null;
+ }
+ // `jpg` is not a valid subtype, so map it to `jpeg`.
+ const extension = match[ 1 ].toLowerCase();
+ const subtype = 'jpg' === extension ? 'jpeg' : extension;
+ return IMAGE_SUBTYPES.includes( subtype ) ? subtype : null;
+ }
+
+ /**
+ * Whether a file is an image the client-side pipeline can process.
+ *
+ * A file whose type is missing from the allowed types the page was
+ * rendered with is left to the server, which can allow it for a single
+ * request (see partitionBatch()). A HEIC file is also matched by its
+ * extension, since browsers on platforms without a HEIC codec may give
+ * it no type at all.
+ *
+ * @param {plupload.File} file A file added to the plupload queue.
+ * @return {boolean} True when the pipeline should take the file.
+ */
+ function isPipelineFile( file ) {
+ const type = ( file.type || '' ).toLowerCase();
+ const allowedTypes = settings.allowedMimeTypes;
+ if (
+ type &&
+ allowedTypes &&
+ ! Object.values( allowedTypes ).includes( type )
+ ) {
+ return false;
+ }
+ if (
+ type.startsWith( 'image/' ) &&
+ IMAGE_SUBTYPES.includes( type.slice( 6 ) )
+ ) {
+ return true;
+ }
+ const subtype = getImageSubtype( file.name );
+ return 'heic' === subtype || 'heif' === subtype;
+ }
+
/**
* Splits a batch of plupload files between the pipeline and classic
* plupload.
*
- * Audio files stay classic so they keep the title and description that
- * media_handle_upload() derives from their ID3 tags, which the REST
- * endpoint does not do. So do JPEG and PNG images while plupload's own
- * client-side resize is enabled (the "Scale images" setting, or a
- * `resize` passed through `plupload_init`): plupload scales those down
- * before uploading them, the pipeline would not.
+ * Only images the pipeline can process are taken (see isPipelineFile()).
+ * Everything else, such as audio, video, PDF, SVG or JSON, stays
+ * classic: the pipeline would do nothing for it but upload it, and
+ * would check its type against the allowed types the page was rendered
+ * with instead of the uploader's own filters, which a plugin can extend
+ * for a single frame. For the same reason an image of a type the page
+ * was not rendered with stays classic, so the server decides. Audio
+ * also keeps the title and description that media_handle_upload()
+ * derives from its ID3 tags, which the REST endpoint does not. JPEG
+ * and PNG images stay classic too while plupload's own client-side
+ * resize is enabled (the "Scale images" setting, or a `resize` passed
+ * through `plupload_init`): plupload scales those down before
+ * uploading them, the pipeline would not.
*
* The whole batch stays classic when a file cannot be re-queued on
* plupload or is already plupload's: plupload returns no native File
@@ -450,7 +514,7 @@ window.wp = window.wp || {};
}
const type = file.type || '';
if (
- /^audio\//i.test( type ) ||
+ ! isPipelineFile( file ) ||
( isResizing && /^image\/(?:jpeg|png)$/i.test( type ) )
) {
batch.classic.push( file );
@@ -735,5 +799,6 @@ window.wp = window.wp || {};
isReady: isReady,
routeBatch: routeBatch,
getErrorText: getErrorText,
+ getImageSubtype: getImageSubtype,
};
} )( window.wp );
diff --git a/wp-admin/js/media-upload-pipeline.min.js b/wp-admin/js/media-upload-pipeline.min.js
index 2c5733c08a..319654fec0 100644
--- a/wp-admin/js/media-upload-pipeline.min.js
+++ b/wp-admin/js/media-upload-pipeline.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-window.wp=window.wp||{},function(l){const i=l.i18n.__,e=window._wpMediaUploadPipelineSettings||{};let u,t=!1;const p=new Map,r=new WeakSet,o=Object.keys(e.allImageSizes||{}).length;function n(n){var e=n.file;const t=n.additionalData||{},a=new FormData;a.append("file",e,e.name||e.type.replace("/",".")),Object.keys(t).forEach(function(e){!function t(n,a,i){null!==i&&"object"==typeof i&&Object.getPrototypeOf(i)===Object.prototype?Object.keys(i).forEach(function(e){t(n,a+"["+e+"]",i[e])}):void 0!==i&&n.append(a,String(i))}(a,e,t[e])}),l.apiFetch({path:"/wp/v2/media/"+n.attachmentId+"/sideload",body:a,method:"POST",signal:n.signal}).then(function(e){n.onSuccess&&n.onSuccess(e)}).catch(function(t){if(n.onError){let e=t;t instanceof Error||(e=new Error(t&&t.message?t.message:String(t))),n.onError(e)}})}async function a(e,t){e=await l.apiFetch({path:"/wp/v2/media/"+e+"/finalize",method:"POST",data:{sub_sizes:t||[]}});if(e)return l.mediaUtils.transformAttachment(e)}function f(e){return l.apiFetch({path:"/wp/v2/media/"+e+"?force=true",method:"DELETE"})}function s(){return Boolean(Boolean("undefined"!=typeof plupload&&l.uploadMedia&&l.mediaUtils&&l.data&&l.element&&l.apiFetch)&&l.uploadMedia.detectClientSideMediaSupport&&l.uploadMedia.detectClientSideMediaSupport().supported)}function d(){if(0!==p.size){const n=new Set;l.data.select(u).getItems().forEach(function(e){var t;e.parentId||(t=p.get(e.onSuccess))&&(n.add(e.onSuccess),t.seen=!0,e.attachment&&e.attachment.id&&(t.attachmentId=e.attachment.id),t.onProgress)&&(e=Math.min(99,Math.round(function(e,t){if("number"==typeof e.progress)return e.progress;var n=e.operations?e.operations.length:0;let a=t.totals;if(a||(a={total:n,remaining:n},t.totals=a),n>a.remaining&&(a.total+=n-a.remaining),a.remaining=n,0===a.total)return 0;let i=0;return(a.total-n+(i="THUMBNAIL_GENERATION"===e.currentOperation&&0<o?Math.min(1,(e.subSizes||[]).length/o):i))/a.total*100}(e,t))))!==t.lastPercent&&(t.lastPercent=e,t.onProgress(e))}),p.forEach(function(e,t){e.seen&&!n.has(t)&&e.fail({message:i("An error occurred while uploading the file.")})})}}function c(){var e=l.data.select(u).getSettings();return Boolean(e&&e.mediaSideload&&e.mediaFinalize)}function g(){window.addEventListener("beforeunload",function(e){0<p.size&&e.preventDefault()})}function m(){return t&&c()}function h(e,t){r.add(t),e.addFile(t)}l.mediaUploadPipeline={isSupported:s,configure:function(){if(!t){if(!s())return!1;t=!0,u=l.uploadMedia.store,e.isBlockEditor||c()||(window.__clientSideMediaProcessing=!0,l.element.createRoot(document.createElement("div")).render(l.element.createElement(l.uploadMedia.MediaUploadProvider,{settings:{mediaUpload:l.mediaUtils.uploadMedia,mediaSideload:n,mediaFinalize:a,mediaDelete:f,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes,allImageSizes:e.allImageSizes,bigImageSizeThreshold:e.bigImageSizeThreshold,imageStripMeta:e.imageStripMeta,imageMaxBitDepth:e.imageMaxBitDepth,generateAnimatedImageSubsizes:e.generateAnimatedImageSubsizes},useSubRegistry:!1}))),l.data.subscribe(d,u),g()}return!0},isReady:m,routeBatch:function(s,e,d){if(m()){var n,e=function(e,t){var e=e.settings&&e.settings.resize,n=Boolean(e&&e.enabled),a={pipeline:[],classic:[]};for(const o of t)if(plupload.FAILED!==o.status){var i=o.getNative&&o.getNative();if(!i||r.has(i))return null;i=o.type||"";(/^audio\//i.test(i)||n&&/^image\/(?:jpeg|png)$/i.test(i)?a.classic:a.pipeline).push(o)}return a.pipeline.length?a:null}(s,e);if(e){const c=function(t,e){const n={};return Object.keys(t||{}).forEach(function(e){"action"!==e&&"_wpnonce"!==e&&"post_id"!==e&&(n[e]=t[e])}),e&&(n.post=e),n}(s.settings&&s.settings.multipart_params||{},d.postId);return d.onStart&&d.onStart(e.pipeline),e.pipeline.forEach(function(e){const o=e.getNative(),r=d.onQueue(e,o);s.removeFile(e);{e=o;var t=c,n={onSuccess:r.onSuccess,onProgress:r.onProgress,onError:function(e){var t,n,a,i;t=s,n=e,a=o,i=l.uploadMedia.ErrorCode||{},n&&i.HEIC_DECODE_ERROR&&n.code===i.HEIC_DECODE_ERROR&&t&&"function"==typeof t.addFile&&(!t.settings||!t.settings.heic_upload_error)&&(h(t,a),1)?r.onHandOff():r.onError(e)}};function a(e){p.delete(a),n.onSuccess&&n.onSuccess(e[0])}const i={onProgress:n.onProgress,lastPercent:-1,totals:null,seen:!1,attachmentId:0,fail:function(e){p.delete(a)&&(i.attachmentId&&f(i.attachmentId).catch(function(){}),n.onError)&&n.onError(e)}};p.set(a,i),l.data.dispatch(u).addItems({files:[e],additionalData:t||{},onSuccess:a,onError:function(e){i.fail("string"==typeof e?{message:e}:e)}})}}),n=s,e.classic.forEach(function(e){var t=e.getNative();n.removeFile(e),h(n,t)}),s.refresh(),!1}}},getErrorText:function(e,t){var n=l.uploadMedia.ErrorCode||{},a=e&&e.code;return a&&a!==n.GENERAL&&Object.prototype.hasOwnProperty.call(n,a)&&l.uploadMedia.getErrorMessage&&(n=l.uploadMedia.getErrorMessage(a,t))&&n.description?n.action?n.description+" "+n.action:n.description:e&&e.message||i("An error occurred while uploading the file.")}}}(window.wp);
\ No newline at end of file
+window.wp=window.wp||{},function(l){const a=l.i18n.__,d=window._wpMediaUploadPipelineSettings||{};let u,e=!1;const p=new Map,f=new WeakSet,o=Object.keys(d.allImageSizes||{}).length,g=["jpeg","png","gif","webp","avif","heic","heif"];function t(n){var e=n.file;const t=n.additionalData||{},i=new FormData;i.append("file",e,e.name||e.type.replace("/",".")),Object.keys(t).forEach(function(e){!function t(n,i,a){null!==a&&"object"==typeof a&&Object.getPrototypeOf(a)===Object.prototype?Object.keys(a).forEach(function(e){t(n,i+"["+e+"]",a[e])}):void 0!==a&&n.append(i,String(a))}(i,e,t[e])}),l.apiFetch({path:"/wp/v2/media/"+n.attachmentId+"/sideload",body:i,method:"POST",signal:n.signal}).then(function(e){n.onSuccess&&n.onSuccess(e)}).catch(function(t){if(n.onError){let e=t;t instanceof Error||(e=new Error(t&&t.message?t.message:String(t))),n.onError(e)}})}async function n(e,t){e=await l.apiFetch({path:"/wp/v2/media/"+e+"/finalize",method:"POST",data:{sub_sizes:t||[]}});if(e)return l.mediaUtils.transformAttachment(e)}function m(e){return l.apiFetch({path:"/wp/v2/media/"+e+"?force=true",method:"DELETE"})}function i(){return Boolean(Boolean("undefined"!=typeof plupload&&l.uploadMedia&&l.mediaUtils&&l.data&&l.element&&l.apiFetch)&&l.uploadMedia.detectClientSideMediaSupport&&l.uploadMedia.detectClientSideMediaSupport().supported)}function r(){if(0!==p.size){const n=new Set;l.data.select(u).getItems().forEach(function(e){var t;e.parentId||(t=p.get(e.onSuccess))&&(n.add(e.onSuccess),t.seen=!0,e.attachment&&e.attachment.id&&(t.attachmentId=e.attachment.id),t.onProgress)&&(e=Math.min(99,Math.round(function(e,t){if("number"==typeof e.progress)return e.progress;var n=e.operations?e.operations.length:0;let i=t.totals;if(i||(i={total:n,remaining:n},t.totals=i),n>i.remaining&&(i.total+=n-i.remaining),i.remaining=n,0===i.total)return 0;let a=0;return(i.total-n+(a="THUMBNAIL_GENERATION"===e.currentOperation&&0<o?Math.min(1,(e.subSizes||[]).length/o):a))/i.total*100}(e,t))))!==t.lastPercent&&(t.lastPercent=e,t.onProgress(e))}),p.forEach(function(e,t){e.seen&&!n.has(t)&&e.fail({message:a("An error occurred while uploading the file.")})})}}function s(){var e=l.data.select(u).getSettings();return Boolean(e&&e.mediaSideload&&e.mediaFinalize)}function c(){window.addEventListener("beforeunload",function(e){0<p.size&&e.preventDefault()})}function h(){return e&&s()}function E(e){var e=/\.([a-z0-9]+)$/i.exec(e||"");return e&&(e="jpg"===(e=e[1].toLowerCase())?"jpeg":e,g.includes(e))?e:null}function S(e,t){var n,i,a,e=e.settings&&e.settings.resize,o=Boolean(e&&e.enabled),r={pipeline:[],classic:[]};for(const c of t)if(plupload.FAILED!==c.status){var s=c.getNative&&c.getNative();if(!s||f.has(s))return null;s=c.type||"";n=c,a=i=void 0,i=(n.type||"").toLowerCase(),a=d.allowedMimeTypes,(i&&a&&!Object.values(a).includes(i)||!(i.startsWith("image/")&&g.includes(i.slice(6))||"heic"===(a=E(n.name))||"heif"===a)||o&&/^image\/(?:jpeg|png)$/i.test(s)?r.classic:r.pipeline).push(c)}return r.pipeline.length?r:null}function w(e,t){f.add(t),e.addFile(t)}l.mediaUploadPipeline={isSupported:i,configure:function(){if(!e){if(!i())return!1;e=!0,u=l.uploadMedia.store,d.isBlockEditor||s()||(window.__clientSideMediaProcessing=!0,l.element.createRoot(document.createElement("div")).render(l.element.createElement(l.uploadMedia.MediaUploadProvider,{settings:{mediaUpload:l.mediaUtils.uploadMedia,mediaSideload:t,mediaFinalize:n,mediaDelete:m,maxUploadFileSize:d.maxUploadFileSize,allowedMimeTypes:d.allowedMimeTypes,allImageSizes:d.allImageSizes,bigImageSizeThreshold:d.bigImageSizeThreshold,imageStripMeta:d.imageStripMeta,imageMaxBitDepth:d.imageMaxBitDepth,generateAnimatedImageSubsizes:d.generateAnimatedImageSubsizes},useSubRegistry:!1}))),l.data.subscribe(r,u),c()}return!0},isReady:h,routeBatch:function(s,e,c){if(h()){var n,e=S(s,e);if(e){const d=function(t,e){const n={};return Object.keys(t||{}).forEach(function(e){"action"!==e&&"_wpnonce"!==e&&"post_id"!==e&&(n[e]=t[e])}),e&&(n.post=e),n}(s.settings&&s.settings.multipart_params||{},c.postId);return c.onStart&&c.onStart(e.pipeline),e.pipeline.forEach(function(e){const o=e.getNative(),r=c.onQueue(e,o);s.removeFile(e);{e=o;var t=d,n={onSuccess:r.onSuccess,onProgress:r.onProgress,onError:function(e){var t,n,i,a;t=s,n=e,i=o,a=l.uploadMedia.ErrorCode||{},n&&a.HEIC_DECODE_ERROR&&n.code===a.HEIC_DECODE_ERROR&&t&&"function"==typeof t.addFile&&(!t.settings||!t.settings.heic_upload_error)&&(w(t,i),1)?r.onHandOff():r.onError(e)}};function i(e){p.delete(i),n.onSuccess&&n.onSuccess(e[0])}const a={onProgress:n.onProgress,lastPercent:-1,totals:null,seen:!1,attachmentId:0,fail:function(e){p.delete(i)&&(a.attachmentId&&m(a.attachmentId).catch(function(){}),n.onError)&&n.onError(e)}};p.set(i,a),l.data.dispatch(u).addItems({files:[e],additionalData:t||{},onSuccess:i,onError:function(e){a.fail("string"==typeof e?{message:e}:e)}})}}),n=s,e.classic.forEach(function(e){var t=e.getNative();n.removeFile(e),w(n,t)}),s.refresh(),!1}}},getErrorText:function(e,t){var n=l.uploadMedia.ErrorCode||{},i=e&&e.code;return i&&i!==n.GENERAL&&Object.prototype.hasOwnProperty.call(n,i)&&l.uploadMedia.getErrorMessage&&(n=l.uploadMedia.getErrorMessage(i,t))&&n.description?n.action?n.description+" "+n.action:n.description:e&&e.message||a("An error occurred while uploading the file.")},getImageSubtype:E}}(window.wp);
\ No newline at end of file
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 1da7d202f4..d1240a2877 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta4-65355';
+$wp_version = '7.2-beta4-65356';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.