Ticket #878: 878.diff
| File 878.diff, 1.8 KB (added by , 19 years ago) |
|---|
-
wp-admin/import/rss.php
40 40 preg_match('|<title>(.*?)</title>|is', $post, $post_title); 41 41 $post_title = $wpdb->escape(trim($post_title[1])); 42 42 43 preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date );43 preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date_gmt); 44 44 45 if ($post_date ) {46 $post_date = strtotime($post_date[1]);45 if ($post_date_gmt) { 46 $post_date_gmt = strtotime($post_date_gmt[1]); 47 47 } else { 48 48 // if we don't already have something from pubDate 49 preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date );50 $post_date = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date[1]);51 $post_date = str_replace('T', ' ', $post_date);52 $post_date = strtotime($post_date);49 preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date_gmt); 50 $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]); 51 $post_date_gmt = str_replace('T', ' ', $post_date_gmt); 52 $post_date_gmt = strtotime($post_date_gmt); 53 53 } 54 54 55 $post_date = gmdate('Y-m-d H:i:s', $post_date); 55 $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt); 56 $post_date = get_date_from_gmt( $post_date_gmt ); 56 57 57 58 preg_match_all('|<category>(.*?)</category>|is', $post, $categories); 58 59 $categories = $categories[1]; … … 90 91 91 92 $post_author = 1; 92 93 $post_status = 'publish'; 93 $this->posts[$index] = compact('post_author', 'post_date', 'post_ content', 'post_title', 'post_status', 'guid', 'categories');94 $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); 94 95 $index++; 95 96 } 96 97 }