Completed
Push — master ( be10ed...127510 )
by cam
04:28
created
ecrire/inc/filtres.php 1 patch
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	}
95 95
 
96 96
 	include_fichiers_fonctions();
97
-	foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) {
97
+	foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) {
98 98
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
99 99
 		// fonction ou name\space\fonction
100 100
 		if (is_callable($f)) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	// affichage "GIT [master: abcdef]"
188 188
 	$commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit'];
189 189
 	if ($desc['branch']) {
190
-		$commit = $desc['branch'] . ': ' . $commit;
190
+		$commit = $desc['branch'].': '.$commit;
191 191
 	}
192 192
 	return "{$desc['vcs']} [$commit]";
193 193
 }
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
 	}
207 207
 
208 208
 	// version installee par GIT
209
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
209
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
210 210
 		$currentHead = trim(substr($c, 4));
211
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
211
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
212 212
 			return [
213 213
 				'vcs' => 'GIT',
214 214
 				'branch' => basename($currentHead),
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 		$dir = '.';
236 236
 	}
237 237
 	// version installee par SVN
238
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
239
-		$db = new SQLite3($dir . '/.svn/wc.db');
238
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
239
+		$db = new SQLite3($dir.'/.svn/wc.db');
240 240
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
241 241
 		if ($result) {
242 242
 			$row = $result->fetchArray();
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
 
276 276
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
277 277
 // et laisser passer les fonctions personnelles baptisees image_...
278
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
279
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
280
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
281
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
282
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
278
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
279
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
280
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
281
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
282
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
283 283
 
284 284
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
285 285
 $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php';
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
  */
437 437
 function filtre_debug($val, $key = null) {
438 438
 	$debug = (
439
-		is_null($key) ? '' : (var_export($key, true) . " = ")
440
-		) . var_export($val, true);
439
+		is_null($key) ? '' : (var_export($key, true)." = ")
440
+		).var_export($val, true);
441 441
 
442 442
 	include_spip('inc/autoriser');
443 443
 	if (autoriser('webmestre')) {
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
537 537
 							$srcover = $match[1];
538 538
 							array_shift($args);
539
-							array_unshift($args, "<img src='" . $match[1] . "' />");
539
+							array_unshift($args, "<img src='".$match[1]."' />");
540 540
 							$srcover_filter = call_user_func_array($filtre, $args);
541 541
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
542 542
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 	// " -> &quot; et tout ce genre de choses
887 887
 	$u = $GLOBALS['meta']['pcre_u'];
888 888
 	$texte = str_replace("&nbsp;", " ", $texte);
889
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
889
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
890 890
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
891 891
 	$texte = entites_html($texte, false, false);
892 892
 	// mais bien echapper les double quotes !
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
  **/
947 947
 function supprimer_numero($texte) {
948 948
 	return preg_replace(
949
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
949
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
950 950
 		"", $texte);
951 951
 }
952 952
 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
  **/
972 972
 function recuperer_numero($texte) {
973 973
 	if (preg_match(
974
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
974
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
975 975
 		$texte, $regs)) {
976 976
 		return strval($regs[1]);
977 977
 	} else {
@@ -1056,8 +1056,8 @@  discard block
 block discarded – undo
1056 1056
  **/
1057 1057
 function textebrut($texte) {
1058 1058
 	$u = $GLOBALS['meta']['pcre_u'];
1059
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
1060
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
1059
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
1060
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
1061 1061
 	$texte = preg_replace("/^\n+/", "", $texte);
1062 1062
 	$texte = preg_replace("/\n+$/", "", $texte);
1063 1063
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1086 1086
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1087 1087
 		foreach ($liens[0] as $a) {
1088
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1088
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1089 1089
 			$ablank = inserer_attribut($a, 'rel', $rel);
1090 1090
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1091 1091
 			$texte = str_replace($a, $ablank, $texte);
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		foreach ($regs[0] as $a) {
1111 1111
 			$rel = extraire_attribut($a, "rel");
1112 1112
 			if (strpos($rel, "nofollow") === false) {
1113
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1113
+				$rel = "nofollow".($rel ? " $rel" : "");
1114 1114
 				$anofollow = inserer_attribut($a, "rel", $rel);
1115 1115
 				$texte = str_replace($a, $anofollow, $texte);
1116 1116
 			}
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 	$u = $GLOBALS['meta']['pcre_u'];
1140 1140
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1141 1141
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1142
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1142
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1143 1143
 
1144 1144
 	return $texte;
1145 1145
 }
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 		return $texte;
1170 1170
 	}
1171 1171
 	include_spip('inc/texte');
1172
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1172
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1173 1173
 		'div' : 'span';
1174 1174
 
1175 1175
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 function attribut_html($texte, $textebrut = true) {
1279 1279
 	$u = $GLOBALS['meta']['pcre_u'];
1280 1280
 	if ($textebrut) {
1281
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1281
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1282 1282
 	}
1283 1283
 	$texte = texte_backend($texte);
1284 1284
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 	# un message pour abs_url
1308 1308
 	$GLOBALS['mode_abs_url'] = 'url';
1309 1309
 	$url = trim($url);
1310
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1310
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1311 1311
 
1312 1312
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1313 1313
 }
@@ -1509,14 +1509,14 @@  discard block
 block discarded – undo
1509 1509
 	if (strpos($texte, "<") !== false) {
1510 1510
 		include_spip('inc/lien');
1511 1511
 		if (defined('_PREG_MODELE')) {
1512
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1512
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1513 1513
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1514 1514
 		}
1515 1515
 	}
1516 1516
 
1517 1517
 	$debut = '';
1518 1518
 	$suite = $texte;
1519
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1519
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1520 1520
 		$debut .= substr($suite, 0, $t - 1);
1521 1521
 		$suite = substr($suite, $t);
1522 1522
 		$car = substr($suite, 0, 1);
@@ -1533,11 +1533,11 @@  discard block
 block discarded – undo
1533 1533
 			$suite = substr($suite, strlen($regs[0]));
1534 1534
 		}
1535 1535
 	}
1536
-	$texte = $debut . $suite;
1536
+	$texte = $debut.$suite;
1537 1537
 
1538 1538
 	$texte = echappe_retour($texte);
1539 1539
 
1540
-	return $texte . $fin;
1540
+	return $texte.$fin;
1541 1541
 }
1542 1542
 
1543 1543
 
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 		}
1599 1599
 
1600 1600
 		foreach ($regs as $reg) {
1601
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1601
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1602 1602
 			$desc = $traduire($cle, $lang, true);
1603 1603
 			$l = $desc->langue;
1604 1604
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1712 1712
 					include_spip('inc/texte');
1713 1713
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1714
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1714
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1715 1715
 					$trad = code_echappement($trad, 'multi', false, $mode);
1716 1716
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
1717 1717
 					if (lang_dir($l) !== lang_dir($lang)) {
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
 	if (is_array($balise)) {
1905 1905
 		array_walk(
1906 1906
 			$balise,
1907
-			function(&$a, $key, $t){
1907
+			function(&$a, $key, $t) {
1908 1908
 				$a = extraire_attribut($a, $t);
1909 1909
 			},
1910 1910
 			$attribut
@@ -1991,14 +1991,14 @@  discard block
 block discarded – undo
1991 1991
 
1992 1992
 	if ($old !== null) {
1993 1993
 		// Remplacer l'ancien attribut du meme nom
1994
-		$balise = $r[1] . $insert . $r[5];
1994
+		$balise = $r[1].$insert.$r[5];
1995 1995
 	} else {
1996 1996
 		// preferer une balise " />" (comme <img />)
1997 1997
 		if (preg_match(',/>,', $balise)) {
1998
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
1998
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
1999 1999
 		} // sinon une balise <a ...> ... </a>
2000 2000
 		else {
2001
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
2001
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
2002 2002
 		}
2003 2003
 	}
2004 2004
 
@@ -2031,7 +2031,7 @@  discard block
 block discarded – undo
2031 2031
  * @param string $operation
2032 2032
  * @return string
2033 2033
  */
2034
-function modifier_class($balise, $class, $operation='ajouter') {
2034
+function modifier_class($balise, $class, $operation = 'ajouter') {
2035 2035
 	if (is_string($class)) {
2036 2036
 		$class = explode(' ', trim($class));
2037 2037
 	}
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 				}
2057 2057
 				if (in_array($operation, ['ajouter', 'commuter'])
2058 2058
 					and !$is_class_presente) {
2059
-					$class_new = rtrim($class_new) . " " . $c;
2059
+					$class_new = rtrim($class_new)." ".$c;
2060 2060
 				}
2061 2061
 				elseif (in_array($operation, ['supprimer', 'commuter'])
2062 2062
 					and $is_class_presente) {
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
  * @param string|array $class
2085 2085
  * @return string
2086 2086
  */
2087
-function ajouter_class($balise, $class){
2087
+function ajouter_class($balise, $class) {
2088 2088
 	return modifier_class($balise, $class, 'ajouter');
2089 2089
 }
2090 2090
 
@@ -2094,7 +2094,7 @@  discard block
 block discarded – undo
2094 2094
  * @param string|array $class
2095 2095
  * @return string
2096 2096
  */
2097
-function supprimer_class($balise, $class){
2097
+function supprimer_class($balise, $class) {
2098 2098
 	return modifier_class($balise, $class, 'supprimer');
2099 2099
 }
2100 2100
 
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
  * @param string|array $class
2106 2106
  * @return string
2107 2107
  */
2108
-function commuter_class($balise, $class){
2108
+function commuter_class($balise, $class) {
2109 2109
 	return modifier_class($balise, $class, 'commuter');
2110 2110
 }
2111 2111
 
@@ -2125,8 +2125,8 @@  discard block
 block discarded – undo
2125 2125
 //
2126 2126
 // Quelques fonctions de calcul arithmetique
2127 2127
 //
2128
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
2129
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
2128
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
2129
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
2130 2130
 
2131 2131
 /**
2132 2132
  * Additionne 2 nombres
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 function plus($a, $b) {
2147 2147
 	return $a + $b;
2148 2148
 }
2149
-function strplus($a, $b) {return strize('plus', $a, $b);}
2149
+function strplus($a, $b) {return strize('plus', $a, $b); }
2150 2150
 /**
2151 2151
  * Soustrait 2 nombres
2152 2152
  *
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
 function moins($a, $b) {
2166 2166
 	return $a - $b;
2167 2167
 }
2168
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2168
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2169 2169
 
2170 2170
 /**
2171 2171
  * Multiplie 2 nombres
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 function mult($a, $b) {
2187 2187
 	return $a * $b;
2188 2188
 }
2189
-function strmult($a, $b) {return strize('mult', $a, $b);}
2189
+function strmult($a, $b) {return strize('mult', $a, $b); }
2190 2190
 
2191 2191
 /**
2192 2192
  * Divise 2 nombres
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
 function div($a, $b) {
2208 2208
 	return $b ? $a / $b : 0;
2209 2209
 }
2210
-function strdiv($a, $b) {return strize('div', $a, $b);}
2210
+function strdiv($a, $b) {return strize('div', $a, $b); }
2211 2211
 
2212 2212
 /**
2213 2213
  * Retourne le modulo 2 nombres
@@ -2248,13 +2248,13 @@  discard block
 block discarded – undo
2248 2248
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2249 2249
 		define('_TAGS_NOM_AUTEUR', '');
2250 2250
 	}
2251
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2251
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2252 2252
 	foreach ($tags_acceptes as $tag) {
2253 2253
 		if (strlen($tag)) {
2254
-			$remp1[] = '<' . trim($tag) . '>';
2255
-			$remp1[] = '</' . trim($tag) . '>';
2256
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2257
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2254
+			$remp1[] = '<'.trim($tag).'>';
2255
+			$remp1[] = '</'.trim($tag).'>';
2256
+			$remp2[] = '\x60'.trim($tag).'\x61';
2257
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2258 2258
 		}
2259 2259
 	}
2260 2260
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 			$s[] = preg_replace(',>[^<]+</a>,S',
2305 2305
 				'>'
2306 2306
 				. http_img_pack('attachment-16.png', $t,
2307
-					'title="' . attribut_html($t) . '"')
2307
+					'title="'.attribut_html($t).'"')
2308 2308
 				. '</a>', $tag);
2309 2309
 		}
2310 2310
 	}
@@ -2365,10 +2365,10 @@  discard block
 block discarded – undo
2365 2365
 	$fichier = basename($url);
2366 2366
 
2367 2367
 	return '<a rel="enclosure"'
2368
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2369
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2370
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2371
-	. '>' . $fichier . '</a>';
2368
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2369
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2370
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2371
+	. '>'.$fichier.'</a>';
2372 2372
 }
2373 2373
 
2374 2374
 /**
@@ -2396,9 +2396,9 @@  discard block
 block discarded – undo
2396 2396
 			} # vieux data
2397 2397
 			$fichier = basename($url);
2398 2398
 			$enclosures[] = '<enclosure'
2399
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2400
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2401
-				. ($length ? ' length="' . $length . '"' : '')
2399
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2400
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2401
+				. ($length ? ' length="'.$length.'"' : '')
2402 2402
 				. ' />';
2403 2403
 		}
2404 2404
 	}
@@ -2424,7 +2424,7 @@  discard block
 block discarded – undo
2424 2424
 		if (extraire_attribut($e, rel) == 'tag') {
2425 2425
 			$subjects .= '<dc:subject>'
2426 2426
 				. texte_backend(textebrut($e))
2427
-				. '</dc:subject>' . "\n";
2427
+				. '</dc:subject>'."\n";
2428 2428
 		}
2429 2429
 	}
2430 2430
 
@@ -2460,7 +2460,7 @@  discard block
 block discarded – undo
2460 2460
 	if (is_array($texte)) {
2461 2461
 		array_walk(
2462 2462
 			$texte,
2463
-			function(&$a, $key, $t){
2463
+			function(&$a, $key, $t) {
2464 2464
 				$a = extraire_balise($a, $t);
2465 2465
 			},
2466 2466
 			$tag
@@ -2504,7 +2504,7 @@  discard block
 block discarded – undo
2504 2504
 	if (is_array($texte)) {
2505 2505
 		array_walk(
2506 2506
 			$texte,
2507
-			function(&$a, $key, $t){
2507
+			function(&$a, $key, $t) {
2508 2508
 				$a = extraire_balises($a, $t);
2509 2509
 			},
2510 2510
 			$tag
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
 		if ($fond != '404') {
2631 2631
 			$contexte = array_shift($p);
2632 2632
 			$contexte['page'] = $fond;
2633
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2633
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2634 2634
 		}
2635 2635
 	}
2636 2636
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2685,9 +2685,9 @@  discard block
 block discarded – undo
2685 2685
 			. '"'
2686 2686
 			. (is_null($val)
2687 2687
 				? ''
2688
-				: ' value="' . entites_html($val) . '"'
2688
+				: ' value="'.entites_html($val).'"'
2689 2689
 			)
2690
-			. ' type="hidden"' . "\n/>";
2690
+			. ' type="hidden"'."\n/>";
2691 2691
 	}
2692 2692
 
2693 2693
 	return join("", $hidden);
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
 	return preg_replace_callback(
2825 2825
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2826 2826
 		function($x) use ($path) {
2827
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2827
+			return "url('".suivre_lien($path, $x[1])."')";
2828 2828
 		},
2829 2829
 		$contenu
2830 2830
 	);
@@ -2886,14 +2886,14 @@  discard block
 block discarded – undo
2886 2886
 	) {
2887 2887
 		$distant = true;
2888 2888
 		$cssf = parse_url($css);
2889
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2889
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2890 2890
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2891 2891
 	} else {
2892 2892
 		$distant = false;
2893 2893
 		$cssf = $css;
2894 2894
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2895 2895
 		//propose (rien a faire dans ce cas)
2896
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2896
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2897 2897
 		if (@file_exists($f)) {
2898 2898
 			return $f;
2899 2899
 		}
@@ -2903,7 +2903,7 @@  discard block
 block discarded – undo
2903 2903
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2904 2904
 	$f = $dir_var
2905 2905
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2906
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2906
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2907 2907
 
2908 2908
 	// la css peut etre distante (url absolue !)
2909 2909
 	if ($distant) {
@@ -2948,8 +2948,8 @@  discard block
 block discarded – undo
2948 2948
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2949 2949
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2950 2950
 			$css_direction = substr($css_direction, strlen($dir_var));
2951
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2952
-			$css_direction = "/@@@@@@/" . $css_direction;
2951
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2952
+			$css_direction = "/@@@@@@/".$css_direction;
2953 2953
 		}
2954 2954
 		$src[] = $regs[0][$k];
2955 2955
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -2998,7 +2998,7 @@  discard block
 block discarded – undo
2998 2998
 
2999 2999
 	$f = basename($css, '.css');
3000 3000
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3001
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3001
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3002 3002
 		. '.css';
3003 3003
 
3004 3004
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3007,7 +3007,7 @@  discard block
 block discarded – undo
3007 3007
 
3008 3008
 	if ($url_absolue_css == $css) {
3009 3009
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3010
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3010
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3011 3011
 		) {
3012 3012
 			include_spip('inc/distant');
3013 3013
 			if (!$contenu = recuperer_page($css)) {
@@ -3117,7 +3117,7 @@  discard block
 block discarded – undo
3117 3117
 	$expression = str_replace("\/", "/", $expression);
3118 3118
 	$expression = str_replace("/", "\/", $expression);
3119 3119
 
3120
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3120
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3121 3121
 		if (isset($r[$capte])) {
3122 3122
 			return $r[$capte];
3123 3123
 		} else {
@@ -3155,7 +3155,7 @@  discard block
 block discarded – undo
3155 3155
 	$expression = str_replace("\/", "/", $expression);
3156 3156
 	$expression = str_replace("/", "\/", $expression);
3157 3157
 
3158
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3158
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3159 3159
 }
3160 3160
 
3161 3161
 
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
 function traiter_doublons_documents(&$doublons, $letexte) {
3175 3175
 
3176 3176
 	// Verifier dans le texte & les notes (pas beau, helas)
3177
-	$t = $letexte . $GLOBALS['les_notes'];
3177
+	$t = $letexte.$GLOBALS['les_notes'];
3178 3178
 
3179 3179
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3180 3180
 		and preg_match_all(
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
 		if (!isset($doublons['documents'])) {
3185 3185
 			$doublons['documents'] = "";
3186 3186
 		}
3187
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3187
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3188 3188
 	}
3189 3189
 
3190 3190
 	return $letexte;
@@ -3241,7 +3241,7 @@  discard block
 block discarded – undo
3241 3241
 	if ($env) {
3242 3242
 		foreach ($env as $i => $j) {
3243 3243
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3244
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3244
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3245 3245
 			}
3246 3246
 		}
3247 3247
 	}
@@ -3280,7 +3280,7 @@  discard block
 block discarded – undo
3280 3280
 	if ($env) {
3281 3281
 		foreach ($env as $i => $j) {
3282 3282
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3283
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3283
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3284 3284
 			}
3285 3285
 		}
3286 3286
 	}
@@ -3364,19 +3364,19 @@  discard block
 block discarded – undo
3364 3364
 
3365 3365
 	$img_file = $img;
3366 3366
 	if ($p = strpos($img_file, '?')) {
3367
-		$img_file = substr($img_file,0, $p);
3367
+		$img_file = substr($img_file, 0, $p);
3368 3368
 	}
3369 3369
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3370 3370
 		$img_file = chemin_image($img);
3371 3371
 	}
3372 3372
 	else {
3373
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3373
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3374 3374
 			// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3375 3375
 			// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3376 3376
 			if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3377
-			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3377
+			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3378 3378
 			  and file_exists($variante_svg_generique)) {
3379
-				if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3379
+				if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) {
3380 3380
 					$img_file = $variante_svg_size;
3381 3381
 				}
3382 3382
 				else {
@@ -3401,7 +3401,7 @@  discard block
 block discarded – undo
3401 3401
 				return "";
3402 3402
 			}
3403 3403
 		}
3404
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3404
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3405 3405
 	}
3406 3406
 
3407 3407
 	if (file_exists($img_file)) {
@@ -3410,15 +3410,15 @@  discard block
 block discarded – undo
3410 3410
 	if ($alt === false) {
3411 3411
 		$alt = '';
3412 3412
 	}
3413
-	elseif($alt or $alt==='') {
3413
+	elseif ($alt or $alt === '') {
3414 3414
 		$alt = " alt='".attribut_html($alt)."'";
3415 3415
 	}
3416 3416
 	else {
3417 3417
 		$alt = " alt='".attribut_html($title)."'";
3418 3418
 	}
3419 3419
 	return "<img src='$img_file'$alt"
3420
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3421
-	. " " . ltrim($atts)
3420
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3421
+	. " ".ltrim($atts)
3422 3422
 	. " />";
3423 3423
 }
3424 3424
 
@@ -3430,12 +3430,12 @@  discard block
 block discarded – undo
3430 3430
  * @param string $size
3431 3431
  * @return string
3432 3432
  */
3433
-function http_style_background($img, $att = '', $size=null) {
3434
-	if ($size and is_numeric($size)){
3435
-		$size = trim($size) . "px";
3433
+function http_style_background($img, $att = '', $size = null) {
3434
+	if ($size and is_numeric($size)) {
3435
+		$size = trim($size)."px";
3436 3436
 	}
3437
-	return " style='background" .
3438
-		($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
3437
+	return " style='background".
3438
+		($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";"
3439 3439
 		. ($size ? "background-size:{$size};" : '')
3440 3440
 		. "'";
3441 3441
 }
@@ -3452,8 +3452,8 @@  discard block
 block discarded – undo
3452 3452
  * @return string
3453 3453
  *     Code HTML de la balise IMG
3454 3454
  */
3455
-function filtre_balise_img_dist($img, $alt = "", $class = "", $width=null) {
3456
-	$atts = $class ? " class='" . attribut_html($class) . "'" : '';
3455
+function filtre_balise_img_dist($img, $alt = "", $class = "", $width = null) {
3456
+	$atts = $class ? " class='".attribut_html($class)."'" : '';
3457 3457
 	// ecriture courte : on donne le width en 2e arg
3458 3458
 	if (empty($width) and is_numeric($alt)) {
3459 3459
 		$width = $alt;
@@ -3481,7 +3481,7 @@  discard block
 block discarded – undo
3481 3481
 function filtre_balise_svg_dist($img, $alt = "", $class = "") {
3482 3482
 	$img_file = $img;
3483 3483
 	if ($p = strpos($img_file, '?')) {
3484
-		$img_file = substr($img_file,0, $p);
3484
+		$img_file = substr($img_file, 0, $p);
3485 3485
 	}
3486 3486
 
3487 3487
 	if (!$img_file or !$svg = file_get_contents($img_file)) {
@@ -3495,18 +3495,18 @@  discard block
 block discarded – undo
3495 3495
 	$balise_svg_source = $balise_svg;
3496 3496
 
3497 3497
 	// entete XML à supprimer
3498
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3498
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3499 3499
 
3500 3500
 	// IE est toujours mon ami
3501 3501
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
3502 3502
 	if ($class) {
3503 3503
 		$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3504 3504
 	}
3505
-	if ($alt){
3505
+	if ($alt) {
3506 3506
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3507
-		$id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4);
3507
+		$id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4);
3508 3508
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3509
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3509
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3510 3510
 		$balise_svg .= $title;
3511 3511
 	}
3512 3512
 	else {
@@ -3540,7 +3540,7 @@  discard block
 block discarded – undo
3540 3540
 	$texte = '';
3541 3541
 	if (is_array($tableau)) {
3542 3542
 		foreach ($tableau as $k => $v) {
3543
-			$res = recuperer_fond('modeles/' . $modele,
3543
+			$res = recuperer_fond('modeles/'.$modele,
3544 3544
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3545 3545
 			);
3546 3546
 			$texte .= $res;
@@ -3717,7 +3717,7 @@  discard block
 block discarded – undo
3717 3717
 	}
3718 3718
 
3719 3719
 	$c = serialize($c);
3720
-	$cle = calculer_cle_action($form . $c);
3720
+	$cle = calculer_cle_action($form.$c);
3721 3721
 	$c = "$cle:$c";
3722 3722
 
3723 3723
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3779,15 +3779,15 @@  discard block
 block discarded – undo
3779 3779
 	}
3780 3780
 	// toujours encoder l'url source dans le bloc ajax
3781 3781
 	$r = self();
3782
-	$r = ' data-origin="' . $r . '"';
3782
+	$r = ' data-origin="'.$r.'"';
3783 3783
 	$class = 'ajaxbloc';
3784 3784
 	if ($ajaxid and is_string($ajaxid)) {
3785 3785
 		// ajaxid est normalement conforme a un nom de classe css
3786 3786
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3787
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3787
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3788 3788
 	}
3789 3789
 
3790
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3790
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3791 3791
 }
3792 3792
 
3793 3793
 /**
@@ -3826,11 +3826,11 @@  discard block
 block discarded – undo
3826 3826
 	// extraire la signature en debut de contexte
3827 3827
 	// et la verifier avant de deserializer
3828 3828
 	// format : signature:donneesserializees
3829
-	if ($p = strpos($c,":")){
3830
-		$cle = substr($c,0,$p);
3831
-		$c = substr($c,$p+1);
3829
+	if ($p = strpos($c, ":")) {
3830
+		$cle = substr($c, 0, $p);
3831
+		$c = substr($c, $p + 1);
3832 3832
 
3833
-		if ($cle == calculer_cle_action($form . $c)) {
3833
+		if ($cle == calculer_cle_action($form.$c)) {
3834 3834
 			$env = @unserialize($c);
3835 3835
 			return $env;
3836 3836
 		}
@@ -3936,24 +3936,24 @@  discard block
 block discarded – undo
3936 3936
 		$att = "";
3937 3937
 		// si $on passe la balise et optionnelement une ou ++classe
3938 3938
 		// a.active span.selected.active etc....
3939
-		if (is_string($on) and (strncmp($on, 'a', 1)==0 or strncmp($on, 'span', 4)==0 or strncmp($on, 'strong', 6)==0)){
3939
+		if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) {
3940 3940
 			$on = explode(".", $on);
3941 3941
 			// on verifie que c'est exactement une des 3 balises a, span ou strong
3942
-			if (in_array(reset($on), array('a', 'span', 'strong'))){
3942
+			if (in_array(reset($on), array('a', 'span', 'strong'))) {
3943 3943
 				$bal = array_shift($on);
3944 3944
 				$class = implode(" ", $on);
3945
-				if ($bal=="a"){
3945
+				if ($bal == "a") {
3946 3946
 					$att = 'href="#" ';
3947 3947
 				}
3948 3948
 			}
3949 3949
 		}
3950
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
3950
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
3951 3951
 	} else {
3952 3952
 		$bal = 'a';
3953 3953
 		$att = "href='$url'"
3954
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
3955
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
3956
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
3954
+			. ($title ? " title='".attribut_html($title)."'" : '')
3955
+			. ($class ? " class='".attribut_html($class)."'" : '')
3956
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
3957 3957
 			. $evt;
3958 3958
 	}
3959 3959
 	if ($libelle === null) {
@@ -4047,7 +4047,7 @@  discard block
 block discarded – undo
4047 4047
 	}
4048 4048
 
4049 4049
 	// ajouter le type d'objet dans la class de l'icone
4050
-	$class .= " " . substr(basename($fond), 0, -4);
4050
+	$class .= " ".substr(basename($fond), 0, -4);
4051 4051
 
4052 4052
 	$alt = attribut_html($texte);
4053 4053
 	$title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ?
@@ -4071,7 +4071,7 @@  discard block
 block discarded – undo
4071 4071
 	}
4072 4072
 
4073 4073
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4074
-	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>";
4074
+	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>";
4075 4075
 
4076 4076
 	if ($type == 'lien') {
4077 4077
 		return "<span class='icone s$size $class'>"
@@ -4301,13 +4301,13 @@  discard block
 block discarded – undo
4301 4301
 	$res = "";
4302 4302
 	foreach ($boutons as $page => $detail) {
4303 4303
 		if ($detail->icone and strlen(trim($detail->icone))) {
4304
-			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}";
4304
+			$res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}";
4305 4305
 		}
4306 4306
 		$selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones ");
4307 4307
 		if (is_array($detail->sousmenu)) {
4308 4308
 			foreach ($detail->sousmenu as $souspage => $sousdetail) {
4309 4309
 				if ($sousdetail->icone and strlen(trim($sousdetail->icone))) {
4310
-					$res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}";
4310
+					$res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}";
4311 4311
 				}
4312 4312
 			}
4313 4313
 		}
@@ -4333,17 +4333,17 @@  discard block
 block discarded – undo
4333 4333
  */
4334 4334
 function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") {
4335 4335
 	if ($confirm) {
4336
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4336
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4337 4337
 		if ($callback) {
4338 4338
 			$callback = "$confirm?($callback):false";
4339 4339
 		} else {
4340 4340
 			$callback = $confirm;
4341 4341
 		}
4342 4342
 	}
4343
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4343
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4344 4344
 	$title = $title ? " title='$title'" : "";
4345 4345
 
4346
-	return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url)
4346
+	return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url)
4347 4347
 	. "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>";
4348 4348
 }
4349 4349
 
@@ -4404,14 +4404,14 @@  discard block
 block discarded – undo
4404 4404
 		$champ_titre = "";
4405 4405
 		if ($demande_titre) {
4406 4406
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4407
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4407
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4408 4408
 		}
4409 4409
 		include_spip('base/abstract_sql');
4410 4410
 		include_spip('base/connect_sql');
4411 4411
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4412
-			'*' . $champ_titre,
4412
+			'*'.$champ_titre,
4413 4413
 			$desc['table_sql'],
4414
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4414
+			id_table_objet($type_objet).' = '.intval($id_objet)
4415 4415
 		);
4416 4416
 	}
4417 4417
 
@@ -4481,7 +4481,7 @@  discard block
 block discarded – undo
4481 4481
 		return $texte;
4482 4482
 	}
4483 4483
 
4484
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4484
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4485 4485
 
4486 4486
 	// Fournir $connect et $Pile[0] au traitement si besoin
4487 4487
 	$Pile = array(0 => $env);
@@ -4515,7 +4515,7 @@  discard block
 block discarded – undo
4515 4515
 	}
4516 4516
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4517 4517
 
4518
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4518
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4519 4519
 }
4520 4520
 
4521 4521
 
@@ -4534,10 +4534,10 @@  discard block
 block discarded – undo
4534 4534
 function wrap($texte, $wrap) {
4535 4535
 	$balises = extraire_balises($wrap);
4536 4536
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4537
-		$texte = $wrap . $texte;
4537
+		$texte = $wrap.$texte;
4538 4538
 		$regs = array_reverse($regs[1]);
4539
-		$wrap = "</" . implode("></", $regs) . ">";
4540
-		$texte = $texte . $wrap;
4539
+		$wrap = "</".implode("></", $regs).">";
4540
+		$texte = $texte.$wrap;
4541 4541
 	}
4542 4542
 
4543 4543
 	return $texte;
@@ -4568,7 +4568,7 @@  discard block
 block discarded – undo
4568 4568
 
4569 4569
 	// caster $u en array si besoin
4570 4570
 	if (is_object($u)) {
4571
-		$u = (array)$u;
4571
+		$u = (array) $u;
4572 4572
 	}
4573 4573
 
4574 4574
 	if (is_array($u)) {
@@ -4589,7 +4589,7 @@  discard block
 block discarded – undo
4589 4589
 		// sinon on passe a la ligne et on indente
4590 4590
 		$i_str = str_pad("", $indent, " ");
4591 4591
 		foreach ($u as $k => $v) {
4592
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4592
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4593 4593
 		}
4594 4594
 
4595 4595
 		return $out;
@@ -4642,8 +4642,8 @@  discard block
 block discarded – undo
4642 4642
  * @param string $class
4643 4643
  * @return string
4644 4644
  */
4645
-function objet_icone($objet, $taille = 24, $class='') {
4646
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4645
+function objet_icone($objet, $taille = 24, $class = '') {
4646
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4647 4647
 	$icone = chemin_image($icone);
4648 4648
 	$balise_img = charger_filtre('balise_img');
4649 4649
 
@@ -4667,12 +4667,12 @@  discard block
 block discarded – undo
4667 4667
  * @param array $options
4668 4668
  * @return string
4669 4669
  */
4670
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4671
-	$chaine = explode(':',$chaine);
4672
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4670
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4671
+	$chaine = explode(':', $chaine);
4672
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4673 4673
 		return $t;
4674 4674
 	}
4675
-	$chaine = implode(':',$chaine);
4675
+	$chaine = implode(':', $chaine);
4676 4676
 	return _T($chaine, $args, $options);
4677 4677
 }
4678 4678
 
@@ -4732,7 +4732,7 @@  discard block
 block discarded – undo
4732 4732
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4733 4733
 
4734 4734
 	// calculer le nom de la css
4735
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
4735
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
4736 4736
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
4737 4737
 	$contexte_implicite = calculer_contexte_implicite();
4738 4738
 
@@ -4740,22 +4740,22 @@  discard block
 block discarded – undo
4740 4740
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
4741 4741
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
4742 4742
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
4743
-		$hash = md5($contexte_implicite['host'] . '::'. $cache);
4743
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
4744 4744
 	}
4745 4745
 	else {
4746 4746
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
4747 4747
 		ksort($contexte);
4748
-		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
4748
+		$hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect);
4749 4749
 	}
4750
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
4750
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
4751 4751
 
4752 4752
 	// mettre a jour le fichier si il n'existe pas
4753 4753
 	// ou trop ancien
4754 4754
 	// le dernier fichier produit est toujours suffixe par .last
4755 4755
 	// et recopie sur le fichier cible uniquement si il change
4756 4756
 	if (!file_exists($filename)
4757
-		or !file_exists($filename . ".last")
4758
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
4757
+		or !file_exists($filename.".last")
4758
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
4759 4759
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
4760 4760
 	) {
4761 4761
 		$contenu = $cache['texte'];
@@ -4774,10 +4774,10 @@  discard block
 block discarded – undo
4774 4774
 			}
4775 4775
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
4776 4776
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
4777
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
4777
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
4778 4778
 		}
4779 4779
 		// et ecrire le fichier si il change
4780
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
4780
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
4781 4781
 	}
4782 4782
 
4783 4783
 	return timestamp($filename);
@@ -4972,11 +4972,11 @@  discard block
 block discarded – undo
4972 4972
 function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) {
4973 4973
 	$l = strlen($passe);
4974 4974
 
4975
-	if ($l<=8 or !$afficher_partiellement){
4975
+	if ($l <= 8 or !$afficher_partiellement) {
4976 4976
 		if (!$l) {
4977 4977
 			return ''; // montrer qu'il y a pas de mot de passe si il y en a pas
4978 4978
 		}
4979
-		return str_pad('',$afficher_partiellement ? $l : 16,'*');
4979
+		return str_pad('', $afficher_partiellement ? $l : 16, '*');
4980 4980
 	}
4981 4981
 
4982 4982
 	if (is_null($portion_pourcent)) {
@@ -4990,9 +4990,9 @@  discard block
 block discarded – undo
4990 4990
 	}
4991 4991
 	$e = intval(ceil($l * $portion_pourcent / 100 / 2));
4992 4992
 	$e = max($e, 0);
4993
-	$mid = str_pad('',$l-2*$e,'*');
4994
-	if ($e>0 and strlen($mid)>8){
4993
+	$mid = str_pad('', $l - 2 * $e, '*');
4994
+	if ($e > 0 and strlen($mid) > 8) {
4995 4995
 		$mid = '***...***';
4996 4996
 	}
4997
-	return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : '');
4997
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
4998 4998
 }
4999 4999
\ No newline at end of file
Please login to merge, or discard this patch.