@@ -615,8 +615,7 @@ discard block |
||
| 615 | 615 | if (!$srcSize) { |
| 616 | 616 | $poids_img[$src] = filesize($src); |
| 617 | 617 | } |
| 618 | - } |
|
| 619 | - elseif (str_contains($src, '<svg')) { |
|
| 618 | + } elseif (str_contains($src, '<svg')) { |
|
| 620 | 619 | include_spip('inc/svg'); |
| 621 | 620 | if ($attrs = svg_lire_attributs($src)) { |
| 622 | 621 | [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
@@ -3420,8 +3419,7 @@ discard block |
||
| 3420 | 3419 | } |
| 3421 | 3420 | if (!isset($options['chemin_image']) || $options['chemin_image'] == true) { |
| 3422 | 3421 | $img_file = chemin_image($img); |
| 3423 | - } |
|
| 3424 | - else { |
|
| 3422 | + } else { |
|
| 3425 | 3423 | if (!isset($options['variante_svg_si_possible']) || $options['variante_svg_si_possible'] == true) { |
| 3426 | 3424 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3427 | 3425 | } |
@@ -3448,11 +3446,9 @@ discard block |
||
| 3448 | 3446 | } |
| 3449 | 3447 | if ($alt === false) { |
| 3450 | 3448 | $alt = ''; |
| 3451 | - } |
|
| 3452 | - elseif ($alt || $alt === '') { |
|
| 3449 | + } elseif ($alt || $alt === '') { |
|
| 3453 | 3450 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3454 | - } |
|
| 3455 | - else { |
|
| 3451 | + } else { |
|
| 3456 | 3452 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3457 | 3453 | } |
| 3458 | 3454 | return "<img src='" . attribut_html($img_file) . "'$alt" |
@@ -3579,8 +3575,7 @@ discard block |
||
| 3579 | 3575 | if (!is_null($class)) { |
| 3580 | 3576 | $img = strlen($class) ? inserer_attribut($img, 'class', $class) : vider_attribut($img, 'class'); |
| 3581 | 3577 | } |
| 3582 | - } |
|
| 3583 | - else { |
|
| 3578 | + } else { |
|
| 3584 | 3579 | $img = http_img_pack( |
| 3585 | 3580 | $img, |
| 3586 | 3581 | $alt, |
@@ -3688,8 +3683,7 @@ discard block |
||
| 3688 | 3683 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3689 | 3684 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3690 | 3685 | $balise_svg .= $title; |
| 3691 | - } |
|
| 3692 | - else { |
|
| 3686 | + } else { |
|
| 3693 | 3687 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3694 | 3688 | } |
| 3695 | 3689 | |
@@ -5080,8 +5074,7 @@ discard block |
||
| 5080 | 5074 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5081 | 5075 | if (isset($options['hash_on_content']) && $options['hash_on_content']) { |
| 5082 | 5076 | $hash = md5($contexte_implicite['host'] . '::' . $cache); |
| 5083 | - } |
|
| 5084 | - else { |
|
| 5077 | + } else { |
|
| 5085 | 5078 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5086 | 5079 | ksort($contexte); |
| 5087 | 5080 | $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
@@ -160,8 +160,7 @@ |
||
| 160 | 160 | $type = objet_type($type); |
| 161 | 161 | $id = (int) $ref; |
| 162 | 162 | $ref = $type . $ref; |
| 163 | - } |
|
| 164 | - else { |
|
| 163 | + } else { |
|
| 165 | 164 | // Si la référence ne correspond à rien, c'est fini |
| 166 | 165 | if (!($match = typer_raccourci($ref))) { |
| 167 | 166 | return json_export(false); |
@@ -83,8 +83,7 @@ discard block |
||
| 83 | 83 | . '</code>' |
| 84 | 84 | . '</pre>' |
| 85 | 85 | . '</div>'; |
| 86 | - } |
|
| 87 | - else { |
|
| 86 | + } else { |
|
| 88 | 87 | $echap = str_replace("\t", ' ', $echap); |
| 89 | 88 | $echap = str_replace(' ', ' ', $echap); |
| 90 | 89 | $html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>'; |
@@ -608,8 +607,7 @@ discard block |
||
| 608 | 607 | $collecteurLiens = $collecteurModeles = null; |
| 609 | 608 | if (!empty($options['expanser_liens'])) { |
| 610 | 609 | $texte = expanser_liens($texte, $env['connect'] ?? '', $env['env'] ?? []); |
| 611 | - } |
|
| 612 | - else { |
|
| 610 | + } else { |
|
| 613 | 611 | include_spip('src/Texte/Collecteur/AbstractCollecteur'); |
| 614 | 612 | include_spip('src/Texte/Collecteur/Liens'); |
| 615 | 613 | include_spip('src/Texte/Collecteur/Modeles'); |
@@ -537,8 +537,7 @@ discard block |
||
| 537 | 537 | process_image_svg_identite($ret); |
| 538 | 538 | $ret['creer'] = false; |
| 539 | 539 | } |
| 540 | - } |
|
| 541 | - else { |
|
| 540 | + } else { |
|
| 542 | 541 | if (!function_exists($ret['fonction_imagecreatefrom'])) { |
| 543 | 542 | return false; |
| 544 | 543 | } |
@@ -1356,9 +1355,7 @@ discard block |
||
| 1356 | 1355 | if ($srcWidth && $srcWidth <= $maxWidth && $srcHeight <= $maxHeight) { |
| 1357 | 1356 | $vignette = $destination . '.' . $format; |
| 1358 | 1357 | @copy($image, $vignette); |
| 1359 | - } |
|
| 1360 | - |
|
| 1361 | - elseif ($valeurs['format_source'] === 'svg') { |
|
| 1358 | + } elseif ($valeurs['format_source'] === 'svg') { |
|
| 1362 | 1359 | include_spip('inc/svg'); |
| 1363 | 1360 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1364 | 1361 | $format_sortie = 'svg'; |
@@ -1793,8 +1790,7 @@ discard block |
||
| 1793 | 1790 | $date = test_espace_prive() ? ('?' . $date) : ''; |
| 1794 | 1791 | |
| 1795 | 1792 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1796 | - } |
|
| 1797 | - else { |
|
| 1793 | + } else { |
|
| 1798 | 1794 | # BMP, tiff ... les redacteurs osent tout! |
| 1799 | 1795 | return $img; |
| 1800 | 1796 | } |
@@ -164,8 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ($start === false || $start === 'end') { |
| 166 | 166 | $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
| 167 | - } |
|
| 168 | - else { |
|
| 167 | + } else { |
|
| 169 | 168 | $p = stripos($svg, '<svg'); |
| 170 | 169 | $p = strpos($svg, '>', $p); |
| 171 | 170 | $svg = substr_replace($svg, $shapes, $p + 1, 0); |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | if (str_starts_with($couleur, 'rgb(')) { |
| 225 | 224 | $c = explode(',', substr($couleur, 4)); |
| 226 | 225 | $couleur = _couleur_dec_to_hex((int) $c[0], (int) $c[1], (int) $c[2]); |
| 227 | - } |
|
| 228 | - else { |
|
| 226 | + } else { |
|
| 229 | 227 | $couleur = couleur_html_to_hex($couleur); |
| 230 | 228 | } |
| 231 | 229 | return '#' . ltrim($couleur, '#'); |
@@ -281,17 +279,14 @@ discard block |
||
| 281 | 279 | // si pas de height valide, on suppose l'image carree |
| 282 | 280 | $viewBox[3] = $width; |
| 283 | 281 | } |
| 284 | - } |
|
| 285 | - else { |
|
| 282 | + } else { |
|
| 286 | 283 | // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
| 287 | 284 | $width = $viewBox[2]; |
| 288 | 285 | if ($width < 1) { |
| 289 | 286 | $coeff = max($coeff, 1000); |
| 290 | - } |
|
| 291 | - elseif ($width < 10) { |
|
| 287 | + } elseif ($width < 10) { |
|
| 292 | 288 | $coeff = max($coeff, 100); |
| 293 | - } |
|
| 294 | - elseif ($width < 100) { |
|
| 289 | + } elseif ($width < 100) { |
|
| 295 | 290 | $coeff = max($coeff, 10); |
| 296 | 291 | } |
| 297 | 292 | } |
@@ -304,16 +299,13 @@ discard block |
||
| 304 | 299 | if (empty($attributs['viewBox'])) { |
| 305 | 300 | $viewBox[3] = $height; |
| 306 | 301 | } |
| 307 | - } |
|
| 308 | - else { |
|
| 302 | + } else { |
|
| 309 | 303 | $height = $viewBox[3]; |
| 310 | 304 | if ($height < 1) { |
| 311 | 305 | $coeff = max($coeff, 1000); |
| 312 | - } |
|
| 313 | - elseif ($height < 10) { |
|
| 306 | + } elseif ($height < 10) { |
|
| 314 | 307 | $coeff = max($coeff, 100); |
| 315 | - } |
|
| 316 | - elseif ($height < 100) { |
|
| 308 | + } elseif ($height < 100) { |
|
| 317 | 309 | $coeff = max($coeff, 10); |
| 318 | 310 | } |
| 319 | 311 | } |
@@ -454,8 +446,7 @@ discard block |
||
| 454 | 446 | if (isset($attributs['viewBox'])) { |
| 455 | 447 | $viewBox = explode(' ', $attributs['viewBox']); |
| 456 | 448 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
| 457 | - } |
|
| 458 | - else { |
|
| 449 | + } else { |
|
| 459 | 450 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 460 | 451 | } |
| 461 | 452 | $svg = svg_insert_shapes($svg, $rect); |
@@ -484,8 +475,7 @@ discard block |
||
| 484 | 475 | if (isset($attributs['viewBox'])) { |
| 485 | 476 | $viewBox = explode(' ', $attributs['viewBox']); |
| 486 | 477 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 487 | - } |
|
| 488 | - else { |
|
| 478 | + } else { |
|
| 489 | 479 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 490 | 480 | } |
| 491 | 481 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -606,8 +596,7 @@ discard block |
||
| 606 | 596 | $x = (int) $viewBox[0] + (int) ($viewBox[2] / 2); |
| 607 | 597 | $mx = -$x; |
| 608 | 598 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 609 | - } |
|
| 610 | - else { |
|
| 599 | + } else { |
|
| 611 | 600 | $transform = 'scale(1,-1)'; |
| 612 | 601 | |
| 613 | 602 | $y = (int) $viewBox[1] + (int) ($viewBox[3] / 2); |
@@ -666,8 +655,7 @@ discard block |
||
| 666 | 655 | $c = array_shift($colors); |
| 667 | 656 | if (strlen($c) == 4) { |
| 668 | 657 | $short[] = $c; |
| 669 | - } |
|
| 670 | - else { |
|
| 658 | + } else { |
|
| 671 | 659 | $long[] = $c; |
| 672 | 660 | } |
| 673 | 661 | } |
@@ -114,11 +114,9 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | if ($statut && test_espace_prive()) { |
| 116 | 116 | $footer = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil')); |
| 117 | - } |
|
| 118 | - elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 117 | + } elseif (!empty($_COOKIE['spip_admin'])) { |
|
| 119 | 118 | $footer = bouton_action(_T('public:lien_connecter'), generer_url_public('login')); |
| 120 | - } |
|
| 121 | - else { |
|
| 119 | + } else { |
|
| 122 | 120 | $footer = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site'] ?? ''); |
| 123 | 121 | } |
| 124 | 122 | |
@@ -130,12 +128,10 @@ discard block |
||
| 130 | 128 | . $titre |
| 131 | 129 | . '</div>'; |
| 132 | 130 | $options['titre'] = ''; |
| 133 | - } |
|
| 134 | - else { |
|
| 131 | + } else { |
|
| 135 | 132 | $options['titre'] = $titre; |
| 136 | 133 | } |
| 137 | - } |
|
| 138 | - else { |
|
| 134 | + } else { |
|
| 139 | 135 | $options['titre'] = $titre; |
| 140 | 136 | } |
| 141 | 137 | $options['page_title'] = $titre; |