Completed
Push — master ( 1dde8c...5a052b )
by cam
01:06
created
ecrire/inc/filtres.php 2 patches
Spacing   +167 added lines, -168 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)) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	// affichage "GIT [master: abcdef]"
222 222
 	$commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit'];
223 223
 	if ($desc['branch']) {
224
-		$commit = $desc['branch'] . ': ' . $commit;
224
+		$commit = $desc['branch'].': '.$commit;
225 225
 	}
226 226
 	return "{$desc['vcs']} [$commit]";
227 227
 }
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 	}
241 241
 
242 242
 	// version installee par GIT
243
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
243
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
244 244
 		$currentHead = trim(substr($c, 4));
245
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
245
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
246 246
 			return [
247 247
 				'vcs' => 'GIT',
248 248
 				'branch' => basename($currentHead),
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 		$dir = '.';
270 270
 	}
271 271
 	// version installee par SVN
272
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
273
-		$db = new SQLite3($dir . '/.svn/wc.db');
272
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
273
+		$db = new SQLite3($dir.'/.svn/wc.db');
274 274
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
275 275
 		if ($result) {
276 276
 			$row = $result->fetchArray();
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
 
289 289
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
290 290
 // et laisser passer les fonctions personnelles baptisees image_...
291
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
292
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
293
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
294
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
295
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
296
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
291
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
292
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
293
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
294
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
295
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
296
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
297 297
 
298 298
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
299 299
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function filtre_debug($val, $key = null) {
454 454
 	$debug = (
455
-		is_null($key) ? '' : (var_export($key, true) . " = ")
456
-		) . var_export($val, true);
455
+		is_null($key) ? '' : (var_export($key, true)." = ")
456
+		).var_export($val, true);
457 457
 
458 458
 	include_spip('inc/autoriser');
459 459
 	if (autoriser('webmestre')) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
553 553
 							$srcover = $match[1];
554 554
 							array_shift($args);
555
-							array_unshift($args, "<img src='" . $match[1] . "' />");
555
+							array_unshift($args, "<img src='".$match[1]."' />");
556 556
 							$srcover_filter = call_user_func_array($filtre, $args);
557 557
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
558 558
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -623,14 +623,14 @@  discard block
 block discarded – undo
623 623
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
624 624
 			}
625 625
 		}
626
-		elseif(strpos($src, "<svg") !== false) {
626
+		elseif (strpos($src, "<svg") !== false) {
627 627
 			include_spip('inc/svg');
628
-			if ($attrs = svg_lire_attributs($src)){
628
+			if ($attrs = svg_lire_attributs($src)) {
629 629
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
630
-				if (!$srcWidth){
630
+				if (!$srcWidth) {
631 631
 					$largeur_img[$src] = $srcWidth = $width;
632 632
 				}
633
-				if (!$srcHeight){
633
+				if (!$srcHeight) {
634 634
 					$hauteur_img[$src] = $srcHeight = $height;
635 635
 				}
636 636
 			}
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	// " -> &quot; et tout ce genre de choses
915 915
 	$u = $GLOBALS['meta']['pcre_u'];
916 916
 	$texte = str_replace("&nbsp;", " ", $texte);
917
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
917
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
918 918
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
919 919
 	$texte = entites_html($texte, false, false);
920 920
 	// mais bien echapper les double quotes !
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  **/
975 975
 function supprimer_numero($texte) {
976 976
 	return preg_replace(
977
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
977
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
978 978
 		"", $texte);
979 979
 }
980 980
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
  **/
1000 1000
 function recuperer_numero($texte) {
1001 1001
 	if (preg_match(
1002
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
1002
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
1003 1003
 		$texte, $regs)) {
1004 1004
 		return strval($regs[1]);
1005 1005
 	} else {
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
  **/
1085 1085
 function textebrut($texte) {
1086 1086
 	$u = $GLOBALS['meta']['pcre_u'];
1087
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
1088
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
1087
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
1088
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
1089 1089
 	$texte = preg_replace("/^\n+/", "", $texte);
1090 1090
 	$texte = preg_replace("/\n+$/", "", $texte);
1091 1091
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1114 1114
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1115 1115
 		foreach ($liens[0] as $a) {
1116
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1116
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1117 1117
 			$ablank = inserer_attribut($a, 'rel', $rel);
1118 1118
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1119 1119
 			$texte = str_replace($a, $ablank, $texte);
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 		foreach ($regs[0] as $a) {
1139 1139
 			$rel = extraire_attribut($a, "rel");
1140 1140
 			if (strpos($rel, "nofollow") === false) {
1141
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1141
+				$rel = "nofollow".($rel ? " $rel" : "");
1142 1142
 				$anofollow = inserer_attribut($a, "rel", $rel);
1143 1143
 				$texte = str_replace($a, $anofollow, $texte);
1144 1144
 			}
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 	$u = $GLOBALS['meta']['pcre_u'];
1168 1168
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1169 1169
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1170
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1170
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1171 1171
 
1172 1172
 	return $texte;
1173 1173
 }
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		return $texte;
1199 1199
 	}
1200 1200
 	include_spip('inc/texte');
1201
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1201
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1202 1202
 		'div' : 'span';
1203 1203
 
1204 1204
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 function attribut_html($texte, $textebrut = true) {
1308 1308
 	$u = $GLOBALS['meta']['pcre_u'];
1309 1309
 	if ($textebrut) {
1310
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1310
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1311 1311
 	}
1312 1312
 	$texte = texte_backend($texte);
1313 1313
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 	# un message pour abs_url
1337 1337
 	$GLOBALS['mode_abs_url'] = 'url';
1338 1338
 	$url = trim($url);
1339
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1339
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1340 1340
 
1341 1341
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1342 1342
 }
@@ -1538,14 +1538,14 @@  discard block
 block discarded – undo
1538 1538
 	if (strpos($texte, "<") !== false) {
1539 1539
 		include_spip('inc/lien');
1540 1540
 		if (defined('_PREG_MODELE')) {
1541
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1541
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1542 1542
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1543 1543
 		}
1544 1544
 	}
1545 1545
 
1546 1546
 	$debut = '';
1547 1547
 	$suite = $texte;
1548
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1548
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1549 1549
 		$debut .= substr($suite, 0, $t - 1);
1550 1550
 		$suite = substr($suite, $t);
1551 1551
 		$car = substr($suite, 0, 1);
@@ -1562,11 +1562,11 @@  discard block
 block discarded – undo
1562 1562
 			$suite = substr($suite, strlen($regs[0]));
1563 1563
 		}
1564 1564
 	}
1565
-	$texte = $debut . $suite;
1565
+	$texte = $debut.$suite;
1566 1566
 
1567 1567
 	$texte = echappe_retour($texte);
1568 1568
 
1569
-	return $texte . $fin;
1569
+	return $texte.$fin;
1570 1570
 }
1571 1571
 
1572 1572
 
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 		}
1628 1628
 
1629 1629
 		foreach ($regs as $reg) {
1630
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1630
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1631 1631
 			$desc = $traduire($cle, $lang, true);
1632 1632
 			$l = $desc->langue;
1633 1633
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1740,9 +1740,9 @@  discard block
 block discarded – undo
1740 1740
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1741 1741
 					include_spip('inc/texte');
1742 1742
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1743
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1743
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1744 1744
 					if ($mode === 'div') {
1745
-						$trad = rtrim($trad) . "\n\n";
1745
+						$trad = rtrim($trad)."\n\n";
1746 1746
 					}
1747 1747
 					$trad = code_echappement($trad, 'multi', false, $mode);
1748 1748
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
 	if (is_array($balise)) {
1937 1937
 		array_walk(
1938 1938
 			$balise,
1939
-			function(&$a, $key, $t){
1939
+			function(&$a, $key, $t) {
1940 1940
 				$a = extraire_attribut($a, $t);
1941 1941
 			},
1942 1942
 			$attribut
@@ -2023,14 +2023,14 @@  discard block
 block discarded – undo
2023 2023
 
2024 2024
 	if ($old !== null) {
2025 2025
 		// Remplacer l'ancien attribut du meme nom
2026
-		$balise = $r[1] . $insert . $r[5];
2026
+		$balise = $r[1].$insert.$r[5];
2027 2027
 	} else {
2028 2028
 		// preferer une balise " />" (comme <img />)
2029 2029
 		if (preg_match(',/>,', $balise)) {
2030
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
2030
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
2031 2031
 		} // sinon une balise <a ...> ... </a>
2032 2032
 		else {
2033
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
2033
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
2034 2034
 		}
2035 2035
 	}
2036 2036
 
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
  * @param string $operation
2064 2064
  * @return string
2065 2065
  */
2066
-function modifier_class($balise, $class, $operation='ajouter') {
2066
+function modifier_class($balise, $class, $operation = 'ajouter') {
2067 2067
 	if (is_string($class)) {
2068 2068
 		$class = explode(' ', trim($class));
2069 2069
 	}
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 				}
2089 2089
 				if (in_array($operation, ['ajouter', 'commuter'])
2090 2090
 					and !$is_class_presente) {
2091
-					$class_new = rtrim($class_new) . " " . $c;
2091
+					$class_new = rtrim($class_new)." ".$c;
2092 2092
 				}
2093 2093
 				elseif (in_array($operation, ['supprimer', 'commuter'])
2094 2094
 					and $is_class_presente) {
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
  * @param string|array $class
2117 2117
  * @return string
2118 2118
  */
2119
-function ajouter_class($balise, $class){
2119
+function ajouter_class($balise, $class) {
2120 2120
 	return modifier_class($balise, $class, 'ajouter');
2121 2121
 }
2122 2122
 
@@ -2126,7 +2126,7 @@  discard block
 block discarded – undo
2126 2126
  * @param string|array $class
2127 2127
  * @return string
2128 2128
  */
2129
-function supprimer_class($balise, $class){
2129
+function supprimer_class($balise, $class) {
2130 2130
 	return modifier_class($balise, $class, 'supprimer');
2131 2131
 }
2132 2132
 
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
  * @param string|array $class
2138 2138
  * @return string
2139 2139
  */
2140
-function commuter_class($balise, $class){
2140
+function commuter_class($balise, $class) {
2141 2141
 	return modifier_class($balise, $class, 'commuter');
2142 2142
 }
2143 2143
 
@@ -2157,8 +2157,8 @@  discard block
 block discarded – undo
2157 2157
 //
2158 2158
 // Quelques fonctions de calcul arithmetique
2159 2159
 //
2160
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
2161
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
2160
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
2161
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
2162 2162
 
2163 2163
 /**
2164 2164
  * Additionne 2 nombres
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
 function plus($a, $b) {
2179 2179
 	return $a + $b;
2180 2180
 }
2181
-function strplus($a, $b) {return strize('plus', $a, $b);}
2181
+function strplus($a, $b) {return strize('plus', $a, $b); }
2182 2182
 /**
2183 2183
  * Soustrait 2 nombres
2184 2184
  *
@@ -2197,7 +2197,7 @@  discard block
 block discarded – undo
2197 2197
 function moins($a, $b) {
2198 2198
 	return $a - $b;
2199 2199
 }
2200
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2200
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2201 2201
 
2202 2202
 /**
2203 2203
  * Multiplie 2 nombres
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
 function mult($a, $b) {
2219 2219
 	return $a * $b;
2220 2220
 }
2221
-function strmult($a, $b) {return strize('mult', $a, $b);}
2221
+function strmult($a, $b) {return strize('mult', $a, $b); }
2222 2222
 
2223 2223
 /**
2224 2224
  * Divise 2 nombres
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
 function div($a, $b) {
2240 2240
 	return $b ? $a / $b : 0;
2241 2241
 }
2242
-function strdiv($a, $b) {return strize('div', $a, $b);}
2242
+function strdiv($a, $b) {return strize('div', $a, $b); }
2243 2243
 
2244 2244
 /**
2245 2245
  * Retourne le modulo 2 nombres
@@ -2280,13 +2280,13 @@  discard block
 block discarded – undo
2280 2280
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2281 2281
 		define('_TAGS_NOM_AUTEUR', '');
2282 2282
 	}
2283
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2283
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2284 2284
 	foreach ($tags_acceptes as $tag) {
2285 2285
 		if (strlen($tag)) {
2286
-			$remp1[] = '<' . trim($tag) . '>';
2287
-			$remp1[] = '</' . trim($tag) . '>';
2288
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2289
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2286
+			$remp1[] = '<'.trim($tag).'>';
2287
+			$remp1[] = '</'.trim($tag).'>';
2288
+			$remp2[] = '\x60'.trim($tag).'\x61';
2289
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2290 2290
 		}
2291 2291
 	}
2292 2292
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2336,7 +2336,7 @@  discard block
 block discarded – undo
2336 2336
 			$s[] = preg_replace(',>[^<]+</a>,S',
2337 2337
 				'>'
2338 2338
 				. http_img_pack('attachment-16.png', $t,
2339
-					'title="' . attribut_html($t) . '"')
2339
+					'title="'.attribut_html($t).'"')
2340 2340
 				. '</a>', $tag);
2341 2341
 		}
2342 2342
 	}
@@ -2397,10 +2397,10 @@  discard block
 block discarded – undo
2397 2397
 	$fichier = basename($url);
2398 2398
 
2399 2399
 	return '<a rel="enclosure"'
2400
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2401
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2402
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2403
-	. '>' . $fichier . '</a>';
2400
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2401
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2402
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2403
+	. '>'.$fichier.'</a>';
2404 2404
 }
2405 2405
 
2406 2406
 /**
@@ -2428,9 +2428,9 @@  discard block
 block discarded – undo
2428 2428
 			} # vieux data
2429 2429
 			$fichier = basename($url);
2430 2430
 			$enclosures[] = '<enclosure'
2431
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2432
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2433
-				. ($length ? ' length="' . $length . '"' : '')
2431
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2432
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2433
+				. ($length ? ' length="'.$length.'"' : '')
2434 2434
 				. ' />';
2435 2435
 		}
2436 2436
 	}
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 		if (extraire_attribut($e, 'rel') == 'tag') {
2457 2457
 			$subjects .= '<dc:subject>'
2458 2458
 				. texte_backend(textebrut($e))
2459
-				. '</dc:subject>' . "\n";
2459
+				. '</dc:subject>'."\n";
2460 2460
 		}
2461 2461
 	}
2462 2462
 
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 	if (is_array($texte)) {
2493 2493
 		array_walk(
2494 2494
 			$texte,
2495
-			function(&$a, $key, $t){
2495
+			function(&$a, $key, $t) {
2496 2496
 				$a = extraire_balise($a, $t);
2497 2497
 			},
2498 2498
 			$tag
@@ -2536,7 +2536,7 @@  discard block
 block discarded – undo
2536 2536
 	if (is_array($texte)) {
2537 2537
 		array_walk(
2538 2538
 			$texte,
2539
-			function(&$a, $key, $t){
2539
+			function(&$a, $key, $t) {
2540 2540
 				$a = extraire_balises($a, $t);
2541 2541
 			},
2542 2542
 			$tag
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 		if ($fond != '404') {
2663 2663
 			$contexte = array_shift($p);
2664 2664
 			$contexte['page'] = $fond;
2665
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2665
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2666 2666
 		}
2667 2667
 	}
2668 2668
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2717,9 +2717,9 @@  discard block
 block discarded – undo
2717 2717
 			. '"'
2718 2718
 			. (is_null($val)
2719 2719
 				? ''
2720
-				: ' value="' . entites_html($val) . '"'
2720
+				: ' value="'.entites_html($val).'"'
2721 2721
 			)
2722
-			. ' type="hidden"' . "\n/>";
2722
+			. ' type="hidden"'."\n/>";
2723 2723
 	}
2724 2724
 
2725 2725
 	return join("", $hidden);
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 	return preg_replace_callback(
2831 2831
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2832 2832
 		function($x) use ($path) {
2833
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2833
+			return "url('".suivre_lien($path, $x[1])."')";
2834 2834
 		},
2835 2835
 		$contenu
2836 2836
 	);
@@ -2892,14 +2892,14 @@  discard block
 block discarded – undo
2892 2892
 	) {
2893 2893
 		$distant = true;
2894 2894
 		$cssf = parse_url($css);
2895
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2895
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2896 2896
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2897 2897
 	} else {
2898 2898
 		$distant = false;
2899 2899
 		$cssf = $css;
2900 2900
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2901 2901
 		//propose (rien a faire dans ce cas)
2902
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2902
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2903 2903
 		if (@file_exists($f)) {
2904 2904
 			return $f;
2905 2905
 		}
@@ -2909,7 +2909,7 @@  discard block
 block discarded – undo
2909 2909
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2910 2910
 	$f = $dir_var
2911 2911
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2912
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2912
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2913 2913
 
2914 2914
 	// la css peut etre distante (url absolue !)
2915 2915
 	if ($distant) {
@@ -2954,8 +2954,8 @@  discard block
 block discarded – undo
2954 2954
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2955 2955
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2956 2956
 			$css_direction = substr($css_direction, strlen($dir_var));
2957
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2958
-			$css_direction = "/@@@@@@/" . $css_direction;
2957
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2958
+			$css_direction = "/@@@@@@/".$css_direction;
2959 2959
 		}
2960 2960
 		$src[] = $regs[0][$k];
2961 2961
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
 
3005 3005
 	$f = basename($css, '.css');
3006 3006
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3007
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3007
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3008 3008
 		. '.css';
3009 3009
 
3010 3010
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3013,7 +3013,7 @@  discard block
 block discarded – undo
3013 3013
 
3014 3014
 	if ($url_absolue_css == $css) {
3015 3015
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3016
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3016
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3017 3017
 		) {
3018 3018
 			include_spip('inc/distant');
3019 3019
 			$contenu = recuperer_url($css);
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
 	$expression = str_replace("\/", "/", $expression);
3126 3126
 	$expression = str_replace("/", "\/", $expression);
3127 3127
 
3128
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3128
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3129 3129
 		if (isset($r[$capte])) {
3130 3130
 			return $r[$capte];
3131 3131
 		} else {
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 	$expression = str_replace("\/", "/", $expression);
3164 3164
 	$expression = str_replace("/", "\/", $expression);
3165 3165
 
3166
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3166
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3167 3167
 }
3168 3168
 
3169 3169
 
@@ -3182,7 +3182,7 @@  discard block
 block discarded – undo
3182 3182
 function traiter_doublons_documents(&$doublons, $letexte) {
3183 3183
 
3184 3184
 	// Verifier dans le texte & les notes (pas beau, helas)
3185
-	$t = $letexte . $GLOBALS['les_notes'];
3185
+	$t = $letexte.$GLOBALS['les_notes'];
3186 3186
 
3187 3187
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3188 3188
 		and preg_match_all(
@@ -3192,7 +3192,7 @@  discard block
 block discarded – undo
3192 3192
 		if (!isset($doublons['documents'])) {
3193 3193
 			$doublons['documents'] = "";
3194 3194
 		}
3195
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3195
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3196 3196
 	}
3197 3197
 
3198 3198
 	return $letexte;
@@ -3249,7 +3249,7 @@  discard block
 block discarded – undo
3249 3249
 	if ($env) {
3250 3250
 		foreach ($env as $i => $j) {
3251 3251
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3252
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3252
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3253 3253
 			}
3254 3254
 		}
3255 3255
 	}
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
 	if ($env) {
3289 3289
 		foreach ($env as $i => $j) {
3290 3290
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3291
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3291
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3292 3292
 			}
3293 3293
 		}
3294 3294
 	}
@@ -3361,9 +3361,9 @@  discard block
 block discarded – undo
3361 3361
 	// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3362 3362
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3363 3363
 	if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3364
-	  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3364
+	  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3365 3365
 	  and file_exists($variante_svg_generique)) {
3366
-		if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3366
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) {
3367 3367
 			$img_file = $variante_svg_size;
3368 3368
 		}
3369 3369
 		else {
@@ -3394,13 +3394,13 @@  discard block
 block discarded – undo
3394 3394
 
3395 3395
 	$img_file = $img;
3396 3396
 	if ($p = strpos($img_file, '?')) {
3397
-		$img_file = substr($img_file,0, $p);
3397
+		$img_file = substr($img_file, 0, $p);
3398 3398
 	}
3399 3399
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3400 3400
 		$img_file = chemin_image($img);
3401 3401
 	}
3402 3402
 	else {
3403
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3403
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3404 3404
 			$img_file = http_img_variante_svg_si_possible($img_file);
3405 3405
 		}
3406 3406
 	}
@@ -3420,7 +3420,7 @@  discard block
 block discarded – undo
3420 3420
 				return "";
3421 3421
 			}
3422 3422
 		}
3423
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3423
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3424 3424
 	}
3425 3425
 
3426 3426
 	if (file_exists($img_file)) {
@@ -3429,15 +3429,15 @@  discard block
 block discarded – undo
3429 3429
 	if ($alt === false) {
3430 3430
 		$alt = '';
3431 3431
 	}
3432
-	elseif($alt or $alt==='') {
3432
+	elseif ($alt or $alt === '') {
3433 3433
 		$alt = " alt='".attribut_html($alt)."'";
3434 3434
 	}
3435 3435
 	else {
3436 3436
 		$alt = " alt='".attribut_html($title)."'";
3437 3437
 	}
3438 3438
 	return "<img src='$img_file'$alt"
3439
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3440
-	. " " . ltrim($atts)
3439
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3440
+	. " ".ltrim($atts)
3441 3441
 	. " />";
3442 3442
 }
3443 3443
 
@@ -3449,12 +3449,12 @@  discard block
 block discarded – undo
3449 3449
  * @param string $size
3450 3450
  * @return string
3451 3451
  */
3452
-function http_style_background($img, $att = '', $size=null) {
3453
-	if ($size and is_numeric($size)){
3454
-		$size = trim($size) . "px";
3452
+function http_style_background($img, $att = '', $size = null) {
3453
+	if ($size and is_numeric($size)) {
3454
+		$size = trim($size)."px";
3455 3455
 	}
3456
-	return " style='background" .
3457
-		($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
3456
+	return " style='background".
3457
+		($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";"
3458 3458
 		. ($size ? "background-size:{$size};" : '')
3459 3459
 		. "'";
3460 3460
 }
@@ -3480,7 +3480,7 @@  discard block
 block discarded – undo
3480 3480
 			$args[] = $maybe_size;
3481 3481
 			$maybe_size = null;
3482 3482
 		}
3483
-		while (count($args)<2) {
3483
+		while (count($args) < 2) {
3484 3484
 			$args[] = null; // default alt or class
3485 3485
 		}
3486 3486
 		$args[] = $maybe_size;
@@ -3490,7 +3490,7 @@  discard block
 block discarded – undo
3490 3490
 
3491 3491
 function helper_filtre_balise_img_svg_size($img, $size) {
3492 3492
 	// si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite
3493
-	if (strpos($size, '@') === 0 and substr($size,-1) === 'x') {
3493
+	if (strpos($size, '@') === 0 and substr($size, -1) === 'x') {
3494 3494
 		$coef = floatval(substr($size, 1, -1));
3495 3495
 		list($h, $w) = taille_image($img);
3496 3496
 		$height = intval(round($h / $coef));
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
  * @return string
3546 3546
  *     Code HTML de la balise IMG
3547 3547
  */
3548
-function filtre_balise_img_dist($img, $alt = '', $class = null, $size=null) {
3548
+function filtre_balise_img_dist($img, $alt = '', $class = null, $size = null) {
3549 3549
 
3550 3550
 	list($alt, $class, $size) = helper_filtre_balise_img_svg_arguments($alt, $class, $size);
3551 3551
 
@@ -3564,7 +3564,7 @@  discard block
 block discarded – undo
3564 3564
 		}
3565 3565
 	}
3566 3566
 	else {
3567
-		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3567
+		$img = http_img_pack($img, $alt, $class ? " class='".attribut_html($class)."'" : '', '',
3568 3568
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3569 3569
 		if (is_null($alt)) {
3570 3570
 			$img = vider_attribut($img, 'alt');
@@ -3610,16 +3610,16 @@  discard block
 block discarded – undo
3610 3610
  * @return string
3611 3611
  *     Code HTML de la balise SVG
3612 3612
  */
3613
-function filtre_balise_svg_dist($img, $alt = '', $class = null, $size=null) {
3613
+function filtre_balise_svg_dist($img, $alt = '', $class = null, $size = null) {
3614 3614
 
3615 3615
 	$img = trim($img);
3616 3616
 	$img_file = $img;
3617
-	if (strpos($img, '<svg') === false){
3618
-		if ($p = strpos($img_file, '?')){
3617
+	if (strpos($img, '<svg') === false) {
3618
+		if ($p = strpos($img_file, '?')) {
3619 3619
 			$img_file = substr($img_file, 0, $p);
3620 3620
 		}
3621 3621
 
3622
-		if (!$img_file or !$svg = file_get_contents($img_file)){
3622
+		if (!$img_file or !$svg = file_get_contents($img_file)) {
3623 3623
 			return '';
3624 3624
 		}
3625 3625
 	}
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
 	$balise_svg_source = $balise_svg;
3635 3635
 
3636 3636
 	// entete XML à supprimer
3637
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3637
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3638 3638
 
3639 3639
 	// IE est toujours mon ami
3640 3640
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3650,11 +3650,11 @@  discard block
 block discarded – undo
3650 3650
 	}
3651 3651
 
3652 3652
 	// regler le alt
3653
-	if ($alt){
3653
+	if ($alt) {
3654 3654
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3655
-		$id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4);
3655
+		$id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4);
3656 3656
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3657
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3657
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3658 3658
 		$balise_svg .= $title;
3659 3659
 	}
3660 3660
 	else {
@@ -3701,7 +3701,7 @@  discard block
 block discarded – undo
3701 3701
 	$texte = '';
3702 3702
 	if (is_array($tableau)) {
3703 3703
 		foreach ($tableau as $k => $v) {
3704
-			$res = recuperer_fond('modeles/' . $modele,
3704
+			$res = recuperer_fond('modeles/'.$modele,
3705 3705
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3706 3706
 			);
3707 3707
 			$texte .= $res;
@@ -3878,7 +3878,7 @@  discard block
 block discarded – undo
3878 3878
 	}
3879 3879
 
3880 3880
 	$c = serialize($c);
3881
-	$cle = calculer_cle_action($form . $c);
3881
+	$cle = calculer_cle_action($form.$c);
3882 3882
 	$c = "$cle:$c";
3883 3883
 
3884 3884
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3935,15 +3935,15 @@  discard block
 block discarded – undo
3935 3935
 	}
3936 3936
 	// toujours encoder l'url source dans le bloc ajax
3937 3937
 	$r = self();
3938
-	$r = ' data-origin="' . $r . '"';
3938
+	$r = ' data-origin="'.$r.'"';
3939 3939
 	$class = 'ajaxbloc';
3940 3940
 	if ($ajaxid and is_string($ajaxid)) {
3941 3941
 		// ajaxid est normalement conforme a un nom de classe css
3942 3942
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3943
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3943
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3944 3944
 	}
3945 3945
 
3946
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3946
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3947 3947
 }
3948 3948
 
3949 3949
 /**
@@ -3982,11 +3982,11 @@  discard block
 block discarded – undo
3982 3982
 	// extraire la signature en debut de contexte
3983 3983
 	// et la verifier avant de deserializer
3984 3984
 	// format : signature:donneesserializees
3985
-	if ($p = strpos($c,":")){
3986
-		$cle = substr($c,0,$p);
3987
-		$c = substr($c,$p+1);
3985
+	if ($p = strpos($c, ":")) {
3986
+		$cle = substr($c, 0, $p);
3987
+		$c = substr($c, $p + 1);
3988 3988
 
3989
-		if ($cle == calculer_cle_action($form . $c)) {
3989
+		if ($cle == calculer_cle_action($form.$c)) {
3990 3990
 			$env = @unserialize($c);
3991 3991
 			return $env;
3992 3992
 		}
@@ -4092,24 +4092,24 @@  discard block
 block discarded – undo
4092 4092
 		$att = "";
4093 4093
 		// si $on passe la balise et optionnelement une ou ++classe
4094 4094
 		// a.active span.selected.active etc....
4095
-		if (is_string($on) and (strncmp($on, 'a', 1)==0 or strncmp($on, 'span', 4)==0 or strncmp($on, 'strong', 6)==0)){
4095
+		if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) {
4096 4096
 			$on = explode(".", $on);
4097 4097
 			// on verifie que c'est exactement une des 3 balises a, span ou strong
4098
-			if (in_array(reset($on), array('a', 'span', 'strong'))){
4098
+			if (in_array(reset($on), array('a', 'span', 'strong'))) {
4099 4099
 				$bal = array_shift($on);
4100 4100
 				$class = implode(" ", $on);
4101
-				if ($bal=="a"){
4101
+				if ($bal == "a") {
4102 4102
 					$att = 'href="#" ';
4103 4103
 				}
4104 4104
 			}
4105 4105
 		}
4106
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4106
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4107 4107
 	} else {
4108 4108
 		$bal = 'a';
4109 4109
 		$att = "href='$url'"
4110
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4111
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4112
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4110
+			. ($title ? " title='".attribut_html($title)."'" : '')
4111
+			. ($class ? " class='".attribut_html($class)."'" : '')
4112
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4113 4113
 			. $evt;
4114 4114
 	}
4115 4115
 	if ($libelle === null) {
@@ -4244,7 +4244,7 @@  discard block
 block discarded – undo
4244 4244
 
4245 4245
 	// Icône
4246 4246
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4247
-	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>";
4247
+	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>";
4248 4248
 
4249 4249
 	// Markup final
4250 4250
 	if ($type == 'lien') {
@@ -4519,20 +4519,20 @@  discard block
 block discarded – undo
4519 4519
 		$class_form = 'ajax';
4520 4520
 		$class = str_replace('ajax', '', $class);
4521 4521
 	}
4522
-	$class_btn = 'submit ' . trim($class);
4522
+	$class_btn = 'submit '.trim($class);
4523 4523
 
4524 4524
 	if ($confirm) {
4525
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4525
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4526 4526
 		if ($callback) {
4527 4527
 			$callback = "$confirm?($callback):false";
4528 4528
 		} else {
4529 4529
 			$callback = $confirm;
4530 4530
 		}
4531 4531
 	}
4532
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4532
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4533 4533
 	$title = $title ? " title='$title'" : '';
4534 4534
 
4535
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4535
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4536 4536
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4537 4537
 }
4538 4538
 
@@ -4596,14 +4596,14 @@  discard block
 block discarded – undo
4596 4596
 		$champ_titre = "";
4597 4597
 		if ($demande_titre) {
4598 4598
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4599
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4599
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4600 4600
 		}
4601 4601
 		include_spip('base/abstract_sql');
4602 4602
 		include_spip('base/connect_sql');
4603 4603
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4604
-			'*' . $champ_titre,
4604
+			'*'.$champ_titre,
4605 4605
 			$desc['table_sql'],
4606
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4606
+			id_table_objet($type_objet).' = '.intval($id_objet)
4607 4607
 		);
4608 4608
 
4609 4609
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4677,8 +4677,7 @@  discard block
 block discarded – undo
4677 4677
 	if (isset($ligne_sql['chapo'])) {
4678 4678
 		$chapo = $ligne_sql['chapo'];
4679 4679
 		$texte = strlen($descriptif) ?
4680
-			'' :
4681
-			"$chapo \n\n $texte";
4680
+			'' : "$chapo \n\n $texte";
4682 4681
 	}
4683 4682
 
4684 4683
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4745,7 +4744,7 @@  discard block
 block discarded – undo
4745 4744
 		return $texte;
4746 4745
 	}
4747 4746
 
4748
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4747
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4749 4748
 
4750 4749
 	// Fournir $connect et $Pile[0] au traitement si besoin
4751 4750
 	$Pile = array(0 => $env);
@@ -4779,7 +4778,7 @@  discard block
 block discarded – undo
4779 4778
 	}
4780 4779
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4781 4780
 
4782
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4781
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4783 4782
 }
4784 4783
 
4785 4784
 
@@ -4798,10 +4797,10 @@  discard block
 block discarded – undo
4798 4797
 function wrap($texte, $wrap) {
4799 4798
 	$balises = extraire_balises($wrap);
4800 4799
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4801
-		$texte = $wrap . $texte;
4800
+		$texte = $wrap.$texte;
4802 4801
 		$regs = array_reverse($regs[1]);
4803
-		$wrap = "</" . implode("></", $regs) . ">";
4804
-		$texte = $texte . $wrap;
4802
+		$wrap = "</".implode("></", $regs).">";
4803
+		$texte = $texte.$wrap;
4805 4804
 	}
4806 4805
 
4807 4806
 	return $texte;
@@ -4832,7 +4831,7 @@  discard block
 block discarded – undo
4832 4831
 
4833 4832
 	// caster $u en array si besoin
4834 4833
 	if (is_object($u)) {
4835
-		$u = (array)$u;
4834
+		$u = (array) $u;
4836 4835
 	}
4837 4836
 
4838 4837
 	if (is_array($u)) {
@@ -4853,7 +4852,7 @@  discard block
 block discarded – undo
4853 4852
 		// sinon on passe a la ligne et on indente
4854 4853
 		$i_str = str_pad("", $indent, " ");
4855 4854
 		foreach ($u as $k => $v) {
4856
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4855
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4857 4856
 		}
4858 4857
 
4859 4858
 		return $out;
@@ -4906,8 +4905,8 @@  discard block
 block discarded – undo
4906 4905
  * @param string $class
4907 4906
  * @return string
4908 4907
  */
4909
-function objet_icone($objet, $taille = 24, $class='') {
4910
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4908
+function objet_icone($objet, $taille = 24, $class = '') {
4909
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4911 4910
 	$icone = chemin_image($icone);
4912 4911
 	$balise_img = charger_filtre('balise_img');
4913 4912
 
@@ -4931,12 +4930,12 @@  discard block
 block discarded – undo
4931 4930
  * @param array $options
4932 4931
  * @return string
4933 4932
  */
4934
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4935
-	$chaine = explode(':',$chaine);
4936
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4933
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4934
+	$chaine = explode(':', $chaine);
4935
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4937 4936
 		return $t;
4938 4937
 	}
4939
-	$chaine = implode(':',$chaine);
4938
+	$chaine = implode(':', $chaine);
4940 4939
 	return _T($chaine, $args, $options);
4941 4940
 }
4942 4941
 
@@ -4998,7 +4997,7 @@  discard block
 block discarded – undo
4998 4997
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4999 4998
 
5000 4999
 	// calculer le nom de la css
5001
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5000
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5002 5001
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
5003 5002
 	$contexte_implicite = calculer_contexte_implicite();
5004 5003
 
@@ -5006,22 +5005,22 @@  discard block
 block discarded – undo
5006 5005
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5007 5006
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5008 5007
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5009
-		$hash = md5($contexte_implicite['host'] . '::'. $cache);
5008
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5010 5009
 	}
5011 5010
 	else {
5012 5011
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5013 5012
 		ksort($contexte);
5014
-		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
5013
+		$hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect);
5015 5014
 	}
5016
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5015
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5017 5016
 
5018 5017
 	// mettre a jour le fichier si il n'existe pas
5019 5018
 	// ou trop ancien
5020 5019
 	// le dernier fichier produit est toujours suffixe par .last
5021 5020
 	// et recopie sur le fichier cible uniquement si il change
5022 5021
 	if (!file_exists($filename)
5023
-		or !file_exists($filename . ".last")
5024
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
5022
+		or !file_exists($filename.".last")
5023
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
5025 5024
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5026 5025
 	) {
5027 5026
 		$contenu = $cache['texte'];
@@ -5040,10 +5039,10 @@  discard block
 block discarded – undo
5040 5039
 			}
5041 5040
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5042 5041
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5043
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5042
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5044 5043
 		}
5045 5044
 		// et ecrire le fichier si il change
5046
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5045
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5047 5046
 	}
5048 5047
 
5049 5048
 	return timestamp($filename);
@@ -5238,11 +5237,11 @@  discard block
 block discarded – undo
5238 5237
 function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) {
5239 5238
 	$l = strlen($passe);
5240 5239
 
5241
-	if ($l<=8 or !$afficher_partiellement){
5240
+	if ($l <= 8 or !$afficher_partiellement) {
5242 5241
 		if (!$l) {
5243 5242
 			return ''; // montrer qu'il y a pas de mot de passe si il y en a pas
5244 5243
 		}
5245
-		return str_pad('',$afficher_partiellement ? $l : 16,'*');
5244
+		return str_pad('', $afficher_partiellement ? $l : 16, '*');
5246 5245
 	}
5247 5246
 
5248 5247
 	if (is_null($portion_pourcent)) {
@@ -5256,11 +5255,11 @@  discard block
 block discarded – undo
5256 5255
 	}
5257 5256
 	$e = intval(ceil($l * $portion_pourcent / 100 / 2));
5258 5257
 	$e = max($e, 0);
5259
-	$mid = str_pad('',$l-2*$e,'*');
5260
-	if ($e>0 and strlen($mid)>8){
5258
+	$mid = str_pad('', $l - 2 * $e, '*');
5259
+	if ($e > 0 and strlen($mid) > 8) {
5261 5260
 		$mid = '***...***';
5262 5261
 	}
5263
-	return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : '');
5262
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5264 5263
 }
5265 5264
 
5266 5265
 
@@ -5282,9 +5281,9 @@  discard block
 block discarded – undo
5282 5281
 function identifiant_slug($texte, $type = '', $options = array()) {
5283 5282
 
5284 5283
 	$original = $texte;
5285
-	$separateur = (isset($options['separateur'])?$options['separateur']:'_');
5286
-	$longueur_maxi = (isset($options['longueur_maxi'])?$options['longueur_maxi']:60);
5287
-	$longueur_mini = (isset($options['longueur_mini'])?$options['longueur_mini']:0);
5284
+	$separateur = (isset($options['separateur']) ? $options['separateur'] : '_');
5285
+	$longueur_maxi = (isset($options['longueur_maxi']) ? $options['longueur_maxi'] : 60);
5286
+	$longueur_mini = (isset($options['longueur_mini']) ? $options['longueur_mini'] : 0);
5288 5287
 
5289 5288
 	if (!function_exists('translitteration')) {
5290 5289
 		include_spip('inc/charsets');
@@ -5326,15 +5325,15 @@  discard block
 block discarded – undo
5326 5325
 			}
5327 5326
 	}
5328 5327
 
5329
-	if (strlen($texte)>$longueur_maxi) {
5328
+	if (strlen($texte) > $longueur_maxi) {
5330 5329
 		$texte = substr($texte, 0, $longueur_maxi);
5331 5330
 	}
5332 5331
 
5333 5332
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5334 5333
 		if (preg_match(',^\d,', $texte)) {
5335
-			$texte = ($type ? substr($type,0,1) : "s") . $texte;
5334
+			$texte = ($type ? substr($type, 0, 1) : "s").$texte;
5336 5335
 		}
5337
-		$texte .= $separateur . md5($original);
5336
+		$texte .= $separateur.md5($original);
5338 5337
 		$texte = substr($texte, 0, $longueur_mini);
5339 5338
 	}
5340 5339
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -622,8 +622,7 @@  discard block
 block discarded – undo
622 622
 			if (!$srcHeight) {
623 623
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
624 624
 			}
625
-		}
626
-		elseif(strpos($src, "<svg") !== false) {
625
+		} elseif(strpos($src, "<svg") !== false) {
627 626
 			include_spip('inc/svg');
628 627
 			if ($attrs = svg_lire_attributs($src)){
629 628
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
@@ -2089,8 +2088,7 @@  discard block
 block discarded – undo
2089 2088
 				if (in_array($operation, ['ajouter', 'commuter'])
2090 2089
 					and !$is_class_presente) {
2091 2090
 					$class_new = rtrim($class_new) . " " . $c;
2092
-				}
2093
-				elseif (in_array($operation, ['supprimer', 'commuter'])
2091
+				} elseif (in_array($operation, ['supprimer', 'commuter'])
2094 2092
 					and $is_class_presente) {
2095 2093
 					$class_new = trim(preg_replace("/(^|\s)".preg_quote($c)."($|\s)/", "\\1", $class_new));
2096 2094
 				}
@@ -2100,8 +2098,7 @@  discard block
 block discarded – undo
2100 2098
 		if ($class_new !== $class_courante) {
2101 2099
 			if (strlen($class_new)) {
2102 2100
 				$balise = inserer_attribut($balise, 'class', $class_new);
2103
-			}
2104
-			elseif ($class_courante) {
2101
+			} elseif ($class_courante) {
2105 2102
 				$balise = vider_attribut($balise, 'class');
2106 2103
 			}
2107 2104
 		}
@@ -3365,8 +3362,7 @@  discard block
 block discarded – undo
3365 3362
 	  and file_exists($variante_svg_generique)) {
3366 3363
 		if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3367 3364
 			$img_file = $variante_svg_size;
3368
-		}
3369
-		else {
3365
+		} else {
3370 3366
 			$img_file = $variante_svg_generique;
3371 3367
 		}
3372 3368
 	}
@@ -3398,8 +3394,7 @@  discard block
 block discarded – undo
3398 3394
 	}
3399 3395
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3400 3396
 		$img_file = chemin_image($img);
3401
-	}
3402
-	else {
3397
+	} else {
3403 3398
 		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3404 3399
 			$img_file = http_img_variante_svg_si_possible($img_file);
3405 3400
 		}
@@ -3428,11 +3423,9 @@  discard block
 block discarded – undo
3428 3423
 	}
3429 3424
 	if ($alt === false) {
3430 3425
 		$alt = '';
3431
-	}
3432
-	elseif($alt or $alt==='') {
3426
+	} elseif($alt or $alt==='') {
3433 3427
 		$alt = " alt='".attribut_html($alt)."'";
3434
-	}
3435
-	else {
3428
+	} else {
3436 3429
 		$alt = " alt='".attribut_html($title)."'";
3437 3430
 	}
3438 3431
 	return "<img src='$img_file'$alt"
@@ -3557,13 +3550,11 @@  discard block
 block discarded – undo
3557 3550
 		if (!is_null($class)) {
3558 3551
 			if (strlen($class)) {
3559 3552
 				$img = inserer_attribut($img, 'class', $class);
3560
-			}
3561
-			else {
3553
+			} else {
3562 3554
 				$img = vider_attribut($img, 'class');
3563 3555
 			}
3564 3556
 		}
3565
-	}
3566
-	else {
3557
+	} else {
3567 3558
 		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3568 3559
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3569 3560
 		if (is_null($alt)) {
@@ -3643,8 +3634,7 @@  discard block
 block discarded – undo
3643 3634
 	if (!is_null($class)) {
3644 3635
 		if (strlen($class)) {
3645 3636
 			$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3646
-		}
3647
-		else {
3637
+		} else {
3648 3638
 			$balise_svg = vider_attribut($balise_svg, 'class');
3649 3639
 		}
3650 3640
 	}
@@ -3656,8 +3646,7 @@  discard block
 block discarded – undo
3656 3646
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3657 3647
 		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3658 3648
 		$balise_svg .= $title;
3659
-	}
3660
-	else {
3649
+	} else {
3661 3650
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3662 3651
 	}
3663 3652
 
@@ -5007,8 +4996,7 @@  discard block
 block discarded – undo
5007 4996
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5008 4997
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5009 4998
 		$hash = md5($contexte_implicite['host'] . '::'. $cache);
5010
-	}
5011
-	else {
4999
+	} else {
5012 5000
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5013 5001
 		ksort($contexte);
5014 5002
 		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
Please login to merge, or discard this patch.