Completed
Push — master ( d58a44...9f5c8b )
by cam
04:31
created
ecrire/req/mysql.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	// si port est fourni mais pas host, c'est un socket -> compat avec vieille syntaxe de mysql_connect() et anciens fichiers connect.php
49 49
 	if (
50 50
 		$port and !is_numeric($socket = $port)
51
-		and (!$host or $host=='localhost')) {
51
+		and (!$host or $host == 'localhost')) {
52 52
 		$link = @mysqli_connect($host, $login, $pass, '', null, $socket);
53 53
 	}
54 54
 	elseif ($port) {
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 
61 61
 	if (!$link) {
62
-		spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS);
62
+		spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS);
63 63
 
64 64
 		return false;
65 65
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		}
77 77
 	}
78 78
 
79
-	spip_log("Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? "operationnelle" : 'impossible'),
79
+	spip_log("Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? "operationnelle" : 'impossible'),
80 80
 		_LOG_DEBUG);
81 81
 
82 82
 	return !$ok ? false : array(
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
  */
166 166
 function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) {
167 167
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
168
-	spip_log("changement de charset sql : " . "SET NAMES " . _q($charset), _LOG_DEBUG);
168
+	spip_log("changement de charset sql : "."SET NAMES "._q($charset), _LOG_DEBUG);
169 169
 
170
-	return mysqli_query($connexion['link'], $connexion['last'] = "SET NAMES " . _q($charset));
170
+	return mysqli_query($connexion['link'], $connexion['last'] = "SET NAMES "._q($charset));
171 171
 }
172 172
 
173 173
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 function spip_mysql_get_charset($charset = array(), $serveur = '', $requeter = true) {
183 183
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
184 184
 	$connexion['last'] = $c = "SHOW CHARACTER SET"
185
-		. (!$charset ? '' : (" LIKE " . _q($charset['charset'])));
185
+		. (!$charset ? '' : (" LIKE "._q($charset['charset'])));
186 186
 
187 187
 	return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur);
188 188
 }
@@ -242,19 +242,19 @@  discard block
 block discarded – undo
242 242
 	$debug = '';
243 243
 	if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) {
244 244
 		if (isset($GLOBALS['debug']['aucasou'])) {
245
-			list(, $id, , $infos) = $GLOBALS['debug']['aucasou'];
246
-			$debug .= "BOUCLE$id @ " . (isset($infos[0]) ? $infos[0] : '') . " | ";
245
+			list(, $id,, $infos) = $GLOBALS['debug']['aucasou'];
246
+			$debug .= "BOUCLE$id @ ".(isset($infos[0]) ? $infos[0] : '')." | ";
247 247
 		}
248 248
 		if (isset($_SERVER['REQUEST_URI'])) {
249 249
 			$debug .= $_SERVER['REQUEST_URI'];
250 250
 		}
251 251
 		if (!empty($GLOBALS['ip'])) {
252
-			$debug .= ' + ' . $GLOBALS['ip'];
252
+			$debug .= ' + '.$GLOBALS['ip'];
253 253
 		}
254
-		$debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */';
254
+		$debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */';
255 255
 	}
256 256
 
257
-	$r = mysqli_query($link, $query . $debug);
257
+	$r = mysqli_query($link, $query.$debug);
258 258
 
259 259
 	//Eviter de propager le GoneAway sur les autres requetes d'un même processus PHP
260 260
 	if ($e = spip_mysql_errno($serveur)) {  // Log d'un Gone Away
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 			$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
268 268
 			$link = $connexion['link'];
269 269
 			//On retente au cas où
270
-			$r = mysqli_query($link, $query . $debug);
270
+			$r = mysqli_query($link, $query.$debug);
271 271
 		}
272 272
 	}
273 273
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	// d'utiliser ceux-ci, copie-colle de phpmyadmin
296 296
 	$query = preg_replace(",^TABLE\s*`([^`]*)`,i", "TABLE \\1", $query);
297 297
 
298
-	return spip_mysql_query("ALTER " . $query, $serveur, $requeter); # i.e. que PG se debrouille
298
+	return spip_mysql_query("ALTER ".$query, $serveur, $requeter); # i.e. que PG se debrouille
299 299
 }
300 300
 
301 301
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
  * @return bool            Toujours true
309 309
  */
310 310
 function spip_mysql_optimize($table, $serveur = '', $requeter = true) {
311
-	spip_mysql_query("OPTIMIZE TABLE " . $table);
311
+	spip_mysql_query("OPTIMIZE TABLE ".$table);
312 312
 
313 313
 	return true;
314 314
 }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	$link = $connexion['link'];
332 332
 	$db = $connexion['db'];
333 333
 
334
-	$query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe);
334
+	$query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe);
335 335
 	$r = mysqli_query($link, $query);
336 336
 
337 337
 	return spip_mysql_fetch($r, null, $serveur);
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		. calculer_mysql_expression('WHERE', $where)
383 383
 		. calculer_mysql_expression('GROUP BY', $groupby, ',')
384 384
 		. calculer_mysql_expression('HAVING', $having)
385
-		. ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '')
385
+		. ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '')
386 386
 		. ($limit ? "\nLIMIT $limit" : '');
387 387
 
388 388
 	// renvoyer la requete inerte si demandee
@@ -472,12 +472,12 @@  discard block
 block discarded – undo
472 472
 	$exp = "\n$expression ";
473 473
 
474 474
 	if (!is_array($v)) {
475
-		return $exp . $v;
475
+		return $exp.$v;
476 476
 	} else {
477 477
 		if (strtoupper($join) === 'AND') {
478
-			return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v));
478
+			return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v));
479 479
 		} else {
480
-			return $exp . join($join, $v);
480
+			return $exp.join($join, $v);
481 481
 		}
482 482
 	}
483 483
 }
@@ -495,17 +495,17 @@  discard block
 block discarded – undo
495 495
 		if (substr($k, -1) == '@') {
496 496
 			// c'est une jointure qui se refere au from precedent
497 497
 			// pas de virgule
498
-			$res .= '  ' . $v;
498
+			$res .= '  '.$v;
499 499
 		} else {
500 500
 			if (!is_numeric($k)) {
501 501
 				$p = strpos($v, " ");
502 502
 				if ($p) {
503
-					$v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p);
503
+					$v = substr($v, 0, $p)." AS `$k`".substr($v, $p);
504 504
 				} else {
505 505
 					$v .= " AS `$k`";
506 506
 				}
507 507
 			}
508
-			$res .= ', ' . $v;
508
+			$res .= ', '.$v;
509 509
 		}
510 510
 	}
511 511
 
@@ -534,13 +534,13 @@  discard block
 block discarded – undo
534 534
 function _mysql_traite_query($query, $db = '', $prefixe = '') {
535 535
 
536 536
 	if ($GLOBALS['mysql_rappel_nom_base'] and $db) {
537
-		$pref = '`' . $db . '`.';
537
+		$pref = '`'.$db.'`.';
538 538
 	} else {
539 539
 		$pref = '';
540 540
 	}
541 541
 
542 542
 	if ($prefixe) {
543
-		$pref .= $prefixe . "_";
543
+		$pref .= $prefixe."_";
544 544
 	}
545 545
 
546 546
 	if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
@@ -554,12 +554,12 @@  discard block
 block discarded – undo
554 554
 		if (stripos($suite, "SELECT") !== false) {
555 555
 			list($suite, $textes) = query_echappe_textes($suite);
556 556
 			if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite, $r)) {
557
-				$suite = $r[1] . _mysql_traite_query($r[2], $db, $prefixe);
557
+				$suite = $r[1]._mysql_traite_query($r[2], $db, $prefixe);
558 558
 			}
559 559
 			$suite = query_reinjecte_textes($suite, $textes);
560 560
 		}
561 561
 	}
562
-	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite;
562
+	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite;
563 563
 
564 564
 	// en option, remplacer les emoji (que mysql ne sait pas gérer) en 💩
565 565
 	if (defined('_MYSQL_NOPLANES') and _MYSQL_NOPLANES and lire_meta('charset_sql_connexion') == 'utf8') {
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 	$link = _mysql_link($serveur);
590 590
 	$ok = mysqli_select_db($link, $db);
591 591
 	if (!$ok) {
592
-		spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE);
592
+		spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE);
593 593
 	}
594 594
 
595 595
 	return $ok;
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
 
680 680
 	$character_set = "";
681 681
 	if (@$GLOBALS['meta']['charset_sql_base']) {
682
-		$character_set .= " CHARACTER SET " . $GLOBALS['meta']['charset_sql_base'];
682
+		$character_set .= " CHARACTER SET ".$GLOBALS['meta']['charset_sql_base'];
683 683
 	}
684 684
 	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
685
-		$character_set .= " COLLATE " . $GLOBALS['meta']['charset_collation_sql_base'];
685
+		$character_set .= " COLLATE ".$GLOBALS['meta']['charset_collation_sql_base'];
686 686
 	}
687 687
 
688 688
 	foreach ($champs as $k => $v) {
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 			if (preg_match(',(char|text),i', $defs[1])
692 692
 				and !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
693 693
 			) {
694
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
694
+				$v = $defs[1].$character_set.' '.substr($v, strlen($defs[1]));
695 695
 			}
696 696
 		}
697 697
 
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$s = ",";
704 704
 	}
705 705
 	$temporary = $temporary ? 'TEMPORARY' : '';
706
-	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ")"
706
+	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').")"
707 707
 		. " ENGINE=MyISAM"
708 708
 		. ($character_set ? " DEFAULT $character_set" : "")
709 709
 		. "\n";
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 		return false;
784 784
 	}
785 785
 
786
-	$query = "CREATE VIEW $nom AS " . $query_select;
786
+	$query = "CREATE VIEW $nom AS ".$query_select;
787 787
 
788 788
 	return spip_mysql_query($query, $serveur, $requeter);
789 789
 }
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
  *     Ressource à utiliser avec sql_fetch()
842 842
  **/
843 843
 function spip_mysql_showbase($match, $serveur = '', $requeter = true) {
844
-	return spip_mysql_query("SHOW TABLES LIKE " . _q($match), $serveur, $requeter);
844
+	return spip_mysql_query("SHOW TABLES LIKE "._q($match), $serveur, $requeter);
845 845
 }
846 846
 
847 847
 /**
@@ -935,22 +935,22 @@  discard block
 block discarded – undo
935 935
 			}
936 936
 			if ($val['Default'] === '0' || $val['Default']) {
937 937
 				if (preg_match('/[A-Z_]/', $val['Default'])) {
938
-					$nfields[$val["Field"]] .= ' DEFAULT ' . $val['Default'];
938
+					$nfields[$val["Field"]] .= ' DEFAULT '.$val['Default'];
939 939
 				} else {
940
-					$nfields[$val["Field"]] .= " DEFAULT '" . $val['Default'] . "'";
940
+					$nfields[$val["Field"]] .= " DEFAULT '".$val['Default']."'";
941 941
 				}
942 942
 			}
943 943
 			if ($val['Extra']) {
944
-				$nfields[$val["Field"]] .= ' ' . $val['Extra'];
944
+				$nfields[$val["Field"]] .= ' '.$val['Extra'];
945 945
 			}
946 946
 			if ($val['Key'] == 'PRI') {
947 947
 				$nkeys['PRIMARY KEY'] = $val["Field"];
948 948
 			} else {
949 949
 				if ($val['Key'] == 'MUL') {
950
-					$nkeys['KEY ' . $val["Field"]] = $val["Field"];
950
+					$nkeys['KEY '.$val["Field"]] = $val["Field"];
951 951
 				} else {
952 952
 					if ($val['Key'] == 'UNI') {
953
-						$nkeys['UNIQUE KEY ' . $val["Field"]] = $val["Field"];
953
+						$nkeys['UNIQUE KEY '.$val["Field"]] = $val["Field"];
954 954
 					}
955 955
 				}
956 956
 			}
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 	$serveur = '',
1022 1022
 	$requeter = true
1023 1023
 ) {
1024
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1024
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
1025 1025
 
1026 1026
 	$r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1027 1027
 	if (!$requeter) {
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 	if ($s) {
1062 1062
 		$trace = debug_backtrace();
1063 1063
 		if ($trace[0]['function'] != "spip_mysql_error") {
1064
-			spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1064
+			spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR);
1065 1065
 		}
1066 1066
 	}
1067 1067
 
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 		$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1220 1220
 	}
1221 1221
 
1222
-	return spip_mysql_insert($table, "(" . join(',', array_keys($couples)) . ")", "(" . join(',', $couples) . ")", $desc,
1222
+	return spip_mysql_insert($table, "(".join(',', array_keys($couples)).")", "(".join(',', $couples).")", $desc,
1223 1223
 		$serveur, $requeter);
1224 1224
 }
1225 1225
 
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 	}
1254 1254
 	$fields = isset($desc['field']) ? $desc['field'] : array();
1255 1255
 
1256
-	$cles = "(" . join(',', array_keys(reset($tab_couples))) . ')';
1256
+	$cles = "(".join(',', array_keys(reset($tab_couples))).')';
1257 1257
 	$valeurs = array();
1258 1258
 	$r = false;
1259 1259
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 		foreach ($couples as $champ => $val) {
1263 1263
 			$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1264 1264
 		}
1265
-		$valeurs[] = '(' . join(',', $couples) . ')';
1265
+		$valeurs[] = '('.join(',', $couples).')';
1266 1266
 		if (count($valeurs) >= 100) {
1267 1267
 			$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1268 1268
 			$valeurs = array();
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
 function spip_mysql_update($table, $champs, $where = '', $desc = array(), $serveur = '', $requeter = true) {
1300 1300
 	$set = array();
1301 1301
 	foreach ($champs as $champ => $val) {
1302
-		$set[] = $champ . "=$val";
1302
+		$set[] = $champ."=$val";
1303 1303
 	}
1304 1304
 	if (!empty($set)) {
1305 1305
 		return spip_mysql_query(
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
 	}
1354 1354
 	$set = array();
1355 1355
 	foreach ($champs as $champ => $val) {
1356
-		$set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1356
+		$set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]);
1357 1357
 	}
1358 1358
 
1359 1359
 	return spip_mysql_query(
@@ -1418,8 +1418,8 @@  discard block
 block discarded – undo
1418 1418
  *     - False en cas d'erreur.
1419 1419
  **/
1420 1420
 function spip_mysql_replace($table, $couples, $desc = array(), $serveur = '', $requeter = true) {
1421
-	return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(',',
1422
-			array_map('_q', $couples)) . ')', $serveur, $requeter);
1421
+	return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join(',',
1422
+			array_map('_q', $couples)).')', $serveur, $requeter);
1423 1423
 }
1424 1424
 
1425 1425
 
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
  *     - False en cas d'erreur.
1449 1449
  **/
1450 1450
 function spip_mysql_replace_multi($table, $tab_couples, $desc = array(), $serveur = '', $requeter = true) {
1451
-	$cles = "(" . join(',', array_keys($tab_couples[0])) . ')';
1451
+	$cles = "(".join(',', array_keys($tab_couples[0])).')';
1452 1452
 	$valeurs = array();
1453 1453
 	foreach ($tab_couples as $couples) {
1454
-		$valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1454
+		$valeurs[] = '('.join(',', array_map('_q', $couples)).')';
1455 1455
 	}
1456 1456
 	$valeurs = implode(', ', $valeurs);
1457 1457
 
@@ -1471,28 +1471,28 @@  discard block
 block discarded – undo
1471 1471
  */
1472 1472
 function spip_mysql_multi($objet, $lang) {
1473 1473
 	$lengthlang = strlen("[$lang]");
1474
-	$posmulti = "INSTR(" . $objet . ", '<multi>')";
1475
-	$posfinmulti = "INSTR(" . $objet . ", '</multi>')";
1476
-	$debutchaine = "LEFT(" . $objet . ", $posmulti-1)";
1477
-	$finchaine = "RIGHT(" . $objet . ", CHAR_LENGTH(" . $objet . ") -(7+$posfinmulti))";
1478
-	$chainemulti = "TRIM(SUBSTRING(" . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1479
-	$poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1474
+	$posmulti = "INSTR(".$objet.", '<multi>')";
1475
+	$posfinmulti = "INSTR(".$objet.", '</multi>')";
1476
+	$debutchaine = "LEFT(".$objet.", $posmulti-1)";
1477
+	$finchaine = "RIGHT(".$objet.", CHAR_LENGTH(".$objet.") -(7+$posfinmulti))";
1478
+	$chainemulti = "TRIM(SUBSTRING(".$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1479
+	$poslang = "INSTR($chainemulti,'[".$lang."]')";
1480 1480
 	$poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1481
-	$chainelang = "TRIM(SUBSTRING(" . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1482
-	$posfinlang = "INSTR(" . $chainelang . ", '[')";
1481
+	$chainelang = "TRIM(SUBSTRING(".$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1482
+	$posfinlang = "INSTR(".$chainelang.", '[')";
1483 1483
 	$chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1484 1484
 	//$chainelang = "LEFT($chainelang,$posfinlang-1)";
1485
-	$retour = "(TRIM(IF($posmulti = 0 , " .
1486
-		"     TRIM(" . $objet . "), " .
1487
-		"     CONCAT( " .
1488
-		"          $debutchaine, " .
1489
-		"          IF( " .
1490
-		"               $poslang = 0, " .
1491
-		"                     $chainemulti, " .
1492
-		"               $chainelang" .
1493
-		"          ), " .
1494
-		"          $finchaine" .
1495
-		"     ) " .
1485
+	$retour = "(TRIM(IF($posmulti = 0 , ".
1486
+		"     TRIM(".$objet."), ".
1487
+		"     CONCAT( ".
1488
+		"          $debutchaine, ".
1489
+		"          IF( ".
1490
+		"               $poslang = 0, ".
1491
+		"                     $chainemulti, ".
1492
+		"               $chainelang".
1493
+		"          ), ".
1494
+		"          $finchaine".
1495
+		"     ) ".
1496 1496
 		"))) AS multi";
1497 1497
 
1498 1498
 	return $retour;
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
  *     Valeur hexadécimale pour MySQL
1510 1510
  **/
1511 1511
 function spip_mysql_hex($v) {
1512
-	return "0x" . $v;
1512
+	return "0x".$v;
1513 1513
 }
1514 1514
 
1515 1515
 /**
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
  *     Expression SQL
1550 1550
  **/
1551 1551
 function spip_mysql_date_proche($champ, $interval, $unite) {
1552
-	$use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false );
1552
+	$use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false);
1553 1553
 	return '('
1554 1554
 	. $champ
1555 1555
 	. (($interval <= 0) ? '>' : '<')
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 		if (is_numeric($v)) {
1601 1601
 			return strval($v);
1602 1602
 		}
1603
-		return "'" . addslashes($v) . "'";
1603
+		return "'".addslashes($v)."'";
1604 1604
 	}
1605 1605
 
1606 1606
 	if (is_null($v)
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 		}
1623 1623
 	}
1624 1624
 
1625
-	return ("'" . addslashes($v) . "'");
1625
+	return ("'".addslashes($v)."'");
1626 1626
 }
1627 1627
 
1628 1628
 
@@ -1651,9 +1651,9 @@  discard block
 block discarded – undo
1651 1651
 	$connexion = &$GLOBALS['connexions'][0];
1652 1652
 	$bd = $connexion['db'];
1653 1653
 	$prefixe = $connexion['prefixe'];
1654
-	$nom = "$bd:$prefixe:$nom" . _LOCK_TIME;
1654
+	$nom = "$bd:$prefixe:$nom"._LOCK_TIME;
1655 1655
 
1656
-	$connexion['last'] = $q = "SELECT GET_LOCK(" . _q($nom) . ", $timeout) AS n";
1656
+	$connexion['last'] = $q = "SELECT GET_LOCK("._q($nom).", $timeout) AS n";
1657 1657
 
1658 1658
 	$q = @sql_fetch(mysqli_query(_mysql_link(), $q));
1659 1659
 	if (!$q) {
@@ -1680,9 +1680,9 @@  discard block
 block discarded – undo
1680 1680
 	$connexion = &$GLOBALS['connexions'][0];
1681 1681
 	$bd = $connexion['db'];
1682 1682
 	$prefixe = $connexion['prefixe'];
1683
-	$nom = "$bd:$prefixe:$nom" . _LOCK_TIME;
1683
+	$nom = "$bd:$prefixe:$nom"._LOCK_TIME;
1684 1684
 
1685
-	$connexion['last'] = $q = "SELECT RELEASE_LOCK(" . _q($nom) . ")";
1685
+	$connexion['last'] = $q = "SELECT RELEASE_LOCK("._q($nom).")";
1686 1686
 	mysqli_query(_mysql_link(), $q);
1687 1687
 }
1688 1688
 
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
 	} else {
1719 1719
 		$GLOBALS['mysql_rappel_nom_base'] = false;
1720 1720
 
1721
-		return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1721
+		return "\$GLOBALS['mysql_rappel_nom_base'] = false; ".
1722 1722
 		"/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1723 1723
 	}
1724 1724
 }
Please login to merge, or discard this patch.