@@ -379,8 +379,7 @@ |
||
| 379 | 379 | function executer_balise_dynamique_dans_un_modele(...$args) { |
| 380 | 380 | if (test_espace_prive()) { |
| 381 | 381 | return executer_balise_dynamique(...$args); |
| 382 | - } |
|
| 383 | - else { |
|
| 382 | + } else { |
|
| 384 | 383 | $str_args = base64_encode(serialize($args)); |
| 385 | 384 | return '<?' . "php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?" . ">\n"; |
| 386 | 385 | } |
@@ -798,8 +798,7 @@ discard block |
||
| 798 | 798 | function public_compte_ligne($texte, $debut = 0, $fin = null) { |
| 799 | 799 | if (is_null($fin)) { |
| 800 | 800 | return substr_count($texte, "\n", $debut); |
| 801 | - } |
|
| 802 | - else { |
|
| 801 | + } else { |
|
| 803 | 802 | return substr_count($texte, "\n", $debut, $fin - $debut); |
| 804 | 803 | } |
| 805 | 804 | } |
@@ -846,8 +845,7 @@ discard block |
||
| 846 | 845 | erreur_squelette($err_b, $result); |
| 847 | 846 | |
| 848 | 847 | continue; |
| 849 | - } |
|
| 850 | - else { |
|
| 848 | + } else { |
|
| 851 | 849 | $boucle = [ |
| 852 | 850 | 'id_boucle' => $id_boucle, |
| 853 | 851 | 'id_boucle_err' => $id_boucle, |
@@ -987,8 +985,7 @@ discard block |
||
| 987 | 985 | // si c'est un appel pour memoriser une boucle, memorisons la |
| 988 | 986 | if (is_string($champ) && !empty($boucle_placeholder) && !empty($boucle)) { |
| 989 | 987 | $boucles_connues[$boucle_placeholder][$champ] = &$boucle; |
| 990 | - } |
|
| 991 | - else { |
|
| 988 | + } else { |
|
| 992 | 989 | if (!empty($champ->nom_champ) && !empty($boucles_connues[$champ->nom_champ])) { |
| 993 | 990 | $placeholder = $champ->nom_champ; |
| 994 | 991 | $id = reset($champ->param[0][1]); |
@@ -1131,8 +1128,7 @@ discard block |
||
| 1131 | 1128 | ]; |
| 1132 | 1129 | erreur_squelette($err_b, $result); |
| 1133 | 1130 | $pos_courante += strlen($fin_boucle); |
| 1134 | - } |
|
| 1135 | - else { |
|
| 1131 | + } else { |
|
| 1136 | 1132 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1137 | 1133 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1138 | 1134 | $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
@@ -18,15 +18,13 @@ discard block |
||
| 18 | 18 | if ($trace === '?' || defined('_DEBUG_TRACE_QUERIES')) { |
| 19 | 19 | if (defined('_DEBUG_TRACE_QUERIES') && _DEBUG_TRACE_QUERIES) { |
| 20 | 20 | $trace = true; |
| 21 | - } |
|
| 22 | - else { |
|
| 21 | + } else { |
|
| 23 | 22 | if (empty($GLOBALS['visiteur_session'])) { |
| 24 | 23 | // si un anonyme fait un var_profile on est oblige de remplir le tableau des temps en attendant de savoir |
| 25 | 24 | // car ici on ne sait pas si c'est un hit anonyme |
| 26 | 25 | // ou une requete SQL faite avant chargement de la session |
| 27 | 26 | $trace = (empty($_GET['var_profile']) ? false : '?'); |
| 28 | - } |
|
| 29 | - else { |
|
| 27 | + } else { |
|
| 30 | 28 | include_spip('inc/autoriser'); |
| 31 | 29 | // gare au bouclage sur calcul de droits au premier appel |
| 32 | 30 | // A fortiori quand on demande une trace |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | // car ici on ne sait pas si c'est un hit anonyme |
| 48 | 46 | // ou une requete SQL faite avant chargement de la session |
| 49 | 47 | $trace = (empty($_GET['var_profile']) ? false : '?'); |
| 50 | - } |
|
| 51 | - else { |
|
| 48 | + } else { |
|
| 52 | 49 | include_spip('inc/autoriser'); |
| 53 | 50 | // gare au bouclage sur calcul de droits au premier appel |
| 54 | 51 | // A fortiori quand on demande une trace |
@@ -87,8 +87,7 @@ discard block |
||
| 87 | 87 | if (!isset($GLOBALS['db_ok'])) { |
| 88 | 88 | spip_log("spip_connect: fichier de connexion '$f' OK mais echec connexion au serveur", _LOG_HS); |
| 89 | 89 | } |
| 90 | - } |
|
| 91 | - else { |
|
| 90 | + } else { |
|
| 92 | 91 | spip_log("spip_connect: fichier de connexion '$f' non trouve, pas de connexion serveur", _LOG_HS); |
| 93 | 92 | } |
| 94 | 93 | if (!isset($GLOBALS['db_ok'])) { |
@@ -453,8 +452,7 @@ discard block |
||
| 453 | 452 | && strpos($query_echappees, $part . $next, $currentpos) === $nextpos |
| 454 | 453 | ) { |
| 455 | 454 | $part .= array_shift($textes); |
| 456 | - } |
|
| 457 | - else { |
|
| 455 | + } else { |
|
| 458 | 456 | break; |
| 459 | 457 | } |
| 460 | 458 | } |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | if (!is_array($id_ou_options)) { |
| 80 | 80 | $options = ['id' => (int) $id_ou_options]; |
| 81 | 81 | $id = $options['id']; |
| 82 | - }else { |
|
| 82 | + } else { |
|
| 83 | 83 | $options = $id_ou_options; |
| 84 | 84 | $id = (int) ($id_ou_options['id'] ?? 0); |
| 85 | 85 | } |
@@ -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 | } |