From adf4ac94ddeab9c9374b0cda1fdcef926b85e4e6 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Sun, 27 Feb 2022 21:16:09 +0100 Subject: Fix an issue where a modifier could not include `:` characters. --- src/Hird.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Hird.php') diff --git a/src/Hird.php b/src/Hird.php index 305356c..d33a9ae 100644 --- a/src/Hird.php +++ b/src/Hird.php @@ -103,7 +103,9 @@ class Hird foreach (explode('|', $rule) as $item) { if (str_contains($item, ':')) { - [$name, $modifier] = explode(':', $item); + $itemParts = explode(':', $item); + $name = $itemParts[0]; + $modifier = implode(':', array_slice($itemParts, 1, count($itemParts) - 1, true)); if (!$this->validators[$name]->validate($field, $value, $modifier)) { $this->errors[] = $this->validators[$name]->composeError($field, $modifier); -- cgit v1.2.3