Completed
Pull Request — master (#32)
by
unknown
05:47
created
ecrire/inc/utils.php 1 patch
Spacing   +122 added lines, -125 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) : '';
@@ -3172,7 +3169,7 @@  discard block
 block discarded – undo
3172 3169
 
3173 3170
 	// fix #4235
3174 3171
 	// On mémorise l'état initial du sessionnement du contexte incluant
3175
-	$cache_utilise_session_appelant	= (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3172
+	$cache_utilise_session_appelant = (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3176 3173
 
3177 3174
 
3178 3175
 	foreach (is_array($fond) ? $fond : array($fond) as $f) {
@@ -3262,7 +3259,7 @@  discard block
 block discarded – undo
3262 3259
  * @return array|string
3263 3260
  */
3264 3261
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3265
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3262
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3266 3263
 	if (!$pathinfo) {
3267 3264
 		return $f;
3268 3265
 	}
@@ -3438,7 +3435,7 @@  discard block
 block discarded – undo
3438 3435
 
3439 3436
 			if (!is_array($params[0])) {
3440 3437
 				trigger_error(
3441
-					'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
3438
+					'array_column() expects parameter 1 to be array, '.gettype($params[0]).' given',
3442 3439
 					E_USER_WARNING
3443 3440
 				);
3444 3441
 				return null;
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
  */
364 364
 function balise_DOSSIER_SQUELETTE_dist($p) {
365 365
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
366
-	$p->code = "_DIR_RACINE . '$code'" .
366
+	$p->code = "_DIR_RACINE . '$code'".
367 367
 		$p->interdire_scripts = false;
368 368
 
369 369
 	return $p;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
  */
383 383
 function balise_SQUELETTE_dist($p) {
384 384
 	$code = addslashes($p->descr['sourcefile']);
385
-	$p->code = "'$code'" .
385
+	$p->code = "'$code'".
386 386
 		$p->interdire_scripts = false;
387 387
 
388 388
 	return $p;
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
  **/
435 435
 function balise_NOM_SITE_dist($p) {
436 436
 	if (!$p->etoile) {
437
-		$p->code = "supprimer_numero(calculer_url(" .
438
-			champ_sql('url_site', $p) . "," .
439
-			champ_sql('nom_site', $p) .
437
+		$p->code = "supprimer_numero(calculer_url(".
438
+			champ_sql('url_site', $p).",".
439
+			champ_sql('nom_site', $p).
440 440
 			", 'titre', \$connect, false))";
441 441
 	} else {
442 442
 		$p->code = champ_sql('nom_site', $p);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	if ($b === '' || !isset($p->boucles[$b])) {
544 544
 		$msg = array(
545 545
 			'zbug_champ_hors_boucle',
546
-			array('champ' => "#$b" . 'TOTAL_BOUCLE')
546
+			array('champ' => "#$b".'TOTAL_BOUCLE')
547 547
 		);
548 548
 		erreur_squelette($msg, $p);
549 549
 	} else {
@@ -593,8 +593,8 @@  discard block
 block discarded – undo
593 593
  *     Pile complétée par le code à générer
594 594
  **/
595 595
 function balise_POPULARITE_ABSOLUE_dist($p) {
596
-	$p->code = 'ceil(' .
597
-		champ_sql('popularite', $p) .
596
+	$p->code = 'ceil('.
597
+		champ_sql('popularite', $p).
598 598
 		')';
599 599
 	$p->interdire_scripts = false;
600 600
 
@@ -672,9 +672,9 @@  discard block
 block discarded – undo
672 672
  **/
673 673
 function balise_VALEUR_dist($p) {
674 674
 	$b = $p->nom_boucle ? $p->nom_boucle : $p->id_boucle;
675
-	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);;
675
+	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); ;
676 676
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
677
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
677
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
678 678
 	}
679 679
 	$p->interdire_scripts = true;
680 680
 
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
 	$_suite = 'null';
831 831
 	$_longueur = $longueur_defaut;
832 832
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
833
-		$_longueur = 'is_numeric(' . $v . ')?intval(' . $v . '):' . $longueur_defaut;
834
-		$_suite = '!is_numeric(' . $v . ')?' . $v . ':null';
833
+		$_longueur = 'is_numeric('.$v.')?intval('.$v.'):'.$longueur_defaut;
834
+		$_suite = '!is_numeric('.$v.')?'.$v.':null';
835 835
 	}
836 836
 	if (($v2 = interprete_argument_balise(2, $p)) !== null) {
837 837
 		$_suite = $v2;
@@ -919,10 +919,10 @@  discard block
 block discarded – undo
919 919
 		$c = memoriser_contexte_compil($p);
920 920
 
921 921
 		$p->code = sprintf(CODE_RECUPERER_FOND, "'modeles/lesauteurs'",
922
-			"array('objet'=>'" . $objet .
923
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
924
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
925
-			($objet == 'article' ? "" : ",'id_article' => " . champ_sql('id_article', $p)) .
922
+			"array('objet'=>'".$objet.
923
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
924
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
925
+			($objet == 'article' ? "" : ",'id_article' => ".champ_sql('id_article', $p)).
926 926
 			")",
927 927
 			"'trim'=>true, 'compil'=>array($c)",
928 928
 			_q($connect));
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 					$m = trim($m);
989 989
 					if ($m != "''") {
990 990
 						if (!preg_match(",\W,", $m)) {
991
-							$m = $boucle->id_table . ".$m";
991
+							$m = $boucle->id_table.".$m";
992 992
 						}
993 993
 						
994 994
 						$m .= " AS titre_rang";
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 	$f_pagination = chercher_filtre('pagination');
1136 1136
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1137 1137
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1138
-		: ("'debut" . substr($type, 1));
1138
+		: ("'debut".substr($type, 1));
1139 1139
 
1140 1140
 	$p->code = sprintf(CODE_PAGINATION, $f_pagination, $b, $type, $modif, $pas, $liste,
1141 1141
 		((isset($__modele) and $__modele) ? $__modele : "''"), _q($connect), $code_contexte);
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 	if ($b === '' || !isset($p->boucles[$b])) {
1200 1200
 		$msg = array(
1201 1201
 			'zbug_champ_hors_boucle',
1202
-			array('champ' => "#$b" . 'TOTAL_BOUCLE')
1202
+			array('champ' => "#$b".'TOTAL_BOUCLE')
1203 1203
 		);
1204 1204
 		erreur_squelette($msg, $p);
1205 1205
 	} else {
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' CHEMIN'));
1273 1273
 		erreur_squelette($msg, $p);
1274 1274
 	} else {
1275
-		$p->code = 'find_in_path(' . $arg . ')';
1275
+		$p->code = 'find_in_path('.$arg.')';
1276 1276
 	}
1277 1277
 
1278 1278
 	$p->interdire_scripts = false;
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' CHEMIN_IMAGE'));
1308 1308
 		erreur_squelette($msg, $p);
1309 1309
 	} else {
1310
-		$p->code = 'chemin_image(' . $arg . ')';
1310
+		$p->code = 'chemin_image('.$arg.')';
1311 1311
 	}
1312 1312
 
1313 1313
 	#$p->interdire_scripts = true;
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1362 1362
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1363 1363
 		if ($src) {
1364
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1364
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1365 1365
 		} else {
1366 1366
 			$p->code = '@serialize($Pile[0])';
1367 1367
 		}
@@ -1414,8 +1414,8 @@  discard block
 block discarded – undo
1414 1414
 	$_sinon = interprete_argument_balise(2, $p);
1415 1415
 	$_unserialize = sinon(interprete_argument_balise(3, $p), "false");
1416 1416
 
1417
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1418
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1417
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1418
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1419 1419
 
1420 1420
 	return $p;
1421 1421
 }
@@ -1508,7 +1508,7 @@  discard block
 block discarded – undo
1508 1508
 		$err_b_s_a = array('zbug_balise_sans_argument', array('balise' => 'SESSION_SET'));
1509 1509
 		erreur_squelette($err_b_s_a, $p);
1510 1510
 	} else {
1511
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1511
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1512 1512
 	}
1513 1513
 
1514 1514
 	$p->interdire_scripts = false;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 		if (preg_match(",^([[:space:]]*//[^\n]*\n)'([^']+)'$,ms",
1552 1552
 			$php, $r)) {
1553 1553
 			$p->code = /* $r[1]. */
1554
-				'(' . $r[2] . ')';
1554
+				'('.$r[2].')';
1555 1555
 		} else {
1556 1556
 			$p->code = "eval('return '.$php.';')";
1557 1557
 		}
@@ -1798,9 +1798,9 @@  discard block
 block discarded – undo
1798 1798
 
1799 1799
 		// noter la duree du cache dans un entete proprietaire
1800 1800
 
1801
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1801
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1802 1802
 			. $duree
1803
-			. '"); ?' . "'.'>'";
1803
+			. '"); ?'."'.'>'";
1804 1804
 
1805 1805
 		// Remplir le header Cache-Control
1806 1806
 		// cas #CACHE{0}
@@ -1820,9 +1820,9 @@  discard block
 block discarded – undo
1820 1820
 			if ($pa == 'cache-client'
1821 1821
 				and $duree > 0
1822 1822
 			) {
1823
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1823
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1824 1824
 					. $duree
1825
-					. '"); ?' . "'.'>'";
1825
+					. '"); ?'."'.'>'";
1826 1826
 				// il semble logique, si on cache-client, de ne pas invalider
1827 1827
 				$pa = 'statique';
1828 1828
 			}
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
 			if ($pa == 'statique'
1831 1831
 				and $duree > 0
1832 1832
 			) {
1833
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1833
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1834 1834
 			}
1835 1835
 		}
1836 1836
 	} else {
@@ -1999,9 +1999,9 @@  discard block
 block discarded – undo
1999 1999
 		if ($p->etoile) {
2000 2000
 			$_options[] = "'etoile'=>true";
2001 2001
 		}
2002
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ")";
2002
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).")";
2003 2003
 
2004
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2004
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2005 2005
 		if ($flag_env) {
2006 2006
 			$_l = "array_merge(\$Pile[0],$_l)";
2007 2007
 		}
@@ -2012,7 +2012,7 @@  discard block
 block discarded – undo
2012 2012
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' INCLURE'));
2013 2013
 		erreur_squelette($msg, $p);
2014 2014
 	} else {
2015
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2015
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2016 2016
 	}
2017 2017
 
2018 2018
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 		unset($_contexte[1]);
2061 2061
 
2062 2062
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2063
-			$nom = "'modeles/" . substr($nom, 1);
2063
+			$nom = "'modeles/".substr($nom, 1);
2064 2064
 		} else {
2065 2065
 			$nom = "'modeles/' . $nom";
2066 2066
 		}
@@ -2077,8 +2077,8 @@  discard block
 block discarded – undo
2077 2077
 			$primary = $p->boucles[$p->id_boucle]->primary;
2078 2078
 			if (!strpos($primary, ',')) {
2079 2079
 				$id = champ_sql($primary, $p);
2080
-				$_contexte[] = "'$primary'=>" . $id;
2081
-				$_contexte[] = "'id'=>" . $id;
2080
+				$_contexte[] = "'$primary'=>".$id;
2081
+				$_contexte[] = "'id'=>".$id;
2082 2082
 			}
2083 2083
 		}
2084 2084
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2092,11 +2092,11 @@  discard block
 block discarded – undo
2092 2092
 		$_options = "'compil'=>array($_options), 'trim'=>true, 'sessionnement_contaminant'=>true";
2093 2093
 		
2094 2094
 		if (isset($_contexte['ajax'])) {
2095
-			$_options .= ", " . preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2095
+			$_options .= ", ".preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2096 2096
 			unset($_contexte['ajax']);
2097 2097
 		}
2098 2098
 
2099
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2099
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2100 2100
 		if ($flag_env) {
2101 2101
 			$_l = "array_merge(\$Pile[0],$_l)";
2102 2102
 		}
@@ -2206,12 +2206,12 @@  discard block
 block discarded – undo
2206 2206
 function balise_DOUBLONS_dist($p) {
2207 2207
 	if ($type = interprete_argument_balise(1, $p)) {
2208 2208
 		if ($famille = interprete_argument_balise(2, $p)) {
2209
-			$type .= '.' . $famille;
2209
+			$type .= '.'.$famille;
2210 2210
 		}
2211
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2211
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2212 2212
 		if (!$p->etoile) {
2213 2213
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2214
-				. $p->code . ')))';
2214
+				. $p->code.')))';
2215 2215
 		}
2216 2216
 	} else {
2217 2217
 		$p->code = '$doublons';
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
 			$_code[] = "$_key => $_val";
2341 2341
 		}
2342 2342
 	} while ($_key && $_val);
2343
-	$p->code = 'array(' . join(', ', $_code) . ')';
2343
+	$p->code = 'array('.join(', ', $_code).')';
2344 2344
 	$p->interdire_scripts = false;
2345 2345
 
2346 2346
 	return $p;
@@ -2367,7 +2367,7 @@  discard block
 block discarded – undo
2367 2367
 	while ($_val = interprete_argument_balise($n++, $p)) {
2368 2368
 		$_code[] = $_val;
2369 2369
 	}
2370
-	$p->code = 'array(' . join(', ', $_code) . ')';
2370
+	$p->code = 'array('.join(', ', $_code).')';
2371 2371
 	$p->interdire_scripts = false;
2372 2372
 
2373 2373
 	return $p;
@@ -2412,8 +2412,8 @@  discard block
 block discarded – undo
2412 2412
 		$_code[] = $_v;
2413 2413
 	}
2414 2414
 
2415
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(', ',
2416
-			$_code) . ')?" ":"")';
2415
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(', ',
2416
+			$_code).')?" ":"")';
2417 2417
 	$p->interdire_scripts = false;
2418 2418
 
2419 2419
 	return $p;
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2447 2447
 
2448 2448
 	$f = chercher_filtre('info_plugin');
2449
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2449
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2450 2450
 
2451 2451
 	return $p;
2452 2452
 }
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
  **/
2471 2471
 function balise_AIDER_dist($p) {
2472 2472
 	$_motif = interprete_argument_balise(1, $p);
2473
-	$s = "'" . addslashes($p->descr['sourcefile']) . "'";
2473
+	$s = "'".addslashes($p->descr['sourcefile'])."'";
2474 2474
 	$p->code = "((\$aider=charger_fonction('aide','inc',true))?\$aider($_motif,$s, \$Pile[0]):'')";
2475 2475
 
2476 2476
 	return $p;
@@ -2689,12 +2689,12 @@  discard block
 block discarded – undo
2689 2689
 	$_issens = "in_array($_champ,array('>','<'))";
2690 2690
 	$_sens = "(strpos('< >',$_champ)-1)";
2691 2691
 
2692
-	$_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom'];
2692
+	$_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom'];
2693 2693
 	$_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)";
2694
-	$_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')";
2695
-	$_on = "\$s?(" . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)";
2694
+	$_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')";
2695
+	$_on = "\$s?(".$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)";
2696 2696
 
2697
-	$p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : "") . ")";
2697
+	$p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : "").")";
2698 2698
 	//$p->code = "''";
2699 2699
 	$p->interdire_scripts = false;
2700 2700
 
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2769 2769
 	}
2770 2770
 
2771
-	$p->code = "(objet_test_si_publie(" . $_type . ",intval(" . $_id . ")," . _q($connect) . ")?' ':'')";
2771
+	$p->code = "(objet_test_si_publie(".$_type.",intval(".$_id."),"._q($connect).")?' ':'')";
2772 2772
 	$p->interdire_scripts = false;
2773 2773
 
2774 2774
 	return $p;
Please login to merge, or discard this patch.