From 6731940272c3230c83024653089fdbf6c2d96327 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 26 Jul 2020 14:08:05 +0000 Subject: [PATCH] Pings/Trackbacks: Avoid a PHP notice in `do_enclose()` when encountering a URL without a path in post content. Props jbouganim, mukesh27, Otto42, SergeyBiryukov. Fixes #49872. Built from https://develop.svn.wordpress.org/trunk@48621 git-svn-id: http://core.svn.wordpress.org/trunk@48383 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 7127f145cc..b07ecb7f4d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -907,7 +907,7 @@ function do_enclose( $content = null, $post ) { // Check to see if we can figure out the mime type from the extension. $url_parts = parse_url( $url ); - if ( false !== $url_parts ) { + if ( false !== $url_parts && ! empty( $url_parts['path'] ) ) { $extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION ); if ( ! empty( $extension ) ) { foreach ( wp_get_mime_types() as $exts => $mime ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 3a14dedeef..3557919ba6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta3-48620'; +$wp_version = '5.5-beta3-48621'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.