mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Ensured uniqueness on imported short URLs short code
This commit is contained in:
@@ -135,8 +135,8 @@ class ShortUrl extends AbstractEntity
|
||||
*/
|
||||
public function regenerateShortCode(): self
|
||||
{
|
||||
// In ShortUrls where a custom slug was provided, do nothing
|
||||
if ($this->customSlugWasProvided) {
|
||||
// In ShortUrls where a custom slug was provided, throw error, unless it is an imported one
|
||||
if ($this->customSlugWasProvided && $this->importSource === null) {
|
||||
throw ShortCodeCannotBeRegeneratedException::forShortUrlWithCustomSlug();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user