PluginProbe
SendWP / 1.2.5
SendWP v1.2.5
trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2.10 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.4.4 1.4.5 1.4.6 1.4.8
← All changes | includes/api/class.request.php +9 -0 1.11.2.5 View file →
@@ -44,8 +44,17 @@
44 44 {
45 45 $args[ 'method' ] = $method;
46 46 $args['reject_unsafe_urls'] = false; // Whitelist requests to the service.
47 47 $args[ 'headers' ][ 'x-sendwp-client-auth' ] = $this->get_auth_headers();
48 +
49 + if (! empty($_SERVER['HTTP_CLIENT_IP'])) {
50 + $args['headers']['x-forwarded-for'] = $_SERVER['HTTP_CLIENT_IP'];
51 + } elseif (! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
52 + $args['headers']['x-forwarded-for'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
53 + } else {
54 + $args['headers']['x-forwarded-for'] = $_SERVER['REMOTE_ADDR'];
55 + }
56 +
48 57 return wp_remote_request( $this->request_url(), $args );
49 58 }
50 59
51 60 protected function get_auth_headers()