Completed
Push — master ( 924986...c8fd73 )
by cam
01:05
created
ecrire/inc/livrer_fichier.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 	if (!is_null($options['range'])) {
56 56
 		spip_livrer_fichier_partie($fichier, $options['range']);
57
-	}
58
-	else {
57
+	} else {
59 58
 		spip_livrer_fichier_entier($fichier);
60 59
 	}
61 60
 }
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 		header('Expires: 0'); // set expiration time
87 86
 		header('Pragma: public');
88 87
 		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
89
-	}
90
-	else {
88
+	} else {
91 89
 		$f = basename($fichier);
92 90
 		header("Content-Disposition: inline; filename=\"$f\";");
93 91
 		header('Expires: ' . $expires); // set expiration time
@@ -154,8 +152,7 @@  discard block
 block discarded – undo
154 152
 		}
155 153
 
156 154
 		$cr_header = sprintf('Content-Range: bytes %d-%d/%d', $byteOffset, $finishBytes, $fileSize);
157
-	}
158
-	else {
155
+	} else {
159 156
 		// si pas de range valide, on delegue a la methode d'envoi complet
160 157
 		spip_livrer_fichier_entier($fichier);
161 158
 		// redondant, mais facilite la comprehension du code
Please login to merge, or discard this patch.
ecrire/public/iterateur.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -261,8 +261,7 @@  discard block
 block discarded – undo
261 261
 			if ($filtres = $this->assembler_filtres($this->filtre)) {
262 262
 				$filtres = 'return ' . $filtres . ';';
263 263
 				$this->func_filtre = fn() => eval($filtres);
264
-			}
265
-			else {
264
+			} else {
266 265
 				$this->func_filtre = null;
267 266
 			}
268 267
 		}
@@ -345,16 +344,14 @@  discard block
 block discarded – undo
345 344
 					$v[$k] = $this->traduire_condition_sql_en_filtre($v[$k]);
346 345
 					if ($v[$k] === null) {
347 346
 						unset($v[$k]);
348
-					}
349
-					elseif ($v[$k] === 'true') {
347
+					} elseif ($v[$k] === 'true') {
350 348
 						if ($op === 'OR') {
351 349
 							return 'true';
352 350
 						}
353 351
 						if ($op === 'AND') {
354 352
 							unset($v[$k]);
355 353
 						}
356
-					}
357
-					elseif ($v[$k] === 'false') {
354
+					} elseif ($v[$k] === 'false') {
358 355
 						if ($op === 'OR') {
359 356
 							unset($v[$k]);
360 357
 						}
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
@@ -2071,8 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 						// Champ joker * des iterateurs DATA qui accepte tout
2072 2072
 						if (@array_key_exists('*', $desc['field'])) {
2073 2073
 							$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
2074
-						}
2075
-						else {
2074
+						} else {
2076 2075
 							$r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table);
2077 2076
 							if (!$r) {
2078 2077
 								return '';
@@ -2115,8 +2114,7 @@  discard block
 block discarded – undo
2115 2114
 				. ((isset($r[2]) and $r[2]) ? $r[2] : ",''")
2116 2115
 				. ",'" . addslashes($type_cast_quote) . "'";
2117 2116
 			$val[0] = "sql_quote($r)";
2118
-		}
2119
-		elseif (
2117
+		} elseif (
2120 2118
 			strpos($val[0], '@@defaultcast@@') !== false
2121 2119
 			and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)
2122 2120
 		) {
Please login to merge, or discard this patch.
ecrire/inc/envoyer_mail.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,8 +205,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -553,16 +553,14 @@
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
prive/formulaires/editer_auteur.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -245,8 +245,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2868,8 +2868,7 @@
 block discarded – undo
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;
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
 		}
@@ -652,8 +651,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -656,8 +656,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.