WordPress.org

Make WordPress Core

Changeset 27873


Ignore:
Timestamp:
03/31/2014 08:44:08 PM (7 years ago)
Author:
nacin
Message:

Forward pingback IP during pingback verification.

Merges [27872] to the 3.8 branch.

props tellyworth, nacin.
fixes #27613.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/src/wp-includes/class-wp-xmlrpc-server.php

    r26120 r27873  
    53915391        sleep(1);
    53925392
     5393        $remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
     5394        $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $GLOBALS['wp_version'] . '; ' . get_bloginfo( 'url' ) );
     5395
    53935396        // Let's check the remote site
    53945397        $http_api_args = array(
     
    53965399            'redirection' => 0,
    53975400            'limit_response_size' => 153600, // 150 KB
     5401            'user-agent' => "$user_agent; verifying pingback from $remote_ip",
     5402            'headers' => array(
     5403                'X-Pingback-Forwarded-For' => $remote_ip,
     5404            ),
    53985405        );
    53995406        $linea = wp_remote_retrieve_body( wp_safe_remote_get( $pagelinkedfrom, $http_api_args ) );
Note: See TracChangeset for help on using the changeset viewer.