public function action_ajaxUploadDelete() { if ($this->check(['isAllowed', 'isModifyingAllowed', 'isDeletionAllowed'], ['getEditData'], ['primary'], ['directoryIndex', 'file']) === true) { $data = $this->model->getEditData($this->params['primary']); if (!empty($data) && !empty($data['uploadsDirs']) && !empty($data['uploadsDirs'][$this->query['directoryIndex']]) && !in_array(mb_eregi_replace('\\s', '', $this->query['file']), Admin::getProtectedUploadFilenames())) { $data = $data['uploadsDirs'][$this->query['directoryIndex']]; $file = Admin::getFullUploadsPath() . $data['directory'] . $this->query['file']; if (file_exists($file)) { ImagePreview::removePreviews($file); unlink($file); } } } die; }