Issue 1502 a bug of uploaded Image from BlogAPI (MetaWebLog)

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10167 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2012-02-22 04:43:19 +00:00
parent af5d1da6cb
commit b140b6a2a8
2 changed files with 10 additions and 7 deletions

View file

@ -234,13 +234,15 @@ if($called_position == 'before_module_proc') {
for($i=0;$i<$file_count;$i++) {
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count = $file_count;
}
}
$obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content);
$oDocumentController = &getController('document');
$obj->commentStatus = 'ALLOW';
@ -329,14 +331,15 @@ if($called_position == 'before_module_proc') {
$moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']);
if(file_exists($moved_filename)) continue;
$oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count += $file_count;
}
}
$obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content);
$oDocumentController = &getController('document');
$output = $oDocumentController->updateDocument($oDocument,$obj);

View file

@ -63,8 +63,8 @@
API網址是 http://安裝位置/模組名稱/api。
將狀態設置成"啟用"時,才可使用 RSD 和 API
</description>
<version>0.1</version>
<date>2007-02-28</date>
<version>1.0</version>
<date>2012-02-22</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NHN</name>