Ticket #13580: 13580.2.diff
| File 13580.2.diff, 940 bytes (added by ryan, 2 years ago) |
|---|
-
wp-admin/admin-ajax.php
83 83 die('0'); 84 84 } 85 85 86 $s = $_GET['q']; // is this slashed already?86 $s = stripslashes( $_GET['q'] ); 87 87 88 88 if ( false !== strpos( $s, ',' ) ) { 89 89 $s = explode( ',', $s ); … … 93 93 if ( strlen( $s ) < 2 ) 94 94 die; // require 2 chars for matching 95 95 96 $results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.name LIKE ('%" . $s . "%')");96 $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . like_escape( $s ) . '%' ) ); 97 97 98 98 echo join( $results, "\n" ); 99 99 die;
