Show
Ignore:
Timestamp:
10/20/05 21:20:52 (3 years ago)
Author:
ryan
Message:

Give wp-mail a little love.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-mail.php

    r2196 r2960  
    137137 
    138138    $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); 
     139    $post_data = add_magic_quotes($post_data); 
    139140 
    140141    $post_ID = wp_insert_post($post_data); 
     
    151152    echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>'; 
    152153 
    153     if (!$post_categories) $post_categories[] = 1; 
    154     foreach ($post_categories as $post_category) : 
    155         $post_category = intval($post_category); 
    156  
    157         // Double check it's not there already 
    158         $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category"); 
    159  
    160         if (!$exists && $result) {  
    161             $wpdb->query(" 
    162             INSERT INTO $wpdb->post2cat 
    163             (post_id, category_id) 
    164             VALUES 
    165             ($post_ID, $post_category) 
    166             "); 
    167         } 
    168     endforeach; 
    169  
    170154    if(!$pop3->delete($i)) { 
    171155        echo '<p>Oops '.$pop3->ERROR.'</p></div>';