Changeset 4149
- Timestamp:
- 08/31/2006 05:34:56 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/rss.php
r3517 r4149 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); … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.