Completed
Push — master ( 46a1d0...45e39f )
by cam
05:22 queued 10s
created
ecrire/inc/filtres.php 1 patch
Spacing   +146 added lines, -146 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)) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	// affichage "GIT [master: abcdef]"
186 186
 	$commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit'];
187 187
 	if ($desc['branch']) {
188
-		$commit = $desc['branch'] . ': ' . $commit;
188
+		$commit = $desc['branch'].': '.$commit;
189 189
 	}
190 190
 	return "{$desc['vcs']} [$commit]";
191 191
 }
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 	}
205 205
 
206 206
 	// version installee par GIT
207
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
207
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
208 208
 		$currentHead = trim(substr($c, 4));
209
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
209
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
210 210
 			return [
211 211
 				'vcs' => 'GIT',
212 212
 				'branch' => basename($currentHead),
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 		$dir = '.';
234 234
 	}
235 235
 	// version installee par SVN
236
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
237
-		$db = new SQLite3($dir . '/.svn/wc.db');
236
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
237
+		$db = new SQLite3($dir.'/.svn/wc.db');
238 238
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
239 239
 		if ($result) {
240 240
 			$row = $result->fetchArray();
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
 
274 274
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
275 275
 // et laisser passer les fonctions personnelles baptisees image_...
276
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
277
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
278
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
279
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
280
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
276
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
277
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
278
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
279
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
280
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
281 281
 
282 282
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
283 283
 $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php';
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
  */
435 435
 function filtre_debug($val, $key = null) {
436 436
 	$debug = (
437
-		is_null($key) ? '' : (var_export($key, true) . " = ")
438
-		) . var_export($val, true);
437
+		is_null($key) ? '' : (var_export($key, true)." = ")
438
+		).var_export($val, true);
439 439
 
440 440
 	include_spip('inc/autoriser');
441 441
 	if (autoriser('webmestre')) {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
524 524
 							$srcover = $match[1];
525 525
 							array_shift($args);
526
-							array_unshift($args, "<img src='" . $match[1] . "' />");
526
+							array_unshift($args, "<img src='".$match[1]."' />");
527 527
 							$srcover_filter = call_user_func_array($filtre, $args);
528 528
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
529 529
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 	// " -> &quot; et tout ce genre de choses
874 874
 	$u = $GLOBALS['meta']['pcre_u'];
875 875
 	$texte = str_replace("&nbsp;", " ", $texte);
876
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
876
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
877 877
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
878 878
 	$texte = entites_html($texte, false, false);
879 879
 	// mais bien echapper les double quotes !
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
  **/
934 934
 function supprimer_numero($texte) {
935 935
 	return preg_replace(
936
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
936
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
937 937
 		"", $texte);
938 938
 }
939 939
 
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
  **/
959 959
 function recuperer_numero($texte) {
960 960
 	if (preg_match(
961
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
961
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
962 962
 		$texte, $regs)) {
963 963
 		return strval($regs[1]);
964 964
 	} else {
@@ -1043,8 +1043,8 @@  discard block
 block discarded – undo
1043 1043
  **/
1044 1044
 function textebrut($texte) {
1045 1045
 	$u = $GLOBALS['meta']['pcre_u'];
1046
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
1047
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
1046
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
1047
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
1048 1048
 	$texte = preg_replace("/^\n+/", "", $texte);
1049 1049
 	$texte = preg_replace("/\n+$/", "", $texte);
1050 1050
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1073 1073
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1074 1074
 		foreach ($liens[0] as $a) {
1075
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1075
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1076 1076
 			$ablank = inserer_attribut($a, 'rel', $rel);
1077 1077
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1078 1078
 			$texte = str_replace($a, $ablank, $texte);
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 		foreach ($regs[0] as $a) {
1098 1098
 			$rel = extraire_attribut($a, "rel");
1099 1099
 			if (strpos($rel, "nofollow") === false) {
1100
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1100
+				$rel = "nofollow".($rel ? " $rel" : "");
1101 1101
 				$anofollow = inserer_attribut($a, "rel", $rel);
1102 1102
 				$texte = str_replace($a, $anofollow, $texte);
1103 1103
 			}
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 	$u = $GLOBALS['meta']['pcre_u'];
1127 1127
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1128 1128
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1129
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1129
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1130 1130
 
1131 1131
 	return $texte;
1132 1132
 }
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		return $texte;
1157 1157
 	}
1158 1158
 	include_spip('inc/texte');
1159
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1159
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1160 1160
 		'div' : 'span';
1161 1161
 
1162 1162
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1265,7 +1265,7 @@  discard block
 block discarded – undo
1265 1265
 function attribut_html($texte, $textebrut = true) {
1266 1266
 	$u = $GLOBALS['meta']['pcre_u'];
1267 1267
 	if ($textebrut) {
1268
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1268
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1269 1269
 	}
1270 1270
 	$texte = texte_backend($texte);
1271 1271
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
 	# un message pour abs_url
1295 1295
 	$GLOBALS['mode_abs_url'] = 'url';
1296 1296
 	$url = trim($url);
1297
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1297
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1298 1298
 
1299 1299
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1300 1300
 }
@@ -1496,14 +1496,14 @@  discard block
 block discarded – undo
1496 1496
 	if (strpos($texte, "<") !== false) {
1497 1497
 		include_spip('inc/lien');
1498 1498
 		if (defined('_PREG_MODELE')) {
1499
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1499
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1500 1500
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1501 1501
 		}
1502 1502
 	}
1503 1503
 
1504 1504
 	$debut = '';
1505 1505
 	$suite = $texte;
1506
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1506
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1507 1507
 		$debut .= substr($suite, 0, $t - 1);
1508 1508
 		$suite = substr($suite, $t);
1509 1509
 		$car = substr($suite, 0, 1);
@@ -1520,11 +1520,11 @@  discard block
 block discarded – undo
1520 1520
 			$suite = substr($suite, strlen($regs[0]));
1521 1521
 		}
1522 1522
 	}
1523
-	$texte = $debut . $suite;
1523
+	$texte = $debut.$suite;
1524 1524
 
1525 1525
 	$texte = echappe_retour($texte);
1526 1526
 
1527
-	return $texte . $fin;
1527
+	return $texte.$fin;
1528 1528
 }
1529 1529
 
1530 1530
 
@@ -1585,7 +1585,7 @@  discard block
 block discarded – undo
1585 1585
 		}
1586 1586
 
1587 1587
 		foreach ($regs as $reg) {
1588
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1588
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1589 1589
 			$desc = $traduire($cle, $lang, true);
1590 1590
 			$l = $desc->langue;
1591 1591
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1699 1699
 					include_spip('inc/texte');
1700 1700
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1701
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1701
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1702 1702
 					$trad = code_echappement($trad, 'multi', false, $mode);
1703 1703
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
1704 1704
 					if (lang_dir($l) !== lang_dir($lang)) {
@@ -1891,7 +1891,7 @@  discard block
 block discarded – undo
1891 1891
 	if (is_array($balise)) {
1892 1892
 		array_walk(
1893 1893
 			$balise,
1894
-			function(&$a, $key, $t){
1894
+			function(&$a, $key, $t) {
1895 1895
 				$a = extraire_attribut($a, $t);
1896 1896
 			},
1897 1897
 			$attribut
@@ -1978,14 +1978,14 @@  discard block
 block discarded – undo
1978 1978
 
1979 1979
 	if ($old !== null) {
1980 1980
 		// Remplacer l'ancien attribut du meme nom
1981
-		$balise = $r[1] . $insert . $r[5];
1981
+		$balise = $r[1].$insert.$r[5];
1982 1982
 	} else {
1983 1983
 		// preferer une balise " />" (comme <img />)
1984 1984
 		if (preg_match(',/>,', $balise)) {
1985
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
1985
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
1986 1986
 		} // sinon une balise <a ...> ... </a>
1987 1987
 		else {
1988
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
1988
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
1989 1989
 		}
1990 1990
 	}
1991 1991
 
@@ -2027,8 +2027,8 @@  discard block
 block discarded – undo
2027 2027
 //
2028 2028
 // Quelques fonctions de calcul arithmetique
2029 2029
 //
2030
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
2031
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
2030
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
2031
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
2032 2032
 
2033 2033
 /**
2034 2034
  * Additionne 2 nombres
@@ -2048,7 +2048,7 @@  discard block
 block discarded – undo
2048 2048
 function plus($a, $b) {
2049 2049
 	return $a + $b;
2050 2050
 }
2051
-function strplus($a, $b) {return strize('plus', $a, $b);}
2051
+function strplus($a, $b) {return strize('plus', $a, $b); }
2052 2052
 /**
2053 2053
  * Soustrait 2 nombres
2054 2054
  *
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
 function moins($a, $b) {
2068 2068
 	return $a - $b;
2069 2069
 }
2070
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2070
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2071 2071
 
2072 2072
 /**
2073 2073
  * Multiplie 2 nombres
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 function mult($a, $b) {
2089 2089
 	return $a * $b;
2090 2090
 }
2091
-function strmult($a, $b) {return strize('mult', $a, $b);}
2091
+function strmult($a, $b) {return strize('mult', $a, $b); }
2092 2092
 
2093 2093
 /**
2094 2094
  * Divise 2 nombres
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
 function div($a, $b) {
2110 2110
 	return $b ? $a / $b : 0;
2111 2111
 }
2112
-function strdiv($a, $b) {return strize('div', $a, $b);}
2112
+function strdiv($a, $b) {return strize('div', $a, $b); }
2113 2113
 
2114 2114
 /**
2115 2115
  * Retourne le modulo 2 nombres
@@ -2150,13 +2150,13 @@  discard block
 block discarded – undo
2150 2150
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2151 2151
 		define('_TAGS_NOM_AUTEUR', '');
2152 2152
 	}
2153
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2153
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2154 2154
 	foreach ($tags_acceptes as $tag) {
2155 2155
 		if (strlen($tag)) {
2156
-			$remp1[] = '<' . trim($tag) . '>';
2157
-			$remp1[] = '</' . trim($tag) . '>';
2158
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2159
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2156
+			$remp1[] = '<'.trim($tag).'>';
2157
+			$remp1[] = '</'.trim($tag).'>';
2158
+			$remp2[] = '\x60'.trim($tag).'\x61';
2159
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2160 2160
 		}
2161 2161
 	}
2162 2162
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 			$s[] = preg_replace(',>[^<]+</a>,S',
2220 2220
 				'>'
2221 2221
 				. http_img_pack('attachment-16.png', $t,
2222
-					'title="' . attribut_html($t) . '"')
2222
+					'title="'.attribut_html($t).'"')
2223 2223
 				. '</a>', $tag);
2224 2224
 		}
2225 2225
 	}
@@ -2280,10 +2280,10 @@  discard block
 block discarded – undo
2280 2280
 	$fichier = basename($url);
2281 2281
 
2282 2282
 	return '<a rel="enclosure"'
2283
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2284
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2285
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2286
-	. '>' . $fichier . '</a>';
2283
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2284
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2285
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2286
+	. '>'.$fichier.'</a>';
2287 2287
 }
2288 2288
 
2289 2289
 /**
@@ -2311,9 +2311,9 @@  discard block
 block discarded – undo
2311 2311
 			} # vieux data
2312 2312
 			$fichier = basename($url);
2313 2313
 			$enclosures[] = '<enclosure'
2314
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2315
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2316
-				. ($length ? ' length="' . $length . '"' : '')
2314
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2315
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2316
+				. ($length ? ' length="'.$length.'"' : '')
2317 2317
 				. ' />';
2318 2318
 		}
2319 2319
 	}
@@ -2339,7 +2339,7 @@  discard block
 block discarded – undo
2339 2339
 		if (extraire_attribut($e, rel) == 'tag') {
2340 2340
 			$subjects .= '<dc:subject>'
2341 2341
 				. texte_backend(textebrut($e))
2342
-				. '</dc:subject>' . "\n";
2342
+				. '</dc:subject>'."\n";
2343 2343
 		}
2344 2344
 	}
2345 2345
 
@@ -2375,7 +2375,7 @@  discard block
 block discarded – undo
2375 2375
 	if (is_array($texte)) {
2376 2376
 		array_walk(
2377 2377
 			$texte,
2378
-			function(&$a, $key, $t){
2378
+			function(&$a, $key, $t) {
2379 2379
 				$a = extraire_balise($a, $t);
2380 2380
 			},
2381 2381
 			$tag
@@ -2419,7 +2419,7 @@  discard block
 block discarded – undo
2419 2419
 	if (is_array($texte)) {
2420 2420
 		array_walk(
2421 2421
 			$texte,
2422
-			function(&$a, $key, $t){
2422
+			function(&$a, $key, $t) {
2423 2423
 				$a = extraire_balises($a, $t);
2424 2424
 			},
2425 2425
 			$tag
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
 		if ($fond != '404') {
2546 2546
 			$contexte = array_shift($p);
2547 2547
 			$contexte['page'] = $fond;
2548
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2548
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2549 2549
 		}
2550 2550
 	}
2551 2551
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2600,9 +2600,9 @@  discard block
 block discarded – undo
2600 2600
 			. '"'
2601 2601
 			. (is_null($val)
2602 2602
 				? ''
2603
-				: ' value="' . entites_html($val) . '"'
2603
+				: ' value="'.entites_html($val).'"'
2604 2604
 			)
2605
-			. ' type="hidden"' . "\n/>";
2605
+			. ' type="hidden"'."\n/>";
2606 2606
 	}
2607 2607
 
2608 2608
 	return join("", $hidden);
@@ -2765,12 +2765,12 @@  discard block
 block discarded – undo
2765 2765
 	if ($pas < 1) {
2766 2766
 		return '';
2767 2767
 	}
2768
-	$ancre = 'pagination' . $nom; // #pagination_articles
2769
-	$debut = 'debut' . $nom; // 'debut_articles'
2768
+	$ancre = 'pagination'.$nom; // #pagination_articles
2769
+	$debut = 'debut'.$nom; // 'debut_articles'
2770 2770
 
2771 2771
 	// n'afficher l'ancre qu'une fois
2772 2772
 	if (!isset($ancres[$ancre])) {
2773
-		$bloc_ancre = $ancres[$ancre] = "<a name='" . $ancre . "' id='" . $ancre . "'></a>";
2773
+		$bloc_ancre = $ancres[$ancre] = "<a name='".$ancre."' id='".$ancre."'></a>";
2774 2774
 	} else {
2775 2775
 		$bloc_ancre = '';
2776 2776
 	}
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 	}
2802 2802
 
2803 2803
 	if ($modele) {
2804
-		$modele = '_' . $modele;
2804
+		$modele = '_'.$modele;
2805 2805
 	}
2806 2806
 
2807 2807
 	return recuperer_fond("modeles/pagination$modele", $pagination, array('trim' => true), $connect);
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
 	return preg_replace_callback(
2827 2827
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2828 2828
 		function($x) use ($path) {
2829
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2829
+			return "url('".suivre_lien($path, $x[1])."')";
2830 2830
 		},
2831 2831
 		$contenu
2832 2832
 	);
@@ -2888,14 +2888,14 @@  discard block
 block discarded – undo
2888 2888
 	) {
2889 2889
 		$distant = true;
2890 2890
 		$cssf = parse_url($css);
2891
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2891
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2892 2892
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2893 2893
 	} else {
2894 2894
 		$distant = false;
2895 2895
 		$cssf = $css;
2896 2896
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2897 2897
 		//propose (rien a faire dans ce cas)
2898
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2898
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2899 2899
 		if (@file_exists($f)) {
2900 2900
 			return $f;
2901 2901
 		}
@@ -2905,7 +2905,7 @@  discard block
 block discarded – undo
2905 2905
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2906 2906
 	$f = $dir_var
2907 2907
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2908
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2908
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2909 2909
 
2910 2910
 	// la css peut etre distante (url absolue !)
2911 2911
 	if ($distant) {
@@ -2950,8 +2950,8 @@  discard block
 block discarded – undo
2950 2950
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2951 2951
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2952 2952
 			$css_direction = substr($css_direction, strlen($dir_var));
2953
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2954
-			$css_direction = "/@@@@@@/" . $css_direction;
2953
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2954
+			$css_direction = "/@@@@@@/".$css_direction;
2955 2955
 		}
2956 2956
 		$src[] = $regs[0][$k];
2957 2957
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3000,7 +3000,7 @@  discard block
 block discarded – undo
3000 3000
 
3001 3001
 	$f = basename($css, '.css');
3002 3002
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3003
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3003
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3004 3004
 		. '.css';
3005 3005
 
3006 3006
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3009,7 +3009,7 @@  discard block
 block discarded – undo
3009 3009
 
3010 3010
 	if ($url_absolue_css == $css) {
3011 3011
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3012
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3012
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3013 3013
 		) {
3014 3014
 			include_spip('inc/distant');
3015 3015
 			if (!$contenu = recuperer_page($css)) {
@@ -3119,7 +3119,7 @@  discard block
 block discarded – undo
3119 3119
 	$expression = str_replace("\/", "/", $expression);
3120 3120
 	$expression = str_replace("/", "\/", $expression);
3121 3121
 
3122
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3122
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3123 3123
 		if (isset($r[$capte])) {
3124 3124
 			return $r[$capte];
3125 3125
 		} else {
@@ -3157,7 +3157,7 @@  discard block
 block discarded – undo
3157 3157
 	$expression = str_replace("\/", "/", $expression);
3158 3158
 	$expression = str_replace("/", "\/", $expression);
3159 3159
 
3160
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3160
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3161 3161
 }
3162 3162
 
3163 3163
 
@@ -3176,7 +3176,7 @@  discard block
 block discarded – undo
3176 3176
 function traiter_doublons_documents(&$doublons, $letexte) {
3177 3177
 
3178 3178
 	// Verifier dans le texte & les notes (pas beau, helas)
3179
-	$t = $letexte . $GLOBALS['les_notes'];
3179
+	$t = $letexte.$GLOBALS['les_notes'];
3180 3180
 
3181 3181
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3182 3182
 		and preg_match_all(
@@ -3186,7 +3186,7 @@  discard block
 block discarded – undo
3186 3186
 		if (!isset($doublons['documents'])) {
3187 3187
 			$doublons['documents'] = "";
3188 3188
 		}
3189
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3189
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3190 3190
 	}
3191 3191
 
3192 3192
 	return $letexte;
@@ -3243,7 +3243,7 @@  discard block
 block discarded – undo
3243 3243
 	if ($env) {
3244 3244
 		foreach ($env as $i => $j) {
3245 3245
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3246
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3246
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3247 3247
 			}
3248 3248
 		}
3249 3249
 	}
@@ -3282,7 +3282,7 @@  discard block
 block discarded – undo
3282 3282
 	if ($env) {
3283 3283
 		foreach ($env as $i => $j) {
3284 3284
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3285
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3285
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3286 3286
 			}
3287 3287
 		}
3288 3288
 	}
@@ -3366,19 +3366,19 @@  discard block
 block discarded – undo
3366 3366
 
3367 3367
 	$img_file = $img;
3368 3368
 	if ($p = strpos($img_file, '?')) {
3369
-		$img_file = substr($img_file,0, $p);
3369
+		$img_file = substr($img_file, 0, $p);
3370 3370
 	}
3371 3371
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3372 3372
 		$img_file = chemin_image($img);
3373 3373
 	}
3374 3374
 	else {
3375
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3375
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3376 3376
 			// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3377 3377
 			// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3378 3378
 			if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3379
-			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3379
+			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3380 3380
 			  and file_exists($variante_svg_generique)) {
3381
-				if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3381
+				if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) {
3382 3382
 					$img_file = $variante_svg_size;
3383 3383
 				}
3384 3384
 				else {
@@ -3403,15 +3403,15 @@  discard block
 block discarded – undo
3403 3403
 				return "";
3404 3404
 			}
3405 3405
 		}
3406
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3406
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3407 3407
 	}
3408 3408
 
3409 3409
 	if (file_exists($img_file)) {
3410 3410
 		$img_file = timestamp($img_file);
3411 3411
 	}
3412
-	return "<img src='$img_file' alt='" . attribut_html($alt ? $alt : $title) . "'"
3413
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3414
-	. " " . ltrim($atts)
3412
+	return "<img src='$img_file' alt='".attribut_html($alt ? $alt : $title)."'"
3413
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3414
+	. " ".ltrim($atts)
3415 3415
 	. " />";
3416 3416
 }
3417 3417
 
@@ -3423,12 +3423,12 @@  discard block
 block discarded – undo
3423 3423
  * @param string $size
3424 3424
  * @return string
3425 3425
  */
3426
-function http_style_background($img, $att = '', $size=null) {
3427
-	if ($size and is_numeric($size)){
3428
-		$size = trim($size) . "px";
3426
+function http_style_background($img, $att = '', $size = null) {
3427
+	if ($size and is_numeric($size)) {
3428
+		$size = trim($size)."px";
3429 3429
 	}
3430
-	return " style='background" .
3431
-		($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
3430
+	return " style='background".
3431
+		($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";"
3432 3432
 		. ($size ? "background-size:{$size};" : '')
3433 3433
 		. "'";
3434 3434
 }
@@ -3445,8 +3445,8 @@  discard block
 block discarded – undo
3445 3445
  * @return string
3446 3446
  *     Code HTML de la balise IMG
3447 3447
  */
3448
-function filtre_balise_img_dist($img, $alt = "", $class = "", $width=null) {
3449
-	$atts = $class ? " class='" . attribut_html($class) . "'" : '';
3448
+function filtre_balise_img_dist($img, $alt = "", $class = "", $width = null) {
3449
+	$atts = $class ? " class='".attribut_html($class)."'" : '';
3450 3450
 	// ecriture courte : on donne le width en 2e arg
3451 3451
 	if (empty($width) and is_numeric($alt)) {
3452 3452
 		$width = $alt;
@@ -3474,7 +3474,7 @@  discard block
 block discarded – undo
3474 3474
 function filtre_balise_svg_dist($img, $alt = "", $class = "") {
3475 3475
 	$img_file = $img;
3476 3476
 	if ($p = strpos($img_file, '?')) {
3477
-		$img_file = substr($img_file,0, $p);
3477
+		$img_file = substr($img_file, 0, $p);
3478 3478
 	}
3479 3479
 
3480 3480
 	if (!$img_file or !$svg = file_get_contents($img_file)) {
@@ -3488,18 +3488,18 @@  discard block
 block discarded – undo
3488 3488
 	$balise_svg_source = $balise_svg;
3489 3489
 
3490 3490
 	// entete XML à supprimer
3491
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3491
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3492 3492
 
3493 3493
 	// IE est toujours mon ami
3494 3494
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
3495 3495
 	if ($class) {
3496 3496
 		$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3497 3497
 	}
3498
-	if ($alt){
3498
+	if ($alt) {
3499 3499
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3500
-		$id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4);
3500
+		$id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4);
3501 3501
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3502
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3502
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3503 3503
 		$balise_svg .= $title;
3504 3504
 	}
3505 3505
 	else {
@@ -3533,7 +3533,7 @@  discard block
 block discarded – undo
3533 3533
 	$texte = '';
3534 3534
 	if (is_array($tableau)) {
3535 3535
 		foreach ($tableau as $k => $v) {
3536
-			$res = recuperer_fond('modeles/' . $modele,
3536
+			$res = recuperer_fond('modeles/'.$modele,
3537 3537
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3538 3538
 			);
3539 3539
 			$texte .= $res;
@@ -3710,7 +3710,7 @@  discard block
 block discarded – undo
3710 3710
 	}
3711 3711
 
3712 3712
 	$c = serialize($c);
3713
-	$cle = calculer_cle_action($form . $c);
3713
+	$cle = calculer_cle_action($form.$c);
3714 3714
 	$c = "$cle:$c";
3715 3715
 
3716 3716
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3772,15 +3772,15 @@  discard block
 block discarded – undo
3772 3772
 	}
3773 3773
 	// toujours encoder l'url source dans le bloc ajax
3774 3774
 	$r = self();
3775
-	$r = ' data-origin="' . $r . '"';
3775
+	$r = ' data-origin="'.$r.'"';
3776 3776
 	$class = 'ajaxbloc';
3777 3777
 	if ($ajaxid and is_string($ajaxid)) {
3778 3778
 		// ajaxid est normalement conforme a un nom de classe css
3779 3779
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3780
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3780
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3781 3781
 	}
3782 3782
 
3783
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3783
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3784 3784
 }
3785 3785
 
3786 3786
 /**
@@ -3819,11 +3819,11 @@  discard block
 block discarded – undo
3819 3819
 	// extraire la signature en debut de contexte
3820 3820
 	// et la verifier avant de deserializer
3821 3821
 	// format : signature:donneesserializees
3822
-	if ($p = strpos($c,":")){
3823
-		$cle = substr($c,0,$p);
3824
-		$c = substr($c,$p+1);
3822
+	if ($p = strpos($c, ":")) {
3823
+		$cle = substr($c, 0, $p);
3824
+		$c = substr($c, $p + 1);
3825 3825
 
3826
-		if ($cle == calculer_cle_action($form . $c)) {
3826
+		if ($cle == calculer_cle_action($form.$c)) {
3827 3827
 			$env = @unserialize($c);
3828 3828
 			return $env;
3829 3829
 		}
@@ -3924,9 +3924,9 @@  discard block
 block discarded – undo
3924 3924
 	} else {
3925 3925
 		$bal = 'a';
3926 3926
 		$att = "href='$url'"
3927
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
3928
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
3929
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
3927
+			. ($title ? " title='".attribut_html($title)."'" : '')
3928
+			. ($class ? " class='".attribut_html($class)."'" : '')
3929
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
3930 3930
 			. $evt;
3931 3931
 	}
3932 3932
 	if ($libelle === null) {
@@ -4001,7 +4001,7 @@  discard block
 block discarded – undo
4001 4001
 	}
4002 4002
 
4003 4003
 	// ajouter le type d'objet dans la class de l'icone
4004
-	$class .= " " . substr(basename($fond), 0, -4);
4004
+	$class .= " ".substr(basename($fond), 0, -4);
4005 4005
 
4006 4006
 	$alt = attribut_html($texte);
4007 4007
 	$title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ?
@@ -4025,7 +4025,7 @@  discard block
 block discarded – undo
4025 4025
 	}
4026 4026
 
4027 4027
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4028
-	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>";
4028
+	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>";
4029 4029
 
4030 4030
 	if ($type == 'lien') {
4031 4031
 		return "<span class='icone s$size $class'>"
@@ -4255,13 +4255,13 @@  discard block
 block discarded – undo
4255 4255
 	$res = "";
4256 4256
 	foreach ($boutons as $page => $detail) {
4257 4257
 		if ($detail->icone and strlen(trim($detail->icone))) {
4258
-			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}";
4258
+			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}";
4259 4259
 		}
4260 4260
 		$selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones ");
4261 4261
 		if (is_array($detail->sousmenu)) {
4262 4262
 			foreach ($detail->sousmenu as $souspage => $sousdetail) {
4263 4263
 				if ($sousdetail->icone and strlen(trim($sousdetail->icone))) {
4264
-					$res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}";
4264
+					$res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}";
4265 4265
 				}
4266 4266
 			}
4267 4267
 		}
@@ -4287,17 +4287,17 @@  discard block
 block discarded – undo
4287 4287
  */
4288 4288
 function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") {
4289 4289
 	if ($confirm) {
4290
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4290
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4291 4291
 		if ($callback) {
4292 4292
 			$callback = "$confirm?($callback):false";
4293 4293
 		} else {
4294 4294
 			$callback = $confirm;
4295 4295
 		}
4296 4296
 	}
4297
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4297
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4298 4298
 	$title = $title ? " title='$title'" : "";
4299 4299
 
4300
-	return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url)
4300
+	return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url)
4301 4301
 	. "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>";
4302 4302
 }
4303 4303
 
@@ -4358,14 +4358,14 @@  discard block
 block discarded – undo
4358 4358
 		$champ_titre = "";
4359 4359
 		if ($demande_titre) {
4360 4360
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4361
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4361
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4362 4362
 		}
4363 4363
 		include_spip('base/abstract_sql');
4364 4364
 		include_spip('base/connect_sql');
4365 4365
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4366
-			'*' . $champ_titre,
4366
+			'*'.$champ_titre,
4367 4367
 			$desc['table_sql'],
4368
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4368
+			id_table_objet($type_objet).' = '.intval($id_objet)
4369 4369
 		);
4370 4370
 	}
4371 4371
 
@@ -4435,7 +4435,7 @@  discard block
 block discarded – undo
4435 4435
 		return $texte;
4436 4436
 	}
4437 4437
 
4438
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4438
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4439 4439
 
4440 4440
 	// Fournir $connect et $Pile[0] au traitement si besoin
4441 4441
 	$Pile = array(0 => $env);
@@ -4469,7 +4469,7 @@  discard block
 block discarded – undo
4469 4469
 	}
4470 4470
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4471 4471
 
4472
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4472
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4473 4473
 }
4474 4474
 
4475 4475
 
@@ -4488,10 +4488,10 @@  discard block
 block discarded – undo
4488 4488
 function wrap($texte, $wrap) {
4489 4489
 	$balises = extraire_balises($wrap);
4490 4490
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4491
-		$texte = $wrap . $texte;
4491
+		$texte = $wrap.$texte;
4492 4492
 		$regs = array_reverse($regs[1]);
4493
-		$wrap = "</" . implode("></", $regs) . ">";
4494
-		$texte = $texte . $wrap;
4493
+		$wrap = "</".implode("></", $regs).">";
4494
+		$texte = $texte.$wrap;
4495 4495
 	}
4496 4496
 
4497 4497
 	return $texte;
@@ -4522,7 +4522,7 @@  discard block
 block discarded – undo
4522 4522
 
4523 4523
 	// caster $u en array si besoin
4524 4524
 	if (is_object($u)) {
4525
-		$u = (array)$u;
4525
+		$u = (array) $u;
4526 4526
 	}
4527 4527
 
4528 4528
 	if (is_array($u)) {
@@ -4543,7 +4543,7 @@  discard block
 block discarded – undo
4543 4543
 		// sinon on passe a la ligne et on indente
4544 4544
 		$i_str = str_pad("", $indent, " ");
4545 4545
 		foreach ($u as $k => $v) {
4546
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4546
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4547 4547
 		}
4548 4548
 
4549 4549
 		return $out;
@@ -4596,8 +4596,8 @@  discard block
 block discarded – undo
4596 4596
  * @param string $class
4597 4597
  * @return string
4598 4598
  */
4599
-function objet_icone($objet, $taille = 24, $class='') {
4600
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4599
+function objet_icone($objet, $taille = 24, $class = '') {
4600
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4601 4601
 	$icone = chemin_image($icone);
4602 4602
 	$balise_img = charger_filtre('balise_img');
4603 4603
 
@@ -4621,12 +4621,12 @@  discard block
 block discarded – undo
4621 4621
  * @param array $options
4622 4622
  * @return string
4623 4623
  */
4624
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4625
-	$chaine = explode(':',$chaine);
4626
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4624
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4625
+	$chaine = explode(':', $chaine);
4626
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4627 4627
 		return $t;
4628 4628
 	}
4629
-	$chaine = implode(':',$chaine);
4629
+	$chaine = implode(':', $chaine);
4630 4630
 	return _T($chaine, $args, $options);
4631 4631
 }
4632 4632
 
@@ -4686,7 +4686,7 @@  discard block
 block discarded – undo
4686 4686
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4687 4687
 
4688 4688
 	// calculer le nom de la css
4689
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
4689
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
4690 4690
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
4691 4691
 	$contexte_implicite = calculer_contexte_implicite();
4692 4692
 
@@ -4694,22 +4694,22 @@  discard block
 block discarded – undo
4694 4694
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
4695 4695
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
4696 4696
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
4697
-		$hash = md5($contexte_implicite['host'] . '::'. $cache);
4697
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
4698 4698
 	}
4699 4699
 	else {
4700 4700
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
4701 4701
 		ksort($contexte);
4702
-		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
4702
+		$hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect);
4703 4703
 	}
4704
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
4704
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
4705 4705
 
4706 4706
 	// mettre a jour le fichier si il n'existe pas
4707 4707
 	// ou trop ancien
4708 4708
 	// le dernier fichier produit est toujours suffixe par .last
4709 4709
 	// et recopie sur le fichier cible uniquement si il change
4710 4710
 	if (!file_exists($filename)
4711
-		or !file_exists($filename . ".last")
4712
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
4711
+		or !file_exists($filename.".last")
4712
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
4713 4713
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
4714 4714
 	) {
4715 4715
 		$contenu = $cache['texte'];
@@ -4728,10 +4728,10 @@  discard block
 block discarded – undo
4728 4728
 			}
4729 4729
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
4730 4730
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
4731
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
4731
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
4732 4732
 		}
4733 4733
 		// et ecrire le fichier si il change
4734
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
4734
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
4735 4735
 	}
4736 4736
 
4737 4737
 	return timestamp($filename);
@@ -4926,11 +4926,11 @@  discard block
 block discarded – undo
4926 4926
 function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) {
4927 4927
 	$l = strlen($passe);
4928 4928
 
4929
-	if ($l<=8 or !$afficher_partiellement){
4929
+	if ($l <= 8 or !$afficher_partiellement) {
4930 4930
 		if (!$l) {
4931 4931
 			return ''; // montrer qu'il y a pas de mot de passe si il y en a pas
4932 4932
 		}
4933
-		return str_pad('',$afficher_partiellement ? $l : 16,'*');
4933
+		return str_pad('', $afficher_partiellement ? $l : 16, '*');
4934 4934
 	}
4935 4935
 
4936 4936
 	if (is_null($portion_pourcent)) {
@@ -4944,9 +4944,9 @@  discard block
 block discarded – undo
4944 4944
 	}
4945 4945
 	$e = intval(ceil($l * $portion_pourcent / 100 / 2));
4946 4946
 	$e = max($e, 0);
4947
-	$mid = str_pad('',$l-2*$e,'*');
4948
-	if ($e>0 and strlen($mid)>8){
4947
+	$mid = str_pad('', $l - 2 * $e, '*');
4948
+	if ($e > 0 and strlen($mid) > 8) {
4949 4949
 		$mid = '***...***';
4950 4950
 	}
4951
-	return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : '');
4951
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
4952 4952
 }
4953 4953
\ No newline at end of file
Please login to merge, or discard this patch.