Ensured custom slugs are case sensitive

This commit is contained in:
Alejandro Celaya
2018-12-01 21:38:29 +01:00
parent aa413dab6d
commit d7e89ebdae
5 changed files with 95 additions and 39 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Options;
use Zend\Stdlib\AbstractOptions;
class UrlShortenerOptions extends AbstractOptions
{
public const DEFAULT_CHARS = '123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ';
// phpcs:disable
protected $__strictMode__ = false;
// phpcs:enable
private $shortcodeChars = self::DEFAULT_CHARS;
private $validateUrl = true;
public function getChars(): string
{
return $this->shortcodeChars;
}
protected function setShortcodeChars(string $shortcodeChars): self
{
$this->shortcodeChars = empty($shortcodeChars) ? self::DEFAULT_CHARS : $shortcodeChars;
return $this;
}
public function isUrlValidationEnabled(): bool
{
return $this->validateUrl;
}
protected function setValidateUrl($validateUrl): self
{
$this->validateUrl = (bool) $validateUrl;
return $this;
}
}