diff --git a/composer.json b/composer.json index 19b3f557..0f259095 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "phly/phly-event-dispatcher": "^1.0", "predis/predis": "^1.1", "pugx/shortid-php": "^0.5", - "shlinkio/shlink-common": "^2.5", + "shlinkio/shlink-common": "dev-master#e6658205370260df72f295df15364ac569ff702c as 2.6.0", "shlinkio/shlink-event-dispatcher": "^1.3", "shlinkio/shlink-installer": "^4.0.1", "shlinkio/shlink-ip-geolocation": "^1.3.1", diff --git a/module/Core/src/Validation/ShortUrlsParamsInputFilter.php b/module/Core/src/Validation/ShortUrlsParamsInputFilter.php index 376eb531..b3e6db2d 100644 --- a/module/Core/src/Validation/ShortUrlsParamsInputFilter.php +++ b/module/Core/src/Validation/ShortUrlsParamsInputFilter.php @@ -4,9 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Validation; -use DateTime; use Laminas\Filter; -use Laminas\InputFilter\ArrayInput; use Laminas\InputFilter\InputFilter; use Laminas\Validator; use Shlinkio\Shlink\Common\Validation; @@ -29,13 +27,8 @@ class ShortUrlsParamsInputFilter extends InputFilter private function initialize(): void { - $startDate = $this->createInput(self::START_DATE, false); - $startDate->getValidatorChain()->attach(new Validator\Date(['format' => DateTime::ATOM])); - $this->add($startDate); - - $endDate = $this->createInput(self::END_DATE, false); - $endDate->getValidatorChain()->attach(new Validator\Date(['format' => DateTime::ATOM])); - $this->add($endDate); + $this->add($this->createDateInput(self::START_DATE, false)); + $this->add($this->createDateInput(self::END_DATE, false)); $this->add($this->createInput(self::SEARCH_TERM, false)); @@ -44,11 +37,8 @@ class ShortUrlsParamsInputFilter extends InputFilter ->attach(new Validator\GreaterThan(['min' => 1, 'inclusive' => true])); $this->add($page); - $tags = new ArrayInput(self::TAGS); - $tags->setRequired(false) - ->getFilterChain()->attach(new Filter\StripTags()) - ->attach(new Filter\StringTrim()) - ->attach(new Filter\StringToLower()) + $tags = $this->createArrayInput(self::TAGS, false); + $tags->getFilterChain()->attach(new Filter\StringToLower()) ->attach(new Validation\SluggerFilter()); $this->add($tags); }