@@ -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 | } |
@@ -656,8 +656,7 @@ discard block |
||
| 656 | 656 | if (!$srcSize) { |
| 657 | 657 | $poids_img[$src] = filesize($src); |
| 658 | 658 | } |
| 659 | - } |
|
| 660 | - elseif (strpos($src, '<svg') !== false) { |
|
| 659 | + } elseif (strpos($src, '<svg') !== false) { |
|
| 661 | 660 | include_spip('inc/svg'); |
| 662 | 661 | if ($attrs = svg_lire_attributs($src)) { |
| 663 | 662 | [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
@@ -3513,8 +3512,7 @@ discard block |
||
| 3513 | 3512 | ) { |
| 3514 | 3513 | if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
| 3515 | 3514 | $img_file = $variante_svg_size; |
| 3516 | - } |
|
| 3517 | - else { |
|
| 3515 | + } else { |
|
| 3518 | 3516 | $img_file = $variante_svg_generique; |
| 3519 | 3517 | } |
| 3520 | 3518 | } |
@@ -3546,8 +3544,7 @@ discard block |
||
| 3546 | 3544 | } |
| 3547 | 3545 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3548 | 3546 | $img_file = chemin_image($img); |
| 3549 | - } |
|
| 3550 | - else { |
|
| 3547 | + } else { |
|
| 3551 | 3548 | if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
| 3552 | 3549 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3553 | 3550 | } |
@@ -3577,11 +3574,9 @@ discard block |
||
| 3577 | 3574 | } |
| 3578 | 3575 | if ($alt === false) { |
| 3579 | 3576 | $alt = ''; |
| 3580 | - } |
|
| 3581 | - elseif ($alt or $alt === '') { |
|
| 3577 | + } elseif ($alt or $alt === '') { |
|
| 3582 | 3578 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3583 | - } |
|
| 3584 | - else { |
|
| 3579 | + } else { |
|
| 3585 | 3580 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3586 | 3581 | } |
| 3587 | 3582 | return "<img src='$img_file'$alt" |
@@ -3708,13 +3703,11 @@ discard block |
||
| 3708 | 3703 | if (!is_null($class)) { |
| 3709 | 3704 | if (strlen($class)) { |
| 3710 | 3705 | $img = inserer_attribut($img, 'class', $class); |
| 3711 | - } |
|
| 3712 | - else { |
|
| 3706 | + } else { |
|
| 3713 | 3707 | $img = vider_attribut($img, 'class'); |
| 3714 | 3708 | } |
| 3715 | 3709 | } |
| 3716 | - } |
|
| 3717 | - else { |
|
| 3710 | + } else { |
|
| 3718 | 3711 | $img = http_img_pack( |
| 3719 | 3712 | $img, |
| 3720 | 3713 | $alt, |
@@ -3812,8 +3805,7 @@ discard block |
||
| 3812 | 3805 | if (!is_null($class)) { |
| 3813 | 3806 | if (strlen($class)) { |
| 3814 | 3807 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3815 | - } |
|
| 3816 | - else { |
|
| 3808 | + } else { |
|
| 3817 | 3809 | $balise_svg = vider_attribut($balise_svg, 'class'); |
| 3818 | 3810 | } |
| 3819 | 3811 | } |
@@ -3825,8 +3817,7 @@ discard block |
||
| 3825 | 3817 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3826 | 3818 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3827 | 3819 | $balise_svg .= $title; |
| 3828 | - } |
|
| 3829 | - else { |
|
| 3820 | + } else { |
|
| 3830 | 3821 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3831 | 3822 | } |
| 3832 | 3823 | |
@@ -5234,8 +5225,7 @@ discard block |
||
| 5234 | 5225 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5235 | 5226 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5236 | 5227 | $hash = md5($contexte_implicite['host'] . '::' . $cache); |
| 5237 | - } |
|
| 5238 | - else { |
|
| 5228 | + } else { |
|
| 5239 | 5229 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5240 | 5230 | ksort($contexte); |
| 5241 | 5231 | $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
@@ -448,8 +448,7 @@ |
||
| 448 | 448 | and strpos($query_echappees, $part . $next, $currentpos) === $nextpos |
| 449 | 449 | ) { |
| 450 | 450 | $part .= array_shift($textes); |
| 451 | - } |
|
| 452 | - else { |
|
| 451 | + } else { |
|
| 453 | 452 | break; |
| 454 | 453 | } |
| 455 | 454 | } |
@@ -339,8 +339,7 @@ |
||
| 339 | 339 | if (!autoriser('modifier', $type, intval($id))) { |
| 340 | 340 | $contexte['editable'] = ''; |
| 341 | 341 | } |
| 342 | - } |
|
| 343 | - else { |
|
| 342 | + } else { |
|
| 344 | 343 | if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
| 345 | 344 | $contexte['editable'] = ''; |
| 346 | 345 | } |
@@ -101,8 +101,7 @@ discard block |
||
| 101 | 101 | if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) { |
| 102 | 102 | spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE); |
| 103 | 103 | $cles->save(); |
| 104 | - } |
|
| 105 | - else { |
|
| 104 | + } else { |
|
| 106 | 105 | spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR); |
| 107 | 106 | sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur'])); |
| 108 | 107 | } |
@@ -202,8 +201,7 @@ discard block |
||
| 202 | 201 | spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE); |
| 203 | 202 | $secret = $cles->getSecretAuth(true); |
| 204 | 203 | return true; |
| 205 | - } |
|
| 206 | - else { |
|
| 204 | + } else { |
|
| 207 | 205 | spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR); |
| 208 | 206 | return false; |
| 209 | 207 | } |
@@ -443,8 +441,7 @@ discard block |
||
| 443 | 441 | if (!$secret) { |
| 444 | 442 | if (auth_spip_initialiser_secret()) { |
| 445 | 443 | $secret = $cles->getSecretAuth(); |
| 446 | - } |
|
| 447 | - else { |
|
| 444 | + } else { |
|
| 448 | 445 | return false; |
| 449 | 446 | } |
| 450 | 447 | } |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | } else { |
| 40 | 40 | $tls = true; |
| 41 | 41 | } |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | $tls_ldap == 'non'; |
| 45 | 44 | } |
| 46 | 45 | |
@@ -121,8 +121,7 @@ discard block |
||
| 121 | 121 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 122 | 122 | spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
| 123 | 123 | @unlink($localrac_tmp); |
| 124 | - } |
|
| 125 | - else { |
|
| 124 | + } else { |
|
| 126 | 125 | spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
| 127 | 126 | } |
| 128 | 127 | if (!$res or !$res['length']) { |
@@ -240,8 +239,7 @@ discard block |
||
| 240 | 239 | break; |
| 241 | 240 | } |
| 242 | 241 | } |
| 243 | - } |
|
| 244 | - else { |
|
| 242 | + } else { |
|
| 245 | 243 | $ip = false; |
| 246 | 244 | } |
| 247 | 245 | } |