Completed
Push — master ( 05da1d...9a9099 )
by cam
01:15
created
ecrire/public/criteres.php 1 patch
Braces   +14 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1472,10 +1472,12 @@  discard block
 block discarded – undo
1472 1472
 	if ($crit->cond) {
1473 1473
 		$pred = calculer_argument_precedent($idb, $col, $boucles);
1474 1474
 		$where = array("'?'", $pred, $where, "''");
1475
-		if ($where_complement) // condition annexe du type "AND (objet='article')"
1475
+		if ($where_complement) {
1476
+		    // condition annexe du type "AND (objet='article')"
1476 1477
 		{
1477 1478
 			$where_complement = array("'?'", $pred, $where_complement, "''");
1478 1479
 		}
1480
+		}
1479 1481
 	}
1480 1482
 	if ($crit->exclus) {
1481 1483
 		if (!preg_match(",^L[0-9]+[.],", $arg)) {
@@ -1496,10 +1498,12 @@  discard block
 block discarded – undo
1496 1498
 	}
1497 1499
 
1498 1500
 	$boucles[$idb]->where[] = $where;
1499
-	if ($where_complement) // condition annexe du type "AND (objet='article')"
1501
+	if ($where_complement) {
1502
+	    // condition annexe du type "AND (objet='article')"
1500 1503
 	{
1501 1504
 		$boucles[$idb]->where[] = $where_complement;
1502 1505
 	}
1506
+	}
1503 1507
 }
1504 1508
 
1505 1509
 // https://code.spip.net/@critere_IN_cas
@@ -1892,17 +1896,21 @@  discard block
 block discarded – undo
1892 1896
 			);
1893 1897
 		}
1894 1898
 		$where = array("'?'", "!(is_array($pred)?count($pred):strlen($pred))", "''", $where);
1895
-		if ($where_complement) // condition annexe du type "AND (objet='article')"
1899
+		if ($where_complement) {
1900
+		    // condition annexe du type "AND (objet='article')"
1896 1901
 		{
1897 1902
 			$where_complement = array("'?'", "!(is_array($pred)?count($pred):strlen($pred))", "''", $where_complement);
1898 1903
 		}
1904
+		}
1899 1905
 	}
1900 1906
 
1901 1907
 	$boucles[$idb]->where[] = $where;
1902
-	if ($where_complement) // condition annexe du type "AND (objet='article')"
1908
+	if ($where_complement) {
1909
+	    // condition annexe du type "AND (objet='article')"
1903 1910
 	{
1904 1911
 		$boucles[$idb]->where[] = $where_complement;
1905 1912
 	}
1913
+	}
1906 1914
 }
1907 1915
 
1908 1916
 
@@ -2013,8 +2021,7 @@  discard block
 block discarded – undo
2013 2021
 						// Champ joker * des iterateurs DATA qui accepte tout
2014 2022
 						if (@array_key_exists('*', $desc['field'])) {
2015 2023
 							$desc['field'][$col_vraie ? $col_vraie : $col] = ''; // on veut pas de cast INT par defaut car le type peut etre n'importe quoi dans les boucles DATA
2016
-						}
2017
-						else {
2024
+						} else {
2018 2025
 							$r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table);
2019 2026
 							if (!$r) {
2020 2027
 								return '';
@@ -2056,8 +2063,7 @@  discard block
 block discarded – undo
2056 2063
 				. ((isset($r[2]) and $r[2]) ? $r[2] : ",''")
2057 2064
 				. ",'" . addslashes($type_cast_quote) . "'";
2058 2065
 			$val[0] = "sql_quote($r)";
2059
-		}
2060
-		elseif(strpos($val[0], '@@defaultcast@@') !== false
2066
+		} elseif(strpos($val[0], '@@defaultcast@@') !== false
2061 2067
 		  and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)) {
2062 2068
 			$val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')";
2063 2069
 		}
Please login to merge, or discard this patch.
ecrire/public/assembler.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -471,9 +471,11 @@  discard block
 block discarded – undo
471 471
 				$contexte[$var] = $val;
472 472
 			} else {
473 473
 				$args = explode('=', $val);
474
-				if (count($args) >= 2) // Flashvars=arg1=machin&arg2=truc genere plus de deux args
474
+				if (count($args) >= 2) {
475
+				    // Flashvars=arg1=machin&arg2=truc genere plus de deux args
475 476
 				{
476 477
 					$contexte[trim($args[0])] = substr($val, strlen($args[0]) + 1);
478
+				}
477 479
 				} else // notation abregee
478 480
 				{
479 481
 					$contexte[trim($val)] = trim($val);
@@ -676,8 +678,8 @@  discard block
 block discarded – undo
676 678
 function page_base_href(&$texte) {
677 679
 	static $set_html_base = null;
678 680
 	if (is_null($set_html_base)) {
679
-		if (!defined('_SET_HTML_BASE'))
680
-			// si la profondeur est superieure a 1
681
+		if (!defined('_SET_HTML_BASE')) {
682
+					// si la profondeur est superieure a 1
681 683
 			// est que ce n'est pas une url page ni une url action
682 684
 			// activer par defaut
683 685
 		{
@@ -685,6 +687,7 @@  discard block
 block discarded – undo
685 687
 				$GLOBALS['profondeur_url'] >= (_DIR_RESTREINT ? 1 : 2)
686 688
 				and _request(_SPIP_PAGE) !== 'login'
687 689
 				and !_request('action')) ? true : false);
690
+		}
688 691
 		} else {
689 692
 			$set_html_base = _SET_HTML_BASE;
690 693
 		}
@@ -742,8 +745,10 @@  discard block
 block discarded – undo
742 745
 // et demarrent par X-Spip-...
743 746
 // https://code.spip.net/@envoyer_entetes
744 747
 function envoyer_entetes($entetes) {
745
-	foreach ($entetes as $k => $v) #	if (strncmp($k, 'X-Spip-', 7))
748
+	foreach ($entetes as $k => $v) {
749
+	    #	if (strncmp($k, 'X-Spip-', 7))
746 750
 	{
747 751
 		@header(strlen($v) ? "$k: $v" : $k);
748 752
 	}
753
+	}
749 754
 }
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,10 +102,12 @@  discard block
 block discarded – undo
102 102
 
103 103
 	// si le plugin CFG est la, l'essayer
104 104
 	if (defined('_DIR_PLUGIN_CFG')) {
105
-		if (include_spip('inc/cfg')) // test CFG version >= 1.0.5
105
+		if (include_spip('inc/cfg')) {
106
+		    // test CFG version >= 1.0.5
106 107
 		{
107 108
 			if ($cfg = icone_lien_cfg("$dir$nom", "cfg")) {
108 109
 				return "<div class='cfg_link'>$cfg</div>";
110
+		}
109 111
 			}
110 112
 		}
111 113
 	}
@@ -174,8 +176,7 @@  discard block
 block discarded – undo
174 176
 	if (!$img) {
175 177
 		$img = http_img_pack("plugin-xx.svg", '', " width='32' height='32'");
176 178
 		$icon_class .= ' no-logo';
177
-	}
178
-	else {
179
+	} else {
179 180
 #		$img = "<img src='$img' width='32' height='32' alt='' />";
180 181
 	}
181 182
 	$i = "<div class='$icon_class'><a href='$url' rel='info'>$img</a></div>";
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
@@ -205,8 +205,7 @@
 block discarded – undo
205 205
 function heures_minutes($numdate, $forme='') {
206 206
 	if ($forme !='abbr') {
207 207
 		return _T('date_fmt_heures_minutes', array('h' => heures($numdate), 'm' => minutes($numdate)));
208
-	}
209
-	else {
208
+	} else {
210 209
 		return _T('date_fmt_heures_minutes_court', array('h' => heures($numdate), 'm' => minutes($numdate)));
211 210
 	}
212 211
 }
Please login to merge, or discard this patch.
ecrire/inc/lang.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 
42 42
 	if (is_null($liste_langues)) {
43 43
 		$liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'];
44
-	}
45
-	else {
44
+	} else {
46 45
 		if (is_array($liste_langues)) {
47 46
 			$liste_langues = implode(',', $liste_langues);
48 47
 		}
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
 		$rep = sous_repertoire(_DIR_CACHE, '', false, true);
59 59
 		$rep = sous_repertoire($rep, 'calcul/', false, true);
60 60
 		$rep = sous_repertoire($rep, $d, false, true);
61
-	}
62
-	else {
61
+	} else {
63 62
 		// en lecture on essaye pa de creer les repertoires, on va au plus vite
64 63
 		$rep = _DIR_CACHE . "$d/";
65 64
 	}
@@ -218,9 +217,11 @@  discard block
 block discarded – undo
218 217
 	// Sinon comparer l'age du fichier a sa duree de cache
219 218
 	$duree = intval($page['entetes']['X-Spip-Cache']);
220 219
 	$cache_mark = (isset($GLOBALS['meta']['cache_mark']) ? $GLOBALS['meta']['cache_mark'] : 0);
221
-	if ($duree == 0)  #CACHE{0}
220
+	if ($duree == 0) {
221
+	    #CACHE{0}
222 222
 	{
223 223
 		return -1;
224
+	}
224 225
 	} // sauf pour les bots, qui utilisent toujours le cache
225 226
 	else {
226 227
 		if ((!_IS_BOT and $date + $duree < $now)
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/utils.php 1 patch
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -358,8 +358,7 @@  discard block
 block discarded – undo
358 358
 	}
359 359
 	if (!isset($regs[2])) {
360 360
 		$niveau = _LOG_INFO;
361
-	}
362
-	else {
361
+	} else {
363 362
 		$niveau = intval($regs[2]);
364 363
 	}
365 364
 
@@ -1460,8 +1459,7 @@  discard block
 block discarded – undo
1460 1459
 		and $f = find_in_theme("$file_svg_generique")) {
1461 1460
 		if ($fsize = substr($f,0,-6) . $m[1] . ".svg" and file_exists($fsize)) {
1462 1461
 			return $themefiles["$subdir$file"] = $fsize;
1463
-		}
1464
-		else {
1462
+		} else {
1465 1463
 			return $themefiles["$subdir$file"] = "$f?".$m[1]."px";
1466 1464
 		}
1467 1465
 	}
@@ -2405,12 +2403,13 @@  discard block
 block discarded – undo
2405 2403
 		define('_DIR_CHMOD', $pi);
2406 2404
 	}
2407 2405
 
2408
-	if (!isset($GLOBALS['test_dirs']))
2409
-		// Pas $pi car il est bon de le mettre hors ecriture apres intstall
2406
+	if (!isset($GLOBALS['test_dirs'])) {
2407
+			// Pas $pi car il est bon de le mettre hors ecriture apres intstall
2410 2408
 		// il sera rajoute automatiquement si besoin a l'etape 2 de l'install
2411 2409
 	{
2412 2410
 		$GLOBALS['test_dirs'] = array($pa, $ti, $ta);
2413 2411
 	}
2412
+	}
2414 2413
 
2415 2414
 	// Declaration des fichiers
2416 2415
 
@@ -3478,8 +3477,7 @@  discard block
 block discarded – undo
3478 3477
 		if (!in_array('svg', $formats)) {
3479 3478
 			$formats[] = 'svg';
3480 3479
 		}
3481
-	}
3482
-	else {
3480
+	} else {
3483 3481
 		$formats = array_diff($formats, ['svg']);
3484 3482
 	}
3485 3483
 	return $formats;
Please login to merge, or discard this patch.
ecrire/inc/precharger_objet.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,8 +157,7 @@
 block discarded – undo
157 157
 			if (count($autre_langue) == 1) {
158 158
 				$row['lang'] = reset($autre_langue);
159 159
 			}
160
-		}
161
-		else {
160
+		} else {
162 161
 			$row['lang'] = 'en';
163 162
 		}
164 163
 
Please login to merge, or discard this patch.