| | 1371 | // expected_slashed (everything!) |
|---|
| | 1372 | $data = array(); |
|---|
| | 1373 | foreach ( array('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') as $f ) |
|---|
| | 1374 | $data[$f] = stripslashes($$f); |
|---|
| | 1375 | unset($f); |
|---|
| | 1376 | |
|---|
| 1372 | | // expected_slashed (everything!) |
|---|
| 1373 | | $wpdb->query( |
|---|
| 1374 | | "UPDATE $wpdb->posts SET |
|---|
| 1375 | | post_author = '$post_author', |
|---|
| 1376 | | post_date = '$post_date', |
|---|
| 1377 | | post_date_gmt = '$post_date_gmt', |
|---|
| 1378 | | post_content = '$post_content', |
|---|
| 1379 | | post_content_filtered = '$post_content_filtered', |
|---|
| 1380 | | post_title = '$post_title', |
|---|
| 1381 | | post_excerpt = '$post_excerpt', |
|---|
| 1382 | | post_status = '$post_status', |
|---|
| 1383 | | post_type = '$post_type', |
|---|
| 1384 | | comment_status = '$comment_status', |
|---|
| 1385 | | ping_status = '$ping_status', |
|---|
| 1386 | | post_password = '$post_password', |
|---|
| 1387 | | post_name = '$post_name', |
|---|
| 1388 | | to_ping = '$to_ping', |
|---|
| 1389 | | pinged = '$pinged', |
|---|
| 1390 | | post_modified = '".current_time('mysql')."', |
|---|
| 1391 | | post_modified_gmt = '".current_time('mysql',1)."', |
|---|
| 1392 | | post_parent = '$post_parent', |
|---|
| 1393 | | menu_order = '$menu_order', |
|---|
| 1394 | | post_mime_type = '$post_mime_type', |
|---|
| 1395 | | guid = '$guid' |
|---|
| 1396 | | WHERE ID = $post_ID"); |
|---|
| 1397 | | } else { |
|---|
| 1398 | | // expected_slashed (everything!) |
|---|
| 1399 | | $wpdb->query( |
|---|
| 1400 | | "INSERT INTO $wpdb->posts |
|---|
| 1401 | | (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) |
|---|
| 1402 | | VALUES |
|---|
| 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')"); |
|---|
| 1404 | | $post_ID = (int) $wpdb->insert_id; |
|---|
| | 1378 | $wpdb->db_update($wpdb->posts, $data, 'ID', $post_ID); |
|---|
| | 1379 | } else { |
|---|
| | 1380 | $wpdb->db_insert($wpdb->posts, $data); |
|---|
| | 1381 | $post_ID = (int) $wpdb->insert_id; |
|---|