Skip to content

Commit cb7809f

Browse files
committed
Add str_contains in nested method
1 parent 9f7c9c8 commit cb7809f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/TwigComponent/src/ComponentAttributes.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ public function nested(string $namespace): self
222222
$attributes = [];
223223

224224
foreach ($this->attributes as $key => $value) {
225-
if (preg_match(self::NESTED_REGEX, $key, $matches) && $namespace === $matches[1]) {
225+
if (
226+
str_contains($key, ':')
227+
&& preg_match(self::NESTED_REGEX, $key, $matches) && $namespace === $matches[1]
228+
) {
226229
$attributes[$matches[2]] = $value;
227230
}
228231
}

0 commit comments

Comments
 (0)