Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] QR Code is showing wrong url on scan #110

Closed
erdmenchen opened this issue Aug 4, 2021 · 2 comments
Closed

[Bug] QR Code is showing wrong url on scan #110

erdmenchen opened this issue Aug 4, 2021 · 2 comments

Comments

@erdmenchen
Copy link

Describe the bug
When trying to scan a QR code of a shortened url, it points to e.g. https://localhost/1 and not the real shortened url.

To Reproduce
Just try to open any generated QR code with current state of main branch.

Expected behavior
QR code should point to the shortened url.

Additional context
Bug is in App\Http\Controllers\QRCodeController, it uses the wrong parameter for $url:

$qrCode = QrCode::format($format)->size(300)->generate(route('click', $url));

should be

$qrCode = QrCode::format($format)->size(300)->generate(route('click', $url->short_url));

Source:

$qrCode = QrCode::format($format)->size(300)->generate(route('click', $url));

@erdmenchen
Copy link
Author

erdmenchen commented Aug 4, 2021

Same in Admin UI in QR-Code modal:

<img class="w-100" src="{{ route('qrcode.svg', $url) }}">

EDIT:
It should be changed here, because the modal is also called from within the analytics page with only the short-url, not the whole url-object:

@include('url.partials.qrcodemodal', ['url' => $data['url']])

Should be:

@include('url.partials.qrcodemodal', ['url' => $data['url']->short_url])

@optiroot
Copy link
Member

Thank you so much for your help.

Fix implemented in next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants