From 8e98c5fc1912aa4f65073776754d8b91080d7a66 Mon Sep 17 00:00:00 2001 From: tianya Date: Wed, 24 May 2023 20:47:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/api.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/admin/api.php b/src/admin/api.php index 52523c67..f7ce8082 100644 --- a/src/admin/api.php +++ b/src/admin/api.php @@ -13,6 +13,7 @@ define('IS_DEDEAPI', TRUE); define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__))); require_once(DEDEADMIN.'/../system/common.inc.php'); require_once(DEDEINC.'/userlogin.class.php'); +@set_time_limit(0); 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 : ''; @@ -245,17 +246,21 @@ if ($action === 'is_need_check_code') { RmRecurse($backupVerPath); mkdir($backupVerPath); foreach ($fileList as $f) { + $realFile = $backupVerPath.$f->filename; if (!preg_match("/^\//", $f->filename)) { //忽略src之外的目录 continue; } + if (file_exists($realFile)) { + continue; + } $fileUrl = DEDEBIZCDN.'/update/'.$ver->ver.'/src'.$f->filename; $dhd = new DedeHttpDown(); $dhd->OpenUrl($fileUrl); $fData = $dhd->GetHtml(); $dhd->Close(); $f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); - $realFile = $backupVerPath.$f->filename; + @mkdir(dirname($realFile), 0777, true); file_put_contents($realFile, $fData); }