Change string indexing from {0} to [0] (deprecated in PHP 7.4)
This commit is contained in:
committed by
Frédéric Guillot
parent
6c08225f76
commit
35602c0880
@@ -100,7 +100,7 @@ class Route extends Base
|
||||
$params = array();
|
||||
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if ($route['items'][$i]{0} === ':') {
|
||||
if ($route['items'][$i][0] === ':') {
|
||||
$params[substr($route['items'][$i], 1)] = $items[$i];
|
||||
} elseif ($route['items'][$i] !== $items[$i]) {
|
||||
break;
|
||||
@@ -177,7 +177,7 @@ class Route extends Base
|
||||
$params = array();
|
||||
|
||||
foreach ($items as $item) {
|
||||
if ($item !== '' && $item{0} === ':') {
|
||||
if ($item !== '' && $item[0] === ':') {
|
||||
$params[substr($item, 1)] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ class Router extends Base
|
||||
$path = substr($path, 0, - strlen($this->request->getQueryString()) - 1);
|
||||
}
|
||||
|
||||
if ($path !== '' && $path{0} === '/') {
|
||||
if ($path !== '' && $path[0] === '/') {
|
||||
$path = substr($path, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user