diff --git a/wp-includes/media.php b/wp-includes/media.php index 260db26cac..2b46167afc 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1857,6 +1857,12 @@ function wp_filter_content_tags( $content, $context = null ) { if ( $filtered_image !== $match[0] ) { $content = str_replace( $match[0], $filtered_image, $content ); } + + /* + * Unset image lookup to not run the same logic again unnecessarily if the same image tag is used more than + * once in the same blob of content. + */ + unset( $images[ $match[0] ] ); } // Filter an iframe match. @@ -1871,6 +1877,12 @@ function wp_filter_content_tags( $content, $context = null ) { if ( $filtered_iframe !== $match[0] ) { $content = str_replace( $match[0], $filtered_iframe, $content ); } + + /* + * Unset iframe lookup to not run the same logic again unnecessarily if the same iframe tag is used more + * than once in the same blob of content. + */ + unset( $iframes[ $match[0] ] ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2caf2499c6..a1c93a42b5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53148'; +$wp_version = '6.0-alpha-53149'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.