From 693e90ac81edb2704796f46dd2cc9a7674de0def Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 25 May 2019 14:35:52 +0000 Subject: [PATCH] Editor: In `edit-form-blocks.php`, check the result of `wp_set_post_lock()`, which may return `false` and cause a warning when passed to `implode()`. Props kakshak, aduth. Fixes #47013. Built from https://develop.svn.wordpress.org/trunk@45413 git-svn-id: http://core.svn.wordpress.org/trunk@45224 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-blocks.php | 8 ++++++-- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index 0ae82cb3a3..29bf93e80e 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -247,9 +247,13 @@ if ( $user_id ) { } else { // Lock the post. $active_post_lock = wp_set_post_lock( $post->ID ); - $lock_details = array( + if ( $active_post_lock ) { + $active_post_lock = esc_attr( implode( ':', $active_post_lock ) ); + } + + $lock_details = array( 'isLocked' => false, - 'activePostLock' => esc_attr( implode( ':', $active_post_lock ) ), + 'activePostLock' => $active_post_lock, ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index d504018884..f71263c993 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45412'; +$wp_version = '5.3-alpha-45413'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.