From 0a501be75e00570c6403c690167ecf3c28056405 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 28 Aug 2025 14:22:53 +0800 Subject: [PATCH 1/2] * [refac bug #62669] Check import file extension. --- module/transfer/control.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/transfer/control.php b/module/transfer/control.php index bcc2487993..ca391754d5 100755 --- a/module/transfer/control.php +++ b/module/transfer/control.php @@ -102,7 +102,9 @@ class transfer extends control $file = $this->loadModel('file')->getUpload('file'); if(!empty($file['error'])) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->uploadError[$file['error']])); - $file = $file[0]; + $file = $file[0]; + if(!in_array(strtolower($file['extension']), array('xls', 'xlsx'))) return $this->send(array('result' => 'fail', 'message' => $this->lang->excel->canNotRead)); + $shortName = $this->file->getSaveName($file['pathname']); if(empty($shortName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->excel->emptyFileName)); From 12e3f62fd3eb1c060f32ccbabfe7aad83432383c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 28 Aug 2025 14:55:45 +0800 Subject: [PATCH 2/2] * [refac bug #65052] Fix error for php8.1 --- lib/dbh/dbh.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dbh/dbh.class.php b/lib/dbh/dbh.class.php index 1e8556cc88..44c1f95ff4 100644 --- a/lib/dbh/dbh.class.php +++ b/lib/dbh/dbh.class.php @@ -987,8 +987,8 @@ class dbh */ public function checkUserPriv(): string { - global $dbConfig; - if(!in_array($this->dbConfig->driver, $dbConfig->mysqlDriverList)) return ''; + global $config; + if(!in_array($this->dbConfig->driver, $config->mysqlDriverList)) return ''; $dbName = $this->dbConfig->name; $user = $this->dbConfig->user;