Make WordPress Core


Ignore:
Timestamp:
04/14/2008 04:13:25 PM (19 years ago)
Author:
ryan
Message:

Prepare DB queries in more places. Props filosofo. see #6644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/blogger.php

    r7072 r7645  
    642642
    643643                // Get an array of posts => authors
    644                 $post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'");
     644                $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) );
    645645                $post_ids = join( ',', $post_ids );
    646646                $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)");
    … …  
    659659                        $post_ids = join( ',', $post_ids);
    660660
    661                         $wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)");
     661                        $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) );
    662662                        $this->blogs[$importing_blog]['authors'][$author][1] = $user_id;
    663663                }
Note: See TracChangeset for help on using the changeset viewer.