Add cache busters also to images used by templates (#6610)

pull/6612/head
Aleksander Machniak 5 years ago
parent 9fe46a4a9a
commit c66199ffd2

@ -13,6 +13,7 @@ CHANGELOG Roundcube Webmail
- Prevent from using deprecated timezone names from jsTimezoneDetect
- Force session.gc_probability=1 when using custom session handlers (#6560)
- Support simple field labels (e.g. LetterHub examples) in csv imports (#6541)
- Add cache busters also to images used by templates (#6610)
- Plugin API: Added 'raise_error' hook (#6199)
- Plugin API: Added 'common_headers' hook (#6385)
- Plugin API: Added 'ldap_connected' hook

@ -888,13 +888,12 @@ EOF;
}
/**
* Correct absolute paths in images and other tags
* add timestamp to .js and .css filename
* Correct absolute paths in images and other tags (add cache busters)
*/
protected function fix_paths($output)
{
return preg_replace_callback(
'!(src|href|background)=(["\']?)([a-z0-9/_.-]+)(["\'\s>])!i',
'!(src|href|background|data-src-[a-z]+)=(["\']?)([a-z0-9/_.-]+)(["\'\s>])!i',
array($this, 'file_callback'), $output);
}
@ -915,7 +914,7 @@ EOF;
}
// add file modification timestamp
if (preg_match('/\.(js|css)$/', $file, $m)) {
if (preg_match('/\.(js|css|less|ico|png|svg|jpeg)$/', $file, $m)) {
$file = $this->file_mod($file);
}

Loading…
Cancel
Save