Completed
Push — master ( 37aa61...be7234 )
by cam
01:24
created
ecrire/base/connect_sql.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
 			if (!isset($GLOBALS['db_ok'])) {
88 88
 				spip_log("spip_connect: fichier de connexion '$f' OK mais echec connexion au serveur", _LOG_HS);
89 89
 			}
90
-		}
91
-		else {
90
+		} else {
92 91
 			spip_log("spip_connect: fichier de connexion '$f' non trouve, pas de connexion serveur", _LOG_HS);
93 92
 		}
94 93
 		if (!isset($GLOBALS['db_ok'])) {
@@ -453,8 +452,7 @@  discard block
 block discarded – undo
453 452
 					&& strpos($query_echappees, $part . $next, $currentpos) === $nextpos
454 453
 				) {
455 454
 					$part .= array_shift($textes);
456
-				}
457
-				else {
455
+				} else {
458 456
 					break;
459 457
 				}
460 458
 			}
Please login to merge, or discard this patch.
ecrire/balise/formulaire_inscription.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_selecteur_generique.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -160,8 +160,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@  discard block
 block discarded – undo
83 83
 		  . '</code>'
84 84
 		  . '</pre>'
85 85
 		  . '</div>';
86
-	}
87
-	else {
86
+	} else {
88 87
 		$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
89 88
 		$echap = str_replace('  ', ' &nbsp;', $echap);
90 89
 		$html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>';
@@ -608,8 +607,7 @@  discard block
 block discarded – undo
608 607
 		$collecteurLiens = $collecteurModeles = null;
609 608
 		if (!empty($options['expanser_liens'])) {
610 609
 			$texte = expanser_liens($texte, $env['connect'] ?? '', $env['env'] ?? []);
611
-		}
612
-		else {
610
+		} else {
613 611
 			include_spip('src/Texte/Collecteur/AbstractCollecteur');
614 612
 			include_spip('src/Texte/Collecteur/Liens');
615 613
 			include_spip('src/Texte/Collecteur/Modeles');
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Braces   +3 added lines, -7 removed lines patch added patch discarded remove patch
@@ -537,8 +537,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
ecrire/inc/svg.php 1 patch
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -164,8 +164,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
ecrire/src/Afficher/Minipage/Admin.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -114,11 +114,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -368,8 +368,7 @@  discard block
 block discarded – undo
368 368
 	}
369 369
 	if (!isset($regs[2])) {
370 370
 		$niveau = _LOG_INFO;
371
-	}
372
-	else {
371
+	} else {
373 372
 		$niveau = intval($regs[2]);
374 373
 	}
375 374
 
@@ -1485,8 +1484,7 @@  discard block
 block discarded – undo
1485 1484
 	) {
1486 1485
 		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1487 1486
 			return $themefiles["$subdir$file"] = $fsize;
1488
-		}
1489
-		else {
1487
+		} else {
1490 1488
 			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1491 1489
 		}
1492 1490
 	}
Please login to merge, or discard this patch.
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.