updating zlib to 1.3.2

This commit is contained in:
El RIDO 2026-04-03 18:15:54 +02:00
parent fa9968f8e7
commit 43a729b1f9
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
11 changed files with 75 additions and 55 deletions

View file

@ -125,7 +125,8 @@ class Configuration
'js/privatebin.js' => 'sha512-6SwOJniNN8RBmAK7yCt4ly2qYyH8OALxB74/K1AJgw+YnZgRCfTDVq1qY1K5Y2QCxCODGGTpAjTqQRExzCqV7g==',
'js/purify-3.3.2.js' => 'sha512-I6igPVpf3xNghG92mujwqB6Zi3LpUTsni4bRuLnMThEGH6BDbsumv7373+AXHzA4OUlxGsym8ZxKFHy4xjYvkQ==',
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
'js/zlib-1.3.1-2.js' => 'sha512-4gT+v+BkBqdVBbKOO4qKGOAzuay+v1FmOLksS+bMgQ08Oo4xEb3X48Xq1Kv2b4HtiCQA7xq9dFRzxal7jmQI7w==',
'js/zlib-1.3.2.mjs' => 'sha512-rv8vIHS886FB1BwNSDK2ePuAlQ2kjuCKyKfu6R6xrUaBW74XJwUkgBkYwb2Qo48JGcfenzJuJWnj7aunxXkyIw==',
'js/zlib.js' => 'sha512-WrCFRc7+7FdFDhN86LQ0g8GHzwhGIqPJ29NBGu2xM3cqkCC9GSMZf/24dhg6+iQs1xjcnWjandBFIOP7xCBUpg==',
),
);

View file

@ -62,6 +62,49 @@ class View
include $path;
}
/**
* get cache buster query string
*
* if the file isn't versioned (ends in a digit), adds our own version as a query string
*
* @access private
* @param string $file
*/
private function _getCacheBuster($file)
{
//
if ((bool) preg_match('#[0-9]\.m?js$#', (string) $file)) {
return '';
}
return '?' . rawurlencode($this->_variables['VERSION']);
}
/**
* get SRI hash for given file
*
* @access private
* @param string $file
*/
private function _getSri($file)
{
if (array_key_exists($file, $this->_variables['SRI'])) {
return ' integrity="' . $this->_variables['SRI'][$file] . '"';
}
return '';
}
/**
* echo module preload link tag incl. SRI hash for given script file
*
* @access private
* @param string $file
*/
private function _linkTag($file)
{
echo '<link rel="modulepreload" href="', $file,
$this->_getCacheBuster($file), '"', $this->_getSri($file), ' />', PHP_EOL;
}
/**
* echo script tag incl. SRI hash for given script file
*
@ -71,13 +114,9 @@ class View
*/
private function _scriptTag($file, $attributes = '')
{
$sri = array_key_exists($file, $this->_variables['SRI']) ?
' integrity="' . $this->_variables['SRI'][$file] . '"' : '';
// if the file isn't versioned (ends in a digit), add our own version
$cacheBuster = (bool) preg_match('#[0-9]\.js$#', (string) $file) ?
'' : '?' . rawurlencode($this->_variables['VERSION']);
echo '<script ', $attributes,
' type="text/javascript" data-cfasync="false" src="', $file,
$cacheBuster, '"', $sri, ' crossorigin="anonymous"></script>', PHP_EOL;
' type="text/javascript" data-cfasync="false" src="', $file,
$this->_getCacheBuster($file), '"', $this->_getSri($file),
' crossorigin="anonymous"></script>', PHP_EOL;
}
}