mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-13 22:26:06 +01:00
Media: In wp_ajax_image_editor()
, check if the error
property exists before accessing it.
This avoids a PHP notice when editing an image. Follow-up to [48375]. Props Mista-Flo. Merges [48946] to the 5.5 branch. Fixes #51251. Built from https://develop.svn.wordpress.org/branches/5.5@48956 git-svn-id: http://core.svn.wordpress.org/branches/5.5@48718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ff206bc029
commit
a4b9563038
@ -2604,10 +2604,11 @@ function wp_ajax_image_editor() {
|
||||
include_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
|
||||
$msg = false;
|
||||
|
||||
switch ( $_POST['do'] ) {
|
||||
case 'save':
|
||||
$msg = wp_save_image( $attachment_id );
|
||||
if ( $msg->error ) {
|
||||
if ( ! empty( $msg->error ) ) {
|
||||
wp_send_json_error( $msg );
|
||||
}
|
||||
|
||||
@ -2625,7 +2626,7 @@ function wp_ajax_image_editor() {
|
||||
wp_image_editor( $attachment_id, $msg );
|
||||
$html = ob_get_clean();
|
||||
|
||||
if ( $msg->error ) {
|
||||
if ( ! empty( $msg->error ) ) {
|
||||
wp_send_json_error(
|
||||
array(
|
||||
'message' => $msg,
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5.2-alpha-48955';
|
||||
$wp_version = '5.5.2-alpha-48956';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user