diff --git a/src/Filter/Login.php b/src/Filter/Login.php index a6591bd..61d20ec 100644 --- a/src/Filter/Login.php +++ b/src/Filter/Login.php @@ -185,7 +185,7 @@ class Login extends Filter } } else if (isset($_SERVER['HTTP_REFERER'])) { $arr = array(); - parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $arr); + parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY) ?? '', $arr); if (isset($arr['back_page']) && $request->get('mode') != 'ajax') { $request->redirect($arr['back_page']); } diff --git a/src/Model/Factory.php b/src/Model/Factory.php index dd99fd7..cf7f46e 100644 --- a/src/Model/Factory.php +++ b/src/Model/Factory.php @@ -9,6 +9,7 @@ class Factory { public $db; public $config; + public $user; public function __construct (Database $db, Registry $config = null, User $user = null) { diff --git a/src/Path.php b/src/Path.php index f2ca20a..d7d0d04 100644 --- a/src/Path.php +++ b/src/Path.php @@ -19,12 +19,12 @@ class Path public function __construct($path = '') { //assert(is_string($path)); - $this->url = parse_url($path); + $this->url = parse_url($path ?? ''); if (isset($this->url['path'])) { $path = $this->url['path']; // $path = preg_replace('/\/{2,}/', '/', $path); - $list = self::listFromString($path); + $list = $this->listFromString($path); if (isset($this->url['scheme']) && !isset($this->url['host'])) { $this->absolute = false; @@ -32,7 +32,7 @@ class Path $this->absolute = true; } - $this->path = self::optimize($list); + $this->path = $this->optimize($list); } } @@ -311,7 +311,7 @@ class Path static function join($_rest) { $args = func_get_args(); - $path = call_user_func_array("self::fromJoin", $args); + $path = call_user_func_array([self::class, "fromJoin"], $args); return self::makeUrl($path->url); }