diff --git src/wp-admin/includes/class-wp-community-events.php src/wp-admin/includes/class-wp-community-events.php
index d3c6f08699..2f1ac86c42 100644
|
|
|
class WP_Community_Events { |
| 143 | 143 | */ |
| 144 | 144 | protected function get_request_url( $search = '', $timezone = '' ) { |
| 145 | 145 | $api_url = 'https://api.wordpress.org/events/1.0/'; |
| 146 | | $args = array( 'number' => 5 ); // Get more than three in case some get trimmed out. |
| | 146 | $args = array( |
| | 147 | // Get more than three in case some get trimmed out. |
| | 148 | 'number' => 5, |
| | 149 | |
| | 150 | // Anonymize the IP to protect user privacy. |
| | 151 | 'ip' => $this->maybe_anonymize_ip_address( $this->get_unsafe_client_ip() ), |
| | 152 | ); |
| 147 | 153 | |
| 148 | 154 | /* |
| 149 | 155 | * Send the minimal set of necessary arguments, in order to increase the |
| … |
… |
class WP_Community_Events { |
| 161 | 167 | |
| 162 | 168 | if ( $search ) { |
| 163 | 169 | $args['location'] = $search; |
| 164 | | } else { |
| 165 | | /* |
| 166 | | * Protect the user's privacy by anonymizing their IP before sending |
| 167 | | * it to w.org, and only send it when necessary. |
| 168 | | * |
| 169 | | * The w.org API endpoint only uses the IP address when a location |
| 170 | | * query is not provided, so we can safely avoid sending it when |
| 171 | | * there is a query. |
| 172 | | */ |
| 173 | | $args['ip'] = $this->maybe_anonymize_ip_address( $this->get_unsafe_client_ip() ); |
| 174 | 170 | } |
| 175 | 171 | } |
| 176 | 172 | |