Skip to content

Commit 92cf7f4

Browse files
committed
Fix a couple of issues for PHP 7.0
1 parent c9e3178 commit 92cf7f4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/Core/Router.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getPath($uri, $query_string = '')
8080
$path = substr($path, 0, - strlen($query_string) - 1);
8181
}
8282

83-
if ($path{0} === '/') {
83+
if (! empty($path) && $path{0} === '/') {
8484
$path = substr($path, 1);
8585
}
8686

@@ -218,7 +218,6 @@ public function dispatch($uri, $query_string = '')
218218
list($this->controller, $this->action) = $this->findRoute($this->getPath($uri, $query_string)); // TODO: add plugin for routes
219219
$plugin = '';
220220
}
221-
222221
$class = empty($plugin) ? '\Controller\\'.ucfirst($this->controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller);
223222

224223
$instance = new $class($this->container);

app/Core/Session.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public function open($base_path = '/')
4545
ini_set('session.use_only_cookies', '1');
4646

4747
// Enable strict mode
48-
ini_set('session.use_strict_mode', '1');
48+
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
49+
ini_set('session.use_strict_mode', '1');
50+
}
4951

5052
// Ensure session ID integrity
5153
ini_set('session.entropy_file', '/dev/urandom');

0 commit comments

Comments
 (0)