From f17491a51a5b21f5ec687b3438941ce3063700da Mon Sep 17 00:00:00 2001 From: Jona Goldman Date: Thu, 16 Nov 2023 11:33:15 -0300 Subject: [PATCH] Fix the replace() method in DefaultService class (#49022) --- src/Illuminate/Support/DefaultProviders.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/DefaultProviders.php b/src/Illuminate/Support/DefaultProviders.php index 441a083fed5c..ef7422fd6239 100644 --- a/src/Illuminate/Support/DefaultProviders.php +++ b/src/Illuminate/Support/DefaultProviders.php @@ -70,7 +70,7 @@ public function replace(array $replacements) foreach ($replacements as $from => $to) { $key = $current->search($from); - $current = $key ? $current->replace([$key => $to]) : $current; + $current = is_int($key) ? $current->replace([$key => $to]) : $current; } return new static($current->values()->toArray());