From 96769f52cfe1b959701d33e7d48c61b99df005c5 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 18 Jun 2016 22:00:41 +0200 Subject: [PATCH] Allowed colons at the end of tags --- src/Validator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Validator.php b/src/Validator.php index 421b78a7..328ced4b 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -98,8 +98,8 @@ class Validator throw new \DomainException('Tags cannot be empty.'); //: causes problems with complex search (e.g. id:5). - if (strpos($tag, ':') > 0) - throw new \DomainException('Colon in tag may appear only at the beginning.'); + if (strpos($tag, ':') !== false && strpos($tag, ':') !== 0 && strpos($tag, ':') !== strlen($tag) - 1) + throw new \DomainException('Colon in tag may appear only at the beginning or end.'); $this->validateMaxLength($tag, 64, 'Tag');