fileType in setHistoryData for php

This commit is contained in:
Andrey Yumatov
2021-12-08 17:24:30 +03:00
parent a7db14811f
commit 6559c76fbd

View File

@ -245,8 +245,10 @@
];
}
$fileExe = strtolower('.' . pathinfo($filename, PATHINFO_EXTENSION));
$prevFileName = $verDir . DIRECTORY_SEPARATOR . "prev." . $filetype;
$prevFileName = substr($prevFileName, strlen(getStoragePath("")));
$dataObj["fileType"] = str_replace(".","",$fileExe);
$dataObj["key"] = $key;
$dataObj["url"] = $i == $curVer ? $fileuri : getVirtualPath(true) . str_replace("%5C", "/", rawurlencode($prevFileName)); // write file url to the data object
$dataObj["version"] = $i;
@ -262,6 +264,7 @@
$prev = $histData[$i - 2]; // get the history data from the previous file version
$dataObj["previous"] = [ // write information about previous file version to the data object
"fileType" => $prev["fileType"],
"key" => $prev["key"],
"url" => $prev["url"]
];