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
This commit is contained in:
Sergey Biryukov 2020-07-26 14:08:05 +00:00
parent d8c62b5647
commit 6731940272
2 changed files with 2 additions and 2 deletions

View File

@ -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 ) {

View File

@ -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.