lol
1From 8823e48b055b7e574c08069048ba21ffa4393699 Mon Sep 17 00:00:00 2001
2From: Daniel Fullmer <danielrf12@gmail.com>
3Date: Fri, 21 Feb 2020 21:52:00 -0500
4Subject: [PATCH] Don't use file timestamp in cache filename
5
6Every file in the nix store has a timestamp of "1", meaning that the
7filename would remain constant even when changing zoneminder versions.
8This would mean that newer versions would use the existing symlink to an
9older version of the source file. We replace SRC_HASH in nix with a
10hash of the source used to build zoneminder to ensure this filename is
11unique.
12---
13 web/includes/functions.php | 3 ++-
14 1 file changed, 2 insertions(+), 1 deletion(-)
15
16diff --git a/web/includes/functions.php b/web/includes/functions.php
17index 89d2cc8ad..52cbb6f38 100644
18--- a/web/includes/functions.php
19+++ b/web/includes/functions.php
20@@ -1941,7 +1941,8 @@ function cache_bust($file) {
21 $parts = pathinfo($file);
22 global $css;
23 $dirname = str_replace('/', '_', $parts['dirname']);
24- $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension'];
25+ $srcHash = '@srcHash@';
26+ $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.$srcHash.'.'.$parts['extension'];
27 if ( file_exists(ZM_DIR_CACHE.'/'.$cacheFile) or symlink(ZM_PATH_WEB.'/'.$file, ZM_DIR_CACHE.'/'.$cacheFile) ) {
28 return 'cache/'.$cacheFile;
29 } else {
30--
312.32.0