mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-08 08:13:11 +08:00
Added validateUrl optional flag for create/edit short URLs
This commit is contained in:
@@ -27,6 +27,7 @@ class ShortUrlMetaInputFilter extends InputFilter
|
||||
public const DOMAIN = 'domain';
|
||||
public const SHORT_CODE_LENGTH = 'shortCodeLength';
|
||||
public const LONG_URL = 'longUrl';
|
||||
public const VALIDATE_URL = 'validateUrl';
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
@@ -64,6 +65,8 @@ class ShortUrlMetaInputFilter extends InputFilter
|
||||
|
||||
$this->add($this->createBooleanInput(self::FIND_IF_EXISTS, false));
|
||||
|
||||
$this->add($this->createInput(self::VALIDATE_URL, false));
|
||||
|
||||
$domain = $this->createInput(self::DOMAIN, false);
|
||||
$domain->getValidatorChain()->attach(new Validation\HostAndPortValidator());
|
||||
$this->add($domain);
|
||||
|
||||
Reference in New Issue
Block a user