diff --git a/var/Widget/Backup.php b/var/Widget/Backup.php index b7179537..33dc1c21 100644 --- a/var/Widget/Backup.php +++ b/var/Widget/Backup.php @@ -189,7 +189,12 @@ class Backup extends BaseOptions implements ActionInterface if (!empty($_FILES)) { $file = array_pop($_FILES); - if (0 == $file['error'] && is_uploaded_file($file['tmp_name'])) { + if(UPLOAD_ERR_NO_FILE == $file['error']) { + Notice::alloc()->set(_t('没有选择任何备份文件'), 'error'); + $this->response->goBack(); + } + + if (UPLOAD_ERR_OK == $file['error'] && is_uploaded_file($file['tmp_name'])) { $path = $file['tmp_name']; } else { Notice::alloc()->set(_t('备份文件上传失败'), 'error'); @@ -270,7 +275,7 @@ class Backup extends BaseOptions implements ActionInterface } // 针对PGSQL重置计数 - if (false !== strpos($this->db->getVersion(), 'pgsql')) { + if (false !== strpos(strtolower($this->db->getAdapterName()), 'pgsql')) { foreach ($this->lastIds as $table => $id) { $seq = $this->db->getPrefix() . $table . '_seq'; $this->db->query('ALTER SEQUENCE ' . $seq . ' RESTART WITH ' . ($id + 1));