Completed
Push — master ( 6a6422...ff2ac0 )
by cam
01:15
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('action/ajouter_documents');
44 40
 		$extension = pathinfo($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/inc/filtres_images_mini.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -511,11 +511,12 @@
 block discarded – undo
511 511
 	$position = 'focus',
512 512
 	$background_color = 'white'
513 513
 ) {
514
-	if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2')
515
-		return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height);
516
-	else 
517
-		return image_passe_partout($im, $width, $height);
518
-}
514
+	if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') {
515
+			return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height);
516
+	} else {
517
+			return image_passe_partout($im, $width, $height);
518
+	}
519
+	}
519 520
 
520 521
 /**
521 522
  * Réduit les images d'un certain facteur
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Braces   +7 added lines, -10 removed lines patch added patch discarded remove patch
@@ -517,8 +517,7 @@  discard block
 block discarded – undo
517 517
 			process_image_svg_identite($ret);
518 518
 			$ret['creer'] = false;
519 519
 		}
520
-	}
521
-	else {
520
+	} else {
522 521
 		if (!function_exists($ret["fonction_imagecreatefrom"])) {
523 522
 			return false;
524 523
 		}
@@ -542,7 +541,9 @@  discard block
 block discarded – undo
542 541
 			$extensions = array_map('trim', $extensions);
543 542
 			$extensions = array_filter($extensions);
544 543
 			$extensions = array_unique($extensions);
545
-			if (in_array("jpg", $extensions)) $extensions[] = 'jpeg';
544
+			if (in_array("jpg", $extensions)) {
545
+			    $extensions[] = 'jpeg';
546
+			}
546 547
 		}
547 548
 		$extensions[] = 'svg'; // on le supporte toujours avec des fonctions specifiques
548 549
 	}
@@ -620,8 +621,7 @@  discard block
 block discarded – undo
620 621
 
621 622
 	if (isset($info['mime'])) {
622 623
 		$mime = $info['mime'];
623
-	}
624
-	else {
624
+	} else {
625 625
 		$mime = image_type_to_mime_type($info[2]);
626 626
 	}
627 627
 
@@ -1395,9 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1396 1396
 		$vignette = $destination . '.' . $format;
1397 1397
 		@copy($image, $vignette);
1398
-	}
1399
-
1400
-	elseif ($valeurs["format_source"] === 'svg') {
1398
+	} elseif ($valeurs["format_source"] === 'svg') {
1401 1399
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)){
1402 1400
 			$format_sortie = 'svg';
1403 1401
 			$vignette = $destination . "." . $format_sortie;
@@ -1822,8 +1820,7 @@  discard block
 block discarded – undo
1822 1820
 		$date = test_espace_prive() ? ('?' . $date) : '';
1823 1821
 
1824 1822
 		return _image_ecrire_tag($image, array('src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight));
1825
-	}
1826
-	else {
1823
+	} else {
1827 1824
 		# BMP, tiff ... les redacteurs osent tout!
1828 1825
 		return $img;
1829 1826
 	}
Please login to merge, or discard this patch.
ecrire/public/tracer.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,15 +20,13 @@  discard block
 block discarded – undo
20 20
 	if ($trace === '?' or defined('_DEBUG_TRACE_QUERIES')) {
21 21
 		if (defined('_DEBUG_TRACE_QUERIES') and _DEBUG_TRACE_QUERIES) {
22 22
 			$trace = true;
23
-		}
24
-		else {
23
+		} else {
25 24
 			if (empty($GLOBALS['visiteur_session'])) {
26 25
 				// si un anonyme fait un var_profile on est oblige de remplir le tableau des temps en attendant de savoir
27 26
 				// car ici on ne sait pas si c'est un hit anonyme
28 27
 				// ou une requete SQL faite avant chargement de la session
29 28
 				$trace = (!empty($_GET['var_profile']) ? '?' : false);
30
-			}
31
-			else {
29
+			} else {
32 30
 				include_spip('inc/autoriser');
33 31
 				// gare au bouclage sur calcul de droits au premier appel
34 32
 				// A fortiori quand on demande une trace
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
 			// car ici on ne sait pas si c'est un hit anonyme
51 49
 			// ou une requete SQL faite avant chargement de la session
52 50
 			$trace = (!empty($_GET['var_profile']) ? '?' : false);
53
-		}
54
-		else {
51
+		} else {
55 52
 			include_spip('inc/autoriser');
56 53
 			// gare au bouclage sur calcul de droits au premier appel
57 54
 			// A fortiori quand on demande une trace
Please login to merge, or discard this patch.
ecrire/req/sqlite_generique.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2006,8 +2006,7 @@  discard block
 block discarded – undo
2006 2006
 		// si on ne connait pas le type on le deduit de $v autant que possible
2007 2007
 		if (is_bool($v)) {
2008 2008
 			return strval(intval($v));
2009
-		}
2010
-		elseif (is_numeric($v)) {
2009
+		} elseif (is_numeric($v)) {
2011 2010
 			return strval($v);
2012 2011
 		}
2013 2012
 	}
@@ -2633,8 +2632,7 @@  discard block
 block discarded – undo
2633 2632
 				$tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
2634 2633
 			}
2635 2634
 		}
2636
-	}
2637
-	else {
2635
+	} else {
2638 2636
 		$now = _sqlite_func_now(true);
2639 2637
 		foreach (array_keys($tables[$table]['desc']) as $k) {
2640 2638
 			$tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
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
@@ -622,8 +622,7 @@  discard block
 block discarded – undo
622 622
 			if (!$srcHeight) {
623 623
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
624 624
 			}
625
-		}
626
-		elseif(strpos($src, "<svg") !== false) {
625
+		} elseif(strpos($src, "<svg") !== false) {
627 626
 			include_spip('inc/svg');
628 627
 			if ($attrs = svg_lire_attributs($src)){
629 628
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
@@ -2089,8 +2088,7 @@  discard block
 block discarded – undo
2089 2088
 				if (in_array($operation, ['ajouter', 'commuter'])
2090 2089
 					and !$is_class_presente) {
2091 2090
 					$class_new = rtrim($class_new) . " " . $c;
2092
-				}
2093
-				elseif (in_array($operation, ['supprimer', 'commuter'])
2091
+				} elseif (in_array($operation, ['supprimer', 'commuter'])
2094 2092
 					and $is_class_presente) {
2095 2093
 					$class_new = trim(preg_replace("/(^|\s)".preg_quote($c)."($|\s)/", "\\1", $class_new));
2096 2094
 				}
@@ -2100,8 +2098,7 @@  discard block
 block discarded – undo
2100 2098
 		if ($class_new !== $class_courante) {
2101 2099
 			if (strlen($class_new)) {
2102 2100
 				$balise = inserer_attribut($balise, 'class', $class_new);
2103
-			}
2104
-			elseif ($class_courante) {
2101
+			} elseif ($class_courante) {
2105 2102
 				$balise = vider_attribut($balise, 'class');
2106 2103
 			}
2107 2104
 		}
@@ -3365,8 +3362,7 @@  discard block
 block discarded – undo
3365 3362
 	  and file_exists($variante_svg_generique)) {
3366 3363
 		if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3367 3364
 			$img_file = $variante_svg_size;
3368
-		}
3369
-		else {
3365
+		} else {
3370 3366
 			$img_file = $variante_svg_generique;
3371 3367
 		}
3372 3368
 	}
@@ -3398,8 +3394,7 @@  discard block
 block discarded – undo
3398 3394
 	}
3399 3395
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3400 3396
 		$img_file = chemin_image($img);
3401
-	}
3402
-	else {
3397
+	} else {
3403 3398
 		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3404 3399
 			$img_file = http_img_variante_svg_si_possible($img_file);
3405 3400
 		}
@@ -3428,11 +3423,9 @@  discard block
 block discarded – undo
3428 3423
 	}
3429 3424
 	if ($alt === false) {
3430 3425
 		$alt = '';
3431
-	}
3432
-	elseif($alt or $alt==='') {
3426
+	} elseif($alt or $alt==='') {
3433 3427
 		$alt = " alt='".attribut_html($alt)."'";
3434
-	}
3435
-	else {
3428
+	} else {
3436 3429
 		$alt = " alt='".attribut_html($title)."'";
3437 3430
 	}
3438 3431
 	return "<img src='$img_file'$alt"
@@ -3557,13 +3550,11 @@  discard block
 block discarded – undo
3557 3550
 		if (!is_null($class)) {
3558 3551
 			if (strlen($class)) {
3559 3552
 				$img = inserer_attribut($img, 'class', $class);
3560
-			}
3561
-			else {
3553
+			} else {
3562 3554
 				$img = vider_attribut($img, 'class');
3563 3555
 			}
3564 3556
 		}
3565
-	}
3566
-	else {
3557
+	} else {
3567 3558
 		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3568 3559
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3569 3560
 		if (is_null($alt)) {
@@ -3643,8 +3634,7 @@  discard block
 block discarded – undo
3643 3634
 	if (!is_null($class)) {
3644 3635
 		if (strlen($class)) {
3645 3636
 			$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3646
-		}
3647
-		else {
3637
+		} else {
3648 3638
 			$balise_svg = vider_attribut($balise_svg, 'class');
3649 3639
 		}
3650 3640
 	}
@@ -3656,8 +3646,7 @@  discard block
 block discarded – undo
3656 3646
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3657 3647
 		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3658 3648
 		$balise_svg .= $title;
3659
-	}
3660
-	else {
3649
+	} else {
3661 3650
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3662 3651
 	}
3663 3652
 
@@ -5007,8 +4996,7 @@  discard block
 block discarded – undo
5007 4996
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5008 4997
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5009 4998
 		$hash = md5($contexte_implicite['host'] . '::'. $cache);
5010
-	}
5011
-	else {
4999
+	} else {
5012 5000
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5013 5001
 		ksort($contexte);
5014 5002
 		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -555,11 +555,9 @@  discard block
 block discarded – undo
555 555
 		if (!isset($msg[$p])) {
556 556
 			if (isset($resume['erreur']) and $resume['erreur']) {
557 557
 				$msg[$p] = array($resume['erreur']);
558
-			}
559
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
558
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
560 559
 				$msg[$p] = array(plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite'));
561
-			}
562
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
560
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
563 561
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
564 562
 			}
565 563
 		} else {
@@ -945,8 +943,7 @@  discard block
 block discarded – undo
945 943
 					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
946 944
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
947 945
 					}
948
-				}
949
-				else{
946
+				} else{
950 947
 					foreach ($info['chemin'] as $chemin) {
951 948
 						if (!isset($chemin['version']) or plugin_version_compatible($chemin['version'],
952 949
 								$GLOBALS['spip_version_branche'], 'spip')
@@ -1169,10 +1166,12 @@  discard block
 block discarded – undo
1169 1166
 					}
1170 1167
 					$nom = $nomlower;
1171 1168
 					// une action vide est une declaration qui ne doit pas etre compilee !
1172
-					if (!isset($GLOBALS['spip_pipeline'][$nom])) // creer le pipeline eventuel
1169
+					if (!isset($GLOBALS['spip_pipeline'][$nom])) {
1170
+					    // creer le pipeline eventuel
1173 1171
 					{
1174 1172
 						$GLOBALS['spip_pipeline'][$nom] = "";
1175 1173
 					}
1174
+					}
1176 1175
 					if ($action) {
1177 1176
 						if (strpos($GLOBALS['spip_pipeline'][$nom], "|$prefix$action") === false) {
1178 1177
 							$GLOBALS['spip_pipeline'][$nom] = preg_replace(",(\|\||$),", "|$prefix$action\\1",
@@ -1404,8 +1403,7 @@  discard block
 block discarded – undo
1404 1403
 						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1405 1404
 						  $trace,
1406 1405
 						  "\n";
1407
-					}
1408
-					else {
1406
+					} else {
1409 1407
 						include_spip('inc/filtres_boites');
1410 1408
 						echo "<div class='install-plugins svp_retour'>"
1411 1409
 							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
@@ -1442,8 +1440,7 @@  discard block
 block discarded – undo
1442 1440
 	if (file_exists($nom)) {
1443 1441
 		if (substr($nom, -4) == '.php') {
1444 1442
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1445
-		}
1446
-		else {
1443
+		} else {
1447 1444
 			$fichier_tmp = $nom . '.tmp';
1448 1445
 		}
1449 1446
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.