mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-29 18:39:16 +08:00
tp框架识别不了https兼容处理
This commit is contained in:
parent
e34a65e3e1
commit
8064f66636
@ -225,6 +225,12 @@ function MyUrl($path, $params=[])
|
||||
$url = str_replace('public/', '', $url);
|
||||
}
|
||||
|
||||
// tpurl方法是否识别到https
|
||||
if(__MY_HTTP__ == 'https' && substr($url, 0, 5) != 'https')
|
||||
{
|
||||
$url = 'https'.mb_substr($url, 4, null, 'utf-8');
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ define('APPLICATION_VERSION', 'v1.4.0');
|
||||
define('DS', '/');
|
||||
|
||||
// HTTP类型
|
||||
define('__MY_HTTP__', ((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') || (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off')) ? 'https' : 'http');
|
||||
define('__MY_HTTP__', ((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') || (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) || (!empty($_SERVER['HTTP_FROM_HTTPS']) && $_SERVER['HTTP_FROM_HTTPS'] !== 'off')) ? 'https' : 'http');
|
||||
|
||||
// 根目录
|
||||
$my_root = empty($_SERVER['SCRIPT_NAME']) ? '' : substr($_SERVER['SCRIPT_NAME'], 1, strrpos($_SERVER['SCRIPT_NAME'], '/'));
|
||||
|
Loading…
Reference in New Issue
Block a user