diff --git a/app/Controllers/Scripts.php b/app/Controllers/Scripts.php index 4a74c15fe..c05933ec1 100644 --- a/app/Controllers/Scripts.php +++ b/app/Controllers/Scripts.php @@ -32,13 +32,15 @@ class Scripts extends BaseController { public function download($id) { - $id = intval($id); if (empty($this->scriptsModel)) { $this->scriptsModel = model('App\Models\ScriptsModel'); } if (!is_numeric($id)) { $id = $this->scriptsModel->getByOs($id); } + if (is_numeric($id)) { + $id = intval($id); + } if (empty($id)) { return; } diff --git a/app/Models/ScriptsModel.php b/app/Models/ScriptsModel.php index da24073b1..1ebb60296 100644 --- a/app/Models/ScriptsModel.php +++ b/app/Models/ScriptsModel.php @@ -358,7 +358,12 @@ public function download(int $id = 0): ?string if (!empty($instance->config->default_network_address)) { $options->url = $instance->config->default_network_address . 'index.php/input/devices'; } else { - unset($options->url); + $baseURL = base_url(); + if (!empty($baseURL)) { + $options->url = $baseURL . 'index.php/input/devices'; + } else { + unset($options->url); + } } } $find = 'Configuration from web UI here'; diff --git a/app/Views/logon.php b/app/Views/logon.php index 88dcf72f8..a339f3f22 100644 --- a/app/Views/logon.php +++ b/app/Views/logon.php @@ -133,7 +133,6 @@