diff --git a/wp-admin/includes/class-plugin-installer-skin.php b/wp-admin/includes/class-plugin-installer-skin.php
index 9cc5646f0b..d2c038702a 100644
--- a/wp-admin/includes/class-plugin-installer-skin.php
+++ b/wp-admin/includes/class-plugin-installer-skin.php
@@ -292,17 +292,19 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$overwrite = $this->is_downgrading ? 'downgrade-plugin' : 'update-plugin';
$install_actions['ovewrite_plugin'] = sprintf(
- '%s',
+ '%s',
wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'plugin-upload' ),
- esc_html( __( 'Replace current with uploaded' ) )
+ __( 'Replace current with uploaded' )
);
} else {
echo $blocked_message;
}
+ $cancel_url = add_query_arg( 'action', 'upload-plugin-cancel-overwrite', $this->url );
+
$install_actions['plugins_page'] = sprintf(
'%s',
- self_admin_url( 'plugin-install.php' ),
+ wp_nonce_url( $cancel_url, 'plugin-upload-cancel-overwrite' ),
__( 'Cancel and go back' )
);
@@ -318,6 +320,10 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = apply_filters( 'install_plugin_ovewrite_actions', $install_actions, $this->api, $this->upgrader->new_plugin_data );
if ( ! empty( $install_actions ) ) {
+ printf(
+ '
%s
',
+ __( 'The uploaded file has expired. Please go back and upload it again.' )
+ );
echo '' . implode( ' ', (array) $install_actions ) . '
';
}
diff --git a/wp-admin/includes/class-theme-installer-skin.php b/wp-admin/includes/class-theme-installer-skin.php
index 89835f287f..2cdc698909 100644
--- a/wp-admin/includes/class-theme-installer-skin.php
+++ b/wp-admin/includes/class-theme-installer-skin.php
@@ -321,17 +321,19 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$overwrite = $this->is_downgrading ? 'downgrade-theme' : 'update-theme';
$install_actions['ovewrite_theme'] = sprintf(
- '%s',
+ '%s',
wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ),
- esc_html( __( 'Replace current with uploaded' ) )
+ __( 'Replace current with uploaded' )
);
} else {
echo $blocked_message;
}
+ $cancel_url = add_query_arg( 'action', 'upload-theme-cancel-overwrite', $this->url );
+
$install_actions['themes_page'] = sprintf(
'%s',
- self_admin_url( 'theme-install.php' ),
+ wp_nonce_url( $cancel_url, 'theme-upload-cancel-overwrite' ),
__( 'Cancel and go back' )
);
@@ -347,6 +349,10 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = apply_filters( 'install_theme_ovewrite_actions', $install_actions, $this->api, $this->upgrader->new_theme_data );
if ( ! empty( $install_actions ) ) {
+ printf(
+ '%s
',
+ __( 'The uploaded file has expired. Please go back and upload it again.' )
+ );
echo '' . implode( ' ', (array) $install_actions ) . '
';
}
diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php
index 630553d63f..1724b96728 100644
--- a/wp-admin/includes/class-wp-media-list-table.php
+++ b/wp-admin/includes/class-wp-media-list-table.php
@@ -69,6 +69,29 @@ class WP_Media_List_Table extends WP_List_Table {
public function prepare_items() {
global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
+ // Exclude attachments scheduled for deletion in the next two hours
+ // if they are for zip packages for interrupted or failed updates.
+ // See File_Upload_Upgrader class.
+ $not_in = array();
+
+ foreach ( _get_cron_array() as $cron ) {
+ if ( isset( $cron['upgrader_scheduled_cleanup'] ) ) {
+ $details = reset( $cron['upgrader_scheduled_cleanup'] );
+
+ if ( ! empty( $details['args'][0] ) ) {
+ $not_in[] = (int) $details['args'][0];
+ }
+ }
+ }
+
+ if ( ! empty( $_REQUEST['post__not_in'] ) && is_array( $_REQUEST['post__not_in'] ) ) {
+ $not_in = array_merge( array_values( $_REQUEST['post__not_in'] ), $not_in );
+ }
+
+ if ( ! empty( $not_in ) ) {
+ $_REQUEST['post__not_in'] = $not_in;
+ }
+
list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );
$this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];
diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js
index 8734ee72f4..7265ae4612 100644
--- a/wp-admin/js/common.js
+++ b/wp-admin/js/common.js
@@ -1606,6 +1606,35 @@ $document.ready( function() {
});
});
+// On the "Update plugin/theme from uploaded zip" screen
+// hide the "Replace current with uploaded" button and show a warning in 1 hour and 59 minutes.
+$document.ready( function( $ ) {
+ var $overwrite, $warning;
+
+ if ( ! $body.hasClass( 'update-php' ) ) {
+ return;
+ }
+
+ $overwrite = $( 'a.update-from-upload-overwrite' );
+ $warning = $( '.update-from-upload-expired' );
+
+ if ( ! $overwrite.length || ! $warning.length ) {
+ return;
+ }
+
+ window.setTimeout(
+ function() {
+ $overwrite.hide();
+ $warning.removeClass( 'hidden' );
+
+ if ( window.wp && window.wp.a11y ) {
+ window.wp.a11y.speak( $warning.text() );
+ }
+ },
+ 7140000 // 119 minutes. The uploaded file is deleted after 2 hours.
+ );
+} );
+
// Fire a custom jQuery event at the end of window resize.
( function() {
var timeout;
diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js
index c2e5c2a292..110d2ff7b5 100644
--- a/wp-admin/js/common.min.js
+++ b/wp-admin/js/common.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(V,q){var B=V(document),H=V(q),Y=V(document.body),G=wp.i18n.__;q.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},q.columns={init:function(){var n=this;V(".hide-column-tog","#adv-settings").click(function(){var e=V(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();V.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:V("#screenoptionnonce").val(),page:pagenow})},checked:function(e){V(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){V(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return V(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return V(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=V("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},B.ready(function(){columns.init()}),q.validateForm=function(e){return!V(e).find(".form-required").filter(function(){return""===V(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){V(this).closest(".form-invalid").removeClass("form-invalid")}).length},q.showNotice={warn:function(){return!!confirm(G("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},q.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=V("#screen-meta"),this.toggles=V("#screen-meta-links").find(".show-settings"),this.page=V("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=V("#"+V(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,V(this)):screenMeta.open(e,V(this)))},open:function(e,t){V("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),B.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),V(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),B.trigger("screen:options:close")}},V(".contextual-help-tabs").delegate("a","click",function(e){var t,n=V(this);if(e.preventDefault(),n.is(".active a"))return!1;V(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=V(n.attr("href")),V(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var e,a=!1,r=V("#permalink_structure"),t=V(".permalink-structure input:radio"),l=V("#custom_selection"),n=V(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==r.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function i(){B.trigger("wp-window-resized")}t.on("change",function(){"custom"!==this.value&&(r.val(this.value),n.each(function(){c(V(this))}))}),r.on("click input",function(){l.prop("checked",!0)}),r.on("focus",function(e){a=!0,V(this).off(e)}),n.each(function(){c(V(this))}),r.on("change",function(){n.each(function(){c(V(this))})}),n.on("click",function(){var e,t=r.val(),n=r[0].selectionStart,i=r[0].selectionEnd,o=V(this).text().trim(),s=V(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),r.val("/"===t?"":t),V("#custom_selection_updated").text(s),void c(V(this));a||0!==n||0!==i||(n=i=t.length),l.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),r.val(t.substr(0,n)+o+t.substr(i)),V("#custom_selection_updated").text(s),c(V(this)),a&&r[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,r[0].setSelectionRange(e,e),r.focus())}),B.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=V("input.current-page"),f=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),b=V("#adminmenuwrap"),v=V("#wpwrap"),g=V("#adminmenu"),w=V("#wp-responsive-overlay"),k=V("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),y=V(".meta-box-sortables"),x=!1,S=V("#wpadminbar"),D=0,M=!1,T=!1,E=0,_=!1,j={window:H.height(),wpwrap:v.height(),adminbar:S.height(),menu:b.height()},A=V(".wp-header-end");function O(){var e=V("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function I(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-v.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(G("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function U(){l.prop("disabled",""===c.map(function(){return V(this).val()}).get().join(""))}function z(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(j.menu+j.adminbarj.wpwrap)P();else{if(_=!0,j.menu+j.adminbar>j.window){if(t<0)return void(M||(T=!(M=!0),b.css({position:"fixed",top:"",bottom:""})));if(t+j.window>B.height()-1)return void(T||(M=!(T=!0),b.css({position:"fixed",top:"",bottom:0})));Dt+j.window&&(E=t),b.css({position:"absolute",top:E,bottom:""})):!M&&b.offset().top>=t+j.adminbar&&(M=!0,b.css({position:"fixed",top:"",bottom:""})):n&&(M=T=!1,0<(E=t+j.window-j.menu-j.adminbar-1)?b.css({position:"absolute",top:E,bottom:""}):P())}D=t}}function N(){j={window:H.height(),wpwrap:v.height(),adminbar:S.height(),menu:b.height()}}function P(){!h&&_&&(M=T=_=!1,b.css({position:"",top:"",bottom:""}))}function R(){N(),g.data("wp-responsive")?(Y.removeClass("sticky-menu"),P()):j.menu+j.adminbar>j.window?(z(),Y.removeClass("sticky-menu")):(Y.addClass("sticky-menu"),P())}function W(){V(".aria-button-if-js").attr("role","button")}function F(){var e=!1;return q.innerWidth&&(e=Math.max(q.innerWidth,document.documentElement.clientWidth)),e}function Q(){var e=F()||961;r=e<=782?"responsive":Y.hasClass("folded")||Y.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=V(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=V(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(V(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),B.on("wp-window-resized.wp-responsive",V.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),B.on("postbox-toggled",this.maybeDisableSortables),V("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),V(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(y.length)try{y.sortable("disable"),y.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(y.length)try{y.sortable("enable"),y.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},V(document).ajaxComplete(function(){W()}),B.on("wp-window-resized.set-menu-state",Q),B.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=V("#collapse-button");i="folded"===t.state?(n="false",G("Expand Main menu")):(n="true",G("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),q.wpResponsive.init(),R(),Q(),O(),K(),W(),B.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",R),V(".wp-initial-focus").focus(),Y.on("click",".js-update-details-toggle",function(){var e=V(this).closest(".js-update-details"),t=V("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),V(this).attr("aria-expanded",t.is(":visible"))})}),H.on("resize.wp-fire-once",function(){q.clearTimeout(e),e=q.setTimeout(i,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window);
\ No newline at end of file
+!function(V,q){var B=V(document),H=V(q),Y=V(document.body),G=wp.i18n.__;q.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},q.columns={init:function(){var n=this;V(".hide-column-tog","#adv-settings").click(function(){var e=V(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();V.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:V("#screenoptionnonce").val(),page:pagenow})},checked:function(e){V(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){V(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return V(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return V(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=V("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},B.ready(function(){columns.init()}),q.validateForm=function(e){return!V(e).find(".form-required").filter(function(){return""===V(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){V(this).closest(".form-invalid").removeClass("form-invalid")}).length},q.showNotice={warn:function(){return!!confirm(G("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},q.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=V("#screen-meta"),this.toggles=V("#screen-meta-links").find(".show-settings"),this.page=V("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=V("#"+V(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,V(this)):screenMeta.open(e,V(this)))},open:function(e,t){V("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),B.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),V(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),B.trigger("screen:options:close")}},V(".contextual-help-tabs").delegate("a","click",function(e){var t,n=V(this);if(e.preventDefault(),n.is(".active a"))return!1;V(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=V(n.attr("href")),V(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var e,a=!1,r=V("#permalink_structure"),t=V(".permalink-structure input:radio"),l=V("#custom_selection"),n=V(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==r.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function i(){B.trigger("wp-window-resized")}t.on("change",function(){"custom"!==this.value&&(r.val(this.value),n.each(function(){c(V(this))}))}),r.on("click input",function(){l.prop("checked",!0)}),r.on("focus",function(e){a=!0,V(this).off(e)}),n.each(function(){c(V(this))}),r.on("change",function(){n.each(function(){c(V(this))})}),n.on("click",function(){var e,t=r.val(),n=r[0].selectionStart,i=r[0].selectionEnd,o=V(this).text().trim(),s=V(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),r.val("/"===t?"":t),V("#custom_selection_updated").text(s),void c(V(this));a||0!==n||0!==i||(n=i=t.length),l.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),r.val(t.substr(0,n)+o+t.substr(i)),V("#custom_selection_updated").text(s),c(V(this)),a&&r[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,r[0].setSelectionRange(e,e),r.focus())}),B.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=V("input.current-page"),h=p.val(),f=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),v=V("#adminmenuwrap"),b=V("#wpwrap"),g=V("#adminmenu"),w=V("#wp-responsive-overlay"),k=V("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),y=V(".meta-box-sortables"),x=!1,S=V("#wpadminbar"),D=0,T=!1,M=!1,E=0,_=!1,j={window:H.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()},A=V(".wp-header-end");function O(){var e=V("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function I(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(G("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function U(){l.prop("disabled",""===c.map(function(){return V(this).val()}).get().join(""))}function z(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!f&&!g.data("wp-responsive"))if(j.menu+j.adminbarj.wpwrap)P();else{if(_=!0,j.menu+j.adminbar>j.window){if(t<0)return void(T||(M=!(T=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+j.window>B.height()-1)return void(M||(T=!(M=!0),v.css({position:"fixed",top:"",bottom:0})));Dt+j.window&&(E=t),v.css({position:"absolute",top:E,bottom:""})):!T&&v.offset().top>=t+j.adminbar&&(T=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(T=M=!1,0<(E=t+j.window-j.menu-j.adminbar-1)?v.css({position:"absolute",top:E,bottom:""}):P())}D=t}}function N(){j={window:H.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()}}function P(){!f&&_&&(T=M=_=!1,v.css({position:"",top:"",bottom:""}))}function R(){N(),g.data("wp-responsive")?(Y.removeClass("sticky-menu"),P()):j.menu+j.adminbar>j.window?(z(),Y.removeClass("sticky-menu")):(Y.addClass("sticky-menu"),P())}function W(){V(".aria-button-if-js").attr("role","button")}function F(){var e=!1;return q.innerWidth&&(e=Math.max(q.innerWidth,document.documentElement.clientWidth)),e}function Q(){var e=F()||961;r=e<=782?"responsive":Y.hasClass("folded")||Y.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=V(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=V(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(V(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),B.on("wp-window-resized.wp-responsive",V.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),B.on("postbox-toggled",this.maybeDisableSortables),V("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),V(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(y.length)try{y.sortable("disable"),y.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(y.length)try{y.sortable("enable"),y.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},V(document).ajaxComplete(function(){W()}),B.on("wp-window-resized.set-menu-state",Q),B.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=V("#collapse-button");i="folded"===t.state?(n="false",G("Expand Main menu")):(n="true",G("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),q.wpResponsive.init(),R(),Q(),O(),K(),W(),B.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",R),V(".wp-initial-focus").focus(),Y.on("click",".js-update-details-toggle",function(){var e=V(this).closest(".js-update-details"),t=V("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),V(this).attr("aria-expanded",t.is(":visible"))})}),B.ready(function(e){var t,n;Y.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&q.setTimeout(function(){t.hide(),n.removeClass("hidden"),q.wp&&q.wp.a11y&&q.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){q.clearTimeout(e),e=q.setTimeout(i,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window);
\ No newline at end of file
diff --git a/wp-admin/update.php b/wp-admin/update.php
index 700c0a779c..7980ea7a8b 100644
--- a/wp-admin/update.php
+++ b/wp-admin/update.php
@@ -17,6 +17,8 @@ require_once __DIR__ . '/admin.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+wp_enqueue_script( 'wp-a11y' );
+
if ( isset( $_GET['action'] ) ) {
$plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';
$theme = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : '';
@@ -174,6 +176,26 @@ if ( isset( $_GET['action'] ) ) {
require_once ABSPATH . 'wp-admin/admin-footer.php';
+ } elseif ( 'upload-plugin-cancel-overwrite' === $action ) {
+ if ( ! current_user_can( 'upload_plugins' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
+ }
+
+ check_admin_referer( 'plugin-upload-cancel-overwrite' );
+
+ // Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die()
+ // that shows a generic "Please select a file" error.
+ if ( ! empty( $_GET['package'] ) ) {
+ $attachment_id = (int) $_GET['package'];
+
+ if ( get_post( $attachment_id ) ) {
+ $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
+ $file_upload->cleanup();
+ }
+ }
+
+ wp_redirect( self_admin_url( 'plugin-install.php' ) );
+ exit;
} elseif ( 'upgrade-theme' === $action ) {
if ( ! current_user_can( 'update_themes' ) ) {
@@ -297,6 +319,26 @@ if ( isset( $_GET['action'] ) ) {
require_once ABSPATH . 'wp-admin/admin-footer.php';
+ } elseif ( 'upload-theme-cancel-overwrite' === $action ) {
+ if ( ! current_user_can( 'upload_themes' ) ) {
+ wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
+ }
+
+ check_admin_referer( 'theme-upload-cancel-overwrite' );
+
+ // Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die()
+ // that shows a generic "Please select a file" error.
+ if ( ! empty( $_GET['package'] ) ) {
+ $attachment_id = (int) $_GET['package'];
+
+ if ( get_post( $attachment_id ) ) {
+ $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
+ $file_upload->cleanup();
+ }
+ }
+
+ wp_redirect( self_admin_url( 'theme-install.php' ) );
+ exit;
} else {
/**
* Fires when a custom plugin or theme update request is received.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 77ef0369e9..34a22c6264 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.5-beta1-48416';
+$wp_version = '5.5-beta1-48417';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.