diff --git a/classes/controller.php b/classes/controller.php index a1b3e4c8..518198c1 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -1652,6 +1652,15 @@ class AdminController $upload = $this->normalizeFiles($_FILES['data'], $settings->name); + if (!isset($settings->destination)) { + $this->admin->json_response = [ + 'status' => 'error', + 'message' => $this->admin->translate('PLUGIN_ADMIN.DESTINATION_NOT_SPECIFIED', null, true) + ]; + + return false; + } + // Do not use self@ outside of pages if ($this->view != 'pages' && in_array($settings->destination, ['@self', 'self@'])) { $this->admin->json_response = [ diff --git a/languages/en.yaml b/languages/en.yaml index 794d1166..004cf437 100644 --- a/languages/en.yaml +++ b/languages/en.yaml @@ -612,4 +612,5 @@ PLUGIN_ADMIN: DROPZONE_RESPONSE_ERROR: "Server responded with {{statusCode}} code." ADMIN_CACHING: "Enable Admin Caching" ADMIN_CACHING_HELP: "Caching in the admin can be controlled independently from the front-end site" + DESTINATION_NOT_SPECIFIED: "Destination not specified" UPLOAD_ERR_NO_TMP_DIR: "Missing a temporary folder"