From 8c3a3caa1ed4a605085d04966750893e8aef6157 Mon Sep 17 00:00:00 2001 From: zyx0814 Date: Mon, 22 Jul 2024 12:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD=E5=90=8E?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80=E4=B8=A2=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dzz/banner/download.php | 4 ++++ dzz/pichome/download.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/dzz/banner/download.php b/dzz/banner/download.php index 67be42c..4bed73d 100644 --- a/dzz/banner/download.php +++ b/dzz/banner/download.php @@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']); if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){ exit(lang('no_perm')); } +$extension = substr($resourcesdata['name'], strrpos($resourcesdata['name'], '.') + 1); +if($extension != $resourcesdata['ext']){ + $resourcesdata['name'] = $resourcesdata['name'].'.'.$resourcesdata['ext']; +} $resourcesdata['name'] = '"' . (strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'Edge') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($resourcesdata['name']) : ($resourcesdata['name'])) . '"'; $attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid)); if(is_numeric($attach['path'])){ diff --git a/dzz/pichome/download.php b/dzz/pichome/download.php index 7cdb96c..5514e50 100644 --- a/dzz/pichome/download.php +++ b/dzz/pichome/download.php @@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']); if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){ exit(lang('no_perm')); } +$extension = substr($resourcesdata['name'], strrpos($resourcesdata['name'], '.') + 1); +if($extension != $resourcesdata['ext']){ + $resourcesdata['name'] = $resourcesdata['name'].'.'.$resourcesdata['ext']; +} $resourcesdata['name'] = '"' . (strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'Edge') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($resourcesdata['name']) : ($resourcesdata['name'])) . '"'; $attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid)); if(is_numeric($attach['path'])){