1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +02:00

Add cache buster to PWImageResizer.js URL per processwire/processwire-issues#1154

This commit is contained in:
Ryan Cramer
2022-04-29 08:59:21 -04:00
parent 15ae6b938d
commit e0b43606b3

View File

@@ -193,10 +193,11 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
// client side image resize
if(!$this->resizeServer && ($this->maxWidth || $this->maxHeight || $this->maxSize)) {
$moduleInfo = self::getModuleInfo();
$thisURL = $config->urls->InputfieldImage;
$jsExt = $config->debug ? "js" : "min.js";
$config->scripts->add($thisURL . "piexif.$jsExt");
$config->scripts->add($thisURL . "PWImageResizer.$jsExt");
$config->scripts->add($thisURL . "PWImageResizer.$jsExt?v=$moduleInfo[version]");
$maxSize = str_replace(',', '.', $this->maxSize);
$quality = str_replace(',', '.', (float) ($this->clientQuality / 100));
$this->wrapAttr('data-resize', "$this->maxWidth;$this->maxHeight;$maxSize;$quality");