[Fix]. 草稿文章时间戳为负

WordPress 草稿文章 GMT 时间为 “0000-00-00 00:00:00”  strtotime 转化后为负数。文章插入报错。
This commit is contained in:
Feng 2021-11-01 15:41:43 +08:00 committed by GitHub
parent 64b9381315
commit b398363a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,7 @@ class WordpressToTypecho_Action extends Typecho_Widget implements Widget_Interfa
'cid' => $row['ID'],
'title' => $row['post_title'],
'slug' => Typecho_Common::slugName(urldecode($row['post_name']), $row['ID'], 128),
'created' => strtotime($row['post_date_gmt']) + $gmtOffset,
'created' => strtotime($row['post_date_gmt']) + $gmtOffset > 0 ? strtotime($row['post_date_gmt']) + $gmtOffset : 0,
'modified' => strtotime($row['post_modified_gmt']) + $gmtOffset,
'text' => $row['post_content'],
'order' => $row['menu_order'],