Skip to content

Commit 7bc7505

Browse files
committed
修复onlyoffice保存文件失败的bug
1 parent 48291fa commit 7bc7505

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

UPDATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
2. github地址:https://github.com/zyx0814/dzzoffice
77
3. 码云地址: https://gitee.com/zyx0814/dzzoffice
88

9-
### DzzOffice2.01主要更新内容
9+
### DzzOffice2.02主要更新内容
1010

1111
1. 缓存优化,开启内存huanc(如:memcached等)会显著提高效率;
1212

core/class/io/io_dzz.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ public function setFileContent($rid, $fileContent, $force = false, $nocover = tr
484484
'ext' => $attach['filetype'],
485485
'dateline' => TIMESTAMP
486486
);
487-
$return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr);
487+
$return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr,$force);
488488
if($return['error']){
489489
return array('error'=>$return['error']);
490490
}

core/class/table/table_resources.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ public function fetch_by_rid($rid, $force_from_db = false)
410410
$data['url'] = DZZSCRIPT . '?mod=document&icoid=' . dzzencode('attach::' . $data['aid']);
411411
$data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']);
412412
} elseif ($data['type'] == 'folder') {
413-
$contaions = self::get_contains_by_fid($data['oid'], true);
414-
$data['contaions'] = $contaions;
413+
//$contaions = self::get_contains_by_fid($data['oid'], true);
414+
//$data['contaions'] = $contaions;
415415
$relativepath = str_replace(':', '', strrchr($data['path'], ':'));
416416
$data['position'] = substr($relativepath, 0, strlen($relativepath) - 1);
417417
$data['fsize'] = formatsize($contaions['size']);
418-
$data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size']));
419-
$data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1]));
418+
// $data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size']));
419+
// $data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1]));
420420
$data['img'] = './dzz/images/extimg/folder.png';
421421
} else {
422422
$data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']);

core/class/table/table_resources_version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ public function delete_by_rid($rid){
125125
$this->clear_cache($cachekey);
126126
}
127127
//上传新版本
128-
public function add_new_version_by_rid($rid,$setarr){
128+
public function add_new_version_by_rid($rid,$setarr,$force=false){
129129
global $_G,$documentexts;
130130
$cachekey = 'resourcesversiondata_'.$rid;
131131
if(!$resources = C::t('resources')->fetch_info_by_rid($rid)){
132132
return array('error'=>lang('file_not_exist'));
133133
}
134134
//检测权限
135-
if (!perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) {
135+
if (!$force && !perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) {
136136
return array('error'=>lang('no_privilege'));
137137
}
138138
//文件类型获取

0 commit comments

Comments
 (0)