- Timestamp:
- 06/05/2017 10:52:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/index.php
r5540 r5541 722 722 global $wpdb; 723 723 724 $country = $wpdb->get_row( $wpdb->prepare( " 725 SELECT country_short, country_long 726 FROM ip2location 724 $field = 'name'; 725 726 if ( strlen( $country_name ) == 2 ) { 727 $field = 'country'; 728 } 729 730 return $wpdb->get_row( $wpdb->prepare( " 731 SELECT 732 country as country_short, 733 name as country_long 734 FROM countrycodes 727 735 WHERE 728 country_long = %s OR 729 country_short = %s 736 $field = %s 730 737 LIMIT 1", 731 $country_name,732 738 $country_name 733 739 ), 'ARRAY_A' ); 734 735 // Convert all errors to boolean false for consistency736 if ( empty( $country ) ) {737 $country = false;738 }739 740 return $country;741 740 } 742 741
Note: See TracChangeset
for help on using the changeset viewer.