Completed
Push — master ( 9b2529...8079cf )
by cam
01:20
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,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((string) $v);
593 593
 	$testv = (is_array($v) ? count($v) : strlen((string) $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
 /**
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 					$value = interdire_scripts($value, -1);
934 934
 				}
935 935
 				if (!empty($options['class'])) {
936
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
936
+					$value = "<span class='".$options['class']."'>$value</span>";
937 937
 				}
938 938
 				$text = str_replace("@$name@", $value, $text);
939 939
 				unset($args[$name]);
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 		// Si des variables n'ont pas ete inserees, le signaler
943 943
 		// (chaines de langues pas a jour)
944 944
 		if ($args) {
945
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
945
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
946 946
 		}
947 947
 	}
948 948
 
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 function joli_repertoire($rep) {
967 967
 	$a = substr($rep, 0, 1);
968 968
 	if ($a <> '.' and $a <> '/') {
969
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
969
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
970 970
 	}
971 971
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
972 972
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 			$p -= ($x * 1000);
1021 1021
 		}
1022 1022
 
1023
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1023
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1024 1024
 	}
1025 1025
 }
1026 1026
 
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	if ($taches and count($taches) and !spip_connect()) {
1088 1088
 		return false;
1089 1089
 	}
1090
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1090
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1091 1091
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1092 1092
 		return $genie($taches);
1093 1093
 	}
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
 	if ($queue_next_job_time == -1) {
1193 1193
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1194
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1194
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1195 1195
 		}
1196 1196
 		// utiliser un cache memoire si dispo
1197 1197
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
 		$src = '';
1261 1261
 	}
1262 1262
 	if ($script) {
1263
-		$script = ("/*<![CDATA[*/\n" .
1264
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1263
+		$script = ("/*<![CDATA[*/\n".
1264
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1265 1265
 			'/*]]>*/');
1266 1266
 	}
1267 1267
 	if ($noscript) {
@@ -1347,13 +1347,13 @@  discard block
 block discarded – undo
1347 1347
 	if ($path_base == null) {
1348 1348
 		// Chemin standard depuis l'espace public
1349 1349
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1350
-			_DIR_RACINE . ':' .
1351
-			_DIR_RACINE . 'squelettes-dist/:' .
1352
-			_DIR_RACINE . 'prive/:' .
1350
+			_DIR_RACINE.':'.
1351
+			_DIR_RACINE.'squelettes-dist/:'.
1352
+			_DIR_RACINE.'prive/:'.
1353 1353
 			_DIR_RESTREINT;
1354 1354
 		// Ajouter squelettes/
1355
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1356
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1355
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1356
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1357 1357
 		}
1358 1358
 		foreach (explode(':', $path) as $dir) {
1359 1359
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 		// Et le(s) dossier(s) des squelettes nommes
1366 1366
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1367 1367
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1368
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1368
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1369 1369
 			}
1370 1370
 		}
1371 1371
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 
1377 1377
 	if (is_array($dir_path) or strlen($dir_path)) {
1378 1378
 		$tete = '';
1379
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1379
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1380 1380
 			$tete = array_shift($path_base);
1381 1381
 		}
1382 1382
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
 	// Et le(s) dossier(s) des squelettes nommes
1398 1398
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1399 1399
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1400
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1400
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1401 1401
 		}
1402 1402
 	}
1403 1403
 
@@ -1468,14 +1468,14 @@  discard block
 block discarded – undo
1468 1468
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1469 1469
 	if (
1470 1470
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1471
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1471
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1472 1472
 		and $f = find_in_theme("$file_svg_generique")
1473 1473
 	) {
1474
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1474
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1475 1475
 			return $themefiles["$subdir$file"] = $fsize;
1476 1476
 		}
1477 1477
 		else {
1478
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1478
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1479 1479
 		}
1480 1480
 	}
1481 1481
 
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 			return $themefiles["$subdir$file"] = $f;
1486 1486
 		}
1487 1487
 	}
1488
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1488
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1489 1489
 
1490 1490
 	return $themefiles["$subdir$file"] = '';
1491 1491
 }
@@ -1593,8 +1593,8 @@  discard block
 block discarded – undo
1593 1593
 			return false;
1594 1594
 		}
1595 1595
 		if ($include and !isset($inc[$dirname][$file])) {
1596
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1597
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1596
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1597
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1598 1598
 		}
1599 1599
 
1600 1600
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1607,14 +1607,14 @@  discard block
 block discarded – undo
1607 1607
 	}
1608 1608
 
1609 1609
 	foreach (creer_chemin() as $dir) {
1610
-		if (!isset($dirs[$a = $dir . $dirname])) {
1611
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1610
+		if (!isset($dirs[$a = $dir.$dirname])) {
1611
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1612 1612
 		}
1613 1613
 		if ($dirs[$a]) {
1614
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1614
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1615 1615
 				if ($include and !isset($inc[$dirname][$file])) {
1616
-					include_once _ROOT_CWD . $a;
1617
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1616
+					include_once _ROOT_CWD.$a;
1617
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1618 1618
 				}
1619 1619
 				if (!defined('_SAUVER_CHEMIN')) {
1620 1620
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
 					define('_SAUVER_CHEMIN', true);
1625 1625
 				}
1626 1626
 
1627
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1627
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1628 1628
 			}
1629 1629
 		}
1630 1630
 	}
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 		define('_SAUVER_CHEMIN', true);
1651 1651
 	}
1652 1652
 
1653
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1653
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1654 1654
 }
1655 1655
 
1656 1656
 function clear_path_cache() {
@@ -1720,12 +1720,12 @@  discard block
 block discarded – undo
1720 1720
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1721 1721
 	// on a pas encore inclus flock.php
1722 1722
 	if (!function_exists('preg_files')) {
1723
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1723
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1724 1724
 	}
1725 1725
 
1726 1726
 	// Parcourir le chemin
1727 1727
 	foreach (creer_chemin() as $d) {
1728
-		$f = $d . $dir;
1728
+		$f = $d.$dir;
1729 1729
 		if (@is_dir($f)) {
1730 1730
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1731 1731
 			foreach ($liste as $chemin) {
@@ -1774,9 +1774,9 @@  discard block
 block discarded – undo
1774 1774
 function charger_fonction_url(string $quoi, string $type = '') {
1775 1775
 	if ($type === 'defaut') {
1776 1776
 		$objet = objet_type($quoi);
1777
-		if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true)
1777
+		if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true)
1778 1778
 			// deprecated
1779
-			or $f = charger_fonction('generer_url_' . $objet, 'urls', true)
1779
+			or $f = charger_fonction('generer_url_'.$objet, 'urls', true)
1780 1780
 		) {
1781 1781
 			return $f;
1782 1782
 		}
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
  * @deprecated 4.1
1898 1898
  * @see generer_objet_url
1899 1899
  */
1900
-function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null){
1900
+function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null) {
1901 1901
 	if ($public and is_string($public)) {
1902 1902
 		return generer_objet_url(intval($id), $entite, $args ?: '', $ancre ?: '', true, $type ?? '', $public);
1903 1903
 	}
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
  * @deprecated 4.1
1933 1933
  * @see generer_objet_url_ecrire_edit
1934 1934
  */
1935
-function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){
1935
+function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') {
1936 1936
 	return generer_objet_url_ecrire_edit(intval($id), $entite, $args, $ancre);
1937 1937
 }
1938 1938
 
@@ -1941,8 +1941,8 @@  discard block
 block discarded – undo
1941 1941
 	include_spip('base/connect_sql');
1942 1942
 	$id_type = id_table_objet($entite, $public);
1943 1943
 
1944
-	return _DIR_RACINE . get_spip_script('./')
1945
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1944
+	return _DIR_RACINE.get_spip_script('./')
1945
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1946 1946
 	. (!$args ? '' : "&$args")
1947 1947
 	. (!$ancre ? '' : "#$ancre");
1948 1948
 }
@@ -1996,7 +1996,7 @@  discard block
 block discarded – undo
1996 1996
  * @deprecated 4.1
1997 1997
  * @see  generer_objet_url_absolue
1998 1998
  */
1999
-function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null){
1999
+function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null) {
2000 2000
 	return generer_objet_url_absolue(intval($id), $entite, $args, $ancre, true, '', $connect);
2001 2001
 }
2002 2002
 
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
 				!empty($_SERVER['QUERY_STRING'])
2114 2114
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2115 2115
 			) {
2116
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2116
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2117 2117
 			}
2118 2118
 		}
2119 2119
 	}
@@ -2148,9 +2148,9 @@  discard block
 block discarded – undo
2148 2148
 		array_shift($myself);
2149 2149
 		$myself = implode('/', $myself);
2150 2150
 	}
2151
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2151
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2152 2152
 
2153
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2153
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2154 2154
 
2155 2155
 	return $url;
2156 2156
 }
@@ -2188,16 +2188,16 @@  discard block
 block discarded – undo
2188 2188
  **/
2189 2189
 function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) {
2190 2190
 	if (!$rel) {
2191
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2191
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2192 2192
 	} else {
2193 2193
 		if (!is_string($rel)) {
2194
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2194
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2195 2195
 		}
2196 2196
 	}
2197 2197
 
2198 2198
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2199 2199
 	if ($script and ($script <> 'accueil' or $rel)) {
2200
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2200
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2201 2201
 	} elseif ($args) {
2202 2202
 		$args = "?$args";
2203 2203
 	}
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
 		$args .= "#$ancre";
2206 2206
 	}
2207 2207
 
2208
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2208
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2209 2209
 }
2210 2210
 
2211 2211
 //
@@ -2287,10 +2287,10 @@  discard block
 block discarded – undo
2287 2287
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2288 2288
 		}
2289 2289
 		if ($args) {
2290
-			$action .= (strpos($action, '?') !== false ? '&' : '?') . $args;
2290
+			$action .= (strpos($action, '?') !== false ? '&' : '?').$args;
2291 2291
 		}
2292 2292
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2293
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2293
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2294 2294
 	}
2295 2295
 
2296 2296
 	if (!$no_entities) {
@@ -2302,7 +2302,7 @@  discard block
 block discarded – undo
2302 2302
 
2303 2303
 function generer_url_prive($script, $args = '', $no_entities = false) {
2304 2304
 
2305
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2305
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2306 2306
 }
2307 2307
 
2308 2308
 // Pour les formulaires en methode POST,
@@ -2337,8 +2337,7 @@  discard block
 block discarded – undo
2337 2337
 	. "><div>\n"
2338 2338
 	. "<input type='hidden' name='exec' value='$script1' />"
2339 2339
 	. $corps
2340
-	. (!$submit ? '' :
2341
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2340
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2342 2341
 	. "</div></form>\n";
2343 2342
 }
2344 2343
 
@@ -2363,14 +2362,14 @@  discard block
 block discarded – undo
2363 2362
 		? generer_url_ecrire(_request('exec'))
2364 2363
 		: generer_url_public();
2365 2364
 
2366
-	return "\n<form action='" .
2367
-	$h .
2368
-	"'" .
2369
-	$atts .
2370
-	">\n" .
2371
-	'<div>' .
2372
-	"\n<input type='hidden' name='action' value='$script' />" .
2373
-	$corps .
2365
+	return "\n<form action='".
2366
+	$h.
2367
+	"'".
2368
+	$atts.
2369
+	">\n".
2370
+	'<div>'.
2371
+	"\n<input type='hidden' name='action' value='$script' />".
2372
+	$corps.
2374 2373
 	'</div></form>';
2375 2374
 }
2376 2375
 
@@ -2398,7 +2397,7 @@  discard block
 block discarded – undo
2398 2397
 		: generer_url_public('', '', false, false);
2399 2398
 	$url = parametre_url($url, 'action', $script);
2400 2399
 	if ($args) {
2401
-		$url .= quote_amp('&' . $args);
2400
+		$url .= quote_amp('&'.$args);
2402 2401
 	}
2403 2402
 
2404 2403
 	if ($no_entities) {
@@ -2432,9 +2431,9 @@  discard block
 block discarded – undo
2432 2431
 	}
2433 2432
 	$url =
2434 2433
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2435
-	. $script . '/'
2434
+	. $script.'/'
2436 2435
 	. ($path ? trim($path, '/') : '')
2437
-	. ($args ? "?" . quote_amp($args) : '');
2436
+	. ($args ? "?".quote_amp($args) : '');
2438 2437
 
2439 2438
 	if ($no_entities) {
2440 2439
 		$url = str_replace('&amp;', '&', $url);
@@ -2483,17 +2482,17 @@  discard block
 block discarded – undo
2483 2482
 
2484 2483
 	// le nom du repertoire plugins/ activables/desactivables
2485 2484
 	if (!defined('_DIR_PLUGINS')) {
2486
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2485
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2487 2486
 	}
2488 2487
 
2489 2488
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2490 2489
 	if (!defined('_DIR_PLUGINS_DIST')) {
2491
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2490
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2492 2491
 	}
2493 2492
 
2494 2493
 	// le nom du repertoire des librairies
2495 2494
 	if (!defined('_DIR_LIB')) {
2496
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2495
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2497 2496
 	}
2498 2497
 
2499 2498
 	if (!defined('_DIR_IMG')) {
@@ -2503,29 +2502,29 @@  discard block
 block discarded – undo
2503 2502
 		define('_DIR_LOGOS', $pa);
2504 2503
 	}
2505 2504
 	if (!defined('_DIR_IMG_ICONES')) {
2506
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2505
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2507 2506
 	}
2508 2507
 
2509 2508
 	if (!defined('_DIR_DUMP')) {
2510
-		define('_DIR_DUMP', $ti . 'dump/');
2509
+		define('_DIR_DUMP', $ti.'dump/');
2511 2510
 	}
2512 2511
 	if (!defined('_DIR_SESSIONS')) {
2513
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2512
+		define('_DIR_SESSIONS', $ti.'sessions/');
2514 2513
 	}
2515 2514
 	if (!defined('_DIR_TRANSFERT')) {
2516
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2515
+		define('_DIR_TRANSFERT', $ti.'upload/');
2517 2516
 	}
2518 2517
 	if (!defined('_DIR_CACHE')) {
2519
-		define('_DIR_CACHE', $ti . 'cache/');
2518
+		define('_DIR_CACHE', $ti.'cache/');
2520 2519
 	}
2521 2520
 	if (!defined('_DIR_CACHE_XML')) {
2522
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2521
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2523 2522
 	}
2524 2523
 	if (!defined('_DIR_SKELS')) {
2525
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2524
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2526 2525
 	}
2527 2526
 	if (!defined('_DIR_AIDE')) {
2528
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2527
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2529 2528
 	}
2530 2529
 	if (!defined('_DIR_TMP')) {
2531 2530
 		define('_DIR_TMP', $ti);
@@ -2554,27 +2553,27 @@  discard block
 block discarded – undo
2554 2553
 	// Declaration des fichiers
2555 2554
 
2556 2555
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2557
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2556
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2558 2557
 	}
2559 2558
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2560
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2559
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2561 2560
 	}
2562 2561
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2563
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2562
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2564 2563
 	}
2565 2564
 	if (!defined('_CACHE_PIPELINES')) {
2566
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2565
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2567 2566
 	}
2568 2567
 	if (!defined('_CACHE_CHEMIN')) {
2569
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2568
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2570 2569
 	}
2571 2570
 
2572 2571
 	# attention .php obligatoire pour ecrire_fichier_securise
2573 2572
 	if (!defined('_FILE_META')) {
2574
-		define('_FILE_META', $ti . 'meta_cache.php');
2573
+		define('_FILE_META', $ti.'meta_cache.php');
2575 2574
 	}
2576 2575
 	if (!defined('_DIR_LOG')) {
2577
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2576
+		define('_DIR_LOG', _DIR_TMP.'log/');
2578 2577
 	}
2579 2578
 	if (!defined('_FILE_LOG')) {
2580 2579
 		define('_FILE_LOG', 'spip');
@@ -2591,8 +2590,8 @@  discard block
 block discarded – undo
2591 2590
 	if (!defined('_FILE_CONNECT')) {
2592 2591
 		define(
2593 2592
 			'_FILE_CONNECT',
2594
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2595
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2593
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2594
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2596 2595
 			: false))
2597 2596
 		);
2598 2597
 	}
@@ -2604,7 +2603,7 @@  discard block
 block discarded – undo
2604 2603
 	if (!defined('_FILE_CHMOD')) {
2605 2604
 		define(
2606 2605
 			'_FILE_CHMOD',
2607
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2606
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2608 2607
 			: false)
2609 2608
 		);
2610 2609
 	}
@@ -2617,10 +2616,10 @@  discard block
 block discarded – undo
2617 2616
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2618 2617
 	}
2619 2618
 	if (!defined('_FILE_CONNECT_TMP')) {
2620
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2619
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2621 2620
 	}
2622 2621
 	if (!defined('_FILE_CHMOD_TMP')) {
2623
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2622
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2624 2623
 	}
2625 2624
 
2626 2625
 	// Definition des droits d'acces en ecriture
@@ -2638,13 +2637,13 @@  discard block
 block discarded – undo
2638 2637
 		define('_DEFAULT_CHARSET', 'utf-8');
2639 2638
 	}
2640 2639
 	if (!defined('_ROOT_PLUGINS')) {
2641
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2640
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2642 2641
 	}
2643 2642
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2644
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2643
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2645 2644
 	}
2646 2645
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2647
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2646
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2648 2647
 	}
2649 2648
 
2650 2649
 	// La taille des Log
@@ -2681,7 +2680,7 @@  discard block
 block discarded – undo
2681 2680
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2682 2681
 	// pour le rendre surchargeable, on va provoquer un reecriture
2683 2682
 	// systematique du noyau ou une baisse de perfs => a etudier)
2684
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2683
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2685 2684
 
2686 2685
 	// charger tout de suite le path et son cache
2687 2686
 	load_path_cache();
@@ -2729,7 +2728,7 @@  discard block
 block discarded – undo
2729 2728
 			!empty($_SERVER['QUERY_STRING'])
2730 2729
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2731 2730
 		) {
2732
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2731
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2733 2732
 		}
2734 2733
 	}
2735 2734
 
@@ -2765,7 +2764,7 @@  discard block
 block discarded – undo
2765 2764
 		) {
2766 2765
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2767 2766
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2768
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2767
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2769 2768
 			} else {
2770 2769
 				$uri_ref = '';
2771 2770
 			}
@@ -2859,7 +2858,7 @@  discard block
 block discarded – undo
2859 2858
 	}
2860 2859
 	if (!defined('_CACHE_RUBRIQUES')) {
2861 2860
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2862
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2861
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2863 2862
 	}
2864 2863
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2865 2864
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2963,7 +2962,7 @@  discard block
 block discarded – undo
2963 2962
 					$memory *= 1024;
2964 2963
 			}
2965 2964
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2966
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2965
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2967 2966
 				if (trim(ini_get('memory_limit')) != $m) {
2968 2967
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2969 2968
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -3114,7 +3113,7 @@  discard block
 block discarded – undo
3114 3113
 					}
3115 3114
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3116 3115
 						spip_log($GLOBALS['visiteur_session']['nom']
3117
-							. ' ' . _VAR_MODE);
3116
+							. ' '._VAR_MODE);
3118 3117
 					}
3119 3118
 				} // pas autorise ?
3120 3119
 				else {
@@ -3129,7 +3128,7 @@  discard block
 block discarded – undo
3129 3128
 						if (strpos($self, 'page=login') === false) {
3130 3129
 							include_spip('inc/headers');
3131 3130
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3132
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3131
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3133 3132
 						}
3134 3133
 					}
3135 3134
 					// sinon tant pis
@@ -3171,10 +3170,10 @@  discard block
 block discarded – undo
3171 3170
 	// mais on risque de perturber des plugins en initialisant trop tot
3172 3171
 	// certaines constantes
3173 3172
 	@spip_initialisation_core(
3174
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3175
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3176
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3177
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3173
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3174
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3175
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3176
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3178 3177
 	);
3179 3178
 
3180 3179
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3207,7 +3206,7 @@  discard block
 block discarded – undo
3207 3206
 	}
3208 3207
 
3209 3208
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3210
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3209
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3211 3210
 		$session = charger_fonction('session', 'inc');
3212 3211
 		if ($session()) {
3213 3212
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3287,7 +3286,7 @@  discard block
 block discarded – undo
3287 3286
 			'definir_session',
3288 3287
 			$GLOBALS['visiteur_session']
3289 3288
 				? serialize($GLOBALS['visiteur_session'])
3290
-				. '_' . @$_COOKIE['spip_session']
3289
+				. '_'.@$_COOKIE['spip_session']
3291 3290
 				: ''
3292 3291
 		);
3293 3292
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3443,11 +3442,11 @@  discard block
 block discarded – undo
3443 3442
 	$GLOBALS['_INC_PUBLIC']++;
3444 3443
 
3445 3444
 	// fix #4235
3446
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3445
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3447 3446
 
3448 3447
 
3449 3448
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3450
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3449
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3451 3450
 
3452 3451
 		$page = evaluer_fond($f, $contexte, $connect);
3453 3452
 		if ($page === '') {
@@ -3532,7 +3531,7 @@  discard block
 block discarded – undo
3532 3531
  * @return array|string
3533 3532
  */
3534 3533
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3535
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3534
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3536 3535
 	if (!$pathinfo) {
3537 3536
 		return $f;
3538 3537
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_ecrire.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	if ($objet == 'rubrique') {
115 115
 		// si c'est une rubrique-secteur contenant des breves, demander la
116 116
 		// confirmation du deplacement
117
-		$contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . intval($id_objet));
117
+		$contient_breves = sql_countsel('spip_breves', 'id_rubrique='.intval($id_objet));
118 118
 
119 119
 		if ($contient_breves > 0) {
120 120
 			$scb = ($contient_breves > 1 ? 's' : '');
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			);
128 128
 			$confirm .= "\n<div class='confirmer_deplacement verdana2'>"
129 129
 				. "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
130
-				. $scb .
130
+				. $scb.
131 131
 				"</label></div></div>\n";
132 132
 		} else {
133 133
 			$confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 	$form .= $confirm;
137 137
 	if ($actionable) {
138 138
 		if (strpos($form, '<select') !== false) {
139
-			$form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
140
-				. '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
139
+			$form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>"
140
+				. '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>'
141 141
 				. '</div>';
142 142
 		}
143
-		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
143
+		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form;
144 144
 		if ($action = charger_fonction("editer_$objet", 'action', true)) {
145 145
 			$form = generer_action_auteur(
146 146
 				"editer_$objet",
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
 	include_spip('inc/presentation');
168 168
 
169
-	return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
169
+	return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur();
170 170
 }
171 171
 
172 172
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	if ($statut == 'nouveau') {
243 243
 		if ($attente) {
244 244
 			$statut = $attente;
245
-			$plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
245
+			$plus = ' ('._T('info_statut_auteur_a_confirmer').')';
246 246
 		} else {
247 247
 			return _T('info_statut_auteur_a_confirmer');
248 248
 		}
@@ -255,16 +255,16 @@  discard block
 block discarded – undo
255 255
 		'5poubelle' => _T('texte_statut_poubelle'), // bouh
256 256
 	];
257 257
 	if (isset($recom[$statut])) {
258
-		return $recom[$statut] . $plus;
258
+		return $recom[$statut].$plus;
259 259
 	}
260 260
 
261 261
 	// retrouver directement par le statut sinon
262 262
 	if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
263 263
 		if (isset($recom[$t])) {
264
-			return $recom[$t] . $plus;
264
+			return $recom[$t].$plus;
265 265
 		}
266 266
 
267
-		return _T($t) . $plus;
267
+		return _T($t).$plus;
268 268
 	}
269 269
 
270 270
 	// si on a pas reussi a le traduire, retournons la chaine telle quelle
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	if (!$id_rubrique and defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') and _CHOIX_RUBRIQUE_PAR_DEFAUT) {
389 389
 		$in = !(is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
390 390
 			? ''
391
-			: (' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']));
391
+			: (' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']));
392 392
 
393 393
 		// on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
394 394
 		if ($objet == 'rubrique') {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		return '';
423 423
 	}
424 424
 
425
-	return propre('[->' . $virtuel . ']');
425
+	return propre('[->'.$virtuel.']');
426 426
 }
427 427
 
428 428
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	$clic = http_img_pack('rss-16.png', 'RSS', '', $title);
450 450
 
451 451
 	$url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
452
-	return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
452
+	return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>";
453 453
 }
454 454
 
455 455
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 	);
526 526
 
527 527
 	if ($alertes = array_filter($alertes)) {
528
-		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
528
+		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>".
529 529
 		join(' | ', $alertes)
530 530
 		. '</div></div>';
531 531
 	}
@@ -559,13 +559,13 @@  discard block
 block discarded – undo
559 559
  */
560 560
 function afficher_plus_info($lien, $titre = '+', $titre_lien = '') {
561 561
 	$titre = attribut_html($titre);
562
-	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
563
-		http_img_pack('information-16.png', $titre) . '</a>';
562
+	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>".
563
+		http_img_pack('information-16.png', $titre).'</a>';
564 564
 
565 565
 	if (!$titre_lien) {
566 566
 		return $icone;
567 567
 	} else {
568
-		return $icone . "\n<a href='$lien'>$titre_lien</a>";
568
+		return $icone."\n<a href='$lien'>$titre_lien</a>";
569 569
 	}
570 570
 }
571 571
 
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	$s = '';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 			if (!$s) {
43 43
 				$s = random_int(0, mt_getrandmax());
44 44
 			}
45
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
45
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
46 46
 		}
47
-		$r = unpack('Cr', pack('H2', $s . $s));
47
+		$r = unpack('Cr', pack('H2', $s.$s));
48 48
 		$x = $r['r'] & 63;
49 49
 		if ($x < 10) {
50 50
 			$x = chr($x + 48);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	static $seeded;
83 83
 
84 84
 	if (!$seeded) {
85
-		$seed = (int)round(((float)microtime() + 1) * time());
85
+		$seed = (int) round(((float) microtime() + 1) * time());
86 86
 		mt_srand($seed);
87 87
 		$seeded = true;
88 88
 	}
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
169 169
 		}
170 170
 	} else {
171
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur));
171
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur));
172 172
 		if (!$low_sec) {
173 173
 			$low_sec = creer_pass_aleatoire();
174
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur));
174
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur));
175 175
 		}
176 176
 	}
177 177
 
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) {
230 230
 	$id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0;
231 231
 	$cle = afficher_low_sec($id_auteur, "$script/$format $fond $args");
232
-	$path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : '');
232
+	$path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : '');
233 233
 
234
-	return generer_url_api( $script,  $path,  $args, $no_entities = false, $public);
234
+	return generer_url_api($script, $path, $args, $no_entities = false, $public);
235 235
 }
236 236
 
237 237
 
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 	foreach ($args as $val => $var) {
254 254
 		if ($var) {
255 255
 			if ($val <> 'statut') {
256
-				$a .= ':' . $val . '-' . $var;
256
+				$a .= ':'.$val.'-'.$var;
257 257
 			}
258
-			$b .= $val . '=' . $var . '&';
258
+			$b .= $val.'='.$var.'&';
259 259
 		}
260 260
 	}
261 261
 	$a = substr($a, 1);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
  *     Clé
286 286
  **/
287 287
 function afficher_low_sec($id_auteur, $action = '') {
288
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
288
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
289 289
 }
290 290
 
291 291
 /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	if (!$id_auteur = intval($id_auteur)) {
317 317
 		return;
318 318
 	} // jamais trop prudent ;)
319
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur));
319
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur));
320 320
 }
321 321
 
322 322
 /**
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 function initialiser_sel() {
328 328
 	if (!isset($GLOBALS['htsalt'])) {
329 329
 		if (CRYPT_MD5) {
330
-			$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
330
+			$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
331 331
 		} else {
332 332
 			$GLOBALS['htsalt'] = '';
333 333
 		}
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
  *     - void sinon.
350 350
  **/
351 351
 function ecrire_acces() {
352
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
353
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
352
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
353
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
354 354
 
355 355
 	// Cette variable de configuration peut etre posee par un plugin
356 356
 	// par exemple acces_restreint ;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 		and !@file_exists($htaccess)
362 362
 	) {
363 363
 		spip_unlink($htpasswd);
364
-		spip_unlink($htpasswd . '-admin');
364
+		spip_unlink($htpasswd.'-admin');
365 365
 		return;
366 366
 	}
367 367
 
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
 	$pwd_all = ''; // login:htpass pour tous
391 391
 	$pwd_admin = ''; // login:htpass pour les admins
392 392
 
393
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
393
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
394 394
 	while ($row = sql_fetch($res)) {
395 395
 		if (strlen($row['login']) and strlen($row['htpass'])) {
396
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
396
+			$ligne = $row['login'].':'.$row['htpass']."\n";
397 397
 			$pwd_all .= $ligne;
398 398
 			if ($row['statut'] == '0minirezo') {
399 399
 				$pwd_admin .= $ligne;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
  * @return boolean
439 439
  */
440 440
 function verifier_htaccess($rep, $force = false) {
441
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
441
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
442 442
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
443 443
 		return true;
444 444
 	}
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
 		fputs($ht, $deny);
468 468
 		fclose($ht);
469 469
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
470
-		$t = rtrim($rep, '/') . '/.ok';
470
+		$t = rtrim($rep, '/').'/.ok';
471 471
 		if ($ht = @fopen($t, 'w')) {
472 472
 			@fclose($ht);
473 473
 			include_spip('inc/distant');
474 474
 			$t = substr($t, strlen(_DIR_RACINE));
475
-			$t = url_de_base() . $t;
475
+			$t = url_de_base().$t;
476 476
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
477 477
 			$ht = ($ht['status'] ?? null) === 403;
478 478
 		}
479 479
 	}
480
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
480
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
481 481
 
482 482
 	return $ht;
483 483
 }
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
504 504
 	$dirs[] = ['extension' => 'distant'];
505 505
 	foreach ($dirs as $e) {
506
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
506
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
507 507
 			if ($f) {
508 508
 				verifier_htaccess($dir);
509 509
 			} else {
510
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
510
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
511 511
 			}
512 512
 		}
513 513
 	}
Please login to merge, or discard this patch.