Merge pull request #955 from atomlong/master

Support Windows Live Writer and Open Live Writer.
This commit is contained in:
joyqi 2020-05-14 11:23:20 +08:00 committed by GitHub
commit 77ef00e1a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -126,6 +126,12 @@ class Widget_Upload extends Widget_Abstract_Contents implements Widget_Interface
if (!file_put_contents($path, $file['bytes'])) {
return false;
}
} else if (isset($file['bits'])) {
//直接写入文件
if (!file_put_contents($path, $file['bits'])) {
return false;
}
} else {
return false;
}
@ -197,6 +203,14 @@ class Widget_Upload extends Widget_Abstract_Contents implements Widget_Interface
if (!file_put_contents($path, $file['bytes'])) {
return false;
}
} else if (isset($file['bits'])) {
@unlink($path);
//直接写入文件
if (!file_put_contents($path, $file['bits'])) {
return false;
}
} else {
return false;
}

View File

@ -1669,7 +1669,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
$result = Widget_Upload::uploadHandle($data);
if (false === $result) {
return IXR_Error(500, _t('上传失败'));
return new IXR_Error(500, _t('上传失败'));
} else {
$insertId = $this->insert(array(
@ -2169,7 +2169,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
return new IXR_Error(48, _t('PingBack已经存在'));
}
} else {
return IXR_Error(49, _t('目标地址禁止Ping'));
return new IXR_Error(49, _t('目标地址禁止Ping'));
}
} else {
return new IXR_Error(33, _t('这个目标地址不存在'));