Completed
Push — master ( b5065b...b2f238 )
by cam
01:06
created
ecrire/req/pg.exp.php 1 patch
Spacing   +83 added lines, -84 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	if (!$link) {
65 65
 		$erreurs[] = pg_last_error();
66 66
 		foreach ($erreurs as $e) {
67
-			spip_log('Echec pg_connect. Erreur : ' . $e, 'pg.' . _LOG_HS);
67
+			spip_log('Echec pg_connect. Erreur : '.$e, 'pg.'._LOG_HS);
68 68
 		}
69 69
 
70 70
 		return false;
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 	spip_log(
85
-		"Connexion vers $host, base $db, prefixe $prefixe " . ($link ? 'operationnelle' : 'impossible'),
86
-		'pg.' . _LOG_DEBUG
85
+		"Connexion vers $host, base $db, prefixe $prefixe ".($link ? 'operationnelle' : 'impossible'),
86
+		'pg.'._LOG_DEBUG
87 87
 	);
88 88
 
89 89
 	return !$link ? false : [
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	} else {
172 172
 		$suite = '';
173 173
 	}
174
-	$query = preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
174
+	$query = preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite;
175 175
 
176 176
 	// renvoyer la requete inerte si demandee
177 177
 	if (!$requeter) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	// ou revoir l'api de sql_alter en creant un
240 240
 	// sql_alter_table($table,array($actions));
241 241
 	if (!preg_match('/\s*((\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
242
-		spip_log("$query mal comprise", 'pg.' . _LOG_ERREUR);
242
+		spip_log("$query mal comprise", 'pg.'._LOG_ERREUR);
243 243
 
244 244
 		return false;
245 245
 	}
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	$i = 0;
253 253
 	$ouverte = false;
254 254
 	while ($do = array_shift($todo)) {
255
-		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
255
+		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i].','.$do : $do;
256 256
 		$o = (false !== strpos($do, '('));
257 257
 		$f = (false !== strpos($do, ')'));
258 258
 		if ($o and !$f) {
@@ -265,33 +265,33 @@  discard block
 block discarded – undo
265 265
 		}
266 266
 	}
267 267
 	$todo = $todo2;
268
-	$query = $debut . ' ' . array_shift($todo);
268
+	$query = $debut.' '.array_shift($todo);
269 269
 
270 270
 	if (!preg_match('/^\s*(IGNORE\s*)?TABLE\s+(\w+)\s+(ADD|DROP|CHANGE|MODIFY|RENAME)\s*(.*)$/is', $query, $r)) {
271
-		spip_log("$query incompris", 'pg.' . _LOG_ERREUR);
271
+		spip_log("$query incompris", 'pg.'._LOG_ERREUR);
272 272
 	} else {
273 273
 		if ($r[1]) {
274
-			spip_log("j'ignore IGNORE dans $query", 'pg.' . _LOG_AVERTISSEMENT);
274
+			spip_log("j'ignore IGNORE dans $query", 'pg.'._LOG_AVERTISSEMENT);
275 275
 		}
276
-		$f = 'spip_pg_alter_' . strtolower($r[3]);
276
+		$f = 'spip_pg_alter_'.strtolower($r[3]);
277 277
 		if (function_exists($f)) {
278 278
 			$f($r[2], $r[4], $serveur, $requeter);
279 279
 		} else {
280
-			spip_log("$query non prevu", 'pg.' . _LOG_ERREUR);
280
+			spip_log("$query non prevu", 'pg.'._LOG_ERREUR);
281 281
 		}
282 282
 	}
283 283
 	// Alter a plusieurs args. Faudrait optimiser.
284 284
 	if ($todo) {
285
-		spip_pg_alter("TABLE $table " . join(',', $todo));
285
+		spip_pg_alter("TABLE $table ".join(',', $todo));
286 286
 	}
287 287
 }
288 288
 
289 289
 function spip_pg_alter_change($table, $arg, $serveur = '', $requeter = true) {
290 290
 	if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) {
291
-		spip_log("alter change: $arg  incompris", 'pg.' . _LOG_ERREUR);
291
+		spip_log("alter change: $arg  incompris", 'pg.'._LOG_ERREUR);
292 292
 	} else {
293 293
 		[, $old, $new, $type, $default, $null, $def2] = $r;
294
-		$actions = ["ALTER $old TYPE " . mysql2pg_type($type)];
294
+		$actions = ["ALTER $old TYPE ".mysql2pg_type($type)];
295 295
 		if ($null) {
296 296
 			$actions[] = "ALTER $old SET NOT NULL";
297 297
 		} else {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			$actions[] = "ALTER $old DROP DEFAULT";
305 305
 		}
306 306
 
307
-		spip_pg_query("ALTER TABLE $table " . join(', ', $actions));
307
+		spip_pg_query("ALTER TABLE $table ".join(', ', $actions));
308 308
 
309 309
 		if ($old != $new) {
310 310
 			spip_pg_query("ALTER TABLE $table RENAME $old TO $new", $serveur);
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 function spip_pg_alter_add($table, $arg, $serveur = '', $requeter = true) {
316 316
 	$nom_index = null;
317 317
 	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*(.*)$/', $arg, $r)) {
318
-		spip_log("alter add $arg  incompris", 'pg.' . _LOG_ERREUR);
318
+		spip_log("alter add $arg  incompris", 'pg.'._LOG_ERREUR);
319 319
 
320 320
 		return null;
321 321
 	}
@@ -325,14 +325,14 @@  discard block
 block discarded – undo
325 325
 			$m[2] = $n[1];
326 326
 		}
327 327
 
328
-		return spip_pg_query("ALTER TABLE $table ADD " . $m[1] . ' ' . mysql2pg_type($m[2]), $serveur, $requeter);
328
+		return spip_pg_query("ALTER TABLE $table ADD ".$m[1].' '.mysql2pg_type($m[2]), $serveur, $requeter);
329 329
 	} elseif ($r[1][0] == 'P') {
330 330
 		// la primary peut etre sur plusieurs champs
331 331
 		$r[2] = trim(str_replace('`', '', $r[2]));
332 332
 		$m = ($r[2][0] == '(') ? substr($r[2], 1, -1) : $r[2];
333 333
 
334 334
 		return spip_pg_query(
335
-			"ALTER TABLE $table ADD CONSTRAINT $table" . '_pkey PRIMARY KEY (' . $m . ')',
335
+			"ALTER TABLE $table ADD CONSTRAINT $table".'_pkey PRIMARY KEY ('.$m.')',
336 336
 			$serveur,
337 337
 			$requeter
338 338
 		);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 				$colonnes = substr($m[1], 1, -1);
352 352
 				if (false !== strpos(',', $colonnes)) {
353 353
 					spip_log('PG : Erreur, impossible de creer un index sur plusieurs colonnes'
354
-						. " sans qu'il ait de nom ($table, ($colonnes))", 'pg.' . _LOG_ERREUR);
354
+						. " sans qu'il ait de nom ($table, ($colonnes))", 'pg.'._LOG_ERREUR);
355 355
 				} else {
356 356
 					$nom_index = $colonnes;
357 357
 				}
@@ -367,23 +367,23 @@  discard block
 block discarded – undo
367 367
 
368 368
 function spip_pg_alter_drop($table, $arg, $serveur = '', $requeter = true) {
369 369
 	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*`?(\w*)`?/', $arg, $r)) {
370
-		spip_log("alter drop: $arg  incompris", 'pg.' . _LOG_ERREUR);
370
+		spip_log("alter drop: $arg  incompris", 'pg.'._LOG_ERREUR);
371 371
 	} else {
372 372
 		if (!$r[1] or $r[1] == 'COLUMN') {
373
-			return spip_pg_query("ALTER TABLE $table DROP " . $r[2], $serveur);
373
+			return spip_pg_query("ALTER TABLE $table DROP ".$r[2], $serveur);
374 374
 		} elseif ($r[1][0] == 'P') {
375
-			return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table" . '_pkey', $serveur);
375
+			return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table".'_pkey', $serveur);
376 376
 		} else {
377
-			return spip_pg_query('DROP INDEX ' . $table . '_' . $r[2], $serveur);
377
+			return spip_pg_query('DROP INDEX '.$table.'_'.$r[2], $serveur);
378 378
 		}
379 379
 	}
380 380
 }
381 381
 
382 382
 function spip_pg_alter_modify($table, $arg, $serveur = '', $requeter = true) {
383 383
 	if (!preg_match('/^`?(\w+)`?\s+(.*)$/', $arg, $r)) {
384
-		spip_log("alter modify: $arg  incompris", 'pg.' . _LOG_ERREUR);
384
+		spip_log("alter modify: $arg  incompris", 'pg.'._LOG_ERREUR);
385 385
 	} else {
386
-		return spip_pg_alter_change($table, $r[1] . ' ' . $arg, $serveur = '', $requeter = true);
386
+		return spip_pg_alter_change($table, $r[1].' '.$arg, $serveur = '', $requeter = true);
387 387
 	}
388 388
 }
389 389
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	} elseif (preg_match('/^(TO)\s*`?(\w*)`?/', $arg, $r)) {
400 400
 		$rename = $r[2];
401 401
 	} else {
402
-		spip_log("alter rename: $arg  incompris", 'pg.' . _LOG_ERREUR);
402
+		spip_log("alter rename: $arg  incompris", 'pg.'._LOG_ERREUR);
403 403
 	}
404 404
 
405 405
 	return $rename ? spip_pg_query("ALTER TABLE $table RENAME TO $rename") : false;
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
 function spip_pg_create_index($nom, $table, $champs, $serveur = '', $requeter = true) {
421 421
 	if (!($nom or $table or $champs)) {
422 422
 		spip_log(
423
-			"Champ manquant pour creer un index pg ($nom, $table, (" . @join(',', $champs) . '))',
424
-			'pg.' . _LOG_ERREUR
423
+			"Champ manquant pour creer un index pg ($nom, $table, (".@join(',', $champs).'))',
424
+			'pg.'._LOG_ERREUR
425 425
 		);
426 426
 
427 427
 		return false;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 	// PG ne differentie pas noms des index en fonction des tables
434 434
 	// il faut donc creer des noms uniques d'index pour une base pg
435
-	$nom = $table . '_' . $nom;
435
+	$nom = $table.'_'.$nom;
436 436
 	// enlever d'eventuelles parentheses deja presentes sur champs
437 437
 	if (!is_array($champs)) {
438 438
 		if ($champs[0] == '(') {
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 		}
441 441
 		$champs = [$champs];
442 442
 	}
443
-	$query = "CREATE INDEX $nom ON $table (" . join(',', $champs) . ')';
443
+	$query = "CREATE INDEX $nom ON $table (".join(',', $champs).')';
444 444
 	if (!$requeter) {
445 445
 		return $query;
446 446
 	}
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	} else {
464 464
 		$suite = '';
465 465
 	}
466
-	$query = 'EXPLAIN ' . preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
466
+	$query = 'EXPLAIN '.preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite;
467 467
 
468 468
 	if (!$requeter) {
469 469
 		return $query;
@@ -556,16 +556,16 @@  discard block
 block discarded – undo
556 556
 		}
557 557
 	}
558 558
 	$from = spip_pg_from($from, $prefixe);
559
-	$query = 'SELECT ' . $select
559
+	$query = 'SELECT '.$select
560 560
 		. (!$from ? '' : "\nFROM $from")
561
-		. (!$where ? '' : ("\nWHERE " . (!is_array($where) ? calculer_pg_where($where) : (join(
561
+		. (!$where ? '' : ("\nWHERE ".(!is_array($where) ? calculer_pg_where($where) : (join(
562 562
 			"\n\tAND ",
563 563
 			array_map('calculer_pg_where', $where)
564 564
 		)))))
565 565
 		. spip_pg_groupby($groupby, $from, $select)
566 566
 		. (!$having ? '' : "\nHAVING $having")
567 567
 		. ($orderby ? ("\nORDER BY $orderby") : '')
568
-		. (!$limit ? '' : (" LIMIT $count" . (!$offset ? '' : " OFFSET $offset")));
568
+		. (!$limit ? '' : (" LIMIT $count".(!$offset ? '' : " OFFSET $offset")));
569 569
 
570 570
 	// renvoyer la requete inerte si demandee
571 571
 	if ($requeter === false) {
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 		$from = spip_pg_select_as($from);
587 587
 	}
588 588
 
589
-	return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1' . $prefixe . '_', $from);
589
+	return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1'.$prefixe.'_', $from);
590 590
 }
591 591
 
592 592
 function spip_pg_orderby($order, $select) {
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 	$arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order));
595 595
 
596 596
 	foreach ($arg as $v) {
597
-		if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+' . $v . '/', $select, $m)) {
597
+		if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+'.$v.'/', $select, $m)) {
598 598
 			$res[] = $m[1];
599 599
 		} else {
600 600
 			$res[] = $v;
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 			$n++;
773 773
 			$res .= "\nwhen $index=$v then $n";
774 774
 		}
775
-		$arg = $m[1] . "case $res else 0 end "
775
+		$arg = $m[1]."case $res else 0 end "
776 776
 			. substr($arg, strlen($m[0]));
777 777
 	}
778 778
 
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
 	}
816 816
 
817 817
 	if (strtoupper($join) === 'AND') {
818
-		return $exp . join("\n\t$join ", array_map('calculer_pg_where', $v));
818
+		return $exp.join("\n\t$join ", array_map('calculer_pg_where', $v));
819 819
 	} else {
820
-		return $exp . join($join, $v);
820
+		return $exp.join($join, $v);
821 821
 	}
822 822
 }
823 823
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 		if (substr($k, -1) == '@') {
828 828
 			// c'est une jointure qui se refere au from precedent
829 829
 			// pas de virgule
830
-			$argsas .= '  ' . $v;
830
+			$argsas .= '  '.$v;
831 831
 		} else {
832 832
 			$as = '';
833 833
 			//  spip_log("$k : $v", _LOG_DEBUG);
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 				} elseif ($v != $k) {
838 838
 					$p = strpos($v, ' ');
839 839
 					if ($p) {
840
-						$v = substr($v, 0, $p) . " AS $k" . substr($v, $p);
840
+						$v = substr($v, 0, $p)." AS $k".substr($v, $p);
841 841
 					} else {
842 842
 						$as = " AS $k";
843 843
 					}
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 			}
846 846
 			// spip_log("subs $k : $v avec $as", _LOG_DEBUG);
847 847
 			// if (strpos($v, 'JOIN') === false)  $argsas .= ', ';
848
-			$argsas .= ', ' . $v . $as;
848
+			$argsas .= ', '.$v.$as;
849 849
 		}
850 850
 	}
851 851
 
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 	$serveur = '',
877 877
 	$requeter = true
878 878
 ) {
879
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
879
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
880 880
 	$r = spip_pg_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
881 881
 	if (!$requeter) {
882 882
 		return $r;
@@ -977,8 +977,8 @@  discard block
 block discarded – undo
977 977
 
978 978
 	return spip_pg_insert(
979 979
 		$table,
980
-		'(' . join(',', array_keys($couples)) . ')',
981
-		'(' . join(',', $couples) . ')',
980
+		'('.join(',', array_keys($couples)).')',
981
+		'('.join(',', $couples).')',
982 982
 		$desc,
983 983
 		$serveur,
984 984
 		$requeter
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 	$c = $tab_couples[0] ?? [];
1002 1002
 	$les_cles = spip_pg_ajouter_champs_timestamp($table, $c, $desc, $serveur);
1003 1003
 
1004
-	$cles = '(' . join(',', array_keys($les_cles)) . ')';
1004
+	$cles = '('.join(',', array_keys($les_cles)).')';
1005 1005
 	$valeurs = [];
1006 1006
 	foreach ($tab_couples as $couples) {
1007 1007
 		foreach ($couples as $champ => $val) {
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 		// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1011 1011
 		$couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1012 1012
 
1013
-		$valeurs[] = '(' . join(',', $couples) . ')';
1013
+		$valeurs[] = '('.join(',', $couples).')';
1014 1014
 	}
1015 1015
 	$valeurs = implode(', ', $valeurs);
1016 1016
 
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
 	$set = [];
1033 1033
 	foreach ($couples as $champ => $val) {
1034
-		$set[] = $champ . '=' . $val;
1034
+		$set[] = $champ.'='.$val;
1035 1035
 	}
1036 1036
 
1037 1037
 	$query = calculer_pg_expression('UPDATE', $table, ',')
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 
1067 1067
 function spip_pg_replace($table, $values, $desc, $serveur = '', $requeter = true) {
1068 1068
 	if (!$values) {
1069
-		spip_log("replace vide $table", 'pg.' . _LOG_AVERTISSEMENT);
1069
+		spip_log("replace vide $table", 'pg.'._LOG_AVERTISSEMENT);
1070 1070
 
1071 1071
 		return 0;
1072 1072
 	}
@@ -1100,8 +1100,8 @@  discard block
 block discarded – undo
1100 1100
 	if (!$where) {
1101 1101
 		return spip_pg_insert(
1102 1102
 			$table,
1103
-			'(' . join(',', array_keys($values)) . ')',
1104
-			'(' . join(',', $values) . ')',
1103
+			'('.join(',', array_keys($values)).')',
1104
+			'('.join(',', $values).')',
1105 1105
 			$desc,
1106 1106
 			$serveur
1107 1107
 		);
@@ -1122,12 +1122,11 @@  discard block
 block discarded – undo
1122 1122
 		$couples = pg_affected_rows($couples);
1123 1123
 	}
1124 1124
 	if (!$couples) {
1125
-		$ret = !$seq ? '' :
1126
-			(" RETURNING nextval('$seq') < $prim");
1127
-		$connexion['last'] = $q = "INSERT INTO $table (" . join(',', array_keys($values)) . ') VALUES (' . join(
1125
+		$ret = !$seq ? '' : (" RETURNING nextval('$seq') < $prim");
1126
+		$connexion['last'] = $q = "INSERT INTO $table (".join(',', array_keys($values)).') VALUES ('.join(
1128 1127
 			',',
1129 1128
 			$values
1130
-		) . ")$ret";
1129
+		).")$ret";
1131 1130
 		$couples = spip_pg_query_simple($link, $q);
1132 1131
 		if (!$couples) {
1133 1132
 			return false;
@@ -1175,7 +1174,7 @@  discard block
 block discarded – undo
1175 1174
 	) {
1176 1175
 		return '';
1177 1176
 	} else {
1178
-		return $raw ? $prim : $table . '_' . $prim . '_seq';
1177
+		return $raw ? $prim : $table.'_'.$prim.'_seq';
1179 1178
 	}
1180 1179
 }
1181 1180
 
@@ -1192,29 +1191,29 @@  discard block
 block discarded – undo
1192 1191
 			return spip_pg_frommysql($v);
1193 1192
 		} else {
1194 1193
 			if (strncmp($v, '0000', 4) == 0) {
1195
-				$v = '0001' . substr($v, 4);
1194
+				$v = '0001'.substr($v, 4);
1196 1195
 			}
1197 1196
 			if (strpos($v, '-00-00') === 4) {
1198
-				$v = substr($v, 0, 4) . '-01-01' . substr($v, 10);
1197
+				$v = substr($v, 0, 4).'-01-01'.substr($v, 10);
1199 1198
 			}
1200 1199
 
1201 1200
 			return "timestamp '$v'";
1202 1201
 		}
1203 1202
 	} elseif (!sql_test_int($t)) {
1204
-		return ("'" . pg_escape_string($v) . "'");
1203
+		return ("'".pg_escape_string($v)."'");
1205 1204
 	} elseif (is_numeric($v) or (strpos($v, 'CAST(') === 0)) {
1206 1205
 		return $v;
1207 1206
 	} elseif ($v[0] == '0' and $v[1] !== 'x' and ctype_xdigit(substr($v, 1))) {
1208 1207
 		return substr($v, 1);
1209 1208
 	} else {
1210
-		spip_log("Warning: '$v'  n'est pas de type $t", 'pg.' . _LOG_AVERTISSEMENT);
1209
+		spip_log("Warning: '$v'  n'est pas de type $t", 'pg.'._LOG_AVERTISSEMENT);
1211 1210
 
1212 1211
 		return intval($v);
1213 1212
 	}
1214 1213
 }
1215 1214
 
1216 1215
 function spip_pg_hex($v) {
1217
-	return "CAST(x'" . $v . "' as bigint)";
1216
+	return "CAST(x'".$v."' as bigint)";
1218 1217
 }
1219 1218
 
1220 1219
 function spip_pg_quote($v, $type = '') {
@@ -1252,15 +1251,15 @@  discard block
 block discarded – undo
1252 1251
 		return $not ? '0=0' : '0=1';
1253 1252
 	}
1254 1253
 	if (strpos($valeurs, "CAST(x'") !== false) {
1255
-		return "($val=" . join("OR $val=", explode(',', $valeurs)) . ')';
1254
+		return "($val=".join("OR $val=", explode(',', $valeurs)).')';
1256 1255
 	}
1257 1256
 	$n = $i = 0;
1258 1257
 	$in_sql = '';
1259 1258
 	while ($n = strpos($valeurs, ',', $n + 1)) {
1260 1259
 		if ((++$i) >= 255) {
1261
-			$in_sql .= "($val $not IN (" .
1262
-				substr($valeurs, 0, $n) .
1263
-				"))\n" .
1260
+			$in_sql .= "($val $not IN (".
1261
+				substr($valeurs, 0, $n).
1262
+				"))\n".
1264 1263
 				($not ? "AND\t" : "OR\t");
1265 1264
 			$valeurs = substr($valeurs, $n + 1);
1266 1265
 			$i = $n = 0;
@@ -1276,7 +1275,7 @@  discard block
 block discarded – undo
1276 1275
 	$s = $link ? pg_last_error($link) : pg_last_error();
1277 1276
 	if ($s) {
1278 1277
 		$s = str_replace('ERROR', 'errcode: 1000 ', $s);
1279
-		spip_log("$s - $query", 'pg.' . _LOG_ERREUR);
1278
+		spip_log("$s - $query", 'pg.'._LOG_ERREUR);
1280 1279
 	}
1281 1280
 
1282 1281
 	return $s;
@@ -1324,7 +1323,7 @@  discard block
 block discarded – undo
1324 1323
 function spip_pg_showbase($match, $serveur = '', $requeter = true) {
1325 1324
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1326 1325
 	$link = $connexion['link'];
1327
-	$connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE ' . _q($match);
1326
+	$connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE '._q($match);
1328 1327
 
1329 1328
 	return spip_pg_query_simple($link, $q);
1330 1329
 }
@@ -1332,7 +1331,7 @@  discard block
 block discarded – undo
1332 1331
 function spip_pg_showtable($nom_table, $serveur = '', $requeter = true) {
1333 1332
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1334 1333
 	$link = $connexion['link'];
1335
-	$connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE ' . _q($nom_table);
1334
+	$connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE '._q($nom_table);
1336 1335
 
1337 1336
 	$res = spip_pg_query_simple($link, $q);
1338 1337
 	if (!$res) {
@@ -1343,15 +1342,15 @@  discard block
 block discarded – undo
1343 1342
 	// il faut en tenir compte dans le return
1344 1343
 	$fields = [];
1345 1344
 	while ($field = pg_fetch_array($res, null, PGSQL_NUM)) {
1346
-		$fields[$field[0]] = $field[2] . (!$field[1] ? '' : (' DEFAULT ' . $field[1]));
1345
+		$fields[$field[0]] = $field[2].(!$field[1] ? '' : (' DEFAULT '.$field[1]));
1347 1346
 	}
1348
-	$connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE ' . _q($nom_table);
1347
+	$connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE '._q($nom_table);
1349 1348
 	$res = spip_pg_query_simple($link, $q);
1350 1349
 	$keys = [];
1351 1350
 	while ($index = pg_fetch_array($res, null, PGSQL_NUM)) {
1352 1351
 		if (preg_match('/CREATE\s+(UNIQUE\s+)?INDEX\s([^\s]+).*\((.*)\)$/', $index[0], $r)) {
1353
-			$nom = str_replace($nom_table . '_', '', $r[2]);
1354
-			$keys[($r[1] ? 'PRIMARY KEY' : ('KEY ' . $nom))] = $r[3];
1352
+			$nom = str_replace($nom_table.'_', '', $r[2]);
1353
+			$keys[($r[1] ? 'PRIMARY KEY' : ('KEY '.$nom))] = $r[3];
1355 1354
 		}
1356 1355
 	}
1357 1356
 
@@ -1383,16 +1382,16 @@  discard block
 block discarded – undo
1383 1382
 		if (strpos($k, 'KEY ') === 0) {
1384 1383
 			$n = str_replace('`', '', $k);
1385 1384
 			$v = str_replace('`', '"', $v);
1386
-			$i = $nom . preg_replace('/KEY +/', '_', $n);
1385
+			$i = $nom.preg_replace('/KEY +/', '_', $n);
1387 1386
 			if ($k != $n) {
1388 1387
 				$i = "\"$i\"";
1389 1388
 			}
1390 1389
 			$keys[] = "CREATE INDEX $i ON $nom ($v);";
1391 1390
 		} elseif (strpos($k, 'UNIQUE ') === 0) {
1392 1391
 			$k = preg_replace('/^UNIQUE +/', '', $k);
1393
-			$prim .= "$s\n\t\tCONSTRAINT " . str_replace('`', '"', $k) . " UNIQUE ($v)";
1392
+			$prim .= "$s\n\t\tCONSTRAINT ".str_replace('`', '"', $k)." UNIQUE ($v)";
1394 1393
 		} else {
1395
-			$prim .= "$s\n\t\t" . str_replace('`', '"', $k) . " ($v)";
1394
+			$prim .= "$s\n\t\t".str_replace('`', '"', $k)." ($v)";
1396 1395
 		}
1397 1396
 		if ($k == 'PRIMARY KEY') {
1398 1397
 			$prim_name = $v;
@@ -1403,17 +1402,17 @@  discard block
 block discarded – undo
1403 1402
 
1404 1403
 	$character_set = '';
1405 1404
 	if (@$GLOBALS['meta']['charset_sql_base']) {
1406
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
1405
+		$character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base'];
1407 1406
 	}
1408 1407
 	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
1409
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
1408
+		$character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base'];
1410 1409
 	}
1411 1410
 
1412 1411
 	foreach ($champs as $k => $v) {
1413 1412
 		$k = str_replace('`', '"', $k);
1414 1413
 		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
1415 1414
 			if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) {
1416
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
1415
+				$v = $defs[1].$character_set.' '.substr($v, strlen($defs[1]));
1417 1416
 			}
1418 1417
 		}
1419 1418
 
@@ -1428,7 +1427,7 @@  discard block
 block discarded – undo
1428 1427
 
1429 1428
 	// En l'absence de "if not exists" en PG, on neutralise les erreurs
1430 1429
 
1431
-	$q = "CREATE $temporary TABLE $nom ($query" . ($prim ? ",$prim" : '') . ')' .
1430
+	$q = "CREATE $temporary TABLE $nom ($query".($prim ? ",$prim" : '').')'.
1432 1431
 		($character_set ? " DEFAULT $character_set" : '')
1433 1432
 		. "\n";
1434 1433
 
@@ -1439,7 +1438,7 @@  discard block
 block discarded – undo
1439 1438
 	$r = @pg_query($link, $q);
1440 1439
 
1441 1440
 	if (!$r) {
1442
-		spip_log("Impossible de creer cette table: $q", 'pg.' . _LOG_ERREUR);
1441
+		spip_log("Impossible de creer cette table: $q", 'pg.'._LOG_ERREUR);
1443 1442
 	} else {
1444 1443
 		foreach ($keys as $index) {
1445 1444
 			pg_query($link, $index);
@@ -1462,20 +1461,20 @@  discard block
 block discarded – undo
1462 1461
 	// vue deja presente
1463 1462
 	if (sql_showtable($nom, false, $serveur)) {
1464 1463
 		if ($requeter) {
1465
-			spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.' . _LOG_ERREUR);
1464
+			spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.'._LOG_ERREUR);
1466 1465
 		}
1467 1466
 
1468 1467
 		return false;
1469 1468
 	}
1470 1469
 
1471
-	$query = "CREATE VIEW $nom AS " . $query_select;
1470
+	$query = "CREATE VIEW $nom AS ".$query_select;
1472 1471
 
1473 1472
 	return spip_pg_query($query, $serveur, $requeter);
1474 1473
 }
1475 1474
 
1476 1475
 
1477 1476
 function spip_pg_set_connect_charset($charset, $serveur = '', $requeter = true) {
1478
-	spip_log('changement de charset sql a ecrire en PG', 'pg.' . _LOG_ERREUR);
1477
+	spip_log('changement de charset sql a ecrire en PG', 'pg.'._LOG_ERREUR);
1479 1478
 }
1480 1479
 
1481 1480
 
@@ -1488,7 +1487,7 @@  discard block
 block discarded – undo
1488 1487
  * @return bool|string true / false / requete
1489 1488
  **/
1490 1489
 function spip_pg_optimize($table, $serveur = '', $requeter = true) {
1491
-	return spip_pg_query('VACUUM ' . $table, $serveur, $requeter);
1490
+	return spip_pg_query('VACUUM '.$table, $serveur, $requeter);
1492 1491
 }
1493 1492
 
1494 1493
 // Selectionner la sous-chaine dans $objet
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +34 added lines, -35 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 			" class='picto_err'",
64 64
 			_T('plugin_info_erreur_xml')
65 65
 		)
66
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . '</div>';
66
+			. "<div class='erreur'>".join('<br >', $info['erreur']).'</div>';
67 67
 		$checkable = false;
68
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
68
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
69 69
 		$class_li .= ' error';
70 70
 		$erreur = http_img_pack(
71 71
 			'plugin-err-32.png',
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 			" class='picto_err'",
74 74
 			_T('plugin_impossible_activer', ['plugin' => $nom])
75 75
 		)
76
-			. "<div class='erreur'>" . implode(
76
+			. "<div class='erreur'>".implode(
77 77
 				'<br />',
78
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]
79
-			) . '</div>';
78
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file]
79
+			).'</div>';
80 80
 	} else {
81 81
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : '';
82 82
 		if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 	// numerotons les occurrences d'un meme prefix
94 94
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
95 95
 
96
-	$class_li .= ($actif ? ' actif' : '') . ($expose ? ' on' : '');
96
+	$class_li .= ($actif ? ' actif' : '').($expose ? ' on' : '');
97 97
 
98 98
 	return "<li id='$prefix$id' class='$class_li'>"
99 99
 	. ((!$checkable and !$checked)
100
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
100
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
101 101
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
102 102
 	. $cfg
103 103
 	. $erreur
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	// si paquet.xml fournit un squelette, le prendre
117 117
 	if (isset($infos['config']) and $infos['config']) {
118 118
 		return recuperer_fond(
119
-			"$dir$nom/" . $infos['config'],
119
+			"$dir$nom/".$infos['config'],
120 120
 			[
121
-				'script' => 'configurer_' . $prefix,
121
+				'script' => 'configurer_'.$prefix,
122 122
 				'nom' => $nom
123 123
 			]
124 124
 		);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	return recuperer_fond(
138 138
 		'prive/squelettes/inclure/cfg',
139 139
 		[
140
-			'script' => 'configurer_' . $prefix,
140
+			'script' => 'configurer_'.$prefix,
141 141
 			'nom' => $nom
142 142
 		]
143 143
 	);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
154 154
 	. ($actif ? " checked='checked'" : '')
155 155
 	. " class='checkbox'  value='O' />"
156
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . '</label>'
156
+	. "\n<label for='label_$id_input'>"._T('activer_plugin').'</label>'
157 157
 	. '</div>';
158 158
 }
159 159
 
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 	. "<h3><a href='$url' rel='info'>"
209 209
 	. $nom
210 210
 	. '</a></h3>'
211
-	. " <span class='version'>" . $info['version'] . '</span>'
211
+	. " <span class='version'>".$info['version'].'</span>'
212 212
 	. " <span class='etat'> - "
213 213
 	. plugin_etat_en_clair($info['etat'])
214 214
 	. '</span>'
215
-	. "<div class='short'>" . $slogan . '</div>'
215
+	. "<div class='short'>".$slogan.'</div>'
216 216
 	. $i
217 217
 	. '</div>';
218 218
 }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	$text2 = _T('info_desinstaller_plugin');
228 228
 	$file = basename($plug_file);
229 229
 
230
-	return "<div class='actions'>[" .
230
+	return "<div class='actions'>[".
231 231
 	"<a href='$action'
232 232
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
233 233
 	. $text
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 		$etat = 'developpement';
250 250
 	}
251 251
 
252
-	return _T('plugin_etat_' . $etat);
252
+	return _T('plugin_etat_'.$etat);
253 253
 }
254 254
 
255 255
 function plugin_propre($texte, $module = '', $propre = 'propre') {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$module = substr($module, strlen(_DIR_RACINE));
259 259
 	}
260 260
 	if (preg_match('|^\w+_[\w_]+$|', $texte)) {
261
-		$texte = _T(($module ? "$module:" : '') . $texte, [], ['force' => false]);
261
+		$texte = _T(($module ? "$module:" : '').$texte, [], ['force' => false]);
262 262
 	}
263 263
 
264 264
 	return $propre($texte);
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 		isset($info['documentation'])
292 292
 		and $lien = $info['documentation']
293 293
 	) {
294
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
294
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
295 295
 	}
296
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
296
+	$s .= "<dd class='desc'>".$description."</dd>\n";
297 297
 
298 298
 	if (isset($info['auteur'])) {
299 299
 		if (is_array($info['auteur'])) {
@@ -303,19 +303,19 @@  discard block
 block discarded – undo
303 303
 			$a = trim($info['auteur']);
304 304
 		}
305 305
 		if ($a) {
306
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre(
306
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre(
307 307
 				$a,
308 308
 				$dir
309
-			)) . "</dd>\n";
309
+			))."</dd>\n";
310 310
 		}
311 311
 	}
312 312
 
313 313
 	if (isset($info['credit'])) {
314 314
 		if ($a = formater_credits($info['credit'], ', ')) {
315
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre(
315
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre(
316 316
 				$a,
317 317
 				$dir
318
-			)) . "</dd>\n";
318
+			))."</dd>\n";
319 319
 		}
320 320
 	}
321 321
 
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 			$a = trim($info['licence']);
328 328
 		}
329 329
 		if ($a) {
330
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre(
330
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre(
331 331
 				$a,
332 332
 				$dir
333
-			)) . "</dd>\n";
333
+			))."</dd>\n";
334 334
 		}
335 335
 	}
336 336
 
@@ -341,25 +341,24 @@  discard block
 block discarded – undo
341 341
 	//
342 342
 	$infotech = [];
343 343
 
344
-	$version = '<dt>' . _T('version') . '</dt><dd>' . $info['version'];
344
+	$version = '<dt>'._T('version').'</dt><dd>'.$info['version'];
345 345
 	// Version VCS
346
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
347
-		$version .= ' ' . $vcs;
346
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
347
+		$version .= ' '.$vcs;
348 348
 	}
349 349
 	$version .= '</dd>';
350 350
 	$infotech[] = $version;
351
-	$infotech[] = '<dt>' . _T('repertoire_plugins') . '</dt><dd>' . joli_repertoire("$dir_plugins$plug_file") . '</dd>';
351
+	$infotech[] = '<dt>'._T('repertoire_plugins').'</dt><dd>'.joli_repertoire("$dir_plugins$plug_file").'</dd>';
352 352
 	// source zip le cas echeant
353
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log)
353
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log)
354 354
 		and preg_match(',^source:(.*)$,m', $log, $r))
355
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . '</dd>'
355
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1]).'</dd>'
356 356
 		: '';
357 357
 
358
-	$infotech[] = !$info['necessite'] ? '' :
359
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(
358
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(
360 359
 			' ',
361 360
 			array_map('array_shift', $info['necessite'])
362
-		) . '</dd>');
361
+		).'</dd>');
363 362
 
364 363
 	$s .= "<dl class='tech'>"
365 364
 		. join('', $infotech)
@@ -380,8 +379,8 @@  discard block
 block discarded – undo
380 379
 		$texte .=
381 380
 			(!is_array($_credit))
382 381
 				? PtoBR(propre($_credit))
383
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
384
-				$_credit['nom'] .
382
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
383
+				$_credit['nom'].
385 384
 				($_credit['url'] ? '</a>' : '');
386 385
 	}
387 386
 
Please login to merge, or discard this patch.
ecrire/inc/presentation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	];
45 45
 	$style_titre_mapping = ['couleur' => 'topper', 'trait-couleur' => 'section'];
46 46
 	$c = $style_mapping[$style] ?? 'simple';
47
-	$class = $c . ($class ? " $class" : '');
47
+	$class = $c.($class ? " $class" : '');
48 48
 	if (!$padding) {
49
-		$class .= ($class ? ' ' : '') . 'no-padding';
49
+		$class .= ($class ? ' ' : '').'no-padding';
50 50
 	}
51 51
 
52 52
 	//($id?"id='$id' ":"")
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 		if ($fonction) {
62 62
 			// 2 images pour composer l'icone : le fond (article) en background,
63 63
 			// la fonction (new) en image
64
-			$icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n" .
64
+			$icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n".
65 65
 				http_style_background($fond, 'no-repeat center center', $size));
66 66
 		} else {
67 67
 			$icone = http_img_pack($fond, '', "class='cadre-icone' width='$size' height='$size'");
68 68
 		}
69
-		$titre = $icone . $titre;
69
+		$titre = $icone.$titre;
70 70
 	}
71 71
 
72 72
 	return boite_ouvrir($titre, $class, $style_titre_mapping[$style] ?? '', $id);
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	$titre,
180 180
 	$ze_logo = ''
181 181
 ) {
182
-	return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n";
182
+	return "<h1 class = 'grostitre'>".$ze_logo.' '.typo($titre)."</h1>\n";
183 183
 }
184 184
 
185 185
 // La boite des raccourcis
186 186
 // Se place a droite si l'ecran est en mode panoramique.
187 187
 function bloc_des_raccourcis($bloc) {
188 188
 	return creer_colonne_droite()
189
-	. boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer();
189
+	. boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis').$bloc.boite_fermer();
190 190
 }
191 191
 
192 192
 //
Please login to merge, or discard this patch.
ecrire/inc/layer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$class = ' blocreplie';
54 54
 	}
55 55
 
56
-	return '<div ' . ($id ? "id='$id' " : '') . "class='bloc_depliable$class'>";
56
+	return '<div '.($id ? "id='$id' " : '')."class='bloc_depliable$class'>";
57 57
 }
58 58
 
59 59
 function fin_block() {
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 // $deplie : true (deplie) ou false (plie) ou -1 (inactif) ou 'incertain' pour que le bouton s'auto init au chargement de la page
65 65
 // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit)
66 66
 function bouton_block_depliable($texte, $deplie, $ids = '') {
67
-	$bouton_id = 'b' . substr(md5($texte . microtime()), 0, 8);
67
+	$bouton_id = 'b'.substr(md5($texte.microtime()), 0, 8);
68 68
 
69 69
 	$class = ($deplie === true) ? ' deplie' : (($deplie == -1) ? ' impliable' : ' replie');
70 70
 	if (strlen($ids)) {
71 71
 		$cible = explode(',', $ids);
72
-		$cible = '#' . implode(',#', $cible);
72
+		$cible = '#'.implode(',#', $cible);
73 73
 	} else {
74 74
 		$cible = "#$bouton_id + div.bloc_depliable";
75 75
 	}
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +120 added lines, -121 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	if (strlen($dossier) and substr($dossier, -1) != '/') {
54 54
 		$dossier .= '/';
55 55
 	}
56
-	$f = str_replace('/', '_', $dossier) . $nom;
56
+	$f = str_replace('/', '_', $dossier).$nom;
57 57
 
58 58
 	if (function_exists($f)) {
59 59
 		return $f;
60 60
 	}
61
-	if (function_exists($g = $f . '_dist')) {
61
+	if (function_exists($g = $f.'_dist')) {
62 62
 		return $g;
63 63
 	}
64 64
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	// passer en minuscules (cf les balises de formulaires)
80 80
 	// et inclure le fichier
81 81
 	if (
82
-		!$inc = include_spip($dossier . ($d = strtolower($nom)))
82
+		!$inc = include_spip($dossier.($d = strtolower($nom)))
83 83
 		// si le fichier truc/machin/nom.php n'existe pas,
84 84
 		// la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions
85 85
 		and strlen(dirname($dossier)) and dirname($dossier) != '.'
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	// Echec : message d'erreur
101
-	spip_log("fonction $nom ($f ou $g) indisponible" .
101
+	spip_log("fonction $nom ($f ou $g) indisponible".
102 102
 		($inc ? '' : " (fichier $d absent de $dossier)"));
103 103
 
104 104
 	include_spip('inc/minipres');
105 105
 	echo minipres(
106 106
 		_T('forum_titre_erreur'),
107
-		_T('fichier_introuvable', ['fichier' => '<b>' . spip_htmlentities($d) . '</b>']),
108
-		['all_inline' => true,'status' => 404]
107
+		_T('fichier_introuvable', ['fichier' => '<b>'.spip_htmlentities($d).'</b>']),
108
+		['all_inline' => true, 'status' => 404]
109 109
 	);
110 110
 	exit;
111 111
 }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
  *     - string : chemin du fichier trouvé
152 152
  **/
153 153
 function include_spip($f, $include = true) {
154
-	return find_in_path($f . '.php', '', $include);
154
+	return find_in_path($f.'.php', '', $include);
155 155
 }
156 156
 
157 157
 /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
  *     - string : chemin du fichier trouvé
172 172
  **/
173 173
 function require_spip($f) {
174
-	return find_in_path($f . '.php', '', 'required');
174
+	return find_in_path($f.'.php', '', 'required');
175 175
 }
176 176
 
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		// donc il faut l'inclure "en globals"
189 189
 		if ($f = find_in_path('mes_fonctions.php')) {
190 190
 			global $dossier_squelettes;
191
-			include_once(_ROOT_CWD . $f);
191
+			include_once(_ROOT_CWD.$f);
192 192
 		}
193 193
 
194 194
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	}
294 294
 
295 295
 	// appliquer notre fonction si elle existe
296
-	$fonc = 'execute_pipeline_' . strtolower($action);
296
+	$fonc = 'execute_pipeline_'.strtolower($action);
297 297
 	if (function_exists($fonc)) {
298 298
 		$val = $fonc($val);
299 299
 	} // plantage ?
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 function spip_log($message = null, $name = null) {
359 359
 	static $pre = [];
360 360
 	static $log;
361
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
361
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
362 362
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
363 363
 		$logname = null;
364 364
 	}
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 		if (!is_string($message)) {
387 387
 			$message = print_r($message, true);
388 388
 		}
389
-		$log($pre[$niveau] . ' ' . $message, $logname);
389
+		$log($pre[$niveau].' '.$message, $logname);
390 390
 	}
391 391
 }
392 392
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		$a = './';
588 588
 	}
589 589
 
590
-	$regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,';
590
+	$regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,';
591 591
 	$ajouts = array_flip(explode('|', $c));
592 592
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
593 593
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 			// Ajout. Pour une variable, remplacer au meme endroit,
615 615
 			// pour un tableau ce sera fait dans la prochaine boucle
616 616
 			elseif (substr($r[1], -2) != '[]') {
617
-				$url[$n] = $r[1] . '=' . $u;
617
+				$url[$n] = $r[1].'='.$u;
618 618
 				unset($ajouts[$r[1]]);
619 619
 			}
620 620
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -635,11 +635,11 @@  discard block
 block discarded – undo
635 635
 	} elseif ($testv) {
636 636
 		foreach ($ajouts as $k => $n) {
637 637
 			if (!is_array($v)) {
638
-				$url[] = $k . '=' . $u;
638
+				$url[] = $k.'='.$u;
639 639
 			} else {
640
-				$id = (substr($k, -2) == '[]') ? $k : ($k . '[]');
640
+				$id = (substr($k, -2) == '[]') ? $k : ($k.'[]');
641 641
 				foreach ($v as $w) {
642
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
642
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
643 643
 				}
644 644
 			}
645 645
 		}
@@ -650,10 +650,10 @@  discard block
 block discarded – undo
650 650
 
651 651
 	// recomposer l'adresse
652 652
 	if ($url) {
653
-		$a .= '?' . join($sep, $url);
653
+		$a .= '?'.join($sep, $url);
654 654
 	}
655 655
 
656
-	return $a . $ancre;
656
+	return $a.$ancre;
657 657
 }
658 658
 
659 659
 /**
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 			translitteration($ancre)
686 686
 		);
687 687
 	}
688
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
688
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
689 689
 }
690 690
 
691 691
 /**
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
  * @return bool
802 802
  */
803 803
 function test_plugin_actif($plugin) {
804
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
804
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
805 805
 }
806 806
 
807 807
 /**
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 					$value = interdire_scripts($value, -1);
934 934
 				}
935 935
 				if (!empty($options['class'])) {
936
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
936
+					$value = "<span class='".$options['class']."'>$value</span>";
937 937
 				}
938 938
 				$text = str_replace("@$name@", $value, $text);
939 939
 				unset($args[$name]);
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 		// Si des variables n'ont pas ete inserees, le signaler
943 943
 		// (chaines de langues pas a jour)
944 944
 		if ($args) {
945
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
945
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
946 946
 		}
947 947
 	}
948 948
 
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 function joli_repertoire($rep) {
967 967
 	$a = substr($rep, 0, 1);
968 968
 	if ($a <> '.' and $a <> '/') {
969
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
969
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
970 970
 	}
971 971
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
972 972
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 			$p -= ($x * 1000);
1021 1021
 		}
1022 1022
 
1023
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1023
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1024 1024
 	}
1025 1025
 }
1026 1026
 
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	if ($taches and count($taches) and !spip_connect()) {
1088 1088
 		return false;
1089 1089
 	}
1090
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1090
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1091 1091
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1092 1092
 		return $genie($taches);
1093 1093
 	}
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
 	if ($queue_next_job_time == -1) {
1193 1193
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1194
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1194
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1195 1195
 		}
1196 1196
 		// utiliser un cache memoire si dispo
1197 1197
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
 		$src = '';
1261 1261
 	}
1262 1262
 	if ($script) {
1263
-		$script = ("/*<![CDATA[*/\n" .
1264
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1263
+		$script = ("/*<![CDATA[*/\n".
1264
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1265 1265
 			'/*]]>*/');
1266 1266
 	}
1267 1267
 	if ($noscript) {
@@ -1347,13 +1347,13 @@  discard block
 block discarded – undo
1347 1347
 	if ($path_base == null) {
1348 1348
 		// Chemin standard depuis l'espace public
1349 1349
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1350
-			_DIR_RACINE . ':' .
1351
-			_DIR_RACINE . 'squelettes-dist/:' .
1352
-			_DIR_RACINE . 'prive/:' .
1350
+			_DIR_RACINE.':'.
1351
+			_DIR_RACINE.'squelettes-dist/:'.
1352
+			_DIR_RACINE.'prive/:'.
1353 1353
 			_DIR_RESTREINT;
1354 1354
 		// Ajouter squelettes/
1355
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1356
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1355
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1356
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1357 1357
 		}
1358 1358
 		foreach (explode(':', $path) as $dir) {
1359 1359
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 		// Et le(s) dossier(s) des squelettes nommes
1366 1366
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1367 1367
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1368
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1368
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1369 1369
 			}
1370 1370
 		}
1371 1371
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 
1377 1377
 	if (is_array($dir_path) or strlen($dir_path)) {
1378 1378
 		$tete = '';
1379
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1379
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1380 1380
 			$tete = array_shift($path_base);
1381 1381
 		}
1382 1382
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
 	// Et le(s) dossier(s) des squelettes nommes
1398 1398
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1399 1399
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1400
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1400
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1401 1401
 		}
1402 1402
 	}
1403 1403
 
@@ -1468,14 +1468,14 @@  discard block
 block discarded – undo
1468 1468
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1469 1469
 	if (
1470 1470
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1471
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1471
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1472 1472
 		and $f = find_in_theme("$file_svg_generique")
1473 1473
 	) {
1474
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1474
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1475 1475
 			return $themefiles["$subdir$file"] = $fsize;
1476 1476
 		}
1477 1477
 		else {
1478
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1478
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1479 1479
 		}
1480 1480
 	}
1481 1481
 
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 			return $themefiles["$subdir$file"] = $f;
1486 1486
 		}
1487 1487
 	}
1488
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1488
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1489 1489
 
1490 1490
 	return $themefiles["$subdir$file"] = '';
1491 1491
 }
@@ -1593,8 +1593,8 @@  discard block
 block discarded – undo
1593 1593
 			return false;
1594 1594
 		}
1595 1595
 		if ($include and !isset($inc[$dirname][$file])) {
1596
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1597
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1596
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1597
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1598 1598
 		}
1599 1599
 
1600 1600
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1607,14 +1607,14 @@  discard block
 block discarded – undo
1607 1607
 	}
1608 1608
 
1609 1609
 	foreach (creer_chemin() as $dir) {
1610
-		if (!isset($dirs[$a = $dir . $dirname])) {
1611
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1610
+		if (!isset($dirs[$a = $dir.$dirname])) {
1611
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1612 1612
 		}
1613 1613
 		if ($dirs[$a]) {
1614
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1614
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1615 1615
 				if ($include and !isset($inc[$dirname][$file])) {
1616
-					include_once _ROOT_CWD . $a;
1617
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1616
+					include_once _ROOT_CWD.$a;
1617
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1618 1618
 				}
1619 1619
 				if (!defined('_SAUVER_CHEMIN')) {
1620 1620
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
 					define('_SAUVER_CHEMIN', true);
1625 1625
 				}
1626 1626
 
1627
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1627
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1628 1628
 			}
1629 1629
 		}
1630 1630
 	}
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 		define('_SAUVER_CHEMIN', true);
1651 1651
 	}
1652 1652
 
1653
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1653
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1654 1654
 }
1655 1655
 
1656 1656
 function clear_path_cache() {
@@ -1720,12 +1720,12 @@  discard block
 block discarded – undo
1720 1720
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1721 1721
 	// on a pas encore inclus flock.php
1722 1722
 	if (!function_exists('preg_files')) {
1723
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1723
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1724 1724
 	}
1725 1725
 
1726 1726
 	// Parcourir le chemin
1727 1727
 	foreach (creer_chemin() as $d) {
1728
-		$f = $d . $dir;
1728
+		$f = $d.$dir;
1729 1729
 		if (@is_dir($f)) {
1730 1730
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1731 1731
 			foreach ($liste as $chemin) {
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 		return $res;
1834 1834
 	}
1835 1835
 	// Sinon c'est un raccourci ou compat SPIP < 2
1836
-	if (!function_exists($f = 'generer_url_' . $entite)) {
1836
+	if (!function_exists($f = 'generer_url_'.$entite)) {
1837 1837
 		if (!function_exists($f .= '_dist')) {
1838 1838
 			$f = '';
1839 1839
 		}
@@ -1842,8 +1842,8 @@  discard block
 block discarded – undo
1842 1842
 		$url = $f($id, $args, $ancre);
1843 1843
 		if (strlen($args)) {
1844 1844
 			$url .= strstr($url, '?')
1845
-				? '&amp;' . $args
1846
-				: '?' . $args;
1845
+				? '&amp;'.$args
1846
+				: '?'.$args;
1847 1847
 		}
1848 1848
 
1849 1849
 		return $url;
@@ -1873,8 +1873,8 @@  discard block
 block discarded – undo
1873 1873
 	include_spip('base/connect_sql');
1874 1874
 	$id_type = id_table_objet($entite, $public);
1875 1875
 
1876
-	return _DIR_RACINE . get_spip_script('./')
1877
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1876
+	return _DIR_RACINE.get_spip_script('./')
1877
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1878 1878
 	. (!$args ? '' : "&$args")
1879 1879
 	. (!$ancre ? '' : "#$ancre");
1880 1880
 }
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
 				!empty($_SERVER['QUERY_STRING'])
2028 2028
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2029 2029
 			) {
2030
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2030
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2031 2031
 			}
2032 2032
 		}
2033 2033
 	}
@@ -2062,9 +2062,9 @@  discard block
 block discarded – undo
2062 2062
 		array_shift($myself);
2063 2063
 		$myself = implode('/', $myself);
2064 2064
 	}
2065
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2065
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2066 2066
 
2067
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2067
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2068 2068
 
2069 2069
 	return $url;
2070 2070
 }
@@ -2102,16 +2102,16 @@  discard block
 block discarded – undo
2102 2102
  **/
2103 2103
 function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) {
2104 2104
 	if (!$rel) {
2105
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2105
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2106 2106
 	} else {
2107 2107
 		if (!is_string($rel)) {
2108
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2108
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2109 2109
 		}
2110 2110
 	}
2111 2111
 
2112 2112
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2113 2113
 	if ($script and ($script <> 'accueil' or $rel)) {
2114
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2114
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2115 2115
 	} elseif ($args) {
2116 2116
 		$args = "?$args";
2117 2117
 	}
@@ -2119,7 +2119,7 @@  discard block
 block discarded – undo
2119 2119
 		$args .= "#$ancre";
2120 2120
 	}
2121 2121
 
2122
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2122
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2123 2123
 }
2124 2124
 
2125 2125
 //
@@ -2192,24 +2192,24 @@  discard block
 block discarded – undo
2192 2192
 		if (is_array($args)) {
2193 2193
 			$r = '';
2194 2194
 			foreach ($args as $k => $v) {
2195
-				$r .= '&' . $k . '=' . $v;
2195
+				$r .= '&'.$k.'='.$v;
2196 2196
 			}
2197 2197
 			$args = substr($r, 1);
2198 2198
 		}
2199 2199
 		$action .=
2200
-			(strpos($action, '?') !== false ? '&' : '?') . $args;
2200
+			(strpos($action, '?') !== false ? '&' : '?').$args;
2201 2201
 	}
2202 2202
 	if (!$no_entities) {
2203 2203
 		$action = quote_amp($action);
2204 2204
 	}
2205 2205
 
2206 2206
 	// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2207
-	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2207
+	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2208 2208
 }
2209 2209
 
2210 2210
 function generer_url_prive($script, $args = '', $no_entities = false) {
2211 2211
 
2212
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2212
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2213 2213
 }
2214 2214
 
2215 2215
 // Pour les formulaires en methode POST,
@@ -2244,8 +2244,7 @@  discard block
 block discarded – undo
2244 2244
 	. "><div>\n"
2245 2245
 	. "<input type='hidden' name='exec' value='$script1' />"
2246 2246
 	. $corps
2247
-	. (!$submit ? '' :
2248
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2247
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2249 2248
 	. "</div></form>\n";
2250 2249
 }
2251 2250
 
@@ -2270,14 +2269,14 @@  discard block
 block discarded – undo
2270 2269
 		? generer_url_ecrire(_request('exec'))
2271 2270
 		: generer_url_public();
2272 2271
 
2273
-	return "\n<form action='" .
2274
-	$h .
2275
-	"'" .
2276
-	$atts .
2277
-	">\n" .
2278
-	'<div>' .
2279
-	"\n<input type='hidden' name='action' value='$script' />" .
2280
-	$corps .
2272
+	return "\n<form action='".
2273
+	$h.
2274
+	"'".
2275
+	$atts.
2276
+	">\n".
2277
+	'<div>'.
2278
+	"\n<input type='hidden' name='action' value='$script' />".
2279
+	$corps.
2281 2280
 	'</div></form>';
2282 2281
 }
2283 2282
 
@@ -2305,7 +2304,7 @@  discard block
 block discarded – undo
2305 2304
 		: generer_url_public('', '', false, false);
2306 2305
 	$url = parametre_url($url, 'action', $script);
2307 2306
 	if ($args) {
2308
-		$url .= quote_amp('&' . $args);
2307
+		$url .= quote_amp('&'.$args);
2309 2308
 	}
2310 2309
 
2311 2310
 	if ($no_entities) {
@@ -2355,17 +2354,17 @@  discard block
 block discarded – undo
2355 2354
 
2356 2355
 	// le nom du repertoire plugins/ activables/desactivables
2357 2356
 	if (!defined('_DIR_PLUGINS')) {
2358
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2357
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2359 2358
 	}
2360 2359
 
2361 2360
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2362 2361
 	if (!defined('_DIR_PLUGINS_DIST')) {
2363
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2362
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2364 2363
 	}
2365 2364
 
2366 2365
 	// le nom du repertoire des librairies
2367 2366
 	if (!defined('_DIR_LIB')) {
2368
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2367
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2369 2368
 	}
2370 2369
 
2371 2370
 	if (!defined('_DIR_IMG')) {
@@ -2375,29 +2374,29 @@  discard block
 block discarded – undo
2375 2374
 		define('_DIR_LOGOS', $pa);
2376 2375
 	}
2377 2376
 	if (!defined('_DIR_IMG_ICONES')) {
2378
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2377
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2379 2378
 	}
2380 2379
 
2381 2380
 	if (!defined('_DIR_DUMP')) {
2382
-		define('_DIR_DUMP', $ti . 'dump/');
2381
+		define('_DIR_DUMP', $ti.'dump/');
2383 2382
 	}
2384 2383
 	if (!defined('_DIR_SESSIONS')) {
2385
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2384
+		define('_DIR_SESSIONS', $ti.'sessions/');
2386 2385
 	}
2387 2386
 	if (!defined('_DIR_TRANSFERT')) {
2388
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2387
+		define('_DIR_TRANSFERT', $ti.'upload/');
2389 2388
 	}
2390 2389
 	if (!defined('_DIR_CACHE')) {
2391
-		define('_DIR_CACHE', $ti . 'cache/');
2390
+		define('_DIR_CACHE', $ti.'cache/');
2392 2391
 	}
2393 2392
 	if (!defined('_DIR_CACHE_XML')) {
2394
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2393
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2395 2394
 	}
2396 2395
 	if (!defined('_DIR_SKELS')) {
2397
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2396
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2398 2397
 	}
2399 2398
 	if (!defined('_DIR_AIDE')) {
2400
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2399
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2401 2400
 	}
2402 2401
 	if (!defined('_DIR_TMP')) {
2403 2402
 		define('_DIR_TMP', $ti);
@@ -2426,27 +2425,27 @@  discard block
 block discarded – undo
2426 2425
 	// Declaration des fichiers
2427 2426
 
2428 2427
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2429
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2428
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2430 2429
 	}
2431 2430
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2432
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2431
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2433 2432
 	}
2434 2433
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2435
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2434
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2436 2435
 	}
2437 2436
 	if (!defined('_CACHE_PIPELINES')) {
2438
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2437
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2439 2438
 	}
2440 2439
 	if (!defined('_CACHE_CHEMIN')) {
2441
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2440
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2442 2441
 	}
2443 2442
 
2444 2443
 	# attention .php obligatoire pour ecrire_fichier_securise
2445 2444
 	if (!defined('_FILE_META')) {
2446
-		define('_FILE_META', $ti . 'meta_cache.php');
2445
+		define('_FILE_META', $ti.'meta_cache.php');
2447 2446
 	}
2448 2447
 	if (!defined('_DIR_LOG')) {
2449
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2448
+		define('_DIR_LOG', _DIR_TMP.'log/');
2450 2449
 	}
2451 2450
 	if (!defined('_FILE_LOG')) {
2452 2451
 		define('_FILE_LOG', 'spip');
@@ -2463,8 +2462,8 @@  discard block
 block discarded – undo
2463 2462
 	if (!defined('_FILE_CONNECT')) {
2464 2463
 		define(
2465 2464
 			'_FILE_CONNECT',
2466
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2467
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2465
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2466
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2468 2467
 			: false))
2469 2468
 		);
2470 2469
 	}
@@ -2476,7 +2475,7 @@  discard block
 block discarded – undo
2476 2475
 	if (!defined('_FILE_CHMOD')) {
2477 2476
 		define(
2478 2477
 			'_FILE_CHMOD',
2479
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2478
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2480 2479
 			: false)
2481 2480
 		);
2482 2481
 	}
@@ -2489,10 +2488,10 @@  discard block
 block discarded – undo
2489 2488
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2490 2489
 	}
2491 2490
 	if (!defined('_FILE_CONNECT_TMP')) {
2492
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2491
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2493 2492
 	}
2494 2493
 	if (!defined('_FILE_CHMOD_TMP')) {
2495
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2494
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2496 2495
 	}
2497 2496
 
2498 2497
 	// Definition des droits d'acces en ecriture
@@ -2510,13 +2509,13 @@  discard block
 block discarded – undo
2510 2509
 		define('_DEFAULT_CHARSET', 'utf-8');
2511 2510
 	}
2512 2511
 	if (!defined('_ROOT_PLUGINS')) {
2513
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2512
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2514 2513
 	}
2515 2514
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2516
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2515
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2517 2516
 	}
2518 2517
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2519
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2518
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2520 2519
 	}
2521 2520
 
2522 2521
 	// La taille des Log
@@ -2553,7 +2552,7 @@  discard block
 block discarded – undo
2553 2552
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2554 2553
 	// pour le rendre surchargeable, on va provoquer un reecriture
2555 2554
 	// systematique du noyau ou une baisse de perfs => a etudier)
2556
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2555
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2557 2556
 
2558 2557
 	// charger tout de suite le path et son cache
2559 2558
 	load_path_cache();
@@ -2601,7 +2600,7 @@  discard block
 block discarded – undo
2601 2600
 			!empty($_SERVER['QUERY_STRING'])
2602 2601
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2603 2602
 		) {
2604
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2603
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2605 2604
 		}
2606 2605
 	}
2607 2606
 
@@ -2637,7 +2636,7 @@  discard block
 block discarded – undo
2637 2636
 		) {
2638 2637
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2639 2638
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2640
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2639
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2641 2640
 			} else {
2642 2641
 				$uri_ref = '';
2643 2642
 			}
@@ -2731,7 +2730,7 @@  discard block
 block discarded – undo
2731 2730
 	}
2732 2731
 	if (!defined('_CACHE_RUBRIQUES')) {
2733 2732
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2734
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2733
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2735 2734
 	}
2736 2735
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2737 2736
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2835,7 +2834,7 @@  discard block
 block discarded – undo
2835 2834
 					$memory *= 1024;
2836 2835
 			}
2837 2836
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2838
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2837
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2839 2838
 				if (trim(ini_get('memory_limit')) != $m) {
2840 2839
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2841 2840
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -2986,7 +2985,7 @@  discard block
 block discarded – undo
2986 2985
 					}
2987 2986
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
2988 2987
 						spip_log($GLOBALS['visiteur_session']['nom']
2989
-							. ' ' . _VAR_MODE);
2988
+							. ' '._VAR_MODE);
2990 2989
 					}
2991 2990
 				} // pas autorise ?
2992 2991
 				else {
@@ -3001,7 +3000,7 @@  discard block
 block discarded – undo
3001 3000
 						if (strpos($self, 'page=login') === false) {
3002 3001
 							include_spip('inc/headers');
3003 3002
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3004
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3003
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3005 3004
 						}
3006 3005
 					}
3007 3006
 					// sinon tant pis
@@ -3043,10 +3042,10 @@  discard block
 block discarded – undo
3043 3042
 	// mais on risque de perturber des plugins en initialisant trop tot
3044 3043
 	// certaines constantes
3045 3044
 	@spip_initialisation_core(
3046
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3047
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3048
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3049
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3045
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3046
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3047
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3048
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3050 3049
 	);
3051 3050
 
3052 3051
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3079,7 +3078,7 @@  discard block
 block discarded – undo
3079 3078
 	}
3080 3079
 
3081 3080
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3082
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3081
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3083 3082
 		$session = charger_fonction('session', 'inc');
3084 3083
 		if ($session()) {
3085 3084
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3159,7 +3158,7 @@  discard block
 block discarded – undo
3159 3158
 			'definir_session',
3160 3159
 			$GLOBALS['visiteur_session']
3161 3160
 				? serialize($GLOBALS['visiteur_session'])
3162
-				. '_' . @$_COOKIE['spip_session']
3161
+				. '_'.@$_COOKIE['spip_session']
3163 3162
 				: ''
3164 3163
 		);
3165 3164
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3315,11 +3314,11 @@  discard block
 block discarded – undo
3315 3314
 	$GLOBALS['_INC_PUBLIC']++;
3316 3315
 
3317 3316
 	// fix #4235
3318
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3317
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3319 3318
 
3320 3319
 
3321 3320
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3322
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3321
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3323 3322
 
3324 3323
 		$page = evaluer_fond($f, $contexte, $connect);
3325 3324
 		if ($page === '') {
@@ -3404,7 +3403,7 @@  discard block
 block discarded – undo
3404 3403
  * @return array|string
3405 3404
  */
3406 3405
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3407
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3406
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3408 3407
 	if (!$pathinfo) {
3409 3408
 		return $f;
3410 3409
 	}
Please login to merge, or discard this patch.
ecrire/inc/install.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  **/
45 45
 function install_fichier_connexion($nom, $texte) {
46
-	$texte = '<' . "?php\n"
46
+	$texte = '<'."?php\n"
47 47
 		. "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n"
48 48
 		. $texte
49
-		. '?' . '>';
49
+		. '?'.'>';
50 50
 
51 51
 	ecrire_fichier($nom, $texte);
52 52
 }
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 		return $regs;
114 114
 	} else {
115 115
 		$ar = '\s*\'([^\']*)\'';
116
-		$r = '\s*,' . $ar;
116
+		$r = '\s*,'.$ar;
117 117
 		$r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#";
118 118
 		if (preg_match($r, $s, $regs)) {
119
-			$regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';');
119
+			$regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';');
120 120
 			array_shift($regs);
121 121
 			array_shift($regs);
122 122
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	// Si on n'a pas la bonne version de PHP, c'est la fin
174 174
 	if ($err) {
175 175
 		die("<div class='error'>"
176
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"
176
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"
177 177
 			. "<li><strong>{$err[0]}</strong></li>\n</ul></div>");
178 178
 	}
179 179
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
 	if ($err) {
202 202
 		echo "<div class='error'>"
203
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>";
203
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>";
204 204
 		foreach ($err as $e) {
205 205
 			echo "<li><strong>$e</strong></li>\n";
206 206
 		}
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 
234 234
 
235 235
 function info_etape($titre, $complement = '') {
236
-	return '<h2>' . $titre . "</h2>\n" .
237
-	($complement ? '' . $complement . "\n" : '');
236
+	return '<h2>'.$titre."</h2>\n".
237
+	($complement ? ''.$complement."\n" : '');
238 238
 }
239 239
 
240 240
 /**
@@ -248,18 +248,18 @@  discard block
 block discarded – undo
248 248
 		$code = _T('bouton_suivant');
249 249
 	}
250 250
 	static $suivant = 0;
251
-	$id = 'suivant' . (($suivant > 0) ? strval($suivant) : '');
251
+	$id = 'suivant'.(($suivant > 0) ? strval($suivant) : '');
252 252
 	$suivant += 1;
253 253
 
254
-	return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" .
255
-	$code .
254
+	return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"".
255
+	$code.
256 256
 	" >>\" /></p>\n";
257 257
 }
258 258
 
259 259
 function info_progression_etape($en_cours, $phase, $dir, $erreur = false) {
260 260
 	$intitule_etat = [];
261 261
 	//$en_cours = _request('etape')?_request('etape'):"";
262
-	$liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$');
262
+	$liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$');
263 263
 	$debut = 1;
264 264
 	$etat = 'ok';
265 265
 	$last = count($liste);
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 			$aff_etapes .= "<li class='$class'><div class='fond'>";
300 300
 			$aff_etapes .= ($debut == $en_cours) ? '<strong>' : '';
301
-			$aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
301
+			$aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
302 302
 			$aff_etapes .= $intitule_etat["$phase"][$debut];
303 303
 			$aff_etapes .= ($debut == $en_cours) ? '</strong>' : '';
304 304
 			$aff_etapes .= '</div></li>';
@@ -313,11 +313,11 @@  discard block
 block discarded – undo
313 313
 
314 314
 
315 315
 function fieldset($legend, $champs = [], $apres = '', $avant = '') {
316
-	return "<fieldset>\n" .
317
-	$avant .
318
-	($legend ? '<legend>' . $legend . "</legend>\n" : '') .
319
-	fieldset_champs($champs) .
320
-	$apres .
316
+	return "<fieldset>\n".
317
+	$avant.
318
+	($legend ? '<legend>'.$legend."</legend>\n" : '').
319
+	fieldset_champs($champs).
320
+	$apres.
321 321
 	"</fieldset>\n";
322 322
 }
323 323
 
@@ -327,18 +327,18 @@  discard block
 block discarded – undo
327 327
 		$type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text');
328 328
 		$class = isset($contenu['hidden']) ? '' : "class='formo' size='40' ";
329 329
 		if (isset($contenu['alternatives'])) {
330
-			$fieldset .= $contenu['label'] . "\n";
330
+			$fieldset .= $contenu['label']."\n";
331 331
 			foreach ($contenu['alternatives'] as $valeur => $label) {
332
-				$fieldset .= "<input type='radio' name='" . $nom .
332
+				$fieldset .= "<input type='radio' name='".$nom.
333 333
 					"' id='$nom-$valeur' value='$valeur'"
334 334
 					. (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '')
335 335
 					. "/>\n";
336
-				$fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n";
336
+				$fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n";
337 337
 			}
338 338
 			$fieldset .= "<br />\n";
339 339
 		} else {
340
-			$fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n";
341
-			$fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'"
340
+			$fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n";
341
+			$fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'"
342 342
 				. (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '')
343 343
 				. ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '')
344 344
 				. " />\n";
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
 function install_select_serveur() {
352 352
 	$options = [];
353
-	$dir = _DIR_RESTREINT . 'req/';
353
+	$dir = _DIR_RESTREINT.'req/';
354 354
 	$d = opendir($dir);
355 355
 	if (!$d) {
356 356
 		return [];
@@ -358,17 +358,17 @@  discard block
 block discarded – undo
358 358
 	while (($f = readdir($d)) !== false) {
359 359
 		if (
360 360
 			(preg_match('/^(.*)[.]php$/', $f, $s))
361
-			and is_readable($f = $dir . $f)
361
+			and is_readable($f = $dir.$f)
362 362
 		) {
363 363
 			require_once($f);
364 364
 			$s = $s[1];
365
-			$v = 'spip_versions_' . $s;
365
+			$v = 'spip_versions_'.$s;
366 366
 			if (function_exists($v) and $v()) {
367 367
 				$titre = _T("install_select_type_$s");
368 368
 				// proposer mysql par defaut si dispo
369 369
 				$checked = ($s == 'mysql' ? " checked='checked'" : '');
370 370
 				$options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>"
371
-					. "<label for='$s'>" . ($titre ?: $s) . '</label></li>';
371
+					. "<label for='$s'>".($titre ?: $s).'</label></li>';
372 372
 			} else {
373 373
 				spip_log("$s: portage indisponible");
374 374
 			}
@@ -386,8 +386,8 @@  discard block
 block discarded – undo
386 386
 		"\n<input type='hidden' name='etape' value='$etape' />"
387 387
 		. $hidden
388 388
 		. (_request('echec') ?
389
-			('<p><b>' . _T('avis_connexion_echec_1') .
390
-				'</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>')
389
+			('<p><b>'._T('avis_connexion_echec_1').
390
+				'</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>')
391 391
 			: '')
392 392
 
393 393
 		. ($jquery ? http_script('', 'jquery.js') : '')
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
 		});')
426 426
 
427 427
 		. ($server_db
428
-			? '<input type="hidden" name="server_db" value="' . $server_db . '" />'
428
+			? '<input type="hidden" name="server_db" value="'.$server_db.'" />'
429 429
 			. (($predef[0])
430
-				? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>')
430
+				? ('<h3>'._T('install_serveur_hebergeur').'</h3>')
431 431
 				: '')
432 432
 			: ('<fieldset><legend>'
433 433
 				. _T('install_select_type_db')
@@ -442,9 +442,9 @@  discard block
 block discarded – undo
442 442
 				. "\n</ul>\n</div></fieldset>")
443 443
 		)
444 444
 		. '<div id="install_adresse_base_hebergeur">'
445
-		. '<p>' . _T('texte_connexion_mysql') . '</p>'
445
+		. '<p>'._T('texte_connexion_mysql').'</p>'
446 446
 		. ($predef[1]
447
-			? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>'
447
+			? '<h3>'._T('install_adresse_base_hebergeur').'</h3>'
448 448
 			: fieldset(
449 449
 				_T('entree_base_donnee_1'),
450 450
 				[
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 		. '<div id="install_login_base_hebergeur">'
461 461
 		. ($predef[2]
462
-			? '<h3>' . _T('install_login_base_hebergeur') . '</h3>'
462
+			? '<h3>'._T('install_login_base_hebergeur').'</h3>'
463 463
 			: fieldset(
464 464
 				_T('entree_login_connexion_1'),
465 465
 				[
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 
475 475
 		. '<div id="install_pass_base_hebergeur">'
476 476
 		. ($predef[3]
477
-			? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>'
477
+			? '<h3>'._T('install_pass_base_hebergeur').'</h3>'
478 478
 			: fieldset(
479 479
 				_T('entree_mot_passe_1'),
480 480
 				[
@@ -496,20 +496,20 @@  discard block
 block discarded – undo
496 496
 function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) {
497 497
 	return ((defined('_INSTALL_HOST_DB'))
498 498
 		? ''
499
-		: "\n<input type='hidden' name='adresse_db'  value=\"" . spip_htmlspecialchars($adresse_db) . '" />'
499
+		: "\n<input type='hidden' name='adresse_db'  value=\"".spip_htmlspecialchars($adresse_db).'" />'
500 500
 	)
501 501
 	. ((defined('_INSTALL_USER_DB'))
502 502
 		? ''
503
-		: "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />'
503
+		: "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />'
504 504
 	)
505 505
 	. ((defined('_INSTALL_PASS_DB'))
506 506
 		? ''
507
-		: "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />'
507
+		: "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />'
508 508
 	)
509 509
 
510 510
 	. ((defined('_INSTALL_SERVER_DB'))
511 511
 		? ''
512
-		: "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />'
512
+		: "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />'
513 513
 	);
514 514
 }
515 515
 
Please login to merge, or discard this patch.
ecrire/inc/lien.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	return $r ?: traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo);
99 99
 }
100 100
 
101
-define('_EXTRAIRE_LIEN', ',^\s*(?:' . _PROTOCOLES_STD . '):?/?/?\s*$,iS');
101
+define('_EXTRAIRE_LIEN', ',^\s*(?:'._PROTOCOLES_STD.'):?/?/?\s*$,iS');
102 102
 
103 103
 function traiter_lien_explicite($ref, $texte = '', $pour = 'url', string $connect = '', $echappe_typo = true) {
104 104
 	if (preg_match(_EXTRAIRE_LIEN, $ref)) {
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 		$lien_court = charger_fonction('lien_court', 'inc');
115 115
 		$texte = $lien_court($texte);
116 116
 		if ($echappe_typo) {
117
-			$texte = '<html>' . quote_amp($texte) . '</html>';
117
+			$texte = '<html>'.quote_amp($texte).'</html>';
118 118
 		}
119 119
 	}
120 120
 
121 121
 	// petites corrections d'URL
122 122
 	if (preg_match('/^www\.[^@]+$/S', $lien)) {
123
-		$lien = 'http://' . $lien;
123
+		$lien = 'http://'.$lien;
124 124
 	} else {
125 125
 		if (strpos($lien, '@') && email_valide($lien)) {
126 126
 			if (!$texte) {
127 127
 				$texte = $lien;
128 128
 			}
129
-			$lien = 'mailto:' . $lien;
129
+			$lien = 'mailto:'.$lien;
130 130
 		}
131 131
 	}
132 132
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 }
143 143
 
144 144
 function liens_implicite_glose_dist($texte, $id, $type, $args, $ancre, string $connect = '') {
145
-	if (function_exists($f = 'glossaire_' . $ancre)) {
145
+	if (function_exists($f = 'glossaire_'.$ancre)) {
146 146
 		$url = $f($texte, $id);
147 147
 	} else {
148 148
 		$url = glossaire_std($texte);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	if (!($match = typer_raccourci($ref))) {
157 157
 		return false;
158 158
 	}
159
-	[$type, , $id, , $args, , $ancre] = array_pad($match, 7, null);
159
+	[$type,, $id,, $args,, $ancre] = array_pad($match, 7, null);
160 160
 	// attention dans le cas des sites le lien doit pointer non pas sur
161 161
 	// la page locale du site, mais directement sur le site lui-meme
162 162
 	if ($f = charger_fonction("implicite_$type", 'liens', true)) {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		$r['titre'] = $texte;
184 184
 	}
185 185
 	if (!@$r['titre']) {
186
-		$r['titre'] = _T($type) . " $id";
186
+		$r['titre'] = _T($type)." $id";
187 187
 	}
188 188
 	if ($pour == 'titre') {
189 189
 		return $r['titre'];
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		and $mime = sql_getfetsel(
197 197
 			'mime_type',
198 198
 			'spip_types_documents',
199
-			'extension IN (' . sql_get_select('extension', 'spip_documents', 'id_document=' . sql_quote($id)) . ')',
199
+			'extension IN ('.sql_get_select('extension', 'spip_documents', 'id_document='.sql_quote($id)).')',
200 200
 			'',
201 201
 			'',
202 202
 			'',
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
 	'(<([a-z_-]{3,})' # <modele
298 298
 	. '\s*([0-9]*)\s*' # id
299 299
 	. '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>)
300
-	. '\s*/?' . '>)' # fin du modele >
300
+	. '\s*/?'.'>)' # fin du modele >
301 301
 	. '\s*(<\/a>)?' # eventuel </a>
302 302
 );
303 303
 
304
-define('_RACCOURCI_MODELE_DEBUT', '@^' . _RACCOURCI_MODELE . '@isS');
304
+define('_RACCOURCI_MODELE_DEBUT', '@^'._RACCOURCI_MODELE.'@isS');
305 305
 
306 306
 function traiter_modeles($texte, $doublons = false, $echap = '', string $connect = '', $liens = null, $env = []) {
307 307
 	// preserver la compatibilite : true = recherche des documents
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 						if (test_espace_prive()) {
381 381
 							$modele = entites_html(substr($texte, $a, $cherche));
382 382
 							if (!is_null($liens)) {
383
-								$modele = '<pre>' . str_replace($liens[0], $liens[1], $modele) . '</pre>';
383
+								$modele = '<pre>'.str_replace($liens[0], $liens[1], $modele).'</pre>';
384 384
 							}
385 385
 						}
386 386
 					}
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 	// celle du texte) et public (spip_lang est la langue du texte)
45 45
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
46 46
 
47
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
47
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
48 48
 	if ($dir == 'rtl') {
49 49
 		$p .= '_rtl';
50 50
 	}
51 51
 
52 52
 	if (!isset($GLOBALS[$p])) {
53
-		$GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>';
53
+		$GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>';
54 54
 	}
55 55
 
56 56
 	return $GLOBALS[$p];
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 
70 70
 if (!defined('_BALISES_BLOCS_REGEXP')) {
71
-	define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
71
+	define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
72 72
 }
73 73
 
74 74
 //
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	// Tester si on echappe en span ou en div
87 87
 	if (is_null($mode) or !in_array($mode, ['div', 'span'])) {
88
-		$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span';
88
+		$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span';
89 89
 	}
90 90
 
91 91
 	// Decouper en morceaux, base64 a des probleme selon la taille de la pile
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	) {
121 121
 		foreach ($matches as $m) {
122 122
 			if ($m[1] === 'code') {
123
-				$code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>';
123
+				$code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>';
124 124
 				$pre = str_replace($m[0], $code, $pre);
125 125
 			}
126 126
 		}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 // Echapper les <code>...</ code>
132 132
 function traiter_echap_code_dist($regs) {
133
-	[, , $att, $corps] = $regs;
133
+	[,, $att, $corps] = $regs;
134 134
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
135 135
 
136 136
 	// ne pas mettre le <div...> s'il n'y a qu'une ligne
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$echap = nl2br($echap);
142 142
 		$echap = "<div style='text-align: left;' "
143 143
 			. "class='spip_code' dir='ltr'><code$att>"
144
-			. $echap . '</code></div>';
144
+			. $echap.'</code></div>';
145 145
 	} else {
146
-		$echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>';
146
+		$echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>';
147 147
 	}
148 148
 
149 149
 	$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 			} // sinon les traiter selon le cas
230 230
 			else {
231 231
 				if (
232
-					function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1]))
233
-					or function_exists($f = $f . '_dist')
232
+					function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1]))
233
+					or function_exists($f = $f.'_dist')
234 234
 				) {
235 235
 					$echap = $f($regs);
236 236
 				}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	// dans une callback autonommee
252 252
 	if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) {
253 253
 		if (
254
-			strpos($letexte, '<' . '?') !== false and preg_match_all(
254
+			strpos($letexte, '<'.'?') !== false and preg_match_all(
255 255
 				',<[?].*($|[?]>),UisS',
256 256
 				$letexte,
257 257
 				$matches,
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			strpos($letexte, '<') !== false
284 284
 			and
285 285
 			preg_match_all(
286
-				',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS',
286
+				',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS',
287 287
 				$letexte,
288 288
 				$regs,
289 289
 				PREG_SET_ORDER
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 					}
301 301
 				}
302 302
 				if ($at) {
303
-					$rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>';
303
+					$rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>';
304 304
 					foreach ($at as $attr => $a) {
305 305
 						$rempl = inserer_attribut($rempl, $attr, $a);
306 306
 					}
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	$texte = nettoyer_raccourcis_typo($texte);
382 382
 
383 383
 	// balises de sauts de ligne et paragraphe
384
-	$texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte);
385
-	$texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte);
384
+	$texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte);
385
+	$texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte);
386 386
 
387 387
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
388 388
 	$texte = str_replace("\n\n", "\r", $texte);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	// supprimer les tags
391 391
 	$texte = supprimer_tags($texte);
392 392
 	$texte = trim(str_replace("\n", ' ', $texte));
393
-	$texte .= "\n";  // marquer la fin
393
+	$texte .= "\n"; // marquer la fin
394 394
 
395 395
 	// corriger la longueur de coupe
396 396
 	// en fonction de la presence de caracteres utf
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	// couper au mot precedent
406 406
 	$long = spip_substr($texte, 0, max($taille - 4, 1));
407 407
 	$u = $GLOBALS['meta']['pcre_u'];
408
-	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
408
+	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
409 409
 	if (is_null($suite)) {
410 410
 		$suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : '&nbsp;(...)');
411 411
 	}
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	if (spip_strlen($court) < max(0.75 * $taille, 2)) {
416 416
 		$points = '';
417 417
 		$long = spip_substr($texte, 0, $taille);
418
-		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
418
+		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
419 419
 		// encore trop court ? couper au caractere
420 420
 		if (spip_strlen($texte) < 0.75 * $taille) {
421 421
 			$texte = $long;
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	// supprimer l'eventuelle entite finale mal coupee
435 435
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
436 436
 
437
-	return quote_amp(trim($texte)) . $points;
437
+	return quote_amp(trim($texte)).$points;
438 438
 }
439 439
 
440 440
 
@@ -446,16 +446,16 @@  discard block
 block discarded – undo
446 446
 				define('_PROTEGE_JS_MODELES', creer_uniqid());
447 447
 			}
448 448
 			foreach ($r as $regs) {
449
-				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
449
+				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t);
450 450
 			}
451 451
 		}
452
-		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
452
+		if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) {
453 453
 			if (!defined('_PROTEGE_PHP_MODELES')) {
454 454
 				include_spip('inc/acces');
455 455
 				define('_PROTEGE_PHP_MODELES', creer_uniqid());
456 456
 			}
457 457
 			foreach ($r as $regs) {
458
-				$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t);
458
+				$t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t);
459 459
 			}
460 460
 		}
461 461
 	}
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 		if (!function_exists('attribut_html')) {
529 529
 			include_spip('inc/filtres');
530 530
 		}
531
-		$texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte;
531
+		$texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte;
532 532
 	}
533 533
 
534 534
 	return $texte;
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
  **/
599 599
 function supprime_img($letexte, $message = null) {
600 600
 	if ($message === null) {
601
-		$message = '(' . _T('img_indisponible') . ')';
601
+		$message = '('._T('img_indisponible').')';
602 602
 	}
603 603
 
604 604
 	return preg_replace(
605
-		',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
605
+		',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
606 606
 		$message,
607 607
 		$letexte
608 608
 	);
Please login to merge, or discard this patch.
ecrire/inc/lang.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 function changer_langue($lang, $liste_langues = null) {
41 41
 
42 42
 	if (is_null($liste_langues)) {
43
-		$liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'];
43
+		$liste_langues = @$GLOBALS['meta']['langues_proposees'].','.@$GLOBALS['meta']['langues_multilingue'];
44 44
 	}
45 45
 	else {
46 46
 		if (is_array($liste_langues)) {
47 47
 			$liste_langues = implode(',', $liste_langues);
48 48
 		}
49 49
 	}
50
-	$liste_langues = ',' . $liste_langues . ',';
50
+	$liste_langues = ','.$liste_langues.',';
51 51
 
52 52
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
53 53
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 	foreach ($langues as $l) {
195 195
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
196
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
196
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
197 197
 	}
198 198
 
199 199
 	if (!test_espace_prive()) {
@@ -211,23 +211,21 @@  discard block
 block discarded – undo
211 211
 		$base,
212 212
 		$cible,
213 213
 		(select_langues($nom_select, $change, $ret)
214
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
214
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
215 215
 		" method='post'"
216 216
 	);
217 217
 }
218 218
 
219 219
 function select_langues($nom_select, $change, $options, $label = '') {
220 220
 	static $cpt = 0;
221
-	$id = 'menu_langues' . $cpt++;
221
+	$id = 'menu_langues'.$cpt++;
222 222
 
223 223
 	return
224
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
224
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
225 225
 		"<select name='$nom_select' id='$id' "
226 226
 		. ((!test_espace_prive()) ?
227
-			("class='forml menu_langues'") :
228
-			(($nom_select == 'var_lang_ecrire') ?
229
-				("class='lang_ecrire'") :
230
-				"class='fondl'"))
227
+			("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ?
228
+				("class='lang_ecrire'") : "class='fondl'"))
231 229
 		. $change
232 230
 		. ">\n"
233 231
 		. $options
@@ -353,7 +351,7 @@  discard block
 block discarded – undo
353 351
 		and (!isset($GLOBALS['spip_lang'])
354 352
 			or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
355 353
 	) {
356
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
354
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
357 355
 	}
358 356
 	// en theorie là, la globale est définie, sinon c'est un problème.
359 357
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -456,7 +454,7 @@  discard block
 block discarded – undo
456 454
 	if (!isset($GLOBALS['meta']['langue_site'])) {
457 455
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
458 456
 		$GLOBALS['meta']['langue_site'] = $tout =
459
-			(!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false))
457
+			(!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false))
460 458
 				? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ','));
461 459
 		ecrire_meta('langue_site', $tout);
462 460
 	}
Please login to merge, or discard this patch.