소스 검색

handle case where fileid is not set

tags/v6.0.0beta2
Thomas Müller 10 년 전
부모
커밋
b02a485712
2개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 4
    1
      lib/private/connector/sabre/filesplugin.php
  2. 8
    3
      lib/private/connector/sabre/node.php

+ 4
- 1
lib/private/connector/sabre/filesplugin.php 파일 보기

@@ -59,7 +59,10 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin
unset($requestedProperties[array_search($fileid_propertyname, $requestedProperties)]);

/** @var $node OC_Connector_Sabre_Node */
$returnedProperties[200][$fileid_propertyname] = $node->getFileId();
$fileId = $node->getFileId();
if (!is_null($fileId)) {
$returnedProperties[200][$fileid_propertyname] = $fileId;
}

}


+ 8
- 3
lib/private/connector/sabre/node.php 파일 보기

@@ -272,8 +272,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
public function getFileId()
{
$this->getFileinfoCache();
$instanceId = OC_Util::getInstanceId();
$id = sprintf('%08d', $this->fileinfo_cache['fileid']);
return $instanceId . $id;

if (isset($this->fileinfo_cache['fileid'])) {
$instanceId = OC_Util::getInstanceId();
$id = sprintf('%08d', $this->fileinfo_cache['fileid']);
return $instanceId . $id;
}

return null;
}
}

Loading…
취소
저장