diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php index f775d4b6ba6ce4bf9a23510b87562d41e2889160..b777f9cb630dcd8406fb240cf36f4756cd52c076 100644 --- a/ecrire/inc/filtres.php +++ b/ecrire/inc/filtres.php @@ -3300,7 +3300,11 @@ function charge_scripts($files, $script = true) { * @return string */ function http_img_pack($img, $alt, $atts = '', $title = '', $options = array()) { + $img_file = $img; + if ($p = strpos($img_file, '?')) { + $img_file = substr($img_file,0, $p); + } if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { $img_file = chemin_image($img); } @@ -3322,8 +3326,11 @@ function http_img_pack($img, $alt, $atts = '', $title = '', $options = array()) } if (stripos($atts, 'width') === false) { // utiliser directement l'info de taille presente dans le nom - if ((!isset($options['utiliser_suffixe_size']) or $options['utiliser_suffixe_size'] == true) - and preg_match(',-([0-9]+)[.](png|gif|svg)$,', $img, $regs) + if ((!isset($options['utiliser_suffixe_size']) + or $options['utiliser_suffixe_size'] == true + or strpos($img_file, '-xx.svg') !== false) + and (preg_match(',-([0-9]+)[.](png|gif|svg)$,', $img, $regs) + or preg_match(',\?([0-9]+)px$,', $img, $regs)) ) { $largeur = $hauteur = intval($regs[1]); } else { @@ -3336,6 +3343,9 @@ function http_img_pack($img, $alt, $atts = '', $title = '', $options = array()) $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; } + if (file_exists($img_file)) { + $img_file = timestamp($img_file); + } return "<img src='$img_file' alt='" . attribut_html($alt ? $alt : $title) . "'" . ($title ? ' title="' . attribut_html($title) . '"' : '') . " " . ltrim($atts) diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index 643109bd6109123edb8f834d481cdc43c72c761f..ccca18285cf5b6da113b9763e39eb96b7482d256 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -1394,7 +1394,7 @@ function find_in_theme($file, $subdir = '', $include = false) { return $themefiles["$subdir$file"] = $fsize; } else { - return $themefiles["$subdir$file"] = $f; + return $themefiles["$subdir$file"] = "$f?".$m[1]."px"; } } @@ -1431,6 +1431,9 @@ function find_in_theme($file, $subdir = '', $include = false) { **/ function chemin_image($icone) { static $icone_renommer; + if ($p = strpos($icone, '?')) { + $icone = substr($icone,0, $p); + } // gerer le cas d'un double appel en evitant de refaire le travail inutilement if (strpos($icone, "/") !== false and file_exists($icone)) { return $icone;