Make WordPress Core

Ticket #5580: admin-ajax.php.diff

File admin-ajax.php.diff, 650 bytes (added by paddya, 17 years ago)
  • admin-ajax.php

     
    1313
    1414        $s = $_GET['q']; // is this slashed already?
    1515
    16         if ( strstr( $s, ',' ) )
    17                 die; // it's a multiple tag insert, we won't find anything
    18         $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" );
     16        if ( strstr( $s, ',' ) ) {
     17    $s = explode( ',', $s );
     18    $s = $s[count( $s ) - 1];
     19  }
     20        $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". trim($s) . "%')" );
    1921        echo join( $results, "\n" );
    2022        die;
    2123}