本站即日起正式部署SSL证书启用https安全连接, 联系站长:416326801#qq.com(#改成@)

emlog设置https后边栏日期不能显示

21 Views 标签: PHP

修改/include/lib/function.base.php


/**
 * 获取站点地址(仅限根目录脚本使用,目前仅用于首页ajax请求)
 */
function getBlogUrl() {
	$phpself = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
        // 增加https端口判断
        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
	if (preg_match("/^.*\//", $phpself, $matches)) {
		return $protocol . $_SERVER['HTTP_HOST'] . $matches[0];
		// return 'http://' . $_SERVER['HTTP_HOST'] . $matches[0];
	} else {
		return BLOG_URL;
	}
}


您可能感兴趣: