@@ -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 | } |
@@ -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); |
@@ -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; |
@@ -32,13 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | if (_request('supprimer_image_fond_login')) { |
| 34 | 34 | // rien à tester |
| 35 | - } |
|
| 36 | - |
|
| 37 | - elseif (_request('supprimer_couleur_login')) { |
|
| 35 | + } elseif (_request('supprimer_couleur_login')) { |
|
| 38 | 36 | // rien à tester |
| 39 | - } |
|
| 40 | - |
|
| 41 | - elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 37 | + } elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 42 | 38 | $file = $_FILES['upload_image_fond_login']; |
| 43 | 39 | include_spip('inc/documents'); |
| 44 | 40 | $extension = pathinfo((string) $file['name'], PATHINFO_EXTENSION); |
@@ -74,14 +70,10 @@ discard block |
||
| 74 | 70 | |
| 75 | 71 | if (_request('supprimer_image_fond_login')) { |
| 76 | 72 | @unlink($dest); |
| 77 | - } |
|
| 78 | - |
|
| 79 | - elseif (_request('supprimer_couleur_login')) { |
|
| 73 | + } elseif (_request('supprimer_couleur_login')) { |
|
| 80 | 74 | effacer_config('couleur_login'); |
| 81 | 75 | set_request('couleur_login', null); |
| 82 | - } |
|
| 83 | - |
|
| 84 | - elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 76 | + } elseif (!empty($_FILES['upload_image_fond_login'])) { |
|
| 85 | 77 | $file = $_FILES['upload_image_fond_login']; |
| 86 | 78 | include_spip('inc/documents'); |
| 87 | 79 | deplacer_fichier_upload($file['tmp_name'], $dest); |
@@ -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((string) $type_cast_quote) . "'"; |
| 2114 | 2113 | $val[0] = "sql_quote($r)"; |
| 2115 | - } |
|
| 2116 | - elseif ( |
|
| 2114 | + } elseif ( |
|
| 2117 | 2115 | str_contains((string) $val[0], '@@defaultcast@@') |
| 2118 | 2116 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r) |
| 2119 | 2117 | ) { |
@@ -110,14 +110,12 @@ discard block |
||
| 110 | 110 | spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE); |
| 111 | 111 | if ($cles->save()) { |
| 112 | 112 | $secret = $cles->getSecretAuth(); |
| 113 | - } |
|
| 114 | - else { |
|
| 113 | + } else { |
|
| 115 | 114 | spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
| 116 | 115 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 117 | 116 | raler_fichier(_DIR_ETC . 'cles.php'); |
| 118 | 117 | } |
| 119 | - } |
|
| 120 | - else { |
|
| 118 | + } else { |
|
| 121 | 119 | 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); |
| 122 | 120 | sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . (int) $row['id_auteur']); |
| 123 | 121 | } |
@@ -125,8 +123,7 @@ discard block |
||
| 125 | 123 | |
| 126 | 124 | if (!$secret || !Password::verifier($pass, $row['pass'], $secret)) { |
| 127 | 125 | unset($row); |
| 128 | - } |
|
| 129 | - else { |
|
| 126 | + } else { |
|
| 130 | 127 | spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG); |
| 131 | 128 | } |
| 132 | 129 | break; |
@@ -234,8 +231,7 @@ discard block |
||
| 234 | 231 | spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
| 235 | 232 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 236 | 233 | raler_fichier(_DIR_ETC . 'cles.php'); |
| 237 | - } |
|
| 238 | - else { |
|
| 234 | + } else { |
|
| 239 | 235 | 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); |
| 240 | 236 | } |
| 241 | 237 | return false; |
@@ -468,8 +464,7 @@ discard block |
||
| 468 | 464 | if (!$secret) { |
| 469 | 465 | if (auth_spip_initialiser_secret()) { |
| 470 | 466 | $secret = $cles->getSecretAuth(); |
| 471 | - } |
|
| 472 | - else { |
|
| 467 | + } else { |
|
| 473 | 468 | return false; |
| 474 | 469 | } |
| 475 | 470 | } |
@@ -182,8 +182,7 @@ |
||
| 182 | 182 | // sinon on ecrit directement sur stdout |
| 183 | 183 | if ($options['envoyer'] && $options['envoyer'] !== 'attachment') { |
| 184 | 184 | $fichier = 'php://output'; |
| 185 | - } |
|
| 186 | - else { |
|
| 185 | + } else { |
|
| 187 | 186 | $fichier = sous_repertoire(_DIR_CACHE, 'export') . $basename; |
| 188 | 187 | } |
| 189 | 188 | |