Completed
Push — master ( f512ef...722af0 )
by cam
01:03
created
ecrire/public/decompiler.php 1 patch
Spacing   +18 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	$type .= ($struct->type_requete ?: $struct->table_optionnelle);
30 30
 
31 31
 	if ($struct->jointures_explicites) {
32
-		$type .= ' ' . $struct->jointures_explicites;
32
+		$type .= ' '.$struct->jointures_explicites;
33 33
 	}
34 34
 	if ($struct->table_optionnelle) {
35 35
 		$type .= '?';
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 
39 39
 	$crit = $struct->param;
40 40
 	if ($crit and !is_array($crit[0])) {
41
-		$type = strtolower($type) . array_shift($crit);
41
+		$type = strtolower($type).array_shift($crit);
42 42
 	}
43 43
 	$crit = decompiler_criteres($struct, $fmt, $prof);
44 44
 
45
-	$f = 'format_boucle_' . $fmt;
45
+	$f = 'format_boucle_'.$fmt;
46 46
 
47 47
 	return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof);
48 48
 }
@@ -55,21 +55,20 @@  discard block
 block discarded – undo
55 55
 			$res[] = decompiler_($v, $fmt, $prof);
56 56
 		}
57 57
 	}
58
-	$file = is_string($struct->texte) ? $struct->texte :
59
-		decompiler_($struct->texte, $fmt, $prof);
60
-	$f = 'format_inclure_' . $fmt;
58
+	$file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof);
59
+	$f = 'format_inclure_'.$fmt;
61 60
 
62 61
 	return $f($file, $res, $prof);
63 62
 }
64 63
 
65 64
 function decompiler_texte($struct, $fmt = '', $prof = 0) {
66
-	$f = 'format_texte_' . $fmt;
65
+	$f = 'format_texte_'.$fmt;
67 66
 
68 67
 	return strlen($struct->texte) ? $f($struct->texte, $prof) : '';
69 68
 }
70 69
 
71 70
 function decompiler_polyglotte($struct, $fmt = '', $prof = 0) {
72
-	$f = 'format_polyglotte_' . $fmt;
71
+	$f = 'format_polyglotte_'.$fmt;
73 72
 
74 73
 	return $f($struct->traductions, $prof);
75 74
 }
@@ -82,7 +81,7 @@  discard block
 block discarded – undo
82 81
 
83 82
 	$filtres = decompiler_liste($struct->param, $fmt, $prof);
84 83
 
85
-	$f = 'format_idiome_' . $fmt;
84
+	$f = 'format_idiome_'.$fmt;
86 85
 
87 86
 	return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof);
88 87
 }
@@ -97,7 +96,7 @@  discard block
 block discarded – undo
97 96
 		}
98 97
 		$filtres = decompiler_liste($p, $fmt, $prof);
99 98
 	}
100
-	$f = 'format_champ_' . $fmt;
99
+	$f = 'format_champ_'.$fmt;
101 100
 
102 101
 	return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof);
103 102
 }
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
 	if (!is_array($sources)) {
107 106
 		return '';
108 107
 	}
109
-	$f = 'format_liste_' . $fmt;
108
+	$f = 'format_liste_'.$fmt;
110 109
 	$res = '';
111 110
 	foreach ($sources as $arg) {
112 111
 		if (!is_array($arg)) {
@@ -123,7 +122,7 @@  discard block
 block discarded – undo
123 122
 				and (strlen($v[0]->apres) == 1)
124 123
 				and $v[0]->apres == $v[0]->avant
125 124
 			) {
126
-				$args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres;
125
+				$args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres;
127 126
 			} else {
128 127
 				$args[] = decompiler_($v, $fmt, 0 - $prof);
129 128
 			}
@@ -146,7 +145,7 @@  discard block
 block discarded – undo
146 145
 		return '';
147 146
 	}
148 147
 	$res = '';
149
-	$f = 'format_critere_' . $fmt;
148
+	$f = 'format_critere_'.$fmt;
150 149
 	foreach ($sources as $crit) {
151 150
 		if (!is_array($crit)) {
152 151
 			continue;
@@ -159,13 +158,13 @@  discard block
 block discarded – undo
159 158
 				and $v[0]->type == 'texte'
160 159
 				and $v[0]->apres
161 160
 			) {
162
-				$args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]];
161
+				$args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]];
163 162
 			} else {
164 163
 				$res2 = [];
165 164
 				foreach ($v as $k => $p) {
166 165
 					if (
167 166
 						isset($p->type)
168
-						and function_exists($d = 'decompiler_' . $p->type)
167
+						and function_exists($d = 'decompiler_'.$p->type)
169 168
 					) {
170 169
 						$r = $d($p, $fmt, (0 - $prof));
171 170
 						$res2[] = [$p->type, $r];
@@ -193,7 +192,7 @@  discard block
 block discarded – undo
193 192
 		if (!isset($p->type)) {
194 193
 			continue;
195 194
 		} #??????
196
-		$d = 'decompiler_' . $p->type;
195
+		$d = 'decompiler_'.$p->type;
197 196
 		$next = $liste[$k + 1] ?? false;
198 197
 		// Forcer le champ etendu si son source (pas les reecritures)
199 198
 		// contenait des args et s'il est suivi d'espaces,
@@ -218,16 +217,16 @@  discard block
 block discarded – undo
218 217
 		}
219 218
 		$contenu[] = [$d($p, $fmt, $prof2), $p->type];
220 219
 	}
221
-	$f = 'format_suite_' . $fmt;
220
+	$f = 'format_suite_'.$fmt;
222 221
 
223 222
 	return $f($contenu);
224 223
 }
225 224
 
226 225
 function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') {
227
-	if (!include_spip('public/format_' . $fmt)) {
226
+	if (!include_spip('public/format_'.$fmt)) {
228 227
 		return "'$fmt'?";
229 228
 	}
230
-	$f = 'decompiler_' . $quoi;
229
+	$f = 'decompiler_'.$quoi;
231 230
 
232 231
 	return $f($liste, $fmt, $prof);
233 232
 }
Please login to merge, or discard this patch.
ecrire/inc/queue.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	$md5args = md5($arguments);
71 71
 
72 72
 	// si pas de date programee, des que possible
73
-	$duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND ';
73
+	$duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND ';
74 74
 	if (!$time) {
75 75
 		$time = time();
76 76
 		$duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution
@@ -96,9 +96,8 @@  discard block
 block discarded – undo
96 96
 			'id_job',
97 97
 			'spip_jobs',
98 98
 			$duplicate_where =
99
-				$duplicate_where . 'fonction=' . sql_quote($function)
100
-				. (($no_duplicate === 'function_only') ? '' :
101
-			' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file))
99
+				$duplicate_where.'fonction='.sql_quote($function)
100
+				. (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file))
102 101
 		)
103 102
 	) {
104 103
 		return $id_job;
@@ -111,9 +110,9 @@  discard block
 block discarded – undo
111 110
 	if (
112 111
 		$no_duplicate
113 112
 		and
114
-		$id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where")
113
+		$id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where")
115 114
 	) {
116
-		sql_delete('spip_jobs', 'id_job=' . intval($id_job));
115
+		sql_delete('spip_jobs', 'id_job='.intval($id_job));
117 116
 
118 117
 		return $id_prev;
119 118
 	}
@@ -125,9 +124,9 @@  discard block
 block discarded – undo
125 124
 	// ie cas d'un char non acceptables sur certains type de champs
126 125
 	// qui coupe la valeur
127 126
 	if (defined('_JQ_INSERT_CHECK_ARGS') and $id_job) {
128
-		$args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job));
127
+		$args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job));
129 128
 		if ($args !== $arguments) {
130
-			spip_log('arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' . var_export(
129
+			spip_log('arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : '.var_export(
131 130
 				$arguments,
132 131
 				true
133 132
 			), 'queue');
@@ -157,7 +156,7 @@  discard block
 block discarded – undo
157 156
 function queue_purger() {
158 157
 	include_spip('base/abstract_sql');
159 158
 	sql_delete('spip_jobs');
160
-	sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')');
159
+	sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')');
161 160
 	include_spip('inc/genie');
162 161
 	genie_queue_watch_dist();
163 162
 }
@@ -173,8 +172,8 @@  discard block
 block discarded – undo
173 172
 	include_spip('base/abstract_sql');
174 173
 
175 174
 	if (
176
-		$row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job))
177
-		and $res = sql_delete('spip_jobs', 'id_job=' . intval($id_job))
175
+		$row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job))
176
+		and $res = sql_delete('spip_jobs', 'id_job='.intval($id_job))
178 177
 	) {
179 178
 		queue_unlink_job($id_job);
180 179
 		// est-ce une tache cron qu'il faut relancer ?
@@ -224,7 +223,7 @@  discard block
 block discarded – undo
224 223
  *  resultat du sql_delete
225 224
  */
226 225
 function queue_unlink_job($id_job) {
227
-	return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job));
226
+	return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job));
228 227
 }
229 228
 
230 229
 /**
@@ -240,7 +239,7 @@  discard block
 block discarded – undo
240 239
 	// deserialiser les arguments
241 240
 	$args = unserialize($row['args']);
242 241
 	if (!is_array($args)) {
243
-		spip_log('arguments job errones ' . var_export($row, true), 'queue');
242
+		spip_log('arguments job errones '.var_export($row, true), 'queue');
244 243
 		$args = [];
245 244
 	}
246 245
 
@@ -257,14 +256,14 @@  discard block
 block discarded – undo
257 256
 	}
258 257
 
259 258
 	if (!function_exists($fonction)) {
260
-		spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue');
259
+		spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue');
261 260
 
262 261
 		return false;
263 262
 	}
264 263
 
265
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue');
264
+	spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue');
266 265
 	$res = $fonction(...$args);
267
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue');
266
+	spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue');
268 267
 
269 268
 	return $res;
270 269
 }
@@ -295,14 +294,14 @@  discard block
 block discarded – undo
295 294
 function queue_schedule($force_jobs = null) {
296 295
 	$time = time();
297 296
 	if (defined('_DEBUG_BLOCK_QUEUE')) {
298
-		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG);
297
+		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG);
299 298
 
300 299
 		return;
301 300
 	}
302 301
 
303 302
 	// rien a faire si le prochain job est encore dans le futur
304 303
 	if (queue_sleep_time_to_next_job() > 0 and (!$force_jobs or !count($force_jobs))) {
305
-		spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG);
304
+		spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG);
306 305
 
307 306
 		return;
308 307
 	}
@@ -323,7 +322,7 @@  discard block
 block discarded – undo
323 322
 	}
324 323
 	$end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE;
325 324
 
326
-	spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG);
325
+	spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG);
327 326
 
328 327
 	if (!defined('_JQ_MAX_JOBS_EXECUTE')) {
329 328
 		define('_JQ_MAX_JOBS_EXECUTE', 200);
@@ -337,19 +336,19 @@  discard block
 block discarded – undo
337 336
 	// lorsqu'un job cron n'a pas fini, sa priorite est descendue
338 337
 	// pour qu'il ne bloque pas les autres jobs en attente
339 338
 	if (is_array($force_jobs) and count($force_jobs)) {
340
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs);
339
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs);
341 340
 	} else {
342 341
 		$now = date('Y-m-d H:i:s', $time);
343
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now);
342
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now);
344 343
 	}
345 344
 
346 345
 	register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible
347
-	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1));
346
+	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1));
348 347
 	do {
349 348
 		if ($row = array_shift($res)) {
350 349
 			$nbj++;
351 350
 			// il faut un verrou, a base de sql_delete
352
-			if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) {
351
+			if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) {
353 352
 				#spip_log("JQ schedule job ".$nbj." OK",'jq');
354 353
 				// on reinsert dans la base aussitot avec un status=_JQ_PENDING
355 354
 				$row['status'] = _JQ_PENDING;
@@ -364,13 +363,13 @@  discard block
 block discarded – undo
364 363
 				queue_close_job($row, $time, $result);
365 364
 			}
366 365
 		}
367
-		spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG);
366
+		spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG);
368 367
 	} while ($nbj < _JQ_MAX_JOBS_EXECUTE and $row and $time < $end_time);
369
-	spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG);
368
+	spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG);
370 369
 
371 370
 	if ($row = array_shift($res)) {
372 371
 		queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP
373
-		spip_log('JQ encore !', 'jq' . _LOG_DEBUG);
372
+		spip_log('JQ encore !', 'jq'._LOG_DEBUG);
374 373
 	} else {
375 374
 		queue_update_next_job_time();
376 375
 	}
@@ -405,9 +404,9 @@  discard block
 block discarded – undo
405 404
 		}
406 405
 	}
407 406
 	// purger ses liens eventuels avec des objets
408
-	sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job']));
407
+	sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job']));
409 408
 	// supprimer le job fini
410
-	sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']));
409
+	sql_delete('spip_jobs', 'id_job='.intval($row['id_job']));
411 410
 }
412 411
 
413 412
 /**
@@ -480,18 +479,18 @@  discard block
 block discarded – undo
480 479
 	$res = sql_allfetsel(
481 480
 		'*',
482 481
 		'spip_jobs',
483
-		'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180))
482
+		'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180))
484 483
 	);
485 484
 	if (is_array($res)) {
486 485
 		foreach ($res as $row) {
487 486
 			queue_close_job($row, $time);
488
-			spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, 1), 'job_mort' . _LOG_ERREUR);
487
+			spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, 1), 'job_mort'._LOG_ERREUR);
489 488
 		}
490 489
 	}
491 490
 
492 491
 	// chercher la date du prochain job si pas connu
493 492
 	if (is_null($next) or is_null(queue_sleep_time_to_next_job())) {
494
-		$date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1');
493
+		$date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1');
495 494
 		$next = strtotime($date);
496 495
 	}
497 496
 	if (!is_null($next_time)) {
@@ -504,7 +503,7 @@  discard block
 block discarded – undo
504 503
 		if (is_null($nb_jobs_scheduled)) {
505 504
 			$nb_jobs_scheduled = sql_countsel(
506 505
 				'spip_jobs',
507
-				'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time))
506
+				'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time))
508 507
 			);
509 508
 		} elseif ($next <= $time) {
510 509
 			$nb_jobs_scheduled++;
@@ -573,7 +572,7 @@  discard block
 block discarded – undo
573 572
 	}
574 573
 
575 574
 	// ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent
576
-	if (file_exists($lock = _DIR_TMP . 'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
575
+	if (file_exists($lock = _DIR_TMP.'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
577 576
 		return $texte;
578 577
 	}
579 578
 
@@ -645,7 +644,7 @@  discard block
 block discarded – undo
645 644
 				$port = 80;
646 645
 		}
647 646
 		$fp = @fsockopen(
648
-			$scheme . $parts['host'],
647
+			$scheme.$parts['host'],
649 648
 			$parts['port'] ?? $port,
650 649
 			$errno,
651 650
 			$errstr,
@@ -655,13 +654,13 @@  discard block
 block discarded – undo
655 654
 		if ($fp) {
656 655
 			$host_sent = $parts['host'];
657 656
 			if (isset($parts['port']) and $parts['port'] !== $port) {
658
-				$host_sent .= ':' . $parts['port'];
657
+				$host_sent .= ':'.$parts['port'];
659 658
 			}
660 659
 			$timeout = 200; // ms
661 660
 			stream_set_timeout($fp, 0, $timeout * 1000);
662
-			$query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : '');
663
-			$out = 'GET ' . $query . " HTTP/1.1\r\n";
664
-			$out .= 'Host: ' . $host_sent . "\r\n";
661
+			$query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : '');
662
+			$out = 'GET '.$query." HTTP/1.1\r\n";
663
+			$out .= 'Host: '.$host_sent."\r\n";
665 664
 			$out .= "Connection: Close\r\n\r\n";
666 665
 			fwrite($fp, $out);
667 666
 			spip_timer('read');
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
  */
359 359
 function balise_DOSSIER_SQUELETTE_dist($p) {
360 360
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
361
-	$p->code = "_DIR_RACINE . '$code'" .
361
+	$p->code = "_DIR_RACINE . '$code'".
362 362
 		$p->interdire_scripts = false;
363 363
 
364 364
 	return $p;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
  */
378 378
 function balise_SQUELETTE_dist($p) {
379 379
 	$code = addslashes($p->descr['sourcefile']);
380
-	$p->code = "'$code'" .
380
+	$p->code = "'$code'".
381 381
 		$p->interdire_scripts = false;
382 382
 
383 383
 	return $p;
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
  **/
430 430
 function balise_NOM_SITE_dist($p) {
431 431
 	if (!$p->etoile) {
432
-		$p->code = 'supprimer_numero(calculer_url(' .
433
-			champ_sql('url_site', $p) . ',' .
434
-			champ_sql('nom_site', $p) .
432
+		$p->code = 'supprimer_numero(calculer_url('.
433
+			champ_sql('url_site', $p).','.
434
+			champ_sql('nom_site', $p).
435 435
 			", 'titre', \$connect, false))";
436 436
 	} else {
437 437
 		$p->code = champ_sql('nom_site', $p);
@@ -582,8 +582,8 @@  discard block
 block discarded – undo
582 582
  *     Pile complétée par le code à générer
583 583
  **/
584 584
 function balise_POPULARITE_ABSOLUE_dist($p) {
585
-	$p->code = 'ceil(' .
586
-		champ_sql('popularite', $p) .
585
+	$p->code = 'ceil('.
586
+		champ_sql('popularite', $p).
587 587
 		')';
588 588
 	$p->interdire_scripts = false;
589 589
 
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);
665 665
 ;
666 666
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
667
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
667
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
668 668
 	}
669 669
 	$p->interdire_scripts = true;
670 670
 
@@ -804,16 +804,16 @@  discard block
 block discarded – undo
804 804
 	$trouver_table = charger_fonction('trouver_table', 'base');
805 805
 	if ($desc = $trouver_table(table_objet_sql($type_objet))) {
806 806
 		if (isset($desc['field']['descriptif'])) {
807
-			$_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ',';
807
+			$_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).',';
808 808
 		}
809 809
 		if (isset($desc['field']['texte'])) {
810
-			$_ligne .= "'texte' => " . champ_sql('texte', $p) . ',';
810
+			$_ligne .= "'texte' => ".champ_sql('texte', $p).',';
811 811
 		}
812 812
 		if (isset($desc['field']['chapo'])) {
813
-			$_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ',';
813
+			$_ligne .= "'chapo' => ".champ_sql('chapo', $p).',';
814 814
 		}
815 815
 		if (isset($desc['introduction_longueur'])) {
816
-			$_introduction_longueur = "'" . $desc['introduction_longueur'] . "'";
816
+			$_introduction_longueur = "'".$desc['introduction_longueur']."'";
817 817
 		}
818 818
 	}
819 819
 	$_ligne .= ')';
@@ -909,10 +909,10 @@  discard block
 block discarded – undo
909 909
 		$p->code = sprintf(
910 910
 			CODE_RECUPERER_FOND,
911 911
 			"'modeles/lesauteurs'",
912
-			"array('objet'=>'" . $objet .
913
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
914
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
915
-			($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) .
912
+			"array('objet'=>'".$objet.
913
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
914
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
915
+			($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)).
916 916
 			')',
917 917
 			"'trim'=>true, 'compil'=>array($c)",
918 918
 			_q($connect)
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
 					$m = trim($m);
982 982
 					if ($m != "''") {
983 983
 						if (!preg_match(',\W,', $m)) {
984
-							$m = $boucle->id_table . ".$m";
984
+							$m = $boucle->id_table.".$m";
985 985
 						}
986 986
 
987 987
 						$m .= ' AS titre_rang';
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 	$f_pagination = chercher_filtre('pagination');
1143 1143
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1144 1144
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1145
-		: ("'debut" . substr($type, 1));
1145
+		: ("'debut".substr($type, 1));
1146 1146
 
1147 1147
 	$p->code = sprintf(
1148 1148
 		CODE_PAGINATION,
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']];
1286 1286
 		erreur_squelette($msg, $p);
1287 1287
 	} else {
1288
-		$p->code = 'find_in_path((string)' . $arg . ')';
1288
+		$p->code = 'find_in_path((string)'.$arg.')';
1289 1289
 	}
1290 1290
 
1291 1291
 	$p->interdire_scripts = false;
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']];
1321 1321
 		erreur_squelette($msg, $p);
1322 1322
 	} else {
1323
-		$p->code = 'chemin_image((string)' . $arg . ')';
1323
+		$p->code = 'chemin_image((string)'.$arg.')';
1324 1324
 	}
1325 1325
 
1326 1326
 	$p->interdire_scripts = false;
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1375 1375
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1376 1376
 		if ($src) {
1377
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1377
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1378 1378
 		} else {
1379 1379
 			$p->code = 'serialize($Pile[0]??[])';
1380 1380
 		}
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
 	$_sinon = interprete_argument_balise(2, $p);
1428 1428
 	$_unserialize = sinon(interprete_argument_balise(3, $p), 'false');
1429 1429
 
1430
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1431
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1430
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1431
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1432 1432
 
1433 1433
 	return $p;
1434 1434
 }
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 		$err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']];
1522 1522
 		erreur_squelette($err_b_s_a, $p);
1523 1523
 	} else {
1524
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1524
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1525 1525
 	}
1526 1526
 
1527 1527
 	$p->interdire_scripts = false;
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
 			)
1570 1570
 		) {
1571 1571
 			$p->code = /* $r[1]. */
1572
-				'(' . $r[2] . ')';
1572
+				'('.$r[2].')';
1573 1573
 		} else {
1574 1574
 			$p->code = "eval('return '.$php.';')";
1575 1575
 		}
@@ -1813,9 +1813,9 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
 		// noter la duree du cache dans un entete proprietaire
1815 1815
 
1816
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1816
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1817 1817
 			. $duree
1818
-			. '"); ?' . "'.'>'";
1818
+			. '"); ?'."'.'>'";
1819 1819
 
1820 1820
 		// Remplir le header Cache-Control
1821 1821
 		// cas #CACHE{0}
@@ -1836,9 +1836,9 @@  discard block
 block discarded – undo
1836 1836
 				$pa == 'cache-client'
1837 1837
 				and $duree > 0
1838 1838
 			) {
1839
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1839
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1840 1840
 					. $duree
1841
-					. '"); ?' . "'.'>'";
1841
+					. '"); ?'."'.'>'";
1842 1842
 				// il semble logique, si on cache-client, de ne pas invalider
1843 1843
 				$pa = 'statique';
1844 1844
 			}
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
 				$pa == 'statique'
1848 1848
 				and $duree > 0
1849 1849
 			) {
1850
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1850
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1851 1851
 			}
1852 1852
 		}
1853 1853
 	} else {
@@ -2011,9 +2011,9 @@  discard block
 block discarded – undo
2011 2011
 		if ($p->etoile) {
2012 2012
 			$_options[] = "'etoile'=>true";
2013 2013
 		}
2014
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')';
2014
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')';
2015 2015
 
2016
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2016
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2017 2017
 		if ($flag_env) {
2018 2018
 			$_l = "array_merge(\$Pile[0],$_l)";
2019 2019
 		}
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']];
2024 2024
 		erreur_squelette($msg, $p);
2025 2025
 	} else {
2026
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2026
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2027 2027
 	}
2028 2028
 
2029 2029
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 		unset($_contexte[1]);
2072 2072
 
2073 2073
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2074
-			$nom = "'modeles/" . substr($nom, 1);
2074
+			$nom = "'modeles/".substr($nom, 1);
2075 2075
 		} else {
2076 2076
 			$nom = "'modeles/' . $nom";
2077 2077
 		}
@@ -2088,8 +2088,8 @@  discard block
 block discarded – undo
2088 2088
 			$primary = $p->boucles[$p->id_boucle]->primary;
2089 2089
 			if (!strpos($primary, ',')) {
2090 2090
 				$id = champ_sql($primary, $p);
2091
-				$_contexte[] = "'$primary'=>" . $id;
2092
-				$_contexte[] = "'id'=>" . $id;
2091
+				$_contexte[] = "'$primary'=>".$id;
2092
+				$_contexte[] = "'id'=>".$id;
2093 2093
 			}
2094 2094
 		}
2095 2095
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2101,11 +2101,11 @@  discard block
 block discarded – undo
2101 2101
 		$_options = memoriser_contexte_compil($p);
2102 2102
 		$_options = "'compil'=>array($_options), 'trim'=>true";
2103 2103
 		if (isset($_contexte['ajax'])) {
2104
-			$_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2104
+			$_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2105 2105
 			unset($_contexte['ajax']);
2106 2106
 		}
2107 2107
 
2108
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2108
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2109 2109
 		if ($flag_env) {
2110 2110
 			$_l = "array_merge(\$Pile[0],$_l)";
2111 2111
 		}
@@ -2215,12 +2215,12 @@  discard block
 block discarded – undo
2215 2215
 function balise_DOUBLONS_dist($p) {
2216 2216
 	if ($type = interprete_argument_balise(1, $p)) {
2217 2217
 		if ($famille = interprete_argument_balise(2, $p)) {
2218
-			$type .= '.' . $famille;
2218
+			$type .= '.'.$famille;
2219 2219
 		}
2220
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2220
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2221 2221
 		if (!$p->etoile) {
2222 2222
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2223
-				. $p->code . ')))';
2223
+				. $p->code.')))';
2224 2224
 		}
2225 2225
 	} else {
2226 2226
 		$p->code = '$doublons';
@@ -2349,7 +2349,7 @@  discard block
 block discarded – undo
2349 2349
 			$_code[] = "$_key => $_val";
2350 2350
 		}
2351 2351
 	} while ($_key && $_val);
2352
-	$p->code = 'array(' . join(', ', $_code) . ')';
2352
+	$p->code = 'array('.join(', ', $_code).')';
2353 2353
 	$p->interdire_scripts = false;
2354 2354
 
2355 2355
 	return $p;
@@ -2376,7 +2376,7 @@  discard block
 block discarded – undo
2376 2376
 	while ($_val = interprete_argument_balise($n++, $p)) {
2377 2377
 		$_code[] = $_val;
2378 2378
 	}
2379
-	$p->code = 'array(' . join(', ', $_code) . ')';
2379
+	$p->code = 'array('.join(', ', $_code).')';
2380 2380
 	$p->interdire_scripts = false;
2381 2381
 
2382 2382
 	return $p;
@@ -2421,10 +2421,10 @@  discard block
 block discarded – undo
2421 2421
 		$_code[] = $_v;
2422 2422
 	}
2423 2423
 
2424
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(
2424
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(
2425 2425
 		', ',
2426 2426
 		$_code
2427
-	) . ')?" ":"")';
2427
+	).')?" ":"")';
2428 2428
 	$p->interdire_scripts = false;
2429 2429
 
2430 2430
 	return $p;
@@ -2457,7 +2457,7 @@  discard block
 block discarded – undo
2457 2457
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2458 2458
 
2459 2459
 	$f = chercher_filtre('info_plugin');
2460
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2460
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2461 2461
 
2462 2462
 	return $p;
2463 2463
 }
@@ -2709,12 +2709,12 @@  discard block
 block discarded – undo
2709 2709
 	$_issens = "in_array($_champ,array('>','<'))";
2710 2710
 	$_sens = "(strpos('< >',$_champ)-1)";
2711 2711
 
2712
-	$_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom'];
2712
+	$_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom'];
2713 2713
 	$_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)";
2714
-	$_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')";
2715
-	$_on = '$s?(' . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)";
2714
+	$_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')";
2715
+	$_on = '$s?('.$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)";
2716 2716
 
2717
-	$p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : '') . ')';
2717
+	$p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : '').')';
2718 2718
 	//$p->code = "''";
2719 2719
 	$p->interdire_scripts = false;
2720 2720
 
@@ -2787,7 +2787,7 @@  discard block
 block discarded – undo
2787 2787
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2788 2788
 	}
2789 2789
 
2790
-	$p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')";
2790
+	$p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')";
2791 2791
 	$p->interdire_scripts = false;
2792 2792
 
2793 2793
 	return $p;
Please login to merge, or discard this patch.
ecrire/src/Chiffrer/Chiffrement.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		$nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
32 32
 		$padded_message = sodium_pad($message, 16);
33 33
 		$encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key);
34
-		$encoded = base64_encode($salt . $nonce . $encrypted);
34
+		$encoded = base64_encode($salt.$nonce.$encrypted);
35 35
 		sodium_memzero($key);
36 36
 		sodium_memzero($nonce);
37 37
 		sodium_memzero($salt);
38
-		spip_log("chiffrer($message)=$encoded", 'chiffrer' . _LOG_DEBUG);
38
+		spip_log("chiffrer($message)=$encoded", 'chiffrer'._LOG_DEBUG);
39 39
 		return $encoded;
40 40
 	}
41 41
 
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 		$decoded = base64_decode($encoded);
49 49
 		$salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES);
50 50
 		$nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
51
-		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
51
+		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES +\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
52 52
 		$key = self::deriveKeyFromPassword($key, $salt);
53 53
 		$padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key);
54 54
 		sodium_memzero($key);
55 55
 		sodium_memzero($nonce);
56 56
 		sodium_memzero($salt);
57 57
 		if ($padded_message === false) {
58
-			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG);
58
+			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer'._LOG_DEBUG);
59 59
 			return null;
60 60
 		}
61 61
 		$message = sodium_unpad($padded_message, 16);
62
-		spip_log("dechiffrer($encoded)=$message", 'chiffrer' . _LOG_DEBUG);
62
+		spip_log("dechiffrer($encoded)=$message", 'chiffrer'._LOG_DEBUG);
63 63
 		return $message;
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
ecrire/install/etape_ldap2.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		echo info_etape(
78 78
 			_T('titre_connexion_ldap'),
79 79
 			info_progression_etape(2, 'etape_ldap', 'install/')
80
-		),  _T('info_connexion_ldap_ok');
80
+		), _T('info_connexion_ldap_ok');
81 81
 		echo generer_form_ecrire('install', (
82 82
 			"\n<input type='hidden' name='etape' value='ldap3' />"
83 83
 			. "\n<input type='hidden' name='adresse_ldap' value=\"".spip_htmlspecialchars($adresse_ldap)."\" />"
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 			. bouton_suivant()));
90 90
 	} else {
91 91
 		echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true),
92
-			"<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>',
93
-			'<p>' . _T('avis_connexion_ldap_echec_2') .
94
-			"<br />\n" . _T('avis_connexion_ldap_echec_3') .
95
-			'<br /><br />' . $erreur . '<b> ?</b></p></div>';
92
+			"<div class='error'><p>"._T('avis_connexion_ldap_echec_1').'</p>',
93
+			'<p>'._T('avis_connexion_ldap_echec_2').
94
+			"<br />\n"._T('avis_connexion_ldap_echec_3').
95
+			'<br /><br />'.$erreur.'<b> ?</b></p></div>';
96 96
 	}
97 97
 
98 98
 	echo install_fin_html();
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		if (!$fonc) {
139 139
 			$fonc = $GLOBALS['debug_objets']['principal'];
140 140
 		}
141
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
141
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
142 142
 	}
143 143
 	if ($message === false) {
144 144
 		lang_select();
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	$fond = $GLOBALS['fond'] ?? '';
168 168
 	// une erreur critique sort $message en array
169 169
 	$debug = is_array($msg) ? $msg[1] : $msg;
170
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
170
+	spip_log('Debug: '.$debug.' ('.$fond.')');
171 171
 
172 172
 	return $msg;
173 173
 }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 function debusquer_bandeau($erreurs) {
176 176
 
177 177
 	if (!empty($erreurs)) {
178
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
178
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
179 179
 
180 180
 		return debusquer_navigation($erreurs, $n);
181 181
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -208,25 +208,25 @@  discard block
 block discarded – undo
208 208
 			$valeur_simple = [];
209 209
 			foreach ($valeur as $v) {
210 210
 				if (is_array($v)) {
211
-					$valeur_simple[] = 'array:' . count($v);
211
+					$valeur_simple[] = 'array:'.count($v);
212 212
 				} elseif (is_object($v)) {
213 213
 					$valeur_simple[] = get_class($v);
214 214
 				} elseif (is_string($v)) {
215
-					$valeur_simple[] = "'" . $v . "'";
215
+					$valeur_simple[] = "'".$v."'";
216 216
 				} else {
217 217
 					$valeur_simple[] = $v;
218 218
 				}
219 219
 			}
220 220
 			$n = count($valeur);
221
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
222
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
221
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
222
+			$valeur .= '['.join(', ', $valeur_simple).']';
223 223
 		} elseif (is_object($valeur)) {
224 224
 			$valeur = get_class($valeur);
225 225
 		} elseif (is_string($valeur)) {
226
-			$valeur = "'" . $valeur . "'";
226
+			$valeur = "'".$valeur."'";
227 227
 		}
228
-		$res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom))
229
-			. '</strong></td><td>:&nbsp;' . nl2br((string) entites_html($valeur))
228
+		$res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom))
229
+			. '</strong></td><td>:&nbsp;'.nl2br((string) entites_html($valeur))
230 230
 			. "</td></tr>\n";
231 231
 	}
232 232
 
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
 				$nom_code = $lieu->descr['nom'];
255 255
 				$skel = $lieu->descr['sourcefile'];
256 256
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
257
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
257
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
258 258
 				$skel = "<a href='$h3'><b>$skel</b></a>";
259 259
 				if ($boucle) {
260
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
260
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
261 261
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
262 262
 				}
263 263
 			}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	}
347 347
 
348 348
 	// Requete erronee
349
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
349
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
350 350
 		. spip_htmlspecialchars($msg)
351 351
 		. "\n<br /><span style='color: red'><b>"
352 352
 		. spip_htmlspecialchars($query)
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
362 362
 
363
-	$id = $nom . $boucle;
363
+	$id = $nom.$boucle;
364 364
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
365 365
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
366 366
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		}
407 407
 	}
408 408
 	}
409
-	$incl = ',' . $reg[1] . '[.]\w$,';
409
+	$incl = ','.$reg[1].'[.]\w$,';
410 410
 
411 411
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
412 412
 		if (preg_match($incl, $v)) {
@@ -421,16 +421,13 @@  discard block
 block discarded – undo
421 421
 	[$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom);
422 422
 
423 423
 	if (!$boucle) {
424
-		return !$ligne ? '' :
425
-			(' (' .
426
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
427
-					_T('squelette_ligne')) .
424
+		return !$ligne ? '' : (' ('.
425
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
428 426
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
429 427
 	} else {
430 428
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
431 429
 
432
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
433
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
430
+		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
434 431
 	}
435 432
 }
436 433
 
@@ -452,14 +449,14 @@  discard block
 block discarded – undo
452 449
 
453 450
 	$s = preg_replace(
454 451
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
455
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
452
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
456 453
 		$s
457 454
 	);
458 455
 
459 456
 
460 457
 	$tableau = explode('<br />', $s);
461 458
 
462
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
459
+	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n";
463 460
 
464 461
 	$format10 = str_replace('white', 'lightgrey', $format);
465 462
 	$formaterr = 'color: red;';
@@ -503,7 +500,7 @@  discard block
 block discarded – undo
503 500
 	. '" style="cursor: pointer;">'
504 501
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
505 502
 	. '</div>
506
-	' . $res . "</div>\n";
503
+	' . $res."</div>\n";
507 504
 }
508 505
 
509 506
 // l'environnement graphique du debuggueur
@@ -525,14 +522,14 @@  discard block
 block discarded – undo
525 522
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
526 523
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
527 524
 				$texte .= $res2;
528
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
529
-				$legend = _T('zbug_' . $mode);
530
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
525
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
526
+				$legend = _T('zbug_'.$mode);
527
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
531 528
 				$texte = ancre_texte($texte, ['', '']);
532 529
 			}
533 530
 		} else {
534 531
 			if (strlen(trim($res))) {
535
-				return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
532
+				return "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
536 533
 			} else {
537 534
 				// cas de l'appel sur erreur: montre la page
538 535
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -540,7 +537,7 @@  discard block
 block discarded – undo
540 537
 		}
541 538
 	} else {
542 539
 		$valider = charger_fonction('valider', 'xml');
543
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
540
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
544 541
 		// Si erreur, signaler leur nombre dans le formulaire admin
545 542
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
546 543
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -551,14 +548,14 @@  discard block
 block discarded – undo
551 548
 		} else {
552 549
 			$err = ": $err";
553 550
 		}
554
-		$legend = _T('validation') . ' ' . $err;
551
+		$legend = _T('validation').' '.$err;
555 552
 		$res = $id = '';
556 553
 	}
557 554
 
558 555
 	return !trim($texte) ? '' : (
559
-		"<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
556
+		"<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
560 557
 		. "<div id='debug_boucle'><fieldset$id><legend>"
561
-		. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
558
+		. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
562 559
 		. ($legend ?: $mode)
563 560
 		. '</a></legend>'
564 561
 		. $texte
@@ -569,7 +566,7 @@  discard block
 block discarded – undo
569 566
 
570 567
 function emboite_texte($res, $fonc = '', $self = '') {
571 568
 	$errs = $res->err;
572
-	$texte = $res->entete . ($errs ? '' : $res->page);
569
+	$texte = $res->entete.($errs ? '' : $res->page);
573 570
 
574 571
 	if (!$texte and !$errs) {
575 572
 		return [ancre_texte('', ['', '']), false];
@@ -625,7 +622,7 @@  discard block
 block discarded – undo
625 622
 		$err = "<h2 style='text-align: center'>"
626 623
 			. $i
627 624
 			. "<a href='#fin_err'>"
628
-			. ' ' . _T('erreur_texte')
625
+			. ' '._T('erreur_texte')
629 626
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
630 627
 			. $err
631 628
 			. " </table><a id='fin_err'></a>";
@@ -635,9 +632,9 @@  discard block
 block discarded – undo
635 632
 		[$msg, $fermant, $ouvrant] = $errs[0];
636 633
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
637 634
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
638
-		$err = $msg .
639
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
640
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
635
+		$err = $msg.
636
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
637
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
641 638
 
642 639
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
643 640
 	}
@@ -670,7 +667,7 @@  discard block
 block discarded – undo
670 667
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
671 668
 		);
672 669
 
673
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
670
+		$res .= "<fieldset id='f_".$nom."'><legend>"
674 671
 			. $t_skel
675 672
 			. ' '
676 673
 			. $sourcefile
@@ -685,7 +682,7 @@  discard block
 block discarded – undo
685 682
 			. "'>"
686 683
 			. _T('zbug_calcul')
687 684
 			. '</a></legend>'
688
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
685
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
689 686
 			. debusquer_contexte($contexte[$sourcefile])
690 687
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
691 688
 		. "</fieldset>\n";
@@ -706,33 +703,33 @@  discard block
 block discarded – undo
706 703
 			$nom = $boucle->id_boucle;
707 704
 			$req = $boucle->type_requete;
708 705
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
709
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
710
-
711
-			$res .= "\n<tr style='background-color: " .
712
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
713
-				"'><td  align='right'>$i</td><td>\n" .
714
-				"<a  class='debug_link_boucle' href='" .
715
-				$self2 .
716
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
717
-				_T('zbug_boucle') .
718
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
719
-				$self2 .
720
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
721
-				_T('zbug_resultat') .
722
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
723
-				$self2 .
724
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
725
-				_T('zbug_code') .
726
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
727
-				str_replace('var_mode=', 'var_profile=', $self2) .
728
-				"'>" .
729
-				_T('zbug_calcul') .
730
-				"</a></td><td>\n" .
731
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
732
-				"</td><td>\n" .
733
-				$req .
734
-				"</td><td>\n" .
735
-				spip_htmlspecialchars($crit) .
706
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
707
+
708
+			$res .= "\n<tr style='background-color: ".
709
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
710
+				"'><td  align='right'>$i</td><td>\n".
711
+				"<a  class='debug_link_boucle' href='".
712
+				$self2.
713
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
714
+				_T('zbug_boucle').
715
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
716
+				$self2.
717
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
718
+				_T('zbug_resultat').
719
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
720
+				$self2.
721
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
722
+				_T('zbug_code').
723
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
724
+				str_replace('var_mode=', 'var_profile=', $self2).
725
+				"'>".
726
+				_T('zbug_calcul').
727
+				"</a></td><td>\n".
728
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
729
+				"</td><td>\n".
730
+				$req.
731
+				"</td><td>\n".
732
+				spip_htmlspecialchars($crit).
736 733
 				'</td></tr>';
737 734
 		}
738 735
 	}
@@ -759,7 +756,7 @@  discard block
 block discarded – undo
759 756
 		}
760 757
 		//  permettre le copier/coller facile
761 758
 		// $res = ancre_texte($req, array(), true);
762
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
759
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
763 760
 		//  formatage et affichage des resultats bruts de la requete
764 761
 		$ress_req = spip_query($req);
765 762
 		$brut_sql = '';
@@ -769,10 +766,10 @@  discard block
 block discarded – undo
769 766
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
770 767
 		while ($retours_sql = sql_fetch($ress_req)) {
771 768
 			if ($num <= $max_aff) {
772
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
769
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
773 770
 				$brut_sql .= '<p>';
774 771
 				foreach ($retours_sql as $key => $val) {
775
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
772
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
776 773
 				}
777 774
 				$brut_sql .= '</p>';
778 775
 			}
@@ -783,14 +780,14 @@  discard block
 block discarded – undo
783 780
 			//  ne pas afficher les $contexte_inclus
784 781
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
785 782
 			if ($view) {
786
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
783
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
787 784
 			}
788 785
 		}
789 786
 	} elseif ($affiche == 'code') {
790 787
 		$legend = $nom;
791
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
788
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
792 789
 	} elseif ($affiche == 'boucle') {
793
-		$legend = _T('zbug_boucle') . ' ' . $nom;
790
+		$legend = _T('zbug_boucle').' '.$nom;
794 791
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
795 792
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
796 793
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -808,23 +805,23 @@  discard block
 block discarded – undo
808 805
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
809 806
 	include_spip('inc/texte'); // pour corriger_typo
810 807
 
811
-	return _DOCTYPE_ECRIRE .
812
-	html_lang_attributes() .
813
-	"<head>\n<title>" .
814
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
815
-		_T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' .
816
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
817
-	")</title>\n" .
818
-	"<meta http-equiv='Content-Type' content='text/html" .
819
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
820
-	"' />\n" .
808
+	return _DOCTYPE_ECRIRE.
809
+	html_lang_attributes().
810
+	"<head>\n<title>".
811
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
812
+		_T('admin_debug').' '.spip_htmlspecialchars($titre).' ('.
813
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
814
+	")</title>\n".
815
+	"<meta http-equiv='Content-Type' content='text/html".
816
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
817
+	"' />\n".
821 818
 	http_script('', 'jquery.js')
822
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
823
-	. "' type='text/css' />" .
824
-	"</head>\n" .
825
-	"<body style='margin:0 10px;'>\n" .
826
-	"<div id='spip-debug-header'>" .
827
-	$corps .
828
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
819
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
820
+	. "' type='text/css' />".
821
+	"</head>\n".
822
+	"<body style='margin:0 10px;'>\n".
823
+	"<div id='spip-debug-header'>".
824
+	$corps.
825
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
829 826
 	'</div></body></html>';
830 827
 }
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +122 added lines, -123 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
 /**
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 			translitteration($ancre)
696 696
 		);
697 697
 	}
698
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
698
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
699 699
 }
700 700
 
701 701
 /**
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
  * @return bool
812 812
  */
813 813
 function test_plugin_actif($plugin) {
814
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
814
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
815 815
 }
816 816
 
817 817
 /**
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 					$value = interdire_scripts($value, -1);
944 944
 				}
945 945
 				if (!empty($options['class'])) {
946
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
946
+					$value = "<span class='".$options['class']."'>$value</span>";
947 947
 				}
948 948
 				$text = str_replace("@$name@", $value, $text);
949 949
 				unset($args[$name]);
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 		// Si des variables n'ont pas ete inserees, le signaler
953 953
 		// (chaines de langues pas a jour)
954 954
 		if ($args) {
955
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
955
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
956 956
 		}
957 957
 	}
958 958
 
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 function joli_repertoire($rep) {
977 977
 	$a = substr($rep, 0, 1);
978 978
 	if ($a <> '.' and $a <> '/') {
979
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
979
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
980 980
 	}
981 981
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
982 982
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 			$p -= ($x * 1000);
1031 1031
 		}
1032 1032
 
1033
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1033
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1034 1034
 	}
1035 1035
 }
1036 1036
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 	if ($taches and count($taches) and !spip_connect()) {
1098 1098
 		return false;
1099 1099
 	}
1100
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1100
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1101 1101
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1102 1102
 		return $genie($taches);
1103 1103
 	}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
 	if ($queue_next_job_time == -1) {
1203 1203
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1204
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1204
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1205 1205
 		}
1206 1206
 		// utiliser un cache memoire si dispo
1207 1207
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1270,8 +1270,8 @@  discard block
 block discarded – undo
1270 1270
 		$src = '';
1271 1271
 	}
1272 1272
 	if ($script) {
1273
-		$script = ("/*<![CDATA[*/\n" .
1274
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1273
+		$script = ("/*<![CDATA[*/\n".
1274
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1275 1275
 			'/*]]>*/');
1276 1276
 	}
1277 1277
 	if ($noscript) {
@@ -1357,13 +1357,13 @@  discard block
 block discarded – undo
1357 1357
 	if ($path_base == null) {
1358 1358
 		// Chemin standard depuis l'espace public
1359 1359
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1360
-			_DIR_RACINE . ':' .
1361
-			_DIR_RACINE . 'squelettes-dist/:' .
1362
-			_DIR_RACINE . 'prive/:' .
1360
+			_DIR_RACINE.':'.
1361
+			_DIR_RACINE.'squelettes-dist/:'.
1362
+			_DIR_RACINE.'prive/:'.
1363 1363
 			_DIR_RESTREINT;
1364 1364
 		// Ajouter squelettes/
1365
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1366
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1365
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1366
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1367 1367
 		}
1368 1368
 		foreach (explode(':', $path) as $dir) {
1369 1369
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 		// Et le(s) dossier(s) des squelettes nommes
1376 1376
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1377 1377
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1378
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1378
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1379 1379
 			}
1380 1380
 		}
1381 1381
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 
1387 1387
 	if (is_array($dir_path) or strlen($dir_path)) {
1388 1388
 		$tete = '';
1389
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1389
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1390 1390
 			$tete = array_shift($path_base);
1391 1391
 		}
1392 1392
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 	// Et le(s) dossier(s) des squelettes nommes
1408 1408
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1409 1409
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1410
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1410
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1411 1411
 		}
1412 1412
 	}
1413 1413
 
@@ -1478,14 +1478,14 @@  discard block
 block discarded – undo
1478 1478
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1479 1479
 	if (
1480 1480
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1481
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1481
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1482 1482
 		and $f = find_in_theme("$file_svg_generique")
1483 1483
 	) {
1484
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1484
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1485 1485
 			return $themefiles["$subdir$file"] = $fsize;
1486 1486
 		}
1487 1487
 		else {
1488
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1488
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1489 1489
 		}
1490 1490
 	}
1491 1491
 
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 			return $themefiles["$subdir$file"] = $f;
1496 1496
 		}
1497 1497
 	}
1498
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1498
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1499 1499
 
1500 1500
 	return $themefiles["$subdir$file"] = '';
1501 1501
 }
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 			return false;
1604 1604
 		}
1605 1605
 		if ($include and !isset($inc[$dirname][$file])) {
1606
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1607
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1606
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1607
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1608 1608
 		}
1609 1609
 
1610 1610
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1617,14 +1617,14 @@  discard block
 block discarded – undo
1617 1617
 	}
1618 1618
 
1619 1619
 	foreach (creer_chemin() as $dir) {
1620
-		if (!isset($dirs[$a = $dir . $dirname])) {
1621
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1620
+		if (!isset($dirs[$a = $dir.$dirname])) {
1621
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1622 1622
 		}
1623 1623
 		if ($dirs[$a]) {
1624
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1624
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1625 1625
 				if ($include and !isset($inc[$dirname][$file])) {
1626
-					include_once _ROOT_CWD . $a;
1627
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1626
+					include_once _ROOT_CWD.$a;
1627
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1628 1628
 				}
1629 1629
 				if (!defined('_SAUVER_CHEMIN')) {
1630 1630
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 					define('_SAUVER_CHEMIN', true);
1635 1635
 				}
1636 1636
 
1637
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1637
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1638 1638
 			}
1639 1639
 		}
1640 1640
 	}
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 		define('_SAUVER_CHEMIN', true);
1661 1661
 	}
1662 1662
 
1663
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1663
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1664 1664
 }
1665 1665
 
1666 1666
 function clear_path_cache() {
@@ -1730,12 +1730,12 @@  discard block
 block discarded – undo
1730 1730
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1731 1731
 	// on a pas encore inclus flock.php
1732 1732
 	if (!function_exists('preg_files')) {
1733
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1733
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1734 1734
 	}
1735 1735
 
1736 1736
 	// Parcourir le chemin
1737 1737
 	foreach (creer_chemin() as $d) {
1738
-		$f = $d . $dir;
1738
+		$f = $d.$dir;
1739 1739
 		if (@is_dir($f)) {
1740 1740
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1741 1741
 			foreach ($liste as $chemin) {
@@ -1785,9 +1785,9 @@  discard block
 block discarded – undo
1785 1785
 	if ($type === 'defaut') {
1786 1786
 		$objet = objet_type($quoi);
1787 1787
 		if (
1788
-			$f = charger_fonction('generer_' . $objet . '_url', 'urls', true)
1788
+			$f = charger_fonction('generer_'.$objet.'_url', 'urls', true)
1789 1789
 			// deprecated
1790
-			or $f = charger_fonction('generer_url_' . $objet, 'urls', true)
1790
+			or $f = charger_fonction('generer_url_'.$objet, 'urls', true)
1791 1791
 		) {
1792 1792
 			return $f;
1793 1793
 		}
@@ -1800,7 +1800,7 @@  discard block
 block discarded – undo
1800 1800
 	}
1801 1801
 
1802 1802
 	// inclure le module d'url
1803
-	include_spip('urls/' . $url_type);
1803
+	include_spip('urls/'.$url_type);
1804 1804
 
1805 1805
 	switch ($quoi) {
1806 1806
 		case 'page':
@@ -1956,8 +1956,8 @@  discard block
 block discarded – undo
1956 1956
 	include_spip('base/connect_sql');
1957 1957
 	$id_type = id_table_objet($entite, $public);
1958 1958
 
1959
-	return _DIR_RACINE . get_spip_script('./')
1960
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1959
+	return _DIR_RACINE.get_spip_script('./')
1960
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1961 1961
 	. (!$args ? '' : "&$args")
1962 1962
 	. (!$ancre ? '' : "#$ancre");
1963 1963
 }
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
 				!empty($_SERVER['QUERY_STRING'])
2129 2129
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2130 2130
 			) {
2131
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2131
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2132 2132
 			}
2133 2133
 		}
2134 2134
 	}
@@ -2163,9 +2163,9 @@  discard block
 block discarded – undo
2163 2163
 		array_shift($myself);
2164 2164
 		$myself = implode('/', $myself);
2165 2165
 	}
2166
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2166
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2167 2167
 
2168
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2168
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2169 2169
 
2170 2170
 	return $url;
2171 2171
 }
@@ -2204,16 +2204,16 @@  discard block
 block discarded – undo
2204 2204
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
2205 2205
 	$script ??= '';
2206 2206
 	if (!$rel) {
2207
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2207
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2208 2208
 	} else {
2209 2209
 		if (!is_string($rel)) {
2210
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2210
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2211 2211
 		}
2212 2212
 	}
2213 2213
 
2214 2214
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2215 2215
 	if ($script and ($script <> 'accueil' or $rel)) {
2216
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2216
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2217 2217
 	} elseif ($args) {
2218 2218
 		$args = "?$args";
2219 2219
 	}
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 		$args .= "#$ancre";
2222 2222
 	}
2223 2223
 
2224
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2224
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2225 2225
 }
2226 2226
 
2227 2227
 //
@@ -2303,10 +2303,10 @@  discard block
 block discarded – undo
2303 2303
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2304 2304
 		}
2305 2305
 		if ($args) {
2306
-			$action .= (strpos($action, '?') !== false ? '&' : '?') . $args;
2306
+			$action .= (strpos($action, '?') !== false ? '&' : '?').$args;
2307 2307
 		}
2308 2308
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2309
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2309
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2310 2310
 	}
2311 2311
 
2312 2312
 	if (!$no_entities) {
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
 
2319 2319
 function generer_url_prive($script, $args = '', $no_entities = false) {
2320 2320
 
2321
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2321
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2322 2322
 }
2323 2323
 
2324 2324
 // Pour les formulaires en methode POST,
@@ -2353,8 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 	. "><div>\n"
2354 2354
 	. "<input type='hidden' name='exec' value='$script1' />"
2355 2355
 	. $corps
2356
-	. (!$submit ? '' :
2357
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2356
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2358 2357
 	. "</div></form>\n";
2359 2358
 }
2360 2359
 
@@ -2379,14 +2378,14 @@  discard block
 block discarded – undo
2379 2378
 		? generer_url_ecrire(_request('exec'))
2380 2379
 		: generer_url_public();
2381 2380
 
2382
-	return "\n<form action='" .
2383
-	$h .
2384
-	"'" .
2385
-	$atts .
2386
-	">\n" .
2387
-	'<div>' .
2388
-	"\n<input type='hidden' name='action' value='$script' />" .
2389
-	$corps .
2381
+	return "\n<form action='".
2382
+	$h.
2383
+	"'".
2384
+	$atts.
2385
+	">\n".
2386
+	'<div>'.
2387
+	"\n<input type='hidden' name='action' value='$script' />".
2388
+	$corps.
2390 2389
 	'</div></form>';
2391 2390
 }
2392 2391
 
@@ -2414,7 +2413,7 @@  discard block
 block discarded – undo
2414 2413
 		: generer_url_public('', '', false, false);
2415 2414
 	$url = parametre_url($url, 'action', $script);
2416 2415
 	if ($args) {
2417
-		$url .= quote_amp('&' . $args);
2416
+		$url .= quote_amp('&'.$args);
2418 2417
 	}
2419 2418
 
2420 2419
 	if ($no_entities) {
@@ -2448,9 +2447,9 @@  discard block
 block discarded – undo
2448 2447
 	}
2449 2448
 	$url =
2450 2449
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2451
-	. $script . '/'
2450
+	. $script.'/'
2452 2451
 	. ($path ? trim($path, '/') : '')
2453
-	. ($args ? '?' . quote_amp($args) : '');
2452
+	. ($args ? '?'.quote_amp($args) : '');
2454 2453
 
2455 2454
 	if ($no_entities) {
2456 2455
 		$url = str_replace('&amp;', '&', $url);
@@ -2499,17 +2498,17 @@  discard block
 block discarded – undo
2499 2498
 
2500 2499
 	// le nom du repertoire plugins/ activables/desactivables
2501 2500
 	if (!defined('_DIR_PLUGINS')) {
2502
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2501
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2503 2502
 	}
2504 2503
 
2505 2504
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2506 2505
 	if (!defined('_DIR_PLUGINS_DIST')) {
2507
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2506
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2508 2507
 	}
2509 2508
 
2510 2509
 	// le nom du repertoire des librairies
2511 2510
 	if (!defined('_DIR_LIB')) {
2512
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2511
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2513 2512
 	}
2514 2513
 
2515 2514
 	if (!defined('_DIR_IMG')) {
@@ -2519,29 +2518,29 @@  discard block
 block discarded – undo
2519 2518
 		define('_DIR_LOGOS', $pa);
2520 2519
 	}
2521 2520
 	if (!defined('_DIR_IMG_ICONES')) {
2522
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2521
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2523 2522
 	}
2524 2523
 
2525 2524
 	if (!defined('_DIR_DUMP')) {
2526
-		define('_DIR_DUMP', $ti . 'dump/');
2525
+		define('_DIR_DUMP', $ti.'dump/');
2527 2526
 	}
2528 2527
 	if (!defined('_DIR_SESSIONS')) {
2529
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2528
+		define('_DIR_SESSIONS', $ti.'sessions/');
2530 2529
 	}
2531 2530
 	if (!defined('_DIR_TRANSFERT')) {
2532
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2531
+		define('_DIR_TRANSFERT', $ti.'upload/');
2533 2532
 	}
2534 2533
 	if (!defined('_DIR_CACHE')) {
2535
-		define('_DIR_CACHE', $ti . 'cache/');
2534
+		define('_DIR_CACHE', $ti.'cache/');
2536 2535
 	}
2537 2536
 	if (!defined('_DIR_CACHE_XML')) {
2538
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2537
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2539 2538
 	}
2540 2539
 	if (!defined('_DIR_SKELS')) {
2541
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2540
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2542 2541
 	}
2543 2542
 	if (!defined('_DIR_AIDE')) {
2544
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2543
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2545 2544
 	}
2546 2545
 	if (!defined('_DIR_TMP')) {
2547 2546
 		define('_DIR_TMP', $ti);
@@ -2570,27 +2569,27 @@  discard block
 block discarded – undo
2570 2569
 	// Declaration des fichiers
2571 2570
 
2572 2571
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2573
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2572
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2574 2573
 	}
2575 2574
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2576
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2575
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2577 2576
 	}
2578 2577
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2579
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2578
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2580 2579
 	}
2581 2580
 	if (!defined('_CACHE_PIPELINES')) {
2582
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2581
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2583 2582
 	}
2584 2583
 	if (!defined('_CACHE_CHEMIN')) {
2585
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2584
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2586 2585
 	}
2587 2586
 
2588 2587
 	# attention .php obligatoire pour ecrire_fichier_securise
2589 2588
 	if (!defined('_FILE_META')) {
2590
-		define('_FILE_META', $ti . 'meta_cache.php');
2589
+		define('_FILE_META', $ti.'meta_cache.php');
2591 2590
 	}
2592 2591
 	if (!defined('_DIR_LOG')) {
2593
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2592
+		define('_DIR_LOG', _DIR_TMP.'log/');
2594 2593
 	}
2595 2594
 	if (!defined('_FILE_LOG')) {
2596 2595
 		define('_FILE_LOG', 'spip');
@@ -2607,8 +2606,8 @@  discard block
 block discarded – undo
2607 2606
 	if (!defined('_FILE_CONNECT')) {
2608 2607
 		define(
2609 2608
 			'_FILE_CONNECT',
2610
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2611
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2609
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2610
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2612 2611
 			: false))
2613 2612
 		);
2614 2613
 	}
@@ -2620,7 +2619,7 @@  discard block
 block discarded – undo
2620 2619
 	if (!defined('_FILE_CHMOD')) {
2621 2620
 		define(
2622 2621
 			'_FILE_CHMOD',
2623
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2622
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2624 2623
 			: false)
2625 2624
 		);
2626 2625
 	}
@@ -2633,10 +2632,10 @@  discard block
 block discarded – undo
2633 2632
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2634 2633
 	}
2635 2634
 	if (!defined('_FILE_CONNECT_TMP')) {
2636
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2635
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2637 2636
 	}
2638 2637
 	if (!defined('_FILE_CHMOD_TMP')) {
2639
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2638
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2640 2639
 	}
2641 2640
 
2642 2641
 	// Definition des droits d'acces en ecriture
@@ -2654,13 +2653,13 @@  discard block
 block discarded – undo
2654 2653
 		define('_DEFAULT_CHARSET', 'utf-8');
2655 2654
 	}
2656 2655
 	if (!defined('_ROOT_PLUGINS')) {
2657
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2656
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2658 2657
 	}
2659 2658
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2660
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2659
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2661 2660
 	}
2662 2661
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2663
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2662
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2664 2663
 	}
2665 2664
 
2666 2665
 	// La taille des Log
@@ -2697,7 +2696,7 @@  discard block
 block discarded – undo
2697 2696
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2698 2697
 	// pour le rendre surchargeable, on va provoquer un reecriture
2699 2698
 	// systematique du noyau ou une baisse de perfs => a etudier)
2700
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2699
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2701 2700
 
2702 2701
 	// charger tout de suite le path et son cache
2703 2702
 	load_path_cache();
@@ -2733,7 +2732,7 @@  discard block
 block discarded – undo
2733 2732
 			!empty($_SERVER['QUERY_STRING'])
2734 2733
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2735 2734
 		) {
2736
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2735
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2737 2736
 		}
2738 2737
 	}
2739 2738
 
@@ -2769,7 +2768,7 @@  discard block
 block discarded – undo
2769 2768
 		) {
2770 2769
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2771 2770
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2772
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2771
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2773 2772
 			} else {
2774 2773
 				$uri_ref = '';
2775 2774
 			}
@@ -2863,7 +2862,7 @@  discard block
 block discarded – undo
2863 2862
 	}
2864 2863
 	if (!defined('_CACHE_RUBRIQUES')) {
2865 2864
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2866
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2865
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2867 2866
 	}
2868 2867
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2869 2868
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -3085,7 +3084,7 @@  discard block
 block discarded – undo
3085 3084
 					}
3086 3085
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3087 3086
 						spip_log($GLOBALS['visiteur_session']['nom']
3088
-							. ' ' . _VAR_MODE);
3087
+							. ' '._VAR_MODE);
3089 3088
 					}
3090 3089
 				} // pas autorise ?
3091 3090
 				else {
@@ -3100,7 +3099,7 @@  discard block
 block discarded – undo
3100 3099
 						if (strpos($self, 'page=login') === false) {
3101 3100
 							include_spip('inc/headers');
3102 3101
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3103
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3102
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3104 3103
 						}
3105 3104
 					}
3106 3105
 					// sinon tant pis
@@ -3150,10 +3149,10 @@  discard block
 block discarded – undo
3150 3149
 **/
3151 3150
 function verifier_visiteur() {
3152 3151
 	@spip_initialisation_core(
3153
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3154
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3155
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3156
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3152
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3153
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3154
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3155
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3157 3156
 	);
3158 3157
 
3159 3158
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3186,7 +3185,7 @@  discard block
 block discarded – undo
3186 3185
 	}
3187 3186
 
3188 3187
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3189
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3188
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3190 3189
 		$session = charger_fonction('session', 'inc');
3191 3190
 		if ($session()) {
3192 3191
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3266,7 +3265,7 @@  discard block
 block discarded – undo
3266 3265
 			'definir_session',
3267 3266
 			$GLOBALS['visiteur_session']
3268 3267
 				? serialize($GLOBALS['visiteur_session'])
3269
-				. '_' . @$_COOKIE['spip_session']
3268
+				. '_'.@$_COOKIE['spip_session']
3270 3269
 				: ''
3271 3270
 		);
3272 3271
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3422,11 +3421,11 @@  discard block
 block discarded – undo
3422 3421
 	$GLOBALS['_INC_PUBLIC']++;
3423 3422
 
3424 3423
 	// fix #4235
3425
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3424
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3426 3425
 
3427 3426
 
3428 3427
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3429
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3428
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3430 3429
 
3431 3430
 		$page = evaluer_fond($f, $contexte, $connect);
3432 3431
 		if ($page === '') {
@@ -3511,7 +3510,7 @@  discard block
 block discarded – undo
3511 3510
  * @return array|string
3512 3511
  */
3513 3512
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3514
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3513
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3515 3514
 	if (!$pathinfo) {
3516 3515
 		return $f;
3517 3516
 	}
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	// in fine renommer le prefixe si besoin
107 107
 	if (strpos($name, 'spip_') === 0) {
108
-		$name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5);
108
+		$name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5);
109 109
 	}
110 110
 
111 111
 	#spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	}
164 164
 	foreach ($_COOKIE as $name => $value) {
165 165
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
166
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
166
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
167 167
 			$_COOKIE[$spipname] = $value;
168 168
 			$GLOBALS[$spipname] = $value;
169 169
 		}
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
27 27
 }
28 28
 if (!defined('_INC_DISTANT_USER_AGENT')) {
29
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
29
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
30 30
 }
31 31
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
32 32
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
36 36
 }
37 37
 
38
-define('_REGEXP_COPIE_LOCALE', ',' 	.
38
+define('_REGEXP_COPIE_LOCALE', ','.
39 39
 	preg_replace(
40 40
 		'@^https?:@',
41 41
 		'https?:',
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// si c'est la protection de soi-meme, retourner le path
74 74
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
75
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
75
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
76 76
 
77 77
 		return @file_exists($source) ? $source : false;
78 78
 	}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		return false;
93 93
 	}
94 94
 
95
-	$localrac = _DIR_RACINE . $local;
95
+	$localrac = _DIR_RACINE.$local;
96 96
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
97 97
 
98 98
 	// test d'existence du fichier
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
 		if (!$taille_max) {
113 113
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
114 114
 		}
115
-		$localrac_tmp = $localrac . '.tmp';
115
+		$localrac_tmp = $localrac.'.tmp';
116 116
 		$res = recuperer_url(
117 117
 			$source,
118 118
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
119 119
 		);
120 120
 
121 121
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
122
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
122
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
123 123
 			@unlink($localrac_tmp);
124 124
 		}
125 125
 		else {
126
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
126
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
127 127
 		}
128 128
 		if (!$res or !$res['length']) {
129 129
 			// si $t c'est sans doute juste un not-modified-since
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		if ($callback_valider_url
135 135
 		  and is_callable($callback_valider_url)
136 136
 		  and !$callback_valider_url($res['url'])) {
137
-			spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
137
+			spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
138 138
 			@unlink($localrac_tmp);
139 139
 			return $t ? $local : false;
140 140
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 	if (!$is_known_host) {
227 227
 		$host = trim($parsed_url['host'], '.');
228
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
228
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
229 229
 			$ip = gethostbyname($host);
230 230
 			if ($ip === $host) {
231 231
 				// Error condition for gethostbyname()
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			}
247 247
 		}
248 248
 		if ($ip) {
249
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
249
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
250 250
 				return false;
251 251
 			}
252 252
 		}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	}
258 258
 
259 259
 	$port = $parsed_url['port'];
260
-	if ($port === 80  or $port === 443  or $port === 8080) {
260
+	if ($port === 80 or $port === 443 or $port === 8080) {
261 261
 		return $url;
262 262
 	}
263 263
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				}
328 328
 			}
329 329
 			if ($taille > 500) {
330
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
330
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
331 331
 			}
332 332
 		}
333 333
 
@@ -355,16 +355,16 @@  discard block
 block discarded – undo
355 355
 			}
356 356
 		} else {
357 357
 			// fabrique une chaine HTTP simple pour un POST
358
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
358
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
359 359
 			$chaine = [];
360 360
 			if (is_array($donnees)) {
361 361
 				foreach ($donnees as $cle => $valeur) {
362 362
 					if (is_array($valeur)) {
363 363
 						foreach ($valeur as $val2) {
364
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
364
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
365 365
 						}
366 366
 					} else {
367
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
367
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
368 368
 					}
369 369
 				}
370 370
 				$chaine = implode('&', $chaine);
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470 470
 	}
471 471
 
472
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
472
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
473 473
 
474 474
 	// Ajout des en-têtes spécifiques si besoin
475 475
 	$formatted_data = '';
476 476
 	if (!empty($options['headers'])) {
477 477
 		foreach ($options['headers'] as $champ => $valeur) {
478
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
478
+			$formatted_data .= $champ.': '.$valeur."\r\n";
479 479
 		}
480 480
 	}
481 481
 
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484 484
 		$head .= $formatted_data;
485 485
 		if (stripos($head, 'Content-Length:') === false) {
486
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
486
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
487 487
 		}
488
-		$formatted_data = $head . "\r\n" . $postdata;
488
+		$formatted_data = $head."\r\n".$postdata;
489 489
 		if (
490 490
 			strlen($postdata)
491 491
 			and !$methode_demandee
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500 500
 	$url = preg_replace(',^feed://,i', 'http://', $url);
501 501
 	if (!tester_url_absolue($url)) {
502
-		$url = 'http://' . $url;
502
+		$url = 'http://'.$url;
503 503
 	} elseif (strncmp($url, '//', 2) == 0) {
504
-		$url = 'http:' . $url;
504
+		$url = 'http:'.$url;
505 505
 	}
506 506
 
507 507
 	$url = url_to_ascii($url);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 		$options['if_modified_since']
531 531
 	);
532 532
 	if (!$handle) {
533
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
533
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
534 534
 
535 535
 		return false;
536 536
 	}
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 					'status' => 200,
561 561
 				];
562 562
 			} else {
563
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
563
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
564 564
 				return false;
565 565
 			}
566 566
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 					$options['datas'] = '';
577 577
 				}
578 578
 			}
579
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
579
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
580 580
 
581 581
 			return recuperer_url($url, $options);
582 582
 		} elseif ($res['status'] !== 200) {
583
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
583
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
584 584
 		}
585 585
 		$result['status'] = $res['status'];
586 586
 		if (isset($res['headers'])) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 	// on ne veut que les entetes
598 598
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
599
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
600 600
 		return $result;
601 601
 	}
602 602
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 	$gz = false;
608 608
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
609
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
610 610
 	}
611 611
 
612 612
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 
643 643
 	$trace = json_decode(json_encode($result), true);
644 644
 	$trace['page'] = '...';
645
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
645
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
646 646
 
647 647
 	return $result;
648 648
 }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	$sig['url'] = $url;
697 697
 
698 698
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
699
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
699
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
700 700
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
701 701
 	$cache = "$sub$cache";
702 702
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	$fp = false;
751 751
 	if ($fichier) {
752 752
 		include_spip('inc/acces');
753
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
753
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
754 754
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755 755
 		if (!$fp and file_exists($fichier)) {
756 756
 			return filesize($fichier);
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	}
810 810
 	$result['status'] = intval($r[1]);
811 811
 	while ($s = trim(fgets($handle, 16384))) {
812
-		$result['headers'][] = $s . "\n";
812
+		$result['headers'][] = $s."\n";
813 813
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814 814
 		[, $d, $v] = $r;
815 815
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -858,13 +858,13 @@  discard block
 block discarded – undo
858 858
 
859 859
 	// on se place tout le temps comme si on etait a la racine
860 860
 	if (_DIR_RACINE) {
861
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
861
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
862 862
 	}
863 863
 
864 864
 	$m = md5($source);
865 865
 
866 866
 	return $d
867
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
867
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
868 868
 	. substr($m, 0, 4)
869 869
 	. ".$extension";
870 870
 }
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 	// Si c'est deja local pas de souci
888 888
 	if (!tester_url_absolue($source)) {
889 889
 		if (_DIR_RACINE) {
890
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
890
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
891 891
 		}
892 892
 
893 893
 		return $source;
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		$ext
906 906
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
907 907
 		and $f = nom_fichier_copie_locale($source, $ext)
908
-		and file_exists(_DIR_RACINE . $f)
908
+		and file_exists(_DIR_RACINE.$f)
909 909
 	) {
910 910
 		return $f;
911 911
 	}
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 
914 914
 	// Si c'est deja dans la table des documents,
915 915
 	// ramener le nom de sa copie potentielle
916
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
916
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
917 917
 
918 918
 	if ($ext) {
919 919
 		return nom_fichier_copie_locale($source, $ext);
@@ -924,9 +924,9 @@  discard block
 block discarded – undo
924 924
 
925 925
 	$ext = $path_parts ? $path_parts['extension'] : '';
926 926
 
927
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
927
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
928 928
 		$f = nom_fichier_copie_locale($source, $ext);
929
-		if (file_exists(_DIR_RACINE . $f)) {
929
+		if (file_exists(_DIR_RACINE.$f)) {
930 930
 			return $f;
931 931
 		}
932 932
 	}
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 	// Ping  pour voir si son extension est connue et autorisee
935 935
 	// avec mise en cache du resultat du ping
936 936
 
937
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
937
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
938 938
 	if (
939 939
 		!@file_exists($cache)
940 940
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -944,10 +944,10 @@  discard block
 block discarded – undo
944 944
 		ecrire_fichier($cache, serialize($path_parts));
945 945
 	}
946 946
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
947
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
947
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
948 948
 		return nom_fichier_copie_locale($source, $ext);
949 949
 	}
950
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
950
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
951 951
 }
952 952
 
953 953
 
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		} else {
1044 1044
 			if ($a['body']) {
1045 1045
 				$a['extension'] = $extension;
1046
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1046
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1047 1047
 				ecrire_fichier($a['fichier'], $a['body']);
1048 1048
 				$size_image = @spip_getimagesize($a['fichier']);
1049 1049
 				$a['largeur'] = intval($size_image[0]);
@@ -1111,20 +1111,20 @@  discard block
 block discarded – undo
1111 1111
 			!$t
1112 1112
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1113 1113
 		) {
1114
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1114
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1115 1115
 		}
1116 1116
 		if (
1117 1117
 			!$t
1118 1118
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1119 1119
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1120 1120
 		) {
1121
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1121
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1122 1122
 		}
1123 1123
 	}
1124 1124
 
1125 1125
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1126 1126
 	if (!$t) {
1127
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1127
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1128 1128
 	}
1129 1129
 
1130 1130
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1135,11 +1135,11 @@  discard block
 block discarded – undo
1135 1135
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1136 1136
 	) {
1137 1137
 		# eviter xxx.3 => 3gp (> SPIP 3)
1138
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1138
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1139 1139
 	}
1140 1140
 
1141 1141
 	if ($t) {
1142
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1142
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1143 1143
 		return $t['extension'];
1144 1144
 	} else {
1145 1145
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 		}
1243 1243
 	} else {
1244 1244
 		$scheme = $t['scheme'];
1245
-		$noproxy = $scheme . '://';
1245
+		$noproxy = $scheme.'://';
1246 1246
 	}
1247 1247
 	if (isset($t['user'])) {
1248 1248
 		$user = [$t['user'], $t['pass']];
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 	}
1257 1257
 
1258 1258
 	if (!empty($t['query'])) {
1259
-		$path .= '?' . $t['query'];
1259
+		$path .= '?'.$t['query'];
1260 1260
 	}
1261 1261
 
1262 1262
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1330,29 +1330,29 @@  discard block
 block discarded – undo
1330 1330
 	$proxy_user = '';
1331 1331
 	$http_proxy = need_proxy($host);
1332 1332
 	if ($user) {
1333
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1333
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1334 1334
 	}
1335 1335
 
1336 1336
 	$connect = '';
1337 1337
 	if ($http_proxy) {
1338
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1339
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1340
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1338
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1339
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1340
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1341 1341
 				. "Host: $path_host\r\n"
1342 1342
 				. "Proxy-Connection: Keep-Alive\r\n";
1343 1343
 		} else {
1344
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1344
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1345 1345
 				. (!$user ? '' : "$user@")
1346
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1346
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1347 1347
 		}
1348 1348
 		$t2 = @parse_url($http_proxy);
1349 1349
 		$first_host = $t2['host'];
1350 1350
 		$port = ($t2['port'] ?? null) ?: 80;
1351 1351
 		if ($t2['user'] ?? null) {
1352
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1352
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1353 1353
 		}
1354 1354
 	} else {
1355
-		$first_host = $noproxy . $host;
1355
+		$first_host = $noproxy.$host;
1356 1356
 	}
1357 1357
 
1358 1358
 	if ($connect) {
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 		);
1375 1375
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1376 1376
 		if (!$f) {
1377
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1377
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1378 1378
 			return $errno;
1379 1379
 		}
1380 1380
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 			or !count($res = explode(' ', $res))
1388 1388
 			or $res[1] !== '200'
1389 1389
 		) {
1390
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1390
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1391 1391
 			fclose($f);
1392 1392
 
1393 1393
 			return false;
@@ -1404,7 +1404,7 @@  discard block
 block discarded – undo
1404 1404
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1405 1405
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1406 1406
 		if (!$f) {
1407
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1407
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1408 1408
 
1409 1409
 			return $errno;
1410 1410
 		}
@@ -1414,16 +1414,16 @@  discard block
 block discarded – undo
1414 1414
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1415 1415
 
1416 1416
 	$host_port = $host;
1417
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1417
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1418 1418
 		$host_port .= ":$port";
1419 1419
 	}
1420 1420
 	$req = "$method $path $vers\r\n"
1421 1421
 		. "Host: $host_port\r\n"
1422
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1423
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1422
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1423
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1424 1424
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1425
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1426
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1425
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1426
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1427 1427
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1428 1428
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1429 1429
 
Please login to merge, or discard this patch.