diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-08 10:57:32 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-08 10:57:32 +0000 |
| commit | e30516b2ee40c1c45c8f288c20a3d4372e478624 (patch) | |
| tree | bd6b8bcc4c06697f50e6985a6b08620e25bc572e /wp-admin/import/rss.php | |
| parent | e20c9aa016d6885c6e3fc7425525b4090f05ac2a (diff) | |
| download | wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.gz wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.xz wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.zip | |
WP Merge to #4124
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@734 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/import/rss.php')
| -rw-r--r-- | wp-admin/import/rss.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/wp-admin/import/rss.php b/wp-admin/import/rss.php index 69972f3..aabfe4e 100644 --- a/wp-admin/import/rss.php +++ b/wp-admin/import/rss.php @@ -38,21 +38,22 @@ class RSS_Import { $index = 0; foreach ($this->posts as $post) { preg_match('|<title>(.*?)</title>|is', $post, $post_title); - $post_title = $wpdb->escape(trim($post_title[1])); + $post_title = str_replace(array('<![CDATA[', ']]>'), '', $wpdb->escape( trim($post_title[1]) )); - preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date); + preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date_gmt); - if ($post_date) { - $post_date = strtotime($post_date[1]); + if ($post_date_gmt) { + $post_date_gmt = strtotime($post_date_gmt[1]); } else { // if we don't already have something from pubDate - preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date); - $post_date = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date[1]); - $post_date = str_replace('T', ' ', $post_date); - $post_date = strtotime($post_date); + preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date_gmt); + $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]); + $post_date_gmt = str_replace('T', ' ', $post_date_gmt); + $post_date_gmt = strtotime($post_date_gmt); } - $post_date = gmdate('Y-m-d H:i:s', $post_date); + $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt); + $post_date = get_date_from_gmt( $post_date_gmt ); preg_match_all('|<category>(.*?)</category>|is', $post, $categories); $categories = $categories[1]; @@ -90,7 +91,7 @@ class RSS_Import { $post_author = 1; $post_status = 'publish'; - $this->posts[$index] = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); + $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); $index++; } } @@ -167,5 +168,5 @@ class RSS_Import { $rss_import = new RSS_Import(); -register_importer('rss', 'RSS', __('Import posts from an RSS feed'), array ($rss_import, 'dispatch')); +register_importer('rss', __('RSS'), __('Import posts from an RSS feed'), array ($rss_import, 'dispatch')); ?> |
