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