From 8518cbeea978eca5c8a24855cefa3d919a5a8a99 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Thu, 29 Oct 2020 16:54:05 +0000 Subject: [PATCH] Embeds: Disable embeds on deactivated Multisite sites. Props xknown, whyisjake, zieladam, peterwilsoncc. Built from https://develop.svn.wordpress.org/branches/5.5@49374 git-svn-id: http://core.svn.wordpress.org/branches/5.5@49133 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/embed.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/embed.php b/wp-includes/embed.php index 8380a72c96..1fa137a614 100644 --- a/wp-includes/embed.php +++ b/wp-includes/embed.php @@ -611,6 +611,11 @@ function get_oembed_response_data_for_url( $url, $args ) { $sites = get_sites( $qv ); $site = reset( $sites ); + // Do not allow embeds for deleted/archived/spam sites. + if ( ! empty( $site->deleted ) || ! empty( $site->spam ) || ! empty( $site->archived ) ) { + return false; + } + if ( $site && get_current_blog_id() !== (int) $site->blog_id ) { switch_to_blog( $site->blog_id ); $switched_blog = true; diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e560888bd..1dcda33f73 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5.2-alpha-49373'; +$wp_version = '5.5.2-alpha-49374'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.