Show
Ignore:
Timestamp:
03/07/06 01:47:45 (3 years ago)
Author:
ryan
Message:

Security back ports from masquerade and MarkJaquith?.

Files:

Legend:

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

    r2196 r3627  
    5151                $subject = trim($line); 
    5252                $subject = substr($subject, 9, strlen($subject)-9); 
    53                 if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $subject)) { 
    54                   $subject = wp_iso_descrambler($subject); 
    55                 } 
     53                $subject = wp_iso_descrambler($subject); 
    5654                // Captures any text in the subject before $phone_delim as the subject 
    5755                $subject = explode($phone_delim, $subject); 
     
    6462                $author=trim($line); 
    6563            if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) { 
    66                 echo "Author = {$regs[1]} <p>"; 
    67                 $result = $wpdb->get_row("SELECT ID FROM $tableusers WHERE user_email='$regs[1]' ORDER BY ID DESC LIMIT 1"); 
     64                $author = $regs[1]; 
     65                echo "Author = {$author} <p>"; 
     66                $author = $wpdb->escape($author); 
     67                $result = $wpdb->get_row("SELECT ID FROM $wpdb->users WHERE user_email='$author' LIMIT 1"); 
    6868                if (!$result) 
    6969                    $post_author = 1; 
     
    8282                $date_arr = explode(' ', $ddate); 
    8383                $date_time = explode(':', $date_arr[3]); 
    84                  
     84 
    8585                $ddate_H = $date_time[0]; 
    8686                $ddate_i = $date_time[1]; 
    8787                $ddate_s = $date_time[2]; 
    88                  
     88 
    8989                $ddate_m = $date_arr[1]; 
    9090                $ddate_d = $date_arr[0]; 
     
    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);