Completed
Push — master ( 51674a...9b54d2 )
by cam
01:35
created
ecrire/public/aiguiller.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	) {
33 33
 		// si l'url est une url du site, on la laisse passer sans rien faire
34 34
 		// c'est encore le plus simple
35
-		$base = $GLOBALS['meta']['adresse_site'] . '/';
35
+		$base = $GLOBALS['meta']['adresse_site'].'/';
36 36
 		if (strlen($base) && str_starts_with($redirect, $base)) {
37 37
 			return $redirect;
38 38
 		}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 			if ($ancre = _request('var_ajax_ancre')) {
154 154
 				// pas n'importe quoi quand meme dans la variable !
155 155
 				$ancre = str_replace(['<', '"', "'"], ['&lt;', '&quot;', ''], $ancre);
156
-				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte;
156
+				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte;
157 157
 			}
158 158
 		} else {
159 159
 			include_spip('inc/headers');
@@ -195,26 +195,26 @@  discard block
 block discarded – undo
195 195
 	$sign = _request('formulaire_action_sign');
196 196
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
197 197
 		if (empty($sign)) {
198
-			spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires' . _LOG_ERREUR);
198
+			spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires'._LOG_ERREUR);
199 199
 			return false;
200 200
 		}
201 201
 		$securiser_action = charger_fonction('securiser_action', 'inc');
202 202
 		$secu = $securiser_action($form, $args, '', -1);
203 203
 		if ($sign !== $secu['hash']) {
204
-			spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires' . _LOG_ERREUR);
204
+			spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires'._LOG_ERREUR);
205 205
 			return false;
206 206
 		}
207 207
 	}
208 208
 	else {
209 209
 		if (!empty($sign)) {
210
-			spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires' . _LOG_ERREUR);
210
+			spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires'._LOG_ERREUR);
211 211
 			return false;
212 212
 		}
213 213
 	}
214 214
 
215 215
 	include_spip('inc/filtres');
216 216
 	if (($args = decoder_contexte_ajax($args, $form)) === false) {
217
-		spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires' . _LOG_ERREUR);
217
+		spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires'._LOG_ERREUR);
218 218
 
219 219
 		return false; // continuons le hit comme si de rien etait
220 220
 	} else {
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 				// on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7
331 331
 				// sans cela le formulaire n'est pas actif apres le hit ajax
332 332
 				// la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe
333
-				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour;
333
+				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour;
334 334
 				ajax_retour($retour, false);
335 335
 
336 336
 				return true; // on a fini le hit
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +125 added lines, -126 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	if (strlen($dossier) && !str_ends_with($dossier, '/')) {
53 53
 		$dossier .= '/';
54 54
 	}
55
-	$f = str_replace('/', '_', $dossier) . $nom;
55
+	$f = str_replace('/', '_', $dossier).$nom;
56 56
 
57 57
 	if (function_exists($f)) {
58 58
 		return $f;
59 59
 	}
60
-	if (function_exists($g = $f . '_dist')) {
60
+	if (function_exists($g = $f.'_dist')) {
61 61
 		return $g;
62 62
 	}
63 63
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	// passer en minuscules (cf les balises de formulaires)
79 79
 	// et inclure le fichier
80 80
 	if (
81
-		!($inc = include_spip($dossier . ($d = strtolower($nom))))
81
+		!($inc = include_spip($dossier.($d = strtolower($nom))))
82 82
 		&& strlen(dirname($dossier))
83 83
 		&& dirname($dossier) != '.'
84 84
 	) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	// Echec : message d'erreur
99
-	spip_log("fonction $nom ($f ou $g) indisponible" .
99
+	spip_log("fonction $nom ($f ou $g) indisponible".
100 100
 		($inc ? '' : " (fichier $d absent de $dossier)"));
101 101
 
102 102
 	include_spip('inc/minipres');
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	echo minipres(
105 105
 		_T('forum_titre_erreur'),
106 106
 		$inc ?
107
-			_T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>'])
107
+			_T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>'])
108 108
 			. '<br />'
109
-			. _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>'])
109
+			. _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
110 110
 			:
111
-			_T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']),
112
-		['all_inline' => true,'status' => 404]
111
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
112
+		['all_inline' => true, 'status' => 404]
113 113
 	);
114 114
 	exit;
115 115
 }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *     - string : chemin du fichier trouvé
156 156
  **/
157 157
 function include_spip($f, $include = true) {
158
-	return find_in_path($f . '.php', '', $include);
158
+	return find_in_path($f.'.php', '', $include);
159 159
 }
160 160
 
161 161
 /**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  *     - string : chemin du fichier trouvé
176 176
  **/
177 177
 function require_spip($f) {
178
-	return find_in_path($f . '.php', '', 'required');
178
+	return find_in_path($f.'.php', '', 'required');
179 179
 }
180 180
 
181 181
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		// donc il faut l'inclure "en globals"
193 193
 		if ($f = find_in_path('mes_fonctions.php')) {
194 194
 			global $dossier_squelettes;
195
-			include_once(_ROOT_CWD . $f);
195
+			include_once(_ROOT_CWD.$f);
196 196
 		}
197 197
 
198 198
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	}
298 298
 
299 299
 	// appliquer notre fonction si elle existe
300
-	$fonc = 'execute_pipeline_' . strtolower($action);
300
+	$fonc = 'execute_pipeline_'.strtolower($action);
301 301
 	if (function_exists($fonc)) {
302 302
 		$val = $fonc($val);
303 303
 	} // plantage ?
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 function spip_log($message = null, $name = null) {
363 363
 	static $pre = [];
364 364
 	static $log;
365
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
365
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
366 366
 	if (!isset($regs[1]) || !$logname = $regs[1]) {
367 367
 		$logname = null;
368 368
 	}
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 		if (!is_string($message)) {
391 391
 			$message = print_r($message, true);
392 392
 		}
393
-		$log($pre[$niveau] . ' ' . $message, $logname);
393
+		$log($pre[$niveau].' '.$message, $logname);
394 394
 	}
395 395
 }
396 396
 
@@ -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 (!str_ends_with($r[1], '[]')) {
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 = (str_ends_with($k, '[]')) ? $k : ($k . '[]');
650
+				$id = (str_ends_with($k, '[]')) ? $k : ($k.'[]');
651 651
 				foreach ($v as $w) {
652
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
652
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
653 653
 				}
654 654
 			}
655 655
 		}
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 
661 661
 	// recomposer l'adresse
662 662
 	if ($url) {
663
-		$a .= '?' . join($sep, $url);
663
+		$a .= '?'.join($sep, $url);
664 664
 	}
665 665
 
666
-	return $a . $ancre;
666
+	return $a.$ancre;
667 667
 }
668 668
 
669 669
 /**
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			translitteration($ancre)
694 694
 		);
695 695
 	}
696
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
696
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
697 697
 }
698 698
 
699 699
 /**
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
  * @return bool
811 811
  */
812 812
 function test_plugin_actif($plugin) {
813
-	return ($plugin && defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
813
+	return ($plugin && defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
814 814
 }
815 815
 
816 816
 /**
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 					$value = interdire_scripts($value, -1);
943 943
 				}
944 944
 				if (!empty($options['class'])) {
945
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
945
+					$value = "<span class='".$options['class']."'>$value</span>";
946 946
 				}
947 947
 				$text = str_replace("@$name@", (string) $value, (string) $text);
948 948
 				unset($args[$name]);
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 		// Si des variables n'ont pas ete inserees, le signaler
952 952
 		// (chaines de langues pas a jour)
953 953
 		if ($args) {
954
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
954
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
955 955
 		}
956 956
 	}
957 957
 
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 function joli_repertoire($rep) {
976 976
 	$a = substr($rep, 0, 1);
977 977
 	if ($a <> '.' && $a <> '/') {
978
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
978
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
979 979
 	}
980 980
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
981 981
 
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
 			$p -= ($x * 1000);
1030 1030
 		}
1031 1031
 
1032
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1032
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1033 1033
 	}
1034 1034
 }
1035 1035
 
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 	if ($taches && count($taches) && !spip_connect()) {
1097 1097
 		return false;
1098 1098
 	}
1099
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1099
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1100 1100
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1101 1101
 		return $genie($taches);
1102 1102
 	}
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
 	if ($queue_next_job_time == -1) {
1201 1201
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1202
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1202
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1203 1203
 		}
1204 1204
 		// utiliser un cache memoire si dispo
1205 1205
 		if (function_exists('cache_get') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) {
@@ -1269,8 +1269,8 @@  discard block
 block discarded – undo
1269 1269
 		$src = '';
1270 1270
 	}
1271 1271
 	if ($script) {
1272
-		$script = ("/*<![CDATA[*/\n" .
1273
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1272
+		$script = ("/*<![CDATA[*/\n".
1273
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1274 1274
 			'/*]]>*/');
1275 1275
 	}
1276 1276
 	if ($noscript) {
@@ -1359,13 +1359,13 @@  discard block
 block discarded – undo
1359 1359
 	if ($path_base == null) {
1360 1360
 		// Chemin standard depuis l'espace public
1361 1361
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1362
-			_DIR_RACINE . ':' .
1363
-			_DIR_RACINE . 'squelettes-dist/:' .
1364
-			_DIR_RACINE . 'prive/:' .
1362
+			_DIR_RACINE.':'.
1363
+			_DIR_RACINE.'squelettes-dist/:'.
1364
+			_DIR_RACINE.'prive/:'.
1365 1365
 			_DIR_RESTREINT;
1366 1366
 		// Ajouter squelettes/
1367
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1368
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1367
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1368
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1369 1369
 		}
1370 1370
 		foreach (explode(':', $path) as $dir) {
1371 1371
 			if (strlen($dir) && !str_ends_with($dir, '/')) {
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 		// Et le(s) dossier(s) des squelettes nommes
1378 1378
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1379 1379
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1380
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1380
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1381 1381
 			}
1382 1382
 		}
1383 1383
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 
1389 1389
 	if (is_array($dir_path) || strlen($dir_path)) {
1390 1390
 		$tete = '';
1391
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1391
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1392 1392
 			$tete = array_shift($path_base);
1393 1393
 		}
1394 1394
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 	// Et le(s) dossier(s) des squelettes nommes
1410 1410
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1411 1411
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1412
-			array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1412
+			array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1413 1413
 		}
1414 1414
 	}
1415 1415
 
@@ -1485,14 +1485,14 @@  discard block
 block discarded – undo
1485 1485
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1486 1486
 	if (
1487 1487
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1488
-		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg')
1488
+		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg')
1489 1489
 		&& ($f = find_in_theme("$file_svg_generique"))
1490 1490
 	) {
1491
-		if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) {
1491
+		if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) {
1492 1492
 			return $themefiles["$subdir$file"] = $fsize;
1493 1493
 		}
1494 1494
 		else {
1495
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1495
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1496 1496
 		}
1497 1497
 	}
1498 1498
 
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
 			return $themefiles["$subdir$file"] = $f;
1503 1503
 		}
1504 1504
 	}
1505
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1505
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1506 1506
 
1507 1507
 	return $themefiles["$subdir$file"] = '';
1508 1508
 }
@@ -1610,8 +1610,8 @@  discard block
 block discarded – undo
1610 1610
 			return false;
1611 1611
 		}
1612 1612
 		if ($include && !isset($inc[$dirname][$file])) {
1613
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1614
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1613
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1614
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1615 1615
 		}
1616 1616
 
1617 1617
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1624,14 +1624,14 @@  discard block
 block discarded – undo
1624 1624
 	}
1625 1625
 
1626 1626
 	foreach (creer_chemin() as $dir) {
1627
-		if (!isset($dirs[$a = $dir . $dirname])) {
1628
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1627
+		if (!isset($dirs[$a = $dir.$dirname])) {
1628
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1629 1629
 		}
1630 1630
 		if ($dirs[$a]) {
1631
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1631
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1632 1632
 				if ($include && !isset($inc[$dirname][$file])) {
1633
-					include_once _ROOT_CWD . $a;
1634
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1633
+					include_once _ROOT_CWD.$a;
1634
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1635 1635
 				}
1636 1636
 				if (!defined('_SAUVER_CHEMIN')) {
1637 1637
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 					define('_SAUVER_CHEMIN', true);
1642 1642
 				}
1643 1643
 
1644
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1644
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1645 1645
 			}
1646 1646
 		}
1647 1647
 	}
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
 		define('_SAUVER_CHEMIN', true);
1668 1668
 	}
1669 1669
 
1670
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1670
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1671 1671
 }
1672 1672
 
1673 1673
 function clear_path_cache() {
@@ -1737,12 +1737,12 @@  discard block
 block discarded – undo
1737 1737
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1738 1738
 	// on a pas encore inclus flock.php
1739 1739
 	if (!function_exists('preg_files')) {
1740
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1740
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1741 1741
 	}
1742 1742
 
1743 1743
 	// Parcourir le chemin
1744 1744
 	foreach (creer_chemin() as $d) {
1745
-		$f = $d . $dir;
1745
+		$f = $d.$dir;
1746 1746
 		if (@is_dir($f)) {
1747 1747
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1748 1748
 			foreach ($liste as $chemin) {
@@ -1794,8 +1794,8 @@  discard block
 block discarded – undo
1794 1794
 	if ($type === 'defaut') {
1795 1795
 		$objet = objet_type($quoi);
1796 1796
 		if (
1797
-			($f = charger_fonction('generer_' . $objet . '_url', 'urls', true))
1798
-			|| ($f = charger_fonction('generer_url_' . $objet, 'urls', true)) // deprecated
1797
+			($f = charger_fonction('generer_'.$objet.'_url', 'urls', true))
1798
+			|| ($f = charger_fonction('generer_url_'.$objet, 'urls', true)) // deprecated
1799 1799
 		) {
1800 1800
 			return $f;
1801 1801
 		}
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
 	}
1809 1809
 
1810 1810
 	// inclure le module d'url
1811
-	include_spip('urls/' . $url_type);
1811
+	include_spip('urls/'.$url_type);
1812 1812
 
1813 1813
 	switch ($quoi) {
1814 1814
 		case 'page':
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 	}
1909 1909
 
1910 1910
 	// On a ete gentil mais la ....
1911
-	spip_log("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect", _LOG_ERREUR);
1911
+	spip_log("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect", _LOG_ERREUR);
1912 1912
 
1913 1913
 	return '';
1914 1914
 }
@@ -1959,8 +1959,8 @@  discard block
 block discarded – undo
1959 1959
 	include_spip('base/connect_sql');
1960 1960
 	$id_type = id_table_objet($entite, $public);
1961 1961
 
1962
-	return _DIR_RACINE . get_spip_script('./')
1963
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1962
+	return _DIR_RACINE.get_spip_script('./')
1963
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1964 1964
 	. (!$args ? '' : "&$args")
1965 1965
 	. (!$ancre ? '' : "#$ancre");
1966 1966
 }
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
 				!empty($_SERVER['QUERY_STRING'])
2130 2130
 				&& !str_contains($_SERVER['REQUEST_URI'], '?')
2131 2131
 			) {
2132
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2132
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2133 2133
 			}
2134 2134
 		}
2135 2135
 	}
@@ -2167,9 +2167,9 @@  discard block
 block discarded – undo
2167 2167
 		array_shift($myself);
2168 2168
 		$myself = implode('/', $myself);
2169 2169
 	}
2170
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2170
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2171 2171
 
2172
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2172
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2173 2173
 
2174 2174
 	return $url;
2175 2175
 }
@@ -2208,16 +2208,16 @@  discard block
 block discarded – undo
2208 2208
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
2209 2209
 	$script ??= '';
2210 2210
 	if (!$rel) {
2211
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2211
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2212 2212
 	} else {
2213 2213
 		if (!is_string($rel)) {
2214
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2214
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2215 2215
 		}
2216 2216
 	}
2217 2217
 
2218 2218
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2219 2219
 	if ($script && ($script <> 'accueil' || $rel)) {
2220
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2220
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2221 2221
 	} elseif ($args) {
2222 2222
 		$args = "?$args";
2223 2223
 	}
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
 		$args .= "#$ancre";
2226 2226
 	}
2227 2227
 
2228
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2228
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2229 2229
 }
2230 2230
 
2231 2231
 //
@@ -2307,10 +2307,10 @@  discard block
 block discarded – undo
2307 2307
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2308 2308
 		}
2309 2309
 		if ($args) {
2310
-			$action .= (str_contains($action, '?') ? '&' : '?') . $args;
2310
+			$action .= (str_contains($action, '?') ? '&' : '?').$args;
2311 2311
 		}
2312 2312
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2313
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2313
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2314 2314
 	}
2315 2315
 
2316 2316
 	if (!$no_entities) {
@@ -2322,7 +2322,7 @@  discard block
 block discarded – undo
2322 2322
 
2323 2323
 function generer_url_prive($script, $args = '', $no_entities = false) {
2324 2324
 
2325
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2325
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2326 2326
 }
2327 2327
 
2328 2328
 // Pour les formulaires en methode POST,
@@ -2357,8 +2357,7 @@  discard block
 block discarded – undo
2357 2357
 	. "><div>\n"
2358 2358
 	. "<input type='hidden' name='exec' value='$script1' />"
2359 2359
 	. $corps
2360
-	. (!$submit ? '' :
2361
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2360
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2362 2361
 	. "</div></form>\n";
2363 2362
 }
2364 2363
 
@@ -2383,14 +2382,14 @@  discard block
 block discarded – undo
2383 2382
 		? generer_url_ecrire(_request('exec'))
2384 2383
 		: generer_url_public();
2385 2384
 
2386
-	return "\n<form action='" .
2387
-	$h .
2388
-	"'" .
2389
-	$atts .
2390
-	">\n" .
2391
-	'<div>' .
2392
-	"\n<input type='hidden' name='action' value='$script' />" .
2393
-	$corps .
2385
+	return "\n<form action='".
2386
+	$h.
2387
+	"'".
2388
+	$atts.
2389
+	">\n".
2390
+	'<div>'.
2391
+	"\n<input type='hidden' name='action' value='$script' />".
2392
+	$corps.
2394 2393
 	'</div></form>';
2395 2394
 }
2396 2395
 
@@ -2418,7 +2417,7 @@  discard block
 block discarded – undo
2418 2417
 		: generer_url_public('', '', false, false);
2419 2418
 	$url = parametre_url($url, 'action', $script);
2420 2419
 	if ($args) {
2421
-		$url .= quote_amp('&' . $args);
2420
+		$url .= quote_amp('&'.$args);
2422 2421
 	}
2423 2422
 
2424 2423
 	if ($no_entities) {
@@ -2452,9 +2451,9 @@  discard block
 block discarded – undo
2452 2451
 	}
2453 2452
 	$url =
2454 2453
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2455
-	. $script . '/'
2454
+	. $script.'/'
2456 2455
 	. ($path ? trim($path, '/') : '')
2457
-	. ($args ? '?' . quote_amp($args) : '');
2456
+	. ($args ? '?'.quote_amp($args) : '');
2458 2457
 
2459 2458
 	if ($no_entities) {
2460 2459
 		$url = str_replace('&amp;', '&', $url);
@@ -2503,22 +2502,22 @@  discard block
 block discarded – undo
2503 2502
 
2504 2503
 	// le nom du repertoire plugins/ activables/desactivables
2505 2504
 	if (!defined('_DIR_PLUGINS')) {
2506
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2505
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2507 2506
 	}
2508 2507
 
2509 2508
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2510 2509
 	if (!defined('_DIR_PLUGINS_DIST')) {
2511
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2510
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2512 2511
 	}
2513 2512
 
2514 2513
 	// le nom du repertoire des librairies
2515 2514
 	if (!defined('_DIR_LIB')) {
2516
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2515
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2517 2516
 	}
2518 2517
 
2519 2518
 	// répertoire des libs via Composer
2520 2519
 	if (!defined('_DIR_VENDOR')) {
2521
-		define('_DIR_VENDOR', _DIR_RACINE . 'vendor/');
2520
+		define('_DIR_VENDOR', _DIR_RACINE.'vendor/');
2522 2521
 	}
2523 2522
 
2524 2523
 	if (!defined('_DIR_IMG')) {
@@ -2528,29 +2527,29 @@  discard block
 block discarded – undo
2528 2527
 		define('_DIR_LOGOS', $pa);
2529 2528
 	}
2530 2529
 	if (!defined('_DIR_IMG_ICONES')) {
2531
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2530
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2532 2531
 	}
2533 2532
 
2534 2533
 	if (!defined('_DIR_DUMP')) {
2535
-		define('_DIR_DUMP', $ti . 'dump/');
2534
+		define('_DIR_DUMP', $ti.'dump/');
2536 2535
 	}
2537 2536
 	if (!defined('_DIR_SESSIONS')) {
2538
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2537
+		define('_DIR_SESSIONS', $ti.'sessions/');
2539 2538
 	}
2540 2539
 	if (!defined('_DIR_TRANSFERT')) {
2541
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2540
+		define('_DIR_TRANSFERT', $ti.'upload/');
2542 2541
 	}
2543 2542
 	if (!defined('_DIR_CACHE')) {
2544
-		define('_DIR_CACHE', $ti . 'cache/');
2543
+		define('_DIR_CACHE', $ti.'cache/');
2545 2544
 	}
2546 2545
 	if (!defined('_DIR_CACHE_XML')) {
2547
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2546
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2548 2547
 	}
2549 2548
 	if (!defined('_DIR_SKELS')) {
2550
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2549
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2551 2550
 	}
2552 2551
 	if (!defined('_DIR_AIDE')) {
2553
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2552
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2554 2553
 	}
2555 2554
 	if (!defined('_DIR_TMP')) {
2556 2555
 		define('_DIR_TMP', $ti);
@@ -2579,27 +2578,27 @@  discard block
 block discarded – undo
2579 2578
 	// Declaration des fichiers
2580 2579
 
2581 2580
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2582
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2581
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2583 2582
 	}
2584 2583
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2585
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2584
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2586 2585
 	}
2587 2586
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2588
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2587
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2589 2588
 	}
2590 2589
 	if (!defined('_CACHE_PIPELINES')) {
2591
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2590
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2592 2591
 	}
2593 2592
 	if (!defined('_CACHE_CHEMIN')) {
2594
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2593
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2595 2594
 	}
2596 2595
 
2597 2596
 	# attention .php obligatoire pour ecrire_fichier_securise
2598 2597
 	if (!defined('_FILE_META')) {
2599
-		define('_FILE_META', $ti . 'meta_cache.php');
2598
+		define('_FILE_META', $ti.'meta_cache.php');
2600 2599
 	}
2601 2600
 	if (!defined('_DIR_LOG')) {
2602
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2601
+		define('_DIR_LOG', _DIR_TMP.'log/');
2603 2602
 	}
2604 2603
 	if (!defined('_FILE_LOG')) {
2605 2604
 		define('_FILE_LOG', 'spip');
@@ -2615,7 +2614,7 @@  discard block
 block discarded – undo
2615 2614
 	if (!defined('_FILE_CONNECT')) {
2616 2615
 		define(
2617 2616
 			'_FILE_CONNECT',
2618
-			@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : false
2617
+			@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f : false
2619 2618
 		);
2620 2619
 	}
2621 2620
 
@@ -2626,7 +2625,7 @@  discard block
 block discarded – undo
2626 2625
 	if (!defined('_FILE_CHMOD')) {
2627 2626
 		define(
2628 2627
 			'_FILE_CHMOD',
2629
-			@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f : false
2628
+			@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f : false
2630 2629
 		);
2631 2630
 	}
2632 2631
 
@@ -2638,10 +2637,10 @@  discard block
 block discarded – undo
2638 2637
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2639 2638
 	}
2640 2639
 	if (!defined('_FILE_CONNECT_TMP')) {
2641
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2640
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2642 2641
 	}
2643 2642
 	if (!defined('_FILE_CHMOD_TMP')) {
2644
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2643
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2645 2644
 	}
2646 2645
 
2647 2646
 	// Definition des droits d'acces en ecriture
@@ -2659,13 +2658,13 @@  discard block
 block discarded – undo
2659 2658
 		define('_DEFAULT_CHARSET', 'utf-8');
2660 2659
 	}
2661 2660
 	if (!defined('_ROOT_PLUGINS')) {
2662
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2661
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2663 2662
 	}
2664 2663
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2665
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2664
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2666 2665
 	}
2667 2666
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2668
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2667
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2669 2668
 	}
2670 2669
 
2671 2670
 	// La taille des Log
@@ -2702,7 +2701,7 @@  discard block
 block discarded – undo
2702 2701
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2703 2702
 	// pour le rendre surchargeable, on va provoquer un reecriture
2704 2703
 	// systematique du noyau ou une baisse de perfs => a etudier)
2705
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2704
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2706 2705
 
2707 2706
 	// charger tout de suite le path et son cache
2708 2707
 	load_path_cache();
@@ -2738,7 +2737,7 @@  discard block
 block discarded – undo
2738 2737
 			!empty($_SERVER['QUERY_STRING'])
2739 2738
 			&& !strpos($_SERVER['REQUEST_URI'], '?')
2740 2739
 		) {
2741
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2740
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2742 2741
 		}
2743 2742
 	}
2744 2743
 
@@ -2774,7 +2773,7 @@  discard block
 block discarded – undo
2774 2773
 		) {
2775 2774
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2776 2775
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2777
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2776
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2778 2777
 			} else {
2779 2778
 				$uri_ref = '';
2780 2779
 			}
@@ -2868,7 +2867,7 @@  discard block
 block discarded – undo
2868 2867
 	}
2869 2868
 	if (!defined('_CACHE_RUBRIQUES')) {
2870 2869
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2871
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2870
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2872 2871
 	}
2873 2872
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2874 2873
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -3091,7 +3090,7 @@  discard block
 block discarded – undo
3091 3090
 					}
3092 3091
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3093 3092
 						spip_log($GLOBALS['visiteur_session']['nom']
3094
-							. ' ' . _VAR_MODE);
3093
+							. ' '._VAR_MODE);
3095 3094
 					}
3096 3095
 				} // pas autorise ?
3097 3096
 				else {
@@ -3106,7 +3105,7 @@  discard block
 block discarded – undo
3106 3105
 						if (!str_contains($self, 'page=login')) {
3107 3106
 							include_spip('inc/headers');
3108 3107
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3109
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3108
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3110 3109
 						}
3111 3110
 					}
3112 3111
 					// sinon tant pis
@@ -3156,10 +3155,10 @@  discard block
 block discarded – undo
3156 3155
 **/
3157 3156
 function verifier_visiteur() {
3158 3157
 	@spip_initialisation_core(
3159
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3160
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3161
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3162
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3158
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3159
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3160
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3161
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3163 3162
 	);
3164 3163
 
3165 3164
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3192,7 +3191,7 @@  discard block
 block discarded – undo
3192 3191
 	}
3193 3192
 
3194 3193
 	$h = (isset($_SERVER['PHP_AUTH_USER']) && !$GLOBALS['ignore_auth_http']);
3195
-	if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3194
+	if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3196 3195
 		$session = charger_fonction('session', 'inc');
3197 3196
 		if ($session()) {
3198 3197
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3272,7 +3271,7 @@  discard block
 block discarded – undo
3272 3271
 		if (!empty($GLOBALS['visiteur_session'])) {
3273 3272
 			include_spip('inc/session');
3274 3273
 			$cookie = lire_cookie_session();
3275
-			$s = serialize($GLOBALS['visiteur_session']) . '_' . ($cookie ?: '');
3274
+			$s = serialize($GLOBALS['visiteur_session']).'_'.($cookie ?: '');
3276 3275
 		}
3277 3276
 		$s = pipeline('definir_session', $s);
3278 3277
 		$session = ($s ? substr(md5($s), 0, 8) : '');
@@ -3320,8 +3319,8 @@  discard block
 block discarded – undo
3320 3319
 		foreach ($cookies_masques as $k) {
3321 3320
 			if (!empty($_COOKIE[$k])) {
3322 3321
 				$cookies_backup[$k] = $_COOKIE[$k];
3323
-				$_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3324
-				$_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3322
+				$_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3323
+				$_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3325 3324
 				$_COOKIE[$k] = $mask;
3326 3325
 			}
3327 3326
 		}
@@ -3439,11 +3438,11 @@  discard block
 block discarded – undo
3439 3438
 	$GLOBALS['_INC_PUBLIC']++;
3440 3439
 
3441 3440
 	// fix #4235
3442
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3441
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3443 3442
 
3444 3443
 
3445 3444
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3446
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3445
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3447 3446
 
3448 3447
 		$page = evaluer_fond($f, $contexte, $connect);
3449 3448
 		if ($page === '') {
@@ -3528,7 +3527,7 @@  discard block
 block discarded – undo
3528 3527
  * @return array|string
3529 3528
  */
3530 3529
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3531
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3530
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3532 3531
 	if (!$pathinfo) {
3533 3532
 		return $f;
3534 3533
 	}
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
28 28
 }
29 29
 if (!defined('_INC_DISTANT_USER_AGENT')) {
30
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
30
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
31 31
 }
32 32
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
33 33
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
37 37
 }
38 38
 
39
-define('_REGEXP_COPIE_LOCALE', ',' 	.
39
+define('_REGEXP_COPIE_LOCALE', ','.
40 40
 	preg_replace(
41 41
 		'@^https?:@',
42 42
 		'https?:',
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 	// si c'est la protection de soi-meme, retourner le path
75 75
 	if ($mode !== 'force' && preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
76
-		$source = substr((string) _DIR_IMG, strlen((string) _DIR_RACINE)) . urldecode($match[1]);
76
+		$source = substr((string) _DIR_IMG, strlen((string) _DIR_RACINE)).urldecode($match[1]);
77 77
 
78 78
 		return @file_exists($source) ? $source : false;
79 79
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		return false;
94 94
 	}
95 95
 
96
-	$localrac = _DIR_RACINE . $local;
96
+	$localrac = _DIR_RACINE.$local;
97 97
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
98 98
 
99 99
 	// test d'existence du fichier
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
 		if (!$taille_max) {
114 114
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
115 115
 		}
116
-		$localrac_tmp = $localrac . '.tmp';
116
+		$localrac_tmp = $localrac.'.tmp';
117 117
 		$res = recuperer_url(
118 118
 			$source,
119 119
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
120 120
 		);
121 121
 
122 122
 		if (!$res || !$res['length'] && $res['status'] != 304) {
123
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
123
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
124 124
 			@unlink($localrac_tmp);
125 125
 		}
126 126
 		else {
127
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
127
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
128 128
 		}
129 129
 		if (!$res || !$res['length']) {
130 130
 			// si $t c'est sans doute juste un not-modified-since
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			&& is_callable($callback_valider_url)
138 138
 			&& !$callback_valider_url($res['url'])
139 139
 		) {
140
-			spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
140
+			spip_log('copie_locale : url finale '.$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
141 141
 			@unlink($localrac_tmp);
142 142
 			return $t ? $local : false;
143 143
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 	if (!$is_known_host) {
229 229
 		$host = trim($parsed_url['host'], '.');
230
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
230
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
231 231
 			$ip = gethostbyname($host);
232 232
 			if ($ip === $host) {
233 233
 				// Error condition for gethostbyname()
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 				$ip = false;
248 248
 			}
249 249
 		}
250
-		if ($ip && ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
250
+		if ($ip && !filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
251 251
 			return false;
252 252
 		}
253 253
 	}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 				}
329 329
 			}
330 330
 			if ($taille > 500) {
331
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
331
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
332 332
 			}
333 333
 		}
334 334
 
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 				foreach ($donnees as $cle => $valeur) {
362 362
 					if (is_array($valeur)) {
363 363
 						foreach ($valeur as $val2) {
364
-							$chaines[] = rawurlencode($cle) . '[]=' . rawurlencode((string) $val2);
364
+							$chaines[] = rawurlencode($cle).'[]='.rawurlencode((string) $val2);
365 365
 						}
366 366
 					} else {
367
-						$chaines[] = rawurlencode($cle) . '=' . rawurlencode((string) $valeur);
367
+						$chaines[] = rawurlencode($cle).'='.rawurlencode((string) $valeur);
368 368
 					}
369 369
 				}
370 370
 				$chaine = implode('&', $chaines);
@@ -466,13 +466,13 @@  discard block
 block discarded – undo
466 466
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
467 467
 	}
468 468
 
469
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
469
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
470 470
 
471 471
 	// Ajout des en-têtes spécifiques si besoin
472 472
 	$formatted_data = '';
473 473
 	if (!empty($options['headers'])) {
474 474
 		foreach ($options['headers'] as $champ => $valeur) {
475
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
475
+			$formatted_data .= $champ.': '.$valeur."\r\n";
476 476
 		}
477 477
 	}
478 478
 
@@ -480,9 +480,9 @@  discard block
 block discarded – undo
480 480
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
481 481
 		$head .= $formatted_data;
482 482
 		if (stripos($head, 'Content-Length:') === false) {
483
-			$head .= 'Content-Length: ' . strlen((string) $postdata) . "\r\n";
483
+			$head .= 'Content-Length: '.strlen((string) $postdata)."\r\n";
484 484
 		}
485
-		$formatted_data = $head . "\r\n" . $postdata;
485
+		$formatted_data = $head."\r\n".$postdata;
486 486
 		if (
487 487
 			strlen((string) $postdata) && !$methode_demandee
488 488
 		) {
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
496 496
 	$url = preg_replace(',^feed://,i', 'http://', $url);
497 497
 	if (!tester_url_absolue($url)) {
498
-		$url = 'http://' . $url;
498
+		$url = 'http://'.$url;
499 499
 	} elseif (str_starts_with($url, '//')) {
500
-		$url = 'http:' . $url;
500
+		$url = 'http:'.$url;
501 501
 	}
502 502
 
503 503
 	$url = url_to_ascii($url);
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		$options['if_modified_since']
527 527
 	);
528 528
 	if (!$handle) {
529
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
529
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
530 530
 
531 531
 		return false;
532 532
 	}
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 					'status' => 200,
557 557
 				];
558 558
 			} else {
559
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
559
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
560 560
 				return false;
561 561
 			}
562 562
 		} elseif ($res['location'] && $options['follow_location']) {
@@ -573,11 +573,11 @@  discard block
 block discarded – undo
573 573
 				$options['methode'] = 'GET';
574 574
 				$options['datas'] = '';
575 575
 			}
576
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
576
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
577 577
 
578 578
 			return recuperer_url($url, $options);
579 579
 		} elseif ($res['status'] !== 200) {
580
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
580
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
581 581
 		}
582 582
 		$result['status'] = $res['status'];
583 583
 		if (isset($res['headers'])) {
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 
594 594
 	// on ne veut que les entetes
595 595
 	if (!$options['taille_max'] || $options['methode'] == 'HEAD' || $result['status'] == '304') {
596
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result, JSON_THROW_ON_ERROR), 'distant' . _LOG_DEBUG);
596
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result, JSON_THROW_ON_ERROR), 'distant'._LOG_DEBUG);
597 597
 		return $result;
598 598
 	}
599 599
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 	$gz = false;
605 605
 	if (preg_match(",\bContent-Encoding: .*gzip,is", (string) $result['headers'])) {
606
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
606
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
607 607
 	}
608 608
 
609 609
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -641,10 +641,10 @@  discard block
 block discarded – undo
641 641
 		$trace = json_decode(json_encode($result, JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR);
642 642
 	} catch (JsonException $e) {
643 643
 		$trace = [];
644
-		spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_ERREUR);
644
+		spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_ERREUR);
645 645
 	}
646 646
 	$trace['page'] = '...';
647
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace, JSON_THROW_ON_ERROR), 'distant' . _LOG_DEBUG);
647
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace, JSON_THROW_ON_ERROR), 'distant'._LOG_DEBUG);
648 648
 
649 649
 	return $result;
650 650
 }
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 	$sig['url'] = $url;
699 699
 
700 700
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
701
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
701
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
702 702
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
703 703
 	$cache = "$sub$cache";
704 704
 
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	$fp = false;
753 753
 	if ($fichier) {
754 754
 		include_spip('inc/acces');
755
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
755
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
756 756
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
757 757
 		if (!$fp && file_exists($fichier)) {
758 758
 			return filesize($fichier);
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 	}
812 812
 	$result['status'] = (int) $r[1];
813 813
 	while ($s = trim(fgets($handle, 16384))) {
814
-		$result['headers'][] = $s . "\n";
814
+		$result['headers'][] = $s."\n";
815 815
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
816 816
 		[, $d, $v] = $r;
817 817
 		if (strtolower(trim($d)) == 'location' && $result['status'] >= 300 && $result['status'] < 400) {
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 
861 861
 	// on se place tout le temps comme si on était a la racine
862 862
 	if (_DIR_RACINE) {
863
-		$d = preg_replace(',^' . preg_quote((string) _DIR_RACINE, ',') . ',', '', (string) $d);
863
+		$d = preg_replace(',^'.preg_quote((string) _DIR_RACINE, ',').',', '', (string) $d);
864 864
 	}
865 865
 
866 866
 	$m = md5($source);
@@ -868,18 +868,18 @@  discard block
 block discarded – undo
868 868
 	$filename =
869 869
 		$d
870 870
 		. substr(preg_replace(',[^\w-],', '', basename($source, $extension)), 0, 16)
871
-		. '-' . substr($m, 0, 8)
871
+		. '-'.substr($m, 0, 8)
872 872
 		. ".$extension";
873 873
 
874 874
 	// ancien nommage des fichiers distants : renommer le fichier a la volee si besoin pour eviter de dupliquer les caches
875 875
 	$legacy_filename =
876 876
 		$d
877
-		. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
877
+		. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
878 878
 		. substr($m, 0, 4)
879 879
 		. ".$extension";
880 880
 
881
-	if (file_exists(_DIR_RACINE . $legacy_filename)) {
882
-		@rename(_DIR_RACINE . $legacy_filename, $filename);
881
+	if (file_exists(_DIR_RACINE.$legacy_filename)) {
882
+		@rename(_DIR_RACINE.$legacy_filename, $filename);
883 883
 	}
884 884
 
885 885
 	return $filename;
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 	// Si c'est deja local pas de souci
905 905
 	if (!tester_url_absolue($source)) {
906 906
 		if (_DIR_RACINE) {
907
-			$source = preg_replace(',^' . preg_quote((string) _DIR_RACINE, ',') . ',', '', $source);
907
+			$source = preg_replace(',^'.preg_quote((string) _DIR_RACINE, ',').',', '', $source);
908 908
 		}
909 909
 
910 910
 		return $source;
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 		$ext
923 923
 		&& preg_match(',^\w+$,', $ext)
924 924
 		&& ($f = nom_fichier_copie_locale($source, $ext))
925
-		&& file_exists(_DIR_RACINE . $f)
925
+		&& file_exists(_DIR_RACINE.$f)
926 926
 	) {
927 927
 		return $f;
928 928
 	}
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
 
931 931
 	// Si c'est deja dans la table des documents,
932 932
 	// ramener le nom de sa copie potentielle
933
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
933
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
934 934
 
935 935
 	if ($ext) {
936 936
 		return nom_fichier_copie_locale($source, $ext);
@@ -941,9 +941,9 @@  discard block
 block discarded – undo
941 941
 
942 942
 	$ext = $path_parts ? $path_parts['extension'] : '';
943 943
 
944
-	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
944
+	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
945 945
 		$f = nom_fichier_copie_locale($source, $ext);
946
-		if (file_exists(_DIR_RACINE . $f)) {
946
+		if (file_exists(_DIR_RACINE.$f)) {
947 947
 			return $f;
948 948
 		}
949 949
 	}
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 	// Ping  pour voir si son extension est connue et autorisee
952 952
 	// avec mise en cache du resultat du ping
953 953
 
954
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
954
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
955 955
 	if (
956 956
 		!@file_exists($cache)
957 957
 		|| !($path_parts = @unserialize(spip_file_get_contents($cache)))
@@ -961,11 +961,11 @@  discard block
 block discarded – undo
961 961
 		ecrire_fichier($cache, serialize($path_parts));
962 962
 	}
963 963
 	$ext = empty($path_parts['extension']) ? '' : $path_parts['extension'];
964
-	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
964
+	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
965 965
 		return nom_fichier_copie_locale($source, $ext);
966 966
 	}
967 967
 
968
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
968
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
969 969
 	return null;
970 970
 }
971 971
 
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
 		} else {
1065 1065
 			if ($a['body']) {
1066 1066
 				$a['extension'] = $extension;
1067
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1067
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1068 1068
 				ecrire_fichier($a['fichier'], $a['body']);
1069 1069
 				$size_image = @spip_getimagesize($a['fichier']);
1070 1070
 				$a['largeur'] = (int) $size_image[0];
@@ -1127,20 +1127,20 @@  discard block
 block discarded – undo
1127 1127
 	$t = null;
1128 1128
 	if (in_array($mime_type, ['text/plain', '', 'application/octet-stream'])) {
1129 1129
 		if (!$t && preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)) {
1130
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1130
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1131 1131
 		}
1132 1132
 		if (
1133 1133
 			!$t
1134 1134
 			&& preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1135 1135
 			&& preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1136 1136
 		) {
1137
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1137
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1138 1138
 		}
1139 1139
 	}
1140 1140
 
1141 1141
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1142 1142
 	if (!$t) {
1143
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1143
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1144 1144
 	}
1145 1145
 
1146 1146
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1151,11 +1151,11 @@  discard block
 block discarded – undo
1151 1151
 		&& preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1152 1152
 	) {
1153 1153
 		# eviter xxx.3 => 3gp (> SPIP 3)
1154
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1154
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1155 1155
 	}
1156 1156
 
1157 1157
 	if ($t) {
1158
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1158
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1159 1159
 		return $t['extension'];
1160 1160
 	} else {
1161 1161
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
 		}
1259 1259
 	} else {
1260 1260
 		$scheme = $t['scheme'];
1261
-		$noproxy = $scheme . '://';
1261
+		$noproxy = $scheme.'://';
1262 1262
 	}
1263 1263
 	if (isset($t['user'])) {
1264 1264
 		// user et pass doivent être passés en urlencodé dans l'URL, on redecode ici
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
 	}
1274 1274
 
1275 1275
 	if (!empty($t['query'])) {
1276
-		$path .= '?' . $t['query'];
1276
+		$path .= '?'.$t['query'];
1277 1277
 	}
1278 1278
 
1279 1279
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1347,29 +1347,29 @@  discard block
 block discarded – undo
1347 1347
 	$proxy_user = '';
1348 1348
 	$http_proxy = need_proxy($host);
1349 1349
 	if ($user) {
1350
-		$user = urlencode((string) $user[0]) . ':' . urlencode((string) $user[1]);
1350
+		$user = urlencode((string) $user[0]).':'.urlencode((string) $user[1]);
1351 1351
 	}
1352 1352
 
1353 1353
 	$connect = '';
1354 1354
 	if ($http_proxy) {
1355
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') && in_array($scheme, ['tls','ssl'])) {
1356
-			$path_host = ($user ? "$user@" : '') . $host . (($port != 80) ? ":$port" : '');
1357
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1355
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') && in_array($scheme, ['tls', 'ssl'])) {
1356
+			$path_host = ($user ? "$user@" : '').$host.(($port != 80) ? ":$port" : '');
1357
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1358 1358
 				. "Host: $path_host\r\n"
1359 1359
 				. "Proxy-Connection: Keep-Alive\r\n";
1360 1360
 		} else {
1361
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1361
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1362 1362
 				. ($user ? "$user@" : '')
1363
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1363
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1364 1364
 		}
1365 1365
 		$t2 = @parse_url($http_proxy);
1366 1366
 		$first_host = $t2['host'];
1367 1367
 		$first_port = ($t2['port'] ?? null) ?: 80;
1368 1368
 		if ($t2['user'] ?? null) {
1369
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1369
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1370 1370
 		}
1371 1371
 	} else {
1372
-		$first_host = $noproxy . $host;
1372
+		$first_host = $noproxy.$host;
1373 1373
 		$first_port = $port;
1374 1374
 	}
1375 1375
 
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 		);
1393 1393
 		spip_log("Recuperer $path sur $first_host:$first_port par $f (via CONNECT)", 'connect');
1394 1394
 		if (!$f) {
1395
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1395
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1396 1396
 			return $errno;
1397 1397
 		}
1398 1398
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 			|| ($res = explode(' ', $res)) === []
1406 1406
 			|| $res[1] !== '200'
1407 1407
 		) {
1408
-			spip_log("Echec CONNECT sur $first_host:$first_port", 'connect' . _LOG_INFO_IMPORTANTE);
1408
+			spip_log("Echec CONNECT sur $first_host:$first_port", 'connect'._LOG_INFO_IMPORTANTE);
1409 1409
 			fclose($f);
1410 1410
 
1411 1411
 			return false;
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 		} while (!$f && $ntry-- && $errno !== 110 && sleep(1));
1423 1423
 		spip_log("Recuperer $path sur $first_host:$first_port par $f");
1424 1424
 		if (!$f) {
1425
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1425
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1426 1426
 
1427 1427
 			return $errno;
1428 1428
 		}
@@ -1432,16 +1432,16 @@  discard block
 block discarded – undo
1432 1432
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1433 1433
 
1434 1434
 	$host_port = $host;
1435
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1435
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1436 1436
 		$host_port .= ":$port";
1437 1437
 	}
1438 1438
 	$req = "$method $path $vers\r\n"
1439 1439
 		. "Host: $host_port\r\n"
1440
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1441
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1440
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1441
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1442 1442
 		. ($site ? "Referer: $site/$referer\r\n" : '')
1443
-		. ($date ? 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n") : '')
1444
-		. ($user ? 'Authorization: Basic ' . base64_encode(urldecode($user)) . "\r\n" : '')
1443
+		. ($date ? 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n") : '')
1444
+		. ($user ? 'Authorization: Basic '.base64_encode(urldecode($user))."\r\n" : '')
1445 1445
 		. ($proxy_user ? "Proxy-Authorization: Basic $proxy_user\r\n" : '')
1446 1446
 		. (strpos($vers, '1.1') ? "Keep-Alive: 300\r\nConnection: keep-alive\r\n" : '');
1447 1447
 
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
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	$md5args = md5($arguments);
70 70
 
71 71
 	// si pas de date programee, des que possible
72
-	$duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND ';
72
+	$duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND ';
73 73
 	if (!$time) {
74 74
 		$time = time();
75 75
 		$duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution
@@ -94,9 +94,8 @@  discard block
 block discarded – undo
94 94
 			'id_job',
95 95
 			'spip_jobs',
96 96
 			$duplicate_where =
97
-				$duplicate_where . 'fonction=' . sql_quote($function)
98
-				. (($no_duplicate === 'function_only') ? '' :
99
-			' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file))
97
+				$duplicate_where.'fonction='.sql_quote($function)
98
+				. (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file))
100 99
 		))
101 100
 	) {
102 101
 		return $id_job;
@@ -108,9 +107,9 @@  discard block
 block discarded – undo
108 107
 	// doit s'effacer
109 108
 	if (
110 109
 		$no_duplicate
111
-		&& ($id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where"))
110
+		&& ($id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where"))
112 111
 	) {
113
-		sql_delete('spip_jobs', 'id_job=' . intval($id_job));
112
+		sql_delete('spip_jobs', 'id_job='.intval($id_job));
114 113
 
115 114
 		return $id_prev;
116 115
 	}
@@ -122,9 +121,9 @@  discard block
 block discarded – undo
122 121
 	// ie cas d'un char non acceptables sur certains type de champs
123 122
 	// qui coupe la valeur
124 123
 	if (defined('_JQ_INSERT_CHECK_ARGS') && $id_job) {
125
-		$args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job));
124
+		$args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job));
126 125
 		if ($args !== $arguments) {
127
-			spip_log('arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' . var_export(
126
+			spip_log('arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : '.var_export(
128 127
 				$arguments,
129 128
 				true
130 129
 			), 'queue');
@@ -154,7 +153,7 @@  discard block
 block discarded – undo
154 153
 function queue_purger() {
155 154
 	include_spip('base/abstract_sql');
156 155
 	sql_delete('spip_jobs');
157
-	sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')');
156
+	sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')');
158 157
 	include_spip('inc/genie');
159 158
 	genie_queue_watch_dist();
160 159
 }
@@ -170,8 +169,8 @@  discard block
 block discarded – undo
170 169
 	include_spip('base/abstract_sql');
171 170
 
172 171
 	if (
173
-		($row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job)))
174
-		&& ($res = sql_delete('spip_jobs', 'id_job=' . intval($id_job)))
172
+		($row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job)))
173
+		&& ($res = sql_delete('spip_jobs', 'id_job='.intval($id_job)))
175 174
 	) {
176 175
 		queue_unlink_job($id_job);
177 176
 		// est-ce une tache cron qu'il faut relancer ?
@@ -221,7 +220,7 @@  discard block
 block discarded – undo
221 220
  *  resultat du sql_delete
222 221
  */
223 222
 function queue_unlink_job($id_job) {
224
-	return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job));
223
+	return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job));
225 224
 }
226 225
 
227 226
 /**
@@ -237,7 +236,7 @@  discard block
 block discarded – undo
237 236
 	// deserialiser les arguments
238 237
 	$args = unserialize($row['args']);
239 238
 	if (!is_array($args)) {
240
-		spip_log('arguments job errones ' . var_export($row, true), 'queue');
239
+		spip_log('arguments job errones '.var_export($row, true), 'queue');
241 240
 		return false;
242 241
 	}
243 242
 
@@ -254,14 +253,14 @@  discard block
 block discarded – undo
254 253
 	}
255 254
 
256 255
 	if (!function_exists($fonction)) {
257
-		spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue');
256
+		spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue');
258 257
 
259 258
 		return false;
260 259
 	}
261 260
 
262
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue');
261
+	spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue');
263 262
 	$res = $fonction(...$args);
264
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue');
263
+	spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue');
265 264
 
266 265
 	return $res;
267 266
 }
@@ -292,14 +291,14 @@  discard block
 block discarded – undo
292 291
 function queue_schedule($force_jobs = null) {
293 292
 	$time = time();
294 293
 	if (defined('_DEBUG_BLOCK_QUEUE')) {
295
-		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG);
294
+		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG);
296 295
 
297 296
 		return;
298 297
 	}
299 298
 
300 299
 	// rien a faire si le prochain job est encore dans le futur
301 300
 	if (queue_sleep_time_to_next_job() > 0 && (!$force_jobs || !count($force_jobs))) {
302
-		spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG);
301
+		spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG);
303 302
 
304 303
 		return;
305 304
 	}
@@ -320,7 +319,7 @@  discard block
 block discarded – undo
320 319
 	}
321 320
 	$end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE;
322 321
 
323
-	spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG);
322
+	spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG);
324 323
 
325 324
 	if (!defined('_JQ_MAX_JOBS_EXECUTE')) {
326 325
 		define('_JQ_MAX_JOBS_EXECUTE', 200);
@@ -334,19 +333,19 @@  discard block
 block discarded – undo
334 333
 	// lorsqu'un job cron n'a pas fini, sa priorite est descendue
335 334
 	// pour qu'il ne bloque pas les autres jobs en attente
336 335
 	if (is_array($force_jobs) && count($force_jobs)) {
337
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs);
336
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs);
338 337
 	} else {
339 338
 		$now = date('Y-m-d H:i:s', $time);
340
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now);
339
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now);
341 340
 	}
342 341
 
343 342
 	register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible
344
-	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1));
343
+	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1));
345 344
 	do {
346 345
 		if ($row = array_shift($res)) {
347 346
 			$nbj++;
348 347
 			// il faut un verrou, a base de sql_delete
349
-			if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) {
348
+			if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) {
350 349
 				#spip_log("JQ schedule job ".$nbj." OK",'jq');
351 350
 				// on reinsert dans la base aussitot avec un status=_JQ_PENDING
352 351
 				$row['status'] = _JQ_PENDING;
@@ -361,13 +360,13 @@  discard block
 block discarded – undo
361 360
 				queue_close_job($row, $time, $result);
362 361
 			}
363 362
 		}
364
-		spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG);
363
+		spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG);
365 364
 	} while ($nbj < _JQ_MAX_JOBS_EXECUTE && $row && $time < $end_time);
366
-	spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG);
365
+	spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG);
367 366
 
368 367
 	if ($row = array_shift($res)) {
369 368
 		queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP
370
-		spip_log('JQ encore !', 'jq' . _LOG_DEBUG);
369
+		spip_log('JQ encore !', 'jq'._LOG_DEBUG);
371 370
 	} else {
372 371
 		queue_update_next_job_time();
373 372
 	}
@@ -402,9 +401,9 @@  discard block
 block discarded – undo
402 401
 		}
403 402
 	}
404 403
 	// purger ses liens eventuels avec des objets
405
-	sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job']));
404
+	sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job']));
406 405
 	// supprimer le job fini
407
-	sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']));
406
+	sql_delete('spip_jobs', 'id_job='.intval($row['id_job']));
408 407
 }
409 408
 
410 409
 /**
@@ -477,18 +476,18 @@  discard block
 block discarded – undo
477 476
 	$res = sql_allfetsel(
478 477
 		'*',
479 478
 		'spip_jobs',
480
-		'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180))
479
+		'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180))
481 480
 	);
482 481
 	if (is_array($res)) {
483 482
 		foreach ($res as $row) {
484 483
 			queue_close_job($row, $time);
485
-			spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, true), 'job_mort' . _LOG_ERREUR);
484
+			spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, true), 'job_mort'._LOG_ERREUR);
486 485
 		}
487 486
 	}
488 487
 
489 488
 	// chercher la date du prochain job si pas connu
490 489
 	if (is_null($next) || is_null(queue_sleep_time_to_next_job())) {
491
-		$date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1');
490
+		$date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1');
492 491
 		$next = strtotime($date);
493 492
 	}
494 493
 	if (!is_null($next_time)) {
@@ -501,7 +500,7 @@  discard block
 block discarded – undo
501 500
 		if (is_null($nb_jobs_scheduled)) {
502 501
 			$nb_jobs_scheduled = sql_countsel(
503 502
 				'spip_jobs',
504
-				'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time))
503
+				'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time))
505 504
 			);
506 505
 		} elseif ($next <= $time) {
507 506
 			$nb_jobs_scheduled++;
@@ -570,7 +569,7 @@  discard block
 block discarded – undo
570 569
 	}
571 570
 
572 571
 	// ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent
573
-	if (file_exists($lock = _DIR_TMP . 'cron.lock') && !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
572
+	if (file_exists($lock = _DIR_TMP.'cron.lock') && !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
574 573
 		return $texte;
575 574
 	}
576 575
 
@@ -642,7 +641,7 @@  discard block
 block discarded – undo
642 641
 				$port = 80;
643 642
 		}
644 643
 		$fp = @fsockopen(
645
-			$scheme . $parts['host'],
644
+			$scheme.$parts['host'],
646 645
 			$parts['port'] ?? $port,
647 646
 			$errno,
648 647
 			$errstr,
@@ -652,13 +651,13 @@  discard block
 block discarded – undo
652 651
 		if ($fp) {
653 652
 			$host_sent = $parts['host'];
654 653
 			if (isset($parts['port']) && $parts['port'] !== $port) {
655
-				$host_sent .= ':' . $parts['port'];
654
+				$host_sent .= ':'.$parts['port'];
656 655
 			}
657 656
 			$timeout = 200; // ms
658 657
 			stream_set_timeout($fp, 0, $timeout * 1000);
659
-			$query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : '');
660
-			$out = 'GET ' . $query . " HTTP/1.1\r\n";
661
-			$out .= 'Host: ' . $host_sent . "\r\n";
658
+			$query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : '');
659
+			$out = 'GET '.$query." HTTP/1.1\r\n";
660
+			$out .= 'Host: '.$host_sent."\r\n";
662 661
 			$out .= "Connection: Close\r\n\r\n";
663 662
 			fwrite($fp, $out);
664 663
 			spip_timer('read');
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +118 added lines, -119 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	}
101 101
 
102 102
 	include_fichiers_fonctions();
103
-	foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) {
103
+	foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) {
104 104
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
105 105
 		if (is_callable($f)) {
106 106
 			return $f;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	// affichage "GIT [master: abcdef]"
236 236
 	$commit = $desc['commit_short'] ?? $desc['commit'];
237 237
 	if ($desc['branch']) {
238
-		$commit = $desc['branch'] . ': ' . $commit;
238
+		$commit = $desc['branch'].': '.$commit;
239 239
 	}
240 240
 	return "{$desc['vcs']} [$commit]";
241 241
 }
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
 	}
257 257
 
258 258
 	// version installee par GIT
259
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
259
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
260 260
 		$currentHead = trim(substr((string) $c, 4));
261
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
261
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
262 262
 			return [
263 263
 				'vcs' => 'GIT',
264 264
 				'branch' => basename($currentHead),
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 
274 274
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
275 275
 // et laisser passer les fonctions personnelles baptisees image_...
276
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
277
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
278
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
279
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
280
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
281
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
276
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
277
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
278
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
279
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
280
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
281
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
282 282
 
283 283
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
284 284
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
  */
438 438
 function filtre_debug(mixed $val, $key = null) {
439 439
 	$debug = (
440
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
441
-		) . var_export($val, true);
440
+		is_null($key) ? '' : (var_export($key, true).' = ')
441
+		).var_export($val, true);
442 442
 
443 443
 	include_spip('inc/autoriser');
444 444
 	if (autoriser('webmestre')) {
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 		$is_file = false;
495 495
 	}
496 496
 	if ($is_file) {
497
-		$is_local_file = function ($path) {
497
+		$is_local_file = function($path) {
498 498
 			if (str_contains($path, '?')) {
499 499
 				$path = supprimer_timestamp($path);
500 500
 				// remove ?24px added by find_in_theme on .svg files
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 					&& preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)
543 543
 				) {
544 544
 					$srcover = $match[1];
545
-					$srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args);
545
+					$srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args);
546 546
 					$srcover_filter = extraire_attribut($srcover_filter, 'src');
547 547
 					$reduit = str_replace($srcover, $srcover_filter, (string) $reduit);
548 548
 				}
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 	// " -> &quot; et tout ce genre de choses
944 944
 	$u = $GLOBALS['meta']['pcre_u'];
945 945
 	$texte = str_replace('&nbsp;', ' ', $texte);
946
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
946
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
947 947
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
948 948
 	$texte = entites_html($texte, false, false);
949 949
 	// mais bien echapper les double quotes !
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 		return '';
1006 1006
 	}
1007 1007
 	return preg_replace(
1008
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1008
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1009 1009
 		'',
1010 1010
 		$texte
1011 1011
 	);
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 		return '';
1036 1036
 	}
1037 1037
 	if (preg_match(
1038
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1038
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1039 1039
 			$texte,
1040 1040
 			$regs
1041 1041
 		)
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 		return '';
1128 1128
 	}
1129 1129
 	$u = $GLOBALS['meta']['pcre_u'];
1130
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1130
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1131 1131
 	$texte = preg_replace('/<(p|br)( [^>]*)?>/iS', "\n\n", $texte);
1132 1132
 	$texte = preg_replace("/^\n+/", '', $texte);
1133 1133
 	$texte = preg_replace("/\n+$/", '', $texte);
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 		)
1166 1166
 	) {
1167 1167
 		foreach ($liens[0] as $a) {
1168
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1168
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1169 1169
 			$ablank = inserer_attribut($a, 'rel', $rel);
1170 1170
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1171 1171
 			$texte = str_replace($a, $ablank, $texte);
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
 		foreach ($regs[0] as $a) {
1194 1194
 			$rel = extraire_attribut($a, 'rel') ?? '';
1195 1195
 			if (!str_contains($rel, 'nofollow')) {
1196
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1196
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1197 1197
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1198 1198
 				$texte = str_replace($a, $anofollow, $texte);
1199 1199
 			}
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1227 1227
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1228 1228
 
1229
-	return preg_replace('@^\s*<br />@S' . $u, '', $texte);
1229
+	return preg_replace('@^\s*<br />@S'.$u, '', $texte);
1230 1230
 }
1231 1231
 
1232 1232
 /**
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 
1315 1315
 		// Calcul de la taille et choix de l'unité
1316 1316
 		$affichage = _T(
1317
-			'spip:taille_' . $unites[$puissance] . $suffixe_item,
1317
+			'spip:taille_'.$unites[$puissance].$suffixe_item,
1318 1318
 			[
1319 1319
 				'taille' => round($octets / $kilo ** $puissance, $precisions[$puissance])
1320 1320
 			]
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 	}
1349 1349
 	$u = $GLOBALS['meta']['pcre_u'];
1350 1350
 	if ($textebrut) {
1351
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1351
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1352 1352
 	}
1353 1353
 	$texte = texte_backend($texte);
1354 1354
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	# un message pour abs_url
1384 1384
 	$GLOBALS['mode_abs_url'] = 'url';
1385 1385
 	$url = trim($url);
1386
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1386
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1387 1387
 
1388 1388
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1389 1389
 }
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
 
1590 1590
 	$debut = '';
1591 1591
 	$suite = $texte;
1592
-	while ($t = strpos((string) ('-' . $suite), "\n", 1)) {
1592
+	while ($t = strpos((string) ('-'.$suite), "\n", 1)) {
1593 1593
 		$debut .= substr($suite, 0, $t - 1);
1594 1594
 		$suite = substr($suite, $t);
1595 1595
 		$car = substr($suite, 0, 1);
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
 			$suite = substr($suite, strlen($regs[0]));
1608 1608
 		}
1609 1609
 	}
1610
-	$texte = $debut . $suite;
1610
+	$texte = $debut.$suite;
1611 1611
 
1612 1612
 	if ($collecteurModeles) {
1613 1613
 		$texte = $collecteurModeles->retablir($texte);
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
 
1616 1616
 	$texte = CollecteurHtmlTag::retablir_depuisHtmlBase64($texte);
1617 1617
 
1618
-	return $texte . $fin;
1618
+	return $texte.$fin;
1619 1619
 }
1620 1620
 
1621 1621
 
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
 		}
1655 1655
 		// Compatibilité avec le prototype de fonction précédente qui utilisait un boolean
1656 1656
 		if (is_bool($options)) {
1657
-			trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => ' . var_export($options, true) . ']');
1657
+			trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => '.var_export($options, true).']');
1658 1658
 			$options = ['echappe_span' => $options];
1659 1659
 		}
1660 1660
 		if (!isset($options['echappe_span'])) {
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 
1712 1712
 		// Compatibilité avec le prototype de fonction précédente qui utilisait un boolean
1713 1713
 		if (is_bool($options)) {
1714
-			trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => ' . var_export($options, true) . ']');
1714
+			trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => '.var_export($options, true).']');
1715 1715
 			$options = ['echappe_span' => $options, 'lang_defaut' => _LANGUE_PAR_DEFAUT];
1716 1716
 		}
1717 1717
 		if (!isset($options['echappe_span'])) {
@@ -1880,7 +1880,7 @@  discard block
 block discarded – undo
1880 1880
 	if (is_array($balise)) {
1881 1881
 		array_walk(
1882 1882
 			$balise,
1883
-			function (&$a, $key, $t) {
1883
+			function(&$a, $key, $t) {
1884 1884
 				$a = extraire_attribut($a, $t);
1885 1885
 			},
1886 1886
 			$attribut
@@ -1974,14 +1974,14 @@  discard block
 block discarded – undo
1974 1974
 
1975 1975
 	if ($old !== null) {
1976 1976
 		// Remplacer l'ancien attribut du meme nom
1977
-		$balise = $r[1] . $insert . $r[5];
1977
+		$balise = $r[1].$insert.$r[5];
1978 1978
 	} else {
1979 1979
 		// preferer une balise " />" (comme <img />)
1980 1980
 		if (preg_match(',/>,', $balise)) {
1981
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
1981
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
1982 1982
 		} // sinon une balise <a ...> ... </a>
1983 1983
 		else {
1984
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
1984
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
1985 1985
 		}
1986 1986
 	}
1987 1987
 
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
 			in_array($operation, ['ajouter', 'commuter'])
2040 2040
 			&& !$is_class_presente
2041 2041
 		) {
2042
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2042
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2043 2043
 		} elseif (
2044 2044
 			in_array($operation, ['supprimer', 'commuter'])
2045 2045
 			&& $is_class_presente
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
 // Quelques fonctions de calcul arithmetique
2110 2110
 //
2111 2111
 function floatstr($a) {
2112
-	return str_replace(',', '.', (string)(float) $a);
2112
+	return str_replace(',', '.', (string) (float) $a);
2113 2113
 }
2114 2114
 function strize($f, $a, $b) {
2115 2115
 	return floatstr($f(floatstr($a), floatstr($b)));
@@ -2250,13 +2250,13 @@  discard block
 block discarded – undo
2250 2250
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2251 2251
 		define('_TAGS_NOM_AUTEUR', '');
2252 2252
 	}
2253
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2253
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2254 2254
 	foreach ($tags_acceptes as $tag) {
2255 2255
 		if (strlen($tag)) {
2256
-			$remp1[] = '<' . trim($tag) . '>';
2257
-			$remp1[] = '</' . trim($tag) . '>';
2258
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2259
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2256
+			$remp1[] = '<'.trim($tag).'>';
2257
+			$remp1[] = '</'.trim($tag).'>';
2258
+			$remp2[] = '\x60'.trim($tag).'\x61';
2259
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2260 2260
 		}
2261 2261
 	}
2262 2262
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2375,10 +2375,10 @@  discard block
 block discarded – undo
2375 2375
 	$fichier = basename($url);
2376 2376
 
2377 2377
 	return '<a rel="enclosure"'
2378
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2379
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2380
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2381
-	. '>' . $fichier . '</a>';
2378
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2379
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2380
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2381
+	. '>'.$fichier.'</a>';
2382 2382
 }
2383 2383
 
2384 2384
 /**
@@ -2406,9 +2406,9 @@  discard block
 block discarded – undo
2406 2406
 			} # vieux data
2407 2407
 			$fichier = basename($url);
2408 2408
 			$enclosures[] = '<enclosure'
2409
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2410
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2411
-				. ($length ? ' length="' . $length . '"' : '')
2409
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2410
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2411
+				. ($length ? ' length="'.$length.'"' : '')
2412 2412
 				. ' />';
2413 2413
 		}
2414 2414
 	}
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
 		if (extraire_attribut($e, 'rel') == 'tag') {
2435 2435
 			$subjects .= '<dc:subject>'
2436 2436
 				. texte_backend(textebrut($e))
2437
-				. '</dc:subject>' . "\n";
2437
+				. '</dc:subject>'."\n";
2438 2438
 		}
2439 2439
 	}
2440 2440
 
@@ -2503,7 +2503,7 @@  discard block
 block discarded – undo
2503 2503
 	if (is_array($texte)) {
2504 2504
 		array_walk(
2505 2505
 			$texte,
2506
-			function (&$a, $key, $t) {
2506
+			function(&$a, $key, $t) {
2507 2507
 				$a = extraire_balises($a, $t);
2508 2508
 			},
2509 2509
 			$tag
@@ -2631,7 +2631,7 @@  discard block
 block discarded – undo
2631 2631
 		if ($fond != '404') {
2632 2632
 			$contexte = array_shift($p);
2633 2633
 			$contexte['page'] = $fond;
2634
-			$action = preg_replace('/([?]' . preg_quote((string) $fond, '/') . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2634
+			$action = preg_replace('/([?]'.preg_quote((string) $fond, '/').'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2635 2635
 		}
2636 2636
 	}
2637 2637
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2686,9 +2686,9 @@  discard block
 block discarded – undo
2686 2686
 			. '"'
2687 2687
 			. (is_null($val)
2688 2688
 				? ''
2689
-				: ' value="' . entites_html($val) . '"'
2689
+				: ' value="'.entites_html($val).'"'
2690 2690
 			)
2691
-			. ' type="hidden"' . "\n/>";
2691
+			. ' type="hidden"'."\n/>";
2692 2692
 	}
2693 2693
 
2694 2694
 	return implode('', $hidden);
@@ -2798,7 +2798,7 @@  discard block
 block discarded – undo
2798 2798
 
2799 2799
 	return preg_replace_callback(
2800 2800
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2801
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2801
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2802 2802
 		$contenu
2803 2803
 	);
2804 2804
 }
@@ -2862,14 +2862,14 @@  discard block
 block discarded – undo
2862 2862
 	) {
2863 2863
 		$distant = true;
2864 2864
 		$cssf = parse_url($css);
2865
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
2865
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
2866 2866
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
2867 2867
 	} else {
2868 2868
 		$distant = false;
2869 2869
 		$cssf = $css;
2870 2870
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2871 2871
 		//propose (rien a faire dans ce cas)
2872
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2872
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2873 2873
 		if (@file_exists($f)) {
2874 2874
 			return $f;
2875 2875
 		}
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2880 2880
 	$f = $dir_var
2881 2881
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2882
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2882
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2883 2883
 
2884 2884
 	// la css peut etre distante (url absolue !)
2885 2885
 	$contenu = null;
@@ -2926,8 +2926,8 @@  discard block
 block discarded – undo
2926 2926
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2927 2927
 		elseif (str_starts_with($css_direction, $dir_var)) {
2928 2928
 			$css_direction = substr($css_direction, strlen($dir_var));
2929
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
2930
-			$css_direction = '/@@@@@@/' . $css_direction;
2929
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
2930
+			$css_direction = '/@@@@@@/'.$css_direction;
2931 2931
 		}
2932 2932
 		$src[] = $regs[0][$k];
2933 2933
 		$src_direction_css[] = str_replace($import_css, $css_direction, (string) $regs[0][$k]);
@@ -2976,7 +2976,7 @@  discard block
 block discarded – undo
2976 2976
 
2977 2977
 	$f = basename($css, '.css');
2978 2978
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
2979
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
2979
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
2980 2980
 		. '.css';
2981 2981
 
2982 2982
 	if (@filemtime($f) > @filemtime($css) && _VAR_MODE != 'recalcul') {
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
 	if ($url_absolue_css == $css) {
2988 2988
 		if (
2989 2989
 			strncmp((string) $GLOBALS['meta']['adresse_site'], $css, $l = strlen((string) $GLOBALS['meta']['adresse_site'])) != 0
2990
-			|| !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
2990
+			|| !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
2991 2991
 		) {
2992 2992
 			include_spip('inc/distant');
2993 2993
 			$contenu = recuperer_url($css);
@@ -3099,7 +3099,7 @@  discard block
 block discarded – undo
3099 3099
 	$expression = str_replace('\/', '/', $expression);
3100 3100
 	$expression = str_replace('/', '\/', $expression);
3101 3101
 
3102
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3102
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3103 3103
 		if (isset($r[$capte])) {
3104 3104
 			return $r[$capte];
3105 3105
 		} else {
@@ -3141,7 +3141,7 @@  discard block
 block discarded – undo
3141 3141
 	$expression = str_replace('\/', '/', $expression);
3142 3142
 	$expression = str_replace('/', '\/', $expression);
3143 3143
 
3144
-	return (string) preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3144
+	return (string) preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3145 3145
 }
3146 3146
 
3147 3147
 
@@ -3160,7 +3160,7 @@  discard block
 block discarded – undo
3160 3160
 function traiter_doublons_documents(&$doublons, $letexte) {
3161 3161
 
3162 3162
 	// Verifier dans le texte & les notes (pas beau, helas)
3163
-	$t = $letexte . $GLOBALS['les_notes'];
3163
+	$t = $letexte.$GLOBALS['les_notes'];
3164 3164
 
3165 3165
 	if (
3166 3166
 		strstr($t, 'spip_document_')
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
 		if (!isset($doublons['documents'])) {
3175 3175
 			$doublons['documents'] = '';
3176 3176
 		}
3177
-		$doublons['documents'] .= ',' . implode(',', $matches[1]);
3177
+		$doublons['documents'] .= ','.implode(',', $matches[1]);
3178 3178
 	}
3179 3179
 
3180 3180
 	return $letexte;
@@ -3231,7 +3231,7 @@  discard block
 block discarded – undo
3231 3231
 	if ($env) {
3232 3232
 		foreach ($env as $i => $j) {
3233 3233
 			if (is_string($j) && !in_array($i, $ignore_params)) {
3234
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3234
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3235 3235
 			}
3236 3236
 		}
3237 3237
 	}
@@ -3270,7 +3270,7 @@  discard block
 block discarded – undo
3270 3270
 	if ($env) {
3271 3271
 		foreach ($env as $i => $j) {
3272 3272
 			if (is_string($j) && !in_array($i, $ignore_params)) {
3273
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3273
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3274 3274
 			}
3275 3275
 		}
3276 3276
 	}
@@ -3344,11 +3344,11 @@  discard block
 block discarded – undo
3344 3344
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3345 3345
 	if (
3346 3346
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3347
-		&& ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg')
3347
+		&& ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg')
3348 3348
 		&& file_exists($variante_svg_generique)
3349 3349
 	) {
3350 3350
 		if (
3351
-			($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg')
3351
+			($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg')
3352 3352
 			&& file_exists($variante_svg_size)
3353 3353
 		) {
3354 3354
 			$img_file = $variante_svg_size;
@@ -3404,7 +3404,7 @@  discard block
 block discarded – undo
3404 3404
 				return '';
3405 3405
 			}
3406 3406
 		}
3407
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3407
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3408 3408
 	}
3409 3409
 
3410 3410
 	if (file_exists($img_file)) {
@@ -3414,14 +3414,14 @@  discard block
 block discarded – undo
3414 3414
 		$alt = '';
3415 3415
 	}
3416 3416
 	elseif ($alt || $alt === '') {
3417
-		$alt = " alt='" . attribut_html($alt) . "'";
3417
+		$alt = " alt='".attribut_html($alt)."'";
3418 3418
 	}
3419 3419
 	else {
3420
-		$alt = " alt='" . attribut_html($title) . "'";
3420
+		$alt = " alt='".attribut_html($title)."'";
3421 3421
 	}
3422
-	return "<img src='" . attribut_html($img_file) . "'$alt"
3423
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3424
-	. ' ' . ltrim($atts)
3422
+	return "<img src='".attribut_html($img_file)."'$alt"
3423
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3424
+	. ' '.ltrim($atts)
3425 3425
 	. ' />';
3426 3426
 }
3427 3427
 
@@ -3435,10 +3435,10 @@  discard block
 block discarded – undo
3435 3435
  */
3436 3436
 function http_style_background($img, $att = '', $size = null) {
3437 3437
 	if ($size && is_numeric($size)) {
3438
-		$size = trim($size) . 'px';
3438
+		$size = trim($size).'px';
3439 3439
 	}
3440
-	return " style='background" .
3441
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3440
+	return " style='background".
3441
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3442 3442
 		. ($size ? "background-size:{$size};" : '')
3443 3443
 		. "'";
3444 3444
 }
@@ -3548,7 +3548,7 @@  discard block
 block discarded – undo
3548 3548
 		$img = http_img_pack(
3549 3549
 			$img,
3550 3550
 			$alt,
3551
-			$class ? " class='" . attribut_html($class) . "'" : '',
3551
+			$class ? " class='".attribut_html($class)."'" : '',
3552 3552
 			'',
3553 3553
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3554 3554
 		);
@@ -3648,9 +3648,9 @@  discard block
 block discarded – undo
3648 3648
 	// regler le alt
3649 3649
 	if ($alt) {
3650 3650
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3651
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3651
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3652 3652
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3653
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3653
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3654 3654
 		$balise_svg .= $title;
3655 3655
 	}
3656 3656
 	else {
@@ -3842,7 +3842,7 @@  discard block
 block discarded – undo
3842 3842
 	}
3843 3843
 
3844 3844
 	$c = serialize($c);
3845
-	$cle = calculer_cle_action($form . $c);
3845
+	$cle = calculer_cle_action($form.$c);
3846 3846
 	$c = "$cle:$c";
3847 3847
 
3848 3848
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3900,15 +3900,15 @@  discard block
 block discarded – undo
3900 3900
 	}
3901 3901
 	// toujours encoder l'url source dans le bloc ajax
3902 3902
 	$r = self();
3903
-	$r = ' data-origin="' . $r . '"';
3903
+	$r = ' data-origin="'.$r.'"';
3904 3904
 	$class = 'ajaxbloc';
3905 3905
 	if ($ajaxid && is_string($ajaxid)) {
3906 3906
 		// ajaxid est normalement conforme a un nom de classe css
3907 3907
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3908
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3908
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3909 3909
 	}
3910 3910
 
3911
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3911
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3912 3912
 }
3913 3913
 
3914 3914
 /**
@@ -3953,7 +3953,7 @@  discard block
 block discarded – undo
3953 3953
 		$cle = substr((string) $c, 0, $p);
3954 3954
 		$c = substr((string) $c, $p + 1);
3955 3955
 
3956
-		if ($cle === calculer_cle_action($form . $c)) {
3956
+		if ($cle === calculer_cle_action($form.$c)) {
3957 3957
 			return @unserialize($c);
3958 3958
 		}
3959 3959
 	}
@@ -4073,13 +4073,13 @@  discard block
 block discarded – undo
4073 4073
 				}
4074 4074
 			}
4075 4075
 		}
4076
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4076
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4077 4077
 	} else {
4078 4078
 		$bal = 'a';
4079 4079
 		$att = "href='$url'"
4080
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4081
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4082
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4080
+			. ($title ? " title='".attribut_html($title)."'" : '')
4081
+			. ($class ? " class='".attribut_html($class)."'" : '')
4082
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4083 4083
 			. $evt;
4084 4084
 	}
4085 4085
 	if ($libelle === null) {
@@ -4216,7 +4216,7 @@  discard block
 block discarded – undo
4216 4216
 
4217 4217
 	// IcĂ´ne
4218 4218
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4219
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4219
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4220 4220
 
4221 4221
 	// Markup final
4222 4222
 	if ($type == 'lien') {
@@ -4491,16 +4491,16 @@  discard block
 block discarded – undo
4491 4491
 		$class_form = 'ajax';
4492 4492
 		$class = str_replace('ajax', '', $class);
4493 4493
 	}
4494
-	$class_btn = 'submit ' . trim($class);
4494
+	$class_btn = 'submit '.trim($class);
4495 4495
 
4496 4496
 	if ($confirm) {
4497
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4497
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4498 4498
 		$callback = $callback ? "$confirm?($callback):false" : $confirm;
4499 4499
 	}
4500
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4500
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4501 4501
 	$title = $title ? " title='$title'" : '';
4502 4502
 
4503
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4503
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4504 4504
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4505 4505
 }
4506 4506
 
@@ -4564,14 +4564,14 @@  discard block
 block discarded – undo
4564 4564
 		$champ_titre = '';
4565 4565
 		if ($demande_titre) {
4566 4566
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4567
-			$champ_titre = (empty($desc['titre'])) ? '' : ', ' . $desc['titre'];
4567
+			$champ_titre = (empty($desc['titre'])) ? '' : ', '.$desc['titre'];
4568 4568
 		}
4569 4569
 		include_spip('base/abstract_sql');
4570 4570
 		include_spip('base/connect_sql');
4571 4571
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4572
-			'*' . $champ_titre,
4572
+			'*'.$champ_titre,
4573 4573
 			$desc['table_sql'],
4574
-			id_table_objet($type_objet) . ' = ' . (int) $id_objet
4574
+			id_table_objet($type_objet).' = '.(int) $id_objet
4575 4575
 		);
4576 4576
 
4577 4577
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4660,8 +4660,7 @@  discard block
 block discarded – undo
4660 4660
 	if (isset($ligne_sql['chapo'])) {
4661 4661
 		$chapo = $ligne_sql['chapo'];
4662 4662
 		$texte = strlen((string) $descriptif) ?
4663
-			'' :
4664
-			"$chapo \n\n $texte";
4663
+			'' : "$chapo \n\n $texte";
4665 4664
 	}
4666 4665
 
4667 4666
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4725,7 +4724,7 @@  discard block
 block discarded – undo
4725 4724
 		return $texte;
4726 4725
 	}
4727 4726
 
4728
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", (string) $traitement);
4727
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", (string) $traitement);
4729 4728
 
4730 4729
 	// signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag
4731 4730
 	if (test_espace_prive()) {
@@ -4761,7 +4760,7 @@  discard block
 block discarded – undo
4761 4760
 	}
4762 4761
 	$url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect);
4763 4762
 
4764
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4763
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4765 4764
 }
4766 4765
 
4767 4766
 /**
@@ -4779,9 +4778,9 @@  discard block
 block discarded – undo
4779 4778
 function wrap($texte, $wrap) {
4780 4779
 	$balises = extraire_balises($wrap);
4781 4780
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4782
-		$texte = $wrap . $texte;
4781
+		$texte = $wrap.$texte;
4783 4782
 		$regs = array_reverse($regs[1]);
4784
-		$wrap = '</' . implode('></', $regs) . '>';
4783
+		$wrap = '</'.implode('></', $regs).'>';
4785 4784
 		$texte .= $wrap;
4786 4785
 	}
4787 4786
 
@@ -4811,7 +4810,7 @@  discard block
 block discarded – undo
4811 4810
 
4812 4811
 	// caster $u en array si besoin
4813 4812
 	if (is_object($u)) {
4814
-		$u = (array)$u;
4813
+		$u = (array) $u;
4815 4814
 	}
4816 4815
 
4817 4816
 	if (is_array($u)) {
@@ -4833,7 +4832,7 @@  discard block
 block discarded – undo
4833 4832
 		// sinon on passe a la ligne et on indente
4834 4833
 		$i_str = str_pad('', $indent, ' ');
4835 4834
 		foreach ($u as $k => $v) {
4836
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4835
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4837 4836
 		}
4838 4837
 
4839 4838
 		return $out;
@@ -4887,7 +4886,7 @@  discard block
 block discarded – undo
4887 4886
  * @return string
4888 4887
  */
4889 4888
 function objet_icone($objet, $taille = 24, $class = '') {
4890
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
4889
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
4891 4890
 	$icone = chemin_image($icone);
4892 4891
 	$balise_img = charger_filtre('balise_img');
4893 4892
 
@@ -4913,7 +4912,7 @@  discard block
 block discarded – undo
4913 4912
  */
4914 4913
 function objet_T($objet, $chaine, $args = [], $options = []) {
4915 4914
 	$chaine = explode(':', $chaine);
4916
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
4915
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
4917 4916
 		return $t;
4918 4917
 	}
4919 4918
 	$chaine = implode(':', $chaine);
@@ -4979,7 +4978,7 @@  discard block
 block discarded – undo
4979 4978
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4980 4979
 
4981 4980
 	// calculer le nom de la css
4982
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
4981
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
4983 4982
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
4984 4983
 	$contexte_implicite = calculer_contexte_implicite();
4985 4984
 
@@ -4987,14 +4986,14 @@  discard block
 block discarded – undo
4987 4986
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
4988 4987
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
4989 4988
 	if (isset($options['hash_on_content']) && $options['hash_on_content']) {
4990
-		$hash = md5((string) ($contexte_implicite['host'] . '::' . $cache));
4989
+		$hash = md5((string) ($contexte_implicite['host'].'::'.$cache));
4991 4990
 	}
4992 4991
 	else {
4993 4992
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
4994 4993
 		ksort($contexte);
4995
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
4994
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
4996 4995
 	}
4997
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
4996
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
4998 4997
 
4999 4998
 	// mettre a jour le fichier si il n'existe pas
5000 4999
 	// ou trop ancien
@@ -5002,8 +5001,8 @@  discard block
 block discarded – undo
5002 5001
 	// et recopie sur le fichier cible uniquement si il change
5003 5002
 	if (
5004 5003
 		!file_exists($filename)
5005
-		|| !file_exists($filename . '.last')
5006
-		|| isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename . '.last') < $cache['lastmodified']
5004
+		|| !file_exists($filename.'.last')
5005
+		|| isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename.'.last') < $cache['lastmodified']
5007 5006
 		|| defined('_VAR_MODE') && _VAR_MODE == 'recalcul'
5008 5007
 	) {
5009 5008
 		$contenu = $cache['texte'];
@@ -5027,10 +5026,10 @@  discard block
 block discarded – undo
5027 5026
 			}
5028 5027
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5029 5028
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5030
-			$comment .= "}\n   md5:" . md5((string) $contenu) . " */\n";
5029
+			$comment .= "}\n   md5:".md5((string) $contenu)." */\n";
5031 5030
 		}
5032 5031
 		// et ecrire le fichier si il change
5033
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5032
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5034 5033
 	}
5035 5034
 
5036 5035
 	return timestamp($filename);
@@ -5257,7 +5256,7 @@  discard block
 block discarded – undo
5257 5256
 	if ($e > 0 && strlen($mid) > 8) {
5258 5257
 		$mid = '***...***';
5259 5258
 	}
5260
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5259
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5261 5260
 }
5262 5261
 
5263 5262
 
@@ -5319,7 +5318,7 @@  discard block
 block discarded – undo
5319 5318
 		case 'id':
5320 5319
 		case 'anchor':
5321 5320
 			if (preg_match(',^\d,', $texte)) {
5322
-				$texte = substr($type, 0, 1) . $texte;
5321
+				$texte = substr($type, 0, 1).$texte;
5323 5322
 			}
5324 5323
 	}
5325 5324
 
@@ -5329,9 +5328,9 @@  discard block
 block discarded – undo
5329 5328
 
5330 5329
 	if (strlen($texte) < $longueur_mini && $longueur_mini < $longueur_maxi) {
5331 5330
 		if (preg_match(',^\d,', $texte)) {
5332
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5331
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5333 5332
 		}
5334
-		$texte .= $separateur . md5($original);
5333
+		$texte .= $separateur.md5($original);
5335 5334
 		$texte = substr($texte, 0, $longueur_mini);
5336 5335
 	}
5337 5336
 
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		$res['message_ok'] = _T('info_modification_enregistree');
100 100
 		if ($retour) {
101 101
 			if (str_starts_with($retour, 'javascript:')) {
102
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
102
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
103 103
 				$res['editable'] = true;
104 104
 			} else {
105 105
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 				if (!isset($erreurs[$champ])) {
140 140
 					$erreurs[$champ] = '';
141 141
 				}
142
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
142
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
143 143
 			}
144 144
 		}
145 145
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	if (
220 220
 		$config_fonc
221 221
 		&& !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
222
-		&& $config_fonc !== $table_objet . '_edit_config'
222
+		&& $config_fonc !== $table_objet.'_edit_config'
223 223
 		&& ($args = test_formulaire_inclus_par_modele())
224 224
 		&& in_array($config_fonc, $args)
225 225
 	) {
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 	// Appel direct dans un squelette
232 232
 	if (!$row) {
233 233
 		if (!$new || $lier_trad) {
234
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
234
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
235 235
 				$row = $select($id, $id_parent, $lier_trad);
236 236
 				// si on a une fonction precharger, elle pu faire un reglage de langue
237 237
 				$lang_default = (empty($row['lang']) ? null : $row['lang']);
238 238
 			} else {
239
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . (int) $id);
239
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.(int) $id);
240 240
 			}
241 241
 			if (!$new) {
242 242
 				$md5 = controles_md5($row ?: []);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		$contexte['config'] = $config = $config_fonc($contexte);
288 288
 		if (!$lang_default) {
289 289
 			include_spip('inc/session');
290
-			$lang_default = $config['langue'] ?? session_get('lang') ;
290
+			$lang_default = $config['langue'] ?? session_get('lang');
291 291
 		}
292 292
 	}
293 293
 	$config += [
@@ -309,13 +309,13 @@  discard block
 block discarded – undo
309 309
 		unset($contexte['lang']);
310 310
 	}
311 311
 
312
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
312
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
313 313
 		($lier_trad
314
-			 ? "\n<input type='hidden' name='lier_trad' value='" .
315
-				$lier_trad .
316
-				"' />" .
317
-				"\n<input type='hidden' name='changer_lang' value='" .
318
-				$lang_default .
314
+			 ? "\n<input type='hidden' name='lier_trad' value='".
315
+				$lier_trad.
316
+				"' />".
317
+				"\n<input type='hidden' name='changer_lang' value='".
318
+				$lang_default.
319 319
 				"' />"
320 320
 			: '')
321 321
 		. $hidden
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 	$aider = charger_fonction('aider', 'inc');
357 357
 	if (strlen($texte) > 28 * 1024) {
358 358
 		$texte = str_replace("\r\n", "\n", $texte);
359
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
359
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
360 360
 		if ($pos > 0 && $pos < 32 * 1024) {
361
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
361
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
362 362
 			$suite = substr($texte, $pos + 2);
363 363
 		} else {
364
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
364
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
365 365
 			if (!($pos > 0 && $pos < 32 * 1024)) {
366
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
366
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
367 367
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
368 368
 			} else {
369 369
 				$decalage = 1;
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 	$ctr = [];
451 451
 	foreach ($data as $key => $val) {
452 452
 		$m = md5($val ?? '');
453
-		$k = $prefixe . $key;
453
+		$k = $prefixe.$key;
454 454
 
455 455
 		$ctr[$k] = match ($format) {
456 456
 			'html' => "<input type='hidden' value='$m' name='$k' />",
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 	}
460 460
 
461 461
 	if ($format === 'html') {
462
-		return "\n\n<!-- controles md5 -->\n" . implode("\n", $ctr) . "\n\n";
462
+		return "\n\n<!-- controles md5 -->\n".implode("\n", $ctr)."\n\n";
463 463
 	} else {
464 464
 		return $ctr;
465 465
 	}
@@ -612,8 +612,8 @@  discard block
 block discarded – undo
612 612
 	// potentiellement modifiees entre temps par un autre utilisateur)
613 613
 	foreach ($champs as $key => $val) {
614 614
 		if (
615
-			isset($ctr[$prefix . $key])
616
-			&& ($m = $ctr[$prefix . $key])
615
+			isset($ctr[$prefix.$key])
616
+			&& ($m = $ctr[$prefix.$key])
617 617
 			&& (is_scalar($val) && $m == md5($val))
618 618
 		) {
619 619
 			unset($champs[$key]);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 	// de conflit.
643 643
 	$ctrh = $ctrq = $conflits = [];
644 644
 	foreach (array_keys($champs) as $key) {
645
-		if (isset($ctr[$prefix . $key]) && ($m = $ctr[$prefix . $key])) {
645
+		if (isset($ctr[$prefix.$key]) && ($m = $ctr[$prefix.$key])) {
646 646
 			$ctrh[$key] = $m;
647 647
 			$ctrq[] = $key;
648 648
 		}
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
  */
677 677
 function display_conflit_champ($x) {
678 678
 	if (strstr($x, "\n") || strlen($x) > 80) {
679
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
679
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
680 680
 	} else {
681
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
681
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
682 682
 	}
683 683
 }
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
23 23
 if (!defined('_DIR_PLUGINS_AUTO')) {
24
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
24
+	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/');
25 25
 }
26 26
 
27 27
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 				if ($dir) {
379 379
 					$dir .= '/';
380 380
 				}
381
-				$dir .= 'procure:' . $procure['nom'];
381
+				$dir .= 'procure:'.$procure['nom'];
382 382
 
383 383
 				$procure['etat'] = '?';
384 384
 				$procure['dir_type'] = $resume['dir_type'];
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		$plug = $resume['dir'];
559 559
 		$k = $infos[$dir_type][$plug];
560 560
 
561
-		$plug = constant($dir_type) . $plug;
561
+		$plug = constant($dir_type).$plug;
562 562
 		if (!isset($msg[$p])) {
563 563
 			if (isset($resume['erreur']) && $resume['erreur']) {
564 564
 				$msg[$p] = [$resume['erreur']];
@@ -601,10 +601,10 @@  discard block
 block discarded – undo
601 601
 		$list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation'];
602 602
 	} elseif (!$raw) {
603 603
 		foreach ($list as $plug => $msg) {
604
-			$list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug])
605
-				. '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>';
604
+			$list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug])
605
+				. '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>';
606 606
 		}
607
-		$list = '<ul>' . join("\n", $list) . '</ul>';
607
+		$list = '<ul>'.join("\n", $list).'</ul>';
608 608
 	}
609 609
 	if ($raz) {
610 610
 		effacer_meta('plugin_erreur_activation');
@@ -718,13 +718,13 @@  discard block
 block discarded – undo
718 718
 			if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) {
719 719
 				return _T("plugin_{$balise}_{$type}", [
720 720
 					'plugin' => $nom,
721
-					'version' => ' &ge; ' . $minimum
721
+					'version' => ' &ge; '.$minimum
722 722
 				]);
723 723
 			}
724 724
 			if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) {
725 725
 				return _T("plugin_{$balise}_{$type}", [
726 726
 					'plugin' => $nom,
727
-					'version' => ' &gt; ' . $minimum
727
+					'version' => ' &gt; '.$minimum
728 728
 				]);
729 729
 			}
730 730
 		}
@@ -733,13 +733,13 @@  discard block
 block discarded – undo
733 733
 			if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) {
734 734
 				return _T("plugin_{$balise}_{$type}", [
735 735
 					'plugin' => $nom,
736
-					'version' => ' &le; ' . $maximum
736
+					'version' => ' &le; '.$maximum
737 737
 				]);
738 738
 			}
739 739
 			if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) {
740 740
 				return _T("plugin_{$balise}_plugin", [
741 741
 					'plugin' => $nom,
742
-					'version' => ' &lt; ' . $maximum
742
+					'version' => ' &lt; '.$maximum
743 743
 				]);
744 744
 			}
745 745
 		}
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 		include_spip('inc/charger_plugin');
759 759
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
760 760
 	}*/
761
-	return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>";
761
+	return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>";
762 762
 }
763 763
 
764 764
 
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	foreach ($plugin_valides as $p => $resume) {
858 858
 		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
859 859
 		if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') {
860
-			$header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : '');
860
+			$header[] = $p.($resume['version'] ? '('.$resume['version'].')' : '');
861 861
 		}
862 862
 		if ($resume['dir']) {
863 863
 			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
@@ -882,11 +882,11 @@  discard block
 block discarded – undo
882 882
 	$header = strtolower(implode(',', $header));
883 883
 	if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) {
884 884
 		ecrire_fichier(
885
-			_DIR_VAR . 'config.txt',
886
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header
885
+			_DIR_VAR.'config.txt',
886
+			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header
887 887
 		);
888 888
 	} else {
889
-		@unlink(_DIR_VAR . 'config.txt');
889
+		@unlink(_DIR_VAR.'config.txt');
890 890
 	}
891 891
 	// generer charger_plugins_chemin.php
892 892
 	plugins_precompile_chemin($plugin_valides, $ordre);
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 			// definir le plugin, donc le path avant l'include du fichier options
941 941
 			// permet de faire des include_spip pour attraper un inc_ du plugin
942 942
 
943
-			$dir = $dir_type . ".'" . $plug . "/'";
943
+			$dir = $dir_type.".'".$plug."/'";
944 944
 
945 945
 			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
946 946
 			if (
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 				if (!$info['chemin']) {
952 952
 					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
953 953
 					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
954
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
954
+					if (is_dir(constant($dir_type).$plug.'/squelettes/')) {
955 955
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956 956
 					}
957 957
 				}
@@ -973,13 +973,13 @@  discard block
 block discarded – undo
973 973
 								$dir = '';
974 974
 							}
975 975
 							if (strlen($dir)) {
976
-								$dir = rtrim($dir, '/') . '/';
976
+								$dir = rtrim($dir, '/').'/';
977 977
 							}
978 978
 							if (!isset($chemin['type']) || $chemin['type'] == 'public') {
979
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
979
+								$chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
980 980
 							}
981 981
 							if (!isset($chemin['type']) || $chemin['type'] == 'prive') {
982
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : '');
982
+								$chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : '');
983 983
 							}
984 984
 						}
985 985
 					}
@@ -988,11 +988,11 @@  discard block
 block discarded – undo
988 988
 		}
989 989
 	}
990 990
 	if (count($chemins['public']) || count($chemins['prive'])) {
991
-		$contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode(
991
+		$contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode(
992 992
 			',',
993 993
 			array_reverse($chemins['public'])
994
-		) . "]);\n"
995
-			. 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n";
994
+		)."]);\n"
995
+			. 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n";
996 996
 	}
997 997
 
998 998
 	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 					&& !str_contains($dir, ':')
1042 1042
 					&& file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1043 1043
 				) {
1044
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) {
1044
+					if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) {
1045 1045
 						$info[$charge] = [$file];
1046 1046
 					}
1047 1047
 				}
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 						) {
1057 1057
 							unset($info[$charge][$k]);
1058 1058
 						} else {
1059
-							$_file = $root_dir_type . ".'$plug/$file'";
1059
+							$_file = $root_dir_type.".'$plug/$file'";
1060 1060
 							$contenu[$charge] .= "include_once_check($_file);\n";
1061 1061
 						}
1062 1062
 					}
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 		}
1067 1067
 	}
1068 1068
 
1069
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1069
+	$contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options'];
1070 1070
 	$contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons)
1071 1071
 		. plugin_ongletbouton('onglets_plugins', $onglets);
1072 1072
 
@@ -1101,12 +1101,12 @@  discard block
 block discarded – undo
1101 1101
 		define("_UPDATED_$nom", $val);
1102 1102
 		define("_UPDATED_md5_$nom", $md5);
1103 1103
 	}
1104
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1104
+	$val = "unserialize('".str_replace("'", "\'", $val)."')";
1105 1105
 
1106 1106
 	return
1107 1107
 		"if (!function_exists('$nom')) {\n"
1108 1108
 		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1109
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1109
+		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n"
1110 1110
 		. "}\n";
1111 1111
 }
1112 1112
 
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1130 1130
 		include_once(_CACHE_PLUGINS_OPT);
1131 1131
 	} else {
1132
-		spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT);
1132
+		spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT);
1133 1133
 	}
1134 1134
 }
1135 1135
 
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 			$dir_type = $plugin_valides[$p]['dir_type'];
1167 1167
 			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1168 1168
 			$plug = $plugin_valides[$p]['dir'];
1169
-			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_');
1169
+			$prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_');
1170 1170
 			if (isset($info['pipeline']) && is_array($info['pipeline'])) {
1171 1171
 				foreach ($info['pipeline'] as $pipe) {
1172 1172
 					$nom = $pipe['nom'];
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
 						}
1201 1201
 						if (isset($pipe['inclure'])) {
1202 1202
 							$GLOBALS['spip_matrice']["$prefix$action"] =
1203
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1203
+								"$root_dir_type:$plug/".$pipe['inclure'];
1204 1204
 						}
1205 1205
 					}
1206 1206
 				}
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
 					$prepend_code['taches_generales_cron'] = '';
1211 1211
 				}
1212 1212
 				foreach ($info['genie'] as $genie) {
1213
-					$nom = $prefix . $genie['nom'];
1213
+					$nom = $prefix.$genie['nom'];
1214 1214
 					$periode = max(60, intval($genie['periode']));
1215 1215
 					if (charger_fonction($nom, 'genie', true)) {
1216 1216
 						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
@@ -1228,13 +1228,13 @@  discard block
 block discarded – undo
1228 1228
 				}
1229 1229
 				foreach ($info['style'] as $style) {
1230 1230
 					if (isset($style['path']) && $style['path']) {
1231
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1231
+						$code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) ";
1232 1232
 					} else {
1233
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1233
+						$code = "if (\$f='".addslashes($style['url'])."') ";
1234 1234
 					}
1235 1235
 					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1236 1236
 					if (isset($style['media']) && strlen($style['media'])) {
1237
-						$code .= ' media="' . addslashes($style['media']) . '"';
1237
+						$code .= ' media="'.addslashes($style['media']).'"';
1238 1238
 					}
1239 1239
 					$code .= "/>';\n";
1240 1240
 					if ($style['type'] != 'prive') {
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 			if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) {
1255 1255
 				foreach ($info['script'] as $script) {
1256 1256
 					if (isset($script['path']) && $script['path']) {
1257
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1257
+						$code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) ";
1258 1258
 					} else {
1259
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1259
+						$code = "if (\$f='".addslashes($script['url'])."') ";
1260 1260
 					}
1261 1261
 					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1262 1262
 					if ($script['type'] != 'prive') {
@@ -1319,10 +1319,10 @@  discard block
 block discarded – undo
1319 1319
 		unset($GLOBALS['spip_pipeline']['all']);
1320 1320
 		$all_pipes = trim(array_shift($a));
1321 1321
 		if ($all_pipes) {
1322
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1322
+			$all_pipes = '|'.ltrim($all_pipes, '|');
1323 1323
 		}
1324 1324
 		if (count($a)) {
1325
-			$all_pipes_end = '||' . array_shift($a);
1325
+			$all_pipes_end = '||'.array_shift($a);
1326 1326
 		}
1327 1327
 	}
1328 1328
 	$content = '';
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 		// Eclater le pipeline en filtres et appliquer chaque filtre
1340 1340
 		foreach ($pipe as $fonc) {
1341 1341
 			$fonc = trim($fonc);
1342
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1342
+			$s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n";
1343 1343
 			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1344 1344
 				$file = $GLOBALS['spip_matrice'][$fonc];
1345 1345
 				$file = "'$file'";
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 					if (defined($root_dir)) {
1351 1351
 						$dir = $root_dir;
1352 1352
 					}
1353
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1353
+					$file = str_replace($regs[0], "'.".$dir.".'", $file);
1354 1354
 					$file = str_replace("''.", '', $file);
1355 1355
 					$file = str_replace(constant($dir), '', $file);
1356 1356
 				}
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 		$content .= "// Pipeline $action \n"
1364 1364
 			. "function execute_pipeline_$action(&\$val){\n"
1365 1365
 			. $s_inc
1366
-			. ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1366
+			. ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '')
1367 1367
 			. $s_call
1368 1368
 			. "return \$val;\n}\n";
1369 1369
 	}
@@ -1419,9 +1419,9 @@  discard block
 block discarded – undo
1419 1419
 					$result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec'));
1420 1420
 					if (_IS_CLI) {
1421 1421
 						include_spip('inc/filtres');
1422
-						$trace = ltrim(textebrut($trace) . "\n" . $result);
1423
-						$trace = '    ' . str_replace("\n", "\n    ", $trace);
1424
-						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1422
+						$trace = ltrim(textebrut($trace)."\n".$result);
1423
+						$trace = '    '.str_replace("\n", "\n    ", $trace);
1424
+						echo "\n".($ok ? 'OK  ' : '/!\ ').textebrut($titre)."\n",
1425 1425
 						  $trace,
1426 1426
 						  "\n";
1427 1427
 					}
@@ -1456,15 +1456,15 @@  discard block
 block discarded – undo
1456 1456
 		$GLOBALS['fichier_php_compile_recent'] = 0;
1457 1457
 	}
1458 1458
 
1459
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1459
+	$contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>';
1460 1460
 	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1461 1461
 	// si pas de modif on ne touche pas au fichier initial
1462 1462
 	if (file_exists($nom)) {
1463 1463
 		if (str_ends_with($nom, '.php')) {
1464
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1464
+			$fichier_tmp = substr($nom, 0, -4).'.tmp.php';
1465 1465
 		}
1466 1466
 		else {
1467
-			$fichier_tmp = $nom . '.tmp';
1467
+			$fichier_tmp = $nom.'.tmp';
1468 1468
 		}
1469 1469
 		file_put_contents($fichier_tmp, $contenu);
1470 1470
 		if (md5_file($nom) == md5_file($fichier_tmp)) {
Please login to merge, or discard this patch.
ecrire/inc/auth.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	}
59 59
 
60 60
 	$n = (int) sql_errno();
61
-	spip_log("Erreur base de donnees $n " . sql_error());
61
+	spip_log("Erreur base de donnees $n ".sql_error());
62 62
 
63 63
 	return $n ?: 1;
64 64
 }
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
 		// erreur SQL a afficher
102 102
 		$raison = minipres(
103 103
 			_T('info_travaux_titre'),
104
-			_T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>'
104
+			_T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>'
105 105
 		);
106 106
 	} elseif (@$raison['statut']) {
107 107
 		// un simple visiteur n'a pas acces a l'espace prive
108
-		spip_log('connexion refusee a ' . @$raison['id_auteur']);
108
+		spip_log('connexion refusee a '.@$raison['id_auteur']);
109 109
 		$est_connecte = (!empty($GLOBALS['visiteur_session']['login']) && !empty($GLOBALS['visiteur_session']['statut'])); // idem test balise #URL_LOGOUT
110 110
 		$raison = minipres(
111 111
 			_T('avis_erreur_connexion'),
112 112
 			_T('avis_erreur_visiteur')
113 113
 				// Lien vers le site public
114
-				. '<br /><a href="' . url_de_base() . '">' . _T('login_retour_public') . '</a>'
114
+				. '<br /><a href="'.url_de_base().'">'._T('login_retour_public').'</a>'
115 115
 				// Si la personne est connectée, lien de déconnexion ramenant vers la page de login
116
-				. ($est_connecte ? ' | <a href="' . generer_url_public('', 'action=logout&amp;logout=prive') . '">' . _T('icone_deconnecter') . '</a>' : '')
116
+				. ($est_connecte ? ' | <a href="'.generer_url_public('', 'action=logout&amp;logout=prive').'">'._T('icone_deconnecter').'</a>' : '')
117 117
 		);
118 118
 	} else {
119 119
 		// auteur en fin de droits ...
@@ -201,8 +201,7 @@  discard block
 block discarded – undo
201 201
 	$where = (is_numeric($id_auteur)
202 202
 		/*AND $id_auteur>0*/ // reprise lors des restaurations
203 203
 	) ?
204
-		"id_auteur=$id_auteur" :
205
-		(strlen((string) $GLOBALS['connect_login']) ? 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text') : '');
204
+		"id_auteur=$id_auteur" : (strlen((string) $GLOBALS['connect_login']) ? 'login='.sql_quote($GLOBALS['connect_login'], '', 'text') : '');
206 205
 
207 206
 	if (!$where) {
208 207
 		return '';
@@ -327,7 +326,7 @@  discard block
 block discarded – undo
327 326
  * @return string
328 327
  */
329 328
 function auth_a_loger() {
330
-	$redirect = generer_url_public('login', 'url=' . rawurlencode((string) self('&', true)), true);
329
+	$redirect = generer_url_public('login', 'url='.rawurlencode((string) self('&', true)), true);
331 330
 
332 331
 	// un echec au "bonjour" (login initial) quand le statut est
333 332
 	// inconnu signale sans doute un probleme de cookies
@@ -363,7 +362,7 @@  discard block
 block discarded – undo
363 362
 	$date ??= date('Y-m-d H:i:s');
364 363
 
365 364
 	if (abs(strtotime($date) - $connect_quand) >= 60) {
366
-		sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . (int) $row['id_auteur']);
365
+		sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.(int) $row['id_auteur']);
367 366
 		$row['en_ligne'] = $date;
368 367
 	}
369 368
 
@@ -471,7 +470,7 @@  discard block
 block discarded – undo
471 470
 	if (
472 471
 		!$login
473 472
 		|| !($login_base = auth_retrouver_login($login, $serveur))
474
-		|| !($row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur))
473
+		|| !($row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur))
475 474
 	) {
476 475
 		// generer de fausses infos, mais credibles, pour eviter une attaque
477 476
 		// https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691
@@ -581,7 +580,7 @@  discard block
 block discarded – undo
581 580
 	sql_updateq(
582 581
 		'spip_auteurs',
583 582
 		['prefs' => serialize($p)],
584
-		'id_auteur=' . (int) $auteur['id_auteur']
583
+		'id_auteur='.(int) $auteur['id_auteur']
585 584
 	);
586 585
 
587 586
 	//  bloquer ici le visiteur qui tente d'abuser de ses droits
@@ -745,7 +744,7 @@  discard block
 block discarded – undo
745 744
 		return false;
746 745
 	}
747 746
 
748
-	$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur);
747
+	$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur);
749 748
 
750 749
 	if (!$row) {
751 750
 		if (
@@ -801,11 +800,11 @@  discard block
 block discarded – undo
801 800
 	$retour = $retour ?: _T('icone_retour');
802 801
 	$corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] ";
803 802
 	if ($url) {
804
-		$corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]";
803
+		$corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]";
805 804
 	}
806 805
 
807 806
 	if ($lien) {
808
-		$corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]';
807
+		$corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]';
809 808
 	}
810 809
 	include_spip('inc/minipres');
811 810
 	echo minipres($pb, $corps);
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		$contenu = @gzfile($fichier);
122 122
 	}
123 123
 
124
-	return is_array($contenu) ? implode('', $contenu) : (string)$contenu;
124
+	return is_array($contenu) ? implode('', $contenu) : (string) $contenu;
125 125
 }
126 126
 
127 127
 
@@ -321,9 +321,9 @@  discard block
 block discarded – undo
321 321
  */
322 322
 function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) {
323 323
 	if (!str_ends_with($fichier, '.php')) {
324
-		spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
324
+		spip_log('Erreur de programmation: '.$fichier.' doit finir par .php');
325 325
 	}
326
-	$contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
326
+	$contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu;
327 327
 
328 328
 	return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
329 329
 }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
  * @return bool
337 337
  */
338 338
 function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) {
339
-	$fichier_tmp = $fichier . '.last';
339
+	$fichier_tmp = $fichier.'.last';
340 340
 	if (!ecrire_fichier($fichier_tmp, $contenu, true)) {
341 341
 		return false;
342 342
 	}
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 				$wait = 0;
548 548
 			}
549 549
 		}
550
-		spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE);
550
+		spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
551 551
 		if ($wait) {
552 552
 			sleep($duree + 1);
553 553
 		}
@@ -575,9 +575,9 @@  discard block
 block discarded – undo
575 575
 		if ($item == '.' || $item == '..') {
576 576
 			continue;
577 577
 		}
578
-		if (!supprimer_repertoire($dir . '/' . $item)) {
579
-			@chmod($dir . '/' . $item, 0777);
580
-			if (!supprimer_repertoire($dir . '/' . $item)) {
578
+		if (!supprimer_repertoire($dir.'/'.$item)) {
579
+			@chmod($dir.'/'.$item, 0777);
580
+			if (!supprimer_repertoire($dir.'/'.$item)) {
581 581
 				return false;
582 582
 			}
583 583
 		};
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	if (!strlen($subdir)) {
623 623
 		$n = strrpos($base, '/');
624 624
 		if ($n === false) {
625
-			return $nobase ? '' : ($base . '/');
625
+			return $nobase ? '' : ($base.'/');
626 626
 		}
627 627
 		$subdir = substr($base, $n + 1);
628 628
 		$base = substr($base, 0, $n + 1);
@@ -632,14 +632,14 @@  discard block
 block discarded – undo
632 632
 	}
633 633
 
634 634
 	$baseaff = $nobase ? '' : $base;
635
-	if (isset($dirs[$base . $subdir])) {
636
-		return $baseaff . $dirs[$base . $subdir];
635
+	if (isset($dirs[$base.$subdir])) {
636
+		return $baseaff.$dirs[$base.$subdir];
637 637
 	}
638 638
 
639
-	$path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
639
+	$path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
640 640
 
641 641
 	if (file_exists("$path/.ok")) {
642
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
642
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
643 643
 	}
644 644
 
645 645
 	@mkdir($path, _SPIP_CHMOD);
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		@touch("$path/.ok");
650 650
 		spip_log("creation $base$subdir/");
651 651
 
652
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
652
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
653 653
 	}
654 654
 
655 655
 	// en cas d'echec c'est peut etre tout simplement que le disque est plein :
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 	}
661 661
 	// FIXME: throw an Exception…
662 662
 	if (!_DIR_RESTREINT) {
663
-		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
663
+		$base = preg_replace(',^'._DIR_RACINE.',', '', $base);
664 664
 	}
665 665
 	$base .= $subdir;
666
-	raler_fichier($base . '/.ok');
666
+	raler_fichier($base.'/.ok');
667 667
 }
668 668
 
669 669
 
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 								$maxfiles - $nbfiles,
736 736
 								$recurs
737 737
 							);
738
-							$fichiers = array_merge((array)$beginning, (array)$end);
738
+							$fichiers = array_merge((array) $beginning, (array) $end);
739 739
 							$nbfiles = count($fichiers);
740 740
 						}
741 741
 					}
Please login to merge, or discard this patch.