From b18a43570eef37a0f222a22e8aa15f5087982738 Mon Sep 17 00:00:00 2001 From: Jason/CrossPlatform <68124218+crossplatformconsulting@users.noreply.github.com> Date: Wed, 12 Mar 2025 08:23:22 +0200 Subject: [PATCH] Update ComponentAttributeBag.php --- src/Illuminate/View/ComponentAttributeBag.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/View/ComponentAttributeBag.php b/src/Illuminate/View/ComponentAttributeBag.php index 780d93deb51d..41728007e1ca 100644 --- a/src/Illuminate/View/ComponentAttributeBag.php +++ b/src/Illuminate/View/ComponentAttributeBag.php @@ -508,7 +508,7 @@ public function __toString() $string = ''; foreach ($this->attributes as $key => $value) { - if ($value === false || is_null($value)) { + if ($value === false || is_null($value) || is_array($value)) { continue; } @@ -516,7 +516,7 @@ public function __toString() $value = $key === 'x-data' || str_starts_with($key, 'wire:') ? '' : $key; } - $string .= ' '.$key.'="'.str_replace('"', '\\"', trim($value)).'"'; + $string .= ' '.$key.'="'.str_replace('"', '\\"', trim((string) $value)).'"'; } return trim($string);