Close off type errors in router
This commit is contained in:
parent
a7f5784aeb
commit
ebcafaf897
|
@ -243,7 +243,7 @@ class Router extends LsObject
|
|||
*/
|
||||
protected function GetRequestUri()
|
||||
{
|
||||
$sReq = preg_replace("/\/+/", '/', $_SERVER['REQUEST_URI']);
|
||||
$sReq = preg_replace("/\/+/", '/', ($_SERVER['REQUEST_URI'] ?? ''));
|
||||
$sReq = preg_replace("/^\/(.*)\/?$/U", '\\1', $sReq);
|
||||
$sReq = preg_replace("/^(.*)\?.*$/U", '\\1', $sReq);
|
||||
/**
|
||||
|
@ -469,8 +469,8 @@ class Router extends LsObject
|
|||
static public function GetFixPathWeb($sUrl, $bWithScheme = true)
|
||||
{
|
||||
$sResult = '';
|
||||
$aPathFull = parse_url($sUrl);
|
||||
$sPath = preg_replace('/^(http|https):\/\/[^\/]+/i', '', $sUrl);
|
||||
$aPathFull = parse_url((string) $sUrl);
|
||||
$sPath = preg_replace('/^(http|https):\/\/[^\/]+/i', '', (string) $sUrl);
|
||||
if (isset($aPathFull['host'])) {
|
||||
$sHost = $aPathFull['host'];
|
||||
} elseif (isset($_SERVER['HTTP_HOST'])) {
|
||||
|
|
Loading…
Reference in a new issue