Completed
Push — master ( 1891d3...7fa313 )
by cam
01:19
created
ecrire/inc/plugin.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -561,11 +561,9 @@  discard block
 block discarded – undo
561 561
 		if (!isset($msg[$p])) {
562 562
 			if (isset($resume['erreur']) and $resume['erreur']) {
563 563
 				$msg[$p] = [$resume['erreur']];
564
-			}
565
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
564
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
566 565
 				$msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
567
-			}
568
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
566
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
569 567
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
570 568
 			}
571 569
 		} else {
@@ -954,8 +952,7 @@  discard block
 block discarded – undo
954 952
 					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
955 953
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956 954
 					}
957
-				}
958
-				else {
955
+				} else {
959 956
 					foreach ($info['chemin'] as $chemin) {
960 957
 						if (
961 958
 							!isset($chemin['version']) or plugin_version_compatible(
@@ -1425,8 +1422,7 @@  discard block
 block discarded – undo
1425 1422
 						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1426 1423
 						  $trace,
1427 1424
 						  "\n";
1428
-					}
1429
-					else {
1425
+					} else {
1430 1426
 						include_spip('inc/filtres_boites');
1431 1427
 						echo "<div class='install-plugins svp_retour'>"
1432 1428
 							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
@@ -1463,8 +1459,7 @@  discard block
 block discarded – undo
1463 1459
 	if (file_exists($nom)) {
1464 1460
 		if (substr($nom, -4) == '.php') {
1465 1461
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1466
-		}
1467
-		else {
1462
+		} else {
1468 1463
 			$fichier_tmp = $nom . '.tmp';
1469 1464
 		}
1470 1465
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,8 +212,7 @@
 block discarded – undo
212 212
 function heures_minutes($numdate, $forme = '') {
213 213
 	if ($forme != 'abbr') {
214 214
 		return _T('date_fmt_heures_minutes', ['h' => heures($numdate), 'm' => minutes($numdate)]);
215
-	}
216
-	else {
215
+	} else {
217 216
 		return _T('date_fmt_heures_minutes_court', ['h' => heures($numdate), 'm' => minutes($numdate)]);
218 217
 	}
219 218
 }
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@
 block discarded – undo
77 77
 				break; // stop on a trouvé le bon champ
78 78
 			}
79 79
 		}
80
-	}
81
-	else {
80
+	} else {
82 81
 		$statuts_publies = ['publie'];
83 82
 	}
84 83
 
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Braces   +4 added lines, -9 removed lines patch added patch discarded remove patch
@@ -524,8 +524,7 @@  discard block
 block discarded – undo
524 524
 			process_image_svg_identite($ret);
525 525
 			$ret['creer'] = false;
526 526
 		}
527
-	}
528
-	else {
527
+	} else {
529 528
 		if (!function_exists($ret['fonction_imagecreatefrom'])) {
530 529
 			return false;
531 530
 		}
@@ -628,8 +627,7 @@  discard block
 block discarded – undo
628 627
 
629 628
 	if (isset($info['mime'])) {
630 629
 		$mime = $info['mime'];
631
-	}
632
-	else {
630
+	} else {
633 631
 		$mime = image_type_to_mime_type($info[2]);
634 632
 	}
635 633
 
@@ -1408,9 +1406,7 @@  discard block
 block discarded – undo
1408 1406
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1409 1407
 		$vignette = $destination . '.' . $format;
1410 1408
 		@copy($image, $vignette);
1411
-	}
1412
-
1413
-	elseif ($valeurs['format_source'] === 'svg') {
1409
+	} elseif ($valeurs['format_source'] === 'svg') {
1414 1410
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1415 1411
 			$format_sortie = 'svg';
1416 1412
 			$vignette = $destination . '.' . $format_sortie;
@@ -1846,8 +1842,7 @@  discard block
 block discarded – undo
1846 1842
 		$date = test_espace_prive() ? ('?' . $date) : '';
1847 1843
 
1848 1844
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1849
-	}
1850
-	else {
1845
+	} else {
1851 1846
 		# BMP, tiff ... les redacteurs osent tout!
1852 1847
 		return $img;
1853 1848
 	}
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -193,11 +193,9 @@
 block discarded – undo
193 193
 
194 194
 		if ($statut and test_espace_prive()) {
195 195
 			$corps = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil'));
196
-		}
197
-		elseif (!empty($_COOKIE['spip_admin'])) {
196
+		} elseif (!empty($_COOKIE['spip_admin'])) {
198 197
 			$corps = bouton_action(_T('public:lien_connecter'), generer_url_public('login'));
199
-		}
200
-		else {
198
+		} else {
201 199
 			$corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']);
202 200
 		}
203 201
 		$corps = "<div class='boutons'>$corps</div>";
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
@@ -173,8 +173,7 @@
 block discarded – undo
173 173
 	// sinon on ecrit directement sur stdout
174 174
 	if ($options['envoyer'] and $options['envoyer'] !== 'attachment') {
175 175
 		$fichier = 'php://output';
176
-	}
177
-	else {
176
+	} else {
178 177
 	$fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename;
179 178
 	}
180 179
 
Please login to merge, or discard this patch.
ecrire/inc/svg.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 	if (is_null($maxlen)) {
65 65
 		$image = file_get_contents($fichier);
66
-	}
67
-	else {
66
+	} else {
68 67
 		$image = file_get_contents($fichier, false, null, 0, $maxlen);
69 68
 	}
70 69
 	// est-ce bien une image svg ?
@@ -190,8 +189,7 @@  discard block
 block discarded – undo
190 189
 
191 190
 	if ($start === false or $start === 'end') {
192 191
 		$svg = str_replace('</svg>', $shapes . '</svg>', $svg);
193
-	}
194
-	else {
192
+	} else {
195 193
 		$p = stripos($svg, '<svg');
196 194
 		$p = strpos($svg, '>', $p);
197 195
 		$svg = substr_replace($svg, $shapes, $p + 1, 0);
@@ -253,8 +251,7 @@  discard block
 block discarded – undo
253 251
 	if (strpos($couleur, 'rgb(') === 0) {
254 252
 		$c = explode(',', substr($couleur, 4));
255 253
 		$couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2]));
256
-	}
257
-	else {
254
+	} else {
258 255
 		$couleur = couleur_html_to_hex($couleur);
259 256
 	}
260 257
 	$couleur = '#' . ltrim($couleur, '#');
@@ -305,17 +302,14 @@  discard block
 block discarded – undo
305 302
 		and $w = svg_dimension_to_pixels($attributs['width'])
306 303
 	) {
307 304
 		$width = $w;
308
-	}
309
-	else {
305
+	} else {
310 306
 		// si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale
311 307
 		$width = $viewBox[2];
312 308
 		if ($width < 1) {
313 309
 			$coeff = max($coeff, 1000);
314
-		}
315
-		elseif ($width < 10) {
310
+		} elseif ($width < 10) {
316 311
 			$coeff = max($coeff, 100);
317
-		}
318
-		elseif ($width < 100) {
312
+		} elseif ($width < 100) {
319 313
 			$coeff = max($coeff, 10);
320 314
 		}
321 315
 	}
@@ -324,16 +318,13 @@  discard block
 block discarded – undo
324 318
 		and $h = svg_dimension_to_pixels($attributs['height'])
325 319
 	) {
326 320
 		$height = $h;
327
-	}
328
-	else {
321
+	} else {
329 322
 		$height = $viewBox[3];
330 323
 		if ($height < 1) {
331 324
 			$coeff = max($coeff, 1000);
332
-		}
333
-		elseif ($height < 10) {
325
+		} elseif ($height < 10) {
334 326
 			$coeff = max($coeff, 100);
335
-		}
336
-		elseif ($height < 100) {
327
+		} elseif ($height < 100) {
337 328
 			$coeff = max($coeff, 10);
338 329
 		}
339 330
 	}
@@ -475,8 +466,7 @@  discard block
 block discarded – undo
475 466
 			if (isset($attributs['viewBox'])) {
476 467
 				$viewBox = explode(' ', $attributs['viewBox']);
477 468
 				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>";
478
-			}
479
-			else {
469
+			} else {
480 470
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
481 471
 			}
482 472
 			$svg = svg_insert_shapes($svg, $rect);
@@ -505,8 +495,7 @@  discard block
 block discarded – undo
505 495
 			if (isset($attributs['viewBox'])) {
506 496
 				$viewBox = explode(' ', $attributs['viewBox']);
507 497
 				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>";
508
-			}
509
-			else {
498
+			} else {
510 499
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
511 500
 			}
512 501
 			$svg = svg_insert_shapes($svg, $rect, false);
@@ -627,8 +616,7 @@  discard block
 block discarded – undo
627 616
 			$x = intval($viewBox[0]) + intval($viewBox[2] / 2);
628 617
 			$mx = -$x;
629 618
 			$transform = "translate($x, 0) $transform translate($mx, 0)";
630
-		}
631
-		else {
619
+		} else {
632 620
 			$transform = 'scale(1,-1)';
633 621
 
634 622
 			$y = intval($viewBox[1]) + intval($viewBox[3] / 2);
@@ -689,8 +677,7 @@  discard block
 block discarded – undo
689 677
 			$c = array_shift($colors);
690 678
 			if (strlen($c) == 4) {
691 679
 				$short[] = $c;
692
-			}
693
-			else {
680
+			} else {
694 681
 				$long[] = $c;
695 682
 			}
696 683
 		}
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,8 +341,7 @@
 block discarded – undo
341 341
 	) {
342 342
 		if ($use_copy) {
343 343
 			@copy($fichier_tmp, $fichier);
344
-		}
345
-		else {
344
+		} else {
346 345
 			@rename($fichier_tmp, $fichier);
347 346
 		}
348 347
 		// eviter que PHP ne reserve le vieux timestamp
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -631,8 +631,7 @@  discard block
 block discarded – undo
631 631
 			if (!$srcHeight) {
632 632
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
633 633
 			}
634
-		}
635
-		elseif (strpos($src, '<svg') !== false) {
634
+		} elseif (strpos($src, '<svg') !== false) {
636 635
 			include_spip('inc/svg');
637 636
 			if ($attrs = svg_lire_attributs($src)) {
638 637
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
@@ -2125,8 +2124,7 @@  discard block
 block discarded – undo
2125 2124
 					and !$is_class_presente
2126 2125
 				) {
2127 2126
 					$class_new = rtrim($class_new) . ' ' . $c;
2128
-				}
2129
-				elseif (
2127
+				} elseif (
2130 2128
 					in_array($operation, ['supprimer', 'commuter'])
2131 2129
 					and $is_class_presente
2132 2130
 				) {
@@ -2138,8 +2136,7 @@  discard block
 block discarded – undo
2138 2136
 		if ($class_new !== $class_courante) {
2139 2137
 			if (strlen($class_new)) {
2140 2138
 				$balise = inserer_attribut($balise, 'class', $class_new);
2141
-			}
2142
-			elseif ($class_courante) {
2139
+			} elseif ($class_courante) {
2143 2140
 				$balise = vider_attribut($balise, 'class');
2144 2141
 			}
2145 2142
 		}
@@ -3440,8 +3437,7 @@  discard block
 block discarded – undo
3440 3437
 	) {
3441 3438
 		if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) {
3442 3439
 			$img_file = $variante_svg_size;
3443
-		}
3444
-		else {
3440
+		} else {
3445 3441
 			$img_file = $variante_svg_generique;
3446 3442
 		}
3447 3443
 	}
@@ -3473,8 +3469,7 @@  discard block
 block discarded – undo
3473 3469
 	}
3474 3470
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3475 3471
 		$img_file = chemin_image($img);
3476
-	}
3477
-	else {
3472
+	} else {
3478 3473
 		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3479 3474
 			$img_file = http_img_variante_svg_si_possible($img_file);
3480 3475
 		}
@@ -3504,11 +3499,9 @@  discard block
 block discarded – undo
3504 3499
 	}
3505 3500
 	if ($alt === false) {
3506 3501
 		$alt = '';
3507
-	}
3508
-	elseif ($alt or $alt === '') {
3502
+	} elseif ($alt or $alt === '') {
3509 3503
 		$alt = " alt='" . attribut_html($alt) . "'";
3510
-	}
3511
-	else {
3504
+	} else {
3512 3505
 		$alt = " alt='" . attribut_html($title) . "'";
3513 3506
 	}
3514 3507
 	return "<img src='$img_file'$alt"
@@ -3635,13 +3628,11 @@  discard block
 block discarded – undo
3635 3628
 		if (!is_null($class)) {
3636 3629
 			if (strlen($class)) {
3637 3630
 				$img = inserer_attribut($img, 'class', $class);
3638
-			}
3639
-			else {
3631
+			} else {
3640 3632
 				$img = vider_attribut($img, 'class');
3641 3633
 			}
3642 3634
 		}
3643
-	}
3644
-	else {
3635
+	} else {
3645 3636
 		$img = http_img_pack(
3646 3637
 			$img,
3647 3638
 			$alt,
@@ -3726,8 +3717,7 @@  discard block
 block discarded – undo
3726 3717
 	if (!is_null($class)) {
3727 3718
 		if (strlen($class)) {
3728 3719
 			$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3729
-		}
3730
-		else {
3720
+		} else {
3731 3721
 			$balise_svg = vider_attribut($balise_svg, 'class');
3732 3722
 		}
3733 3723
 	}
@@ -3739,8 +3729,7 @@  discard block
 block discarded – undo
3739 3729
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3740 3730
 		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3741 3731
 		$balise_svg .= $title;
3742
-	}
3743
-	else {
3732
+	} else {
3744 3733
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3745 3734
 	}
3746 3735
 
@@ -5117,8 +5106,7 @@  discard block
 block discarded – undo
5117 5106
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5118 5107
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5119 5108
 		$hash = md5($contexte_implicite['host'] . '::' . $cache);
5120
-	}
5121
-	else {
5109
+	} else {
5122 5110
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5123 5111
 		ksort($contexte);
5124 5112
 		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
Please login to merge, or discard this patch.