From 9b797031542facd993809aede4c3c078f1a28b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Thu, 24 Dec 2020 21:50:32 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=8F=98=E9=87=8F=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=96=B0=E5=A2=9EYouTube=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=9C=B0=E5=9D=80=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/function/media/media_tudou.php | 2 +- upload/source/function/media/media_youtube.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/upload/source/function/media/media_tudou.php b/upload/source/function/media/media_tudou.php index f1bec7062..dde9d2747 100644 --- a/upload/source/function/media/media_tudou.php +++ b/upload/source/function/media/media_tudou.php @@ -11,7 +11,7 @@ function media_tudou($url, $width, $height) { $flv = 'http://www.tudou.com/v/'.$matches[2]; $iframe = 'http://www.tudou.com/programs/view/html5embed.action?code='.$matches[2]; if(!$width && !$height) { - $str = file_get_contents($url, false, $ctx); + $str = file_get_contents($url, false); if(!empty($str) && preg_match("/(.+?)<\/span>/i", $str, $image)) { $imgurl = trim($image[1]); } diff --git a/upload/source/function/media/media_youtube.php b/upload/source/function/media/media_youtube.php index fb7464054..b516a5cf4 100644 --- a/upload/source/function/media/media_youtube.php +++ b/upload/source/function/media/media_youtube.php @@ -4,14 +4,14 @@ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } -$checkurl = array('www.youtube.com/watch?'); +$checkurl = array('youtube.com/watch?'); function media_youtube($url, $width, $height) { - if(preg_match("/^https?:\/\/www.youtube.com\/watch\?v=([^\/&]+)&?/i", $url, $matches)) { - $flv = 'https://www.youtube.com/v/'.$matches[1].'&hl=zh_CN&fs=1'; - $iframe = 'https://www.youtube.com/embed/'.$matches[1]; + if(preg_match("/^https?:\/\/(|m.|www.)youtube.com\/watch\?v=([^\/&]+)&?/i", $url, $matches)) { + $flv = 'https://www.youtube.com/v/'.$matches[2].'&fs=1'; + $iframe = 'https://www.youtube.com/embed/'.$matches[2]; if(!$width && !$height) { - $str = file_get_contents($url, false, $ctx); + $str = file_get_contents($url, false); if(!empty($str) && preg_match("/'VIDEO_HQ_THUMB':\s'(.+?)'/i", $str, $image)) { $url = substr($image[1], 0, strrpos($image[1], '/')+1); $filename = substr($image[1], strrpos($image[1], '/')+3); -- Gitee From 5acc5b02acb05e3f6aa8d4b079a23f62c6f38598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Thu, 24 Dec 2020 22:54:00 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=BC=80=E5=90=AFre?= =?UTF-8?q?dis=E7=BC=93=E5=AD=98+=E4=B8=BB=E9=A2=98=E5=88=86=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=AD=98=E6=A1=A3=E8=A1=A8=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AD=98=E6=A1=A3=E5=B8=96=E5=AD=90=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/class/table/table_forum_thread.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/source/class/table/table_forum_thread.php b/upload/source/class/table/table_forum_thread.php index 797deeee0..2736fec2b 100644 --- a/upload/source/class/table/table_forum_thread.php +++ b/upload/source/class/table/table_forum_thread.php @@ -506,7 +506,7 @@ class table_forum_thread extends discuz_table } } } - if($firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null && ($data = $this->fetch_cache($tlkey, 'forumdisplay_')) !== false) { + if(!$tableid && $firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null && ($data = $this->fetch_cache($tlkey, 'forumdisplay_')) !== false) { $delusers = $this->fetch_cache('deleteuids', ''); if(!empty($delusers)) { foreach($data as $tid => $value) { @@ -521,7 +521,7 @@ class table_forum_thread extends discuz_table } } $data = DB::fetch_all("SELECT * FROM ".DB::table($this->get_table_name($tableid))." $forceindex".$this->search_condition($conditions)." $ordersql ".DB::limit($start, $limit)); - if(!defined('IN_MOBILE') && $firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null) { + if(!defined('IN_MOBILE') && !$tableid && $firstpage && !empty($tlkey) && ($ttl = getglobal('setting/memory/forum_thread_forumdisplay')) !== null) { $this->store_cache($tlkey, $data, $ttl, 'forumdisplay_'); } return $data; -- Gitee From 88fea4bb3620728481601b11ed29c942e6714f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Fri, 25 Dec 2020 16:35:25 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=A1=B5Debug=E4=BF=A1=E6=81=AF=E5=9C=A8=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E5=90=AFDebug=E6=97=B6=E5=B1=95=E7=A4=BA=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/module/forum/forum_index.php | 8 ++++++-- upload/source/module/forum/forum_viewthread.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/upload/source/module/forum/forum_index.php b/upload/source/module/forum/forum_index.php index e9fe2b507..7e7273ef3 100644 --- a/upload/source/module/forum/forum_index.php +++ b/upload/source/module/forum/forum_index.php @@ -476,8 +476,12 @@ function get_index_page_guest_cache() { }); readfile($indexcache['filename']); $updatetime = dgmdate($filemtime, 'Y-m-d H:i:s'); - $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; - echo ''; + $debuginfo = ", Updated at $updatetime"; + if(getglobal('setting/debug')) { + $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; + $debuginfo .= ', Processed in '.sprintf("%0.6f", microtime(TRUE) - $start_time).' second(s)'.$gzip; + } + echo ''; ob_end_flush(); exit(); } diff --git a/upload/source/module/forum/forum_viewthread.php b/upload/source/module/forum/forum_viewthread.php index 588b604ca..ac88434eb 100644 --- a/upload/source/module/forum/forum_viewthread.php +++ b/upload/source/module/forum/forum_viewthread.php @@ -1307,8 +1307,12 @@ function viewthread_loadcache() { readfile($threadcache['filename']); viewthread_updateviews($_G['forum_thread']['threadtableid']); $updatetime = dgmdate($filemtime, 'Y-m-d H:i:s'); - $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; - echo ''; + $debuginfo = ", Updated at $updatetime"; + if(getglobal('setting/debug')) { + $gzip = $_G['gzipcompress'] ? ', Gzip On' : ''; + $debuginfo .= ', Processed in '.sprintf("%0.6f", microtime(TRUE) - $start_time).' second(s)'.$gzip; + } + echo ''; ob_end_flush(); exit(); } -- Gitee From 6b1e087ee8a5b3d7b02d63be2b0d70e062fb2eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Mon, 28 Dec 2020 08:06:11 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20error=5Freporting=20?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=200=20=E6=97=B6=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/archiver/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/archiver/index.php b/upload/archiver/index.php index 7320c6c78..b048b662f 100644 --- a/upload/archiver/index.php +++ b/upload/archiver/index.php @@ -13,7 +13,7 @@ chdir('../'); $querystring = $_SERVER['QUERY_STRING']; -if(!empty($_GET['action'])) { +if(!empty($_GET['action']) && !empty($_GET['value'])) { $querystring = $_GET['action'].'-'.$_GET['value']; } -- Gitee From 4cff4c16ccb5a513381e78ffda9ccf49cda10c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Mon, 28 Dec 2020 08:11:01 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=9B=9B=E6=A0=BC=E9=94=99=E8=AF=AF=E6=96=87=E5=AD=97=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/language/lang_admincp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/source/language/lang_admincp.php b/upload/source/language/lang_admincp.php index c3cc58421..eaccfdafb 100644 --- a/upload/source/language/lang_admincp.php +++ b/upload/source/language/lang_admincp.php @@ -2713,7 +2713,7 @@ $lang = array 'forums_grid_show_grid' => '是否开启首页四格', 'forums_grid_show_grid_comment' => '在论坛首页展示四格内容', 'forums_grid_style_type' => '展示风格', - 'forums_grid_style_type_comment' => '图文并茂: 幻灯+新帖+新回复+热帖; 简洁文字:新帖+新回复+精华贴+精华贴;', + 'forums_grid_style_type_comment' => '图文并茂: 幻灯+新帖+新回复+热帖; 简洁文字:新帖+新回复+热帖+精华贴;', 'forums_grid_style_image' => '图文并茂', 'forums_grid_style_text' => '简洁文字', 'forums_grid_data_source' => '数据来源版块', -- Gitee From 220729aa492810358205a4ff96312ca06d7115f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Mon, 28 Dec 2020 08:14:11 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E4=BD=8E=E6=A6=82=E7=8E=87=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/module/forum/forum_ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upload/source/module/forum/forum_ajax.php b/upload/source/module/forum/forum_ajax.php index 39d932cd3..af195d4b0 100644 --- a/upload/source/module/forum/forum_ajax.php +++ b/upload/source/module/forum/forum_ajax.php @@ -682,7 +682,9 @@ EOF; C::t('common_setting')->update($funkey, $funstatus); $setting[$funkey] = $funstatus; - include libfile('function/cache'); + if(!function_exists('updatecache')) { + include libfile('function/cache'); + } updatecache('setting'); } showmessage('do_success', dreferer(), array(), array('header'=>true)); -- Gitee From 0f5e3eb096eb5988e2f4ecf6032ded3cb13fe5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Mon, 28 Dec 2020 08:15:56 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=89=88=E5=9D=97=E5=9B=BE=E6=A0=87=E5=89=8D=E7=AB=AF=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1alt=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/function/function_forumlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/source/function/function_forumlist.php b/upload/source/function/function_forumlist.php index 7da26a7d0..2e478bdc0 100644 --- a/upload/source/function/function_forumlist.php +++ b/upload/source/function/function_forumlist.php @@ -36,7 +36,7 @@ function forum(&$forum) { if($forum['icon']) { $forum['icon'] = get_forumimg($forum['icon']); - $forum['icon'] = ''; + $forum['icon'] = ''.$forum['name'].''; } $lastpost = array(0, 0, '', ''); -- Gitee From 485b0e36878e96a612388735739459b6b5fa9b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Thu, 12 Mar 2020 21:18:15 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B8=A6from?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E4=B8=BB=E9=A2=98=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=A2=AB=E9=94=99=E8=AF=AF=E7=BC=93=E5=AD=98=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/module/forum/forum_viewthread.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/source/module/forum/forum_viewthread.php b/upload/source/module/forum/forum_viewthread.php index ac88434eb..f6e4ce8ec 100644 --- a/upload/source/module/forum/forum_viewthread.php +++ b/upload/source/module/forum/forum_viewthread.php @@ -34,7 +34,7 @@ if($page === 1 && !empty($_G['setting']['antitheft']['allow']) && empty($_G['set helper_antitheft::check($_G['forum_thread']['tid'], 'tid'); } -if($_G['setting']['cachethreadlife'] && $_G['forum']['threadcaches'] && !$_G['uid'] && $page == 1 && !$_G['forum']['special'] && empty($_GET['do']) && empty($_GET['threadindex']) && !defined('IN_ARCHIVER') && !defined('IN_MOBILE')) { +if($_G['setting']['cachethreadlife'] && $_G['forum']['threadcaches'] && !$_G['uid'] && $page == 1 && !$_G['forum']['special'] && empty($_GET['do']) && empty($_GET['from']) && empty($_GET['threadindex']) && !defined('IN_ARCHIVER') && !defined('IN_MOBILE')) { viewthread_loadcache(); } -- Gitee From e71408c4e282798be4b543f19525c7466d510501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sun, 10 Jan 2021 15:37:57 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=86=85=E5=AD=98=E7=BC=93=E5=AD=98=E5=90=8E=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=B8=8D=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/include/topicadmin/topicadmin_moderate.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/upload/source/include/topicadmin/topicadmin_moderate.php b/upload/source/include/topicadmin/topicadmin_moderate.php index 55bc6012b..4832743fa 100644 --- a/upload/source/include/topicadmin/topicadmin_moderate.php +++ b/upload/source/include/topicadmin/topicadmin_moderate.php @@ -707,6 +707,13 @@ if(!submitcheck('modsubmit')) { set_stamp($stampstatus, $stampaction, $threadlist, $expiration); } + // 当进行管理操作后, 更新相关板块的板块缓存 + $fidarr = array(); + foreach ($threadlist as $thread) { + $fidarr[] = $thread['fid']; + } + C::t('forum_thread')->clear_cache($fidarr, 'forumdisplay_'); + } showmessage('admin_succeed', $_G['referer']); } -- Gitee From 9e53e1ac1a0a3c7869bb369aa3e5bd322fe3b9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sun, 10 Jan 2021 16:38:47 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=A5=BF=E7=93=9C?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=A7=86=E9=A2=91=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/function/media/media_ixigua.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 upload/source/function/media/media_ixigua.php diff --git a/upload/source/function/media/media_ixigua.php b/upload/source/function/media/media_ixigua.php new file mode 100644 index 000000000..64e31a33a --- /dev/null +++ b/upload/source/function/media/media_ixigua.php @@ -0,0 +1,15 @@ + Date: Sun, 10 Jan 2021 16:11:55 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=81=E7=A9=BA=E9=97=B4=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E3=80=81=E6=A8=A1=E5=9D=97=E5=90=8D=E7=A7=B0=E3=80=81=E9=9F=B3?= =?UTF-8?q?=E4=B9=90=E5=90=8D=E7=A7=B0=E6=8E=A5=E5=8F=97=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E8=AF=8D=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/include/spacecp/spacecp_index.php | 10 ++++++---- upload/static/js/space_diy.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/upload/source/include/spacecp/spacecp_index.php b/upload/source/include/spacecp/spacecp_index.php index b20b19f60..d1a5fdd19 100644 --- a/upload/source/include/spacecp/spacecp_index.php +++ b/upload/source/include/spacecp/spacecp_index.php @@ -109,8 +109,8 @@ if ($op == 'start') { space_merge($space,'field_home'); if (submitcheck('savespaceinfosubmit')) { - $spacename = getstr($_POST['spacename'], 30); - $spacedescription = getstr($_POST['spacedescription'], 135); + $spacename = censor(getstr($_POST['spacename'], 30)); + $spacedescription = censor(getstr($_POST['spacedescription'], 135)); $setarr = array(); $setarr['spacename'] = $spacename; @@ -137,7 +137,7 @@ if (submitcheck('blocksubmit')) { space_merge($space,'field_home'); $blockdata = dunserialize($space['blockposition']); - $title = getstr($_POST['blocktitle'],50); + $title = censor(getstr($_POST['blocktitle'],50)); $blockdata['parameters'][$blockname]['title'] = $title; if (in_array($blockname, array('block1', 'block2', 'block3', 'block4', 'block5'))) { @@ -219,13 +219,14 @@ if (submitcheck('musicsubmit')) { ); $blockdata['parameters']['music']['config'] = $config; - $blockdata['parameters']['music']['title']= getstr($_POST['blocktitle'],50); + $blockdata['parameters']['music']['title']= censor(getstr($_POST['blocktitle'],50)); } elseif ($_POST['act'] == 'addmusic') { $mp3url = $_POST['mp3url']; $mp3name = $_POST['mp3name']; $cdbj = $_POST['cdbj']; $mp3list = empty($blockdata['parameters']['music']['mp3list']) ? array() : $blockdata['parameters']['music']['mp3list']; + censor(implode('', $_POST['mp3name'])); foreach ($mp3url as $key => $value) { if (!empty($value)) { if(empty($mp3name[$key])) $mp3name[$key] = substr($value,strrpos($value,'/')+1,strlen($value)); @@ -239,6 +240,7 @@ if (submitcheck('musicsubmit')) { $mp3name = $_POST['mp3name']; $cdbj = $_POST['cdbj']; $mp3list = array(); + censor(implode('', $_POST['mp3name'])); foreach ($mp3url as $key => $value) { if (!empty($value)) { if(empty($mp3name[$key])) $mp3name[$key] = substr($value,strrpos($value,'/')+1,strlen($value)); diff --git a/upload/static/js/space_diy.js b/upload/static/js/space_diy.js index 281b49b25..63361f4d2 100644 --- a/upload/static/js/space_diy.js +++ b/upload/static/js/space_diy.js @@ -175,7 +175,7 @@ spaceDiy.extend({ if ($('spaceinfoshow')) $('spaceinfoshow').style.display = 'inline'; }, spaceInfoSave : function () { - ajaxpost('savespaceinfo','spaceinfoshow'); + ajaxpost('savespaceinfo','spaceinfoshow','','onerror'); }, init : function () { drag.init(); -- Gitee From 1fea5bf3eeda86d7ccd9988e597b58a3d1f3f6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sun, 6 Dec 2020 14:11:59 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=AF=B9=E5=A4=96?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=B8=8D=E6=94=AF=E6=8C=81=20SNI=20=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/install/include/install_function.php | 10 +++++++++- upload/source/function/function_filesock.php | 12 ++++++++++-- upload/uc_client/client.php | 10 +++++++++- upload/uc_client/model/misc.php | 10 +++++++++- upload/uc_server/install/func.inc.php | 10 +++++++++- upload/uc_server/model/misc.php | 10 +++++++++- 6 files changed, 55 insertions(+), 7 deletions(-) diff --git a/upload/install/include/install_function.php b/upload/install/include/install_function.php index 5c9adab6a..d3dc45d4d 100644 --- a/upload/install/include/install_function.php +++ b/upload/install/include/install_function.php @@ -885,7 +885,15 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ $ch = curl_init(); $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/upload/source/function/function_filesock.php b/upload/source/function/function_filesock.php index 1a8594e56..d0bd95e16 100644 --- a/upload/source/function/function_filesock.php +++ b/upload/source/function/function_filesock.php @@ -75,7 +75,7 @@ function _dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FAL return ''; } $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/'; - $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'http' ? '80' : ''); + $port = !empty($matches['port']) ? $matches['port'] : (strtolower($scheme) == 'https' ? 443 : 80); $boundary = $encodetype == 'URLENCODE' ? '' : random(40); if($post) { @@ -95,7 +95,15 @@ function _dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FAL if($httpheader) { curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader); } - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).($port ? ':'.$port : '').$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); diff --git a/upload/uc_client/client.php b/upload/uc_client/client.php index 0f97d1a31..9e050bd95 100644 --- a/upload/uc_client/client.php +++ b/upload/uc_client/client.php @@ -234,7 +234,15 @@ function uc_fopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ch = curl_init(); $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/upload/uc_client/model/misc.php b/upload/uc_client/model/misc.php index 55ed49bb3..5d60abda7 100644 --- a/upload/uc_client/model/misc.php +++ b/upload/uc_client/model/misc.php @@ -73,7 +73,15 @@ class miscmodel { $ch = curl_init(); $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/upload/uc_server/install/func.inc.php b/upload/uc_server/install/func.inc.php index 24204f578..c0365a283 100644 --- a/upload/uc_server/install/func.inc.php +++ b/upload/uc_server/install/func.inc.php @@ -755,7 +755,15 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ $ch = curl_init(); $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/upload/uc_server/model/misc.php b/upload/uc_server/model/misc.php index e90440138..9ab23336b 100644 --- a/upload/uc_server/model/misc.php +++ b/upload/uc_server/model/misc.php @@ -71,7 +71,15 @@ class miscmodel { $ch = curl_init(); $ip && curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: ".$host)); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); - curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + // 在请求主机名并非一个合法 IP 地址, 且 PHP 版本 >= 5.5.0 时, 使用 CURLOPT_RESOLVE 设置固定的 IP 地址与域名关系 + // 在不支持的 PHP 版本下, 继续采用原有不支持 SNI 的流程 + if(!filter_var($host, FILTER_VALIDATE_IP) && version_compare(PHP_VERSION, '5.5.0', 'ge')) { + curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($ch, CURLOPT_RESOLVE, array("$host:$port:$ip")); + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.$host.':'.$port.$path); + } else { + curl_setopt($ch, CURLOPT_URL, $scheme.'://'.($ip ? $ip : $host).':'.$port.$path); + } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); -- Gitee From a98080fe5b156611eb96a27165c6800a2c6f7466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sat, 30 Jan 2021 10:13:54 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=80=89=E9=A1=B9=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E6=95=B0=E5=AD=97=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/language/lang_admincp_msg.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/source/language/lang_admincp_msg.php b/upload/source/language/lang_admincp_msg.php index 620c61e4e..d6a6e7dab 100644 --- a/upload/source/language/lang_admincp_msg.php +++ b/upload/source/language/lang_admincp_msg.php @@ -104,7 +104,7 @@ $lang = array ( 'select_thread_empty' => '没有选择主题', 'threadtype_infotypes_option_invalid' => '分类扩展选项名称或者变量名为空', 'threadtype_infotypes_optionvariable_iskeyword' => '选项变量名不被允许使用', - 'threadtype_infotypes_optionvariable_invalid' => '分类选项变量名重复', + 'threadtype_infotypes_optionvariable_invalid' => '分类选项变量名重复或不为字母开头', 'threadtype_infotypes_succeed' => '分类选项更新成功 ', 'forums_threadtypes_duplicate' => '新增主题分类与现有重复', 'threadtype_import_succeed' => '导入成功', -- Gitee From 3c7a3d298d47869c75727e49434b32fd90f9b040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sat, 30 Jan 2021 11:02:30 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81=E9=9D=9E=20Ajax=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F,=20=E7=BC=93=E8=A7=A3=20Ajax=20=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=80=A0=E6=88=90=E6=94=AF=E4=BB=98=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/include/spacecp/spacecp_credit_base.php | 6 +++--- upload/source/module/misc/misc_buyinvitecode.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/upload/source/include/spacecp/spacecp_credit_base.php b/upload/source/include/spacecp/spacecp_credit_base.php index 695edaef8..2cd092f0d 100644 --- a/upload/source/include/spacecp/spacecp_credit_base.php +++ b/upload/source/include/spacecp/spacecp_credit_base.php @@ -150,9 +150,9 @@ if($_GET['op'] == 'base') { 'submitdate' => $_G['timestamp'], )); - include template('common/header_ajax'); - echo '
'; - include template('common/footer_ajax'); + include isset($_REQUEST['inajax']) ? template('common/header_ajax') : template('common/header'); + echo '
'; + include isset($_REQUEST['inajax']) ? template('common/footer_ajax') : template('common/footer'); dexit(); } } else { diff --git a/upload/source/module/misc/misc_buyinvitecode.php b/upload/source/module/misc/misc_buyinvitecode.php index ab4129da7..9fbe05006 100644 --- a/upload/source/module/misc/misc_buyinvitecode.php +++ b/upload/source/module/misc/misc_buyinvitecode.php @@ -45,9 +45,9 @@ if(submitcheck('buysubmit')) { 'email' => $email, 'ip' => $_G['clientip'], )); - include template('common/header_ajax'); - echo '
'; - include template('common/footer_ajax'); + include isset($_REQUEST['inajax']) ? template('common/header_ajax') : template('common/header'); + echo '
'; + include isset($_REQUEST['inajax']) ? template('common/footer_ajax') : template('common/footer'); dexit(); } else { showmessage('action_closed', NULL); -- Gitee