Completed
Push — master ( ffbbca...ad9227 )
by cam
01:32
created
ecrire/inc/rubriques.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 		sql_updateq(
136 136
 			'spip_rubriques',
137 137
 			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
138
-			'id_rubrique=' . intval($id_rubrique)
138
+			'id_rubrique='.intval($id_rubrique)
139 139
 		);
140
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
140
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique));
141 141
 		if (!$id_parent) {
142 142
 			break;
143 143
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return $id_pred != $id_rubrique;
173 173
 		}
174 174
 		// passer au parent si on a depublie
175
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
175
+		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred));
176 176
 		$id_pred = $r['id_parent'];
177 177
 	}
178 178
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 		$date = date('Y-m-d H:i:s');
198 198
 	}
199 199
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
200
-		' AND date <= ' . sql_quote($date) : '';
200
+		' AND date <= '.sql_quote($date) : '';
201 201
 
202 202
 	if (!$id_rubrique = intval($id_rubrique)) {
203 203
 		return false;
204 204
 	}
205 205
 
206 206
 	// verifier qu'elle existe et est bien publiee
207
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
207
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
208 208
 	if (!$r || $r['statut'] !== 'publie') {
209 209
 		return false;
210 210
 	}
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
 	$compte = [
215 215
 		'articles' => sql_countsel(
216 216
 			'spip_articles',
217
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
217
+			'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates"
218 218
 		),
219
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
219
+		'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"),
220 220
 		'documents' => sql_countsel(
221 221
 			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
222
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
222
+			'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
223 223
 		)
224 224
 	];
225 225
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		}
245 245
 	}
246 246
 
247
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
247
+	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique));
248 248
 
249 249
 #		spip_log("depublier_rubrique $id_pred");
250 250
 	return true;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 	// Afficher les articles post-dates ?
309 309
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
310
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
310
+		'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
311 311
 
312 312
 	$r = sql_select(
313 313
 		'R.id_rubrique AS id, max(A.date) AS date_h',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		sql_updateq(
320 320
 			'spip_rubriques',
321 321
 			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
322
-			'id_rubrique=' . intval($row['id'])
322
+			'id_rubrique='.intval($row['id'])
323 323
 		);
324 324
 	}
325 325
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			sql_updateq(
346 346
 				'spip_rubriques',
347 347
 				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
348
-				'id_rubrique=' . intval($row['id'])
348
+				'id_rubrique='.intval($row['id'])
349 349
 			);
350 350
 			$continuer = true;
351 351
 		}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			&& ($rows = sql_allfetsel(
399 399
 				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
400 400
 				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
401
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
401
+				'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
402 402
 				'',
403 403
 				'R.id_secteur',
404 404
 				'0,100'
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 			&& ($rows = sql_allfetsel(
438 438
 				'id_rubrique as id',
439 439
 				'spip_rubriques',
440
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
440
+				'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select(
441 441
 					'zzz.id_rubrique',
442 442
 					'spip_rubriques AS zzz',
443
-					'zzz.profondeur=' . intval($prof)
444
-				) . ')',
443
+					'zzz.profondeur='.intval($prof)
444
+				).')',
445 445
 				'',
446 446
 				'',
447 447
 				'0,100'
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
456 456
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
457 457
 		// on arrete les frais
458
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
458
+		if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) {
459 459
 			$prof++;
460 460
 			$continuer = true;
461 461
 		}
@@ -463,12 +463,12 @@  discard block
 block discarded – undo
463 463
 
464 464
 	// loger si la table des rubriques semble foireuse
465 465
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
466
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
466
+	if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) {
467 467
 		spip_log(
468
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
468
+			'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)',
469 469
 			_LOG_CRITIQUE
470 470
 		);
471
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
471
+		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1));
472 472
 	}
473 473
 
474 474
 	// reparer les articles
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 	);
480 480
 
481 481
 	while ($row = sql_fetch($r)) {
482
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
482
+		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id']));
483 483
 	}
484 484
 
485 485
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$t = sql_updateq(
511 511
 			'spip_rubriques',
512 512
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
513
-			'id_rubrique=' . intval($id_rubrique)
513
+			'id_rubrique='.intval($id_rubrique)
514 514
 		);
515 515
 	}
516 516
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		sql_updateq(
556 556
 			'spip_articles',
557 557
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
558
-			'id_article=' . intval($id_article)
558
+			'id_article='.intval($id_article)
559 559
 		);
560 560
 	}
561 561
 
@@ -630,11 +630,11 @@  discard block
 block discarded – undo
630 630
 				];
631 631
 				// generer un nom de fonction "anonyme" unique
632 632
 				do {
633
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
633
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax());
634 634
 				} while (function_exists($functionname));
635 635
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
636
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
637
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
636
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
637
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
638 638
 				$res = '';
639 639
 				eval($code);
640 640
 				$res = explode(',', $res);
@@ -736,11 +736,11 @@  discard block
 block discarded – undo
736 736
 		$maxiter-- && ($filles = sql_allfetsel(
737 737
 			'id_rubrique',
738 738
 			'spip_rubriques',
739
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
739
+			sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT')
740 740
 		))
741 741
 	) {
742 742
 		$r = join(',', array_column($filles, 'id_rubrique'));
743
-		$branche .= ',' . $r;
743
+		$branche .= ','.$r;
744 744
 	}
745 745
 
746 746
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
 	if (isset($b[$id])) {
782 782
 		// Notre branche commence par la rubrique de depart si $tout=true
783
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
783
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
784 784
 	}
785 785
 
786 786
 	$hier = '';
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
 		$maxiter-- && ($parents = sql_allfetsel(
794 794
 			'id_parent',
795 795
 			'spip_rubriques',
796
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
796
+			sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT')
797 797
 		))
798 798
 	) {
799 799
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
800
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
800
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
801 801
 	}
802 802
 
803 803
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	include_spip('base/abstract_sql');
830 830
 	if ($check) {
831 831
 		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
832
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
832
+			'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
833 833
 
834 834
 		$r = sql_select(
835 835
 			'DISTINCT A.id_rubrique AS id',
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 	$t = sql_fetsel(
847 847
 		'date',
848 848
 		'spip_articles',
849
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
849
+		"statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')),
850 850
 		'',
851 851
 		'date',
852 852
 		'1'
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		$r = sql_getfetsel(
903 903
 			'id_rubrique',
904 904
 			'spip_rubriques',
905
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
905
+			'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent),
906 906
 			$groupby = [],
907 907
 			$orderby = [],
908 908
 			$limit = '',
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 			sql_updateq(
939 939
 				'spip_rubriques',
940 940
 				['id_secteur' => $id_secteur, 'lang' => $lang],
941
-				'id_rubrique=' . intval($id_rubrique),
941
+				'id_rubrique='.intval($id_rubrique),
942 942
 				[],
943 943
 				$serveur
944 944
 			);
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	// celle du texte) et public (spip_lang est la langue du texte)
50 50
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
51 51
 
52
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
52
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
53 53
 	if ($dir == 'rtl') {
54 54
 		$p .= '_rtl';
55 55
 	}
56 56
 
57 57
 	if (!isset($GLOBALS[$p])) {
58
-		$GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>';
58
+		$GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>';
59 59
 	}
60 60
 
61 61
 	return $GLOBALS[$p];
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 function spip_balisage_code(string $corps, bool $bloc = false, string $attributs = '', string $langage = ''): string {
68 68
 
69 69
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
70
-	$class = 'spip_code ' . ($bloc ? 'spip_code_block' : 'spip_code_inline');
70
+	$class = 'spip_code '.($bloc ? 'spip_code_block' : 'spip_code_inline');
71 71
 	if ($attributs) {
72
-		$attributs = ' ' . trim($attributs);
72
+		$attributs = ' '.trim($attributs);
73 73
 	}
74 74
 	if ($langage) {
75 75
 		$class .= " language-$langage";
76
-		$attributs .= ' data-language="' . $langage . '"';
76
+		$attributs .= ' data-language="'.$langage.'"';
77 77
 	}
78 78
 	if ($bloc) {
79 79
 		$html = '<div class="precode">'
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	} else {
87 87
 		$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
88 88
 		$echap = str_replace('  ', ' &nbsp;', $echap);
89
-		$html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>';
89
+		$html = "<code class=\"$class\" dir=\"ltr\"$attributs>".$echap.'</code>';
90 90
 	}
91 91
 
92 92
 	return $html;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 // XHTML - Preserver les balises-bloc : on liste ici tous les elements
97 97
 // dont on souhaite qu'ils provoquent un saut de paragraphe
98 98
 defined('_BALISES_BLOCS') || define('_BALISES_BLOCS', implode('|', CollecteurHtmlTag::$listeBalisesBloc));
99
-defined('_BALISES_BLOCS_REGEXP') || define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
99
+defined('_BALISES_BLOCS_REGEXP') || define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
100 100
 
101 101
 /**
102 102
  * Echapper les elements perilleux en les passant en base64
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		return '';
117 117
 	}
118 118
 
119
-	return CollecteurHtmlTag::echappementHtmlBase64((string)$rempl, (string)$source, in_array($mode, ['div', 'span']) ? $mode === 'div' : null);
119
+	return CollecteurHtmlTag::echappementHtmlBase64((string) $rempl, (string) $source, in_array($mode, ['div', 'span']) ? $mode === 'div' : null);
120 120
 }
121 121
 
122 122
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		$collections = $collecteurCode->collecter($pre);
137 137
 		$collections = array_reverse($collections);
138 138
 		foreach ($collections as $c) {
139
-			$code = $c['opening'] . spip_htmlspecialchars($c['innerHtml']) . $c['closing'];
139
+			$code = $c['opening'].spip_htmlspecialchars($c['innerHtml']).$c['closing'];
140 140
 			$pre = substr_replace($pre, $code, $c['pos'], $c['length']);
141 141
 		}
142 142
 	}
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	return $regs['raw'];
192 192
 }
193 193
 
194
-defined('_PROTEGE_BLOCS') || define('_PROTEGE_BLOCS', ',<(' . implode('|', CollecteurHtmlTag::$listeBalisesAProteger) . ')(\b[^>]*)?>(.*)</\1>,UimsS');
194
+defined('_PROTEGE_BLOCS') || define('_PROTEGE_BLOCS', ',<('.implode('|', CollecteurHtmlTag::$listeBalisesAProteger).')(\b[^>]*)?>(.*)</\1>,UimsS');
195 195
 
196 196
 /**
197 197
  * pour $source voir commentaire infra (echappe_retour)
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 		$callback_secure_prefix = ($callback_options['secure_prefix'] ?? '');
243 243
 		foreach ($html_tags ?: CollecteurHtmlTag::$listeBalisesAProteger as $tag) {
244 244
 			if (
245
-				function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . $tag)
246
-				|| function_exists($f = $f . '_dist')
245
+				function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.$tag)
246
+				|| function_exists($f = $f.'_dist')
247 247
 				|| $callback_secure_prefix && (
248
-					function_exists($f = $callback_prefix . 'traiter_echap_' . $tag)
249
-					|| function_exists($f = $f . '_dist')
248
+					function_exists($f = $callback_prefix.'traiter_echap_'.$tag)
249
+					|| function_exists($f = $f.'_dist')
250 250
 				)
251 251
 			) {
252 252
 				$callbacks[$tag] = $f;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	if (!is_string($letexte) || !strlen($letexte)) {
287 287
 		return $letexte;
288 288
 	}
289
-	return CollecteurHtmlTag::retablir_depuisHtmlBase64((string)$letexte, (string)$source, (string)$filtre);
289
+	return CollecteurHtmlTag::retablir_depuisHtmlBase64((string) $letexte, (string) $source, (string) $filtre);
290 290
 }
291 291
 
292 292
 // Reinserer le javascript de confiance (venant des modeles)
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	if (!is_string($letexte) || !strlen($letexte)) {
296 296
 		return $letexte;
297 297
 	}
298
-	$letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64((string)$letexte);
298
+	$letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64((string) $letexte);
299 299
 
300 300
 	// Dans les appels directs hors squelette, securiser aussi ici
301 301
 	// c'est interdire_scripts() qui rétablit les scripts des modeles echappés avec _PROTEGE_JS_MODELES et _PROTEGE_PHP_MODELES
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 	$texte = nettoyer_raccourcis_typo($texte);
365 365
 
366 366
 	// balises de sauts de ligne et paragraphe
367
-	$texte = preg_replace('/<p( [^>]*)?' . '>/', "\r\r", $texte);
368
-	$texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte);
367
+	$texte = preg_replace('/<p( [^>]*)?'.'>/', "\r\r", $texte);
368
+	$texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte);
369 369
 
370 370
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
371 371
 	$texte = str_replace("\n\n", "\r\r", $texte);
@@ -390,15 +390,15 @@  discard block
 block discarded – undo
390 390
 		// excédentaire est ensuite supprimé par l'appel à preg_replace()
391 391
 		$long = spip_substr($texte, 0, max($taille + 1 - $taille_suite, 1));
392 392
 		$u = $GLOBALS['meta']['pcre_u'];
393
-		$court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long);
393
+		$court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long);
394 394
 		$points = $suite;
395 395
 
396 396
 		// trop court ? ne pas faire de (...)
397 397
 		if (spip_strlen($court) < max(0.75 * $taille, 2)) {
398 398
 			$points = '';
399 399
 			$long = spip_substr($texte, 0, $taille + 1);
400
-			preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, $long, $m);
401
-			$texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long);
400
+			preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, $long, $m);
401
+			$texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long);
402 402
 			// encore trop court ? couper au caractere
403 403
 			if (spip_strlen($texte) < 0.75 * $taille) {
404 404
 				$texte = spip_substr($long, 0, $taille);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	// supprimer l'eventuelle entite finale mal coupee
415 415
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
416 416
 
417
-	return quote_amp(trim($texte)) . $points;
417
+	return quote_amp(trim($texte)).$points;
418 418
 }
419 419
 
420 420
 
@@ -422,16 +422,16 @@  discard block
 block discarded – undo
422 422
 	if (isset($GLOBALS['visiteur_session']) && str_contains($texte, '<')) {
423 423
 		$tags = [
424 424
 			'javascript' => ['tag' => 'script', 'preg' => ',<script.*?($|</script.),isS', 'c' => '_PROTEGE_JS_MODELES'],
425
-			'php' => ['tag' => '?php', 'preg' => ',<\?php.*?($|\?' . '>),isS', 'c' => '_PROTEGE_PHP_MODELES'],
425
+			'php' => ['tag' => '?php', 'preg' => ',<\?php.*?($|\?'.'>),isS', 'c' => '_PROTEGE_PHP_MODELES'],
426 426
 		];
427 427
 		foreach ($tags as $k => $t) {
428
-			if (stripos($texte, '<' . $t['tag']) !== false) {
428
+			if (stripos($texte, '<'.$t['tag']) !== false) {
429 429
 				if (!defined($t['c'])) {
430 430
 					include_spip('inc/acces');
431 431
 					define($t['c'], creer_uniqid());
432 432
 				}
433 433
 				$collecteurHtmlTag = new CollecteurHtmlTag($t['tag'], $t['preg'], '');
434
-				$texte = $collecteurHtmlTag->echapper_enHtmlBase64($texte, $k . constant($t['c']));
434
+				$texte = $collecteurHtmlTag->echapper_enHtmlBase64($texte, $k.constant($t['c']));
435 435
 			}
436 436
 		}
437 437
 	}
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 			if (!empty($options['wrap_suspect'])) {
545 545
 				$texte = wrap($texte, $options['wrap_suspect']);
546 546
 			}
547
-			$texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte;
547
+			$texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte;
548 548
 		}
549 549
 
550 550
 		$texte = $collecteurModeles->retablir($texte);
@@ -687,11 +687,11 @@  discard block
 block discarded – undo
687 687
  **/
688 688
 function supprime_img($letexte, $message = null) {
689 689
 	if ($message === null) {
690
-		$message = '(' . _T('img_indisponible') . ')';
690
+		$message = '('._T('img_indisponible').')';
691 691
 	}
692 692
 
693 693
 	return preg_replace(
694
-		',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
694
+		',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
695 695
 		$message,
696 696
 		$letexte
697 697
 	);
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$infos['url_voir'] = $infos['type'];
704 704
 	}
705 705
 	if (!isset($infos['url_edit'])) {
706
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
706
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
707 707
 	}
708 708
 	if (!isset($infos['icone_objet'])) {
709 709
 		$infos['icone_objet'] = $infos['type'];
@@ -715,48 +715,48 @@  discard block
 block discarded – undo
715 715
 		$infos['texte_retour'] = 'icone_retour';
716 716
 	}
717 717
 	if (!isset($infos['texte_modifier'])) {
718
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
718
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
719 719
 	}
720 720
 	if (!isset($infos['texte_creer'])) {
721
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
721
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer_associer'])) {
724
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
724
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_ajouter'])) {
727 727
 		// Ajouter un X
728
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
728
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
729 729
 	}
730 730
 	if (!isset($infos['texte_objets'])) {
731
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
731
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objet'])) {
734
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
734
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
735 735
 	}
736 736
 	if (!isset($infos['texte_logo_objet'])) {
737 737
 		// objet:titre_logo_objet "Logo de ce X"
738
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
738
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
739 739
 	}
740 740
 	if (!isset($infos['texte_langue_objet'])) {
741 741
 		// objet:texte_langue_objet "Langue de ce X"
742
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
742
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
743 743
 	}
744 744
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
745 745
 		// "Ce X est une traduction du X numéro :"
746
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
746
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
747 747
 	}
748 748
 
749 749
 	// objet:info_aucun_objet
750 750
 	if (!isset($infos['info_aucun_objet'])) {
751
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
751
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
752 752
 	}
753 753
 	// objet:info_1_objet
754 754
 	if (!isset($infos['info_1_objet'])) {
755
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
755
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
756 756
 	}
757 757
 	// objet:info_nb_objets
758 758
 	if (!isset($infos['info_nb_objets'])) {
759
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
759
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
760 760
 	}
761 761
 
762 762
 	if (!isset($infos['champs_editables'])) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 		}
955 955
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
956 956
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
957
-		$spip = $connexion['prefixe'] . '_';
957
+		$spip = $connexion['prefixe'].'_';
958 958
 		foreach ($ts as $t) {
959 959
 			$t = substr((string) $t, strlen($spip));
960 960
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
  * @return string
1008 1008
  *     Nom de l'objet
1009 1009
  **/
1010
-function table_objet(string $type, string|false $serveur = ''): string {
1010
+function table_objet(string $type, string | false $serveur = ''): string {
1011 1011
 
1012 1012
 	if ($type) {
1013 1013
 		$type = preg_replace(',^spip_|^id_|s$,', '', $type);
@@ -1024,9 +1024,9 @@  discard block
 block discarded – undo
1024 1024
 	if ($serveur !== false) {
1025 1025
 		$t = lister_tables_spip($serveur);
1026 1026
 		$trouver_table = charger_fonction('trouver_table', 'base');
1027
-		$typetrim = rtrim($type, 's') . 's';
1027
+		$typetrim = rtrim($type, 's').'s';
1028 1028
 		if (
1029
-			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1029
+			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1030 1030
 		) {
1031 1031
 			return $desc['id_table'];
1032 1032
 		} elseif (
@@ -1035,11 +1035,11 @@  discard block
 block discarded – undo
1035 1035
 			return $desc['id_table'];
1036 1036
 		}
1037 1037
 
1038
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1038
+		spip_log('table_objet('.$type.') calculee sans verification');
1039 1039
 		#spip_log(debug_backtrace(),'db');
1040 1040
 	}
1041 1041
 
1042
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1042
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1043 1043
 }
1044 1044
 
1045 1045
 /**
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
  * @return string
1060 1060
  *     Nom de la table SQL
1061 1061
  **/
1062
-function table_objet_sql(string $type, string|false $serveur = ''): string {
1062
+function table_objet_sql(string $type, string | false $serveur = ''): string {
1063 1063
 	$nom = table_objet($type, $serveur);
1064 1064
 	if (!strlen($nom)) {
1065 1065
 		return '';
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
  * @return string|null
1152 1152
  *     Type de l'objet
1153 1153
  **/
1154
-function objet_type(string $table_objet, string|false $serveur = ''): ?string {
1154
+function objet_type(string $table_objet, string | false $serveur = ''): ?string {
1155 1155
 	if (!$table_objet) {
1156 1156
 		return null;
1157 1157
 	}
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1224 1224
 	// voir si une fonction est definie pour faire le boulot
1225 1225
 	// elle a la priorite dans ce cas
1226
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1226
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1227 1227
 		return $f($objet, $id_objet, $serveur);
1228 1228
 	}
1229 1229
 
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 		$boucle->sql_serveur = $serveur;
1246 1246
 		$boucle->select[] = $id_table_objet;
1247 1247
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1248
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . (int) $id_objet;
1248
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.(int) $id_objet;
1249 1249
 
1250 1250
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1251 1251
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 						? "{$parent_methode['source_champ']} = $id_objet"
1369 1369
 						: "$cle_objet = $id_objet";
1370 1370
 					if (isset($parent_methode['source_champ_type'])) {
1371
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1371
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1372 1372
 					}
1373 1373
 					// -- Condition supplémentaire sur la détection du parent
1374 1374
 					if (isset($parent_methode['table_condition'])) {
@@ -1492,11 +1492,11 @@  discard block
 block discarded – undo
1492 1492
 			$where = [];
1493 1493
 			// -- L'identifiant du parent
1494 1494
 			if (isset($_methode_parent['champ'])) {
1495
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1495
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1496 1496
 			}
1497 1497
 			// -- Si le parent est variable
1498 1498
 			if (isset($_methode_parent['champ_type'])) {
1499
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1499
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1500 1500
 			}
1501 1501
 
1502 1502
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.
ecrire/plugins/afficher_nom_plugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	// numerotons les occurences d'un meme prefix
37 37
 	$versions[$info['prefix']] ??= 0;
38 38
 	$versions[$info['prefix']]++;
39
-	$id = $info['prefix'] . $versions[$info['prefix']];
39
+	$id = $info['prefix'].$versions[$info['prefix']];
40 40
 
41 41
 	$class = $class_li;
42 42
 	$class .= $actif ? ' actif' : '';
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 
50 50
 	// Cartouche Resume
51 51
 	$s .= "<div class='resume'>";
52
-	$s .= "<strong class='nom'>" . typo($info['nom']) . '</strong>';
53
-	$s .= " <span class='version'>" . $info['version'] . '</span>';
54
-	$s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . '</span>';
52
+	$s .= "<strong class='nom'>".typo($info['nom']).'</strong>';
53
+	$s .= " <span class='version'>".$info['version'].'</span>';
54
+	$s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat']).'</span>';
55 55
 	$s .= '</div>';
56 56
 
57 57
 	if ($erreur) {
58
-		$s .= "<div class='erreur'>" . implode('<br >', $info['erreur']) . '</div>';
58
+		$s .= "<div class='erreur'>".implode('<br >', $info['erreur']).'</div>';
59 59
 	}
60 60
 
61
-	return $s . '</li>';
61
+	return $s.'</li>';
62 62
 }
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +34 added lines, -35 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 			" class='picto_err'",
63 63
 			_T('plugin_info_erreur_xml')
64 64
 		)
65
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . '</div>';
65
+			. "<div class='erreur'>".join('<br >', $info['erreur']).'</div>';
66 66
 		$checkable = false;
67
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
67
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
68 68
 		$class_li .= ' error';
69 69
 		$erreur = http_img_pack(
70 70
 			'plugin-err-32.png',
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 			" class='picto_err'",
73 73
 			_T('plugin_impossible_activer', ['plugin' => $nom])
74 74
 		)
75
-			. "<div class='erreur'>" . implode(
75
+			. "<div class='erreur'>".implode(
76 76
 				'<br />',
77
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]
78
-			) . '</div>';
77
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file]
78
+			).'</div>';
79 79
 	} else {
80 80
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : '';
81 81
 		if (defined('_DEV_VERSION_SPIP_COMPAT') && !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 	// numerotons les occurrences d'un meme prefix
93 93
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
94 94
 
95
-	$class_li .= ($actif ? ' actif' : '') . ($expose ? ' on' : '');
95
+	$class_li .= ($actif ? ' actif' : '').($expose ? ' on' : '');
96 96
 
97 97
 	return "<li id='$prefix$id' class='$class_li'>"
98 98
 	. ((!$checkable && !$checked)
99
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
99
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
100 100
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
101 101
 	. $cfg
102 102
 	. $erreur
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 	// si paquet.xml fournit un squelette, le prendre
116 116
 	if (isset($infos['config']) && $infos['config']) {
117 117
 		return recuperer_fond(
118
-			"$dir$nom/" . $infos['config'],
118
+			"$dir$nom/".$infos['config'],
119 119
 			[
120
-				'script' => 'configurer_' . $prefix,
120
+				'script' => 'configurer_'.$prefix,
121 121
 				'nom' => $nom
122 122
 			]
123 123
 		);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	return recuperer_fond(
128 128
 		'prive/squelettes/inclure/cfg',
129 129
 		[
130
-			'script' => 'configurer_' . $prefix,
130
+			'script' => 'configurer_'.$prefix,
131 131
 			'nom' => $nom
132 132
 		]
133 133
 	);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
144 144
 	. ($actif ? " checked='checked'" : '')
145 145
 	. " class='checkbox'  value='O' />"
146
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . '</label>'
146
+	. "\n<label for='label_$id_input'>"._T('activer_plugin').'</label>'
147 147
 	. '</div>';
148 148
 }
149 149
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	. "<h3><a href='$url' rel='info'>"
199 199
 	. $nom
200 200
 	. '</a></h3>'
201
-	. " <span class='version'>" . $info['version'] . '</span>'
201
+	. " <span class='version'>".$info['version'].'</span>'
202 202
 	. " <span class='etat'> - "
203 203
 	. plugin_etat_en_clair($info['etat'])
204 204
 	. '</span>'
205
-	. "<div class='short'>" . $slogan . '</div>'
205
+	. "<div class='short'>".$slogan.'</div>'
206 206
 	. $i
207 207
 	. '</div>';
208 208
 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	$text2 = _T('info_desinstaller_plugin');
218 218
 	$file = basename($plug_file);
219 219
 
220
-	return "<div class='actions'>[" .
220
+	return "<div class='actions'>[".
221 221
 	"<a href='$action'
222 222
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
223 223
 	. $text
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$etat = 'developpement';
240 240
 	}
241 241
 
242
-	return _T('plugin_etat_' . $etat);
242
+	return _T('plugin_etat_'.$etat);
243 243
 }
244 244
 
245 245
 function plugin_propre($texte, $module = '', $propre = 'propre') {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		$module = substr($module, strlen(_DIR_RACINE));
249 249
 	}
250 250
 	if (preg_match('|^\w+_[\w_]+$|', $texte)) {
251
-		$texte = _T(($module ? "$module:" : '') . $texte, [], ['force' => false]);
251
+		$texte = _T(($module ? "$module:" : '').$texte, [], ['force' => false]);
252 252
 	}
253 253
 
254 254
 	return $propre($texte);
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 	if (
281 281
 		isset($info['documentation']) && ($lien = $info['documentation'])
282 282
 	) {
283
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
283
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
284 284
 	}
285
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
285
+	$s .= "<dd class='desc'>".$description."</dd>\n";
286 286
 
287 287
 	if (isset($info['auteur'])) {
288 288
 		if (is_array($info['auteur'])) {
@@ -292,19 +292,19 @@  discard block
 block discarded – undo
292 292
 			$a = trim($info['auteur']);
293 293
 		}
294 294
 		if ($a) {
295
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre(
295
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre(
296 296
 				$a,
297 297
 				$dir
298
-			)) . "</dd>\n";
298
+			))."</dd>\n";
299 299
 		}
300 300
 	}
301 301
 
302 302
 	if (isset($info['credit'])) {
303 303
 		if ($a = formater_credits($info['credit'], ', ')) {
304
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre(
304
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre(
305 305
 				$a,
306 306
 				$dir
307
-			)) . "</dd>\n";
307
+			))."</dd>\n";
308 308
 		}
309 309
 	}
310 310
 
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 			$a = trim($info['licence']);
317 317
 		}
318 318
 		if ($a) {
319
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre(
319
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre(
320 320
 				$a,
321 321
 				$dir
322
-			)) . "</dd>\n";
322
+			))."</dd>\n";
323 323
 		}
324 324
 	}
325 325
 
@@ -330,24 +330,23 @@  discard block
 block discarded – undo
330 330
 	//
331 331
 	$infotech = [];
332 332
 
333
-	$version = '<dt>' . _T('version') . '</dt><dd>' . $info['version'];
333
+	$version = '<dt>'._T('version').'</dt><dd>'.$info['version'];
334 334
 	// Version VCS
335
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
336
-		$version .= ' ' . $vcs;
335
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
336
+		$version .= ' '.$vcs;
337 337
 	}
338 338
 	$version .= '</dd>';
339 339
 	$infotech[] = $version;
340
-	$infotech[] = '<dt>' . _T('repertoire_plugins') . '</dt><dd>' . joli_repertoire("$dir_plugins$plug_file") . '</dd>';
340
+	$infotech[] = '<dt>'._T('repertoire_plugins').'</dt><dd>'.joli_repertoire("$dir_plugins$plug_file").'</dd>';
341 341
 	// source zip le cas echeant
342
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . '</dd>'
342
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1]).'</dd>'
344 344
 		: '';
345 345
 
346
-	$infotech[] = !$info['necessite'] ? '' :
347
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(
346
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(
348 347
 			' ',
349 348
 			array_map('array_shift', $info['necessite'])
350
-		) . '</dd>');
349
+		).'</dd>');
351 350
 
352 351
 	$s .= "<dl class='tech'>"
353 352
 		. join('', $infotech)
@@ -368,8 +367,8 @@  discard block
 block discarded – undo
368 367
 		$texte .=
369 368
 			(!is_array($_credit))
370 369
 				? PtoBR(propre($_credit))
371
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
372
-				$_credit['nom'] .
370
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
371
+				$_credit['nom'].
373 372
 				($_credit['url'] ? '</a>' : '');
374 373
 	}
375 374
 
Please login to merge, or discard this patch.
ecrire/install/etape_fin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	// creer le repertoire cache, qui sert partout !
40 40
 	// deja fait en etape 4 en principe, on garde au cas ou
41 41
 	if (!@file_exists(_DIR_CACHE)) {
42
-		$rep = preg_replace(',' . _DIR_TMP . ',', '', (string) _DIR_CACHE);
42
+		$rep = preg_replace(','._DIR_TMP.',', '', (string) _DIR_CACHE);
43 43
 		$rep = sous_repertoire(_DIR_TMP, $rep, true, true);
44 44
 	}
45 45
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$cible = _T('public:accueil_site');
51 51
 		$cible = generer_form_ecrire('accueil', '', '', $cible);
52 52
 		$minipage = new Installation();
53
-		echo $minipage->page($msg . $cible);
53
+		echo $minipage->page($msg.$cible);
54 54
 		// ok, deboucher dans l'espace prive
55 55
 	} else {
56 56
 		redirige_url_ecrire('accueil');
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 	$averti = _T(
72 72
 		'htaccess_a_simuler',
73 73
 		[
74
-			'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>',
74
+			'htaccess' => '<tt>'._ACCESS_FILE_NAME.'</tt>',
75 75
 			'constantes' => '<tt>_DIR_TMP &amp; _DIR_CONNECT</tt>',
76
-			'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>'
76
+			'document_root' => '<tt>'.$_SERVER['DOCUMENT_ROOT'].'</tt>'
77 77
 		]
78 78
 	);
79 79
 
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
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 	} else {
35 35
 		include_spip('inc/presentation'); // pour info_copyright
36 36
 
37
-		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
38
-			"<p class='small'>" . info_copyright() . "</p></div>\n" .
39
-			'<p>' . _T('install_select_langue') . '</p>' .
40
-			'<div>' . $menu_langues . "</div>\n" .
41
-			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
37
+		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='".chemin_image('logo-spip.png')."' />\n".
38
+			"<p class='small'>".info_copyright()."</p></div>\n".
39
+			'<p>'._T('install_select_langue').'</p>'.
40
+			'<div>'.$menu_langues."</div>\n".
41
+			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />".bouton_suivant());
42 42
 
43 43
 		$minipage = new Installation();
44 44
 		echo $minipage->page($res);
Please login to merge, or discard this patch.
ecrire/install/etape_2.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	$GLOBALS['connexions'][$server_db] = $link;
51 51
 
52 52
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
53
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
53
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
54 54
 
55 55
 	$minipage = new Installation();
56 56
 	echo $minipage->installDebutPage();
@@ -70,18 +70,18 @@  discard block
 block discarded – undo
70 70
 	//echo "\n-->\n";
71 71
 
72 72
 	if (($db_connect == '0') && $link) {
73
-		echo "<div class='success'><b>" . _T('info_connexion_ok') . '</b></div>';
73
+		echo "<div class='success'><b>"._T('info_connexion_ok').'</b></div>';
74 74
 		echo info_progression_etape(2, 'etape_', 'install/');
75 75
 
76
-		echo info_etape(_T('menu_aide_installation_choix_base') . aider('install2', true));
76
+		echo info_etape(_T('menu_aide_installation_choix_base').aider('install2', true));
77 77
 
78 78
 		echo "\n", '<!-- ', sql_version($server_db), ' -->';
79 79
 		[$checked, $res] = install_etape_2_bases($login_db, $server_db);
80 80
 
81 81
 		$hidden = (defined('_SPIP_CHMOD')
82 82
 				? ''
83
-				: ("\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />"))
84
-			. predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db);
83
+				: ("\n<input type='hidden' name='chmod' value='".spip_htmlspecialchars($chmod)."' />"))
84
+			. predef_ou_cache($adresse_db.($port ? ':'.$port : ''), $login_db, $pass_db, $server_db);
85 85
 
86 86
 		echo install_etape_2_form($hidden, $checked, $res, 3);
87 87
 	} else {
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 
90 90
 		echo "<div class='error'>";
91 91
 		echo info_etape(_T('info_connexion_base'));
92
-		echo '<h3>' . _T('avis_connexion_echec_1') . '</h3>';
93
-		echo '<p>' . _T('avis_connexion_echec_2') . '</p>';
92
+		echo '<h3>'._T('avis_connexion_echec_1').'</h3>';
93
+		echo '<p>'._T('avis_connexion_echec_2').'</p>';
94 94
 
95 95
 		echo "<p style='font-size: small;'>",
96 96
 		_T('avis_connexion_echec_3'),
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 			. ' '
123 123
 		];
124 124
 	}
125
-	$res = '<b>' . _T('avis_lecture_noms_bases_1') . '</b>
126
-		' . _T('avis_lecture_noms_bases_2') . '<p>';
125
+	$res = '<b>'._T('avis_lecture_noms_bases_1').'</b>
126
+		' . _T('avis_lecture_noms_bases_2').'<p>';
127 127
 
128 128
 	$checked = false;
129 129
 	if ($login_db) {
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 		if ($ok) {
141 141
 			$res .= _T('avis_lecture_noms_bases_3')
142 142
 				. '<ul>'
143
-				. '<li><input name="choix_db" value="' . $test_base . "\" type='radio' id='stand' checked='checked' />"
144
-				. "<label for='stand'>" . $test_base . "</label></li>\n"
143
+				. '<li><input name="choix_db" value="'.$test_base."\" type='radio' id='stand' checked='checked' />"
144
+				. "<label for='stand'>".$test_base."</label></li>\n"
145 145
 				. '</ul>'
146
-				. '<p>' . _T('info_ou') . ' ';
146
+				. '<p>'._T('info_ou').' ';
147 147
 			$checked = true;
148 148
 		}
149 149
 	}
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
 		"\n<input type='hidden' name='etape' value='$etape' />"
157 157
 		. $hidden
158 158
 		. (defined('_INSTALL_NAME_DB')
159
-			? '<h3>' . _T('install_nom_base_hebergeur') . ' <tt>' . _INSTALL_NAME_DB . '</tt>' . '</h3>'
160
-			: "\n<fieldset><legend>" . _T('texte_choix_base_1') . "</legend>\n"
159
+			? '<h3>'._T('install_nom_base_hebergeur').' <tt>'._INSTALL_NAME_DB.'</tt>'.'</h3>'
160
+			: "\n<fieldset><legend>"._T('texte_choix_base_1')."</legend>\n"
161 161
 			. $res
162 162
 			. "\n<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'"
163 163
 			. ($checked ? '' : " checked='checked'")
164
-			. " />\n<label for='nou'>" . _T('info_creer_base') . "</label></p>\n<p>"
164
+			. " />\n<label for='nou'>"._T('info_creer_base')."</label></p>\n<p>"
165 165
 			. "\n<input type='text' name='table_new' class='text' value=\"spip\" size='20' /></p></fieldset>\n"
166 166
 		)
167 167
 
168 168
 		. ((defined('_INSTALL_TABLE_PREFIX') || $GLOBALS['table_prefix'] != 'spip')
169
-			? '<h3>' . _T('install_table_prefix_hebergeur') . '  <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>'
170
-			: '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n"
171
-			. "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>'
169
+			? '<h3>'._T('install_table_prefix_hebergeur').'  <tt>'.$GLOBALS['table_prefix'].'</tt>'.'</h3>'
170
+			: '<fieldset><legend>'._T('texte_choix_table_prefix')."</legend>\n"
171
+			. "<p><label for='table_prefix'>"._T('info_table_prefix').'</label></p><p>'
172 172
 			. "\n<input type='text' id='tprefix' name='tprefix' class='text' value='"
173 173
 			. 'spip' # valeur par defaut
174 174
 			. "' size='20' /></p></fieldset>"
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') && _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 (str_ends_with($k, '@')) {
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'] && $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
 				&& !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
 }
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
  *     Ressource à utiliser avec sql_fetch()
866 866
  **/
867 867
 function spip_mysql_showbase($match, $serveur = '', $requeter = true) {
868
-	return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter);
868
+	return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter);
869 869
 }
870 870
 
871 871
 /**
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
  *     - true si la requête a réussie, false sinon
882 882
  */
883 883
 function spip_mysql_repair($table, $serveur = '', $requeter = true) {
884
-	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true));
884
+	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = '._q($table), $serveur, true));
885 885
 	$engine = $table_status['Engine'];
886 886
 	if ($engine == 'InnoDB') {
887 887
 		if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) {
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	} elseif ($engine == 'MyISAM') {
891 891
 		return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter);
892 892
 	} else {
893
-		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG);
893
+		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.'._LOG_DEBUG);
894 894
 	}
895 895
 	return false;
896 896
 }
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
  *     - string : requete sql, si $requeter = true
911 911
  **/
912 912
 function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) {
913
-	$r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter);
913
+	$r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter);
914 914
 	if (!$requeter) {
915 915
 		return $r;
916 916
 	}
@@ -992,22 +992,22 @@  discard block
 block discarded – undo
992 992
 			}
993 993
 			if ($val['Default'] === '0' || $val['Default']) {
994 994
 				if (preg_match('/[A-Z_]/', $val['Default'])) {
995
-					$nfields[$val['Field']] .= ' DEFAULT ' . $val['Default'];
995
+					$nfields[$val['Field']] .= ' DEFAULT '.$val['Default'];
996 996
 				} else {
997
-					$nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'";
997
+					$nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'";
998 998
 				}
999 999
 			}
1000 1000
 			if ($val['Extra']) {
1001
-				$nfields[$val['Field']] .= ' ' . $val['Extra'];
1001
+				$nfields[$val['Field']] .= ' '.$val['Extra'];
1002 1002
 			}
1003 1003
 			if ($val['Key'] == 'PRI') {
1004 1004
 				$nkeys['PRIMARY KEY'] = $val['Field'];
1005 1005
 			} else {
1006 1006
 				if ($val['Key'] == 'MUL') {
1007
-					$nkeys['KEY ' . $val['Field']] = $val['Field'];
1007
+					$nkeys['KEY '.$val['Field']] = $val['Field'];
1008 1008
 				} else {
1009 1009
 					if ($val['Key'] == 'UNI') {
1010
-						$nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field'];
1010
+						$nkeys['UNIQUE KEY '.$val['Field']] = $val['Field'];
1011 1011
 					}
1012 1012
 				}
1013 1013
 			}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 	$serveur = '',
1084 1084
 	$requeter = true
1085 1085
 ) {
1086
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1086
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
1087 1087
 
1088 1088
 	$r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1089 1089
 	if (!$requeter) {
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 	if ($s) {
1124 1124
 		$trace = debug_backtrace();
1125 1125
 		if ($trace[0]['function'] != 'spip_mysql_error') {
1126
-			spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1126
+			spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR);
1127 1127
 		}
1128 1128
 	}
1129 1129
 
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 	try {
1254 1254
 		$insert = mysqli_query($link, $query);
1255 1255
 	} catch (\mysqli_sql_exception $e) {
1256
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
1256
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
1257 1257
 		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
1258 1258
 		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
1259 1259
 	}
@@ -1308,8 +1308,8 @@  discard block
 block discarded – undo
1308 1308
 
1309 1309
 	return spip_mysql_insert(
1310 1310
 		$table,
1311
-		'(' . join(',', array_keys($couples)) . ')',
1312
-		'(' . join(',', $couples) . ')',
1311
+		'('.join(',', array_keys($couples)).')',
1312
+		'('.join(',', $couples).')',
1313 1313
 		$desc,
1314 1314
 		$serveur,
1315 1315
 		$requeter
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 	}
1347 1347
 	$fields = $desc['field'] ?? [];
1348 1348
 
1349
-	$cles = '(' . join(',', array_keys(reset($tab_couples))) . ')';
1349
+	$cles = '('.join(',', array_keys(reset($tab_couples))).')';
1350 1350
 	$valeurs = [];
1351 1351
 	$r = false;
1352 1352
 
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
 		foreach ($couples as $champ => $val) {
1356 1356
 			$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1357 1357
 		}
1358
-		$valeurs[] = '(' . join(',', $couples) . ')';
1358
+		$valeurs[] = '('.join(',', $couples).')';
1359 1359
 		if (count($valeurs) >= 100) {
1360 1360
 			$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1361 1361
 			$valeurs = [];
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) {
1393 1393
 	$set = [];
1394 1394
 	foreach ($champs as $champ => $val) {
1395
-		$set[] = $champ . "=$val";
1395
+		$set[] = $champ."=$val";
1396 1396
 	}
1397 1397
 	if (!empty($set)) {
1398 1398
 		return spip_mysql_query(
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 	}
1450 1450
 	$set = [];
1451 1451
 	foreach ($champs as $champ => $val) {
1452
-		$set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1452
+		$set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]);
1453 1453
 	}
1454 1454
 
1455 1455
 	return spip_mysql_query(
@@ -1518,10 +1518,10 @@  discard block
 block discarded – undo
1518 1518
  *     - false en cas d'erreur.
1519 1519
  **/
1520 1520
 function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) {
1521
-	return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1521
+	return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join(
1522 1522
 		',',
1523 1523
 		array_map('_q', $couples)
1524
-	) . ')', $serveur, $requeter);
1524
+	).')', $serveur, $requeter);
1525 1525
 }
1526 1526
 
1527 1527
 
@@ -1550,10 +1550,10 @@  discard block
 block discarded – undo
1550 1550
  *     - false en cas d'erreur.
1551 1551
  **/
1552 1552
 function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) {
1553
-	$cles = '(' . join(',', array_keys($tab_couples[0])) . ')';
1553
+	$cles = '('.join(',', array_keys($tab_couples[0])).')';
1554 1554
 	$valeurs = [];
1555 1555
 	foreach ($tab_couples as $couples) {
1556
-		$valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1556
+		$valeurs[] = '('.join(',', array_map('_q', $couples)).')';
1557 1557
 	}
1558 1558
 	$valeurs = implode(', ', $valeurs);
1559 1559
 
@@ -1573,28 +1573,28 @@  discard block
 block discarded – undo
1573 1573
  */
1574 1574
 function spip_mysql_multi($objet, $lang) {
1575 1575
 	$lengthlang = strlen("[$lang]");
1576
-	$posmulti = 'INSTR(' . $objet . ", '<multi>')";
1577
-	$posfinmulti = 'INSTR(' . $objet . ", '</multi>')";
1578
-	$debutchaine = 'LEFT(' . $objet . ", $posmulti-1)";
1579
-	$finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))";
1580
-	$chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1581
-	$poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1576
+	$posmulti = 'INSTR('.$objet.", '<multi>')";
1577
+	$posfinmulti = 'INSTR('.$objet.", '</multi>')";
1578
+	$debutchaine = 'LEFT('.$objet.", $posmulti-1)";
1579
+	$finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))";
1580
+	$chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1581
+	$poslang = "INSTR($chainemulti,'[".$lang."]')";
1582 1582
 	$poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1583
-	$chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1584
-	$posfinlang = 'INSTR(' . $chainelang . ", '[')";
1583
+	$chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1584
+	$posfinlang = 'INSTR('.$chainelang.", '[')";
1585 1585
 	$chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1586 1586
 	//$chainelang = "LEFT($chainelang,$posfinlang-1)";
1587
-	$retour = "(TRIM(IF($posmulti = 0 , " .
1588
-		'     TRIM(' . $objet . '), ' .
1589
-		'     CONCAT( ' .
1590
-		"          $debutchaine, " .
1591
-		'          IF( ' .
1592
-		"               $poslang = 0, " .
1593
-		"                     $chainemulti, " .
1594
-		"               $chainelang" .
1595
-		'          ), ' .
1596
-		"          $finchaine" .
1597
-		'     ) ' .
1587
+	$retour = "(TRIM(IF($posmulti = 0 , ".
1588
+		'     TRIM('.$objet.'), '.
1589
+		'     CONCAT( '.
1590
+		"          $debutchaine, ".
1591
+		'          IF( '.
1592
+		"               $poslang = 0, ".
1593
+		"                     $chainemulti, ".
1594
+		"               $chainelang".
1595
+		'          ), '.
1596
+		"          $finchaine".
1597
+		'     ) '.
1598 1598
 		'))) AS multi';
1599 1599
 
1600 1600
 	return $retour;
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
  *     Valeur hexadécimale pour MySQL
1612 1612
  **/
1613 1613
 function spip_mysql_hex($v) {
1614
-	return '0x' . $v;
1614
+	return '0x'.$v;
1615 1615
 }
1616 1616
 
1617 1617
 /**
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
  *     Expression SQL
1652 1652
  **/
1653 1653
 function spip_mysql_date_proche($champ, $interval, $unite) {
1654
-	$use_now = ( ($champ === 'maj' || strpos($champ, '.maj')) ? true : false );
1654
+	$use_now = (($champ === 'maj' || strpos($champ, '.maj')) ? true : false);
1655 1655
 	return '('
1656 1656
 	. $champ
1657 1657
 	. (($interval <= 0) ? '>' : '<')
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
 		} elseif ($v === null) {
1707 1707
 			return "''";
1708 1708
 		}
1709
-		return "'" . addslashes($v) . "'";
1709
+		return "'".addslashes($v)."'";
1710 1710
 	}
1711 1711
 
1712 1712
 	if ($v === null) {
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 		}
1731 1731
 	}
1732 1732
 
1733
-	return ("'" . addslashes($v) . "'");
1733
+	return ("'".addslashes($v)."'");
1734 1734
 }
1735 1735
 
1736 1736
 /**
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
 	} else {
1765 1765
 		$GLOBALS['mysql_rappel_nom_base'] = false;
1766 1766
 
1767
-		return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1767
+		return "\$GLOBALS['mysql_rappel_nom_base'] = false; ".
1768 1768
 		"/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1769 1769
 	}
1770 1770
 }
Please login to merge, or discard this patch.