@@ -648,8 +648,7 @@ discard block |
||
| 648 | 648 | if (!$srcSize) { |
| 649 | 649 | $poids_img[$src] = filesize($src); |
| 650 | 650 | } |
| 651 | - } |
|
| 652 | - elseif (strpos($src, '<svg') !== false) { |
|
| 651 | + } elseif (strpos($src, '<svg') !== false) { |
|
| 653 | 652 | include_spip('inc/svg'); |
| 654 | 653 | if ($attrs = svg_lire_attributs($src)) { |
| 655 | 654 | [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
@@ -3507,8 +3506,7 @@ discard block |
||
| 3507 | 3506 | ) { |
| 3508 | 3507 | if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
| 3509 | 3508 | $img_file = $variante_svg_size; |
| 3510 | - } |
|
| 3511 | - else { |
|
| 3509 | + } else { |
|
| 3512 | 3510 | $img_file = $variante_svg_generique; |
| 3513 | 3511 | } |
| 3514 | 3512 | } |
@@ -3540,8 +3538,7 @@ discard block |
||
| 3540 | 3538 | } |
| 3541 | 3539 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3542 | 3540 | $img_file = chemin_image($img); |
| 3543 | - } |
|
| 3544 | - else { |
|
| 3541 | + } else { |
|
| 3545 | 3542 | if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
| 3546 | 3543 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3547 | 3544 | } |
@@ -3571,11 +3568,9 @@ discard block |
||
| 3571 | 3568 | } |
| 3572 | 3569 | if ($alt === false) { |
| 3573 | 3570 | $alt = ''; |
| 3574 | - } |
|
| 3575 | - elseif ($alt or $alt === '') { |
|
| 3571 | + } elseif ($alt or $alt === '') { |
|
| 3576 | 3572 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3577 | - } |
|
| 3578 | - else { |
|
| 3573 | + } else { |
|
| 3579 | 3574 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3580 | 3575 | } |
| 3581 | 3576 | return "<img src='" . attribut_html($img_file) . "'$alt" |
@@ -3702,13 +3697,11 @@ discard block |
||
| 3702 | 3697 | if (!is_null($class)) { |
| 3703 | 3698 | if (strlen($class)) { |
| 3704 | 3699 | $img = inserer_attribut($img, 'class', $class); |
| 3705 | - } |
|
| 3706 | - else { |
|
| 3700 | + } else { |
|
| 3707 | 3701 | $img = vider_attribut($img, 'class'); |
| 3708 | 3702 | } |
| 3709 | 3703 | } |
| 3710 | - } |
|
| 3711 | - else { |
|
| 3704 | + } else { |
|
| 3712 | 3705 | $img = http_img_pack( |
| 3713 | 3706 | $img, |
| 3714 | 3707 | $alt, |
@@ -3806,8 +3799,7 @@ discard block |
||
| 3806 | 3799 | if (!is_null($class)) { |
| 3807 | 3800 | if (strlen($class)) { |
| 3808 | 3801 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3809 | - } |
|
| 3810 | - else { |
|
| 3802 | + } else { |
|
| 3811 | 3803 | $balise_svg = vider_attribut($balise_svg, 'class'); |
| 3812 | 3804 | } |
| 3813 | 3805 | } |
@@ -3819,8 +3811,7 @@ discard block |
||
| 3819 | 3811 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3820 | 3812 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3821 | 3813 | $balise_svg .= $title; |
| 3822 | - } |
|
| 3823 | - else { |
|
| 3814 | + } else { |
|
| 3824 | 3815 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3825 | 3816 | } |
| 3826 | 3817 | |
@@ -5231,8 +5222,7 @@ discard block |
||
| 5231 | 5222 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5232 | 5223 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5233 | 5224 | $hash = md5($contexte_implicite['host'] . '::' . $cache); |
| 5234 | - } |
|
| 5235 | - else { |
|
| 5225 | + } else { |
|
| 5236 | 5226 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5237 | 5227 | ksort($contexte); |
| 5238 | 5228 | $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |