文件
vendor\fancyecommerce\fecshop\services\Url.php
代码
public function getCurrentUrl()
{
if (!$this->_currentUrl) {
$this->_currentUrl = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
}
return $this->_currentUrl;
}
关于$_SERVER['HTTPS']的解释
$_SERVER['HTTPS'] — 如果通过https访问,则被设为一个非空的值(on),否则返回off
所以正确的写法应该是
isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']=='on'