Completed
Push — master ( a5da4e...51674a )
by cam
01:27
created
ecrire/src/Chiffrer/Password.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			$pass_poivre = hash_hmac('sha256', $password_clair, $key);
38 38
 			return password_verify($pass_poivre, $password_hash);
39 39
 		}
40
-		spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE);
40
+		spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE);
41 41
 		return false;
42 42
 	}
43 43
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			$pass_poivre = hash_hmac('sha256', $password_clair, $key);
60 60
 			return password_hash($pass_poivre, PASSWORD_DEFAULT);
61 61
 		}
62
-		spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE);
62
+		spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE);
63 63
 		return null;
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
ecrire/src/Chiffrer/Cles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 	public function generate(string $name): string {
31 31
 		$key = Chiffrement::keygen();
32 32
 		$this->keys[$name] = $key;
33
-		spip_log("Création de la cle $name", 'chiffrer' . _LOG_INFO_IMPORTANTE);
33
+		spip_log("Création de la cle $name", 'chiffrer'._LOG_INFO_IMPORTANTE);
34 34
 		return $key;
35 35
 	}
36 36
 
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/action/editer_rubrique.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			$id_rubrique,
151 151
 			[
152 152
 			'data' => $set,
153
-			'nonvide' => ['titre' => _T('titre_nouvelle_rubrique') . ' ' . _T('info_numero_abbreviation') . $id_rubrique]
153
+			'nonvide' => ['titre' => _T('titre_nouvelle_rubrique').' '._T('info_numero_abbreviation').$id_rubrique]
154 154
 			],
155 155
 			$c
156 156
 		)
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 				)
255 255
 			) {
256 256
 				if ($s['statut'] != 'prepa') {
257
-					spip_log("deplacement de $id_rubrique vers $id_parent refuse a " . $GLOBALS['visiteur_session']['id_auteur'] . ' ' . $GLOBALS['visiteur_session']['statut']);
257
+					spip_log("deplacement de $id_rubrique vers $id_parent refuse a ".$GLOBALS['visiteur_session']['id_auteur'].' '.$GLOBALS['visiteur_session']['statut']);
258 258
 				}
259 259
 			} elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) {
260 260
 				$statut_ancien = $s['statut'];
Please login to merge, or discard this patch.
ecrire/inc/config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -303,9 +303,9 @@
 block discarded – undo
303 303
 			// et dans ce cas il faut verifier que l'ecriture en base a bien eu lieu a l'identique si il y a des planes dans la chaine
304 304
 			// car sinon ca casse le serialize PHP - par exemple si on est en mysql utf8 (non mb4)
305 305
 			if ($has_planes) {
306
-				$check_store = sql_getfetsel('valeur', 'spip_' . $table, 'nom=' . sql_quote($casier));
306
+				$check_store = sql_getfetsel('valeur', 'spip_'.$table, 'nom='.sql_quote($casier));
307 307
 				if ($check_store !== $serialized_store) {
308
-					array_walk_recursive($store, function (&$value, $key) {
308
+					array_walk_recursive($store, function(&$value, $key) {
309 309
 						if (is_string($value)) {
310 310
 							$value = utf8_noplanes($value);
311 311
 						}
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +48 added lines, -48 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
 }
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
 	}
2690 2690
 
2691 2691
 	// Différentes infos relatives au tri présentes dans les modificateurs
2692
-	$_tri_nom = $boucle->modificateur['tri_nom'] ; // nom du paramètre définissant le tri
2692
+	$_tri_nom = $boucle->modificateur['tri_nom']; // nom du paramètre définissant le tri
2693 2693
 	$_tri_champ = $boucle->modificateur['tri_champ']; // champ actuel utilisé le tri
2694 2694
 	$_tri_sens = $boucle->modificateur['tri_sens']; // sens de tri actuel
2695 2695
 	$_tri_liste_sens_defaut = $boucle->modificateur['tri_liste_sens_defaut']; // sens par défaut pour chaque champ
@@ -2784,7 +2784,7 @@  discard block
 block discarded – undo
2784 2784
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2785 2785
 	}
2786 2786
 
2787
-	$p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')";
2787
+	$p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')";
2788 2788
 	$p->interdire_scripts = false;
2789 2789
 
2790 2790
 	return $p;
Please login to merge, or discard this patch.
ecrire/inc/commencer_page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$titre = '['
91 91
 		. $nom_site_spip
92 92
 		. ']'
93
-		. ($titre ? ' ' . textebrut(typo($titre)) : '');
93
+		. ($titre ? ' '.textebrut(typo($titre)) : '');
94 94
 
95 95
 	return _DOCTYPE_ECRIRE
96 96
 	. html_lang_attributes()
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) {
134 134
 
135 135
 	$res = pipeline('body_prive', "<body class='"
136
-		. init_body_class() . ' ' . _request('exec') . "'"
136
+		. init_body_class().' '._request('exec')."'"
137 137
 		. ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '')
138 138
 		. '>');
139 139
 
Please login to merge, or discard this patch.
ecrire/public/interfaces.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -813,9 +813,9 @@
 block discarded – undo
813 813
 	if (!defined('_TRAITEMENT_TYPO_SANS_NUMERO')) {
814 814
 		define('_TRAITEMENT_TYPO_SANS_NUMERO', 'supprimer_numero(typo(%s, "TYPO", $connect, $Pile[0]))');
815 815
 	}
816
-	$GLOBALS['table_des_traitements']['BIO'][] = 'safehtml(' . _TRAITEMENT_RACCOURCIS . ')';
816
+	$GLOBALS['table_des_traitements']['BIO'][] = 'safehtml('._TRAITEMENT_RACCOURCIS.')';
817 817
 	$GLOBALS['table_des_traitements']['NOM_SITE']['auteurs'] = 'entites_html(%s)';
818
-	$GLOBALS['table_des_traitements']['NOM']['auteurs'] = 'safehtml(' . _TRAITEMENT_TYPO_SANS_NUMERO . ')';
818
+	$GLOBALS['table_des_traitements']['NOM']['auteurs'] = 'safehtml('._TRAITEMENT_TYPO_SANS_NUMERO.')';
819 819
 	$GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS;
820 820
 	$GLOBALS['table_des_traitements']['DATE'][] = 'normaliser_date(%s)';
821 821
 	$GLOBALS['table_des_traitements']['DATE_REDAC'][] = 'normaliser_date(%s)';
Please login to merge, or discard this patch.
ecrire/maj/2021.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 $GLOBALS['maj'][2021_02_18_00] = [
26
-	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ],
27
-	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ],
26
+	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"],
27
+	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"],
28 28
 ];
29 29
 
30 30
 $GLOBALS['maj'][2022_02_23_02] = [
31
-	['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL" ],
32
-	['sql_delete', 'spip_meta', "nom='secret_du_site'" ],
31
+	['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL"],
32
+	['sql_delete', 'spip_meta', "nom='secret_du_site'"],
33 33
 ];
34 34
 
35 35
 $GLOBALS['maj'][2022_02_23_03] = [
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		spip_log('supprimer sessions auteur', 'maj');
49 49
 		if ($dir = opendir(_DIR_SESSIONS)) {
50 50
 			while (($f = readdir($dir)) !== false) {
51
-				spip_unlink(_DIR_SESSIONS . $f);
51
+				spip_unlink(_DIR_SESSIONS.$f);
52 52
 				if (time() >= _TIME_OUT) {
53 53
 					return;
54 54
 				}
Please login to merge, or discard this patch.