Completed
Push — master ( 44448f...9c847e )
by cam
01:17
created
ecrire/base/objets.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -981,8 +981,9 @@  discard block
 block discarded – undo
981 981
 	static $tables = array();
982 982
 	if (!isset($tables[$serveur])){
983 983
 		$tables[$serveur] = array();
984
-		if (!function_exists("sql_alltable"))
985
-			include_spip("base/abstract_sql");
984
+		if (!function_exists("sql_alltable")) {
985
+					include_spip("base/abstract_sql");
986
+		}
986 987
 		$ts = sql_alltable('%',$serveur); // toutes les tables
987 988
 		foreach ($ts as $t){
988 989
 			$tables[$serveur][$t] = $t;
@@ -1384,8 +1385,7 @@  discard block
 block discarded – undo
1384 1385
 							'champ' 	=> $parent_methode['champ'],
1385 1386
 							'table'    => $table,
1386 1387
 						);
1387
-					}
1388
-					elseif (isset($parent_methode['champ_type'])) {
1388
+					} elseif (isset($parent_methode['champ_type'])) {
1389 1389
 						$parent = array(
1390 1390
 							'objet' 	 => $ligne[$parent_methode['champ_type']],
1391 1391
 							'id_objet' 	 => intval($ligne[$parent_methode['champ']]),
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,11 +50,9 @@  discard block
 block discarded – undo
50 50
 		$port and !is_numeric($socket = $port)
51 51
 		and (!$host or $host=='localhost')) {
52 52
 		$link = @mysqli_connect($host, $login, $pass, '', null, $socket);
53
-	}
54
-	elseif ($port) {
53
+	} elseif ($port) {
55 54
 		$link = @mysqli_connect($host, $login, $pass, '', $port);
56
-	}
57
-	else {
55
+	} else {
58 56
 		$link = @mysqli_connect($host, $login, $pass);
59 57
 	}
60 58
 
@@ -1612,8 +1610,7 @@  discard block
 block discarded – undo
1612 1610
 	if (!$type) {
1613 1611
 		if (is_bool($v)) {
1614 1612
 			return strval(intval($v));
1615
-		}
1616
-		elseif (is_numeric($v)) {
1613
+		} elseif (is_numeric($v)) {
1617 1614
 			return strval($v);
1618 1615
 		}
1619 1616
 		return "'" . addslashes($v) . "'";
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('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.