diff --git a/src/apis/StorageController.php b/src/apis/StorageController.php index b3b774aaa..c4f43bec1 100644 --- a/src/apis/StorageController.php +++ b/src/apis/StorageController.php @@ -378,11 +378,9 @@ public function actionDataFilters() public function actionFileReplace() { $fileId = Yii::$app->request->post('fileId', false); - $pageId = Yii::$app->request->post('pageId', 0); - Yii::warning('replace request for file id' . $fileId, __METHOD__); - $raw = $_FILES['file']; + $raw = $_FILES['file'] ?? false; /** @var $file \luya\admin\file\Item */ - if ($file = Yii::$app->storage->getFile($fileId)) { + if ($raw && $file = Yii::$app->storage->getFile($fileId)) { $newFileSource = $raw['tmp_name']; if (is_uploaded_file($newFileSource)) { // check for same extension / mimeType