Changeset 40774
- Timestamp:
- 05/18/2017 07:30:05 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-community-events.php
r40669 r40774 138 138 * @since 4.8.0 139 139 * 140 * @param string $search City search string. Default empty string.141 * @param string $timezone Timezone string. Default empty string.140 * @param string $search Optional. City search string. Default empty string. 141 * @param string $timezone Optional. Timezone string. Default empty string. 142 142 * @return string The request URL. 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 'number' => 5, // Get more than three in case some get trimmed out. 148 'ip' => $this->maybe_anonymize_ip_address( $this->get_unsafe_client_ip() ), 149 ); 147 150 148 151 /* … … 162 165 if ( $search ) { 163 166 $args['location'] = $search; 164 } else {165 /*166 * Protect the user's privacy by anonymizing their IP before sending167 * it to w.org, and only send it when necessary.168 *169 * The w.org API endpoint only uses the IP address when a location170 * query is not provided, so we can safely avoid sending it when171 * there is a query.172 */173 $args['ip'] = $this->maybe_anonymize_ip_address( $this->get_unsafe_client_ip() );174 167 } 175 168 }
Note: See TracChangeset
for help on using the changeset viewer.