From c438e4205328e1394fcf919a460031f1cfcf9f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?= <93301500+xushubieli@users.noreply.github.com> Date: Thu, 25 May 2023 09:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/api.php | 17 ++++++++--------- src/system/archive/listview.class.php | 2 +- src/system/archive/sglistview.class.php | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/admin/api.php b/src/admin/api.php index f7ce8082..3c23efcf 100644 --- a/src/admin/api.php +++ b/src/admin/api.php @@ -17,7 +17,7 @@ require_once(DEDEINC.'/userlogin.class.php'); AjaxHead(); helper('cache'); $action = isset($action) && in_array($action, array('is_need_check_code', 'has_new_version', 'get_changed_files', 'update_backup', 'get_update_versions', 'update', 'upload_image')) ? $action : ''; -$curDir = dirname(GetCurUrl()); //当前目录 +$curDir = dirname(GetCurUrl());//当前目录 /** * 登录鉴权 * @@ -47,7 +47,7 @@ if ($action === 'is_need_check_code') { )); exit; } else if ($action === 'has_new_version') { - //判断版本更新差异sql + //判断版本sql之间差异 $unQueryVer = array(); if (!TableHasField("#@__tagindex", "keywords")) { $unQueryVer[] = "6.0.2"; @@ -98,7 +98,7 @@ if ($action === 'is_need_check_code') { } require_once(DEDEINC.'/libraries/dedehttpdown.class.php'); checkLogin(); - //是否存在更新版本 + //发现有新版本 $phpv = phpversion(); $sp_os = PHP_OS; $mysql_ver = $dsql->GetVersion(); @@ -187,8 +187,8 @@ if ($action === 'is_need_check_code') { mkdir($backupPath); foreach ($data as $file) { $realFile = DEDEROOT.str_replace("\\", '/', $file->filename); + //备份文件 if (file_exists($realFile) && md5_file($realFile) !== $file->hash) { - //备份文件 $dstFile = $backupPath.'/'.str_replace("\\", '/', $file->filename); @mkdir(dirname($dstFile), 0777, true); copy($realFile, $dstFile); @@ -247,8 +247,8 @@ if ($action === 'is_need_check_code') { mkdir($backupVerPath); foreach ($fileList as $f) { $realFile = $backupVerPath.$f->filename; + //忽略src之外的目录 if (!preg_match("/^\//", $f->filename)) { - //忽略src之外的目录 continue; } if (file_exists($realFile)) { @@ -260,7 +260,6 @@ if ($action === 'is_need_check_code') { $fData = $dhd->GetHtml(); $dhd->Close(); $f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); - @mkdir(dirname($realFile), 0777, true); file_put_contents($realFile, $fData); } @@ -288,7 +287,7 @@ if ($action === 'is_need_check_code') { foreach ($row as $k => $ver) { if ($ver->ispatched !== true) { $backupVerPath = $backupPath.'/'.$ver->ver; - //执行更新SQL文件 + //执行更新sql文件 $sql = file_get_contents($backupVerPath.'/update.sql'); if (!empty($sql)) { $sql = preg_replace('#ENGINE=MyISAM#i', 'TYPE=MyISAM', $sql); @@ -306,8 +305,8 @@ if ($action === 'is_need_check_code') { //复制文件 $fileList = json_decode(file_get_contents($backupVerPath.'/files.txt')); foreach ($fileList as $f) { + //忽略src之外的目录 if (!preg_match("/^\//", $f->filename)) { - //忽略src之外的目录 continue; } $f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); @@ -340,7 +339,7 @@ if ($action === 'is_need_check_code') { ), )); exit; -} else if($action === 'upload_image'){ +} else if($action === 'upload_image') { checkLogin(); $imgfile_name = $_FILES["file"]['name']; $activepath = $cfg_image_dir; diff --git a/src/system/archive/listview.class.php b/src/system/archive/listview.class.php index 9d825757..a4e47952 100755 --- a/src/system/archive/listview.class.php +++ b/src/system/archive/listview.class.php @@ -289,7 +289,7 @@ class ListView } //创建封面模板文件 if ($this->TypeLink->TypeInfos['isdefault'] == -1) { - echo DedeAlert('这个是动态栏目', ALERT_WARNING); + echo DedeAlert('该栏目采用动态浏览', ALERT_WARNING); return '../apps/list.php?tid='.$this->TypeLink->TypeInfos['id']; } //单独页面 diff --git a/src/system/archive/sglistview.class.php b/src/system/archive/sglistview.class.php index ed8376b2..219b5897 100755 --- a/src/system/archive/sglistview.class.php +++ b/src/system/archive/sglistview.class.php @@ -247,7 +247,7 @@ class SgListView } //创建封面模板文件 if ($this->TypeLink->TypeInfos['isdefault'] == -1) { - echo DedeAlert('这个是动态栏目', ALERT_WARNING); + echo DedeAlert('该栏目采用动态浏览', ALERT_WARNING); return ''; } //单独页面