From afd08593dd18de2961d123eaca1da201e264baa9 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 1 Feb 2023 22:39:43 +0100 Subject: [PATCH] Use FTL-provided fileversion() function Signed-off-by: DL6ER --- scripts/pi-hole/php/func.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php index 3b7744e8..df128552 100644 --- a/scripts/pi-hole/php/func.php +++ b/scripts/pi-hole/php/func.php @@ -112,20 +112,6 @@ function checkfile($filename) return '/dev/null'; } -// Avoid browser caching old versions of a file, using the last modification time -// Receive the file URL (without "/admin/"); -// Return the string containin URL + "?v=xxx", where xxx is the last modified time of the file. -function fileversion($url) -{ - $filename = $_SERVER['DOCUMENT_ROOT'].'/admin/'.$url; - $ver = 0; // Default - if (file_exists($filename)) { - $ver = filemtime($filename); - } - - return $url.'?v='.$ver; -} - // Credit: http://php.net/manual/en/function.hash-equals.php#119576 if (!function_exists('hash_equals')) { function hash_equals($known_string, $user_string)