mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48621 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user