WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/18/2016 02:25:13 PM (20 months ago)
Author:
SergeyBiryukov
Message:

XML-RPC: Avoid a PHP notice in ::pingback_ping() if page title was not found.

Props RedSand.
Fixes #36727.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r38600 r38620  
    63246324
    63256325        preg_match( '|<title>([^<]*?)</title>|is', $remote_source, $matchtitle );
    6326         $title = $matchtitle[1];
    6327         if ( empty( $title ) )
    6328             return $this->pingback_error( 32, __('We cannot find a title on that page.' ) );
     6326        $title = isset( $matchtitle[1] ) ? $matchtitle[1] : '';
     6327        if ( empty( $title ) ) {
     6328            return $this->pingback_error( 32, __( 'We cannot find a title on that page.' ) );
     6329        }
    63296330
    63306331        $remote_source = strip_tags( $remote_source, '<a>' ); // just keep the tag we need
Note: See TracChangeset for help on using the changeset viewer.