From f8b657f674a28fb89ef50aec95aa52ba77e6c6aa Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 30 Jun 2023 09:59:57 -0600 Subject: [PATCH] Fix the device.file.download file name --- app/devices/device_edit.php | 2 +- app/provision/index.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index dd23b7f2db..d71af4b816 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -720,7 +720,7 @@ if ($_SERVER['HTTPS'] == 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } if ($_SERVER['SERVER_PORT'] == '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } } - echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$domain_name.PROJECT_PATH."/app/provision/index.php?mac=".escape($device_address ?? '')."&file=' + d + '&content_type=application/octet-stream';\n"; + echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$domain_name.PROJECT_PATH."/app/provision/index.php?address=".escape($device_address ?? '')."&file=' + d + '&content_type=application/octet-stream';\n"; echo " }\n"; echo "\n"; diff --git a/app/provision/index.php b/app/provision/index.php index 1bab4c09b2..abeab28b9c 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -445,7 +445,8 @@ $device_address_formatted = $prov->format_address($device_address, $device_vendor); //replace the variable name with the value - $file_name = str_replace("{\$device_address}", $device_address_formatted, $file); + $file_name = str_replace("{\$address}", $device_address_formatted, $file); + $file_name = str_replace("{\$mac}", $device_address_formatted, $file); //set the headers header('Content-Description: File Transfer');