diff --git a/lib/View.php b/lib/View.php index 0caa911d..958be833 100644 --- a/lib/View.php +++ b/lib/View.php @@ -69,10 +69,11 @@ class View { $sri = array_key_exists($file, $this->_variables['SRI']) ? ' integrity="' . $this->_variables['SRI'][$file] . '"' : ''; - $suffix = preg_match('#\d.js$#', $file) == 0 ? - '?' . rawurlencode($this->_variables['VERSION']) : ''; + // if the file isn't versioned (ends in a digit), add our own version + $cacheBuster = ctype_digit(substr($file, -4, 1)) ? + '' : '?' . rawurlencode($this->_variables['VERSION']); echo '', PHP_EOL; + $cacheBuster, '"', $sri, ' crossorigin="anonymous">', PHP_EOL; } } diff --git a/tst/Bootstrap.php b/tst/Bootstrap.php index c43e2b25..28b56422 100644 --- a/tst/Bootstrap.php +++ b/tst/Bootstrap.php @@ -1,7 +1,5 @@