mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-04 04:30:40 -06:00
Ensured domain is taken into account when generating QR codes
This commit is contained in:
parent
6d366188c9
commit
cd6f067fe5
@ -59,8 +59,10 @@ class QrCodeAction implements MiddlewareInterface
|
||||
{
|
||||
// Make sure the short URL exists for this short code
|
||||
$shortCode = $request->getAttribute('shortCode');
|
||||
$domain = $request->getUri()->getAuthority();
|
||||
|
||||
try {
|
||||
$this->urlShortener->shortCodeToUrl($shortCode);
|
||||
$this->urlShortener->shortCodeToUrl($shortCode, $domain);
|
||||
} catch (InvalidShortCodeException | EntityDoesNotExistException $e) {
|
||||
$this->logger->warning('An error occurred while creating QR code. {e}', ['e' => $e]);
|
||||
return $this->buildErrorResponse($request, $handler);
|
||||
|
@ -152,6 +152,7 @@ class UrlShortener implements UrlShortenerInterface
|
||||
if ($shortUrl === null) {
|
||||
throw EntityDoesNotExistException::createFromEntityAndConditions(ShortUrl::class, [
|
||||
'shortCode' => $shortCode,
|
||||
'domain' => $domain,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user