From e0dc1712cacb2bfa6be796d6d667ec7cae5553d8 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Fri, 15 May 2026 21:59:36 +0300 Subject: [PATCH] fix: use cache-busting 'verify_qr' route to bypass Varnish cache caching old 302 redirects --- app/modules_app/invoices/export_excel.php | 6 +++--- public/index.php | 2 +- public/shell.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/modules_app/invoices/export_excel.php b/app/modules_app/invoices/export_excel.php index 0759903..c411593 100644 --- a/app/modules_app/invoices/export_excel.php +++ b/app/modules_app/invoices/export_excel.php @@ -358,8 +358,8 @@ foreach ($invoices as $invIdx => $inv) { // --- Add Clickable Website Link --- // We'll move the link slightly down or put it in I1 with the QR - $sheet->setCellValue("I" . $invRow, 'musadaq.intaleqapp.com/verify'); - $verifyUrl = "https://musadaq.intaleqapp.com/index.php?route=verify&id=" . $inv['id']; + $sheet->setCellValue("I" . $invRow, 'musadaq.intaleqapp.com/verify_qr'); + $verifyUrl = "https://musadaq.intaleqapp.com/index.php?route=verify_qr&id=" . $inv['id']; $sheet->getCell("I" . $invRow)->getHyperlink()->setUrl($verifyUrl); $sheet->getStyle("I" . $invRow)->applyFromArray([ 'font' => ['color' => ['argb' => 'FFFFFFFF'], 'underline' => true, 'size' => 8], @@ -368,7 +368,7 @@ foreach ($invoices as $invIdx => $inv) { // --- Add Verification QR Code --- try { - $verifyUrl = "https://musadaq.intaleqapp.com/index.php?route=verify&id=" . $inv['id']; + $verifyUrl = "https://musadaq.intaleqapp.com/index.php?route=verify_qr&id=" . $inv['id']; $qrApiUrl = "https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=" . urlencode($verifyUrl); $qrData = $downloadUrl($qrApiUrl); if ($qrData) { diff --git a/public/index.php b/public/index.php index 362c1a3..0c1c78a 100644 --- a/public/index.php +++ b/public/index.php @@ -11,7 +11,7 @@ $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $route = $_GET['route'] ?? str_replace('/api/', '', $uri); $route = trim($route, '/'); -if ($route === 'verify' || $route === 'v.php' || $route === 'v1/verify') { +if ($route === 'verify_qr' || $route === 'verify' || $route === 'v.php' || $route === 'v1/verify') { $id = $_GET['id'] ?? null; require_once APP_PATH . '/modules_app/invoices/verify_public.php'; exit; diff --git a/public/shell.php b/public/shell.php index 9038e38..d237068 100644 --- a/public/shell.php +++ b/public/shell.php @@ -3039,7 +3039,7 @@ getQrSrc(inv) { if (!inv) return ''; if (inv.jofotara?.qr_image_uri) return inv.jofotara.qr_image_uri; - const verifyUrl = `https://musadaq.intaleqapp.com/index.php?route=verify&id=${inv.id}`; + const verifyUrl = `https://musadaq.intaleqapp.com/index.php?route=verify_qr&id=${inv.id}`; const qr = new QRious({ value: verifyUrl, size: 300, level: 'H' }); return qr.toDataURL(); },