Fix a couple of issues for PHP 7.0
This commit is contained in:
parent
c9e3178720
commit
92cf7f4df6
|
|
@ -80,7 +80,7 @@ class Router extends Base
|
||||||
$path = substr($path, 0, - strlen($query_string) - 1);
|
$path = substr($path, 0, - strlen($query_string) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($path{0} === '/') {
|
if (! empty($path) && $path{0} === '/') {
|
||||||
$path = substr($path, 1);
|
$path = substr($path, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,7 +218,6 @@ class Router extends Base
|
||||||
list($this->controller, $this->action) = $this->findRoute($this->getPath($uri, $query_string)); // TODO: add plugin for routes
|
list($this->controller, $this->action) = $this->findRoute($this->getPath($uri, $query_string)); // TODO: add plugin for routes
|
||||||
$plugin = '';
|
$plugin = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = empty($plugin) ? '\Controller\\'.ucfirst($this->controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller);
|
$class = empty($plugin) ? '\Controller\\'.ucfirst($this->controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller);
|
||||||
|
|
||||||
$instance = new $class($this->container);
|
$instance = new $class($this->container);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,9 @@ class Session implements ArrayAccess
|
||||||
ini_set('session.use_only_cookies', '1');
|
ini_set('session.use_only_cookies', '1');
|
||||||
|
|
||||||
// Enable strict mode
|
// Enable strict mode
|
||||||
ini_set('session.use_strict_mode', '1');
|
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
|
||||||
|
ini_set('session.use_strict_mode', '1');
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure session ID integrity
|
// Ensure session ID integrity
|
||||||
ini_set('session.entropy_file', '/dev/urandom');
|
ini_set('session.entropy_file', '/dev/urandom');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue