mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.1.11-20240119
This commit is contained in:
@@ -1506,6 +1506,7 @@ function read_data(){
|
||||
$log .= in_array("Phar",$ext) ? "" : "Phar:不支持 (在线更新/主题下载)\n";
|
||||
$log .= in_array("hash",$ext) ? "" : "hash:不支持 (书签分享/生成注册码)\n";
|
||||
$log .= in_array("session",$ext) ? "" : "session:不支持 (影响较大)\n";
|
||||
$log .= in_array("intl",$ext) ? "" : "intl:不支持 (使用中文域名时可能会导致异常)\n";
|
||||
$log .= "可用模块:".implode(" ",$ext)."\n";
|
||||
$updatadb_logs = select_db('updatadb_logs','file_name',['file_name[!]'=>'install.sql']);
|
||||
$log .= "数据库更新记录:".(empty($updatadb_logs)?'无':"\n".implode("\n",$updatadb_logs))."\n";
|
||||
@@ -1643,9 +1644,8 @@ function other_get_link_info(){
|
||||
msg(-1010,'URL不能为空!');
|
||||
}elseif(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
|
||||
msg(-1010,'只支持识别http/https协议的链接!');
|
||||
}elseif( !filter_var($url, FILTER_VALIDATE_URL) ) {
|
||||
msg(-1010,'URL无效!');
|
||||
}
|
||||
$url = process_url_idn($url);
|
||||
//获取网站标题 (HTML/JS跳转无法识别)
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, $url);
|
||||
|
||||
@@ -86,7 +86,9 @@ if(!empty($link['url_standby']) || $site['link_model'] == 'Transition'){
|
||||
if(!empty($link['url_standby'])) {
|
||||
$link['url_standby'] = unserialize($link['url_standby']);
|
||||
//主链优先模式
|
||||
if(!empty($site['main_link_priority']) && $site['link_model'] != 'Transition'){
|
||||
if($site['main_link_priority'] == '3'){
|
||||
$site['link_model'] = $site['link_model'] == 'direct' ? '302' : $site['link_model'];
|
||||
}elseif($site['main_link_priority'] > 0 && $site['link_model'] != 'Transition'){
|
||||
$code = get_http_code($link['url'],3,($site['main_link_priority'] == 1));
|
||||
if(in_array(intval($code),[200,301,302,401]) ){
|
||||
$site['link_model'] = $site['link_model'] == 'direct' ? '302' : $site['link_model'];
|
||||
@@ -110,9 +112,11 @@ if ($site['link_model'] == '302'){ //302重定向(临时)
|
||||
exit;
|
||||
}elseif($site['link_model'] == 'Privacy'){ //隐私保护_header
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $link['url']) > 0){
|
||||
exit ('<html lang="zh-ch"><head><title>正在保护您的隐私..</title><meta name="referrer" content="same-origin"><script>window.location.href="'.$link['url'].'"</script></head>');
|
||||
}
|
||||
header("Refresh:0;url=".$link['url']);
|
||||
echo '<html lang="zh-ch"><head><title>正在保护您的隐私..</title><meta name="referrer" content="same-origin"></head>';
|
||||
exit;
|
||||
exit ('<html lang="zh-ch"><head><title>正在保护您的隐私..</title><meta name="referrer" content="same-origin"></head>');
|
||||
}elseif($site['link_model'] == 'Privacy_js'){ //隐私保护_js
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
echo '<html lang="zh-ch"><head><title>正在保护您的隐私..</title><meta name="referrer" content="same-origin"><script>window.location.href="'.$link['url'].'"</script></head>';
|
||||
|
||||
@@ -775,4 +775,12 @@ function get_OEM(){
|
||||
//返回404
|
||||
function Not_Found() {
|
||||
header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;
|
||||
}
|
||||
|
||||
function process_url_idn($url) {
|
||||
$parsed_url = parse_url($url);
|
||||
if(!preg_match('/[\x{4e00}-\x{9fa5}]/u', $parsed_url['host'])){
|
||||
return $url;
|
||||
}
|
||||
return substr_replace($url, idn_to_ascii($parsed_url['host']), strpos($url, "//") + 2, strlen($parsed_url['host']));
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
v2.1.09-20231220
|
||||
v2.1.11-20240119
|
||||
@@ -2,6 +2,18 @@
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main" style=" margin-left: 20px;">
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.1.11-20240119</h4>
|
||||
<ul>
|
||||
<li>[修复] 链接识别遇到中文域名时提示URL无效</li>
|
||||
<li>[修复] 链接模式为隐私保护(header)时中文域名无法跳转</li>
|
||||
<li>[修复] 主链优先设为强制优先时不起作用</li>
|
||||
<li>[优化] 一键诊断缺少intl扩展模块时给出提醒</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
|
||||
Reference in New Issue
Block a user