From 7f1aee47b4006b5e0ff8f97893cd68863b2ec198 Mon Sep 17 00:00:00 2001
From: Julian Prieber
Date: Thu, 11 May 2023 14:31:04 +0200
Subject: [PATCH] Bugfix
https://github.com/LinkStackOrg/LinkStack/issues/425
---
resources/views/layouts/sidebar.blade.php | 41 +++++++----------------
1 file changed, 12 insertions(+), 29 deletions(-)
diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php
index 8a42b21..9b33da3 100755
--- a/resources/views/layouts/sidebar.blade.php
+++ b/resources/views/layouts/sidebar.blade.php
@@ -314,25 +314,6 @@ $usrhandl = Auth::user()->littlelink_name;
- {{--
-
-
- --}}
@@ -701,23 +682,25 @@ $usrhandl = Auth::user()->littlelink_name;
@php
- $qrCodeData = url('@'.Auth::user()->littlelink_name);
+ try {
+ $qrCodeData = url('@'.Auth::user()->littlelink_name);
- $renderer = new ImageRenderer(
- new RendererStyle(400),
- new SvgImageBackEnd()
- );
- $writer = new Writer($renderer);
+ $renderer = new ImageRenderer(
+ new RendererStyle(400),
+ new SvgImageBackEnd()
+ );
+ $writer = new Writer($renderer);
- $svgImageData = $writer->writeString($qrCodeData);
+ $svgImageData = $writer->writeString($qrCodeData);
- $svgImageBase64 = base64_encode($svgImageData);
+ $svgImageBase64 = base64_encode($svgImageData);
- $imgSrc = 'data:image/svg+xml;base64,' . $svgImageBase64;
+ $imgSrc = 'data:image/svg+xml;base64,' . $svgImageBase64;
+ } catch(exception $e) {echo 'QR code could not be generated
'; if(auth()->user()->role == 'admin'){echo "Reason:
".$e->getMessage()."
";}}
@endphp
-
+