- Timestamp:
- 02/22/2017 12:47:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/index.php
r4884 r4978 80 80 } 81 81 82 function guess_location_from_ip( $dotted_ip , $timezone, $country) {82 function guess_location_from_ip( $dotted_ip ) { 83 83 global $wpdb; 84 84 … … 88 88 89 89 $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ip2location WHERE ip_to >= %d ORDER BY ip_to ASC LIMIT 1", $long_ip ) ); 90 // Unknown location: 91 if ( ! $row || '-' == $row->country_short ) { 92 return; 93 } 94 90 95 return $row; 91 96 } … … 120 125 // IP: 121 126 if ( isset( $args['ip'] ) ) { 122 $guess = guess_location_from_ip( $args['ip'] , $args['timezone'] ?? '', $country_code);127 $guess = guess_location_from_ip( $args['ip'] ); 123 128 if ( $guess ) { 124 129 return array(
Note: See TracChangeset
for help on using the changeset viewer.