Making WordPress.org


Ignore:
Timestamp:
03/07/2017 01:28:44 AM (10 years ago)
Author:
iandunn
Message:

Events API: Trim input and strip commas to avoid false negatives

If the user entered Portland or Portland, Oregon, we wouldn't want to query the database for Portland or Portland,.

File:
1 edited

Legend:

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

    r5101 r5102  
    6565        // Simplified parameters for lookup by location (city) name, with optional timezone and locale params for extra context.
    6666        if ( isset( $_REQUEST['location'] ) ) {
    67                 $location_args['location_name'] = $_REQUEST['location'];
     67                $location_args['location_name'] = trim( $_REQUEST['location'] );
     68                $location_args['location_name'] = str_replace( ',', '', $location_args['location_name'] );
    6869        }
    6970
Note: See TracChangeset for help on using the changeset viewer.