Completed
Pull Request — master (#32)
by
unknown
07:05 queued 01:05
created
ecrire/inc/utils.php 1 patch
Spacing   +123 added lines, -126 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
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 	// passer en minuscules (cf les balises de formulaires)
80 80
 	// et inclure le fichier
81
-	if (!$inc = include_spip($dossier . ($d = strtolower($nom)))
81
+	if (!$inc = include_spip($dossier.($d = strtolower($nom)))
82 82
 		// si le fichier truc/machin/nom.php n'existe pas,
83 83
 		// la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions
84 84
 		and strlen(dirname($dossier)) and dirname($dossier) != '.'
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 	}
98 98
 
99 99
 	// Echec : message d'erreur
100
-	spip_log("fonction $nom ($f ou $g) indisponible" .
100
+	spip_log("fonction $nom ($f ou $g) indisponible".
101 101
 		($inc ? "" : " (fichier $d absent de $dossier)"));
102 102
 
103 103
 	include_spip('inc/minipres');
104 104
 	echo minipres(_T('forum_titre_erreur'),
105
-		_T('fichier_introuvable', array('fichier' => '<b>' . spip_htmlentities($d) . '</b>')),
106
-		array('all_inline'=>true,'status'=>404));
105
+		_T('fichier_introuvable', array('fichier' => '<b>'.spip_htmlentities($d).'</b>')),
106
+		array('all_inline'=>true, 'status'=>404));
107 107
 	exit;
108 108
 }
109 109
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
  *     - string : chemin du fichier trouvé
149 149
  **/
150 150
 function include_spip($f, $include = true) {
151
-	return find_in_path($f . '.php', '', $include);
151
+	return find_in_path($f.'.php', '', $include);
152 152
 }
153 153
 
154 154
 /**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
  *     - string : chemin du fichier trouvé
169 169
  **/
170 170
 function require_spip($f) {
171
-	return find_in_path($f . '.php', '', 'required');
171
+	return find_in_path($f.'.php', '', 'required');
172 172
 }
173 173
 
174 174
 /**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	}
261 261
 
262 262
 	// appliquer notre fonction si elle existe
263
-	$fonc = 'execute_pipeline_' . strtolower($action);
263
+	$fonc = 'execute_pipeline_'.strtolower($action);
264 264
 	if (function_exists($fonc)) {
265 265
 		$val = $fonc($val);
266 266
 	} // plantage ?
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 function spip_log($message = null, $name = null) {
325 325
 	static $pre = array();
326 326
 	static $log;
327
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
327
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
328 328
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
329 329
 		$logname = null;
330 330
 	}
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		if (!is_string($message)) {
350 350
 			$message = print_r($message, true);
351 351
 		}
352
-		$log($pre[$niveau] . ' ' . $message, $logname);
352
+		$log($pre[$niveau].' '.$message, $logname);
353 353
 	}
354 354
 }
355 355
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 		$a = './';
513 513
 	}
514 514
 
515
-	$regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,';
515
+	$regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,';
516 516
 	$ajouts = array_flip(explode('|', $c));
517 517
 	$u = is_array($v) ? $v : rawurlencode($v);
518 518
 	$testv = (is_array($v) ? count($v) : strlen($v));
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 			// Ajout. Pour une variable, remplacer au meme endroit,
540 540
 			// pour un tableau ce sera fait dans la prochaine boucle
541 541
 			elseif (substr($r[1], -2) != '[]') {
542
-				$url[$n] = $r[1] . '=' . $u;
542
+				$url[$n] = $r[1].'='.$u;
543 543
 				unset($ajouts[$r[1]]);
544 544
 			}
545 545
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 	} elseif ($testv) {
560 560
 		foreach ($ajouts as $k => $n) {
561 561
 			if (!is_array($v)) {
562
-				$url[] = $k . '=' . $u;
562
+				$url[] = $k.'='.$u;
563 563
 			} else {
564
-				$id = (substr($k, -2) == '[]') ? $k : ($k . "[]");
564
+				$id = (substr($k, -2) == '[]') ? $k : ($k."[]");
565 565
 				foreach ($v as $w) {
566
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : $w);
566
+					$url[] = $id.'='.(is_array($w) ? 'Array' : $w);
567 567
 				}
568 568
 			}
569 569
 		}
@@ -574,10 +574,10 @@  discard block
 block discarded – undo
574 574
 
575 575
 	// recomposer l'adresse
576 576
 	if ($url) {
577
-		$a .= '?' . join($sep, $url);
577
+		$a .= '?'.join($sep, $url);
578 578
 	}
579 579
 
580
-	return $a . $ancre;
580
+	return $a.$ancre;
581 581
 }
582 582
 
583 583
 /**
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 			translitteration($ancre)
610 610
 		);
611 611
 	}
612
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
612
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
613 613
 }
614 614
 
615 615
 /**
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
  * @return bool
719 719
  */
720 720
 function test_plugin_actif($plugin) {
721
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
721
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
722 722
 }
723 723
 
724 724
 /**
@@ -786,8 +786,7 @@  discard block
 block discarded – undo
786 786
 		// pour les chaines non traduites, assurer un service minimum
787 787
 		if (!$GLOBALS['test_i18n'] and (_request('var_mode') != 'traduction')) {
788 788
 			$text = str_replace('_', ' ',
789
-				(($n = strpos($text, ':')) === false ? $texte :
790
-					substr($texte, $n + 1)));
789
+				(($n = strpos($text, ':')) === false ? $texte : substr($texte, $n + 1)));
791 790
 		}
792 791
 		$o['class'] = null;
793 792
 
@@ -860,7 +859,7 @@  discard block
 block discarded – undo
860 859
 		// Si des variables n'ont pas ete inserees, le signaler
861 860
 		// (chaines de langues pas a jour)
862 861
 		if ($args) {
863
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
862
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
864 863
 		}
865 864
 	}
866 865
 
@@ -884,7 +883,7 @@  discard block
 block discarded – undo
884 883
 function joli_repertoire($rep) {
885 884
 	$a = substr($rep, 0, 1);
886 885
 	if ($a <> '.' and $a <> '/') {
887
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
886
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
888 887
 	}
889 888
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
890 889
 
@@ -938,7 +937,7 @@  discard block
 block discarded – undo
938 937
 			$p -= ($x * 1000);
939 938
 		}
940 939
 
941
-		return $s . sprintf($s ? "%07.3f ms" : "%.3f ms", $p);
940
+		return $s.sprintf($s ? "%07.3f ms" : "%.3f ms", $p);
942 941
 	}
943 942
 }
944 943
 
@@ -1007,7 +1006,7 @@  discard block
 block discarded – undo
1007 1006
 	if ($taches and count($taches) and !spip_connect()) {
1008 1007
 		return false;
1009 1008
 	}
1010
-	spip_log("cron !", 'jq' . _LOG_DEBUG);
1009
+	spip_log("cron !", 'jq'._LOG_DEBUG);
1011 1010
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1012 1011
 		return $genie($taches);
1013 1012
 	}
@@ -1111,7 +1110,7 @@  discard block
 block discarded – undo
1111 1110
 
1112 1111
 	if ($queue_next_job_time == -1) {
1113 1112
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1114
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . "job_queue_next.txt");
1113
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP."job_queue_next.txt");
1115 1114
 		}
1116 1115
 		// utiliser un cache memoire si dispo
1117 1116
 		if (function_exists("cache_get") and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1178,8 +1177,8 @@  discard block
 block discarded – undo
1178 1177
 		$src = '';
1179 1178
 	}
1180 1179
 	if ($script) {
1181
-		$script = ("/*<![CDATA[*/\n" .
1182
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1180
+		$script = ("/*<![CDATA[*/\n".
1181
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1183 1182
 			"/*]]>*/");
1184 1183
 	}
1185 1184
 	if ($noscript) {
@@ -1265,13 +1264,13 @@  discard block
 block discarded – undo
1265 1264
 	if ($path_base == null) {
1266 1265
 		// Chemin standard depuis l'espace public
1267 1266
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1268
-			_DIR_RACINE . ':' .
1269
-			_DIR_RACINE . 'squelettes-dist/:' .
1270
-			_DIR_RACINE . 'prive/:' .
1267
+			_DIR_RACINE.':'.
1268
+			_DIR_RACINE.'squelettes-dist/:'.
1269
+			_DIR_RACINE.'prive/:'.
1271 1270
 			_DIR_RESTREINT;
1272 1271
 		// Ajouter squelettes/
1273
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1274
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1272
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1273
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1275 1274
 		}
1276 1275
 		foreach (explode(':', $path) as $dir) {
1277 1276
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1283,7 +1282,7 @@  discard block
 block discarded – undo
1283 1282
 		// Et le(s) dossier(s) des squelettes nommes
1284 1283
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1285 1284
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1286
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1285
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1287 1286
 			}
1288 1287
 		}
1289 1288
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1294,7 +1293,7 @@  discard block
 block discarded – undo
1294 1293
 
1295 1294
 	if (strlen($dir_path)) {
1296 1295
 		$tete = "";
1297
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1296
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1298 1297
 			$tete = array_shift($path_base);
1299 1298
 		}
1300 1299
 		$dirs = array_reverse(explode(':', $dir_path));
@@ -1316,7 +1315,7 @@  discard block
 block discarded – undo
1316 1315
 	// Et le(s) dossier(s) des squelettes nommes
1317 1316
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1318 1317
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1319
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1318
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1320 1319
 		}
1321 1320
 	}
1322 1321
 
@@ -1389,7 +1388,7 @@  discard block
 block discarded – undo
1389 1388
 			return $themefiles["$subdir$file"] = $f;
1390 1389
 		}
1391 1390
 	}
1392
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1391
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1393 1392
 
1394 1393
 	return $themefiles["$subdir$file"] = "";
1395 1394
 }
@@ -1490,8 +1489,8 @@  discard block
 block discarded – undo
1490 1489
 			return false;
1491 1490
 		}
1492 1491
 		if ($include and !isset($inc[$dirname][$file])) {
1493
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1494
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1492
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1493
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1495 1494
 		}
1496 1495
 
1497 1496
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1504,14 +1503,14 @@  discard block
 block discarded – undo
1504 1503
 	}
1505 1504
 
1506 1505
 	foreach (creer_chemin() as $dir) {
1507
-		if (!isset($dirs[$a = $dir . $dirname])) {
1508
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1506
+		if (!isset($dirs[$a = $dir.$dirname])) {
1507
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1509 1508
 		}
1510 1509
 		if ($dirs[$a]) {
1511
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1510
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1512 1511
 				if ($include and !isset($inc[$dirname][$file])) {
1513
-					include_once _ROOT_CWD . $a;
1514
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1512
+					include_once _ROOT_CWD.$a;
1513
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1515 1514
 				}
1516 1515
 				if (!defined('_SAUVER_CHEMIN')) {
1517 1516
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1521,7 +1520,7 @@  discard block
 block discarded – undo
1521 1520
 					define('_SAUVER_CHEMIN', true);
1522 1521
 				}
1523 1522
 
1524
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1523
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1525 1524
 			}
1526 1525
 		}
1527 1526
 	}
@@ -1547,7 +1546,7 @@  discard block
 block discarded – undo
1547 1546
 		define('_SAUVER_CHEMIN', true);
1548 1547
 	}
1549 1548
 
1550
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1549
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1551 1550
 }
1552 1551
 
1553 1552
 function clear_path_cache() {
@@ -1616,12 +1615,12 @@  discard block
 block discarded – undo
1616 1615
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1617 1616
 	// on a pas encore inclus flock.php
1618 1617
 	if (!function_exists('preg_files')) {
1619
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1618
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1620 1619
 	}
1621 1620
 
1622 1621
 	// Parcourir le chemin
1623 1622
 	foreach (creer_chemin() as $d) {
1624
-		$f = $d . $dir;
1623
+		$f = $d.$dir;
1625 1624
 		if (@is_dir($f)) {
1626 1625
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? array() : $recurs);
1627 1626
 			foreach ($liste as $chemin) {
@@ -1722,7 +1721,7 @@  discard block
 block discarded – undo
1722 1721
 		return $res;
1723 1722
 	}
1724 1723
 	// Sinon c'est un raccourci ou compat SPIP < 2
1725
-	if (!function_exists($f = 'generer_url_' . $entite)) {
1724
+	if (!function_exists($f = 'generer_url_'.$entite)) {
1726 1725
 		if (!function_exists($f .= '_dist')) {
1727 1726
 			$f = '';
1728 1727
 		}
@@ -1731,8 +1730,8 @@  discard block
 block discarded – undo
1731 1730
 		$url = $f($id, $args, $ancre);
1732 1731
 		if (strlen($args)) {
1733 1732
 			$url .= strstr($url, '?')
1734
-				? '&amp;' . $args
1735
-				: '?' . $args;
1733
+				? '&amp;'.$args
1734
+				: '?'.$args;
1736 1735
 		}
1737 1736
 
1738 1737
 		return $url;
@@ -1763,8 +1762,8 @@  discard block
 block discarded – undo
1763 1762
 	include_spip('base/connect_sql');
1764 1763
 	$id_type = id_table_objet($entite, $public);
1765 1764
 
1766
-	return _DIR_RACINE . get_spip_script('./')
1767
-	. "?" . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1765
+	return _DIR_RACINE.get_spip_script('./')
1766
+	. "?"._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1768 1767
 	. (!$args ? '' : "&$args")
1769 1768
 	. (!$ancre ? '' : "#$ancre");
1770 1769
 }
@@ -1916,7 +1915,7 @@  discard block
 block discarded – undo
1916 1915
 			if (!empty($_SERVER['QUERY_STRING'])
1917 1916
 				and !strpos($_SERVER['REQUEST_URI'], '?')
1918 1917
 			) {
1919
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
1918
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
1920 1919
 			}
1921 1920
 		}
1922 1921
 	}
@@ -1943,17 +1942,17 @@  discard block
 block discarded – undo
1943 1942
 	list($myself) = explode('?', $myself);
1944 1943
 	// vieux mode HTTP qui envoie après le nom de la methode l'URL compléte
1945 1944
 	// protocole, "://", nom du serveur avant le path dans _SERVER["REQUEST_URI"]
1946
-	if (strpos($myself,'://') !== false) {
1947
-		$myself = explode('://',$myself);
1945
+	if (strpos($myself, '://') !== false) {
1946
+		$myself = explode('://', $myself);
1948 1947
 		array_shift($myself);
1949
-		$myself = implode('://',$myself);
1950
-		$myself = explode('/',$myself);
1948
+		$myself = implode('://', $myself);
1949
+		$myself = explode('/', $myself);
1951 1950
 		array_shift($myself);
1952
-		$myself = implode('/',$myself);
1951
+		$myself = implode('/', $myself);
1953 1952
 	}
1954
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
1953
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
1955 1954
 
1956
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
1955
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
1957 1956
 
1958 1957
 	return $url;
1959 1958
 }
@@ -1991,17 +1990,17 @@  discard block
 block discarded – undo
1991 1990
  **/
1992 1991
 function generer_url_ecrire($script = '', $args = "", $no_entities = false, $rel = false) {
1993 1992
 	if (!$rel) {
1994
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
1993
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
1995 1994
 	} else {
1996 1995
 		if (!is_string($rel)) {
1997 1996
 			$rel = _DIR_RESTREINT ? _DIR_RESTREINT :
1998
-				('./' . _SPIP_ECRIRE_SCRIPT);
1997
+				('./'._SPIP_ECRIRE_SCRIPT);
1999 1998
 		}
2000 1999
 	}
2001 2000
 
2002 2001
 	list($script, $ancre) = array_pad(explode('#', $script), 2, null);
2003 2002
 	if ($script and ($script <> 'accueil' or $rel)) {
2004
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2003
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2005 2004
 	} elseif ($args) {
2006 2005
 		$args = "?$args";
2007 2006
 	}
@@ -2009,7 +2008,7 @@  discard block
 block discarded – undo
2009 2008
 		$args .= "#$ancre";
2010 2009
 	}
2011 2010
 
2012
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2011
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2013 2012
 }
2014 2013
 
2015 2014
 //
@@ -2079,25 +2078,25 @@  discard block
 block discarded – undo
2079 2078
 		if (is_array($args)) {
2080 2079
 			$r = '';
2081 2080
 			foreach ($args as $k => $v) {
2082
-				$r .= '&' . $k . '=' . $v;
2081
+				$r .= '&'.$k.'='.$v;
2083 2082
 			}
2084 2083
 			$args = substr($r, 1);
2085 2084
 		}
2086 2085
 		$action .=
2087
-			(strpos($action, '?') !== false ? '&' : '?') . $args;
2086
+			(strpos($action, '?') !== false ? '&' : '?').$args;
2088 2087
 	}
2089 2088
 	if (!$no_entities) {
2090 2089
 		$action = quote_amp($action);
2091 2090
 	}
2092 2091
 
2093 2092
 	// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2094
-	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(",^/[.]/,", "/", "/$action"));
2093
+	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(",^/[.]/,", "/", "/$action"));
2095 2094
 }
2096 2095
 
2097 2096
 // http://code.spip.net/@generer_url_prive
2098 2097
 function generer_url_prive($script, $args = "", $no_entities = false) {
2099 2098
 
2100
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2099
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2101 2100
 }
2102 2101
 
2103 2102
 // Pour les formulaires en methode POST,
@@ -2132,8 +2131,7 @@  discard block
 block discarded – undo
2132 2131
 	. "><div>\n"
2133 2132
 	. "<input type='hidden' name='exec' value='$script1' />"
2134 2133
 	. $corps
2135
-	. (!$submit ? '' :
2136
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo' type='submit' value=\"" . entites_html($submit) . "\" /></div>"))
2134
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo' type='submit' value=\"".entites_html($submit)."\" /></div>"))
2137 2135
 	. "</div></form>\n";
2138 2136
 }
2139 2137
 
@@ -2158,14 +2156,14 @@  discard block
 block discarded – undo
2158 2156
 		? generer_url_ecrire(_request('exec'))
2159 2157
 		: generer_url_public();
2160 2158
 
2161
-	return "\n<form action='" .
2162
-	$h .
2163
-	"'" .
2164
-	$atts .
2165
-	">\n" .
2166
-	"<div>" .
2167
-	"\n<input type='hidden' name='action' value='$script' />" .
2168
-	$corps .
2159
+	return "\n<form action='".
2160
+	$h.
2161
+	"'".
2162
+	$atts.
2163
+	">\n".
2164
+	"<div>".
2165
+	"\n<input type='hidden' name='action' value='$script' />".
2166
+	$corps.
2169 2167
 	"</div></form>";
2170 2168
 }
2171 2169
 
@@ -2193,7 +2191,7 @@  discard block
 block discarded – undo
2193 2191
 		: generer_url_public('', '', false, false);
2194 2192
 	$url = parametre_url($url, 'action', $script);
2195 2193
 	if ($args) {
2196
-		$url .= quote_amp('&' . $args);
2194
+		$url .= quote_amp('&'.$args);
2197 2195
 	}
2198 2196
 
2199 2197
 	if ($no_entities) {
@@ -2243,17 +2241,17 @@  discard block
 block discarded – undo
2243 2241
 
2244 2242
 	// le nom du repertoire plugins/ activables/desactivables
2245 2243
 	if (!defined('_DIR_PLUGINS')) {
2246
-		define('_DIR_PLUGINS', _DIR_RACINE . "plugins/");
2244
+		define('_DIR_PLUGINS', _DIR_RACINE."plugins/");
2247 2245
 	}
2248 2246
 
2249 2247
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2250 2248
 	if (!defined('_DIR_PLUGINS_DIST')) {
2251
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . "plugins-dist/");
2249
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE."plugins-dist/");
2252 2250
 	}
2253 2251
 
2254 2252
 	// le nom du repertoire des librairies
2255 2253
 	if (!defined('_DIR_LIB')) {
2256
-		define('_DIR_LIB', _DIR_RACINE . "lib/");
2254
+		define('_DIR_LIB', _DIR_RACINE."lib/");
2257 2255
 	}
2258 2256
 
2259 2257
 	if (!defined('_DIR_IMG')) {
@@ -2263,29 +2261,29 @@  discard block
 block discarded – undo
2263 2261
 		define('_DIR_LOGOS', $pa);
2264 2262
 	}
2265 2263
 	if (!defined('_DIR_IMG_ICONES')) {
2266
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . "icones/");
2264
+		define('_DIR_IMG_ICONES', _DIR_LOGOS."icones/");
2267 2265
 	}
2268 2266
 
2269 2267
 	if (!defined('_DIR_DUMP')) {
2270
-		define('_DIR_DUMP', $ti . "dump/");
2268
+		define('_DIR_DUMP', $ti."dump/");
2271 2269
 	}
2272 2270
 	if (!defined('_DIR_SESSIONS')) {
2273
-		define('_DIR_SESSIONS', $ti . "sessions/");
2271
+		define('_DIR_SESSIONS', $ti."sessions/");
2274 2272
 	}
2275 2273
 	if (!defined('_DIR_TRANSFERT')) {
2276
-		define('_DIR_TRANSFERT', $ti . "upload/");
2274
+		define('_DIR_TRANSFERT', $ti."upload/");
2277 2275
 	}
2278 2276
 	if (!defined('_DIR_CACHE')) {
2279
-		define('_DIR_CACHE', $ti . "cache/");
2277
+		define('_DIR_CACHE', $ti."cache/");
2280 2278
 	}
2281 2279
 	if (!defined('_DIR_CACHE_XML')) {
2282
-		define('_DIR_CACHE_XML', _DIR_CACHE . "xml/");
2280
+		define('_DIR_CACHE_XML', _DIR_CACHE."xml/");
2283 2281
 	}
2284 2282
 	if (!defined('_DIR_SKELS')) {
2285
-		define('_DIR_SKELS', _DIR_CACHE . "skel/");
2283
+		define('_DIR_SKELS', _DIR_CACHE."skel/");
2286 2284
 	}
2287 2285
 	if (!defined('_DIR_AIDE')) {
2288
-		define('_DIR_AIDE', _DIR_CACHE . "aide/");
2286
+		define('_DIR_AIDE', _DIR_CACHE."aide/");
2289 2287
 	}
2290 2288
 	if (!defined('_DIR_TMP')) {
2291 2289
 		define('_DIR_TMP', $ti);
@@ -2315,27 +2313,27 @@  discard block
 block discarded – undo
2315 2313
 	// Declaration des fichiers
2316 2314
 
2317 2315
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2318
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . "charger_plugins_chemins.php");
2316
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE."charger_plugins_chemins.php");
2319 2317
 	}
2320 2318
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2321
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . "charger_plugins_options.php");
2319
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE."charger_plugins_options.php");
2322 2320
 	}
2323 2321
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2324
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . "charger_plugins_fonctions.php");
2322
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE."charger_plugins_fonctions.php");
2325 2323
 	}
2326 2324
 	if (!defined('_CACHE_PIPELINES')) {
2327
-		define('_CACHE_PIPELINES', _DIR_CACHE . "charger_pipelines.php");
2325
+		define('_CACHE_PIPELINES', _DIR_CACHE."charger_pipelines.php");
2328 2326
 	}
2329 2327
 	if (!defined('_CACHE_CHEMIN')) {
2330
-		define('_CACHE_CHEMIN', _DIR_CACHE . "chemin.txt");
2328
+		define('_CACHE_CHEMIN', _DIR_CACHE."chemin.txt");
2331 2329
 	}
2332 2330
 
2333 2331
 	# attention .php obligatoire pour ecrire_fichier_securise
2334 2332
 	if (!defined('_FILE_META')) {
2335
-		define('_FILE_META', $ti . 'meta_cache.php');
2333
+		define('_FILE_META', $ti.'meta_cache.php');
2336 2334
 	}
2337 2335
 	if (!defined('_DIR_LOG')) {
2338
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2336
+		define('_DIR_LOG', _DIR_TMP.'log/');
2339 2337
 	}
2340 2338
 	if (!defined('_FILE_LOG')) {
2341 2339
 		define('_FILE_LOG', 'spip');
@@ -2351,8 +2349,8 @@  discard block
 block discarded – undo
2351 2349
 	}
2352 2350
 	if (!defined('_FILE_CONNECT')) {
2353 2351
 		define('_FILE_CONNECT',
2354
-		(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2355
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2352
+		(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2353
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2356 2354
 				: false)));
2357 2355
 	}
2358 2356
 
@@ -2362,7 +2360,7 @@  discard block
 block discarded – undo
2362 2360
 	}
2363 2361
 	if (!defined('_FILE_CHMOD')) {
2364 2362
 		define('_FILE_CHMOD',
2365
-		(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2363
+		(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2366 2364
 			: false));
2367 2365
 	}
2368 2366
 
@@ -2374,10 +2372,10 @@  discard block
 block discarded – undo
2374 2372
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2375 2373
 	}
2376 2374
 	if (!defined('_FILE_CONNECT_TMP')) {
2377
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2375
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2378 2376
 	}
2379 2377
 	if (!defined('_FILE_CHMOD_TMP')) {
2380
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2378
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2381 2379
 	}
2382 2380
 
2383 2381
 	// Definition des droits d'acces en ecriture
@@ -2395,13 +2393,13 @@  discard block
 block discarded – undo
2395 2393
 		define('_DEFAULT_CHARSET', 'utf-8');
2396 2394
 	}
2397 2395
 	if (!defined('_ROOT_PLUGINS')) {
2398
-		define('_ROOT_PLUGINS', _ROOT_RACINE . "plugins/");
2396
+		define('_ROOT_PLUGINS', _ROOT_RACINE."plugins/");
2399 2397
 	}
2400 2398
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2401
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . "plugins-dist/");
2399
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE."plugins-dist/");
2402 2400
 	}
2403 2401
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2404
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2402
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2405 2403
 	}
2406 2404
 
2407 2405
 	// La taille des Log
@@ -2438,7 +2436,7 @@  discard block
 block discarded – undo
2438 2436
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2439 2437
 	// pour le rendre surchargeable, on va provoquer un reecriture
2440 2438
 	// systematique du noyau ou une baisse de perfs => a etudier)
2441
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2439
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2442 2440
 
2443 2441
 	// charger tout de suite le path et son cache
2444 2442
 	load_path_cache();
@@ -2485,7 +2483,7 @@  discard block
 block discarded – undo
2485 2483
 		if (!empty($_SERVER['QUERY_STRING'])
2486 2484
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2487 2485
 		) {
2488
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2486
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2489 2487
 		}
2490 2488
 	}
2491 2489
 
@@ -2521,7 +2519,7 @@  discard block
 block discarded – undo
2521 2519
 
2522 2520
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2523 2521
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2524
-				$uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '') . '/';
2522
+				$uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '').'/';
2525 2523
 			} else {
2526 2524
 				$uri_ref = "";
2527 2525
 			}
@@ -2609,7 +2607,7 @@  discard block
 block discarded – undo
2609 2607
 	}
2610 2608
 	if (!defined('_CACHE_RUBRIQUES')) {
2611 2609
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2612
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2610
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2613 2611
 	}
2614 2612
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2615 2613
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2645,8 +2643,7 @@  discard block
 block discarded – undo
2645 2643
 	// les anciens IIS n'acceptent pas les POST sur ecrire/ (#419)
2646 2644
 	// meme pb sur thttpd cf. http://forum.spip.net/fr_184153.html
2647 2645
 	if (!defined('_SPIP_ECRIRE_SCRIPT')) {
2648
-		define('_SPIP_ECRIRE_SCRIPT', (empty($_SERVER['SERVER_SOFTWARE']) ? '' :
2649
-			preg_match(',IIS|thttpd,', $_SERVER['SERVER_SOFTWARE']) ?
2646
+		define('_SPIP_ECRIRE_SCRIPT', (empty($_SERVER['SERVER_SOFTWARE']) ? '' : preg_match(',IIS|thttpd,', $_SERVER['SERVER_SOFTWARE']) ?
2650 2647
 				'index.php' : ''));
2651 2648
 	}
2652 2649
 
@@ -2699,7 +2696,7 @@  discard block
 block discarded – undo
2699 2696
 					$memory *= 1024;
2700 2697
 			}
2701 2698
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2702
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2699
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2703 2700
 				if (trim(ini_get('memory_limit')) != $m) {
2704 2701
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2705 2702
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -2849,7 +2846,7 @@  discard block
 block discarded – undo
2849 2846
 					}
2850 2847
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
2851 2848
 						spip_log($GLOBALS['visiteur_session']['nom']
2852
-							. " " . _VAR_MODE);
2849
+							. " "._VAR_MODE);
2853 2850
 					}
2854 2851
 				} // pas autorise ?
2855 2852
 				else {
@@ -2857,7 +2854,7 @@  discard block
 block discarded – undo
2857 2854
 					if (!$GLOBALS['visiteur_session']) {
2858 2855
 						include_spip('inc/headers');
2859 2856
 						redirige_par_entete(generer_url_public('login',
2860
-							'url=' . rawurlencode(
2857
+							'url='.rawurlencode(
2861 2858
 								parametre_url(self(), 'var_mode', $_GET['var_mode'], '&')
2862 2859
 							), true));
2863 2860
 					}
@@ -2910,10 +2907,10 @@  discard block
 block discarded – undo
2910 2907
 	// mais on risque de perturber des plugins en initialisant trop tot
2911 2908
 	// certaines constantes
2912 2909
 	@spip_initialisation_core(
2913
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
2914
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
2915
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
2916
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
2910
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
2911
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
2912
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
2913
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
2917 2914
 	);
2918 2915
 
2919 2916
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -2946,7 +2943,7 @@  discard block
 block discarded – undo
2946 2943
 	}
2947 2944
 
2948 2945
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
2949
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
2946
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
2950 2947
 
2951 2948
 		$session = charger_fonction('session', 'inc');
2952 2949
 		if ($session()) {
@@ -3026,7 +3023,7 @@  discard block
 block discarded – undo
3026 3023
 		$s = pipeline('definir_session',
3027 3024
 			$GLOBALS['visiteur_session']
3028 3025
 				? serialize($GLOBALS['visiteur_session'])
3029
-				. '_' . @$_COOKIE['spip_session']
3026
+				. '_'.@$_COOKIE['spip_session']
3030 3027
 				: ''
3031 3028
 		);
3032 3029
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3171,12 +3168,12 @@  discard block
 block discarded – undo
3171 3168
 	$GLOBALS['_INC_PUBLIC']++;
3172 3169
 
3173 3170
 	// fix #4235
3174
-	$cache_utilise_session_appelant	= (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3171
+	$cache_utilise_session_appelant = (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3175 3172
 
3176 3173
 
3177 3174
 	foreach (is_array($fond) ? $fond : array($fond) as $f) {
3178 3175
 		
3179
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3176
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3180 3177
 
3181 3178
 		$page = evaluer_fond($f, $contexte, $connect);
3182 3179
 		if ($page === '') {
@@ -3255,7 +3252,7 @@  discard block
 block discarded – undo
3255 3252
  * @return array|string
3256 3253
  */
3257 3254
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3258
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3255
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3259 3256
 	if (!$pathinfo) {
3260 3257
 		return $f;
3261 3258
 	}
@@ -3431,7 +3428,7 @@  discard block
 block discarded – undo
3431 3428
 
3432 3429
 			if (!is_array($params[0])) {
3433 3430
 				trigger_error(
3434
-					'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
3431
+					'array_column() expects parameter 1 to be array, '.gettype($params[0]).' given',
3435 3432
 					E_USER_WARNING
3436 3433
 				);
3437 3434
 				return null;
Please login to merge, or discard this patch.