fix snap file location

This commit is contained in:
ghost 2023-07-30 14:46:07 +03:00
parent 3c4a89d16d
commit 1972b3411c

View File

@ -52,6 +52,9 @@ switch ($type) {
// Get snap details from DB
if ($hostPageSnap = $db->getHostPageSnap(!empty($_GET['hps']) ? (int) $_GET['hps'] : 0)) {
// Get file
$snapFile = 'hp/' . chunk_split($hostPageSnap->hostPageId, 1, '/') . $hostPageSnap->timeAdded . '.zip';
// Get snap file
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
@ -66,9 +69,6 @@ switch ($type) {
case 'localhost':
// Get file
$snapFile = 'hp/' . chunk_split($hostPageSnap->hostPageId, 1, '/') . $hostPageSnap->timeAdded . '.zip';
// Download local snap in higher priority if possible
if (file_exists($storage->directory . $snapFile) &&
is_readable($storage->directory . $snapFile)) {