Changeset 9640
- Timestamp:
- 03/29/2020 01:47:54 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/index.php
r9349 r9640 301 301 FIELD( %s, country ) DESC, 302 302 FIELD( %s, timezone ) DESC, 303 population DESC 303 population DESC, 304 BINARY LOWER( %s ) = BINARY LOWER( name ) DESC 304 305 LIMIT 1"; 305 306 306 $prepared_query = $wpdb->prepare( $query, $location_name, $country, $timezone );307 $prepared_query = $wpdb->prepare( $query, $location_name, $country, $timezone, $location_name ); 307 308 $db_handle = $wpdb->db_connect( $prepared_query ); 308 309 … … 320 321 FIELD( %s, country ) DESC, 321 322 FIELD( %s, timezone ) DESC, 322 population DESC 323 population DESC, 324 BINARY LOWER( %s ) = BINARY LOWER( LEFT( name, %d ) ) DESC 323 325 LIMIT 1"; 324 326 325 $prepared_query = $wpdb->prepare( $query, $wpdb->esc_like( $location_name ) . '%', $country, $timezone );327 $prepared_query = $wpdb->prepare( $query, $wpdb->esc_like( $location_name ) . '%', $country, $timezone, $location_name, mb_strlen( $location_name ) ); 326 328 $db_handle = $wpdb->db_connect( $prepared_query ); 327 329
Note: See TracChangeset
for help on using the changeset viewer.