Completed
Push — master ( b0842c...2f7bdd )
by cam
01:08
created
ecrire/inc/utils.php 1 patch
Spacing   +123 added lines, -124 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,7 +98,7 @@  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');
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 			.'<br />'
110 110
 			._T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
111 111
 			:
112
-			_T('fichier_introuvable', ['fichier' => '<code>'. spip_htmlentities($d).'</code>']),
113
-			['all_inline' => true,'status' => 404]
112
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
113
+			['all_inline' => true, 'status' => 404]
114 114
 	);
115 115
 	exit;
116 116
 }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  *     - string : chemin du fichier trouvé
157 157
  **/
158 158
 function include_spip($f, $include = true) {
159
-	return find_in_path($f . '.php', '', $include);
159
+	return find_in_path($f.'.php', '', $include);
160 160
 }
161 161
 
162 162
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  *     - string : chemin du fichier trouvé
177 177
  **/
178 178
 function require_spip($f) {
179
-	return find_in_path($f . '.php', '', 'required');
179
+	return find_in_path($f.'.php', '', 'required');
180 180
 }
181 181
 
182 182
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		// donc il faut l'inclure "en globals"
194 194
 		if ($f = find_in_path('mes_fonctions.php')) {
195 195
 			global $dossier_squelettes;
196
-			include_once(_ROOT_CWD . $f);
196
+			include_once(_ROOT_CWD.$f);
197 197
 		}
198 198
 
199 199
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	}
299 299
 
300 300
 	// appliquer notre fonction si elle existe
301
-	$fonc = 'execute_pipeline_' . strtolower($action);
301
+	$fonc = 'execute_pipeline_'.strtolower($action);
302 302
 	if (function_exists($fonc)) {
303 303
 		$val = $fonc($val);
304 304
 	} // plantage ?
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 function spip_log($message = null, $name = null) {
364 364
 	static $pre = [];
365 365
 	static $log;
366
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
366
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
367 367
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
368 368
 		$logname = null;
369 369
 	}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 		if (!is_string($message)) {
392 392
 			$message = print_r($message, true);
393 393
 		}
394
-		$log($pre[$niveau] . ' ' . $message, $logname);
394
+		$log($pre[$niveau].' '.$message, $logname);
395 395
 	}
396 396
 }
397 397
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		$a = './';
593 593
 	}
594 594
 
595
-	$regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,';
595
+	$regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,';
596 596
 	$ajouts = array_flip(explode('|', $c));
597 597
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
598 598
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 			// Ajout. Pour une variable, remplacer au meme endroit,
620 620
 			// pour un tableau ce sera fait dans la prochaine boucle
621 621
 			elseif (substr($r[1], -2) != '[]') {
622
-				$url[$n] = $r[1] . '=' . $u;
622
+				$url[$n] = $r[1].'='.$u;
623 623
 				unset($ajouts[$r[1]]);
624 624
 			}
625 625
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -640,11 +640,11 @@  discard block
 block discarded – undo
640 640
 	} elseif ($testv) {
641 641
 		foreach ($ajouts as $k => $n) {
642 642
 			if (!is_array($v)) {
643
-				$url[] = $k . '=' . $u;
643
+				$url[] = $k.'='.$u;
644 644
 			} else {
645
-				$id = (substr($k, -2) == '[]') ? $k : ($k . '[]');
645
+				$id = (substr($k, -2) == '[]') ? $k : ($k.'[]');
646 646
 				foreach ($v as $w) {
647
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
647
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
648 648
 				}
649 649
 			}
650 650
 		}
@@ -655,10 +655,10 @@  discard block
 block discarded – undo
655 655
 
656 656
 	// recomposer l'adresse
657 657
 	if ($url) {
658
-		$a .= '?' . join($sep, $url);
658
+		$a .= '?'.join($sep, $url);
659 659
 	}
660 660
 
661
-	return $a . $ancre;
661
+	return $a.$ancre;
662 662
 }
663 663
 
664 664
 /**
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 			translitteration($ancre)
691 691
 		);
692 692
 	}
693
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
693
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
694 694
 }
695 695
 
696 696
 /**
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
  * @return bool
807 807
  */
808 808
 function test_plugin_actif($plugin) {
809
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
809
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
810 810
 }
811 811
 
812 812
 /**
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 					$value = interdire_scripts($value, -1);
939 939
 				}
940 940
 				if (!empty($options['class'])) {
941
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
941
+					$value = "<span class='".$options['class']."'>$value</span>";
942 942
 				}
943 943
 				$text = str_replace("@$name@", $value, $text);
944 944
 				unset($args[$name]);
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 		// Si des variables n'ont pas ete inserees, le signaler
948 948
 		// (chaines de langues pas a jour)
949 949
 		if ($args) {
950
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
950
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
951 951
 		}
952 952
 	}
953 953
 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 function joli_repertoire($rep) {
972 972
 	$a = substr($rep, 0, 1);
973 973
 	if ($a <> '.' and $a <> '/') {
974
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
974
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
975 975
 	}
976 976
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
977 977
 
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
 			$p -= ($x * 1000);
1026 1026
 		}
1027 1027
 
1028
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1028
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1029 1029
 	}
1030 1030
 }
1031 1031
 
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
 	if ($taches and count($taches) and !spip_connect()) {
1093 1093
 		return false;
1094 1094
 	}
1095
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1095
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1096 1096
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1097 1097
 		return $genie($taches);
1098 1098
 	}
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
 	if ($queue_next_job_time == -1) {
1198 1198
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1199
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1199
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1200 1200
 		}
1201 1201
 		// utiliser un cache memoire si dispo
1202 1202
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1265,8 +1265,8 @@  discard block
 block discarded – undo
1265 1265
 		$src = '';
1266 1266
 	}
1267 1267
 	if ($script) {
1268
-		$script = ("/*<![CDATA[*/\n" .
1269
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1268
+		$script = ("/*<![CDATA[*/\n".
1269
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1270 1270
 			'/*]]>*/');
1271 1271
 	}
1272 1272
 	if ($noscript) {
@@ -1352,13 +1352,13 @@  discard block
 block discarded – undo
1352 1352
 	if ($path_base == null) {
1353 1353
 		// Chemin standard depuis l'espace public
1354 1354
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1355
-			_DIR_RACINE . ':' .
1356
-			_DIR_RACINE . 'squelettes-dist/:' .
1357
-			_DIR_RACINE . 'prive/:' .
1355
+			_DIR_RACINE.':'.
1356
+			_DIR_RACINE.'squelettes-dist/:'.
1357
+			_DIR_RACINE.'prive/:'.
1358 1358
 			_DIR_RESTREINT;
1359 1359
 		// Ajouter squelettes/
1360
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1361
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1360
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1361
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1362 1362
 		}
1363 1363
 		foreach (explode(':', $path) as $dir) {
1364 1364
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
 		// Et le(s) dossier(s) des squelettes nommes
1371 1371
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1372 1372
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1373
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1373
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1374 1374
 			}
1375 1375
 		}
1376 1376
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
 
1382 1382
 	if (is_array($dir_path) or strlen($dir_path)) {
1383 1383
 		$tete = '';
1384
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1384
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1385 1385
 			$tete = array_shift($path_base);
1386 1386
 		}
1387 1387
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
 	// Et le(s) dossier(s) des squelettes nommes
1403 1403
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1404 1404
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1405
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1405
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1406 1406
 		}
1407 1407
 	}
1408 1408
 
@@ -1473,14 +1473,14 @@  discard block
 block discarded – undo
1473 1473
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1474 1474
 	if (
1475 1475
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1476
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1476
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1477 1477
 		and $f = find_in_theme("$file_svg_generique")
1478 1478
 	) {
1479
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1479
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1480 1480
 			return $themefiles["$subdir$file"] = $fsize;
1481 1481
 		}
1482 1482
 		else {
1483
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1483
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1484 1484
 		}
1485 1485
 	}
1486 1486
 
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
 			return $themefiles["$subdir$file"] = $f;
1491 1491
 		}
1492 1492
 	}
1493
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1493
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1494 1494
 
1495 1495
 	return $themefiles["$subdir$file"] = '';
1496 1496
 }
@@ -1598,8 +1598,8 @@  discard block
 block discarded – undo
1598 1598
 			return false;
1599 1599
 		}
1600 1600
 		if ($include and !isset($inc[$dirname][$file])) {
1601
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1602
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1601
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1602
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1603 1603
 		}
1604 1604
 
1605 1605
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1612,14 +1612,14 @@  discard block
 block discarded – undo
1612 1612
 	}
1613 1613
 
1614 1614
 	foreach (creer_chemin() as $dir) {
1615
-		if (!isset($dirs[$a = $dir . $dirname])) {
1616
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1615
+		if (!isset($dirs[$a = $dir.$dirname])) {
1616
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1617 1617
 		}
1618 1618
 		if ($dirs[$a]) {
1619
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1619
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1620 1620
 				if ($include and !isset($inc[$dirname][$file])) {
1621
-					include_once _ROOT_CWD . $a;
1622
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1621
+					include_once _ROOT_CWD.$a;
1622
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1623 1623
 				}
1624 1624
 				if (!defined('_SAUVER_CHEMIN')) {
1625 1625
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
 					define('_SAUVER_CHEMIN', true);
1630 1630
 				}
1631 1631
 
1632
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1632
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1633 1633
 			}
1634 1634
 		}
1635 1635
 	}
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
 		define('_SAUVER_CHEMIN', true);
1656 1656
 	}
1657 1657
 
1658
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1658
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1659 1659
 }
1660 1660
 
1661 1661
 function clear_path_cache() {
@@ -1725,12 +1725,12 @@  discard block
 block discarded – undo
1725 1725
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1726 1726
 	// on a pas encore inclus flock.php
1727 1727
 	if (!function_exists('preg_files')) {
1728
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1728
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1729 1729
 	}
1730 1730
 
1731 1731
 	// Parcourir le chemin
1732 1732
 	foreach (creer_chemin() as $d) {
1733
-		$f = $d . $dir;
1733
+		$f = $d.$dir;
1734 1734
 		if (@is_dir($f)) {
1735 1735
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1736 1736
 			foreach ($liste as $chemin) {
@@ -1779,9 +1779,9 @@  discard block
 block discarded – undo
1779 1779
 function charger_fonction_url(string $quoi, string $type = '') {
1780 1780
 	if ($type === 'defaut') {
1781 1781
 		$objet = objet_type($quoi);
1782
-		if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true)
1782
+		if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true)
1783 1783
 			// deprecated
1784
-			or $f = charger_fonction('generer_url_' . $objet, 'urls', true)
1784
+			or $f = charger_fonction('generer_url_'.$objet, 'urls', true)
1785 1785
 		) {
1786 1786
 			return $f;
1787 1787
 		}
@@ -1902,7 +1902,7 @@  discard block
 block discarded – undo
1902 1902
  * @deprecated 4.1
1903 1903
  * @see generer_objet_url
1904 1904
  */
1905
-function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null){
1905
+function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null) {
1906 1906
 	if ($public and is_string($public)) {
1907 1907
 		return generer_objet_url(intval($id), $entite, $args ?: '', $ancre ?: '', true, $type ?? '', $public);
1908 1908
 	}
@@ -1937,7 +1937,7 @@  discard block
 block discarded – undo
1937 1937
  * @deprecated 4.1
1938 1938
  * @see generer_objet_url_ecrire_edit
1939 1939
  */
1940
-function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){
1940
+function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') {
1941 1941
 	return generer_objet_url_ecrire_edit(intval($id), $entite, $args, $ancre);
1942 1942
 }
1943 1943
 
@@ -1946,8 +1946,8 @@  discard block
 block discarded – undo
1946 1946
 	include_spip('base/connect_sql');
1947 1947
 	$id_type = id_table_objet($entite, $public);
1948 1948
 
1949
-	return _DIR_RACINE . get_spip_script('./')
1950
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1949
+	return _DIR_RACINE.get_spip_script('./')
1950
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1951 1951
 	. (!$args ? '' : "&$args")
1952 1952
 	. (!$ancre ? '' : "#$ancre");
1953 1953
 }
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
  * @deprecated 4.1
2002 2002
  * @see  generer_objet_url_absolue
2003 2003
  */
2004
-function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null){
2004
+function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null) {
2005 2005
 	return generer_objet_url_absolue(intval($id), $entite, $args, $ancre, true, '', $connect);
2006 2006
 }
2007 2007
 
@@ -2118,7 +2118,7 @@  discard block
 block discarded – undo
2118 2118
 				!empty($_SERVER['QUERY_STRING'])
2119 2119
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2120 2120
 			) {
2121
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2121
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2122 2122
 			}
2123 2123
 		}
2124 2124
 	}
@@ -2153,9 +2153,9 @@  discard block
 block discarded – undo
2153 2153
 		array_shift($myself);
2154 2154
 		$myself = implode('/', $myself);
2155 2155
 	}
2156
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2156
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2157 2157
 
2158
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2158
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2159 2159
 
2160 2160
 	return $url;
2161 2161
 }
@@ -2193,16 +2193,16 @@  discard block
 block discarded – undo
2193 2193
  **/
2194 2194
 function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) {
2195 2195
 	if (!$rel) {
2196
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2196
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2197 2197
 	} else {
2198 2198
 		if (!is_string($rel)) {
2199
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2199
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2200 2200
 		}
2201 2201
 	}
2202 2202
 
2203 2203
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2204 2204
 	if ($script and ($script <> 'accueil' or $rel)) {
2205
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2205
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2206 2206
 	} elseif ($args) {
2207 2207
 		$args = "?$args";
2208 2208
 	}
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
 		$args .= "#$ancre";
2211 2211
 	}
2212 2212
 
2213
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2213
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2214 2214
 }
2215 2215
 
2216 2216
 //
@@ -2292,10 +2292,10 @@  discard block
 block discarded – undo
2292 2292
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2293 2293
 		}
2294 2294
 		if ($args) {
2295
-			$action .= (strpos($action, '?') !== false ? '&' : '?') . $args;
2295
+			$action .= (strpos($action, '?') !== false ? '&' : '?').$args;
2296 2296
 		}
2297 2297
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2298
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2298
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2299 2299
 	}
2300 2300
 
2301 2301
 	if (!$no_entities) {
@@ -2307,7 +2307,7 @@  discard block
 block discarded – undo
2307 2307
 
2308 2308
 function generer_url_prive($script, $args = '', $no_entities = false) {
2309 2309
 
2310
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2310
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2311 2311
 }
2312 2312
 
2313 2313
 // Pour les formulaires en methode POST,
@@ -2342,8 +2342,7 @@  discard block
 block discarded – undo
2342 2342
 	. "><div>\n"
2343 2343
 	. "<input type='hidden' name='exec' value='$script1' />"
2344 2344
 	. $corps
2345
-	. (!$submit ? '' :
2346
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2345
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2347 2346
 	. "</div></form>\n";
2348 2347
 }
2349 2348
 
@@ -2368,14 +2367,14 @@  discard block
 block discarded – undo
2368 2367
 		? generer_url_ecrire(_request('exec'))
2369 2368
 		: generer_url_public();
2370 2369
 
2371
-	return "\n<form action='" .
2372
-	$h .
2373
-	"'" .
2374
-	$atts .
2375
-	">\n" .
2376
-	'<div>' .
2377
-	"\n<input type='hidden' name='action' value='$script' />" .
2378
-	$corps .
2370
+	return "\n<form action='".
2371
+	$h.
2372
+	"'".
2373
+	$atts.
2374
+	">\n".
2375
+	'<div>'.
2376
+	"\n<input type='hidden' name='action' value='$script' />".
2377
+	$corps.
2379 2378
 	'</div></form>';
2380 2379
 }
2381 2380
 
@@ -2403,7 +2402,7 @@  discard block
 block discarded – undo
2403 2402
 		: generer_url_public('', '', false, false);
2404 2403
 	$url = parametre_url($url, 'action', $script);
2405 2404
 	if ($args) {
2406
-		$url .= quote_amp('&' . $args);
2405
+		$url .= quote_amp('&'.$args);
2407 2406
 	}
2408 2407
 
2409 2408
 	if ($no_entities) {
@@ -2437,9 +2436,9 @@  discard block
 block discarded – undo
2437 2436
 	}
2438 2437
 	$url =
2439 2438
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2440
-	. $script . '/'
2439
+	. $script.'/'
2441 2440
 	. ($path ? trim($path, '/') : '')
2442
-	. ($args ? "?" . quote_amp($args) : '');
2441
+	. ($args ? "?".quote_amp($args) : '');
2443 2442
 
2444 2443
 	if ($no_entities) {
2445 2444
 		$url = str_replace('&amp;', '&', $url);
@@ -2488,17 +2487,17 @@  discard block
 block discarded – undo
2488 2487
 
2489 2488
 	// le nom du repertoire plugins/ activables/desactivables
2490 2489
 	if (!defined('_DIR_PLUGINS')) {
2491
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2490
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2492 2491
 	}
2493 2492
 
2494 2493
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2495 2494
 	if (!defined('_DIR_PLUGINS_DIST')) {
2496
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2495
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2497 2496
 	}
2498 2497
 
2499 2498
 	// le nom du repertoire des librairies
2500 2499
 	if (!defined('_DIR_LIB')) {
2501
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2500
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2502 2501
 	}
2503 2502
 
2504 2503
 	if (!defined('_DIR_IMG')) {
@@ -2508,29 +2507,29 @@  discard block
 block discarded – undo
2508 2507
 		define('_DIR_LOGOS', $pa);
2509 2508
 	}
2510 2509
 	if (!defined('_DIR_IMG_ICONES')) {
2511
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2510
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2512 2511
 	}
2513 2512
 
2514 2513
 	if (!defined('_DIR_DUMP')) {
2515
-		define('_DIR_DUMP', $ti . 'dump/');
2514
+		define('_DIR_DUMP', $ti.'dump/');
2516 2515
 	}
2517 2516
 	if (!defined('_DIR_SESSIONS')) {
2518
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2517
+		define('_DIR_SESSIONS', $ti.'sessions/');
2519 2518
 	}
2520 2519
 	if (!defined('_DIR_TRANSFERT')) {
2521
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2520
+		define('_DIR_TRANSFERT', $ti.'upload/');
2522 2521
 	}
2523 2522
 	if (!defined('_DIR_CACHE')) {
2524
-		define('_DIR_CACHE', $ti . 'cache/');
2523
+		define('_DIR_CACHE', $ti.'cache/');
2525 2524
 	}
2526 2525
 	if (!defined('_DIR_CACHE_XML')) {
2527
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2526
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2528 2527
 	}
2529 2528
 	if (!defined('_DIR_SKELS')) {
2530
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2529
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2531 2530
 	}
2532 2531
 	if (!defined('_DIR_AIDE')) {
2533
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2532
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2534 2533
 	}
2535 2534
 	if (!defined('_DIR_TMP')) {
2536 2535
 		define('_DIR_TMP', $ti);
@@ -2559,27 +2558,27 @@  discard block
 block discarded – undo
2559 2558
 	// Declaration des fichiers
2560 2559
 
2561 2560
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2562
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2561
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2563 2562
 	}
2564 2563
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2565
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2564
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2566 2565
 	}
2567 2566
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2568
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2567
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2569 2568
 	}
2570 2569
 	if (!defined('_CACHE_PIPELINES')) {
2571
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2570
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2572 2571
 	}
2573 2572
 	if (!defined('_CACHE_CHEMIN')) {
2574
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2573
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2575 2574
 	}
2576 2575
 
2577 2576
 	# attention .php obligatoire pour ecrire_fichier_securise
2578 2577
 	if (!defined('_FILE_META')) {
2579
-		define('_FILE_META', $ti . 'meta_cache.php');
2578
+		define('_FILE_META', $ti.'meta_cache.php');
2580 2579
 	}
2581 2580
 	if (!defined('_DIR_LOG')) {
2582
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2581
+		define('_DIR_LOG', _DIR_TMP.'log/');
2583 2582
 	}
2584 2583
 	if (!defined('_FILE_LOG')) {
2585 2584
 		define('_FILE_LOG', 'spip');
@@ -2596,8 +2595,8 @@  discard block
 block discarded – undo
2596 2595
 	if (!defined('_FILE_CONNECT')) {
2597 2596
 		define(
2598 2597
 			'_FILE_CONNECT',
2599
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2600
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2598
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2599
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2601 2600
 			: false))
2602 2601
 		);
2603 2602
 	}
@@ -2609,7 +2608,7 @@  discard block
 block discarded – undo
2609 2608
 	if (!defined('_FILE_CHMOD')) {
2610 2609
 		define(
2611 2610
 			'_FILE_CHMOD',
2612
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2611
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2613 2612
 			: false)
2614 2613
 		);
2615 2614
 	}
@@ -2622,10 +2621,10 @@  discard block
 block discarded – undo
2622 2621
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2623 2622
 	}
2624 2623
 	if (!defined('_FILE_CONNECT_TMP')) {
2625
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2624
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2626 2625
 	}
2627 2626
 	if (!defined('_FILE_CHMOD_TMP')) {
2628
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2627
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2629 2628
 	}
2630 2629
 
2631 2630
 	// Definition des droits d'acces en ecriture
@@ -2643,13 +2642,13 @@  discard block
 block discarded – undo
2643 2642
 		define('_DEFAULT_CHARSET', 'utf-8');
2644 2643
 	}
2645 2644
 	if (!defined('_ROOT_PLUGINS')) {
2646
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2645
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2647 2646
 	}
2648 2647
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2649
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2648
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2650 2649
 	}
2651 2650
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2652
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2651
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2653 2652
 	}
2654 2653
 
2655 2654
 	// La taille des Log
@@ -2686,7 +2685,7 @@  discard block
 block discarded – undo
2686 2685
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2687 2686
 	// pour le rendre surchargeable, on va provoquer un reecriture
2688 2687
 	// systematique du noyau ou une baisse de perfs => a etudier)
2689
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2688
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2690 2689
 
2691 2690
 	// charger tout de suite le path et son cache
2692 2691
 	load_path_cache();
@@ -2734,7 +2733,7 @@  discard block
 block discarded – undo
2734 2733
 			!empty($_SERVER['QUERY_STRING'])
2735 2734
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2736 2735
 		) {
2737
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2736
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2738 2737
 		}
2739 2738
 	}
2740 2739
 
@@ -2770,7 +2769,7 @@  discard block
 block discarded – undo
2770 2769
 		) {
2771 2770
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2772 2771
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2773
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2772
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2774 2773
 			} else {
2775 2774
 				$uri_ref = '';
2776 2775
 			}
@@ -2864,7 +2863,7 @@  discard block
 block discarded – undo
2864 2863
 	}
2865 2864
 	if (!defined('_CACHE_RUBRIQUES')) {
2866 2865
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2867
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2866
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2868 2867
 	}
2869 2868
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2870 2869
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2968,7 +2967,7 @@  discard block
 block discarded – undo
2968 2967
 					$memory *= 1024;
2969 2968
 			}
2970 2969
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2971
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2970
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2972 2971
 				if (trim(ini_get('memory_limit')) != $m) {
2973 2972
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2974 2973
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -3119,7 +3118,7 @@  discard block
 block discarded – undo
3119 3118
 					}
3120 3119
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3121 3120
 						spip_log($GLOBALS['visiteur_session']['nom']
3122
-							. ' ' . _VAR_MODE);
3121
+							. ' '._VAR_MODE);
3123 3122
 					}
3124 3123
 				} // pas autorise ?
3125 3124
 				else {
@@ -3134,7 +3133,7 @@  discard block
 block discarded – undo
3134 3133
 						if (strpos($self, 'page=login') === false) {
3135 3134
 							include_spip('inc/headers');
3136 3135
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3137
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3136
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3138 3137
 						}
3139 3138
 					}
3140 3139
 					// sinon tant pis
@@ -3176,10 +3175,10 @@  discard block
 block discarded – undo
3176 3175
 	// mais on risque de perturber des plugins en initialisant trop tot
3177 3176
 	// certaines constantes
3178 3177
 	@spip_initialisation_core(
3179
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3180
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3181
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3182
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3178
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3179
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3180
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3181
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3183 3182
 	);
3184 3183
 
3185 3184
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3212,7 +3211,7 @@  discard block
 block discarded – undo
3212 3211
 	}
3213 3212
 
3214 3213
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3215
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3214
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3216 3215
 		$session = charger_fonction('session', 'inc');
3217 3216
 		if ($session()) {
3218 3217
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3292,7 +3291,7 @@  discard block
 block discarded – undo
3292 3291
 			'definir_session',
3293 3292
 			$GLOBALS['visiteur_session']
3294 3293
 				? serialize($GLOBALS['visiteur_session'])
3295
-				. '_' . @$_COOKIE['spip_session']
3294
+				. '_'.@$_COOKIE['spip_session']
3296 3295
 				: ''
3297 3296
 		);
3298 3297
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3448,11 +3447,11 @@  discard block
 block discarded – undo
3448 3447
 	$GLOBALS['_INC_PUBLIC']++;
3449 3448
 
3450 3449
 	// fix #4235
3451
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3450
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3452 3451
 
3453 3452
 
3454 3453
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3455
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3454
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3456 3455
 
3457 3456
 		$page = evaluer_fond($f, $contexte, $connect);
3458 3457
 		if ($page === '') {
@@ -3537,7 +3536,7 @@  discard block
 block discarded – undo
3537 3536
  * @return array|string
3538 3537
  */
3539 3538
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3540
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3539
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3541 3540
 	if (!$pathinfo) {
3542 3541
 		return $f;
3543 3542
 	}
Please login to merge, or discard this patch.