Index: /sites/trunk/api.wordpress.org/public_html/events/1.0/index.php
===================================================================
--- /sites/trunk/api.wordpress.org/public_html/events/1.0/index.php (revision 5540)
+++ /sites/trunk/api.wordpress.org/public_html/events/1.0/index.php (revision 5541)
@@ -722,21 +722,20 @@
global $wpdb;
- $country = $wpdb->get_row( $wpdb->prepare( "
- SELECT country_short, country_long
- FROM ip2location
+ $field = 'name';
+
+ if ( strlen( $country_name ) == 2 ) {
+ $field = 'country';
+ }
+
+ return $wpdb->get_row( $wpdb->prepare( "
+ SELECT
+ country as country_short,
+ name as country_long
+ FROM countrycodes
WHERE
- country_long = %s OR
- country_short = %s
+ $field = %s
LIMIT 1",
- $country_name,
$country_name
), 'ARRAY_A' );
-
- // Convert all errors to boolean false for consistency
- if ( empty( $country ) ) {
- $country = false;
- }
-
- return $country;
}