diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-03 21:44:26 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-03 21:44:26 -0400 |
commit | 92cf7f4df60e3d6105dae5c6c78d58b1577a3f58 (patch) | |
tree | 89c76057c29fad1912f1f4237b20777df03339ad /app | |
parent | c9e317872004cdd7e58a9474d17a1b85888c5873 (diff) |
Fix a couple of issues for PHP 7.0
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/Router.php | 3 | ||||
-rw-r--r-- | app/Core/Session.php | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/Core/Router.php b/app/Core/Router.php index f1cdc040..93d266bb 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -80,7 +80,7 @@ class Router extends Base $path = substr($path, 0, - strlen($query_string) - 1); } - if ($path{0} === '/') { + if (! empty($path) && $path{0} === '/') { $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 $plugin = ''; } - $class = empty($plugin) ? '\Controller\\'.ucfirst($this->controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller); $instance = new $class($this->container); diff --git a/app/Core/Session.php b/app/Core/Session.php index df0ec5f7..4f5fde70 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -45,7 +45,9 @@ class Session implements ArrayAccess ini_set('session.use_only_cookies', '1'); // 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 ini_set('session.entropy_file', '/dev/urandom'); |