Completed
Push — master ( 37aa61...be7234 )
by cam
01:24
created
ecrire/src/Texte/Collecteur/Idiomes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
 				$offset_pos = 0;
108 108
 				foreach ($idiomes as $idiome) {
109 109
 
110
-					$cle = ($idiome['module'] ? $idiome['module'] . ':' : '') . $idiome['chaine'];
110
+					$cle = ($idiome['module'] ? $idiome['module'].':' : '').$idiome['chaine'];
111 111
 					$desc = $traduire($cle, $lang, true);
112 112
 					$l = $desc->langue;
113 113
 
Please login to merge, or discard this patch.
ecrire/src/Texte/Collecteur/Modeles.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,10 @@
 block discarded – undo
32 32
 
33 33
 	public function __construct(?string $preg = null) {
34 34
 
35
-		$this->preg_modele = ($preg ?:
36
-			'@<([a-z_-]{3,})' # <modele
35
+		$this->preg_modele = ($preg ?: '@<([a-z_-]{3,})' # <modele
37 36
 			. '\s*([0-9]*)\s*' # id
38 37
 			. '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>)
39
-			. '\s*/?' . '>@isS' # fin du modele >
38
+			. '\s*/?'.'>@isS' # fin du modele >
40 39
 		);
41 40
 	}
42 41
 
Please login to merge, or discard this patch.
ecrire/public/compiler.php 1 patch
Spacing   +109 added lines, -118 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 						: calculer_liste($val, $p->descr, $boucles, $id_boucle);
125 125
 					if ($var !== 1) {
126 126
 						$val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
127
-							. $val . ($echap ? ") . '" : ' ');
127
+							. $val.($echap ? ") . '" : ' ');
128 128
 					} else {
129 129
 						$val = $echap ? "'.$val.'" : $val;
130 130
 					}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	if (!$lang) {
146 146
 		$lang = '$GLOBALS["spip_lang"]';
147 147
 	}
148
-	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' ');
148
+	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' ');
149 149
 
150 150
 	return $l;
151 151
 }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	$_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
176 176
 	if (is_string($p->texte)) {
177 177
 		$fichier = $p->texte;
178
-		$code = '"' . str_replace('"', '\"', $fichier) . '"';
178
+		$code = '"'.str_replace('"', '\"', $fichier).'"';
179 179
 	} else {
180 180
 		$code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
181 181
 		if ($code and preg_match("/^'([^']*)'/s", $code, $r)) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		return false;
225 225
 	} // j'aurais voulu toucher le fond ...
226 226
 
227
-	$contexte = 'array(' . $_contexte . ')';
227
+	$contexte = 'array('.$_contexte.')';
228 228
 
229 229
 	if ($env) {
230 230
 		$contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
 			$_options[] = $ajax;
240 240
 		}
241 241
 		$code = " ' . argumenter_squelette($code) . '";
242
-		$code = 'echo ' . sprintf(
242
+		$code = 'echo '.sprintf(
243 243
 			CODE_RECUPERER_FOND,
244 244
 			$code,
245 245
 			$contexte,
246 246
 			implode(',', $_options),
247 247
 			"_request(\\'connect\\') ?? \\'\\'"
248
-		) . ';';
248
+		).';';
249 249
 	}
250 250
 
251
-	return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'";
251
+	return "\n'<'.'".'?php '.$code."\n?'."."'>'";
252 252
 }
253 253
 
254 254
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 					$id = $id_table;
329 329
 					$statut = preg_replace(',\W,', '', $s['champ']); // securite
330 330
 				}
331
-				$mstatut = $id . '.' . $statut;
331
+				$mstatut = $id.'.'.$statut;
332 332
 
333 333
 				$arg_ignore_previsu = ($ignore_previsu ? ',true' : '');
334 334
 				include_spip('public/quete');
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
 					isset($s['post_date']) and $s['post_date']
337 337
 					and $GLOBALS['meta']['post_dates'] == 'non'
338 338
 				) {
339
-					$date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
339
+					$date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite
340 340
 					array_unshift(
341 341
 						$boucle->where,
342 342
 						$echapper ?
343
-							"\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
343
+							"\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)"
344 344
 							:
345 345
 							quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
346 346
 					);
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 					$boucle->where,
350 350
 					$echapper ?
351 351
 						"\nquete_condition_statut('$mstatut',"
352
-						. _q($s['previsu']) . ','
353
-						. _q($s['publie']) . ','
354
-						. _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
352
+						. _q($s['previsu']).','
353
+						. _q($s['publie']).','
354
+						. _q($boucle->sql_serveur)."$arg_ignore_previsu)"
355 355
 						:
356 356
 						quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
357 357
 				);
@@ -385,14 +385,14 @@  discard block
 block discarded – undo
385 385
 	if (_request('var_mode_affiche') != 'resultat') {
386 386
 		$trace = '';
387 387
 	} else {
388
-		$_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
388
+		$_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle;
389 389
 		$_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
390 390
 		$trace = "
391 391
 		if (empty($_trace)) {
392 392
 			$_trace = [];
393 393
 		}
394 394
 		if (count($_trace) < 3) {
395
-			$_trace" . '[] = $t0;
395
+			$_trace".'[] = $t0;
396 396
 		}';
397 397
 	}
398 398
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	return
427 427
 		// Numrows[$nom] peut ne pas être encore defini
428 428
 		"\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
429
-		. "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';'
429
+		. "\n\t\$t0 = ".$boucles[$id_boucle]->return.';'
430 430
 		. "\n\t\$Numrows['$nom'] = (\$save_numrows);"
431 431
 		. $trace
432 432
 		. "\n\treturn \$t0;";
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	// faudrait expanser le foreach a la compil, car y en a souvent qu'un
495 495
 	// et puis faire un [] plutot qu'un "','."
496 496
 	if ($boucle->doublons) {
497
-		$corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
497
+		$corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '.
498 498
 			index_pile($id_boucle, $primary, $boucles)
499 499
 			. "; // doublons\n";
500 500
 	}
@@ -522,13 +522,13 @@  discard block
 block discarded – undo
522 522
 		$corps .=
523 523
 			"\n\t\tlang_select_public("
524 524
 			. index_pile($id_boucle, 'lang', $boucles)
525
-			. ", '" . $boucle->lang_select . "'"
525
+			. ", '".$boucle->lang_select."'"
526 526
 			. (in_array($type_boucle, [
527 527
 				'articles',
528 528
 				'rubriques',
529 529
 				'hierarchie',
530 530
 				'breves'
531
-			]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
531
+			]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '')
532 532
 			. ');';
533 533
 	} else {
534 534
 		$init_lang = '';
@@ -550,20 +550,16 @@  discard block
 block discarded – undo
550 550
 
551 551
 	// gestion optimale des separateurs et des boucles constantes
552 552
 	if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) {
553
-		$code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
553
+		$code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'");
554 554
 	}
555 555
 
556 556
 	$corps .=
557 557
 		((!$boucle->separateur) ?
558
-			(($constant && !$corps && !$flag_cpt) ? $return :
559
-				(($return === "''") ? '' :
560
-					("\n\t\t" . '$t0 .= ' . $return . ';'))) :
561
-			("\n\t\t\$t1 " .
558
+			(($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ".
562 559
 				((strpos($return, '$t1.') === 0) ?
563
-					('.=' . substr($return, 4)) :
564
-					('= ' . $return)) .
565
-				";\n\t\t" .
566
-				'$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
560
+					('.='.substr($return, 4)) : ('= '.$return)).
561
+				";\n\t\t".
562
+				'$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;"));
567 563
 
568 564
 	// Calculer les invalideurs si c'est une boucle non constante et si on
569 565
 	// souhaite invalider ces elements
@@ -645,7 +641,7 @@  discard block
 block discarded – undo
645 641
 		$corps,
646 642
 		$fin_lang,
647 643
 		$trace,
648
-		'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
644
+		'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile'])
649 645
 	);
650 646
 
651 647
 	return $a;
@@ -665,25 +661,24 @@  discard block
 block discarded – undo
665 661
  **/
666 662
 function calculer_requete_sql($boucle) {
667 663
 	$init = [];
668
-	$init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
669
-	$init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
664
+	$init[] = calculer_dec('table', "'".$boucle->id_table."'");
665
+	$init[] = calculer_dec('id', "'".$boucle->id_boucle."'");
670 666
 	# En absence de champ c'est un decompte :
671 667
 	$init[] = calculer_dec('from', calculer_from($boucle));
672 668
 	$init[] = calculer_dec('type', calculer_from_type($boucle));
673 669
 	$init[] = calculer_dec(
674 670
 		'groupby',
675
-		'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')'
671
+		'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')'
676 672
 	);
677
-	$init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")');
678
-	$init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')');
673
+	$init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")');
674
+	$init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')');
679 675
 	$init[] = calculer_dec('where', calculer_dump_array($boucle->where));
680 676
 	$init[] = calculer_dec('join', calculer_dump_join($boucle->join));
681 677
 	$init[] = calculer_dec(
682 678
 		'limit',
683 679
 		(
684 680
 			strpos($boucle->limit, 'intval') === false ?
685
-			"'" . ($boucle->limit) . "'" :
686
-			$boucle->limit
681
+			"'".($boucle->limit)."'" : $boucle->limit
687 682
 		)
688 683
 	);
689 684
 	$init[] = calculer_dec('having', calculer_dump_array($boucle->having));
@@ -692,17 +687,17 @@  discard block
 block discarded – undo
692 687
 	// ou recalculée à chaque passage (vide)
693 688
 	foreach ($init as $i) {
694 689
 		if (reset($i)) {
695
-			$s .= "\n\t\t" . end($i);
690
+			$s .= "\n\t\t".end($i);
696 691
 		} # statique
697 692
 		else {
698
-			$d .= "\n\t" . end($i);
693
+			$d .= "\n\t".end($i);
699 694
 		} # dynamique
700 695
 	}
701 696
 
702 697
 	return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
703 698
 	. $boucle->in
704 699
 	. $boucle->hash
705
-	. "\n\t" . 'if (!isset($command[\'table\'])) {'
700
+	. "\n\t".'if (!isset($command[\'table\'])) {'
706 701
 	. $s
707 702
 	. "\n\t}"
708 703
 	. $d;
@@ -757,7 +752,7 @@  discard block
 block discarded – undo
757 752
 	];
758 753
 
759 754
 	$p->id_boucle = $context_compil[2] ?? '';
760
-	$p->ligne = (int)($context_compil[3] ?? 0);
755
+	$p->ligne = (int) ($context_compil[3] ?? 0);
761 756
 	$p->lang = $context_compil[4] ?? '';
762 757
 
763 758
 	return $p;
@@ -786,7 +781,7 @@  discard block
 block discarded – undo
786 781
  *    - index 1 : Code de l'affectation
787 782
  **/
788 783
 function calculer_dec($nom, $val) {
789
-	$static = 'if (!isset($command[\'' . $nom . '\'])) ';
784
+	$static = 'if (!isset($command[\''.$nom.'\'])) ';
790 785
 	// si une variable apparait dans le calcul de la clause
791 786
 	// il faut la re-evaluer a chaque passage
792 787
 	if (
@@ -803,7 +798,7 @@  discard block
 block discarded – undo
803 798
 		$static = '';
804 799
 	}
805 800
 
806
-	return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';'];
801
+	return [$static, '$command[\''.$nom.'\'] = '.$val.';'];
807 802
 }
808 803
 
809 804
 /**
@@ -828,27 +823,27 @@  discard block
 block discarded – undo
828 823
 	}
829 824
 	$res = '';
830 825
 	if ($a and $a[0] == "'?'") {
831
-		return ('(' . calculer_dump_array($a[1]) .
832
-			' ? ' . calculer_dump_array($a[2]) .
833
-			' : ' . calculer_dump_array($a[3]) .
826
+		return ('('.calculer_dump_array($a[1]).
827
+			' ? '.calculer_dump_array($a[2]).
828
+			' : '.calculer_dump_array($a[3]).
834 829
 			')');
835 830
 	} else {
836 831
 		foreach ($a as $k => $v) {
837
-			$showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
838
-			$res .= ', ' . $showk . calculer_dump_array($v);
832
+			$showk = (is_numeric($k) ? '' : sql_quote($k).' => ');
833
+			$res .= ', '.$showk.calculer_dump_array($v);
839 834
 		}
840 835
 
841
-		return "\n\t\t\tarray(" . substr($res, 2) . ')';
836
+		return "\n\t\t\tarray(".substr($res, 2).')';
842 837
 	}
843 838
 }
844 839
 
845 840
 function calculer_dump_join($a) {
846 841
 	$res = '';
847 842
 	foreach ($a as $k => $v) {
848
-		$res .= ", '$k' => array(" . implode(',', $v) . ')';
843
+		$res .= ", '$k' => array(".implode(',', $v).')';
849 844
 	}
850 845
 
851
-	return 'array(' . substr($res, 2) . ')';
846
+	return 'array('.substr($res, 2).')';
852 847
 }
853 848
 
854 849
 /**
@@ -865,7 +860,7 @@  discard block
 block discarded – undo
865 860
 		$res .= ",'$k' => '$v'";
866 861
 	}
867 862
 
868
-	return 'array(' . substr($res, 1) . ')';
863
+	return 'array('.substr($res, 1).')';
869 864
 }
870 865
 
871 866
 /**
@@ -883,7 +878,7 @@  discard block
 block discarded – undo
883 878
 		$res .= ",'$k' => '$v'";
884 879
 	}
885 880
 
886
-	return 'array(' . substr($res, 1) . ')';
881
+	return 'array('.substr($res, 1).')';
887 882
 }
888 883
 
889 884
 function calculer_order(&$boucle) {
@@ -952,19 +947,19 @@  discard block
 block discarded – undo
952 947
 				) {
953 948
 					$res .= " .\n$tab$code";
954 949
 				} else {
955
-					$res = substr($res, 0, -1) . substr($code, 1);
950
+					$res = substr($res, 0, -1).substr($code, 1);
956 951
 				}
957 952
 			}
958 953
 
959
-			return '(' . substr($res, 2 + $descr['niv']) . ')';
954
+			return '('.substr($res, 2 + $descr['niv']).')';
960 955
 		}
961 956
 	} else {
962
-		$nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: '');
957
+		$nom = $descr['nom'].$id_boucle.($descr['niv'] ?: '');
963 958
 
964
-		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(
959
+		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join(
965 960
 			" ,\n$tab",
966 961
 			$codes
967
-		) . ')))';
962
+		).')))';
968 963
 	}
969 964
 }
970 965
 
@@ -1000,7 +995,7 @@  discard block
 block discarded – undo
1000 995
 			// texte seul
1001 996
 			case 'texte':
1002 997
 				$code = sandbox_composer_texte($p->texte, $p);
1003
-				$commentaire = strlen($p->texte) . ' signes';
998
+				$commentaire = strlen($p->texte).' signes';
1004 999
 				$avant = '';
1005 1000
 				$apres = '';
1006 1001
 				$altern = "''";
@@ -1009,14 +1004,14 @@  discard block
 block discarded – undo
1009 1004
 			case 'polyglotte':
1010 1005
 				$code = '';
1011 1006
 				foreach ($p->traductions as $k => $v) {
1012
-					$code .= ",'" .
1013
-						str_replace(['\\', "'"], ['\\\\', "\\'"], $k) .
1014
-						"' => '" .
1015
-						str_replace(['\\', "'"], ['\\\\', "\\'"], $v) .
1007
+					$code .= ",'".
1008
+						str_replace(['\\', "'"], ['\\\\', "\\'"], $k).
1009
+						"' => '".
1010
+						str_replace(['\\', "'"], ['\\\\', "\\'"], $v).
1016 1011
 						"'";
1017 1012
 				}
1018
-				$code = 'choisir_traduction(array(' .
1019
-					substr($code, 1) .
1013
+				$code = 'choisir_traduction(array('.
1014
+					substr($code, 1).
1020 1015
 					'))';
1021 1016
 				$commentaire = '&';
1022 1017
 				$avant = '';
@@ -1032,7 +1027,7 @@  discard block
 block discarded – undo
1032 1027
 					$err_e_c = true;
1033 1028
 					$code = "''";
1034 1029
 				} else {
1035
-					$commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1030
+					$commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>';
1036 1031
 					$avant = '';
1037 1032
 					$apres = '';
1038 1033
 					$altern = "''";
@@ -1061,8 +1056,8 @@  discard block
 block discarded – undo
1061 1056
 					$err_e_c = true;
1062 1057
 					$code = "''";
1063 1058
 				} else {
1064
-					$code = 'BOUCLE' .
1065
-						str_replace('-', '_', $nom) . $descr['nom'] .
1059
+					$code = 'BOUCLE'.
1060
+						str_replace('-', '_', $nom).$descr['nom'].
1066 1061
 						'($Cache, $Pile, $doublons, $Numrows, $SP)';
1067 1062
 					$commentaire = "?$nom";
1068 1063
 					if (
@@ -1104,24 +1099,22 @@  discard block
 block discarded – undo
1104 1099
 				foreach ($p->arg as $k => $v) {
1105 1100
 					$_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1106 1101
 					if ($k) {
1107
-						$l[] = _q($k) . ' => ' . $_v;
1102
+						$l[] = _q($k).' => '.$_v;
1108 1103
 					} else {
1109 1104
 						$code = $_v;
1110 1105
 					}
1111 1106
 				}
1112 1107
 				// Si le module n'est pas fourni, l'expliciter sauf si calculé
1113 1108
 				if ($p->module) {
1114
-					$m = $p->module . ':' . $p->nom_champ;
1109
+					$m = $p->module.':'.$p->nom_champ;
1115 1110
 				} elseif ($p->nom_champ) {
1116
-					$m = MODULES_IDIOMES . ':' . $p->nom_champ;
1111
+					$m = MODULES_IDIOMES.':'.$p->nom_champ;
1117 1112
 				} else {
1118 1113
 					$m = '';
1119 1114
 				}
1120 1115
 
1121
-				$code = (!$code ? "'$m'" :
1122
-						($m ? "'$m' . $code" :
1123
-							("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1124
-					. (!$l ? '' : (', array(' . implode(",\n", $l) . ')'));
1116
+				$code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))")))
1117
+					. (!$l ? '' : (', array('.implode(",\n", $l).')'));
1125 1118
 				$code = "_T($code)";
1126 1119
 				if ($p->param) {
1127 1120
 					$p->id_boucle = $id_boucle;
@@ -1143,7 +1136,7 @@  discard block
 block discarded – undo
1143 1136
 				$p->type_requete = $type;
1144 1137
 
1145 1138
 				$code = calculer_champ($p);
1146
-				$commentaire = '#' . $p->nom_champ . $p->etoile;
1139
+				$commentaire = '#'.$p->nom_champ.$p->etoile;
1147 1140
 				$avant = calculer_liste(
1148 1141
 					$p->avant,
1149 1142
 					$descr,
@@ -1183,10 +1176,9 @@  discard block
 block discarded – undo
1183 1176
 		if ($code != "''") {
1184 1177
 			$code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1185 1178
 			$codes[] = (($mode == 'validation') ?
1186
-				"array($code, '$commentaire', " . $p->ligne . ')'
1179
+				"array($code, '$commentaire', ".$p->ligne.')'
1187 1180
 				: (($mode == 'code') ?
1188
-					"\n// $commentaire\n$code" :
1189
-					$code));
1181
+					"\n// $commentaire\n$code" : $code));
1190 1182
 		}
1191 1183
 	} // foreach
1192 1184
 
@@ -1242,19 +1234,19 @@  discard block
 block discarded – undo
1242 1234
 			$cond = '';
1243 1235
 		} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1244 1236
 			$t = $r[2];
1245
-			$cond = '!' . $r[1];
1237
+			$cond = '!'.$r[1];
1246 1238
 		} else {
1247 1239
 			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) {
1248 1240
 				$t = $r[2];
1249 1241
 				$cond = $r[1];
1250 1242
 			} else {
1251
-				$t = '$t' . $n;
1243
+				$t = '$t'.$n;
1252 1244
 				$cond = "($t = $code)!==''";
1253 1245
 			}
1254 1246
 		}
1255 1247
 
1256
-		$res = (!$avant ? '' : "$avant . ") .
1257
-			$t .
1248
+		$res = (!$avant ? '' : "$avant . ").
1249
+			$t.
1258 1250
 			(!$apres ? '' : " . $apres");
1259 1251
 
1260 1252
 		if ($res !== $t) {
@@ -1305,12 +1297,12 @@  discard block
 block discarded – undo
1305 1297
 
1306 1298
 	// rendre inertes les echappements de #[](){}<>
1307 1299
 	$i = 0;
1308
-	while (str_contains($squelette, $inerte = '-INERTE' . $i)) {
1300
+	while (str_contains($squelette, $inerte = '-INERTE'.$i)) {
1309 1301
 		$i++;
1310 1302
 	}
1311 1303
 	$squelette = preg_replace_callback(
1312 1304
 		',\\\\([#[()\]{}<>]),',
1313
-		fn($a) => "$inerte-" . ord($a[1]) . '-',
1305
+		fn($a) => "$inerte-".ord($a[1]).'-',
1314 1306
 		$squelette,
1315 1307
 		-1,
1316 1308
 		$esc
@@ -1326,7 +1318,7 @@  discard block
 block discarded – undo
1326 1318
 	// Phraser le squelette, selon sa grammaire
1327 1319
 
1328 1320
 	$boucles = [];
1329
-	$f = charger_fonction('phraser_' . $gram, 'public');
1321
+	$f = charger_fonction('phraser_'.$gram, 'public');
1330 1322
 
1331 1323
 	$squelette = $f($squelette, '', $boucles, $descr);
1332 1324
 
@@ -1342,7 +1334,7 @@  discard block
 block discarded – undo
1342 1334
 			);
1343 1335
 			$boucles[$i]->descr['squelette'] = preg_replace_callback(
1344 1336
 				",$inerte-(\d+)-,",
1345
-				fn($a) => '\\\\' . chr($a[1]),
1337
+				fn($a) => '\\\\'.chr($a[1]),
1346 1338
 				$boucle->descr['squelette']
1347 1339
 			);
1348 1340
 		}
@@ -1353,19 +1345,19 @@  discard block
 block discarded – undo
1353 1345
 		include_spip('public/decompiler');
1354 1346
 		foreach ($boucles as $id => $boucle) {
1355 1347
 			if ($id) {
1356
-				$decomp = "\n/* BOUCLE " .
1357
-					$boucle->type_requete .
1358
-					' ' .
1359
-					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1360
-					($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1348
+				$decomp = "\n/* BOUCLE ".
1349
+					$boucle->type_requete.
1350
+					' '.
1351
+					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')).
1352
+					($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : '').
1361 1353
 					" */\n";
1362 1354
 			} else {
1363
-				$decomp = ("\n/*\n" .
1355
+				$decomp = ("\n/*\n".
1364 1356
 					str_replace('*/', '* /', public_decompiler($squelette, $gram))
1365 1357
 					. "\n*/");
1366 1358
 			}
1367
-			$boucles[$id]->return = $decomp . $boucle->return;
1368
-			$GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1359
+			$boucles[$id]->return = $decomp.$boucle->return;
1360
+			$GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return;
1369 1361
 		}
1370 1362
 	}
1371 1363
 
@@ -1388,7 +1380,7 @@  discard block
 block discarded – undo
1388 1380
 		}
1389 1381
 	}
1390 1382
 	foreach ($boucles as $id => $boucle) {
1391
-		$GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1383
+		$GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle;
1392 1384
 	}
1393 1385
 	$descr['documents'] = compile_inclure_doublons($squelette);
1394 1386
 
@@ -1479,8 +1471,7 @@  discard block
 block discarded – undo
1479 1471
 						} else {
1480 1472
 							$boucles[$id]->type_requete = false;
1481 1473
 							$boucle = $boucles[$id];
1482
-							$x = (!$boucle->sql_serveur ? '' :
1483
-									($boucle->sql_serveur . ':')) .
1474
+							$x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')).
1484 1475
 								$type;
1485 1476
 							$msg = [
1486 1477
 								'zbug_table_inconnue',
@@ -1570,13 +1561,13 @@  discard block
 block discarded – undo
1570 1561
 			if (
1571 1562
 				// fonction de boucle avec serveur & table
1572 1563
 				(!$serveur or
1573
-					((!function_exists($f = 'boucle_' . $serveur . '_' . $table))
1574
-						and (!function_exists($f = $f . '_dist'))
1564
+					((!function_exists($f = 'boucle_'.$serveur.'_'.$table))
1565
+						and (!function_exists($f = $f.'_dist'))
1575 1566
 					)
1576 1567
 				)
1577 1568
 				// fonction de boucle avec table
1578
-				and (!function_exists($f = 'boucle_' . $table))
1579
-				and (!function_exists($f = $f . '_dist'))
1569
+				and (!function_exists($f = 'boucle_'.$table))
1570
+				and (!function_exists($f = $f.'_dist'))
1580 1571
 			) {
1581 1572
 				// fonction de boucle standard
1582 1573
 				if (!function_exists($f = 'boucle_DEFAUT')) {
@@ -1584,20 +1575,20 @@  discard block
 block discarded – undo
1584 1575
 				}
1585 1576
 			}
1586 1577
 
1587
-			$req = "\n\n\tstatic \$command = array();\n\t" .
1588
-				"static \$connect;\n\t" .
1589
-				"\$command['connect'] = \$connect = " .
1590
-				_q($boucle->sql_serveur) .
1591
-				';' .
1578
+			$req = "\n\n\tstatic \$command = array();\n\t".
1579
+				"static \$connect;\n\t".
1580
+				"\$command['connect'] = \$connect = ".
1581
+				_q($boucle->sql_serveur).
1582
+				';'.
1592 1583
 				$f($id, $boucles);
1593 1584
 		} else {
1594 1585
 			$req = ("\n\treturn '';");
1595 1586
 		}
1596 1587
 
1597 1588
 		$boucles[$id]->return =
1598
-			"\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom .
1599
-			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1600
-			$req .
1589
+			"\n\nfunction BOUCLE".strtr($id, '-', '_').$nom.
1590
+			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'.
1591
+			$req.
1601 1592
 			"\n}\n";
1602 1593
 	}
1603 1594
 
@@ -1607,7 +1598,7 @@  discard block
 block discarded – undo
1607 1598
 		return false;
1608 1599
 	}
1609 1600
 
1610
-	$principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1601
+	$principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1611 1602
 '
1612 1603
 		// reporter de maniere securisee les doublons inclus
1613 1604
 		. '
@@ -1615,15 +1606,15 @@  discard block
 block discarded – undo
1615 1606
 		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
1616 1607
 
1617 1608
 	$connect = ' .
1618
-		_q($connect) . ';
1609
+		_q($connect).';
1619 1610
 	$page = ' .
1620 1611
 		// ATTENTION, le calcul de l'expression $corps affectera $Cache
1621 1612
 		// c'est pourquoi on l'affecte a la variable auxiliaire $page.
1622 1613
 		// avant de referencer $Cache
1623
-		$corps . ';
1614
+		$corps.';
1624 1615
 
1625 1616
 	return analyse_resultat_skel(' . var_export($nom, true)
1626
-		. ', $Cache, $page, ' . var_export($sourcefile, true) . ');
1617
+		. ', $Cache, $page, '.var_export($sourcefile, true).');
1627 1618
 }';
1628 1619
 
1629 1620
 	$secondes = spip_timer('calcul_skel');
@@ -1637,10 +1628,10 @@  discard block
 block discarded – undo
1637 1628
 	$code->return = '
1638 1629
 //
1639 1630
 // Fonction principale du squelette ' .
1640
-		$sourcefile .
1641
-		($connect ? " pour $connect" : '') .
1642
-		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1643
-		"\n//\n" .
1631
+		$sourcefile.
1632
+		($connect ? " pour $connect" : '').
1633
+		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes").
1634
+		"\n//\n".
1644 1635
 		$principal;
1645 1636
 
1646 1637
 	$boucles[''] = $code;
@@ -1692,7 +1683,7 @@  discard block
 block discarded – undo
1692 1683
  **/
1693 1684
 function requeteur_data_dist(&$boucles, &$boucle, &$id) {
1694 1685
 	include_spip('iterateur/data');
1695
-	if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1686
+	if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) {
1696 1687
 		$g = charger_fonction('data', 'iterateur');
1697 1688
 		$boucles[$id] = $g($boucle);
1698 1689
 		// from[0] stocke le type de data (rss, yql, ...)
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
24 24
 if (!defined('_DIR_PLUGINS_AUTO')) {
25
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
25
+	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/');
26 26
 }
27 27
 
28 28
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 				if ($dir) {
382 382
 					$dir .= '/';
383 383
 				}
384
-				$dir .= 'procure:' . $procure['nom'];
384
+				$dir .= 'procure:'.$procure['nom'];
385 385
 
386 386
 				$procure['etat'] = '?';
387 387
 				$procure['dir_type'] = $resume['dir_type'];
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		$plug = $resume['dir'];
566 566
 		$k = $infos[$dir_type][$plug];
567 567
 
568
-		$plug = constant($dir_type) . $plug;
568
+		$plug = constant($dir_type).$plug;
569 569
 		if (!isset($msg[$p])) {
570 570
 			if (isset($resume['erreur']) and $resume['erreur']) {
571 571
 				$msg[$p] = [$resume['erreur']];
@@ -608,10 +608,10 @@  discard block
 block discarded – undo
608 608
 		$list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation'];
609 609
 	} elseif (!$raw) {
610 610
 		foreach ($list as $plug => $msg) {
611
-			$list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug])
612
-				. '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>';
611
+			$list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug])
612
+				. '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>';
613 613
 		}
614
-		$list = '<ul>' . join("\n", $list) . '</ul>';
614
+		$list = '<ul>'.join("\n", $list).'</ul>';
615 615
 	}
616 616
 	if ($raz) {
617 617
 		effacer_meta('plugin_erreur_activation');
@@ -725,13 +725,13 @@  discard block
 block discarded – undo
725 725
 			if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) {
726 726
 				return _T("plugin_{$balise}_{$type}", [
727 727
 					'plugin' => $nom,
728
-					'version' => ' &ge; ' . $minimum
728
+					'version' => ' &ge; '.$minimum
729 729
 				]);
730 730
 			}
731 731
 			if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) {
732 732
 				return _T("plugin_{$balise}_{$type}", [
733 733
 					'plugin' => $nom,
734
-					'version' => ' &gt; ' . $minimum
734
+					'version' => ' &gt; '.$minimum
735 735
 				]);
736 736
 			}
737 737
 		}
@@ -740,13 +740,13 @@  discard block
 block discarded – undo
740 740
 			if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) {
741 741
 				return _T("plugin_{$balise}_{$type}", [
742 742
 					'plugin' => $nom,
743
-					'version' => ' &le; ' . $maximum
743
+					'version' => ' &le; '.$maximum
744 744
 				]);
745 745
 			}
746 746
 			if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) {
747 747
 				return _T("plugin_{$balise}_plugin", [
748 748
 					'plugin' => $nom,
749
-					'version' => ' &lt; ' . $maximum
749
+					'version' => ' &lt; '.$maximum
750 750
 				]);
751 751
 			}
752 752
 		}
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		include_spip('inc/charger_plugin');
766 766
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
767 767
 	}*/
768
-	return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>";
768
+	return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>";
769 769
 }
770 770
 
771 771
 
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 	foreach ($plugin_valides as $p => $resume) {
866 866
 		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
867 867
 		if (!str_starts_with($p, 'PHP:') and $p !== 'PHP') {
868
-			$header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : '');
868
+			$header[] = $p.($resume['version'] ? '('.$resume['version'].')' : '');
869 869
 		}
870 870
 		if ($resume['dir']) {
871 871
 			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
@@ -890,11 +890,11 @@  discard block
 block discarded – undo
890 890
 	$header = strtolower(implode(',', $header));
891 891
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
892 892
 		ecrire_fichier(
893
-			_DIR_VAR . 'config.txt',
894
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header
893
+			_DIR_VAR.'config.txt',
894
+			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header
895 895
 		);
896 896
 	} else {
897
-		@unlink(_DIR_VAR . 'config.txt');
897
+		@unlink(_DIR_VAR.'config.txt');
898 898
 	}
899 899
 	// generer charger_plugins_chemin.php
900 900
 	plugins_precompile_chemin($plugin_valides, $ordre);
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
 			// definir le plugin, donc le path avant l'include du fichier options
949 949
 			// permet de faire des include_spip pour attraper un inc_ du plugin
950 950
 
951
-			$dir = $dir_type . ".'" . $plug . "/'";
951
+			$dir = $dir_type.".'".$plug."/'";
952 952
 
953 953
 			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
954 954
 			if (
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 				if (!$info['chemin']) {
960 960
 					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
961 961
 					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
962
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
962
+					if (is_dir(constant($dir_type).$plug.'/squelettes/')) {
963 963
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
964 964
 					}
965 965
 				}
@@ -980,13 +980,13 @@  discard block
 block discarded – undo
980 980
 								$dir = '';
981 981
 							}
982 982
 							if (strlen($dir)) {
983
-								$dir = rtrim($dir, '/') . '/';
983
+								$dir = rtrim($dir, '/').'/';
984 984
 							}
985 985
 							if (!isset($chemin['type']) or $chemin['type'] == 'public') {
986
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
986
+								$chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
987 987
 							}
988 988
 							if (!isset($chemin['type']) or $chemin['type'] == 'prive') {
989
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
989
+								$chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
990 990
 							}
991 991
 						}
992 992
 					}
@@ -995,11 +995,11 @@  discard block
 block discarded – undo
995 995
 		}
996 996
 	}
997 997
 	if (count($chemins['public']) or count($chemins['prive'])) {
998
-		$contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode(
998
+		$contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode(
999 999
 			',',
1000 1000
 			array_reverse($chemins['public'])
1001
-		) . "]);\n"
1002
-			. 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n";
1001
+		)."]);\n"
1002
+			. 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n";
1003 1003
 	}
1004 1004
 
1005 1005
 	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 					and !str_contains($dir, ':') // exclure le cas des procure:
1049 1049
 					and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1050 1050
 				) {
1051
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) {
1051
+					if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) {
1052 1052
 						$info[$charge] = [$file];
1053 1053
 					}
1054 1054
 				}
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 						) {
1066 1066
 							unset($info[$charge][$k]);
1067 1067
 						} else {
1068
-							$_file = $root_dir_type . ".'$plug/$file'";
1068
+							$_file = $root_dir_type.".'$plug/$file'";
1069 1069
 							$contenu[$charge] .= "include_once_check($_file);\n";
1070 1070
 						}
1071 1071
 					}
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 		}
1076 1076
 	}
1077 1077
 
1078
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1078
+	$contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options'];
1079 1079
 	$contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons)
1080 1080
 		. plugin_ongletbouton('onglets_plugins', $onglets);
1081 1081
 
@@ -1110,12 +1110,12 @@  discard block
 block discarded – undo
1110 1110
 		define("_UPDATED_$nom", $val);
1111 1111
 		define("_UPDATED_md5_$nom", $md5);
1112 1112
 	}
1113
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1113
+	$val = "unserialize('".str_replace("'", "\'", $val)."')";
1114 1114
 
1115 1115
 	return
1116 1116
 		"if (!function_exists('$nom')) {\n"
1117 1117
 		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1118
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1118
+		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n"
1119 1119
 		. "}\n";
1120 1120
 }
1121 1121
 
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1139 1139
 		include_once(_CACHE_PLUGINS_OPT);
1140 1140
 	} else {
1141
-		spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT);
1141
+		spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT);
1142 1142
 	}
1143 1143
 }
1144 1144
 
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 			$dir_type = $plugin_valides[$p]['dir_type'];
1176 1176
 			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1177 1177
 			$plug = $plugin_valides[$p]['dir'];
1178
-			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_');
1178
+			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_');
1179 1179
 			if (isset($info['pipeline']) and is_array($info['pipeline'])) {
1180 1180
 				foreach ($info['pipeline'] as $pipe) {
1181 1181
 					$nom = $pipe['nom'];
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
 						}
1210 1210
 						if (isset($pipe['inclure'])) {
1211 1211
 							$GLOBALS['spip_matrice']["$prefix$action"] =
1212
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1212
+								"$root_dir_type:$plug/".$pipe['inclure'];
1213 1213
 						}
1214 1214
 					}
1215 1215
 				}
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 					$prepend_code['taches_generales_cron'] = '';
1220 1220
 				}
1221 1221
 				foreach ($info['genie'] as $genie) {
1222
-					$nom = $prefix . $genie['nom'];
1222
+					$nom = $prefix.$genie['nom'];
1223 1223
 					$periode = max(60, intval($genie['periode']));
1224 1224
 					if (charger_fonction($nom, 'genie', true)) {
1225 1225
 						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
@@ -1237,13 +1237,13 @@  discard block
 block discarded – undo
1237 1237
 				}
1238 1238
 				foreach ($info['style'] as $style) {
1239 1239
 					if (isset($style['path']) and $style['path']) {
1240
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1240
+						$code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) ";
1241 1241
 					} else {
1242
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1242
+						$code = "if (\$f='".addslashes($style['url'])."') ";
1243 1243
 					}
1244 1244
 					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1245 1245
 					if (isset($style['media']) and strlen($style['media'])) {
1246
-						$code .= ' media="' . addslashes($style['media']) . '"';
1246
+						$code .= ' media="'.addslashes($style['media']).'"';
1247 1247
 					}
1248 1248
 					$code .= "/>';\n";
1249 1249
 					if ($style['type'] != 'prive') {
@@ -1263,9 +1263,9 @@  discard block
 block discarded – undo
1263 1263
 			if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) {
1264 1264
 				foreach ($info['script'] as $script) {
1265 1265
 					if (isset($script['path']) and $script['path']) {
1266
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1266
+						$code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) ";
1267 1267
 					} else {
1268
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1268
+						$code = "if (\$f='".addslashes($script['url'])."') ";
1269 1269
 					}
1270 1270
 					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1271 1271
 					if ($script['type'] != 'prive') {
@@ -1328,10 +1328,10 @@  discard block
 block discarded – undo
1328 1328
 		unset($GLOBALS['spip_pipeline']['all']);
1329 1329
 		$all_pipes = trim(array_shift($a));
1330 1330
 		if ($all_pipes) {
1331
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1331
+			$all_pipes = '|'.ltrim($all_pipes, '|');
1332 1332
 		}
1333 1333
 		if (count($a)) {
1334
-			$all_pipes_end = '||' . array_shift($a);
1334
+			$all_pipes_end = '||'.array_shift($a);
1335 1335
 		}
1336 1336
 	}
1337 1337
 	$content = '';
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 		// Eclater le pipeline en filtres et appliquer chaque filtre
1349 1349
 		foreach ($pipe as $fonc) {
1350 1350
 			$fonc = trim($fonc);
1351
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1351
+			$s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n";
1352 1352
 			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1353 1353
 				$file = $GLOBALS['spip_matrice'][$fonc];
1354 1354
 				$file = "'$file'";
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
 					if (defined($root_dir)) {
1360 1360
 						$dir = $root_dir;
1361 1361
 					}
1362
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1362
+					$file = str_replace($regs[0], "'.".$dir.".'", $file);
1363 1363
 					$file = str_replace("''.", '', $file);
1364 1364
 					$file = str_replace(constant($dir), '', $file);
1365 1365
 				}
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 		$content .= "// Pipeline $action \n"
1373 1373
 			. "function execute_pipeline_$action(&\$val){\n"
1374 1374
 			. $s_inc
1375
-			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1375
+			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '')
1376 1376
 			. $s_call
1377 1377
 			. "return \$val;\n}\n";
1378 1378
 	}
@@ -1428,9 +1428,9 @@  discard block
 block discarded – undo
1428 1428
 					$result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec'));
1429 1429
 					if (_IS_CLI) {
1430 1430
 						include_spip('inc/filtres');
1431
-						$trace = ltrim(textebrut($trace) . "\n" . $result);
1432
-						$trace = '    ' . str_replace("\n", "\n    ", $trace);
1433
-						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1431
+						$trace = ltrim(textebrut($trace)."\n".$result);
1432
+						$trace = '    '.str_replace("\n", "\n    ", $trace);
1433
+						echo "\n".($ok ? 'OK  ' : '/!\ ').textebrut($titre)."\n",
1434 1434
 						  $trace,
1435 1435
 						  "\n";
1436 1436
 					}
@@ -1465,15 +1465,15 @@  discard block
 block discarded – undo
1465 1465
 		$GLOBALS['fichier_php_compile_recent'] = 0;
1466 1466
 	}
1467 1467
 
1468
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1468
+	$contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>';
1469 1469
 	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1470 1470
 	// si pas de modif on ne touche pas au fichier initial
1471 1471
 	if (file_exists($nom)) {
1472 1472
 		if (substr($nom, -4) == '.php') {
1473
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1473
+			$fichier_tmp = substr($nom, 0, -4).'.tmp.php';
1474 1474
 		}
1475 1475
 		else {
1476
-			$fichier_tmp = $nom . '.tmp';
1476
+			$fichier_tmp = $nom.'.tmp';
1477 1477
 		}
1478 1478
 		file_put_contents($fichier_tmp, $contenu);
1479 1479
 		if (md5_file($nom) == md5_file($fichier_tmp)) {
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +125 added lines, -126 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,19 +98,19 @@  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 107
 		$inc ?
108
-			_T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>'])
108
+			_T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>'])
109 109
 			. '<br />'
110
-			. _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>'])
110
+			. _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
111 111
 			:
112
-			_T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']),
113
-		['all_inline' => true,'status' => 404]
112
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
113
+		['all_inline' => true, 'status' => 404]
114 114
 	);
115 115
 	exit;
116 116
 }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  *     - string : chemin du fichier trouvé
157 157
  **/
158 158
 function include_spip($f, $include = true) {
159
-	return find_in_path($f . '.php', '', $include);
159
+	return find_in_path($f.'.php', '', $include);
160 160
 }
161 161
 
162 162
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  *     - string : chemin du fichier trouvé
177 177
  **/
178 178
 function require_spip($f) {
179
-	return find_in_path($f . '.php', '', 'required');
179
+	return find_in_path($f.'.php', '', 'required');
180 180
 }
181 181
 
182 182
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		// donc il faut l'inclure "en globals"
194 194
 		if ($f = find_in_path('mes_fonctions.php')) {
195 195
 			global $dossier_squelettes;
196
-			include_once(_ROOT_CWD . $f);
196
+			include_once(_ROOT_CWD.$f);
197 197
 		}
198 198
 
199 199
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	}
299 299
 
300 300
 	// appliquer notre fonction si elle existe
301
-	$fonc = 'execute_pipeline_' . strtolower($action);
301
+	$fonc = 'execute_pipeline_'.strtolower($action);
302 302
 	if (function_exists($fonc)) {
303 303
 		$val = $fonc($val);
304 304
 	} // plantage ?
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 function spip_log($message = null, $name = null) {
364 364
 	static $pre = [];
365 365
 	static $log;
366
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
366
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
367 367
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
368 368
 		$logname = null;
369 369
 	}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 		if (!is_string($message)) {
392 392
 			$message = print_r($message, true);
393 393
 		}
394
-		$log($pre[$niveau] . ' ' . $message, $logname);
394
+		$log($pre[$niveau].' '.$message, $logname);
395 395
 	}
396 396
 }
397 397
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	foreach ($regexp as $r => $e) {
598 598
 		$regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e));
599 599
 	}
600
-	$regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,';
600
+	$regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,';
601 601
 	$ajouts = array_flip(explode('|', $c));
602 602
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
603 603
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 			// Ajout. Pour une variable, remplacer au meme endroit,
625 625
 			// pour un tableau ce sera fait dans la prochaine boucle
626 626
 			elseif (substr($r[1], -2) != '[]') {
627
-				$url[$n] = $r[1] . '=' . $u;
627
+				$url[$n] = $r[1].'='.$u;
628 628
 				unset($ajouts[$r[1]]);
629 629
 			}
630 630
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -645,11 +645,11 @@  discard block
 block discarded – undo
645 645
 	} elseif ($testv) {
646 646
 		foreach ($ajouts as $k => $n) {
647 647
 			if (!is_array($v)) {
648
-				$url[] = $k . '=' . $u;
648
+				$url[] = $k.'='.$u;
649 649
 			} else {
650
-				$id = (substr($k, -2) == '[]') ? $k : ($k . '[]');
650
+				$id = (substr($k, -2) == '[]') ? $k : ($k.'[]');
651 651
 				foreach ($v as $w) {
652
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
652
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
653 653
 				}
654 654
 			}
655 655
 		}
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 
661 661
 	// recomposer l'adresse
662 662
 	if ($url) {
663
-		$a .= '?' . join($sep, $url);
663
+		$a .= '?'.join($sep, $url);
664 664
 	}
665 665
 
666
-	return $a . $ancre;
666
+	return $a.$ancre;
667 667
 }
668 668
 
669 669
 /**
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			translitteration($ancre)
694 694
 		);
695 695
 	}
696
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
696
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
697 697
 }
698 698
 
699 699
 /**
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
  * @return bool
810 810
  */
811 811
 function test_plugin_actif($plugin) {
812
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
812
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
813 813
 }
814 814
 
815 815
 /**
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 					$value = interdire_scripts($value, -1);
942 942
 				}
943 943
 				if (!empty($options['class'])) {
944
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
944
+					$value = "<span class='".$options['class']."'>$value</span>";
945 945
 				}
946 946
 				$text = str_replace("@$name@", $value, $text);
947 947
 				unset($args[$name]);
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 		// Si des variables n'ont pas ete inserees, le signaler
951 951
 		// (chaines de langues pas a jour)
952 952
 		if ($args) {
953
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
953
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
954 954
 		}
955 955
 	}
956 956
 
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 function joli_repertoire($rep) {
975 975
 	$a = substr($rep, 0, 1);
976 976
 	if ($a <> '.' and $a <> '/') {
977
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
977
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
978 978
 	}
979 979
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
980 980
 
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 			$p -= ($x * 1000);
1029 1029
 		}
1030 1030
 
1031
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1031
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1032 1032
 	}
1033 1033
 }
1034 1034
 
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 	if ($taches and count($taches) and !spip_connect()) {
1096 1096
 		return false;
1097 1097
 	}
1098
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1098
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1099 1099
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1100 1100
 		return $genie($taches);
1101 1101
 	}
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
 	if ($queue_next_job_time == -1) {
1201 1201
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1202
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1202
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1203 1203
 		}
1204 1204
 		// utiliser un cache memoire si dispo
1205 1205
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1268,8 +1268,8 @@  discard block
 block discarded – undo
1268 1268
 		$src = '';
1269 1269
 	}
1270 1270
 	if ($script) {
1271
-		$script = ("/*<![CDATA[*/\n" .
1272
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1271
+		$script = ("/*<![CDATA[*/\n".
1272
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1273 1273
 			'/*]]>*/');
1274 1274
 	}
1275 1275
 	if ($noscript) {
@@ -1355,13 +1355,13 @@  discard block
 block discarded – undo
1355 1355
 	if ($path_base == null) {
1356 1356
 		// Chemin standard depuis l'espace public
1357 1357
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1358
-			_DIR_RACINE . ':' .
1359
-			_DIR_RACINE . 'squelettes-dist/:' .
1360
-			_DIR_RACINE . 'prive/:' .
1358
+			_DIR_RACINE.':'.
1359
+			_DIR_RACINE.'squelettes-dist/:'.
1360
+			_DIR_RACINE.'prive/:'.
1361 1361
 			_DIR_RESTREINT;
1362 1362
 		// Ajouter squelettes/
1363
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1364
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1363
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1364
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1365 1365
 		}
1366 1366
 		foreach (explode(':', $path) as $dir) {
1367 1367
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 		// Et le(s) dossier(s) des squelettes nommes
1374 1374
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1375 1375
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1376
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1376
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1377 1377
 			}
1378 1378
 		}
1379 1379
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 
1385 1385
 	if (is_array($dir_path) or strlen($dir_path)) {
1386 1386
 		$tete = '';
1387
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1387
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1388 1388
 			$tete = array_shift($path_base);
1389 1389
 		}
1390 1390
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 	// Et le(s) dossier(s) des squelettes nommes
1406 1406
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1407 1407
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1408
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1408
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1409 1409
 		}
1410 1410
 	}
1411 1411
 
@@ -1476,14 +1476,14 @@  discard block
 block discarded – undo
1476 1476
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1477 1477
 	if (
1478 1478
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1479
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1479
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1480 1480
 		and $f = find_in_theme("$file_svg_generique")
1481 1481
 	) {
1482
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1482
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1483 1483
 			return $themefiles["$subdir$file"] = $fsize;
1484 1484
 		}
1485 1485
 		else {
1486
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1486
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1487 1487
 		}
1488 1488
 	}
1489 1489
 
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 			return $themefiles["$subdir$file"] = $f;
1494 1494
 		}
1495 1495
 	}
1496
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1496
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1497 1497
 
1498 1498
 	return $themefiles["$subdir$file"] = '';
1499 1499
 }
@@ -1601,8 +1601,8 @@  discard block
 block discarded – undo
1601 1601
 			return false;
1602 1602
 		}
1603 1603
 		if ($include and !isset($inc[$dirname][$file])) {
1604
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1605
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1604
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1605
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1606 1606
 		}
1607 1607
 
1608 1608
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1615,14 +1615,14 @@  discard block
 block discarded – undo
1615 1615
 	}
1616 1616
 
1617 1617
 	foreach (creer_chemin() as $dir) {
1618
-		if (!isset($dirs[$a = $dir . $dirname])) {
1619
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1618
+		if (!isset($dirs[$a = $dir.$dirname])) {
1619
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1620 1620
 		}
1621 1621
 		if ($dirs[$a]) {
1622
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1622
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1623 1623
 				if ($include and !isset($inc[$dirname][$file])) {
1624
-					include_once _ROOT_CWD . $a;
1625
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1624
+					include_once _ROOT_CWD.$a;
1625
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1626 1626
 				}
1627 1627
 				if (!defined('_SAUVER_CHEMIN')) {
1628 1628
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
 					define('_SAUVER_CHEMIN', true);
1633 1633
 				}
1634 1634
 
1635
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1635
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1636 1636
 			}
1637 1637
 		}
1638 1638
 	}
@@ -1658,7 +1658,7 @@  discard block
 block discarded – undo
1658 1658
 		define('_SAUVER_CHEMIN', true);
1659 1659
 	}
1660 1660
 
1661
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1661
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1662 1662
 }
1663 1663
 
1664 1664
 function clear_path_cache() {
@@ -1728,12 +1728,12 @@  discard block
 block discarded – undo
1728 1728
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1729 1729
 	// on a pas encore inclus flock.php
1730 1730
 	if (!function_exists('preg_files')) {
1731
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1731
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1732 1732
 	}
1733 1733
 
1734 1734
 	// Parcourir le chemin
1735 1735
 	foreach (creer_chemin() as $d) {
1736
-		$f = $d . $dir;
1736
+		$f = $d.$dir;
1737 1737
 		if (@is_dir($f)) {
1738 1738
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1739 1739
 			foreach ($liste as $chemin) {
@@ -1783,9 +1783,9 @@  discard block
 block discarded – undo
1783 1783
 	if ($type === 'defaut') {
1784 1784
 		$objet = objet_type($quoi);
1785 1785
 		if (
1786
-			$f = charger_fonction('generer_' . $objet . '_url', 'urls', true)
1786
+			$f = charger_fonction('generer_'.$objet.'_url', 'urls', true)
1787 1787
 			// deprecated
1788
-			or $f = charger_fonction('generer_url_' . $objet, 'urls', true)
1788
+			or $f = charger_fonction('generer_url_'.$objet, 'urls', true)
1789 1789
 		) {
1790 1790
 			return $f;
1791 1791
 		}
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
 	}
1799 1799
 
1800 1800
 	// inclure le module d'url
1801
-	include_spip('urls/' . $url_type);
1801
+	include_spip('urls/'.$url_type);
1802 1802
 
1803 1803
 	switch ($quoi) {
1804 1804
 		case 'page':
@@ -1951,8 +1951,8 @@  discard block
 block discarded – undo
1951 1951
 	include_spip('base/connect_sql');
1952 1952
 	$id_type = id_table_objet($entite, $public);
1953 1953
 
1954
-	return _DIR_RACINE . get_spip_script('./')
1955
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1954
+	return _DIR_RACINE.get_spip_script('./')
1955
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1956 1956
 	. (!$args ? '' : "&$args")
1957 1957
 	. (!$ancre ? '' : "#$ancre");
1958 1958
 }
@@ -2127,7 +2127,7 @@  discard block
 block discarded – undo
2127 2127
 				!empty($_SERVER['QUERY_STRING'])
2128 2128
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2129 2129
 			) {
2130
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2130
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2131 2131
 			}
2132 2132
 		}
2133 2133
 	}
@@ -2165,9 +2165,9 @@  discard block
 block discarded – undo
2165 2165
 		array_shift($myself);
2166 2166
 		$myself = implode('/', $myself);
2167 2167
 	}
2168
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2168
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2169 2169
 
2170
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2170
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2171 2171
 
2172 2172
 	return $url;
2173 2173
 }
@@ -2206,16 +2206,16 @@  discard block
 block discarded – undo
2206 2206
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
2207 2207
 	$script ??= '';
2208 2208
 	if (!$rel) {
2209
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2209
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2210 2210
 	} else {
2211 2211
 		if (!is_string($rel)) {
2212
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2212
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2213 2213
 		}
2214 2214
 	}
2215 2215
 
2216 2216
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2217 2217
 	if ($script and ($script <> 'accueil' or $rel)) {
2218
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2218
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2219 2219
 	} elseif ($args) {
2220 2220
 		$args = "?$args";
2221 2221
 	}
@@ -2223,7 +2223,7 @@  discard block
 block discarded – undo
2223 2223
 		$args .= "#$ancre";
2224 2224
 	}
2225 2225
 
2226
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2226
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2227 2227
 }
2228 2228
 
2229 2229
 //
@@ -2305,10 +2305,10 @@  discard block
 block discarded – undo
2305 2305
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2306 2306
 		}
2307 2307
 		if ($args) {
2308
-			$action .= (strpos($action, '?') !== false ? '&' : '?') . $args;
2308
+			$action .= (strpos($action, '?') !== false ? '&' : '?').$args;
2309 2309
 		}
2310 2310
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2311
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2311
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2312 2312
 	}
2313 2313
 
2314 2314
 	if (!$no_entities) {
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
 
2321 2321
 function generer_url_prive($script, $args = '', $no_entities = false) {
2322 2322
 
2323
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2323
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2324 2324
 }
2325 2325
 
2326 2326
 // Pour les formulaires en methode POST,
@@ -2355,8 +2355,7 @@  discard block
 block discarded – undo
2355 2355
 	. "><div>\n"
2356 2356
 	. "<input type='hidden' name='exec' value='$script1' />"
2357 2357
 	. $corps
2358
-	. (!$submit ? '' :
2359
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2358
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2360 2359
 	. "</div></form>\n";
2361 2360
 }
2362 2361
 
@@ -2381,14 +2380,14 @@  discard block
 block discarded – undo
2381 2380
 		? generer_url_ecrire(_request('exec'))
2382 2381
 		: generer_url_public();
2383 2382
 
2384
-	return "\n<form action='" .
2385
-	$h .
2386
-	"'" .
2387
-	$atts .
2388
-	">\n" .
2389
-	'<div>' .
2390
-	"\n<input type='hidden' name='action' value='$script' />" .
2391
-	$corps .
2383
+	return "\n<form action='".
2384
+	$h.
2385
+	"'".
2386
+	$atts.
2387
+	">\n".
2388
+	'<div>'.
2389
+	"\n<input type='hidden' name='action' value='$script' />".
2390
+	$corps.
2392 2391
 	'</div></form>';
2393 2392
 }
2394 2393
 
@@ -2416,7 +2415,7 @@  discard block
 block discarded – undo
2416 2415
 		: generer_url_public('', '', false, false);
2417 2416
 	$url = parametre_url($url, 'action', $script);
2418 2417
 	if ($args) {
2419
-		$url .= quote_amp('&' . $args);
2418
+		$url .= quote_amp('&'.$args);
2420 2419
 	}
2421 2420
 
2422 2421
 	if ($no_entities) {
@@ -2450,9 +2449,9 @@  discard block
 block discarded – undo
2450 2449
 	}
2451 2450
 	$url =
2452 2451
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2453
-	. $script . '/'
2452
+	. $script.'/'
2454 2453
 	. ($path ? trim($path, '/') : '')
2455
-	. ($args ? '?' . quote_amp($args) : '');
2454
+	. ($args ? '?'.quote_amp($args) : '');
2456 2455
 
2457 2456
 	if ($no_entities) {
2458 2457
 		$url = str_replace('&amp;', '&', $url);
@@ -2501,22 +2500,22 @@  discard block
 block discarded – undo
2501 2500
 
2502 2501
 	// le nom du repertoire plugins/ activables/desactivables
2503 2502
 	if (!defined('_DIR_PLUGINS')) {
2504
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2503
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2505 2504
 	}
2506 2505
 
2507 2506
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2508 2507
 	if (!defined('_DIR_PLUGINS_DIST')) {
2509
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2508
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2510 2509
 	}
2511 2510
 
2512 2511
 	// le nom du repertoire des librairies
2513 2512
 	if (!defined('_DIR_LIB')) {
2514
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2513
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2515 2514
 	}
2516 2515
 
2517 2516
 	// répertoire des libs via Composer
2518 2517
 	if (!defined('_DIR_VENDOR')) {
2519
-		define('_DIR_VENDOR', _DIR_RACINE . 'vendor/');
2518
+		define('_DIR_VENDOR', _DIR_RACINE.'vendor/');
2520 2519
 	}
2521 2520
 
2522 2521
 	if (!defined('_DIR_IMG')) {
@@ -2526,29 +2525,29 @@  discard block
 block discarded – undo
2526 2525
 		define('_DIR_LOGOS', $pa);
2527 2526
 	}
2528 2527
 	if (!defined('_DIR_IMG_ICONES')) {
2529
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2528
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2530 2529
 	}
2531 2530
 
2532 2531
 	if (!defined('_DIR_DUMP')) {
2533
-		define('_DIR_DUMP', $ti . 'dump/');
2532
+		define('_DIR_DUMP', $ti.'dump/');
2534 2533
 	}
2535 2534
 	if (!defined('_DIR_SESSIONS')) {
2536
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2535
+		define('_DIR_SESSIONS', $ti.'sessions/');
2537 2536
 	}
2538 2537
 	if (!defined('_DIR_TRANSFERT')) {
2539
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2538
+		define('_DIR_TRANSFERT', $ti.'upload/');
2540 2539
 	}
2541 2540
 	if (!defined('_DIR_CACHE')) {
2542
-		define('_DIR_CACHE', $ti . 'cache/');
2541
+		define('_DIR_CACHE', $ti.'cache/');
2543 2542
 	}
2544 2543
 	if (!defined('_DIR_CACHE_XML')) {
2545
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2544
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2546 2545
 	}
2547 2546
 	if (!defined('_DIR_SKELS')) {
2548
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2547
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2549 2548
 	}
2550 2549
 	if (!defined('_DIR_AIDE')) {
2551
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2550
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2552 2551
 	}
2553 2552
 	if (!defined('_DIR_TMP')) {
2554 2553
 		define('_DIR_TMP', $ti);
@@ -2577,27 +2576,27 @@  discard block
 block discarded – undo
2577 2576
 	// Declaration des fichiers
2578 2577
 
2579 2578
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2580
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2579
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2581 2580
 	}
2582 2581
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2583
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2582
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2584 2583
 	}
2585 2584
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2586
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2585
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2587 2586
 	}
2588 2587
 	if (!defined('_CACHE_PIPELINES')) {
2589
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2588
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2590 2589
 	}
2591 2590
 	if (!defined('_CACHE_CHEMIN')) {
2592
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2591
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2593 2592
 	}
2594 2593
 
2595 2594
 	# attention .php obligatoire pour ecrire_fichier_securise
2596 2595
 	if (!defined('_FILE_META')) {
2597
-		define('_FILE_META', $ti . 'meta_cache.php');
2596
+		define('_FILE_META', $ti.'meta_cache.php');
2598 2597
 	}
2599 2598
 	if (!defined('_DIR_LOG')) {
2600
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2599
+		define('_DIR_LOG', _DIR_TMP.'log/');
2601 2600
 	}
2602 2601
 	if (!defined('_FILE_LOG')) {
2603 2602
 		define('_FILE_LOG', 'spip');
@@ -2614,8 +2613,8 @@  discard block
 block discarded – undo
2614 2613
 	if (!defined('_FILE_CONNECT')) {
2615 2614
 		define(
2616 2615
 			'_FILE_CONNECT',
2617
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2618
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2616
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2617
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2619 2618
 			: false))
2620 2619
 		);
2621 2620
 	}
@@ -2627,7 +2626,7 @@  discard block
 block discarded – undo
2627 2626
 	if (!defined('_FILE_CHMOD')) {
2628 2627
 		define(
2629 2628
 			'_FILE_CHMOD',
2630
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2629
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2631 2630
 			: false)
2632 2631
 		);
2633 2632
 	}
@@ -2640,10 +2639,10 @@  discard block
 block discarded – undo
2640 2639
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2641 2640
 	}
2642 2641
 	if (!defined('_FILE_CONNECT_TMP')) {
2643
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2642
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2644 2643
 	}
2645 2644
 	if (!defined('_FILE_CHMOD_TMP')) {
2646
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2645
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2647 2646
 	}
2648 2647
 
2649 2648
 	// Definition des droits d'acces en ecriture
@@ -2661,13 +2660,13 @@  discard block
 block discarded – undo
2661 2660
 		define('_DEFAULT_CHARSET', 'utf-8');
2662 2661
 	}
2663 2662
 	if (!defined('_ROOT_PLUGINS')) {
2664
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2663
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2665 2664
 	}
2666 2665
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2667
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2666
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2668 2667
 	}
2669 2668
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2670
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2669
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2671 2670
 	}
2672 2671
 
2673 2672
 	// La taille des Log
@@ -2704,7 +2703,7 @@  discard block
 block discarded – undo
2704 2703
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2705 2704
 	// pour le rendre surchargeable, on va provoquer un reecriture
2706 2705
 	// systematique du noyau ou une baisse de perfs => a etudier)
2707
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2706
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2708 2707
 
2709 2708
 	// charger tout de suite le path et son cache
2710 2709
 	load_path_cache();
@@ -2740,7 +2739,7 @@  discard block
 block discarded – undo
2740 2739
 			!empty($_SERVER['QUERY_STRING'])
2741 2740
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2742 2741
 		) {
2743
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2742
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2744 2743
 		}
2745 2744
 	}
2746 2745
 
@@ -2776,7 +2775,7 @@  discard block
 block discarded – undo
2776 2775
 		) {
2777 2776
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2778 2777
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2779
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2778
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2780 2779
 			} else {
2781 2780
 				$uri_ref = '';
2782 2781
 			}
@@ -2870,7 +2869,7 @@  discard block
 block discarded – undo
2870 2869
 	}
2871 2870
 	if (!defined('_CACHE_RUBRIQUES')) {
2872 2871
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2873
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2872
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2874 2873
 	}
2875 2874
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2876 2875
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -3092,7 +3091,7 @@  discard block
 block discarded – undo
3092 3091
 					}
3093 3092
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3094 3093
 						spip_log($GLOBALS['visiteur_session']['nom']
3095
-							. ' ' . _VAR_MODE);
3094
+							. ' '._VAR_MODE);
3096 3095
 					}
3097 3096
 				} // pas autorise ?
3098 3097
 				else {
@@ -3107,7 +3106,7 @@  discard block
 block discarded – undo
3107 3106
 						if (strpos($self, 'page=login') === false) {
3108 3107
 							include_spip('inc/headers');
3109 3108
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3110
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3109
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3111 3110
 						}
3112 3111
 					}
3113 3112
 					// sinon tant pis
@@ -3157,10 +3156,10 @@  discard block
 block discarded – undo
3157 3156
 **/
3158 3157
 function verifier_visiteur() {
3159 3158
 	@spip_initialisation_core(
3160
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3161
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3162
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3163
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3159
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3160
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3161
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3162
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3164 3163
 	);
3165 3164
 
3166 3165
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3193,7 +3192,7 @@  discard block
 block discarded – undo
3193 3192
 	}
3194 3193
 
3195 3194
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3196
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3195
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3197 3196
 		$session = charger_fonction('session', 'inc');
3198 3197
 		if ($session()) {
3199 3198
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3273,7 +3272,7 @@  discard block
 block discarded – undo
3273 3272
 			'definir_session',
3274 3273
 			$GLOBALS['visiteur_session']
3275 3274
 				? serialize($GLOBALS['visiteur_session'])
3276
-				. '_' . @$_COOKIE['spip_session']
3275
+				. '_'.@$_COOKIE['spip_session']
3277 3276
 				: ''
3278 3277
 		);
3279 3278
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3321,8 +3320,8 @@  discard block
 block discarded – undo
3321 3320
 		foreach ($cookies_masques as $k) {
3322 3321
 			if (!empty($_COOKIE[$k])) {
3323 3322
 				$cookies_backup[$k] = $_COOKIE[$k];
3324
-				$_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3325
-				$_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3323
+				$_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3324
+				$_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3326 3325
 				$_COOKIE[$k] = $mask;
3327 3326
 			}
3328 3327
 		}
@@ -3440,11 +3439,11 @@  discard block
 block discarded – undo
3440 3439
 	$GLOBALS['_INC_PUBLIC']++;
3441 3440
 
3442 3441
 	// fix #4235
3443
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3442
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3444 3443
 
3445 3444
 
3446 3445
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3447
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3446
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3448 3447
 
3449 3448
 		$page = evaluer_fond($f, $contexte, $connect);
3450 3449
 		if ($page === '') {
@@ -3529,7 +3528,7 @@  discard block
 block discarded – undo
3529 3528
  * @return array|string
3530 3529
  */
3531 3530
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3532
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3531
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3533 3532
 	if (!$pathinfo) {
3534 3533
 		return $f;
3535 3534
 	}
Please login to merge, or discard this patch.
ecrire/inc/presentation_mini.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		$rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER;
190 190
 	}
191 191
 
192
-	return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
192
+	return $rejouer.(defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '');
193 193
 }
194 194
 
195 195
 /**
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
 	//
236 236
 	if ($vcs = version_vcs_courante(_DIR_RACINE, true)) {
237 237
 		if ($vcs['vcs'] === 'GIT') {
238
-			$url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit'];
238
+			$url = 'https://git.spip.net/spip/spip/commit/'.$vcs['commit'];
239 239
 		} elseif ($vcs['vcs'] === 'SVN') {
240
-			$url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit'];
240
+			$url = 'https://core.spip.net/projects/spip/repository/revisions/'.$vcs['commit'];
241 241
 		} else {
242 242
 			$url = '';
243 243
 		}
@@ -247,21 +247,21 @@  discard block
 block discarded – undo
247 247
 			$commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>";
248 248
 		}
249 249
 		if ($vcs['branch']) {
250
-			$commit = $vcs['branch'] . ': ' . $commit;
250
+			$commit = $vcs['branch'].': '.$commit;
251 251
 		}
252 252
 		$version .= " {$vcs['vcs']} [$commit]";
253 253
 	}
254 254
 
255 255
 	// et la version de l'ecran de securite
256 256
 	$secu = defined('_ECRAN_SECURITE')
257
-		? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE])
257
+		? '<br />'._T('ecran_securite', ['version' => _ECRAN_SECURITE])
258 258
 		: '';
259 259
 
260 260
 	return _T(
261 261
 		'info_copyright',
262 262
 		[
263 263
 			'spip' => "<b>SPIP $version</b> ",
264
-			'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html">' . _T('info_copyright_gpl') . '</a>'
264
+			'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html">'._T('info_copyright_gpl').'</a>'
265 265
 		]
266 266
 	)
267 267
 	. $secu;
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
 		$onfocus = '';
289 289
 	}
290 290
 
291
-	$form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />';
292
-	$form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />";
291
+	$form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"'.$onfocus.' />';
292
+	$form .= "<input type='image' src='".chemin_image('rechercher-20.png')."' name='submit' class='submit' alt='"._T('info_rechercher')."' />";
293 293
 
294
-	return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>';
294
+	return "<div class='spip_recherche'>".generer_form_ecrire($page, $form.$complement, " method='get'").'</div>';
295 295
 }
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 			$link = @mysqli_connect($host, $login, $pass);
59 59
 		}
60 60
 	} catch (\mysqli_sql_exception $e) {
61
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
61
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
62 62
 		$link = false;
63 63
 	}
64 64
 
65 65
 	if (!$link) {
66
-		spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS);
66
+		spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS);
67 67
 
68 68
 		return false;
69 69
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 	spip_log(
85
-		"Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'),
85
+		"Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? 'operationnelle' : 'impossible'),
86 86
 		_LOG_DEBUG
87 87
 	);
88 88
 
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) {
175 175
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
176
-	spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG);
176
+	spip_log('changement de charset sql : '.'SET NAMES '._q($charset), _LOG_DEBUG);
177 177
 
178
-	return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset));
178
+	return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES '._q($charset));
179 179
 }
180 180
 
181 181
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) {
191 191
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
192 192
 	$connexion['last'] = $c = 'SHOW CHARACTER SET'
193
-		. (!$charset ? '' : (' LIKE ' . _q($charset['charset'])));
193
+		. (!$charset ? '' : (' LIKE '._q($charset['charset'])));
194 194
 
195 195
 	return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur);
196 196
 }
@@ -234,21 +234,21 @@  discard block
 block discarded – undo
234 234
 	$debug = '';
235 235
 	if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) {
236 236
 		if (isset($GLOBALS['debug']['aucasou'])) {
237
-			[, $id, , $infos] = $GLOBALS['debug']['aucasou'];
238
-			$debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | ';
237
+			[, $id,, $infos] = $GLOBALS['debug']['aucasou'];
238
+			$debug .= "BOUCLE$id @ ".($infos[0] ?? '').' | ';
239 239
 		}
240 240
 		if (isset($_SERVER['REQUEST_URI'])) {
241 241
 			$debug .= $_SERVER['REQUEST_URI'];
242 242
 		}
243 243
 		if (!empty($GLOBALS['ip'])) {
244
-			$debug .= ' + ' . $GLOBALS['ip'];
244
+			$debug .= ' + '.$GLOBALS['ip'];
245 245
 		}
246
-		$debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */';
246
+		$debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */';
247 247
 	}
248 248
 	try {
249
-		$r = mysqli_query($link, $query . $debug);
249
+		$r = mysqli_query($link, $query.$debug);
250 250
 	} catch (\mysqli_sql_exception $e) {
251
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
251
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
252 252
 		$r = false;
253 253
 		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
254 254
 		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 			$link = $connexion['link'];
267 267
 			//On retente au cas où
268 268
 			try {
269
-				$r = mysqli_query($link, $query . $debug);
269
+				$r = mysqli_query($link, $query.$debug);
270 270
 			} catch (\mysqli_sql_exception $e) {
271
-				spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
271
+				spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
272 272
 				$r = false;
273 273
 				// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
274 274
 				// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	// d'utiliser ceux-ci, copie-colle de phpmyadmin
302 302
 	$query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query);
303 303
 
304
-	return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille
304
+	return spip_mysql_query('ALTER '.$query, $serveur, $requeter); # i.e. que PG se debrouille
305 305
 }
306 306
 
307 307
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
  * @return bool            Toujours true
315 315
  */
316 316
 function spip_mysql_optimize($table, $serveur = '', $requeter = true) {
317
-	spip_mysql_query('OPTIMIZE TABLE ' . $table);
317
+	spip_mysql_query('OPTIMIZE TABLE '.$table);
318 318
 
319 319
 	return true;
320 320
 }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	$link = $connexion['link'];
338 338
 	$db = $connexion['db'];
339 339
 
340
-	$query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe);
340
+	$query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe);
341 341
 	$r = mysqli_query($link, $query);
342 342
 
343 343
 	return spip_mysql_fetch($r, null, $serveur);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		. calculer_mysql_expression('WHERE', $where)
389 389
 		. calculer_mysql_expression('GROUP BY', $groupby, ',')
390 390
 		. calculer_mysql_expression('HAVING', $having)
391
-		. ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '')
391
+		. ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '')
392 392
 		. ($limit ? "\nLIMIT $limit" : '');
393 393
 
394 394
 	// renvoyer la requete inerte si demandee
@@ -478,12 +478,12 @@  discard block
 block discarded – undo
478 478
 	$exp = "\n$expression ";
479 479
 
480 480
 	if (!is_array($v)) {
481
-		return $exp . $v;
481
+		return $exp.$v;
482 482
 	} else {
483 483
 		if (strtoupper($join) === 'AND') {
484
-			return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v));
484
+			return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v));
485 485
 		} else {
486
-			return $exp . join($join, $v);
486
+			return $exp.join($join, $v);
487 487
 		}
488 488
 	}
489 489
 }
@@ -501,17 +501,17 @@  discard block
 block discarded – undo
501 501
 		if (substr($k, -1) == '@') {
502 502
 			// c'est une jointure qui se refere au from precedent
503 503
 			// pas de virgule
504
-			$res .= '  ' . $v;
504
+			$res .= '  '.$v;
505 505
 		} else {
506 506
 			if (!is_numeric($k)) {
507 507
 				$p = strpos($v, ' ');
508 508
 				if ($p) {
509
-					$v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p);
509
+					$v = substr($v, 0, $p)." AS `$k`".substr($v, $p);
510 510
 				} else {
511 511
 					$v .= " AS `$k`";
512 512
 				}
513 513
 			}
514
-			$res .= ', ' . $v;
514
+			$res .= ', '.$v;
515 515
 		}
516 516
 	}
517 517
 
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) {
542 542
 
543 543
 	if ($GLOBALS['mysql_rappel_nom_base'] and $db) {
544
-		$pref = '`' . $db . '`.';
544
+		$pref = '`'.$db.'`.';
545 545
 	} else {
546 546
 		$pref = '';
547 547
 	}
548 548
 
549 549
 	if ($prefixe) {
550
-		$pref .= $prefixe . '_';
550
+		$pref .= $prefixe.'_';
551 551
 	}
552 552
 
553 553
 	if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				$suite_echap = $suite;
567 567
 			}
568 568
 			if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) {
569
-				$suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false);
569
+				$suite_echap = $r[1]._mysql_traite_query($r[2], $db, $prefixe, false);
570 570
 				if ($echappe_textes) {
571 571
 					$suite = query_reinjecte_textes($suite_echap, $textes);
572 572
 				}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			}
577 577
 		}
578 578
 	}
579
-	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite;
579
+	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite;
580 580
 
581 581
 	// en option, remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
582 582
 	// remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$ok = false;
617 617
 	}
618 618
 	if (!$ok) {
619
-		spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE);
619
+		spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE);
620 620
 	}
621 621
 
622 622
 	return $ok;
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 
707 707
 	$character_set = '';
708 708
 	if (@$GLOBALS['meta']['charset_sql_base']) {
709
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
709
+		$character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base'];
710 710
 	}
711 711
 	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
712
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
712
+		$character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base'];
713 713
 	}
714 714
 
715 715
 	foreach ($champs as $k => $v) {
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 				preg_match(',(char|text),i', $defs[1])
720 720
 				and !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
721 721
 			) {
722
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
722
+				$v = $defs[1].$character_set.' '.substr($v, strlen($defs[1]));
723 723
 			}
724 724
 		}
725 725
 
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
 		$s = ',';
732 732
 	}
733 733
 	$temporary = $temporary ? 'TEMPORARY' : '';
734
-	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')'
735
-		. (defined('_MYSQL_ENGINE') ? ' ENGINE=' . _MYSQL_ENGINE : '')
734
+	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')'
735
+		. (defined('_MYSQL_ENGINE') ? ' ENGINE='._MYSQL_ENGINE : '')
736 736
 		. ($character_set ? " DEFAULT $character_set" : '')
737 737
 		. "\n";
738 738
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		return false;
812 812
 	}
813 813
 
814
-	$query = "CREATE VIEW $nom AS " . $query_select;
814
+	$query = "CREATE VIEW $nom AS ".$query_select;
815 815
 
816 816
 	return spip_mysql_query($query, $serveur, $requeter);
817 817
 }
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
  *     Ressource à utiliser avec sql_fetch()
870 870
  **/
871 871
 function spip_mysql_showbase($match, $serveur = '', $requeter = true) {
872
-	return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter);
872
+	return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter);
873 873
 }
874 874
 
875 875
 /**
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
  *     - true si la requête a réussie, false sinon
886 886
  */
887 887
 function spip_mysql_repair($table, $serveur = '', $requeter = true) {
888
-	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true));
888
+	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = '._q($table), $serveur, true));
889 889
 	$engine = $table_status['Engine'];
890 890
 	if ($engine == 'InnoDB') {
891 891
 		if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 	} elseif ($engine == 'MyISAM') {
895 895
 		return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter);
896 896
 	} else {
897
-		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG);
897
+		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.'._LOG_DEBUG);
898 898
 	}
899 899
 	return false;
900 900
 }
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
  *     - string : requete sql, si $requeter = true
915 915
  **/
916 916
 function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) {
917
-	$r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter);
917
+	$r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter);
918 918
 	if (!$requeter) {
919 919
 		return $r;
920 920
 	}
@@ -996,22 +996,22 @@  discard block
 block discarded – undo
996 996
 			}
997 997
 			if ($val['Default'] === '0' || $val['Default']) {
998 998
 				if (preg_match('/[A-Z_]/', $val['Default'])) {
999
-					$nfields[$val['Field']] .= ' DEFAULT ' . $val['Default'];
999
+					$nfields[$val['Field']] .= ' DEFAULT '.$val['Default'];
1000 1000
 				} else {
1001
-					$nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'";
1001
+					$nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'";
1002 1002
 				}
1003 1003
 			}
1004 1004
 			if ($val['Extra']) {
1005
-				$nfields[$val['Field']] .= ' ' . $val['Extra'];
1005
+				$nfields[$val['Field']] .= ' '.$val['Extra'];
1006 1006
 			}
1007 1007
 			if ($val['Key'] == 'PRI') {
1008 1008
 				$nkeys['PRIMARY KEY'] = $val['Field'];
1009 1009
 			} else {
1010 1010
 				if ($val['Key'] == 'MUL') {
1011
-					$nkeys['KEY ' . $val['Field']] = $val['Field'];
1011
+					$nkeys['KEY '.$val['Field']] = $val['Field'];
1012 1012
 				} else {
1013 1013
 					if ($val['Key'] == 'UNI') {
1014
-						$nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field'];
1014
+						$nkeys['UNIQUE KEY '.$val['Field']] = $val['Field'];
1015 1015
 					}
1016 1016
 				}
1017 1017
 			}
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	$serveur = '',
1088 1088
 	$requeter = true
1089 1089
 ) {
1090
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1090
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
1091 1091
 
1092 1092
 	$r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1093 1093
 	if (!$requeter) {
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 	if ($s) {
1128 1128
 		$trace = debug_backtrace();
1129 1129
 		if ($trace[0]['function'] != 'spip_mysql_error') {
1130
-			spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1130
+			spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR);
1131 1131
 		}
1132 1132
 	}
1133 1133
 
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 	try {
1258 1258
 		$insert = mysqli_query($link, $query);
1259 1259
 	} catch (\mysqli_sql_exception $e) {
1260
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
1260
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
1261 1261
 		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
1262 1262
 		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
1263 1263
 	}
@@ -1312,8 +1312,8 @@  discard block
 block discarded – undo
1312 1312
 
1313 1313
 	return spip_mysql_insert(
1314 1314
 		$table,
1315
-		'(' . join(',', array_keys($couples)) . ')',
1316
-		'(' . join(',', $couples) . ')',
1315
+		'('.join(',', array_keys($couples)).')',
1316
+		'('.join(',', $couples).')',
1317 1317
 		$desc,
1318 1318
 		$serveur,
1319 1319
 		$requeter
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 	}
1351 1351
 	$fields = $desc['field'] ?? [];
1352 1352
 
1353
-	$cles = '(' . join(',', array_keys(reset($tab_couples))) . ')';
1353
+	$cles = '('.join(',', array_keys(reset($tab_couples))).')';
1354 1354
 	$valeurs = [];
1355 1355
 	$r = false;
1356 1356
 
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
 		foreach ($couples as $champ => $val) {
1360 1360
 			$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1361 1361
 		}
1362
-		$valeurs[] = '(' . join(',', $couples) . ')';
1362
+		$valeurs[] = '('.join(',', $couples).')';
1363 1363
 		if (count($valeurs) >= 100) {
1364 1364
 			$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1365 1365
 			$valeurs = [];
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
 function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) {
1397 1397
 	$set = [];
1398 1398
 	foreach ($champs as $champ => $val) {
1399
-		$set[] = $champ . "=$val";
1399
+		$set[] = $champ."=$val";
1400 1400
 	}
1401 1401
 	if (!empty($set)) {
1402 1402
 		return spip_mysql_query(
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 	}
1454 1454
 	$set = [];
1455 1455
 	foreach ($champs as $champ => $val) {
1456
-		$set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1456
+		$set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]);
1457 1457
 	}
1458 1458
 
1459 1459
 	return spip_mysql_query(
@@ -1522,10 +1522,10 @@  discard block
 block discarded – undo
1522 1522
  *     - false en cas d'erreur.
1523 1523
  **/
1524 1524
 function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) {
1525
-	return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1525
+	return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join(
1526 1526
 		',',
1527 1527
 		array_map('_q', $couples)
1528
-	) . ')', $serveur, $requeter);
1528
+	).')', $serveur, $requeter);
1529 1529
 }
1530 1530
 
1531 1531
 
@@ -1554,10 +1554,10 @@  discard block
 block discarded – undo
1554 1554
  *     - false en cas d'erreur.
1555 1555
  **/
1556 1556
 function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) {
1557
-	$cles = '(' . join(',', array_keys($tab_couples[0])) . ')';
1557
+	$cles = '('.join(',', array_keys($tab_couples[0])).')';
1558 1558
 	$valeurs = [];
1559 1559
 	foreach ($tab_couples as $couples) {
1560
-		$valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1560
+		$valeurs[] = '('.join(',', array_map('_q', $couples)).')';
1561 1561
 	}
1562 1562
 	$valeurs = implode(', ', $valeurs);
1563 1563
 
@@ -1577,28 +1577,28 @@  discard block
 block discarded – undo
1577 1577
  */
1578 1578
 function spip_mysql_multi($objet, $lang) {
1579 1579
 	$lengthlang = strlen("[$lang]");
1580
-	$posmulti = 'INSTR(' . $objet . ", '<multi>')";
1581
-	$posfinmulti = 'INSTR(' . $objet . ", '</multi>')";
1582
-	$debutchaine = 'LEFT(' . $objet . ", $posmulti-1)";
1583
-	$finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))";
1584
-	$chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1585
-	$poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1580
+	$posmulti = 'INSTR('.$objet.", '<multi>')";
1581
+	$posfinmulti = 'INSTR('.$objet.", '</multi>')";
1582
+	$debutchaine = 'LEFT('.$objet.", $posmulti-1)";
1583
+	$finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))";
1584
+	$chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1585
+	$poslang = "INSTR($chainemulti,'[".$lang."]')";
1586 1586
 	$poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1587
-	$chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1588
-	$posfinlang = 'INSTR(' . $chainelang . ", '[')";
1587
+	$chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1588
+	$posfinlang = 'INSTR('.$chainelang.", '[')";
1589 1589
 	$chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1590 1590
 	//$chainelang = "LEFT($chainelang,$posfinlang-1)";
1591
-	$retour = "(TRIM(IF($posmulti = 0 , " .
1592
-		'     TRIM(' . $objet . '), ' .
1593
-		'     CONCAT( ' .
1594
-		"          $debutchaine, " .
1595
-		'          IF( ' .
1596
-		"               $poslang = 0, " .
1597
-		"                     $chainemulti, " .
1598
-		"               $chainelang" .
1599
-		'          ), ' .
1600
-		"          $finchaine" .
1601
-		'     ) ' .
1591
+	$retour = "(TRIM(IF($posmulti = 0 , ".
1592
+		'     TRIM('.$objet.'), '.
1593
+		'     CONCAT( '.
1594
+		"          $debutchaine, ".
1595
+		'          IF( '.
1596
+		"               $poslang = 0, ".
1597
+		"                     $chainemulti, ".
1598
+		"               $chainelang".
1599
+		'          ), '.
1600
+		"          $finchaine".
1601
+		'     ) '.
1602 1602
 		'))) AS multi';
1603 1603
 
1604 1604
 	return $retour;
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
  *     Valeur hexadécimale pour MySQL
1616 1616
  **/
1617 1617
 function spip_mysql_hex($v) {
1618
-	return '0x' . $v;
1618
+	return '0x'.$v;
1619 1619
 }
1620 1620
 
1621 1621
 /**
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
  *     Expression SQL
1656 1656
  **/
1657 1657
 function spip_mysql_date_proche($champ, $interval, $unite) {
1658
-	$use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false );
1658
+	$use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false);
1659 1659
 	return '('
1660 1660
 	. $champ
1661 1661
 	. (($interval <= 0) ? '>' : '<')
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
 		} elseif ($v === null) {
1711 1711
 			return "''";
1712 1712
 		}
1713
-		return "'" . addslashes($v) . "'";
1713
+		return "'".addslashes($v)."'";
1714 1714
 	}
1715 1715
 
1716 1716
 	if ($v === null) {
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
 		}
1735 1735
 	}
1736 1736
 
1737
-	return ("'" . addslashes($v) . "'");
1737
+	return ("'".addslashes($v)."'");
1738 1738
 }
1739 1739
 
1740 1740
 /**
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
 	} else {
1769 1769
 		$GLOBALS['mysql_rappel_nom_base'] = false;
1770 1770
 
1771
-		return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1771
+		return "\$GLOBALS['mysql_rappel_nom_base'] = false; ".
1772 1772
 		"/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1773 1773
 	}
1774 1774
 }
Please login to merge, or discard this patch.
ecrire/install/etape_.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
 	} else {
33 33
 		include_spip('inc/presentation'); // pour info_copyright
34 34
 
35
-		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
36
-			"<p class='small'>" . info_copyright() . "</p></div>\n" .
37
-			'<p>' . _T('install_select_langue') . '</p>' .
38
-			'<div>' . $menu_langues . "</div>\n" .
39
-			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
35
+		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='".chemin_image('logo-spip.png')."' />\n".
36
+			"<p class='small'>".info_copyright()."</p></div>\n".
37
+			'<p>'._T('install_select_langue').'</p>'.
38
+			'<div>'.$menu_langues."</div>\n".
39
+			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />".bouton_suivant());
40 40
 
41 41
 		$minipage = new Spip\Afficher\Minipage\Installation();
42 42
 		echo $minipage->page($res);
Please login to merge, or discard this patch.
ecrire/src/Afficher/Minipage/Admin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 			$titre = ($titre == 'install')
106 106
 				? _T('avis_espace_interdit')
107
-				: $titre . '&nbsp;: ' . _T('info_acces_interdit');
107
+				: $titre.'&nbsp;: '._T('info_acces_interdit');
108 108
 
109 109
 			$statut = $GLOBALS['visiteur_session']['statut'] ?? '';
110 110
 			$nom = $GLOBALS['visiteur_session']['nom'] ?? '';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 				$footer = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site'] ?? '');
124 124
 			}
125 125
 
126
-			spip_log($nom . " $titre " . $_SERVER['REQUEST_URI'], 'minipres');
126
+			spip_log($nom." $titre ".$_SERVER['REQUEST_URI'], 'minipres');
127 127
 
128 128
 			$options['footer'] = $footer;
129 129
 			if (empty($corps)) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			foreach ($_POST as $v => $c) {
155 155
 				$url = parametre_url($url, $v, $c, '&');
156 156
 			}
157
-			ajax_retour('<div>' . $titre . redirige_formulaire($url) . '</div>', false);
157
+			ajax_retour('<div>'.$titre.redirige_formulaire($url).'</div>', false);
158 158
 			return '';
159 159
 		}
160 160
 	}
Please login to merge, or discard this patch.