Make WordPress Core

Changeset 6216


Ignore:
Timestamp:
10/09/2007 11:16:35 PM (17 years ago)
Author:
markjaquith
Message:

Revert partial prepare() implementation. Needs to be all or nothing. Props xknown. fixes #5145

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r6204 r6216  
    711711        // expected_slashed (everything!)
    712712        $wpdb->query(
    713             $wpdb->prepare(
    714713            "UPDATE IGNORE $wpdb->posts SET
    715714            post_author = '$post_author',
     
    730729            post_modified = '".current_time('mysql')."',
    731730            post_modified_gmt = '".current_time('mysql',1)."',
    732             post_parent = %d,
     731            post_parent = '$post_parent',
    733732            menu_order = '$menu_order'
    734             WHERE ID = %d"
    735             , $post_parent, $post_ID ));
     733            WHERE ID = $post_ID");
    736734    } else {
    737735        // expected_slashed (everything!)
    738736        $wpdb->query(
    739             $wpdb->prepare(
    740737            "INSERT IGNORE INTO $wpdb->posts
    741738            (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt,  post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type)
    742739            VALUES
    743             ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', %d, '$menu_order', '$post_mime_type')", $post_parent));
     740            ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type')");
    744741            $post_ID = (int) $wpdb->insert_id;
    745742    }
     
    13751372        // expected_slashed (everything!)
    13761373        $wpdb->query(
    1377             $wpdb->prepare(
    13781374            "UPDATE $wpdb->posts SET
    13791375            post_author = '$post_author',
     
    13941390            post_modified = '".current_time('mysql')."',
    13951391            post_modified_gmt = '".current_time('mysql',1)."',
    1396             post_parent = %d,
     1392            post_parent = '$post_parent',
    13971393            menu_order = '$menu_order',
    13981394            post_mime_type = '$post_mime_type',
    13991395            guid = '$guid'
    1400             WHERE ID = %d", $post_parent, $post_ID));
     1396            WHERE ID = $post_ID");
    14011397    } else {
    14021398        // expected_slashed (everything!)
    14031399        $wpdb->query(
    1404             $wpdb->prepare(
    14051400            "INSERT INTO $wpdb->posts
    14061401            (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt,  post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid)
    14071402            VALUES
    1408             ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', %d, '$menu_order', '$post_mime_type', '$guid')", $post_parent ));
     1403            ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')");
    14091404            $post_ID = (int) $wpdb->insert_id;
    14101405    }
Note: See TracChangeset for help on using the changeset viewer.