@@ -205,8 +205,7 @@ |
||
| 205 | 205 | // Marie Toto <[email protected]> => @toto.com |
| 206 | 206 | if (preg_match('/@[^\s>]+/', $from, $domain)) { |
| 207 | 207 | $domain = $domain[0]; |
| 208 | - } |
|
| 209 | - else { |
|
| 208 | + } else { |
|
| 210 | 209 | $domain = '@unknown-' . md5($from) . '.org'; |
| 211 | 210 | } |
| 212 | 211 | $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
@@ -553,16 +553,14 @@ |
||
| 553 | 553 | if (stripos($suite, 'SELECT') !== false) { |
| 554 | 554 | if ($echappe_textes) { |
| 555 | 555 | [$suite_echap, $textes] = query_echappe_textes($suite); |
| 556 | - } |
|
| 557 | - else { |
|
| 556 | + } else { |
|
| 558 | 557 | $suite_echap = $suite; |
| 559 | 558 | } |
| 560 | 559 | if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) { |
| 561 | 560 | $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false); |
| 562 | 561 | if ($echappe_textes) { |
| 563 | 562 | $suite = query_reinjecte_textes($suite_echap, $textes); |
| 564 | - } |
|
| 565 | - else { |
|
| 563 | + } else { |
|
| 566 | 564 | $suite = $suite_echap; |
| 567 | 565 | } |
| 568 | 566 | } |
@@ -640,8 +640,7 @@ discard block |
||
| 640 | 640 | if (!$srcSize){ |
| 641 | 641 | $poids_img[$src] = filesize($src); |
| 642 | 642 | } |
| 643 | - } |
|
| 644 | - elseif (strpos($src, '<svg') !== false) { |
|
| 643 | + } elseif (strpos($src, '<svg') !== false) { |
|
| 645 | 644 | include_spip('inc/svg'); |
| 646 | 645 | if ($attrs = svg_lire_attributs($src)) { |
| 647 | 646 | [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
@@ -3497,8 +3496,7 @@ discard block |
||
| 3497 | 3496 | ) { |
| 3498 | 3497 | if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
| 3499 | 3498 | $img_file = $variante_svg_size; |
| 3500 | - } |
|
| 3501 | - else { |
|
| 3499 | + } else { |
|
| 3502 | 3500 | $img_file = $variante_svg_generique; |
| 3503 | 3501 | } |
| 3504 | 3502 | } |
@@ -3530,8 +3528,7 @@ discard block |
||
| 3530 | 3528 | } |
| 3531 | 3529 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3532 | 3530 | $img_file = chemin_image($img); |
| 3533 | - } |
|
| 3534 | - else { |
|
| 3531 | + } else { |
|
| 3535 | 3532 | if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
| 3536 | 3533 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3537 | 3534 | } |
@@ -3561,11 +3558,9 @@ discard block |
||
| 3561 | 3558 | } |
| 3562 | 3559 | if ($alt === false) { |
| 3563 | 3560 | $alt = ''; |
| 3564 | - } |
|
| 3565 | - elseif ($alt or $alt === '') { |
|
| 3561 | + } elseif ($alt or $alt === '') { |
|
| 3566 | 3562 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3567 | - } |
|
| 3568 | - else { |
|
| 3563 | + } else { |
|
| 3569 | 3564 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3570 | 3565 | } |
| 3571 | 3566 | return "<img src='$img_file'$alt" |
@@ -3692,13 +3687,11 @@ discard block |
||
| 3692 | 3687 | if (!is_null($class)) { |
| 3693 | 3688 | if (strlen($class)) { |
| 3694 | 3689 | $img = inserer_attribut($img, 'class', $class); |
| 3695 | - } |
|
| 3696 | - else { |
|
| 3690 | + } else { |
|
| 3697 | 3691 | $img = vider_attribut($img, 'class'); |
| 3698 | 3692 | } |
| 3699 | 3693 | } |
| 3700 | - } |
|
| 3701 | - else { |
|
| 3694 | + } else { |
|
| 3702 | 3695 | $img = http_img_pack( |
| 3703 | 3696 | $img, |
| 3704 | 3697 | $alt, |
@@ -3796,8 +3789,7 @@ discard block |
||
| 3796 | 3789 | if (!is_null($class)) { |
| 3797 | 3790 | if (strlen($class)) { |
| 3798 | 3791 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3799 | - } |
|
| 3800 | - else { |
|
| 3792 | + } else { |
|
| 3801 | 3793 | $balise_svg = vider_attribut($balise_svg, 'class'); |
| 3802 | 3794 | } |
| 3803 | 3795 | } |
@@ -3809,8 +3801,7 @@ discard block |
||
| 3809 | 3801 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3810 | 3802 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3811 | 3803 | $balise_svg .= $title; |
| 3812 | - } |
|
| 3813 | - else { |
|
| 3804 | + } else { |
|
| 3814 | 3805 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3815 | 3806 | } |
| 3816 | 3807 | |
@@ -5218,8 +5209,7 @@ discard block |
||
| 5218 | 5209 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5219 | 5210 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5220 | 5211 | $hash = md5($contexte_implicite['host'] . '::' . $cache); |
| 5221 | - } |
|
| 5222 | - else { |
|
| 5212 | + } else { |
|
| 5223 | 5213 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5224 | 5214 | ksort($contexte); |
| 5225 | 5215 | $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
@@ -245,8 +245,7 @@ discard block |
||
| 245 | 245 | if (_request('login')) { |
| 246 | 246 | // on n'est jamais cense poster le name 'login' |
| 247 | 247 | $erreurs['login'] = _T('info_non_modifiable'); |
| 248 | - } |
|
| 249 | - elseif ( |
|
| 248 | + } elseif ( |
|
| 250 | 249 | ($login = _request('new_login')) and |
| 251 | 250 | $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)) |
| 252 | 251 | ) { |
@@ -483,8 +482,7 @@ discard block |
||
| 483 | 482 | if (!isset($contexte['lang']) or !$contexte['lang']) { |
| 484 | 483 | if (isset($row['lang']) and $row['lang']) { |
| 485 | 484 | $contexte['lang'] = $row['lang']; |
| 486 | - } |
|
| 487 | - else { |
|
| 485 | + } else { |
|
| 488 | 486 | $contexte['lang'] = $GLOBALS['meta']['langue_site']; |
| 489 | 487 | } |
| 490 | 488 | } |
@@ -445,8 +445,7 @@ |
||
| 445 | 445 | if (strpos($next, "'") === 0 |
| 446 | 446 | and strpos($query_echappees, $part . $next, $currentpos) === $nextpos) { |
| 447 | 447 | $part .= array_shift($textes); |
| 448 | - } |
|
| 449 | - else { |
|
| 448 | + } else { |
|
| 450 | 449 | break; |
| 451 | 450 | } |
| 452 | 451 | } |
@@ -2868,8 +2868,7 @@ |
||
| 2868 | 2868 | $_const = interprete_argument_balise(1, $p); |
| 2869 | 2869 | if (!strlen($_const ?? '')) { |
| 2870 | 2870 | $p->code = "''"; |
| 2871 | - } |
|
| 2872 | - else { |
|
| 2871 | + } else { |
|
| 2873 | 2872 | $p->code = "(defined($_const)?constant($_const):'')"; |
| 2874 | 2873 | } |
| 2875 | 2874 | $p->interdire_scripts = false; |
@@ -267,8 +267,7 @@ discard block |
||
| 267 | 267 | if ($id === '*') { |
| 268 | 268 | unset($GLOBALS['autoriser_exception'][$faire][$type]); |
| 269 | 269 | unset($autorisation[$faire][$type]); |
| 270 | - } |
|
| 271 | - else { |
|
| 270 | + } else { |
|
| 272 | 271 | unset($GLOBALS['autoriser_exception'][$faire][$type][$id]); |
| 273 | 272 | unset($autorisation[$faire][$type][$id]); |
| 274 | 273 | } |
@@ -652,8 +651,7 @@ discard block |
||
| 652 | 651 | function autoriser_rubrique_creer_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 653 | 652 | if (!empty($opt['id_parent'])) { |
| 654 | 653 | return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui); |
| 655 | - } |
|
| 656 | - else { |
|
| 654 | + } else { |
|
| 657 | 655 | return autoriser('defaut', null, 0, $qui, $opt); |
| 658 | 656 | } |
| 659 | 657 | } |
@@ -814,8 +812,7 @@ discard block |
||
| 814 | 812 | if (!empty($opt['id_parent'])) { |
| 815 | 813 | // creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi |
| 816 | 814 | return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui); |
| 817 | - } |
|
| 818 | - else { |
|
| 815 | + } else { |
|
| 819 | 816 | return (sql_countsel('spip_rubriques') > 0 and in_array($qui['statut'], ['0minirezo', '1comite'])); |
| 820 | 817 | } |
| 821 | 818 | } |