From 983293ec333deb9df8578333dd91cb6c38ebca13 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 12 Jul 2020 11:21:41 +0700 Subject: [PATCH] fix unset reference variable --- system/Router/RouteCollection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index eb3baa0d8f12..baf498f0e47d 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -831,11 +831,11 @@ public function resource(string $name, array $options = null): RouteCollectionIn if (isset($options['except'])) { $options['except'] = is_array($options['except']) ? $options['except'] : explode(',', $options['except']); - foreach ($methods as &$method) + foreach ($methods as $i => $method) { if (in_array($method, $options['except'])) { - unset($method); + unset($methods[$i]); } } } @@ -945,11 +945,11 @@ public function presenter(string $name, array $options = null): RouteCollectionI if (isset($options['except'])) { $options['except'] = is_array($options['except']) ? $options['except'] : explode(',', $options['except']); - foreach ($methods as &$method) + foreach ($methods as $i => $method) { if (in_array($method, $options['except'])) { - unset($method); + unset($methods[$i]); } } }