Making WordPress.org


Ignore:
Timestamp:
11/30/2020 05:40:43 AM (3 years ago)
Author:
dd32
Message:

Events API: Don't strip commas when performing location lookups. This allows for disambiguation to occur better by treating commas as separators.

See #3367.

File:
1 edited

Legend:

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

    r10474 r10475  
    135135    // Simplified parameters for lookup by location (city) name, with optional timezone and locale params for extra context.
    136136    if ( isset( $_REQUEST['location'] ) ) {
    137         $location_args['location_name'] = trim( str_replace( ',', ' ', $_REQUEST['location'] ) );
     137        $location_args['location_name'] = trim( $_REQUEST['location'] );
    138138    }
    139139
     
    311311     * delimiter.
    312312     */
    313     $location_name_parts = preg_split( '/\s+/u', $location_name );
     313    $location_name_parts = preg_split( '/[,\s]+/u', $location_name );
    314314    $location_word_count = count( $location_name_parts );
    315315
Note: See TracChangeset for help on using the changeset viewer.