Completed
Push — master ( 27dd6e...9ef4c0 )
by cam
04:23
created
ecrire/inc/utils.php 1 patch
Spacing   +126 added lines, -128 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
 /**
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
  * @return bool
722 722
  */
723 723
 function test_plugin_actif($plugin) {
724
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
724
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
725 725
 }
726 726
 
727 727
 /**
@@ -789,8 +789,7 @@  discard block
 block discarded – undo
789 789
 		// pour les chaines non traduites, assurer un service minimum
790 790
 		if (!$GLOBALS['test_i18n'] and (_request('var_mode') != 'traduction')) {
791 791
 			$text = str_replace('_', ' ',
792
-				(($n = strpos($text, ':')) === false ? $texte :
793
-					substr($texte, $n + 1)));
792
+				(($n = strpos($text, ':')) === false ? $texte : substr($texte, $n + 1)));
794 793
 		}
795 794
 		$o['class'] = null;
796 795
 
@@ -862,7 +861,7 @@  discard block
 block discarded – undo
862 861
 		// Si des variables n'ont pas ete inserees, le signaler
863 862
 		// (chaines de langues pas a jour)
864 863
 		if ($args) {
865
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
864
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
866 865
 		}
867 866
 	}
868 867
 
@@ -886,7 +885,7 @@  discard block
 block discarded – undo
886 885
 function joli_repertoire($rep) {
887 886
 	$a = substr($rep, 0, 1);
888 887
 	if ($a <> '.' and $a <> '/') {
889
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
888
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
890 889
 	}
891 890
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
892 891
 
@@ -940,7 +939,7 @@  discard block
 block discarded – undo
940 939
 			$p -= ($x * 1000);
941 940
 		}
942 941
 
943
-		return $s . sprintf($s ? "%07.3f ms" : "%.3f ms", $p);
942
+		return $s.sprintf($s ? "%07.3f ms" : "%.3f ms", $p);
944 943
 	}
945 944
 }
946 945
 
@@ -1009,7 +1008,7 @@  discard block
 block discarded – undo
1009 1008
 	if ($taches and count($taches) and !spip_connect()) {
1010 1009
 		return false;
1011 1010
 	}
1012
-	spip_log("cron !", 'jq' . _LOG_DEBUG);
1011
+	spip_log("cron !", 'jq'._LOG_DEBUG);
1013 1012
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1014 1013
 		return $genie($taches);
1015 1014
 	}
@@ -1113,7 +1112,7 @@  discard block
 block discarded – undo
1113 1112
 
1114 1113
 	if ($queue_next_job_time == -1) {
1115 1114
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1116
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . "job_queue_next.txt");
1115
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP."job_queue_next.txt");
1117 1116
 		}
1118 1117
 		// utiliser un cache memoire si dispo
1119 1118
 		if (function_exists("cache_get") and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1180,8 +1179,8 @@  discard block
 block discarded – undo
1180 1179
 		$src = '';
1181 1180
 	}
1182 1181
 	if ($script) {
1183
-		$script = ("/*<![CDATA[*/\n" .
1184
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1182
+		$script = ("/*<![CDATA[*/\n".
1183
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1185 1184
 			"/*]]>*/");
1186 1185
 	}
1187 1186
 	if ($noscript) {
@@ -1267,13 +1266,13 @@  discard block
 block discarded – undo
1267 1266
 	if ($path_base == null) {
1268 1267
 		// Chemin standard depuis l'espace public
1269 1268
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1270
-			_DIR_RACINE . ':' .
1271
-			_DIR_RACINE . 'squelettes-dist/:' .
1272
-			_DIR_RACINE . 'prive/:' .
1269
+			_DIR_RACINE.':'.
1270
+			_DIR_RACINE.'squelettes-dist/:'.
1271
+			_DIR_RACINE.'prive/:'.
1273 1272
 			_DIR_RESTREINT;
1274 1273
 		// Ajouter squelettes/
1275
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1276
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1274
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1275
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1277 1276
 		}
1278 1277
 		foreach (explode(':', $path) as $dir) {
1279 1278
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1285,7 +1284,7 @@  discard block
 block discarded – undo
1285 1284
 		// Et le(s) dossier(s) des squelettes nommes
1286 1285
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1287 1286
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1288
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1287
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1289 1288
 			}
1290 1289
 		}
1291 1290
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1296,7 +1295,7 @@  discard block
 block discarded – undo
1296 1295
 
1297 1296
 	if (strlen($dir_path)) {
1298 1297
 		$tete = "";
1299
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1298
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1300 1299
 			$tete = array_shift($path_base);
1301 1300
 		}
1302 1301
 		$dirs = array_reverse(explode(':', $dir_path));
@@ -1318,7 +1317,7 @@  discard block
 block discarded – undo
1318 1317
 	// Et le(s) dossier(s) des squelettes nommes
1319 1318
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1320 1319
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1321
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1320
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1322 1321
 		}
1323 1322
 	}
1324 1323
 
@@ -1387,7 +1386,7 @@  discard block
 block discarded – undo
1387 1386
 	}
1388 1387
 	// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire
1389 1388
 	if (preg_match(',-\d+[.](png|gif|svg)$,', $file, $m)
1390
-	  and $file_svg_generique = substr($file,0, -strlen($m[0])) . "-xx.svg"
1389
+	  and $file_svg_generique = substr($file, 0, -strlen($m[0]))."-xx.svg"
1391 1390
 		and $f = find_in_theme("$file_svg_generique")) {
1392 1391
 		return $themefiles["$subdir$file"] = $f;
1393 1392
 	}
@@ -1398,7 +1397,7 @@  discard block
 block discarded – undo
1398 1397
 			return $themefiles["$subdir$file"] = $f;
1399 1398
 		}
1400 1399
 	}
1401
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1400
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1402 1401
 
1403 1402
 	return $themefiles["$subdir$file"] = "";
1404 1403
 }
@@ -1499,8 +1498,8 @@  discard block
 block discarded – undo
1499 1498
 			return false;
1500 1499
 		}
1501 1500
 		if ($include and !isset($inc[$dirname][$file])) {
1502
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1503
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1501
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1502
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1504 1503
 		}
1505 1504
 
1506 1505
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1513,14 +1512,14 @@  discard block
 block discarded – undo
1513 1512
 	}
1514 1513
 
1515 1514
 	foreach (creer_chemin() as $dir) {
1516
-		if (!isset($dirs[$a = $dir . $dirname])) {
1517
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1515
+		if (!isset($dirs[$a = $dir.$dirname])) {
1516
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1518 1517
 		}
1519 1518
 		if ($dirs[$a]) {
1520
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1519
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1521 1520
 				if ($include and !isset($inc[$dirname][$file])) {
1522
-					include_once _ROOT_CWD . $a;
1523
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1521
+					include_once _ROOT_CWD.$a;
1522
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1524 1523
 				}
1525 1524
 				if (!defined('_SAUVER_CHEMIN')) {
1526 1525
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1530,7 +1529,7 @@  discard block
 block discarded – undo
1530 1529
 					define('_SAUVER_CHEMIN', true);
1531 1530
 				}
1532 1531
 
1533
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1532
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1534 1533
 			}
1535 1534
 		}
1536 1535
 	}
@@ -1556,7 +1555,7 @@  discard block
 block discarded – undo
1556 1555
 		define('_SAUVER_CHEMIN', true);
1557 1556
 	}
1558 1557
 
1559
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1558
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1560 1559
 }
1561 1560
 
1562 1561
 function clear_path_cache() {
@@ -1625,12 +1624,12 @@  discard block
 block discarded – undo
1625 1624
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1626 1625
 	// on a pas encore inclus flock.php
1627 1626
 	if (!function_exists('preg_files')) {
1628
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1627
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1629 1628
 	}
1630 1629
 
1631 1630
 	// Parcourir le chemin
1632 1631
 	foreach (creer_chemin() as $d) {
1633
-		$f = $d . $dir;
1632
+		$f = $d.$dir;
1634 1633
 		if (@is_dir($f)) {
1635 1634
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? array() : $recurs);
1636 1635
 			foreach ($liste as $chemin) {
@@ -1660,9 +1659,9 @@  discard block
 block discarded – undo
1660 1659
 	static $autsanscookie = array('install', 'base_repair');
1661 1660
 
1662 1661
 	if (in_array($nom, $autsanscookie)) {
1663
-		if (test_espace_prive()){
1662
+		if (test_espace_prive()) {
1664 1663
 			include_spip('base/connect_sql');
1665
-			if (!$strict or !spip_connect()){
1664
+			if (!$strict or !spip_connect()) {
1666 1665
 				return true;
1667 1666
 			}
1668 1667
 		}
@@ -1741,7 +1740,7 @@  discard block
 block discarded – undo
1741 1740
 		return $res;
1742 1741
 	}
1743 1742
 	// Sinon c'est un raccourci ou compat SPIP < 2
1744
-	if (!function_exists($f = 'generer_url_' . $entite)) {
1743
+	if (!function_exists($f = 'generer_url_'.$entite)) {
1745 1744
 		if (!function_exists($f .= '_dist')) {
1746 1745
 			$f = '';
1747 1746
 		}
@@ -1750,8 +1749,8 @@  discard block
 block discarded – undo
1750 1749
 		$url = $f($id, $args, $ancre);
1751 1750
 		if (strlen($args)) {
1752 1751
 			$url .= strstr($url, '?')
1753
-				? '&amp;' . $args
1754
-				: '?' . $args;
1752
+				? '&amp;'.$args
1753
+				: '?'.$args;
1755 1754
 		}
1756 1755
 
1757 1756
 		return $url;
@@ -1782,8 +1781,8 @@  discard block
 block discarded – undo
1782 1781
 	include_spip('base/connect_sql');
1783 1782
 	$id_type = id_table_objet($entite, $public);
1784 1783
 
1785
-	return _DIR_RACINE . get_spip_script('./')
1786
-	. "?" . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1784
+	return _DIR_RACINE.get_spip_script('./')
1785
+	. "?"._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1787 1786
 	. (!$args ? '' : "&$args")
1788 1787
 	. (!$ancre ? '' : "#$ancre");
1789 1788
 }
@@ -1935,7 +1934,7 @@  discard block
 block discarded – undo
1935 1934
 			if (!empty($_SERVER['QUERY_STRING'])
1936 1935
 				and !strpos($_SERVER['REQUEST_URI'], '?')
1937 1936
 			) {
1938
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
1937
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
1939 1938
 			}
1940 1939
 		}
1941 1940
 	}
@@ -1962,17 +1961,17 @@  discard block
 block discarded – undo
1962 1961
 	list($myself) = explode('?', $myself);
1963 1962
 	// vieux mode HTTP qui envoie après le nom de la methode l'URL compléte
1964 1963
 	// protocole, "://", nom du serveur avant le path dans _SERVER["REQUEST_URI"]
1965
-	if (strpos($myself,'://') !== false) {
1966
-		$myself = explode('://',$myself);
1964
+	if (strpos($myself, '://') !== false) {
1965
+		$myself = explode('://', $myself);
1967 1966
 		array_shift($myself);
1968
-		$myself = implode('://',$myself);
1969
-		$myself = explode('/',$myself);
1967
+		$myself = implode('://', $myself);
1968
+		$myself = explode('/', $myself);
1970 1969
 		array_shift($myself);
1971
-		$myself = implode('/',$myself);
1970
+		$myself = implode('/', $myself);
1972 1971
 	}
1973
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
1972
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
1974 1973
 
1975
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
1974
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
1976 1975
 
1977 1976
 	return $url;
1978 1977
 }
@@ -2010,17 +2009,17 @@  discard block
 block discarded – undo
2010 2009
  **/
2011 2010
 function generer_url_ecrire($script = '', $args = "", $no_entities = false, $rel = false) {
2012 2011
 	if (!$rel) {
2013
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2012
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2014 2013
 	} else {
2015 2014
 		if (!is_string($rel)) {
2016 2015
 			$rel = _DIR_RESTREINT ? _DIR_RESTREINT :
2017
-				('./' . _SPIP_ECRIRE_SCRIPT);
2016
+				('./'._SPIP_ECRIRE_SCRIPT);
2018 2017
 		}
2019 2018
 	}
2020 2019
 
2021 2020
 	list($script, $ancre) = array_pad(explode('#', $script), 2, null);
2022 2021
 	if ($script and ($script <> 'accueil' or $rel)) {
2023
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2022
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2024 2023
 	} elseif ($args) {
2025 2024
 		$args = "?$args";
2026 2025
 	}
@@ -2028,7 +2027,7 @@  discard block
 block discarded – undo
2028 2027
 		$args .= "#$ancre";
2029 2028
 	}
2030 2029
 
2031
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2030
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2032 2031
 }
2033 2032
 
2034 2033
 //
@@ -2098,25 +2097,25 @@  discard block
 block discarded – undo
2098 2097
 		if (is_array($args)) {
2099 2098
 			$r = '';
2100 2099
 			foreach ($args as $k => $v) {
2101
-				$r .= '&' . $k . '=' . $v;
2100
+				$r .= '&'.$k.'='.$v;
2102 2101
 			}
2103 2102
 			$args = substr($r, 1);
2104 2103
 		}
2105 2104
 		$action .=
2106
-			(strpos($action, '?') !== false ? '&' : '?') . $args;
2105
+			(strpos($action, '?') !== false ? '&' : '?').$args;
2107 2106
 	}
2108 2107
 	if (!$no_entities) {
2109 2108
 		$action = quote_amp($action);
2110 2109
 	}
2111 2110
 
2112 2111
 	// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2113
-	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(",^/[.]/,", "/", "/$action"));
2112
+	return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(",^/[.]/,", "/", "/$action"));
2114 2113
 }
2115 2114
 
2116 2115
 // http://code.spip.net/@generer_url_prive
2117 2116
 function generer_url_prive($script, $args = "", $no_entities = false) {
2118 2117
 
2119
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2118
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2120 2119
 }
2121 2120
 
2122 2121
 // Pour les formulaires en methode POST,
@@ -2151,8 +2150,7 @@  discard block
 block discarded – undo
2151 2150
 	. "><div>\n"
2152 2151
 	. "<input type='hidden' name='exec' value='$script1' />"
2153 2152
 	. $corps
2154
-	. (!$submit ? '' :
2155
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo' type='submit' value=\"" . entites_html($submit) . "\" /></div>"))
2153
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo' type='submit' value=\"".entites_html($submit)."\" /></div>"))
2156 2154
 	. "</div></form>\n";
2157 2155
 }
2158 2156
 
@@ -2177,14 +2175,14 @@  discard block
 block discarded – undo
2177 2175
 		? generer_url_ecrire(_request('exec'))
2178 2176
 		: generer_url_public();
2179 2177
 
2180
-	return "\n<form action='" .
2181
-	$h .
2182
-	"'" .
2183
-	$atts .
2184
-	">\n" .
2185
-	"<div>" .
2186
-	"\n<input type='hidden' name='action' value='$script' />" .
2187
-	$corps .
2178
+	return "\n<form action='".
2179
+	$h.
2180
+	"'".
2181
+	$atts.
2182
+	">\n".
2183
+	"<div>".
2184
+	"\n<input type='hidden' name='action' value='$script' />".
2185
+	$corps.
2188 2186
 	"</div></form>";
2189 2187
 }
2190 2188
 
@@ -2212,7 +2210,7 @@  discard block
 block discarded – undo
2212 2210
 		: generer_url_public('', '', false, false);
2213 2211
 	$url = parametre_url($url, 'action', $script);
2214 2212
 	if ($args) {
2215
-		$url .= quote_amp('&' . $args);
2213
+		$url .= quote_amp('&'.$args);
2216 2214
 	}
2217 2215
 
2218 2216
 	if ($no_entities) {
@@ -2262,17 +2260,17 @@  discard block
 block discarded – undo
2262 2260
 
2263 2261
 	// le nom du repertoire plugins/ activables/desactivables
2264 2262
 	if (!defined('_DIR_PLUGINS')) {
2265
-		define('_DIR_PLUGINS', _DIR_RACINE . "plugins/");
2263
+		define('_DIR_PLUGINS', _DIR_RACINE."plugins/");
2266 2264
 	}
2267 2265
 
2268 2266
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2269 2267
 	if (!defined('_DIR_PLUGINS_DIST')) {
2270
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . "plugins-dist/");
2268
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE."plugins-dist/");
2271 2269
 	}
2272 2270
 
2273 2271
 	// le nom du repertoire des librairies
2274 2272
 	if (!defined('_DIR_LIB')) {
2275
-		define('_DIR_LIB', _DIR_RACINE . "lib/");
2273
+		define('_DIR_LIB', _DIR_RACINE."lib/");
2276 2274
 	}
2277 2275
 
2278 2276
 	if (!defined('_DIR_IMG')) {
@@ -2282,29 +2280,29 @@  discard block
 block discarded – undo
2282 2280
 		define('_DIR_LOGOS', $pa);
2283 2281
 	}
2284 2282
 	if (!defined('_DIR_IMG_ICONES')) {
2285
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . "icones/");
2283
+		define('_DIR_IMG_ICONES', _DIR_LOGOS."icones/");
2286 2284
 	}
2287 2285
 
2288 2286
 	if (!defined('_DIR_DUMP')) {
2289
-		define('_DIR_DUMP', $ti . "dump/");
2287
+		define('_DIR_DUMP', $ti."dump/");
2290 2288
 	}
2291 2289
 	if (!defined('_DIR_SESSIONS')) {
2292
-		define('_DIR_SESSIONS', $ti . "sessions/");
2290
+		define('_DIR_SESSIONS', $ti."sessions/");
2293 2291
 	}
2294 2292
 	if (!defined('_DIR_TRANSFERT')) {
2295
-		define('_DIR_TRANSFERT', $ti . "upload/");
2293
+		define('_DIR_TRANSFERT', $ti."upload/");
2296 2294
 	}
2297 2295
 	if (!defined('_DIR_CACHE')) {
2298
-		define('_DIR_CACHE', $ti . "cache/");
2296
+		define('_DIR_CACHE', $ti."cache/");
2299 2297
 	}
2300 2298
 	if (!defined('_DIR_CACHE_XML')) {
2301
-		define('_DIR_CACHE_XML', _DIR_CACHE . "xml/");
2299
+		define('_DIR_CACHE_XML', _DIR_CACHE."xml/");
2302 2300
 	}
2303 2301
 	if (!defined('_DIR_SKELS')) {
2304
-		define('_DIR_SKELS', _DIR_CACHE . "skel/");
2302
+		define('_DIR_SKELS', _DIR_CACHE."skel/");
2305 2303
 	}
2306 2304
 	if (!defined('_DIR_AIDE')) {
2307
-		define('_DIR_AIDE', _DIR_CACHE . "aide/");
2305
+		define('_DIR_AIDE', _DIR_CACHE."aide/");
2308 2306
 	}
2309 2307
 	if (!defined('_DIR_TMP')) {
2310 2308
 		define('_DIR_TMP', $ti);
@@ -2334,27 +2332,27 @@  discard block
 block discarded – undo
2334 2332
 	// Declaration des fichiers
2335 2333
 
2336 2334
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2337
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . "charger_plugins_chemins.php");
2335
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE."charger_plugins_chemins.php");
2338 2336
 	}
2339 2337
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2340
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . "charger_plugins_options.php");
2338
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE."charger_plugins_options.php");
2341 2339
 	}
2342 2340
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2343
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . "charger_plugins_fonctions.php");
2341
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE."charger_plugins_fonctions.php");
2344 2342
 	}
2345 2343
 	if (!defined('_CACHE_PIPELINES')) {
2346
-		define('_CACHE_PIPELINES', _DIR_CACHE . "charger_pipelines.php");
2344
+		define('_CACHE_PIPELINES', _DIR_CACHE."charger_pipelines.php");
2347 2345
 	}
2348 2346
 	if (!defined('_CACHE_CHEMIN')) {
2349
-		define('_CACHE_CHEMIN', _DIR_CACHE . "chemin.txt");
2347
+		define('_CACHE_CHEMIN', _DIR_CACHE."chemin.txt");
2350 2348
 	}
2351 2349
 
2352 2350
 	# attention .php obligatoire pour ecrire_fichier_securise
2353 2351
 	if (!defined('_FILE_META')) {
2354
-		define('_FILE_META', $ti . 'meta_cache.php');
2352
+		define('_FILE_META', $ti.'meta_cache.php');
2355 2353
 	}
2356 2354
 	if (!defined('_DIR_LOG')) {
2357
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2355
+		define('_DIR_LOG', _DIR_TMP.'log/');
2358 2356
 	}
2359 2357
 	if (!defined('_FILE_LOG')) {
2360 2358
 		define('_FILE_LOG', 'spip');
@@ -2370,8 +2368,8 @@  discard block
 block discarded – undo
2370 2368
 	}
2371 2369
 	if (!defined('_FILE_CONNECT')) {
2372 2370
 		define('_FILE_CONNECT',
2373
-		(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2374
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2371
+		(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2372
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2375 2373
 				: false)));
2376 2374
 	}
2377 2375
 
@@ -2381,7 +2379,7 @@  discard block
 block discarded – undo
2381 2379
 	}
2382 2380
 	if (!defined('_FILE_CHMOD')) {
2383 2381
 		define('_FILE_CHMOD',
2384
-		(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2382
+		(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2385 2383
 			: false));
2386 2384
 	}
2387 2385
 
@@ -2393,10 +2391,10 @@  discard block
 block discarded – undo
2393 2391
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2394 2392
 	}
2395 2393
 	if (!defined('_FILE_CONNECT_TMP')) {
2396
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2394
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2397 2395
 	}
2398 2396
 	if (!defined('_FILE_CHMOD_TMP')) {
2399
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2397
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2400 2398
 	}
2401 2399
 
2402 2400
 	// Definition des droits d'acces en ecriture
@@ -2414,13 +2412,13 @@  discard block
 block discarded – undo
2414 2412
 		define('_DEFAULT_CHARSET', 'utf-8');
2415 2413
 	}
2416 2414
 	if (!defined('_ROOT_PLUGINS')) {
2417
-		define('_ROOT_PLUGINS', _ROOT_RACINE . "plugins/");
2415
+		define('_ROOT_PLUGINS', _ROOT_RACINE."plugins/");
2418 2416
 	}
2419 2417
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2420
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . "plugins-dist/");
2418
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE."plugins-dist/");
2421 2419
 	}
2422 2420
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2423
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2421
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2424 2422
 	}
2425 2423
 
2426 2424
 	// La taille des Log
@@ -2457,7 +2455,7 @@  discard block
 block discarded – undo
2457 2455
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2458 2456
 	// pour le rendre surchargeable, on va provoquer un reecriture
2459 2457
 	// systematique du noyau ou une baisse de perfs => a etudier)
2460
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2458
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2461 2459
 
2462 2460
 	// charger tout de suite le path et son cache
2463 2461
 	load_path_cache();
@@ -2504,7 +2502,7 @@  discard block
 block discarded – undo
2504 2502
 		if (!empty($_SERVER['QUERY_STRING'])
2505 2503
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2506 2504
 		) {
2507
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2505
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2508 2506
 		}
2509 2507
 	}
2510 2508
 
@@ -2540,7 +2538,7 @@  discard block
 block discarded – undo
2540 2538
 
2541 2539
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2542 2540
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2543
-				$uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '') . '/';
2541
+				$uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '').'/';
2544 2542
 			} else {
2545 2543
 				$uri_ref = "";
2546 2544
 			}
@@ -2628,7 +2626,7 @@  discard block
 block discarded – undo
2628 2626
 	}
2629 2627
 	if (!defined('_CACHE_RUBRIQUES')) {
2630 2628
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2631
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2629
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2632 2630
 	}
2633 2631
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2634 2632
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -2720,7 +2718,7 @@  discard block
 block discarded – undo
2720 2718
 					$memory *= 1024;
2721 2719
 			}
2722 2720
 			if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) {
2723
-				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M');
2721
+				@ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M');
2724 2722
 				if (trim(ini_get('memory_limit')) != $m) {
2725 2723
 					if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) {
2726 2724
 						define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
@@ -2870,7 +2868,7 @@  discard block
 block discarded – undo
2870 2868
 					}
2871 2869
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
2872 2870
 						spip_log($GLOBALS['visiteur_session']['nom']
2873
-							. " " . _VAR_MODE);
2871
+							. " "._VAR_MODE);
2874 2872
 					}
2875 2873
 				} // pas autorise ?
2876 2874
 				else {
@@ -2878,7 +2876,7 @@  discard block
 block discarded – undo
2878 2876
 					if (!$GLOBALS['visiteur_session']) {
2879 2877
 						include_spip('inc/headers');
2880 2878
 						redirige_par_entete(generer_url_public('login',
2881
-							'url=' . rawurlencode(
2879
+							'url='.rawurlencode(
2882 2880
 								parametre_url(self(), 'var_mode', $_GET['var_mode'], '&')
2883 2881
 							), true));
2884 2882
 					}
@@ -2931,10 +2929,10 @@  discard block
 block discarded – undo
2931 2929
 	// mais on risque de perturber des plugins en initialisant trop tot
2932 2930
 	// certaines constantes
2933 2931
 	@spip_initialisation_core(
2934
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
2935
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
2936
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
2937
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
2932
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
2933
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
2934
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
2935
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
2938 2936
 	);
2939 2937
 
2940 2938
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -2967,7 +2965,7 @@  discard block
 block discarded – undo
2967 2965
 	}
2968 2966
 
2969 2967
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
2970
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
2968
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
2971 2969
 
2972 2970
 		$session = charger_fonction('session', 'inc');
2973 2971
 		if ($session()) {
@@ -3047,7 +3045,7 @@  discard block
 block discarded – undo
3047 3045
 		$s = pipeline('definir_session',
3048 3046
 			$GLOBALS['visiteur_session']
3049 3047
 				? serialize($GLOBALS['visiteur_session'])
3050
-				. '_' . @$_COOKIE['spip_session']
3048
+				. '_'.@$_COOKIE['spip_session']
3051 3049
 				: ''
3052 3050
 		);
3053 3051
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3192,12 +3190,12 @@  discard block
 block discarded – undo
3192 3190
 	$GLOBALS['_INC_PUBLIC']++;
3193 3191
 
3194 3192
 	// fix #4235
3195
-	$cache_utilise_session_appelant	= (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3193
+	$cache_utilise_session_appelant = (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null);
3196 3194
 
3197 3195
 
3198 3196
 	foreach (is_array($fond) ? $fond : array($fond) as $f) {
3199 3197
 		
3200
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3198
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3201 3199
 
3202 3200
 		$page = evaluer_fond($f, $contexte, $connect);
3203 3201
 		if ($page === '') {
@@ -3236,7 +3234,7 @@  discard block
 block discarded – undo
3236 3234
 		}
3237 3235
 		
3238 3236
 		// contamination de la session appelante, pour les inclusions statiques
3239
-		if (isset($page['invalideurs']['session'])){
3237
+		if (isset($page['invalideurs']['session'])) {
3240 3238
 			$cache_utilise_session_appelant = $page['invalideurs']['session'];
3241 3239
 		}
3242 3240
 	}
@@ -3282,7 +3280,7 @@  discard block
 block discarded – undo
3282 3280
  * @return array|string
3283 3281
  */
3284 3282
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3285
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3283
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3286 3284
 	if (!$pathinfo) {
3287 3285
 		return $f;
3288 3286
 	}
@@ -3522,7 +3520,7 @@  discard block
 block discarded – undo
3522 3520
 
3523 3521
 			if (!is_array($params[0])) {
3524 3522
 				trigger_error(
3525
-					'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
3523
+					'array_column() expects parameter 1 to be array, '.gettype($params[0]).' given',
3526 3524
 					E_USER_WARNING
3527 3525
 				);
3528 3526
 				return null;
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 		return $f;
94 94
 	}
95
-	foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) {
95
+	foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) {
96 96
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
97 97
 		// fonction ou name\space\fonction
98 98
 		if (is_callable($f)) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 function spip_version() {
160 160
 	$version = $GLOBALS['spip_version_affichee'];
161 161
 	if ($svn_revision = version_svn_courante(_DIR_RACINE)) {
162
-		$version .= ($svn_revision < 0 ? ' SVN' : '') . ' [' . abs($svn_revision) . ']';
162
+		$version .= ($svn_revision < 0 ? ' SVN' : '').' ['.abs($svn_revision).']';
163 163
 	}
164 164
 
165 165
 	return $version;
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
 	}
187 187
 
188 188
 	// version installee par paquet ZIP
189
-	if (lire_fichier($dir . '/svn.revision', $c)
189
+	if (lire_fichier($dir.'/svn.revision', $c)
190 190
 		and preg_match(',Revision: (\d+),', $c, $d)
191 191
 	) {
192 192
 		return intval($d[1]);
193 193
 	}
194 194
 
195 195
 	// version installee par SVN
196
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
197
-		$db = new SQLite3($dir . '/.svn/wc.db');
196
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
197
+		$db = new SQLite3($dir.'/.svn/wc.db');
198 198
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
199 199
 		if ($result) {
200 200
 			$row = $result->fetchArray();
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				return -$row['changed_revision'];
203 203
 			}
204 204
 		}
205
-	} else if (lire_fichier($dir . '/.svn/entries', $c)
205
+	} else if (lire_fichier($dir.'/.svn/entries', $c)
206 206
 		and (
207 207
 			(preg_match_all(
208 208
 					',committed-rev="([0-9]+)",', $c, $r1, PREG_PATTERN_ORDER)
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 
223 223
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
224 224
 // et laisser passer les fonctions personnelles baptisees image_...
225
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
226
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
227
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
228
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
229
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
225
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
226
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
227
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
228
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
229
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
230 230
 
231 231
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
232 232
 $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php';
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
  */
373 373
 function filtre_debug($val, $key = null) {
374 374
 	$debug = (
375
-		is_null($key) ? '' : (var_export($key, true) . " = ")
376
-		) . var_export($val, true);
375
+		is_null($key) ? '' : (var_export($key, true)." = ")
376
+		).var_export($val, true);
377 377
 
378 378
 	include_spip('inc/autoriser');
379 379
 	if (autoriser('webmestre')) {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
462 462
 							$srcover = $match[1];
463 463
 							array_shift($args);
464
-							array_unshift($args, "<img src='" . $match[1] . "' />");
464
+							array_unshift($args, "<img src='".$match[1]."' />");
465 465
 							$srcover_filter = call_user_func_array($filtre, $args);
466 466
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
467 467
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 	// " -> &quot; et tout ce genre de choses
812 812
 	$u = $GLOBALS['meta']['pcre_u'];
813 813
 	$texte = str_replace("&nbsp;", " ", $texte);
814
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
814
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
815 815
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
816 816
 	$texte = entites_html($texte, false, false);
817 817
 	// mais bien echapper les double quotes !
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
  **/
872 872
 function supprimer_numero($texte) {
873 873
 	return preg_replace(
874
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
874
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
875 875
 		"", $texte);
876 876
 }
877 877
 
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
  **/
897 897
 function recuperer_numero($texte) {
898 898
 	if (preg_match(
899
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
899
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
900 900
 		$texte, $regs)) {
901 901
 		return strval($regs[1]);
902 902
 	} else {
@@ -981,8 +981,8 @@  discard block
 block discarded – undo
981 981
  **/
982 982
 function textebrut($texte) {
983 983
 	$u = $GLOBALS['meta']['pcre_u'];
984
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
985
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
984
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
985
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
986 986
 	$texte = preg_replace("/^\n+/", "", $texte);
987 987
 	$texte = preg_replace("/\n+$/", "", $texte);
988 988
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1011 1011
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1012 1012
 		foreach ($liens[0] as $a) {
1013
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1013
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1014 1014
 			$ablank = inserer_attribut($a, 'rel', $rel);
1015 1015
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1016 1016
 			$texte = str_replace($a, $ablank, $texte);
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 		foreach ($regs[0] as $a) {
1036 1036
 			$rel = extraire_attribut($a, "rel");
1037 1037
 			if (strpos($rel, "nofollow") === false) {
1038
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1038
+				$rel = "nofollow".($rel ? " $rel" : "");
1039 1039
 				$anofollow = inserer_attribut($a, "rel", $rel);
1040 1040
 				$texte = str_replace($a, $anofollow, $texte);
1041 1041
 			}
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
 	$u = $GLOBALS['meta']['pcre_u'];
1065 1065
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1066 1066
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1067
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1067
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1068 1068
 
1069 1069
 	return $texte;
1070 1070
 }
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 		return $texte;
1095 1095
 	}
1096 1096
 	include_spip('inc/texte');
1097
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1097
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1098 1098
 		'div' : 'span';
1099 1099
 
1100 1100
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 function attribut_html($texte, $textebrut = true) {
1204 1204
 	$u = $GLOBALS['meta']['pcre_u'];
1205 1205
 	if ($textebrut) {
1206
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1206
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1207 1207
 	}
1208 1208
 	$texte = texte_backend($texte);
1209 1209
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 	# un message pour abs_url
1233 1233
 	$GLOBALS['mode_abs_url'] = 'url';
1234 1234
 	$url = trim($url);
1235
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1235
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1236 1236
 
1237 1237
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1238 1238
 }
@@ -1434,14 +1434,14 @@  discard block
 block discarded – undo
1434 1434
 	if (strpos($texte, "<") !== false) {
1435 1435
 		include_spip('inc/lien');
1436 1436
 		if (defined('_PREG_MODELE')) {
1437
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1437
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1438 1438
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1439 1439
 		}
1440 1440
 	}
1441 1441
 
1442 1442
 	$debut = '';
1443 1443
 	$suite = $texte;
1444
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1444
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1445 1445
 		$debut .= substr($suite, 0, $t - 1);
1446 1446
 		$suite = substr($suite, $t);
1447 1447
 		$car = substr($suite, 0, 1);
@@ -1458,11 +1458,11 @@  discard block
 block discarded – undo
1458 1458
 			$suite = substr($suite, strlen($regs[0]));
1459 1459
 		}
1460 1460
 	}
1461
-	$texte = $debut . $suite;
1461
+	$texte = $debut.$suite;
1462 1462
 
1463 1463
 	$texte = echappe_retour($texte);
1464 1464
 
1465
-	return $texte . $fin;
1465
+	return $texte.$fin;
1466 1466
 }
1467 1467
 
1468 1468
 
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 		}
1524 1524
 
1525 1525
 		foreach ($regs as $reg) {
1526
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1526
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1527 1527
 			$desc = $traduire($cle, $lang, true);
1528 1528
 			$l = $desc->langue;
1529 1529
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1637 1637
 					include_spip('inc/texte');
1638 1638
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1639
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1639
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1640 1640
 					$trad = code_echappement($trad, 'multi', false, $mode);
1641 1641
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
1642 1642
 					if (lang_dir($l) !== lang_dir($lang)) {
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 	if (is_array($balise)) {
1830 1830
 		array_walk(
1831 1831
 			$balise,
1832
-			function(&$a, $key, $t){
1832
+			function(&$a, $key, $t) {
1833 1833
 				$a = extraire_attribut($a, $t);
1834 1834
 			},
1835 1835
 			$attribut
@@ -1916,14 +1916,14 @@  discard block
 block discarded – undo
1916 1916
 
1917 1917
 	if ($old !== null) {
1918 1918
 		// Remplacer l'ancien attribut du meme nom
1919
-		$balise = $r[1] . $insert . $r[5];
1919
+		$balise = $r[1].$insert.$r[5];
1920 1920
 	} else {
1921 1921
 		// preferer une balise " />" (comme <img />)
1922 1922
 		if (preg_match(',/>,', $balise)) {
1923
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
1923
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
1924 1924
 		} // sinon une balise <a ...> ... </a>
1925 1925
 		else {
1926
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
1926
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
1927 1927
 		}
1928 1928
 	}
1929 1929
 
@@ -1965,8 +1965,8 @@  discard block
 block discarded – undo
1965 1965
 //
1966 1966
 // Quelques fonctions de calcul arithmetique
1967 1967
 //
1968
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
1969
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
1968
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
1969
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
1970 1970
 
1971 1971
 /**
1972 1972
  * Additionne 2 nombres
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
 function plus($a, $b) {
1987 1987
 	return $a + $b;
1988 1988
 }
1989
-function strplus($a, $b) {return strize('plus', $a, $b);}
1989
+function strplus($a, $b) {return strize('plus', $a, $b); }
1990 1990
 /**
1991 1991
  * Soustrait 2 nombres
1992 1992
  *
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
 function moins($a, $b) {
2006 2006
 	return $a - $b;
2007 2007
 }
2008
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2008
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2009 2009
 
2010 2010
 /**
2011 2011
  * Multiplie 2 nombres
@@ -2026,7 +2026,7 @@  discard block
 block discarded – undo
2026 2026
 function mult($a, $b) {
2027 2027
 	return $a * $b;
2028 2028
 }
2029
-function strmult($a, $b) {return strize('mult', $a, $b);}
2029
+function strmult($a, $b) {return strize('mult', $a, $b); }
2030 2030
 
2031 2031
 /**
2032 2032
  * Divise 2 nombres
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
 function div($a, $b) {
2048 2048
 	return $b ? $a / $b : 0;
2049 2049
 }
2050
-function strdiv($a, $b) {return strize('div', $a, $b);}
2050
+function strdiv($a, $b) {return strize('div', $a, $b); }
2051 2051
 
2052 2052
 /**
2053 2053
  * Retourne le modulo 2 nombres
@@ -2088,13 +2088,13 @@  discard block
 block discarded – undo
2088 2088
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2089 2089
 		define('_TAGS_NOM_AUTEUR', '');
2090 2090
 	}
2091
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2091
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2092 2092
 	foreach ($tags_acceptes as $tag) {
2093 2093
 		if (strlen($tag)) {
2094
-			$remp1[] = '<' . trim($tag) . '>';
2095
-			$remp1[] = '</' . trim($tag) . '>';
2096
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2097
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2094
+			$remp1[] = '<'.trim($tag).'>';
2095
+			$remp1[] = '</'.trim($tag).'>';
2096
+			$remp2[] = '\x60'.trim($tag).'\x61';
2097
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2098 2098
 		}
2099 2099
 	}
2100 2100
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2157,7 +2157,7 @@  discard block
 block discarded – undo
2157 2157
 			$s[] = preg_replace(',>[^<]+</a>,S',
2158 2158
 				'>'
2159 2159
 				. http_img_pack('attachment-16.png', $t,
2160
-					'title="' . attribut_html($t) . '"')
2160
+					'title="'.attribut_html($t).'"')
2161 2161
 				. '</a>', $tag);
2162 2162
 		}
2163 2163
 	}
@@ -2218,10 +2218,10 @@  discard block
 block discarded – undo
2218 2218
 	$fichier = basename($url);
2219 2219
 
2220 2220
 	return '<a rel="enclosure"'
2221
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2222
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2223
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2224
-	. '>' . $fichier . '</a>';
2221
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2222
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2223
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2224
+	. '>'.$fichier.'</a>';
2225 2225
 }
2226 2226
 
2227 2227
 /**
@@ -2249,9 +2249,9 @@  discard block
 block discarded – undo
2249 2249
 			} # vieux data
2250 2250
 			$fichier = basename($url);
2251 2251
 			$enclosures[] = '<enclosure'
2252
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2253
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2254
-				. ($length ? ' length="' . $length . '"' : '')
2252
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2253
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2254
+				. ($length ? ' length="'.$length.'"' : '')
2255 2255
 				. ' />';
2256 2256
 		}
2257 2257
 	}
@@ -2277,7 +2277,7 @@  discard block
 block discarded – undo
2277 2277
 		if (extraire_attribut($e, rel) == 'tag') {
2278 2278
 			$subjects .= '<dc:subject>'
2279 2279
 				. texte_backend(textebrut($e))
2280
-				. '</dc:subject>' . "\n";
2280
+				. '</dc:subject>'."\n";
2281 2281
 		}
2282 2282
 	}
2283 2283
 
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
 	if (is_array($texte)) {
2314 2314
 		array_walk(
2315 2315
 			$texte,
2316
-			function(&$a, $key, $t){
2316
+			function(&$a, $key, $t) {
2317 2317
 				$a = extraire_balise($a, $t);
2318 2318
 			},
2319 2319
 			$tag
@@ -2357,7 +2357,7 @@  discard block
 block discarded – undo
2357 2357
 	if (is_array($texte)) {
2358 2358
 		array_walk(
2359 2359
 			$texte,
2360
-			function(&$a, $key, $t){
2360
+			function(&$a, $key, $t) {
2361 2361
 				$a = extraire_balises($a, $t);
2362 2362
 			},
2363 2363
 			$tag
@@ -2483,7 +2483,7 @@  discard block
 block discarded – undo
2483 2483
 		if ($fond != '404') {
2484 2484
 			$contexte = array_shift($p);
2485 2485
 			$contexte['page'] = $fond;
2486
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2486
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2487 2487
 		}
2488 2488
 	}
2489 2489
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2538,9 +2538,9 @@  discard block
 block discarded – undo
2538 2538
 			. '"'
2539 2539
 			. (is_null($val)
2540 2540
 				? ''
2541
-				: ' value="' . entites_html($val) . '"'
2541
+				: ' value="'.entites_html($val).'"'
2542 2542
 			)
2543
-			. ' type="hidden"' . "\n/>";
2543
+			. ' type="hidden"'."\n/>";
2544 2544
 	}
2545 2545
 
2546 2546
 	return join("", $hidden);
@@ -2703,12 +2703,12 @@  discard block
 block discarded – undo
2703 2703
 	if ($pas < 1) {
2704 2704
 		return '';
2705 2705
 	}
2706
-	$ancre = 'pagination' . $nom; // #pagination_articles
2707
-	$debut = 'debut' . $nom; // 'debut_articles'
2706
+	$ancre = 'pagination'.$nom; // #pagination_articles
2707
+	$debut = 'debut'.$nom; // 'debut_articles'
2708 2708
 
2709 2709
 	// n'afficher l'ancre qu'une fois
2710 2710
 	if (!isset($ancres[$ancre])) {
2711
-		$bloc_ancre = $ancres[$ancre] = "<a name='" . $ancre . "' id='" . $ancre . "'></a>";
2711
+		$bloc_ancre = $ancres[$ancre] = "<a name='".$ancre."' id='".$ancre."'></a>";
2712 2712
 	} else {
2713 2713
 		$bloc_ancre = '';
2714 2714
 	}
@@ -2738,7 +2738,7 @@  discard block
 block discarded – undo
2738 2738
 	}
2739 2739
 
2740 2740
 	if ($modele) {
2741
-		$modele = '_' . $modele;
2741
+		$modele = '_'.$modele;
2742 2742
 	}
2743 2743
 
2744 2744
 	return recuperer_fond("modeles/pagination$modele", $pagination, array('trim' => true), $connect);
@@ -2763,7 +2763,7 @@  discard block
 block discarded – undo
2763 2763
 	return preg_replace_callback(
2764 2764
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2765 2765
 		function($x) use ($path) {
2766
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2766
+			return "url('".suivre_lien($path, $x[1])."')";
2767 2767
 		},
2768 2768
 		$contenu
2769 2769
 	);
@@ -2825,14 +2825,14 @@  discard block
 block discarded – undo
2825 2825
 	) {
2826 2826
 		$distant = true;
2827 2827
 		$cssf = parse_url($css);
2828
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2828
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2829 2829
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2830 2830
 	} else {
2831 2831
 		$distant = false;
2832 2832
 		$cssf = $css;
2833 2833
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2834 2834
 		//propose (rien a faire dans ce cas)
2835
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2835
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2836 2836
 		if (@file_exists($f)) {
2837 2837
 			return $f;
2838 2838
 		}
@@ -2842,7 +2842,7 @@  discard block
 block discarded – undo
2842 2842
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2843 2843
 	$f = $dir_var
2844 2844
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2845
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2845
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2846 2846
 
2847 2847
 	// la css peut etre distante (url absolue !)
2848 2848
 	if ($distant) {
@@ -2887,8 +2887,8 @@  discard block
 block discarded – undo
2887 2887
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2888 2888
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2889 2889
 			$css_direction = substr($css_direction, strlen($dir_var));
2890
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2891
-			$css_direction = "/@@@@@@/" . $css_direction;
2890
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2891
+			$css_direction = "/@@@@@@/".$css_direction;
2892 2892
 		}
2893 2893
 		$src[] = $regs[0][$k];
2894 2894
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -2937,7 +2937,7 @@  discard block
 block discarded – undo
2937 2937
 
2938 2938
 	$f = basename($css, '.css');
2939 2939
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
2940
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
2940
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
2941 2941
 		. '.css';
2942 2942
 
2943 2943
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -2946,7 +2946,7 @@  discard block
 block discarded – undo
2946 2946
 
2947 2947
 	if ($url_absolue_css == $css) {
2948 2948
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
2949
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
2949
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
2950 2950
 		) {
2951 2951
 			include_spip('inc/distant');
2952 2952
 			if (!$contenu = recuperer_page($css)) {
@@ -3056,7 +3056,7 @@  discard block
 block discarded – undo
3056 3056
 	$expression = str_replace("\/", "/", $expression);
3057 3057
 	$expression = str_replace("/", "\/", $expression);
3058 3058
 
3059
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3059
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3060 3060
 		if (isset($r[$capte])) {
3061 3061
 			return $r[$capte];
3062 3062
 		} else {
@@ -3094,7 +3094,7 @@  discard block
 block discarded – undo
3094 3094
 	$expression = str_replace("\/", "/", $expression);
3095 3095
 	$expression = str_replace("/", "\/", $expression);
3096 3096
 
3097
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3097
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3098 3098
 }
3099 3099
 
3100 3100
 
@@ -3113,7 +3113,7 @@  discard block
 block discarded – undo
3113 3113
 function traiter_doublons_documents(&$doublons, $letexte) {
3114 3114
 
3115 3115
 	// Verifier dans le texte & les notes (pas beau, helas)
3116
-	$t = $letexte . $GLOBALS['les_notes'];
3116
+	$t = $letexte.$GLOBALS['les_notes'];
3117 3117
 
3118 3118
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3119 3119
 		and preg_match_all(
@@ -3123,7 +3123,7 @@  discard block
 block discarded – undo
3123 3123
 		if (!isset($doublons['documents'])) {
3124 3124
 			$doublons['documents'] = "";
3125 3125
 		}
3126
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3126
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3127 3127
 	}
3128 3128
 
3129 3129
 	return $letexte;
@@ -3180,7 +3180,7 @@  discard block
 block discarded – undo
3180 3180
 	if ($env) {
3181 3181
 		foreach ($env as $i => $j) {
3182 3182
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3183
-				$texte .= "<param name='" . $i . "'\n\tvalue='" . $j . "' />";
3183
+				$texte .= "<param name='".$i."'\n\tvalue='".$j."' />";
3184 3184
 			}
3185 3185
 		}
3186 3186
 	}
@@ -3219,7 +3219,7 @@  discard block
 block discarded – undo
3219 3219
 	if ($env) {
3220 3220
 		foreach ($env as $i => $j) {
3221 3221
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3222
-				$texte .= $i . "='" . $j . "' ";
3222
+				$texte .= $i."='".$j."' ";
3223 3223
 			}
3224 3224
 		}
3225 3225
 	}
@@ -3305,10 +3305,10 @@  discard block
 block discarded – undo
3305 3305
 		$img_file = chemin_image($img);
3306 3306
 	}
3307 3307
 	else {
3308
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3308
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3309 3309
 			if (preg_match(',-\d+[.](png|gif|svg)$,', $img_file, $m)
3310
-				and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3311
-				and file_exists($variante_svg_generique)){
3310
+				and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3311
+				and file_exists($variante_svg_generique)) {
3312 3312
 				$img_file = $variante_svg_generique;
3313 3313
 			}
3314 3314
 		}
@@ -3326,12 +3326,12 @@  discard block
 block discarded – undo
3326 3326
 				return "";
3327 3327
 			}
3328 3328
 		}
3329
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3329
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3330 3330
 	}
3331 3331
 
3332
-	return "<img src='$img_file' alt='" . attribut_html($alt ? $alt : $title) . "'"
3333
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3334
-	. " " . ltrim($atts)
3332
+	return "<img src='$img_file' alt='".attribut_html($alt ? $alt : $title)."'"
3333
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3334
+	. " ".ltrim($atts)
3335 3335
 	. " />";
3336 3336
 }
3337 3337
 
@@ -3343,7 +3343,7 @@  discard block
 block discarded – undo
3343 3343
  * @return string
3344 3344
  */
3345 3345
 function http_style_background($img, $att = '') {
3346
-	return " style='background" . ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";'";
3346
+	return " style='background".($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";'";
3347 3347
 }
3348 3348
 
3349 3349
 /**
@@ -3358,7 +3358,7 @@  discard block
 block discarded – undo
3358 3358
  *     Code HTML de la balise IMG
3359 3359
  */
3360 3360
 function filtre_balise_img_dist($img, $alt = "", $class = "") {
3361
-	return http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3361
+	return http_img_pack($img, $alt, $class ? " class='".attribut_html($class)."'" : '', '',
3362 3362
 		array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3363 3363
 }
3364 3364
 
@@ -3390,11 +3390,11 @@  discard block
 block discarded – undo
3390 3390
 	if ($class) {
3391 3391
 		$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3392 3392
 	}
3393
-	if ($alt){
3393
+	if ($alt) {
3394 3394
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3395
-		$id = "img-svg-title-" . substr(md5("$file:$svg:$alt"),0,4);
3395
+		$id = "img-svg-title-".substr(md5("$file:$svg:$alt"), 0, 4);
3396 3396
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3397
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3397
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3398 3398
 		$balise_svg .= $title;
3399 3399
 	}
3400 3400
 	else {
@@ -3428,7 +3428,7 @@  discard block
 block discarded – undo
3428 3428
 	$texte = '';
3429 3429
 	if (is_array($tableau)) {
3430 3430
 		foreach ($tableau as $k => $v) {
3431
-			$res = recuperer_fond('modeles/' . $modele,
3431
+			$res = recuperer_fond('modeles/'.$modele,
3432 3432
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3433 3433
 			);
3434 3434
 			$texte .= $res;
@@ -3605,7 +3605,7 @@  discard block
 block discarded – undo
3605 3605
 	}
3606 3606
 
3607 3607
 	$c = serialize($c);
3608
-	$cle = calculer_cle_action($form . $c);
3608
+	$cle = calculer_cle_action($form.$c);
3609 3609
 	$c = "$cle:$c";
3610 3610
 
3611 3611
 	// on ne stocke pas les contextes dans des fichiers caches
@@ -3655,15 +3655,15 @@  discard block
 block discarded – undo
3655 3655
 	}
3656 3656
 	// toujours encoder l'url source dans le bloc ajax
3657 3657
 	$r = self();
3658
-	$r = ' data-origin="' . $r . '"';
3658
+	$r = ' data-origin="'.$r.'"';
3659 3659
 	$class = 'ajaxbloc';
3660 3660
 	if ($ajaxid and is_string($ajaxid)) {
3661 3661
 		// ajaxid est normalement conforme a un nom de classe css
3662 3662
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3663
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3663
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3664 3664
 	}
3665 3665
 
3666
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3666
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3667 3667
 }
3668 3668
 
3669 3669
 /**
@@ -3702,11 +3702,11 @@  discard block
 block discarded – undo
3702 3702
 	// extraire la signature en debut de contexte
3703 3703
 	// et la verifier avant de deserializer
3704 3704
 	// format : signature:donneesserializees
3705
-	if ($p = strpos($c,":")){
3706
-		$cle = substr($c,0,$p);
3707
-		$c = substr($c,$p+1);
3705
+	if ($p = strpos($c, ":")) {
3706
+		$cle = substr($c, 0, $p);
3707
+		$c = substr($c, $p + 1);
3708 3708
 
3709
-		if ($cle == calculer_cle_action($form . $c)) {
3709
+		if ($cle == calculer_cle_action($form.$c)) {
3710 3710
 			$env = @unserialize($c);
3711 3711
 			return $env;
3712 3712
 		}
@@ -3807,9 +3807,9 @@  discard block
 block discarded – undo
3807 3807
 	} else {
3808 3808
 		$bal = 'a';
3809 3809
 		$att = "href='$url'"
3810
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
3811
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
3812
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
3810
+			. ($title ? " title='".attribut_html($title)."'" : '')
3811
+			. ($class ? " class='".attribut_html($class)."'" : '')
3812
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
3813 3813
 			. $evt;
3814 3814
 	}
3815 3815
 	if ($libelle === null) {
@@ -3883,7 +3883,7 @@  discard block
 block discarded – undo
3883 3883
 	}
3884 3884
 
3885 3885
 	// ajouter le type d'objet dans la class de l'icone
3886
-	$class .= " " . substr(basename($fond), 0, -4);
3886
+	$class .= " ".substr(basename($fond), 0, -4);
3887 3887
 
3888 3888
 	$alt = attribut_html($texte);
3889 3889
 	$title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ?
@@ -3908,7 +3908,7 @@  discard block
 block discarded – undo
3908 3908
 	if ($fonction) {
3909 3909
 		// 2 images pour composer l'icone : le fond (article) en background,
3910 3910
 		// la fonction (new) en image
3911
-		$icone = http_img_pack($fonction, $alt, "width='$size' height='$size'\n" .
3911
+		$icone = http_img_pack($fonction, $alt, "width='$size' height='$size'\n".
3912 3912
 			http_style_background($fond));
3913 3913
 	} else {
3914 3914
 		$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
@@ -4142,13 +4142,13 @@  discard block
 block discarded – undo
4142 4142
 	$res = "";
4143 4143
 	foreach ($boutons as $page => $detail) {
4144 4144
 		if ($detail->icone and strlen(trim($detail->icone))) {
4145
-			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}";
4145
+			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}";
4146 4146
 		}
4147 4147
 		$selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones ");
4148 4148
 		if (is_array($detail->sousmenu)) {
4149 4149
 			foreach ($detail->sousmenu as $souspage => $sousdetail) {
4150 4150
 				if ($sousdetail->icone and strlen(trim($sousdetail->icone))) {
4151
-					$res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}";
4151
+					$res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}";
4152 4152
 				}
4153 4153
 			}
4154 4154
 		}
@@ -4174,17 +4174,17 @@  discard block
 block discarded – undo
4174 4174
  */
4175 4175
 function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") {
4176 4176
 	if ($confirm) {
4177
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4177
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4178 4178
 		if ($callback) {
4179 4179
 			$callback = "$confirm?($callback):false";
4180 4180
 		} else {
4181 4181
 			$callback = $confirm;
4182 4182
 		}
4183 4183
 	}
4184
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4184
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4185 4185
 	$title = $title ? " title='$title'" : "";
4186 4186
 
4187
-	return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url)
4187
+	return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url)
4188 4188
 	. "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>";
4189 4189
 }
4190 4190
 
@@ -4323,14 +4323,14 @@  discard block
 block discarded – undo
4323 4323
 		$champ_titre = "";
4324 4324
 		if ($demande_titre) {
4325 4325
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4326
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4326
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4327 4327
 		}
4328 4328
 		include_spip('base/abstract_sql');
4329 4329
 		include_spip('base/connect_sql');
4330 4330
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4331
-			'*' . $champ_titre,
4331
+			'*'.$champ_titre,
4332 4332
 			$desc['table_sql'],
4333
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4333
+			id_table_objet($type_objet).' = '.intval($id_objet)
4334 4334
 		);
4335 4335
 	}
4336 4336
 
@@ -4400,7 +4400,7 @@  discard block
 block discarded – undo
4400 4400
 		return $texte;
4401 4401
 	}
4402 4402
 
4403
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4403
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4404 4404
 
4405 4405
 	// Fournir $connect et $Pile[0] au traitement si besoin
4406 4406
 	$Pile = array(0 => $env);
@@ -4434,7 +4434,7 @@  discard block
 block discarded – undo
4434 4434
 	}
4435 4435
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4436 4436
 
4437
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4437
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4438 4438
 }
4439 4439
 
4440 4440
 
@@ -4453,10 +4453,10 @@  discard block
 block discarded – undo
4453 4453
 function wrap($texte, $wrap) {
4454 4454
 	$balises = extraire_balises($wrap);
4455 4455
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4456
-		$texte = $wrap . $texte;
4456
+		$texte = $wrap.$texte;
4457 4457
 		$regs = array_reverse($regs[1]);
4458
-		$wrap = "</" . implode("></", $regs) . ">";
4459
-		$texte = $texte . $wrap;
4458
+		$wrap = "</".implode("></", $regs).">";
4459
+		$texte = $texte.$wrap;
4460 4460
 	}
4461 4461
 
4462 4462
 	return $texte;
@@ -4487,7 +4487,7 @@  discard block
 block discarded – undo
4487 4487
 
4488 4488
 	// caster $u en array si besoin
4489 4489
 	if (is_object($u)) {
4490
-		$u = (array)$u;
4490
+		$u = (array) $u;
4491 4491
 	}
4492 4492
 
4493 4493
 	if (is_array($u)) {
@@ -4508,7 +4508,7 @@  discard block
 block discarded – undo
4508 4508
 		// sinon on passe a la ligne et on indente
4509 4509
 		$i_str = str_pad("", $indent, " ");
4510 4510
 		foreach ($u as $k => $v) {
4511
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4511
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4512 4512
 		}
4513 4513
 
4514 4514
 		return $out;
@@ -4561,7 +4561,7 @@  discard block
 block discarded – undo
4561 4561
  * @return string
4562 4562
  */
4563 4563
 function objet_icone($objet, $taille = 24) {
4564
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4564
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4565 4565
 	$icone = chemin_image($icone);
4566 4566
 	$balise_img = charger_filtre('balise_img');
4567 4567
 
@@ -4585,12 +4585,12 @@  discard block
 block discarded – undo
4585 4585
  * @param array $options
4586 4586
  * @return string
4587 4587
  */
4588
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4589
-	$chaine = explode(':',$chaine);
4590
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4588
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4589
+	$chaine = explode(':', $chaine);
4590
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4591 4591
 		return $t;
4592 4592
 	}
4593
-	$chaine = implode(':',$chaine);
4593
+	$chaine = implode(':', $chaine);
4594 4594
 	return _T($chaine, $args, $options);
4595 4595
 }
4596 4596
 
@@ -4650,11 +4650,11 @@  discard block
 block discarded – undo
4650 4650
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4651 4651
 
4652 4652
 	// calculer le nom de la css
4653
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
4653
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
4654 4654
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
4655 4655
 	$contexte_implicite = calculer_contexte_implicite();
4656
-	$filename = $dir_var . $extension . "dyn-$nom_safe-"
4657
-		. substr(md5($fond . serialize($contexte_implicite) . serialize($contexte) . $connect), 0, 8)
4656
+	$filename = $dir_var.$extension."dyn-$nom_safe-"
4657
+		. substr(md5($fond.serialize($contexte_implicite).serialize($contexte).$connect), 0, 8)
4658 4658
 		. ".$extension";
4659 4659
 
4660 4660
 	// mettre a jour le fichier si il n'existe pas
@@ -4662,8 +4662,8 @@  discard block
 block discarded – undo
4662 4662
 	// le dernier fichier produit est toujours suffixe par .last
4663 4663
 	// et recopie sur le fichier cible uniquement si il change
4664 4664
 	if (!file_exists($filename)
4665
-		or !file_exists($filename . ".last")
4666
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
4665
+		or !file_exists($filename.".last")
4666
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
4667 4667
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
4668 4668
 	) {
4669 4669
 		$contenu = $cache['texte'];
@@ -4682,15 +4682,15 @@  discard block
 block discarded – undo
4682 4682
 			}
4683 4683
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
4684 4684
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
4685
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
4685
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
4686 4686
 		}
4687 4687
 		// et ecrire le fichier
4688
-		ecrire_fichier($filename . ".last", $comment . $contenu);
4688
+		ecrire_fichier($filename.".last", $comment.$contenu);
4689 4689
 		// regarder si on recopie
4690 4690
 		if (!file_exists($filename)
4691
-			or md5_file($filename) !== md5_file($filename . ".last")
4691
+			or md5_file($filename) !== md5_file($filename.".last")
4692 4692
 		) {
4693
-			@copy($filename . ".last", $filename);
4693
+			@copy($filename.".last", $filename);
4694 4694
 			clearstatcache(true, $filename); // eviter que PHP ne reserve le vieux timestamp
4695 4695
 		}
4696 4696
 	}
Please login to merge, or discard this patch.