WordPress.org

Make WordPress Core

Ticket #2699: 2699.5.diff

File 2699.5.diff, 713 bytes (added by Denis-de-Bernardy, 5 years ago)

fix the sql syntax

  • wp-admin/includes/upgrade.php

     
    16721672        // Delete duplicate options.  Keep the option with the highest option_id. 
    16731673        $delete_options = $wpdb->get_col("SELECT o1.option_id FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 ON o2.option_name = o1.option_name AND o2.option_id > o1.option_id"); 
    16741674        if ( !empty($delete_options) ) { 
    1675                 $delete_options = implode("', '", $delete_options); 
     1675                $delete_options = implode(',', $delete_options); 
    16761676                $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($delete_options)"); 
    16771677        } 
    16781678