Making WordPress.org

Changeset 5278


Ignore:
Timestamp:
04/07/2017 05:20:58 AM (8 years ago)
Author:
iandunn
Message:

Events: Only SELECT the columns that are actually used

File:
1 edited

Legend:

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

    r5277 r5278  
    196196
    197197    $row = $wpdb->get_row( $wpdb->prepare( "
    198         SELECT *
     198        SELECT name, latitude, longitude, country
    199199        FROM geoname
    200200        WHERE
     
    339339        return;
    340340
    341     $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ip2location WHERE ip_to >= %d ORDER BY ip_to ASC LIMIT 1", $long_ip ) );
     341    $row = $wpdb->get_row( $wpdb->prepare( "
     342        SELECT ip_city, ip_latitude, ip_longitude, country_short
     343        FROM ip2location
     344        WHERE ip_to >= %d
     345        ORDER BY ip_to ASC
     346        LIMIT 1",
     347        $long_ip
     348    ) );
     349
    342350    // Unknown location:
    343351    if ( ! $row || '-' == $row->country_short ) {
Note: See TracChangeset for help on using the changeset viewer.