Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add hash prefix
Signed-off-by: Tomasz Grobelny <[email protected]>
  • Loading branch information
tomasz-grobelny committed Jan 12, 2019
commit e3a39dd0488e9db26d50fab7fd704c12101d2aa4
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function put($data) {
} else {
$checksum = hash_final($contextObject->hashContext);
}
$this->fileView->putFileInfo($this->path, ['checksum' => $checksum]);
$this->fileView->putFileInfo($this->path, ['checksum' => 'md5:' . $checksum]);
$this->refreshInfo();

} catch (StorageNotAvailableException $e) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData =
$cacheData = $this->cache->get($file);
}
if (($reuseExisting & self::RECALCULATE_CHECKSUM_IF_EMPTY) && empty($cacheData['checksum'])) {
$data['checksum'] = $this->storage->hash('md5', $file);
$data['checksum'] = 'md5:' . $this->storage->hash('md5', $file);
}
if ($cacheData and $reuseExisting and isset($cacheData['fileid'])) {
// prevent empty etag
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public function file_put_contents($path, $data) {
list (, $result) = \OC_Helper::streamCopy($data, $target);
fclose($target);
fclose($data);
$this->putFileInfo($path, ['checksum' => hash_final($contextObject->hashContext)]);
$this->putFileInfo($path, ['checksum' => 'md5:' . hash_final($contextObject->hashContext)]);

$this->writeUpdate($storage, $internalPath);

Expand Down Expand Up @@ -1560,7 +1560,7 @@ public function putFileInfo($path, $data) {
list($storage, $internalPath) = Filesystem::resolvePath($path);
if ($storage) {
if ($data['checksum'] == '') {
$data['checksum'] = $storage->hash('md5', $internalPath);
$data['checksum'] = 'md5' . $storage->hash('md5', $internalPath);
}
$cache = $storage->getCache($path);

Expand Down