Completed
Push — master ( 4ccfda...548ed0 )
by cam
01:16
created
ecrire/inc/utils.php 1 patch
Spacing   +120 added lines, -121 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	if (strlen($dossier) and substr($dossier, -1) != '/') {
54 54
 		$dossier .= '/';
55 55
 	}
56
-	$f = str_replace('/', '_', $dossier) . $nom;
56
+	$f = str_replace('/', '_', $dossier).$nom;
57 57
 
58 58
 	if (function_exists($f)) {
59 59
 		return $f;
60 60
 	}
61
-	if (function_exists($g = $f . '_dist')) {
61
+	if (function_exists($g = $f.'_dist')) {
62 62
 		return $g;
63 63
 	}
64 64
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		dd(debug_backtrace());
83 83
 	}
84 84
 	if (
85
-		!$inc = include_spip($dossier . ($d = strtolower($nom)))
85
+		!$inc = include_spip($dossier.($d = strtolower($nom)))
86 86
 		// si le fichier truc/machin/nom.php n'existe pas,
87 87
 		// la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions
88 88
 		and strlen(dirname($dossier)) and dirname($dossier) != '.'
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 
103 103
 	// Echec : message d'erreur
104
-	spip_log("fonction $nom ($f ou $g) indisponible" .
104
+	spip_log("fonction $nom ($f ou $g) indisponible".
105 105
 		($inc ? '' : " (fichier $d absent de $dossier)"));
106 106
 
107 107
 	include_spip('inc/minipres');
108 108
 	echo minipres(
109 109
 		_T('forum_titre_erreur'),
110
-		_T('fichier_introuvable', ['fichier' => '<b>' . spip_htmlentities($d) . '</b>']),
111
-		['all_inline' => true,'status' => 404]
110
+		_T('fichier_introuvable', ['fichier' => '<b>'.spip_htmlentities($d).'</b>']),
111
+		['all_inline' => true, 'status' => 404]
112 112
 	);
113 113
 	exit;
114 114
 }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
  *     - string : chemin du fichier trouvé
155 155
  **/
156 156
 function include_spip($f, $include = true) {
157
-	return find_in_path($f . '.php', '', $include);
157
+	return find_in_path($f.'.php', '', $include);
158 158
 }
159 159
 
160 160
 /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
  *     - string : chemin du fichier trouvé
175 175
  **/
176 176
 function require_spip($f) {
177
-	return find_in_path($f . '.php', '', 'required');
177
+	return find_in_path($f.'.php', '', 'required');
178 178
 }
179 179
 
180 180
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		// donc il faut l'inclure "en globals"
192 192
 		if ($f = find_in_path('mes_fonctions.php')) {
193 193
 			global $dossier_squelettes;
194
-			include_once(_ROOT_CWD . $f);
194
+			include_once(_ROOT_CWD.$f);
195 195
 		}
196 196
 
197 197
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	}
297 297
 
298 298
 	// appliquer notre fonction si elle existe
299
-	$fonc = 'execute_pipeline_' . strtolower($action);
299
+	$fonc = 'execute_pipeline_'.strtolower($action);
300 300
 	if (function_exists($fonc)) {
301 301
 		$val = $fonc($val);
302 302
 	} // plantage ?
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 function spip_log($message = null, $name = null) {
362 362
 	static $pre = [];
363 363
 	static $log;
364
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
364
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
365 365
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
366 366
 		$logname = null;
367 367
 	}
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		if (!is_string($message)) {
390 390
 			$message = print_r($message, true);
391 391
 		}
392
-		$log($pre[$niveau] . ' ' . $message, $logname);
392
+		$log($pre[$niveau].' '.$message, $logname);
393 393
 	}
394 394
 }
395 395
 
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 		$a = './';
591 591
 	}
592 592
 
593
-	$regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,';
593
+	$regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,';
594 594
 	$ajouts = array_flip(explode('|', $c));
595 595
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
596 596
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 			// Ajout. Pour une variable, remplacer au meme endroit,
618 618
 			// pour un tableau ce sera fait dans la prochaine boucle
619 619
 			elseif (substr($r[1], -2) != '[]') {
620
-				$url[$n] = $r[1] . '=' . $u;
620
+				$url[$n] = $r[1].'='.$u;
621 621
 				unset($ajouts[$r[1]]);
622 622
 			}
623 623
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -638,11 +638,11 @@  discard block
 block discarded – undo
638 638
 	} elseif ($testv) {
639 639
 		foreach ($ajouts as $k => $n) {
640 640
 			if (!is_array($v)) {
641
-				$url[] = $k . '=' . $u;
641
+				$url[] = $k.'='.$u;
642 642
 			} else {
643
-				$id = (substr($k, -2) == '[]') ? $k : ($k . '[]');
643
+				$id = (substr($k, -2) == '[]') ? $k : ($k.'[]');
644 644
 				foreach ($v as $w) {
645
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
645
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
646 646
 				}
647 647
 			}
648 648
 		}
@@ -653,10 +653,10 @@  discard block
 block discarded – undo
653 653
 
654 654
 	// recomposer l'adresse
655 655
 	if ($url) {
656
-		$a .= '?' . join($sep, $url);
656
+		$a .= '?'.join($sep, $url);
657 657
 	}
658 658
 
659
-	return $a . $ancre;
659
+	return $a.$ancre;
660 660
 }
661 661
 
662 662
 /**
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 			translitteration($ancre)
689 689
 		);
690 690
 	}
691
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
691
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
692 692
 }
693 693
 
694 694
 /**
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
  * @return bool
805 805
  */
806 806
 function test_plugin_actif($plugin) {
807
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
807
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
808 808
 }
809 809
 
810 810
 /**
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 					$value = interdire_scripts($value, -1);
937 937
 				}
938 938
 				if (!empty($options['class'])) {
939
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
939
+					$value = "<span class='".$options['class']."'>$value</span>";
940 940
 				}
941 941
 				$text = str_replace("@$name@", $value, $text);
942 942
 				unset($args[$name]);
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 		// Si des variables n'ont pas ete inserees, le signaler
946 946
 		// (chaines de langues pas a jour)
947 947
 		if ($args) {
948
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
948
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
949 949
 		}
950 950
 	}
951 951
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 function joli_repertoire($rep) {
970 970
 	$a = substr($rep, 0, 1);
971 971
 	if ($a <> '.' and $a <> '/') {
972
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
972
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
973 973
 	}
974 974
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
975 975
 
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 			$p -= ($x * 1000);
1024 1024
 		}
1025 1025
 
1026
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1026
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1027 1027
 	}
1028 1028
 }
1029 1029
 
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 	if ($taches and count($taches) and !spip_connect()) {
1092 1092
 		return false;
1093 1093
 	}
1094
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1094
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1095 1095
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1096 1096
 		return $genie($taches);
1097 1097
 	}
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
 	if ($queue_next_job_time == -1) {
1197 1197
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1198
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1198
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1199 1199
 		}
1200 1200
 		// utiliser un cache memoire si dispo
1201 1201
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1264,8 +1264,8 @@  discard block
 block discarded – undo
1264 1264
 		$src = '';
1265 1265
 	}
1266 1266
 	if ($script) {
1267
-		$script = ("/*<![CDATA[*/\n" .
1268
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1267
+		$script = ("/*<![CDATA[*/\n".
1268
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1269 1269
 			'/*]]>*/');
1270 1270
 	}
1271 1271
 	if ($noscript) {
@@ -1351,13 +1351,13 @@  discard block
 block discarded – undo
1351 1351
 	if ($path_base == null) {
1352 1352
 		// Chemin standard depuis l'espace public
1353 1353
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1354
-			_DIR_RACINE . ':' .
1355
-			_DIR_RACINE . 'squelettes-dist/:' .
1356
-			_DIR_RACINE . 'prive/:' .
1354
+			_DIR_RACINE.':'.
1355
+			_DIR_RACINE.'squelettes-dist/:'.
1356
+			_DIR_RACINE.'prive/:'.
1357 1357
 			_DIR_RESTREINT;
1358 1358
 		// Ajouter squelettes/
1359
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1360
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1359
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1360
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1361 1361
 		}
1362 1362
 		foreach (explode(':', $path) as $dir) {
1363 1363
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 		// Et le(s) dossier(s) des squelettes nommes
1370 1370
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1371 1371
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1372
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1372
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1373 1373
 			}
1374 1374
 		}
1375 1375
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
 
1381 1381
 	if (is_array($dir_path) or strlen($dir_path)) {
1382 1382
 		$tete = '';
1383
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1383
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1384 1384
 			$tete = array_shift($path_base);
1385 1385
 		}
1386 1386
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 	// Et le(s) dossier(s) des squelettes nommes
1402 1402
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1403 1403
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1404
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1404
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1405 1405
 		}
1406 1406
 	}
1407 1407
 
@@ -1472,14 +1472,14 @@  discard block
 block discarded – undo
1472 1472
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1473 1473
 	if (
1474 1474
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1475
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1475
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1476 1476
 		and $f = find_in_theme("$file_svg_generique")
1477 1477
 	) {
1478
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1478
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1479 1479
 			return $themefiles["$subdir$file"] = $fsize;
1480 1480
 		}
1481 1481
 		else {
1482
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1482
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1483 1483
 		}
1484 1484
 	}
1485 1485
 
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 			return $themefiles["$subdir$file"] = $f;
1490 1490
 		}
1491 1491
 	}
1492
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1492
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1493 1493
 
1494 1494
 	return $themefiles["$subdir$file"] = '';
1495 1495
 }
@@ -1597,8 +1597,8 @@  discard block
 block discarded – undo
1597 1597
 			return false;
1598 1598
 		}
1599 1599
 		if ($include and !isset($inc[$dirname][$file])) {
1600
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1601
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1600
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1601
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1602 1602
 		}
1603 1603
 
1604 1604
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1611,14 +1611,14 @@  discard block
 block discarded – undo
1611 1611
 	}
1612 1612
 
1613 1613
 	foreach (creer_chemin() as $dir) {
1614
-		if (!isset($dirs[$a = $dir . $dirname])) {
1615
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1614
+		if (!isset($dirs[$a = $dir.$dirname])) {
1615
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1616 1616
 		}
1617 1617
 		if ($dirs[$a]) {
1618
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1618
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1619 1619
 				if ($include and !isset($inc[$dirname][$file])) {
1620
-					include_once _ROOT_CWD . $a;
1621
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1620
+					include_once _ROOT_CWD.$a;
1621
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1622 1622
 				}
1623 1623
 				if (!defined('_SAUVER_CHEMIN')) {
1624 1624
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 					define('_SAUVER_CHEMIN', true);
1629 1629
 				}
1630 1630
 
1631
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1631
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1632 1632
 			}
1633 1633
 		}
1634 1634
 	}
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
 		define('_SAUVER_CHEMIN', true);
1655 1655
 	}
1656 1656
 
1657
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1657
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1658 1658
 }
1659 1659
 
1660 1660
 function clear_path_cache() {
@@ -1724,12 +1724,12 @@  discard block
 block discarded – undo
1724 1724
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1725 1725
 	// on a pas encore inclus flock.php
1726 1726
 	if (!function_exists('preg_files')) {
1727
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1727
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1728 1728
 	}
1729 1729
 
1730 1730
 	// Parcourir le chemin
1731 1731
 	foreach (creer_chemin() as $d) {
1732
-		$f = $d . $dir;
1732
+		$f = $d.$dir;
1733 1733
 		if (@is_dir($f)) {
1734 1734
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1735 1735
 			foreach ($liste as $chemin) {
@@ -1837,7 +1837,7 @@  discard block
 block discarded – undo
1837 1837
 		return $res;
1838 1838
 	}
1839 1839
 	// Sinon c'est un raccourci ou compat SPIP < 2
1840
-	if (!function_exists($f = 'generer_url_' . $entite)) {
1840
+	if (!function_exists($f = 'generer_url_'.$entite)) {
1841 1841
 		if (!function_exists($f .= '_dist')) {
1842 1842
 			$f = '';
1843 1843
 		}
@@ -1846,8 +1846,8 @@  discard block
 block discarded – undo
1846 1846
 		$url = $f($id, $args, $ancre);
1847 1847
 		if (strlen($args)) {
1848 1848
 			$url .= strstr($url, '?')
1849
-				? '&amp;' . $args
1850
-				: '?' . $args;
1849
+				? '&amp;'.$args
1850
+				: '?'.$args;
1851 1851
 		}
1852 1852
 
1853 1853
 		return $url;
@@ -1878,8 +1878,8 @@  discard block
 block discarded – undo
1878 1878
 	include_spip('base/connect_sql');
1879 1879
 	$id_type = id_table_objet($entite, $public);
1880 1880
 
1881
-	return _DIR_RACINE . get_spip_script('./')
1882
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1881
+	return _DIR_RACINE.get_spip_script('./')
1882
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1883 1883
 	. (!$args ? '' : "&$args")
1884 1884
 	. (!$ancre ? '' : "#$ancre");
1885 1885
 }
@@ -2033,7 +2033,7 @@  discard block
 block discarded – undo
2033 2033
 				!empty($_SERVER['QUERY_STRING'])
2034 2034
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2035 2035
 			) {
2036
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2036
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2037 2037
 			}
2038 2038
 		}
2039 2039
 	}
@@ -2068,9 +2068,9 @@  discard block
 block discarded – undo
2068 2068
 		array_shift($myself);
2069 2069
 		$myself = implode('/', $myself);
2070 2070
 	}
2071
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2071
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2072 2072
 
2073
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2073
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2074 2074
 
2075 2075
 	return $url;
2076 2076
 }
@@ -2108,16 +2108,16 @@  discard block
 block discarded – undo
2108 2108
  **/
2109 2109
 function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) {
2110 2110
 	if (!$rel) {
2111
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2111
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2112 2112
 	} else {
2113 2113
 		if (!is_string($rel)) {
2114
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2114
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2115 2115
 		}
2116 2116
 	}
2117 2117
 
2118 2118
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2119 2119
 	if ($script and ($script <> 'accueil' or $rel)) {
2120
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2120
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2121 2121
 	} elseif ($args) {
2122 2122
 		$args = "?$args";
2123 2123
 	}
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 		$args .= "#$ancre";
2126 2126
 	}
2127 2127
 
2128
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2128
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2129 2129
 }
2130 2130
 
2131 2131
 //
@@ -2198,25 +2198,25 @@  discard block
 block discarded – undo
2198 2198
 		if (is_array($args)) {
2199 2199
 			$r = '';
2200 2200
 			foreach ($args as $k => $v) {
2201
-				$r .= '&' . $k . '=' . $v;
2201
+				$r .= '&'.$k.'='.$v;
2202 2202
 			}
2203 2203
 			$args = substr($r, 1);
2204 2204
 		}
2205 2205
 		$action .=
2206
-			(strpos($action, '?') !== false ? '&' : '?') . $args;
2206
+			(strpos($action, '?') !== false ? '&' : '?').$args;
2207 2207
 	}
2208 2208
 	if (!$no_entities) {
2209 2209
 		$action = quote_amp($action);
2210 2210
 	}
2211 2211
 
2212 2212
 	// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2213
-	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2213
+	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2214 2214
 }
2215 2215
 
2216 2216
 // https://code.spip.net/@generer_url_prive
2217 2217
 function generer_url_prive($script, $args = '', $no_entities = false) {
2218 2218
 
2219
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2219
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2220 2220
 }
2221 2221
 
2222 2222
 // Pour les formulaires en methode POST,
@@ -2251,8 +2251,7 @@  discard block
 block discarded – undo
2251 2251
 	. "><div>\n"
2252 2252
 	. "<input type='hidden' name='exec' value='$script1' />"
2253 2253
 	. $corps
2254
-	. (!$submit ? '' :
2255
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2254
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2256 2255
 	. "</div></form>\n";
2257 2256
 }
2258 2257
 
@@ -2277,14 +2276,14 @@  discard block
 block discarded – undo
2277 2276
 		? generer_url_ecrire(_request('exec'))
2278 2277
 		: generer_url_public();
2279 2278
 
2280
-	return "\n<form action='" .
2281
-	$h .
2282
-	"'" .
2283
-	$atts .
2284
-	">\n" .
2285
-	'<div>' .
2286
-	"\n<input type='hidden' name='action' value='$script' />" .
2287
-	$corps .
2279
+	return "\n<form action='".
2280
+	$h.
2281
+	"'".
2282
+	$atts.
2283
+	">\n".
2284
+	'<div>'.
2285
+	"\n<input type='hidden' name='action' value='$script' />".
2286
+	$corps.
2288 2287
 	'</div></form>';
2289 2288
 }
2290 2289
 
@@ -2312,7 +2311,7 @@  discard block
 block discarded – undo
2312 2311
 		: generer_url_public('', '', false, false);
2313 2312
 	$url = parametre_url($url, 'action', $script);
2314 2313
 	if ($args) {
2315
-		$url .= quote_amp('&' . $args);
2314
+		$url .= quote_amp('&'.$args);
2316 2315
 	}
2317 2316
 
2318 2317
 	if ($no_entities) {
@@ -2362,17 +2361,17 @@  discard block
 block discarded – undo
2362 2361
 
2363 2362
 	// le nom du repertoire plugins/ activables/desactivables
2364 2363
 	if (!defined('_DIR_PLUGINS')) {
2365
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2364
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2366 2365
 	}
2367 2366
 
2368 2367
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2369 2368
 	if (!defined('_DIR_PLUGINS_DIST')) {
2370
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2369
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2371 2370
 	}
2372 2371
 
2373 2372
 	// le nom du repertoire des librairies
2374 2373
 	if (!defined('_DIR_LIB')) {
2375
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2374
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2376 2375
 	}
2377 2376
 
2378 2377
 	if (!defined('_DIR_IMG')) {
@@ -2382,29 +2381,29 @@  discard block
 block discarded – undo
2382 2381
 		define('_DIR_LOGOS', $pa);
2383 2382
 	}
2384 2383
 	if (!defined('_DIR_IMG_ICONES')) {
2385
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2384
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2386 2385
 	}
2387 2386
 
2388 2387
 	if (!defined('_DIR_DUMP')) {
2389
-		define('_DIR_DUMP', $ti . 'dump/');
2388
+		define('_DIR_DUMP', $ti.'dump/');
2390 2389
 	}
2391 2390
 	if (!defined('_DIR_SESSIONS')) {
2392
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2391
+		define('_DIR_SESSIONS', $ti.'sessions/');
2393 2392
 	}
2394 2393
 	if (!defined('_DIR_TRANSFERT')) {
2395
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2394
+		define('_DIR_TRANSFERT', $ti.'upload/');
2396 2395
 	}
2397 2396
 	if (!defined('_DIR_CACHE')) {
2398
-		define('_DIR_CACHE', $ti . 'cache/');
2397
+		define('_DIR_CACHE', $ti.'cache/');
2399 2398
 	}
2400 2399
 	if (!defined('_DIR_CACHE_XML')) {
2401
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2400
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2402 2401
 	}
2403 2402
 	if (!defined('_DIR_SKELS')) {
2404
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2403
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2405 2404
 	}
2406 2405
 	if (!defined('_DIR_AIDE')) {
2407
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2406
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2408 2407
 	}
2409 2408
 	if (!defined('_DIR_TMP')) {
2410 2409
 		define('_DIR_TMP', $ti);
@@ -2433,27 +2432,27 @@  discard block
 block discarded – undo
2433 2432
 	// Declaration des fichiers
2434 2433
 
2435 2434
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2436
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2435
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2437 2436
 	}
2438 2437
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2439
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2438
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2440 2439
 	}
2441 2440
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2442
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2441
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2443 2442
 	}
2444 2443
 	if (!defined('_CACHE_PIPELINES')) {
2445
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2444
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2446 2445
 	}
2447 2446
 	if (!defined('_CACHE_CHEMIN')) {
2448
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2447
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2449 2448
 	}
2450 2449
 
2451 2450
 	# attention .php obligatoire pour ecrire_fichier_securise
2452 2451
 	if (!defined('_FILE_META')) {
2453
-		define('_FILE_META', $ti . 'meta_cache.php');
2452
+		define('_FILE_META', $ti.'meta_cache.php');
2454 2453
 	}
2455 2454
 	if (!defined('_DIR_LOG')) {
2456
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2455
+		define('_DIR_LOG', _DIR_TMP.'log/');
2457 2456
 	}
2458 2457
 	if (!defined('_FILE_LOG')) {
2459 2458
 		define('_FILE_LOG', 'spip');
@@ -2470,8 +2469,8 @@  discard block
 block discarded – undo
2470 2469
 	if (!defined('_FILE_CONNECT')) {
2471 2470
 		define(
2472 2471
 			'_FILE_CONNECT',
2473
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2474
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2472
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2473
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2475 2474
 			: false))
2476 2475
 		);
2477 2476
 	}
@@ -2483,7 +2482,7 @@  discard block
 block discarded – undo
2483 2482
 	if (!defined('_FILE_CHMOD')) {
2484 2483
 		define(
2485 2484
 			'_FILE_CHMOD',
2486
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2485
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2487 2486
 			: false)
2488 2487
 		);
2489 2488
 	}
@@ -2496,10 +2495,10 @@  discard block
 block discarded – undo
2496 2495
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2497 2496
 	}
2498 2497
 	if (!defined('_FILE_CONNECT_TMP')) {
2499
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2498
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2500 2499
 	}
2501 2500
 	if (!defined('_FILE_CHMOD_TMP')) {
2502
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2501
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2503 2502
 	}
2504 2503
 
2505 2504
 	// Definition des droits d'acces en ecriture
@@ -2517,13 +2516,13 @@  discard block
 block discarded – undo
2517 2516
 		define('_DEFAULT_CHARSET', 'utf-8');
2518 2517
 	}
2519 2518
 	if (!defined('_ROOT_PLUGINS')) {
2520
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2519
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2521 2520
 	}
2522 2521
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2523
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2522
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2524 2523
 	}
2525 2524
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2526
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2525
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2527 2526
 	}
2528 2527
 
2529 2528
 	// La taille des Log
@@ -2560,7 +2559,7 @@  discard block
 block discarded – undo
2560 2559
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2561 2560
 	// pour le rendre surchargeable, on va provoquer un reecriture
2562 2561
 	// systematique du noyau ou une baisse de perfs => a etudier)
2563
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2562
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2564 2563
 
2565 2564
 	// charger tout de suite le path et son cache
2566 2565
 	load_path_cache();
@@ -2608,7 +2607,7 @@  discard block
 block discarded – undo
2608 2607
 			!empty($_SERVER['QUERY_STRING'])
2609 2608
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2610 2609
 		) {
2611
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2610
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2612 2611
 		}
2613 2612
 	}
2614 2613
 
@@ -2644,7 +2643,7 @@  discard block
 block discarded – undo
2644 2643
 		) {
2645 2644
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2646 2645
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2647
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2646
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2648 2647
 			} else {
2649 2648
 				$uri_ref = '';
2650 2649
 			}
@@ -2738,7 +2737,7 @@  discard block
 block discarded – undo
2738 2737
 	}
2739 2738
 	if (!defined('_CACHE_RUBRIQUES')) {
2740 2739
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2741
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2740
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2742 2741
 	}
2743 2742
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2744 2743
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2842,7 +2841,7 @@  discard block
 block discarded – undo
2842 2841
 					$memory *= 1024;
2843 2842
 			}
2844 2843
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2845
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2844
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2846 2845
 				if (trim(ini_get('memory_limit')) != $m) {
2847 2846
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2848 2847
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -2993,7 +2992,7 @@  discard block
 block discarded – undo
2993 2992
 					}
2994 2993
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
2995 2994
 						spip_log($GLOBALS['visiteur_session']['nom']
2996
-							. ' ' . _VAR_MODE);
2995
+							. ' '._VAR_MODE);
2997 2996
 					}
2998 2997
 				} // pas autorise ?
2999 2998
 				else {
@@ -3008,7 +3007,7 @@  discard block
 block discarded – undo
3008 3007
 						if (strpos($self, 'page=login') === false) {
3009 3008
 							include_spip('inc/headers');
3010 3009
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3011
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3010
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3012 3011
 						}
3013 3012
 					}
3014 3013
 					// sinon tant pis
@@ -3052,10 +3051,10 @@  discard block
 block discarded – undo
3052 3051
 	// mais on risque de perturber des plugins en initialisant trop tot
3053 3052
 	// certaines constantes
3054 3053
 	@spip_initialisation_core(
3055
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3056
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3057
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3058
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3054
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3055
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3056
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3057
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3059 3058
 	);
3060 3059
 
3061 3060
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3088,7 +3087,7 @@  discard block
 block discarded – undo
3088 3087
 	}
3089 3088
 
3090 3089
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3091
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3090
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3092 3091
 		$session = charger_fonction('session', 'inc');
3093 3092
 		if ($session()) {
3094 3093
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3168,7 +3167,7 @@  discard block
 block discarded – undo
3168 3167
 			'definir_session',
3169 3168
 			$GLOBALS['visiteur_session']
3170 3169
 				? serialize($GLOBALS['visiteur_session'])
3171
-				. '_' . @$_COOKIE['spip_session']
3170
+				. '_'.@$_COOKIE['spip_session']
3172 3171
 				: ''
3173 3172
 		);
3174 3173
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3324,11 +3323,11 @@  discard block
 block discarded – undo
3324 3323
 	$GLOBALS['_INC_PUBLIC']++;
3325 3324
 
3326 3325
 	// fix #4235
3327
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3326
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3328 3327
 
3329 3328
 
3330 3329
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3331
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3330
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3332 3331
 
3333 3332
 		$page = evaluer_fond($f, $contexte, $connect);
3334 3333
 		if ($page === '') {
@@ -3413,7 +3412,7 @@  discard block
 block discarded – undo
3413 3412
  * @return array|string
3414 3413
  */
3415 3414
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3416
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3415
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3417 3416
 	if (!$pathinfo) {
3418 3417
 		return $f;
3419 3418
 	}
Please login to merge, or discard this patch.