@@ -2069,8 +2069,7 @@ discard block |
||
| 2069 | 2069 | // Champ joker * des iterateurs DATA qui accepte tout |
| 2070 | 2070 | if (@array_key_exists('*', $desc['field'])) { |
| 2071 | 2071 | $desc['field'][$col_vraie ?: $col] = ''; // on veut pas de cast INT par defaut car le type peut etre n'importe quoi dans les boucles DATA |
| 2072 | - } |
|
| 2073 | - else { |
|
| 2072 | + } else { |
|
| 2074 | 2073 | $r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table); |
| 2075 | 2074 | if (!$r) { |
| 2076 | 2075 | return ''; |
@@ -2112,8 +2111,7 @@ discard block |
||
| 2112 | 2111 | . ((isset($r[2]) && $r[2]) ? $r[2] : ",''") |
| 2113 | 2112 | . ",'" . addslashes($type_cast_quote) . "'"; |
| 2114 | 2113 | $val[0] = "sql_quote($r)"; |
| 2115 | - } |
|
| 2116 | - elseif ( |
|
| 2114 | + } elseif ( |
|
| 2117 | 2115 | str_contains($val[0], '@@defaultcast@@') |
| 2118 | 2116 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2119 | 2117 | ) { |
@@ -282,8 +282,7 @@ discard block |
||
| 282 | 282 | if ($ids) { |
| 283 | 283 | $ids = array_column($ids, 'id_objet'); |
| 284 | 284 | return implode(',', $ids); |
| 285 | - } |
|
| 286 | - else { |
|
| 285 | + } else { |
|
| 287 | 286 | return '0'; |
| 288 | 287 | } |
| 289 | 288 | } |
@@ -651,8 +650,7 @@ discard block |
||
| 651 | 650 | $logo_bg = timestamp($logo_bg); |
| 652 | 651 | $styles .= ".page_login, .page_spip_pass {background-image:url($logo_bg), url($logo_mini);}\n"; |
| 653 | 652 | $Pile[0]['body_class'] = 'fond_image'; |
| 654 | - } |
|
| 655 | - else { |
|
| 653 | + } else { |
|
| 656 | 654 | $Pile[0]['body_class'] = 'sans_fond'; |
| 657 | 655 | } |
| 658 | 656 | if ($styles) { |
@@ -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); |