diff --git a/upload/api/db/dbbak.php b/upload/api/db/dbbak.php index 7cc64d28813e9a5cd0d841682ce967703dba79d3..4960cb02e7418e58a88db4a22ccbaf03ddbf7197 100644 --- a/upload/api/db/dbbak.php +++ b/upload/api/db/dbbak.php @@ -916,19 +916,26 @@ function send_mime_type_header($type = 'application/xml') { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/index.php b/upload/index.php index 49663b8244a6a486651a75606a3733f072d18d9a..374da65d139ac11b9bf1b61bdc656185d4f471e8 100644 --- a/upload/index.php +++ b/upload/index.php @@ -162,19 +162,26 @@ function checkholddomain($domain) { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/install/include/install_function.php b/upload/install/include/install_function.php index f6e828053eeb922eff650be082e3fe900a52f1df..07c258f38c470b21db35ead3c991f5eaec1e8a26 100644 --- a/upload/install/include/install_function.php +++ b/upload/install/include/install_function.php @@ -1813,19 +1813,26 @@ function send_mime_type_header($type = 'application/xml') { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/source/class/discuz/discuz_application.php b/upload/source/class/discuz/discuz_application.php index 0ce5b1b4b9991748c3772953b6b909f0607187d4..8a900646d79ea504e1a5231bc5fc393fd5830b98 100644 --- a/upload/source/class/discuz/discuz_application.php +++ b/upload/source/class/discuz/discuz_application.php @@ -390,19 +390,26 @@ class discuz_application extends discuz_base{ } private function _is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/uc_server/admin.php b/upload/uc_server/admin.php index ac1514278892ee313b5c565158ef436c1789ab64..4f85f444ab9b2dd8cc007012aa3bd0330241eb1a 100644 --- a/upload/uc_server/admin.php +++ b/upload/uc_server/admin.php @@ -127,19 +127,26 @@ function dhtmlspecialchars($string, $flags = null) { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/uc_server/api/dbbak.php b/upload/uc_server/api/dbbak.php index 684cc40872397fceed030f34b3cf3dedd7926b18..ff41add98242901ce2d2ed8704e067587b54c3fc 100644 --- a/upload/uc_server/api/dbbak.php +++ b/upload/uc_server/api/dbbak.php @@ -912,19 +912,26 @@ function send_mime_type_header($type = 'application/xml') { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/uc_server/avatar.php b/upload/uc_server/avatar.php index f6306b49eede76fea8c012c39bf8be742cc46028..26b4f24cf6cc28ffa03acb244cf110c6fc67e76e 100644 --- a/upload/uc_server/avatar.php +++ b/upload/uc_server/avatar.php @@ -86,19 +86,26 @@ function _get_script_url() { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/upload/uc_server/index.php b/upload/uc_server/index.php index 718d6313111d2d51c13face8fc200a9254178228..b330100da80200a33c2c8187b23530c2a43979be 100644 --- a/upload/uc_server/index.php +++ b/upload/uc_server/index.php @@ -146,19 +146,26 @@ function dhtmlspecialchars($string, $flags = null) { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false; diff --git a/utility/restore.php b/utility/restore.php index 4400f99cc13d70665486e28a913eeb1ebba2fa42..3bb9bc52b353db4e455a7513d2745c4a69e978fa 100644 --- a/utility/restore.php +++ b/utility/restore.php @@ -672,19 +672,26 @@ function syntablestruct($sql, $version, $dbcharset) { } function is_https() { - if (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off") { + // PHP 标准服务器变量 + if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { return true; } - if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"]) == "https") { + // X-Forwarded-Proto 事实标准头部, 用于反代透传 HTTPS 状态 + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') { return true; } - if (isset($_SERVER["HTTP_SCHEME"]) && strtolower($_SERVER["HTTP_SCHEME"]) == "https") { + // 阿里云全站加速私有 HTTPS 状态头部 + // Git 意见反馈 https://gitee.com/Discuz/DiscuzX/issues/I3W5GP + if(isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') { return true; } - if (isset($_SERVER["HTTP_FROM_HTTPS"]) && strtolower($_SERVER["HTTP_FROM_HTTPS"]) != "off") { + // 西部数码建站助手私有 HTTPS 状态头部 + // 官网意见反馈 https://www.discuz.net/thread-3849819-1-1.html + if(isset($_SERVER['HTTP_FROM_HTTPS']) && strtolower($_SERVER['HTTP_FROM_HTTPS']) != 'off') { return true; } - if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == 443) { + // 服务器端口号兜底判断 + if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { return true; } return false;