diff options
| author | Asko Nomm <asko@bien.ee> | 2022-02-27 21:16:09 +0100 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-02-27 21:16:09 +0100 |
| commit | adf4ac94ddeab9c9374b0cda1fdcef926b85e4e6 (patch) | |
| tree | 39b2118f0f08d9c37211ba6d267e1345b960e84d /src | |
| parent | 3a7ca1c47a5e1a6820c38dc39e1a129be64ecc93 (diff) | |
Fix an issue where a modifier could not include `:` characters.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Hird.php | 4 |
1 files changed, 3 insertions, 1 deletions
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); |
