Skip to content
Permalink
Browse files

Merge pull request #882 from kraity/master

修复 XmlRpc 接口的几个错误问题
  • Loading branch information...
joyqi committed Sep 3, 2019
2 parents 147f7ed + 5abd915 commit c17bdaf6066e345bf868c3d8bfde0acff22ce140
Showing with 7 additions and 8 deletions.
  1. +1 −0 tools/Dockerfile
  2. +6 −8 var/Widget/XmlRpc.php
@@ -18,6 +18,7 @@ RUN sed -i 's/archive.ubuntu.com/'$ubuntu_mirror'/g' /etc/apt/sources.list && \

# install mysql
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server && \
mkdir -p /var/run/mysqld && chown mysql:mysql /var/run/mysqld && \
# sed -i -e "s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf && \
sed -i 's/^\(log_error\s.*\)/# \1/' /etc/mysql/my.cnf && \
echo "mysqld_safe &" > /tmp/mysql_config && \
@@ -395,8 +395,7 @@ public function wpGetPages($blogId, $userName, $password)
'dateCreated' => new IXR_Date($this->options->timezone + $pages->created),
'userid' => $pages->authorId,
'page_id' => intval($pages->cid),
/** todo:此处有疑问 */
'page_status' => $this->typechoToWordpressStatus($pages->status, 'page'),
'page_status' => $this->typechoToWordpressStatus(($pages->hasSaved || 'page_draft' == $pages->type) ? 'draft' : $pages->status, 'page'),
'description' => $excerpt,
'title' => $pages->title,
'link' => $pages->permalink,
@@ -485,8 +484,8 @@ public function wpDeletePage($blogId, $userName, $password, $pageId)
*/
public function wpEditPage($blogId, $pageId, $userName, $password, $content, $publish)
{
$content['type'] = 'page';
$this->mwEditPost($blogId, $pageId, $userName, $password, $content, $publish);
$content['post_type'] = 'page';
$this->mwEditPost($pageId, $userName, $password, $content, $publish);
}
@@ -1053,8 +1052,7 @@ public function wpGetComments($blogId, $userName, $password, $struct)
$input = array();
if (!empty($struct['status'])) {
$input['status'] = 'hold' == $input['status'] ? $input['status'] :
$this->wordpressToTypechoStatus($struct['status']);
$input['status'] = $this->wordpressToTypechoStatus($struct['status'], 'comment');
} else {
$input['__typecho_all_comments'] = 'on';
}
@@ -1440,7 +1438,7 @@ public function mwNewPost($blogId, $userName, $password, $content, $publish)
/** 调整状态 */
if (isset($content["{$type}_status"])) {
$status = $this->wordpressToTypechoStatus($content["{$type}_status"], $type);
$input['visibility'] = isset($content["visibility"]) ? $content["visibility"] : $status;
if ('publish' == $status || 'waiting' == $status || 'private' == $status) {
$input['do'] = 'publish';
@@ -1605,7 +1603,7 @@ public function mwGetRecentPosts($blogId, $userName, $password, $postsNum)
'wp_author_id' => $posts->authorId,
'wp_author_display_name' => $posts->author->screenName,
'date_created_gmt' => new IXR_Date($posts->created),
'post_status' => $this->typechoToWordpressStatus($posts->status, 'post'),
'post_status' => $this->typechoToWordpressStatus(($posts->hasSaved || 'post_draft' == $posts->type) ? 'draft' : $posts->status, 'post'),
'custom_fields' => array(),
'wp_post_format' => 'standard',
'date_modified' => new IXR_Date($this->options->timezone + $posts->modified),

1 comment on commit c17bdaf

@vitoland

This comment has been minimized.

Copy link

commented on c17bdaf Sep 18, 2019

竟然还在开发吗?还以为放弃了。

Please sign in to comment.
You can’t perform that action at this time.