Completed
Pull Request — master (#36)
by
unknown
06:08
created
ecrire/public/criteres.php 1 patch
Braces   +14 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1478,10 +1478,12 @@  discard block
 block discarded – undo
1478 1478
 	if ($crit->cond) {
1479 1479
 		$pred = calculer_argument_precedent($idb, $col, $boucles);
1480 1480
 		$where = array("'?'", $pred, $where, "''");
1481
-		if ($where_complement) // condition annexe du type "AND (objet='article')"
1481
+		if ($where_complement) {
1482
+		    // condition annexe du type "AND (objet='article')"
1482 1483
 		{
1483 1484
 			$where_complement = array("'?'", $pred, $where_complement, "''");
1484 1485
 		}
1486
+		}
1485 1487
 	}
1486 1488
 	if ($crit->exclus) {
1487 1489
 		if (!preg_match(",^L[0-9]+[.],", $arg)) {
@@ -1502,10 +1504,12 @@  discard block
 block discarded – undo
1502 1504
 	}
1503 1505
 
1504 1506
 	$boucles[$idb]->where[] = $where;
1505
-	if ($where_complement) // condition annexe du type "AND (objet='article')"
1507
+	if ($where_complement) {
1508
+	    // condition annexe du type "AND (objet='article')"
1506 1509
 	{
1507 1510
 		$boucles[$idb]->where[] = $where_complement;
1508 1511
 	}
1512
+	}
1509 1513
 }
1510 1514
 
1511 1515
 // http://code.spip.net/@critere_IN_cas
@@ -1755,17 +1759,21 @@  discard block
 block discarded – undo
1755 1759
 			);
1756 1760
 		}
1757 1761
 		$where = array("'?'", "!(is_array($pred)?count($pred):strlen($pred))", "''", $where);
1758
-		if ($where_complement) // condition annexe du type "AND (objet='article')"
1762
+		if ($where_complement) {
1763
+		    // condition annexe du type "AND (objet='article')"
1759 1764
 		{
1760 1765
 			$where_complement = array("'?'", "!(is_array($pred)?count($pred):strlen($pred))", "''", $where_complement);
1761 1766
 		}
1767
+		}
1762 1768
 	}
1763 1769
 
1764 1770
 	$boucles[$idb]->where[] = $where;
1765
-	if ($where_complement) // condition annexe du type "AND (objet='article')"
1771
+	if ($where_complement) {
1772
+	    // condition annexe du type "AND (objet='article')"
1766 1773
 	{
1767 1774
 		$boucles[$idb]->where[] = $where_complement;
1768 1775
 	}
1776
+	}
1769 1777
 }
1770 1778
 
1771 1779
 
@@ -1876,8 +1884,7 @@  discard block
 block discarded – undo
1876 1884
 						// Champ joker * des iterateurs DATA qui accepte tout
1877 1885
 						if (@array_key_exists('*', $desc['field'])) {
1878 1886
 							$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
1879
-						}
1880
-						else {
1887
+						} else {
1881 1888
 							$r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table);
1882 1889
 							if (!$r) {
1883 1890
 								return '';
@@ -1919,8 +1926,7 @@  discard block
 block discarded – undo
1919 1926
 				. ((isset($r[2]) and $r[2]) ? $r[2] : ",''")
1920 1927
 				. ",'" . addslashes($type_cast_quote) . "'";
1921 1928
 			$val[0] = "sql_quote($r)";
1922
-		}
1923
-		elseif(strpos($val[0], '@@defaultcast@@') !== false
1929
+		} elseif(strpos($val[0], '@@defaultcast@@') !== false
1924 1930
 		  and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)) {
1925 1931
 			$val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')";
1926 1932
 		}
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,11 +50,9 @@
 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
 
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1127,10 +1127,12 @@  discard block
 block discarded – undo
1127 1127
 					}
1128 1128
 					$nom = $nomlower;
1129 1129
 					// une action vide est une declaration qui ne doit pas etre compilee !
1130
-					if (!isset($GLOBALS['spip_pipeline'][$nom])) // creer le pipeline eventuel
1130
+					if (!isset($GLOBALS['spip_pipeline'][$nom])) {
1131
+					    // creer le pipeline eventuel
1131 1132
 					{
1132 1133
 						$GLOBALS['spip_pipeline'][$nom] = "";
1133 1134
 					}
1135
+					}
1134 1136
 					if ($action) {
1135 1137
 						if (strpos($GLOBALS['spip_pipeline'][$nom], "|$prefix$action") === false) {
1136 1138
 							$GLOBALS['spip_pipeline'][$nom] = preg_replace(",(\|\||$),", "|$prefix$action\\1",
@@ -1373,8 +1375,7 @@  discard block
 block discarded – undo
1373 1375
 	if (file_exists($nom)) {
1374 1376
 		if (substr($nom, -4) == '.php') {
1375 1377
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1376
-		}
1377
-		else {
1378
+		} else {
1378 1379
 			$fichier_tmp = $nom . '.tmp';
1379 1380
 		}
1380 1381
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1256,8 +1256,9 @@
 block discarded – undo
1256 1256
 	$http_noproxy = " $http_noproxy ";
1257 1257
 	$domain = $host;
1258 1258
 	// si le domaine exact www.example.org est dans les exceptions
1259
-	if (strpos($http_noproxy, " $domain ") !== false)
1260
-		return '';
1259
+	if (strpos($http_noproxy, " $domain ") !== false) {
1260
+			return '';
1261
+	}
1261 1262
 
1262 1263
 	while (strpos($domain, '.') !== false) {
1263 1264
 		$domain = explode('.', $domain);
Please login to merge, or discard this patch.
ecrire/public/composer.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	if (lire_fichier($source, $skel)) {
81 81
 		$compiler = charger_fonction('compiler', 'public');
82 82
 		$skel_code = $compiler($skel, $nom, $gram, $source, $connect);
83
+	} else {
84
+			$skel_code='';
83 85
 	}
84
-	else
85
-		$skel_code='';
86 86
 
87 87
 	// Ne plus rien faire si le compilateur n'a pas pu operer.
88 88
 	if (!$skel_code) {
@@ -359,10 +359,12 @@  discard block
 block discarded – undo
359 359
 
360 360
 	// et reparagrapher si necessaire (coherence avec le cas descriptif)
361 361
 	// une introduction a tojours un <p>
362
-	if ($GLOBALS['toujours_paragrapher']) // Fermer les paragraphes
362
+	if ($GLOBALS['toujours_paragrapher']) {
363
+	    // Fermer les paragraphes
363 364
 	{
364 365
 		$texte = paragrapher($texte, $GLOBALS['toujours_paragrapher']);
365 366
 	}
367
+	}
366 368
 
367 369
 	return $texte;
368 370
 }
Please login to merge, or discard this patch.