Making WordPress.org


Ignore:
Timestamp:
02/22/2017 01:22:33 AM (10 years ago)
Author:
dd32
Message:

Events API: Correctly match the locale field based, this was referencing a non-set array indicy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/index.php

    r4978 r4979  
    7777        $location_name = '"' . strtr( $location_name, [ '"' => '', "'" => '' ] ) . '"';
    7878        $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM geoname WHERE MATCH(name,asciiname,alternatenames) AGAINST(%s IN BOOLEAN MODE) ORDER BY FIELD(%s, country) DESC, FIELD(%s, timezone) DESC, population DESC LIMIT 1", $location_name, $country, $timezone ) );
     79
    7980        return $row;
    8081}
    … …  
    101102        if ( isset( $args['country'] ) ) {
    102103                return array(
    103                         'country'     => $args['country'],
     104                        'country' => $args['country'],
    104105                );
    105106        }
    106107
    107108        $country_code = null;
    108         if ( isset( $args['location_data']['locale'] ) && preg_match( '/^[a-z]+[-_]([a-z]+)$/i', $args['location_data']['locale'], $match ) ) {
     109        if ( isset( $args['locale'] ) && preg_match( '/^[a-z]+[-_]([a-z]+)$/i', $args['locale'], $match ) ) {
    109110                $country_code = $match[1];
    110111        }
    … …  
    135136                }
    136137        }
    137                                
     138
    138139        if (
    139140                ! empty( $args['latitude'] )  && is_numeric( $args['latitude'] ) &&
Note: See TracChangeset for help on using the changeset viewer.