mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Ensured custom slugs are case sensitive
This commit is contained in:
40
module/Core/src/Options/UrlShortenerOptions.php
Normal file
40
module/Core/src/Options/UrlShortenerOptions.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user