From 134b3dfa5cd8e8e5ce3f10912b58afecc4f118e0 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 26 Jun 2025 13:07:42 +0300 Subject: [PATCH] fix(redirect): add no-cache headers to prevent browser caching of redirects (#2010) --- library/includes/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/includes/functions.php b/library/includes/functions.php index 948208667..dde48be28 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -1450,6 +1450,9 @@ function redirect($url) $redirect_url = $server_protocol . $server_name . $server_port . $script_name . preg_replace('#^\/?(.*?)\/?$#', '/\1', $url); + // Send no-cache headers to prevent browsers from caching redirects + send_no_cache_headers(); + // Behave as per HTTP/1.1 spec for others header('Location: ' . $redirect_url, response_code: 301); exit;