mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-23 15:40:33 -06:00
Ensured BC on dates for short urls params
This commit is contained in:
parent
51ebe57ac8
commit
7add41d560
@ -47,7 +47,7 @@
|
|||||||
"phly/phly-event-dispatcher": "^1.0",
|
"phly/phly-event-dispatcher": "^1.0",
|
||||||
"predis/predis": "^1.1",
|
"predis/predis": "^1.1",
|
||||||
"pugx/shortid-php": "^0.5",
|
"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-event-dispatcher": "^1.3",
|
||||||
"shlinkio/shlink-installer": "^4.0.1",
|
"shlinkio/shlink-installer": "^4.0.1",
|
||||||
"shlinkio/shlink-ip-geolocation": "^1.3.1",
|
"shlinkio/shlink-ip-geolocation": "^1.3.1",
|
||||||
|
@ -4,9 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Validation;
|
namespace Shlinkio\Shlink\Core\Validation;
|
||||||
|
|
||||||
use DateTime;
|
|
||||||
use Laminas\Filter;
|
use Laminas\Filter;
|
||||||
use Laminas\InputFilter\ArrayInput;
|
|
||||||
use Laminas\InputFilter\InputFilter;
|
use Laminas\InputFilter\InputFilter;
|
||||||
use Laminas\Validator;
|
use Laminas\Validator;
|
||||||
use Shlinkio\Shlink\Common\Validation;
|
use Shlinkio\Shlink\Common\Validation;
|
||||||
@ -29,13 +27,8 @@ class ShortUrlsParamsInputFilter extends InputFilter
|
|||||||
|
|
||||||
private function initialize(): void
|
private function initialize(): void
|
||||||
{
|
{
|
||||||
$startDate = $this->createInput(self::START_DATE, false);
|
$this->add($this->createDateInput(self::START_DATE, false));
|
||||||
$startDate->getValidatorChain()->attach(new Validator\Date(['format' => DateTime::ATOM]));
|
$this->add($this->createDateInput(self::END_DATE, false));
|
||||||
$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->createInput(self::SEARCH_TERM, 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]));
|
->attach(new Validator\GreaterThan(['min' => 1, 'inclusive' => true]));
|
||||||
$this->add($page);
|
$this->add($page);
|
||||||
|
|
||||||
$tags = new ArrayInput(self::TAGS);
|
$tags = $this->createArrayInput(self::TAGS, false);
|
||||||
$tags->setRequired(false)
|
$tags->getFilterChain()->attach(new Filter\StringToLower())
|
||||||
->getFilterChain()->attach(new Filter\StripTags())
|
|
||||||
->attach(new Filter\StringTrim())
|
|
||||||
->attach(new Filter\StringToLower())
|
|
||||||
->attach(new Validation\SluggerFilter());
|
->attach(new Validation\SluggerFilter());
|
||||||
$this->add($tags);
|
$this->add($tags);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user