From a5ec57ebfea3cbd64a386be3e0a0c7f553c38ef6 Mon Sep 17 00:00:00 2001 From: Paulo Cruz Date: Thu, 10 Oct 2024 09:29:22 -0300 Subject: [PATCH] VideoPress: Add missing check for empty video_info on get_media_item_v1_1 (#39706) * Add missing check for empty video_info * changelog * Use ! empty --- .../plugins/jetpack/changelog/fix-empty-video-info-warning | 5 +++++ projects/plugins/jetpack/class.json-api-endpoints.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/fix-empty-video-info-warning diff --git a/projects/plugins/jetpack/changelog/fix-empty-video-info-warning b/projects/plugins/jetpack/changelog/fix-empty-video-info-warning new file mode 100644 index 0000000000000..cb0601cecf6eb --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-empty-video-info-warning @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Add missing check for empty video_info on get_media_item_v1_1 + + diff --git a/projects/plugins/jetpack/class.json-api-endpoints.php b/projects/plugins/jetpack/class.json-api-endpoints.php index 68e2288596ace..d3a2225cd16aa 100644 --- a/projects/plugins/jetpack/class.json-api-endpoints.php +++ b/projects/plugins/jetpack/class.json-api-endpoints.php @@ -1739,7 +1739,7 @@ public function get_media_item_v1_1( $media_id, $media_item = null, $file = null } $thumbnail_query_data = array(); - if ( function_exists( 'video_is_private' ) && video_is_private( $info ) ) { + if ( ! empty( $info ) && function_exists( 'video_is_private' ) && video_is_private( $info ) ) { $thumbnail_query_data['metadata_token'] = video_generate_auth_token( $info ); }