From 3f49337186e2002c1861436a83ea511c43ee3935 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 3 Jan 2019 14:13:49 +0800 Subject: [PATCH] fix --- application/controllers/info_amp.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/controllers/info_amp.php b/application/controllers/info_amp.php index 6bcf9fd6..c1d031df 100644 --- a/application/controllers/info_amp.php +++ b/application/controllers/info_amp.php @@ -364,11 +364,12 @@ class Info_amp extends CI_Controller $file = $_FILES['file']; if (!$file) return; //转移文件 - $path = realpath('../cht-system/views/information/word_source').'/'.basename($file['name']); + $md5_name = md5($file["name"]).strrchr($file["name"],'.'); + $path = realpath('../cht-system/views/information/word_source').'/'.basename($md5_name); if (move_uploaded_file($file['tmp_name'], $path)) { - $msg = "File is valid, and was successfully uploaded: ".$path; + $msg = "file path: ".$path; } else { - $msg = "Possible file upload attack!"; + $msg = "file upload error!"; } if($file) {