From b76abe33b41a2ca4dbacab506164e04da39cf6e7 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 13 Aug 2008 16:01:01 +0000 Subject: [PATCH] Make sure timestamps are not 0000 when publishing. Props techcookies. fixes #6527 git-svn-id: http://svn.automattic.com/wordpress/trunk@8636 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 6976c056ff..3c540f9b0e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1354,14 +1354,14 @@ function wp_insert_post($postarr = array(), $wp_error = false) { } // If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now - if (empty($post_date)) { + if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) { if ( !in_array($post_status, array('draft', 'pending')) ) $post_date = current_time('mysql'); else $post_date = '0000-00-00 00:00:00'; } - if (empty($post_date_gmt)) { + if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { if ( !in_array($post_status, array('draft', 'pending')) ) $post_date_gmt = get_gmt_from_date($post_date); else