mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 22:56:19 +01:00
Forward pingback IP during pingback verification.
Merges [27872] to the 3.7 branch. props tellyworth, nacin. fixes #27613. Built from https://develop.svn.wordpress.org/branches/3.7@27878 git-svn-id: http://core.svn.wordpress.org/branches/3.7@27709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a9ce0ee825
commit
2486cbe932
@ -5391,11 +5391,18 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
// very stupid, but gives time to the 'from' server to publish !
|
||||
sleep(1);
|
||||
|
||||
$remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
|
||||
$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $GLOBALS['wp_version'] . '; ' . get_bloginfo( 'url' ) );
|
||||
|
||||
// Let's check the remote site
|
||||
$http_api_args = array(
|
||||
'timeout' => 10,
|
||||
'redirection' => 0,
|
||||
'limit_response_size' => 153600, // 150 KB
|
||||
'user-agent' => "$user_agent; verifying pingback from $remote_ip",
|
||||
'headers' => array(
|
||||
'X-Pingback-Forwarded-For' => $remote_ip,
|
||||
),
|
||||
);
|
||||
$linea = wp_remote_retrieve_body( wp_safe_remote_get( $pagelinkedfrom, $http_api_args ) );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user