Use FTL-provided fileversion() function

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-02-01 22:39:43 +01:00
parent 8ddebe8f14
commit afd08593dd
-14
View File
@@ -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)