Completed
Push — master ( 350a8b...37aa61 )
by cam
01:39
created
prive/formulaires/configurer_ecran_connexion.php 1 patch
Braces   +4 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,13 +32,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
ecrire/public/phraser_html.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -798,8 +798,7 @@  discard block
 block discarded – undo
798 798
 function public_compte_ligne($texte, $debut = 0, $fin = null) {
799 799
 	if (is_null($fin)) {
800 800
 		return substr_count((string) $texte, "\n", $debut);
801
-	}
802
-	else {
801
+	} else {
803 802
 		return substr_count((string) $texte, "\n", $debut, $fin - $debut);
804 803
 	}
805 804
 }
@@ -846,8 +845,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 . '(';
Please login to merge, or discard this patch.
ecrire/public/criteres.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2069,8 +2069,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		) {
Please login to merge, or discard this patch.
ecrire/auth/spip.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -110,14 +110,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
ecrire/inc/exporter_csv.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -182,8 +182,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -336,8 +336,7 @@
 block discarded – undo
336 336
 		if (!autoriser('modifier', $type, (int) $id)) {
337 337
 			$contexte['editable'] = '';
338 338
 		}
339
-	}
340
-	else {
339
+	} else {
341 340
 		if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) {
342 341
 			$contexte['editable'] = '';
343 342
 		}
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -122,8 +122,7 @@  discard block
 block discarded – undo
122 122
 		if (!$res || !$res['length'] && $res['status'] != 304) {
123 123
 			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
124 124
 			@unlink($localrac_tmp);
125
-		}
126
-		else {
125
+		} else {
127 126
 			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
128 127
 		}
129 128
 		if (!$res || !$res['length']) {
@@ -242,8 +241,7 @@  discard block
 block discarded – undo
242 241
 						break;
243 242
 					}
244 243
 				}
245
-			}
246
-			else {
244
+			} else {
247 245
 				$ip = false;
248 246
 			}
249 247
 		}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -267,8 +267,7 @@  discard block
 block discarded – undo
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
 		}
@@ -635,8 +634,7 @@  discard block
 block discarded – undo
635 634
 function autoriser_rubrique_creer_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
636 635
 	if (!empty($opt['id_parent'])) {
637 636
 		return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui);
638
-	}
639
-	else {
637
+	} else {
640 638
 		return autoriser('defaut', null, 0, $qui, $opt);
641 639
 	}
642 640
 }
@@ -791,8 +789,7 @@  discard block
 block discarded – undo
791 789
 	if (!empty($opt['id_parent'])) {
792 790
 		// creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi
793 791
 		return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui);
794
-	}
795
-	else {
792
+	} else {
796 793
 		return (sql_countsel('spip_rubriques') > 0 && in_array($qui['statut'], ['0minirezo', '1comite']));
797 794
 	}
798 795
 }
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -615,8 +615,7 @@  discard block
 block discarded – undo
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);
@@ -3421,8 +3420,7 @@  discard block
 block discarded – undo
3421 3420
 	}
3422 3421
 	if (!isset($options['chemin_image']) || $options['chemin_image'] == true) {
3423 3422
 		$img_file = chemin_image($img);
3424
-	}
3425
-	else {
3423
+	} else {
3426 3424
 		if (!isset($options['variante_svg_si_possible']) || $options['variante_svg_si_possible'] == true) {
3427 3425
 			$img_file = http_img_variante_svg_si_possible($img_file);
3428 3426
 		}
@@ -3449,11 +3447,9 @@  discard block
 block discarded – undo
3449 3447
 	}
3450 3448
 	if ($alt === false) {
3451 3449
 		$alt = '';
3452
-	}
3453
-	elseif ($alt || $alt === '') {
3450
+	} elseif ($alt || $alt === '') {
3454 3451
 		$alt = " alt='" . attribut_html($alt) . "'";
3455
-	}
3456
-	else {
3452
+	} else {
3457 3453
 		$alt = " alt='" . attribut_html($title) . "'";
3458 3454
 	}
3459 3455
 	return "<img src='" . attribut_html($img_file) . "'$alt"
@@ -3580,8 +3576,7 @@  discard block
 block discarded – undo
3580 3576
 		if (!is_null($class)) {
3581 3577
 			$img = strlen((string) $class) ? inserer_attribut($img, 'class', $class) : vider_attribut($img, 'class');
3582 3578
 		}
3583
-	}
3584
-	else {
3579
+	} else {
3585 3580
 		$img = http_img_pack(
3586 3581
 			$img,
3587 3582
 			$alt,
@@ -3689,8 +3684,7 @@  discard block
 block discarded – undo
3689 3684
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3690 3685
 		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3691 3686
 		$balise_svg .= $title;
3692
-	}
3693
-	else {
3687
+	} else {
3694 3688
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3695 3689
 	}
3696 3690
 
@@ -5081,8 +5075,7 @@  discard block
 block discarded – undo
5081 5075
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5082 5076
 	if (isset($options['hash_on_content']) && $options['hash_on_content']) {
5083 5077
 		$hash = md5((string) ($contexte_implicite['host'] . '::' . $cache));
5084
-	}
5085
-	else {
5078
+	} else {
5086 5079
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5087 5080
 		ksort($contexte);
5088 5081
 		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
Please login to merge, or discard this patch.