Completed
Push — master ( 09d0ed...222728 )
by cam
01:23
created
ecrire/inc/distant.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
29 29
 }
30 30
 if (!defined('_INC_DISTANT_USER_AGENT')) {
31
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
31
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
32 32
 }
33 33
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
34 34
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
38 38
 }
39 39
 
40
-define('_REGEXP_COPIE_LOCALE', ',' 	.
40
+define('_REGEXP_COPIE_LOCALE', ','.
41 41
 	preg_replace(
42 42
 		'@^https?:@',
43 43
 		'https?:',
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 	// si c'est la protection de soi-meme, retourner le path
76 76
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
77
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
77
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
78 78
 
79 79
 		return @file_exists($source) ? $source : false;
80 80
 	}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		return false;
95 95
 	}
96 96
 
97
-	$localrac = _DIR_RACINE . $local;
97
+	$localrac = _DIR_RACINE.$local;
98 98
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
99 99
 
100 100
 	// test d'existence du fichier
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 		if (!$taille_max) {
115 115
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
116 116
 		}
117
-		$localrac_tmp = $localrac . '.tmp';
117
+		$localrac_tmp = $localrac.'.tmp';
118 118
 		$res = recuperer_url(
119 119
 			$source,
120 120
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
121 121
 		);
122 122
 
123 123
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
124
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
124
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
125 125
 			@unlink($localrac_tmp);
126 126
 		}
127 127
 		else {
128
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
128
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
129 129
 		}
130 130
 		if (!$res or !$res['length']) {
131 131
 			// si $t c'est sans doute juste un not-modified-since
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			and is_callable($callback_valider_url)
139 139
 			and !$callback_valider_url($res['url'])
140 140
 		) {
141
-			spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
141
+			spip_log('copie_locale : url finale '.$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
142 142
 			@unlink($localrac_tmp);
143 143
 			return $t ? $local : false;
144 144
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 	if (!$is_known_host) {
231 231
 		$host = trim($parsed_url['host'], '.');
232
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
232
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
233 233
 			$ip = gethostbyname($host);
234 234
 			if ($ip === $host) {
235 235
 				// Error condition for gethostbyname()
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			}
251 251
 		}
252 252
 		if ($ip) {
253
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
253
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
254 254
 				return false;
255 255
 			}
256 256
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	}
262 262
 
263 263
 	$port = $parsed_url['port'];
264
-	if ($port === 80  or $port === 443  or $port === 8080) {
264
+	if ($port === 80 or $port === 443 or $port === 8080) {
265 265
 		return $url;
266 266
 	}
267 267
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 				}
332 332
 			}
333 333
 			if ($taille > 500) {
334
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
334
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
335 335
 			}
336 336
 		}
337 337
 
@@ -359,16 +359,16 @@  discard block
 block discarded – undo
359 359
 			}
360 360
 		} else {
361 361
 			// fabrique une chaine HTTP simple pour un POST
362
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
362
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
363 363
 			$chaine = [];
364 364
 			if (is_array($donnees)) {
365 365
 				foreach ($donnees as $cle => $valeur) {
366 366
 					if (is_array($valeur)) {
367 367
 						foreach ($valeur as $val2) {
368
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
368
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
369 369
 						}
370 370
 					} else {
371
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
371
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
372 372
 					}
373 373
 				}
374 374
 				$chaine = implode('&', $chaine);
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470 470
 	}
471 471
 
472
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
472
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
473 473
 
474 474
 	// Ajout des en-têtes spécifiques si besoin
475 475
 	$formatted_data = '';
476 476
 	if (!empty($options['headers'])) {
477 477
 		foreach ($options['headers'] as $champ => $valeur) {
478
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
478
+			$formatted_data .= $champ.': '.$valeur."\r\n";
479 479
 		}
480 480
 	}
481 481
 
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484 484
 		$head .= $formatted_data;
485 485
 		if (stripos($head, 'Content-Length:') === false) {
486
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
486
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
487 487
 		}
488
-		$formatted_data = $head . "\r\n" . $postdata;
488
+		$formatted_data = $head."\r\n".$postdata;
489 489
 		if (
490 490
 			strlen($postdata)
491 491
 			and !$methode_demandee
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500 500
 	$url = preg_replace(',^feed://,i', 'http://', $url);
501 501
 	if (!tester_url_absolue($url)) {
502
-		$url = 'http://' . $url;
502
+		$url = 'http://'.$url;
503 503
 	} elseif (strncmp($url, '//', 2) == 0) {
504
-		$url = 'http:' . $url;
504
+		$url = 'http:'.$url;
505 505
 	}
506 506
 
507 507
 	$url = url_to_ascii($url);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 		$options['if_modified_since']
531 531
 	);
532 532
 	if (!$handle) {
533
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
533
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
534 534
 
535 535
 		return false;
536 536
 	}
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 					'status' => 200,
561 561
 				];
562 562
 			} else {
563
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
563
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
564 564
 				return false;
565 565
 			}
566 566
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 					$options['datas'] = '';
577 577
 				}
578 578
 			}
579
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
579
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
580 580
 
581 581
 			return recuperer_url($url, $options);
582 582
 		} elseif ($res['status'] !== 200) {
583
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
583
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
584 584
 		}
585 585
 		$result['status'] = $res['status'];
586 586
 		if (isset($res['headers'])) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 	// on ne veut que les entetes
598 598
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
599
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
600 600
 		return $result;
601 601
 	}
602 602
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 	$gz = false;
608 608
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
609
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
610 610
 	}
611 611
 
612 612
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 
643 643
 	$trace = json_decode(json_encode($result), true);
644 644
 	$trace['page'] = '...';
645
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
645
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
646 646
 
647 647
 	return $result;
648 648
 }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	$sig['url'] = $url;
697 697
 
698 698
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
699
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
699
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
700 700
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
701 701
 	$cache = "$sub$cache";
702 702
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	$fp = false;
751 751
 	if ($fichier) {
752 752
 		include_spip('inc/acces');
753
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
753
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
754 754
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755 755
 		if (!$fp and file_exists($fichier)) {
756 756
 			return filesize($fichier);
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	}
810 810
 	$result['status'] = intval($r[1]);
811 811
 	while ($s = trim(fgets($handle, 16384))) {
812
-		$result['headers'][] = $s . "\n";
812
+		$result['headers'][] = $s."\n";
813 813
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814 814
 		[, $d, $v] = $r;
815 815
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -858,13 +858,13 @@  discard block
 block discarded – undo
858 858
 
859 859
 	// on se place tout le temps comme si on etait a la racine
860 860
 	if (_DIR_RACINE) {
861
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
861
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
862 862
 	}
863 863
 
864 864
 	$m = md5($source);
865 865
 
866 866
 	return $d
867
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
867
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
868 868
 	. substr($m, 0, 4)
869 869
 	. ".$extension";
870 870
 }
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 	// Si c'est deja local pas de souci
889 889
 	if (!tester_url_absolue($source)) {
890 890
 		if (_DIR_RACINE) {
891
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
891
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
892 892
 		}
893 893
 
894 894
 		return $source;
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 		$ext
907 907
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
908 908
 		and $f = nom_fichier_copie_locale($source, $ext)
909
-		and file_exists(_DIR_RACINE . $f)
909
+		and file_exists(_DIR_RACINE.$f)
910 910
 	) {
911 911
 		return $f;
912 912
 	}
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 
915 915
 	// Si c'est deja dans la table des documents,
916 916
 	// ramener le nom de sa copie potentielle
917
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
917
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
918 918
 
919 919
 	if ($ext) {
920 920
 		return nom_fichier_copie_locale($source, $ext);
@@ -925,9 +925,9 @@  discard block
 block discarded – undo
925 925
 
926 926
 	$ext = $path_parts ? $path_parts['extension'] : '';
927 927
 
928
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
928
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
929 929
 		$f = nom_fichier_copie_locale($source, $ext);
930
-		if (file_exists(_DIR_RACINE . $f)) {
930
+		if (file_exists(_DIR_RACINE.$f)) {
931 931
 			return $f;
932 932
 		}
933 933
 	}
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	// Ping  pour voir si son extension est connue et autorisee
936 936
 	// avec mise en cache du resultat du ping
937 937
 
938
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
938
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
939 939
 	if (
940 940
 		!@file_exists($cache)
941 941
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -945,11 +945,11 @@  discard block
 block discarded – undo
945 945
 		ecrire_fichier($cache, serialize($path_parts));
946 946
 	}
947 947
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
948
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
948
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
949 949
 		return nom_fichier_copie_locale($source, $ext);
950 950
 	}
951 951
 
952
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
952
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
953 953
 	return null;
954 954
 }
955 955
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 		} else {
1049 1049
 			if ($a['body']) {
1050 1050
 				$a['extension'] = $extension;
1051
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1051
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1052 1052
 				ecrire_fichier($a['fichier'], $a['body']);
1053 1053
 				$size_image = @spip_getimagesize($a['fichier']);
1054 1054
 				$a['largeur'] = intval($size_image[0]);
@@ -1116,20 +1116,20 @@  discard block
 block discarded – undo
1116 1116
 			!$t
1117 1117
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1118 1118
 		) {
1119
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1119
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1120 1120
 		}
1121 1121
 		if (
1122 1122
 			!$t
1123 1123
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1124 1124
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1125 1125
 		) {
1126
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1126
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1127 1127
 		}
1128 1128
 	}
1129 1129
 
1130 1130
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1131 1131
 	if (!$t) {
1132
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1132
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1133 1133
 	}
1134 1134
 
1135 1135
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1140,11 +1140,11 @@  discard block
 block discarded – undo
1140 1140
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1141 1141
 	) {
1142 1142
 		# eviter xxx.3 => 3gp (> SPIP 3)
1143
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1143
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1144 1144
 	}
1145 1145
 
1146 1146
 	if ($t) {
1147
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1147
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1148 1148
 		return $t['extension'];
1149 1149
 	} else {
1150 1150
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 		}
1248 1248
 	} else {
1249 1249
 		$scheme = $t['scheme'];
1250
-		$noproxy = $scheme . '://';
1250
+		$noproxy = $scheme.'://';
1251 1251
 	}
1252 1252
 	if (isset($t['user'])) {
1253 1253
 		$user = [$t['user'], $t['pass']];
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 	}
1262 1262
 
1263 1263
 	if (!empty($t['query'])) {
1264
-		$path .= '?' . $t['query'];
1264
+		$path .= '?'.$t['query'];
1265 1265
 	}
1266 1266
 
1267 1267
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1335,29 +1335,29 @@  discard block
 block discarded – undo
1335 1335
 	$proxy_user = '';
1336 1336
 	$http_proxy = need_proxy($host);
1337 1337
 	if ($user) {
1338
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1338
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1339 1339
 	}
1340 1340
 
1341 1341
 	$connect = '';
1342 1342
 	if ($http_proxy) {
1343
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1344
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1345
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1343
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1344
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1345
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1346 1346
 				. "Host: $path_host\r\n"
1347 1347
 				. "Proxy-Connection: Keep-Alive\r\n";
1348 1348
 		} else {
1349
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1349
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1350 1350
 				. (!$user ? '' : "$user@")
1351
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1351
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1352 1352
 		}
1353 1353
 		$t2 = @parse_url($http_proxy);
1354 1354
 		$first_host = $t2['host'];
1355 1355
 		$port = ($t2['port'] ?? null) ?: 80;
1356 1356
 		if ($t2['user'] ?? null) {
1357
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1357
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1358 1358
 		}
1359 1359
 	} else {
1360
-		$first_host = $noproxy . $host;
1360
+		$first_host = $noproxy.$host;
1361 1361
 	}
1362 1362
 
1363 1363
 	if ($connect) {
@@ -1379,7 +1379,7 @@  discard block
 block discarded – undo
1379 1379
 		);
1380 1380
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1381 1381
 		if (!$f) {
1382
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1382
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1383 1383
 			return $errno;
1384 1384
 		}
1385 1385
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 			or !count($res = explode(' ', $res))
1393 1393
 			or $res[1] !== '200'
1394 1394
 		) {
1395
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1395
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1396 1396
 			fclose($f);
1397 1397
 
1398 1398
 			return false;
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1410 1410
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1411 1411
 		if (!$f) {
1412
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1412
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1413 1413
 
1414 1414
 			return $errno;
1415 1415
 		}
@@ -1419,16 +1419,16 @@  discard block
 block discarded – undo
1419 1419
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1420 1420
 
1421 1421
 	$host_port = $host;
1422
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1422
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1423 1423
 		$host_port .= ":$port";
1424 1424
 	}
1425 1425
 	$req = "$method $path $vers\r\n"
1426 1426
 		. "Host: $host_port\r\n"
1427
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1428
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1427
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1428
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1429 1429
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1430
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1431
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1430
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1431
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1432 1432
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1433 1433
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1434 1434
 
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +124 added lines, -125 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	include_fichiers_fonctions();
99
-	foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) {
99
+	foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) {
100 100
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
101 101
 		if (is_callable($f)) {
102 102
 			return $f;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	// affichage "GIT [master: abcdef]"
232 232
 	$commit = $desc['commit_short'] ?? $desc['commit'];
233 233
 	if ($desc['branch']) {
234
-		$commit = $desc['branch'] . ': ' . $commit;
234
+		$commit = $desc['branch'].': '.$commit;
235 235
 	}
236 236
 	return "{$desc['vcs']} [$commit]";
237 237
 }
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 
252 252
 	// version installee par GIT
253
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
253
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
254 254
 		$currentHead = trim(substr($c, 4));
255
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
255
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
256 256
 			return [
257 257
 				'vcs' => 'GIT',
258 258
 				'branch' => basename($currentHead),
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
 
268 268
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
269 269
 // et laisser passer les fonctions personnelles baptisees image_...
270
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
271
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
272
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
273
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
274
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
275
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
270
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
271
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
272
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
273
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
274
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
275
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
276 276
 
277 277
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
278 278
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
  */
432 432
 function filtre_debug($val, $key = null) {
433 433
 	$debug = (
434
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
435
-		) . var_export($val, true);
434
+		is_null($key) ? '' : (var_export($key, true).' = ')
435
+		).var_export($val, true);
436 436
 
437 437
 	include_spip('inc/autoriser');
438 438
 	if (autoriser('webmestre')) {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		$is_file = false;
489 489
 	}
490 490
 	if ($is_file) {
491
-		$is_local_file = function ($path) {
491
+		$is_local_file = function($path) {
492 492
 			if (strpos($path, '?') !== false) {
493 493
 				$path = supprimer_timestamp($path);
494 494
 				// remove ?24px added by find_in_theme on .svg files
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 					if ($mouseover = extraire_attribut($reduit, 'onmouseover')) {
538 538
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
539 539
 							$srcover = $match[1];
540
-							$srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args);
540
+							$srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args);
541 541
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
542 542
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
543 543
 						}
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 	// " -> &quot; et tout ce genre de choses
940 940
 	$u = $GLOBALS['meta']['pcre_u'];
941 941
 	$texte = str_replace('&nbsp;', ' ', $texte);
942
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
942
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
943 943
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
944 944
 	$texte = entites_html($texte, false, false);
945 945
 	// mais bien echapper les double quotes !
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 		return '';
1002 1002
 	}
1003 1003
 	return preg_replace(
1004
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1004
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1005 1005
 		'',
1006 1006
 		$texte
1007 1007
 	);
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 	if (
1031 1031
 		$texte and
1032 1032
 		preg_match(
1033
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1033
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1034 1034
 			$texte,
1035 1035
 			$regs
1036 1036
 		)
@@ -1121,8 +1121,8 @@  discard block
 block discarded – undo
1121 1121
  **/
1122 1122
 function textebrut($texte) {
1123 1123
 	$u = $GLOBALS['meta']['pcre_u'];
1124
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1125
-	$texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte);
1124
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1125
+	$texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte);
1126 1126
 	$texte = preg_replace("/^\n+/", '', $texte);
1127 1127
 	$texte = preg_replace("/\n+$/", '', $texte);
1128 1128
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		)
1157 1157
 	) {
1158 1158
 		foreach ($liens[0] as $a) {
1159
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1159
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1160 1160
 			$ablank = inserer_attribut($a, 'rel', $rel);
1161 1161
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1162 1162
 			$texte = str_replace($a, $ablank, $texte);
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 		foreach ($regs[0] as $a) {
1182 1182
 			$rel = extraire_attribut($a, 'rel') ?? '';
1183 1183
 			if (strpos($rel, 'nofollow') === false) {
1184
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1184
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1185 1185
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1186 1186
 				$texte = str_replace($a, $anofollow, $texte);
1187 1187
 			}
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
 	$u = $GLOBALS['meta']['pcre_u'];
1211 1211
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1212 1212
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1213
-	$texte = preg_replace('@^\s*<br />@S' . $u, '', $texte);
1213
+	$texte = preg_replace('@^\s*<br />@S'.$u, '', $texte);
1214 1214
 
1215 1215
 	return $texte;
1216 1216
 }
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 		return $texte;
1242 1242
 	}
1243 1243
 	include_spip('inc/texte');
1244
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1244
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1245 1245
 		'div' : 'span';
1246 1246
 
1247 1247
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 
1333 1333
 		// Calcul de la taille et choix de l'unité
1334 1334
 		$affichage = _T(
1335
-			'spip:taille_' . $unites[$puissance] . $suffixe_item,
1335
+			'spip:taille_'.$unites[$puissance].$suffixe_item,
1336 1336
 			[
1337 1337
 				'taille' => round($octets / pow($kilo, $puissance), $precisions[$puissance])
1338 1338
 			]
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 	}
1367 1367
 	$u = $GLOBALS['meta']['pcre_u'];
1368 1368
 	if ($textebrut) {
1369
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1369
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1370 1370
 	}
1371 1371
 	$texte = texte_backend($texte);
1372 1372
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 	# un message pour abs_url
1402 1402
 	$GLOBALS['mode_abs_url'] = 'url';
1403 1403
 	$url = trim($url);
1404
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1404
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1405 1405
 
1406 1406
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1407 1407
 }
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 
1609 1609
 	$debut = '';
1610 1610
 	$suite = $texte;
1611
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1611
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1612 1612
 		$debut .= substr($suite, 0, $t - 1);
1613 1613
 		$suite = substr($suite, $t);
1614 1614
 		$car = substr($suite, 0, 1);
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 			$suite = substr($suite, strlen($regs[0]));
1627 1627
 		}
1628 1628
 	}
1629
-	$texte = $debut . $suite;
1629
+	$texte = $debut.$suite;
1630 1630
 
1631 1631
 	if ($collecteurModeles) {
1632 1632
 		$texte = $collecteurModeles->retablir($texte);
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 
1635 1635
 	$texte = echappe_retour($texte);
1636 1636
 
1637
-	return $texte . $fin;
1637
+	return $texte.$fin;
1638 1638
 }
1639 1639
 
1640 1640
 
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
 	if (is_array($balise)) {
1911 1911
 		array_walk(
1912 1912
 			$balise,
1913
-			function (&$a, $key, $t) {
1913
+			function(&$a, $key, $t) {
1914 1914
 				$a = extraire_attribut($a, $t);
1915 1915
 			},
1916 1916
 			$attribut
@@ -2008,14 +2008,14 @@  discard block
 block discarded – undo
2008 2008
 
2009 2009
 	if ($old !== null) {
2010 2010
 		// Remplacer l'ancien attribut du meme nom
2011
-		$balise = $r[1] . $insert . $r[5];
2011
+		$balise = $r[1].$insert.$r[5];
2012 2012
 	} else {
2013 2013
 		// preferer une balise " />" (comme <img />)
2014 2014
 		if (preg_match(',/>,', $balise)) {
2015
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
2015
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
2016 2016
 		} // sinon une balise <a ...> ... </a>
2017 2017
 		else {
2018
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
2018
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
2019 2019
 		}
2020 2020
 	}
2021 2021
 
@@ -2070,7 +2070,7 @@  discard block
 block discarded – undo
2070 2070
 		if (
2071 2071
 			$class_courante
2072 2072
 			and str_contains($class_courante, (string) $c)
2073
-			and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante)
2073
+			and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante)
2074 2074
 		) {
2075 2075
 			$is_class_presente = true;
2076 2076
 		}
@@ -2078,12 +2078,12 @@  discard block
 block discarded – undo
2078 2078
 			in_array($operation, ['ajouter', 'commuter'])
2079 2079
 			and !$is_class_presente
2080 2080
 		) {
2081
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2081
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2082 2082
 		} elseif (
2083 2083
 			in_array($operation, ['supprimer', 'commuter'])
2084 2084
 			and $is_class_presente
2085 2085
 		) {
2086
-			$class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new));
2086
+			$class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new));
2087 2087
 		}
2088 2088
 	}
2089 2089
 
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 // Quelques fonctions de calcul arithmetique
2147 2147
 //
2148 2148
 function floatstr($a) {
2149
- return str_replace(',', '.', (string)floatval($a));
2149
+ return str_replace(',', '.', (string) floatval($a));
2150 2150
 }
2151 2151
 function strize($f, $a, $b) {
2152 2152
  return floatstr($f(floatstr($a), floatstr($b)));
@@ -2287,13 +2287,13 @@  discard block
 block discarded – undo
2287 2287
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2288 2288
 		define('_TAGS_NOM_AUTEUR', '');
2289 2289
 	}
2290
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2290
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2291 2291
 	foreach ($tags_acceptes as $tag) {
2292 2292
 		if (strlen($tag)) {
2293
-			$remp1[] = '<' . trim($tag) . '>';
2294
-			$remp1[] = '</' . trim($tag) . '>';
2295
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2296
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2293
+			$remp1[] = '<'.trim($tag).'>';
2294
+			$remp1[] = '</'.trim($tag).'>';
2295
+			$remp2[] = '\x60'.trim($tag).'\x61';
2296
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2297 2297
 		}
2298 2298
 	}
2299 2299
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2413,10 +2413,10 @@  discard block
 block discarded – undo
2413 2413
 	$fichier = basename($url);
2414 2414
 
2415 2415
 	return '<a rel="enclosure"'
2416
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2417
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2418
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2419
-	. '>' . $fichier . '</a>';
2416
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2417
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2418
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2419
+	. '>'.$fichier.'</a>';
2420 2420
 }
2421 2421
 
2422 2422
 /**
@@ -2444,9 +2444,9 @@  discard block
 block discarded – undo
2444 2444
 			} # vieux data
2445 2445
 			$fichier = basename($url);
2446 2446
 			$enclosures[] = '<enclosure'
2447
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2448
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2449
-				. ($length ? ' length="' . $length . '"' : '')
2447
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2448
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2449
+				. ($length ? ' length="'.$length.'"' : '')
2450 2450
 				. ' />';
2451 2451
 		}
2452 2452
 	}
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
 		if (extraire_attribut($e, 'rel') == 'tag') {
2473 2473
 			$subjects .= '<dc:subject>'
2474 2474
 				. texte_backend(textebrut($e))
2475
-				. '</dc:subject>' . "\n";
2475
+				. '</dc:subject>'."\n";
2476 2476
 		}
2477 2477
 	}
2478 2478
 
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
 	if (is_array($texte)) {
2509 2509
 		array_walk(
2510 2510
 			$texte,
2511
-			function (&$a, $key, $t) {
2511
+			function(&$a, $key, $t) {
2512 2512
 				$a = extraire_balise($a, $t);
2513 2513
 			},
2514 2514
 			$tag
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
 	if (is_array($texte)) {
2557 2557
 		array_walk(
2558 2558
 			$texte,
2559
-			function (&$a, $key, $t) {
2559
+			function(&$a, $key, $t) {
2560 2560
 				$a = extraire_balises($a, $t);
2561 2561
 			},
2562 2562
 			$tag
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
 		if ($fond != '404') {
2690 2690
 			$contexte = array_shift($p);
2691 2691
 			$contexte['page'] = $fond;
2692
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2692
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2693 2693
 		}
2694 2694
 	}
2695 2695
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2744,9 +2744,9 @@  discard block
 block discarded – undo
2744 2744
 			. '"'
2745 2745
 			. (is_null($val)
2746 2746
 				? ''
2747
-				: ' value="' . entites_html($val) . '"'
2747
+				: ' value="'.entites_html($val).'"'
2748 2748
 			)
2749
-			. ' type="hidden"' . "\n/>";
2749
+			. ' type="hidden"'."\n/>";
2750 2750
 	}
2751 2751
 
2752 2752
 	return join('', $hidden);
@@ -2856,7 +2856,7 @@  discard block
 block discarded – undo
2856 2856
 
2857 2857
 	return preg_replace_callback(
2858 2858
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2859
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2859
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2860 2860
 		$contenu
2861 2861
 	);
2862 2862
 }
@@ -2917,14 +2917,14 @@  discard block
 block discarded – undo
2917 2917
 	) {
2918 2918
 		$distant = true;
2919 2919
 		$cssf = parse_url($css);
2920
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
2920
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
2921 2921
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
2922 2922
 	} else {
2923 2923
 		$distant = false;
2924 2924
 		$cssf = $css;
2925 2925
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2926 2926
 		//propose (rien a faire dans ce cas)
2927
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2927
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2928 2928
 		if (@file_exists($f)) {
2929 2929
 			return $f;
2930 2930
 		}
@@ -2934,7 +2934,7 @@  discard block
 block discarded – undo
2934 2934
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2935 2935
 	$f = $dir_var
2936 2936
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2937
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2937
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2938 2938
 
2939 2939
 	// la css peut etre distante (url absolue !)
2940 2940
 	if ($distant) {
@@ -2980,8 +2980,8 @@  discard block
 block discarded – undo
2980 2980
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2981 2981
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2982 2982
 			$css_direction = substr($css_direction, strlen($dir_var));
2983
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
2984
-			$css_direction = '/@@@@@@/' . $css_direction;
2983
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
2984
+			$css_direction = '/@@@@@@/'.$css_direction;
2985 2985
 		}
2986 2986
 		$src[] = $regs[0][$k];
2987 2987
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3030,7 +3030,7 @@  discard block
 block discarded – undo
3030 3030
 
3031 3031
 	$f = basename($css, '.css');
3032 3032
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3033
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3033
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3034 3034
 		. '.css';
3035 3035
 
3036 3036
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3040,7 +3040,7 @@  discard block
 block discarded – undo
3040 3040
 	if ($url_absolue_css == $css) {
3041 3041
 		if (
3042 3042
 			strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3043
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3043
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3044 3044
 		) {
3045 3045
 			include_spip('inc/distant');
3046 3046
 			$contenu = recuperer_url($css);
@@ -3152,7 +3152,7 @@  discard block
 block discarded – undo
3152 3152
 	$expression = str_replace('\/', '/', $expression);
3153 3153
 	$expression = str_replace('/', '\/', $expression);
3154 3154
 
3155
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3155
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3156 3156
 		if (isset($r[$capte])) {
3157 3157
 			return $r[$capte];
3158 3158
 		} else {
@@ -3190,7 +3190,7 @@  discard block
 block discarded – undo
3190 3190
 	$expression = str_replace('\/', '/', $expression);
3191 3191
 	$expression = str_replace('/', '\/', $expression);
3192 3192
 
3193
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3193
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3194 3194
 }
3195 3195
 
3196 3196
 
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
 function traiter_doublons_documents(&$doublons, $letexte) {
3210 3210
 
3211 3211
 	// Verifier dans le texte & les notes (pas beau, helas)
3212
-	$t = $letexte . $GLOBALS['les_notes'];
3212
+	$t = $letexte.$GLOBALS['les_notes'];
3213 3213
 
3214 3214
 	if (
3215 3215
 		strstr($t, 'spip_document_') // evite le preg_match_all si inutile
@@ -3223,7 +3223,7 @@  discard block
 block discarded – undo
3223 3223
 		if (!isset($doublons['documents'])) {
3224 3224
 			$doublons['documents'] = '';
3225 3225
 		}
3226
-		$doublons['documents'] .= ',' . join(',', $matches[1]);
3226
+		$doublons['documents'] .= ','.join(',', $matches[1]);
3227 3227
 	}
3228 3228
 
3229 3229
 	return $letexte;
@@ -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 .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3283
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3284 3284
 			}
3285 3285
 		}
3286 3286
 	}
@@ -3319,7 +3319,7 @@  discard block
 block discarded – undo
3319 3319
 	if ($env) {
3320 3320
 		foreach ($env as $i => $j) {
3321 3321
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3322
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3322
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3323 3323
 			}
3324 3324
 		}
3325 3325
 	}
@@ -3393,10 +3393,10 @@  discard block
 block discarded – undo
3393 3393
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3394 3394
 	if (
3395 3395
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3396
-		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg'
3396
+		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg'
3397 3397
 		and file_exists($variante_svg_generique)
3398 3398
 	) {
3399
-		if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) {
3399
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) {
3400 3400
 			$img_file = $variante_svg_size;
3401 3401
 		}
3402 3402
 		else {
@@ -3454,7 +3454,7 @@  discard block
 block discarded – undo
3454 3454
 				return '';
3455 3455
 			}
3456 3456
 		}
3457
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3457
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3458 3458
 	}
3459 3459
 
3460 3460
 	if (file_exists($img_file)) {
@@ -3464,14 +3464,14 @@  discard block
 block discarded – undo
3464 3464
 		$alt = '';
3465 3465
 	}
3466 3466
 	elseif ($alt or $alt === '') {
3467
-		$alt = " alt='" . attribut_html($alt) . "'";
3467
+		$alt = " alt='".attribut_html($alt)."'";
3468 3468
 	}
3469 3469
 	else {
3470
-		$alt = " alt='" . attribut_html($title) . "'";
3470
+		$alt = " alt='".attribut_html($title)."'";
3471 3471
 	}
3472
-	return "<img src='" . attribut_html($img_file) . "'$alt"
3473
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3474
-	. ' ' . ltrim($atts)
3472
+	return "<img src='".attribut_html($img_file)."'$alt"
3473
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3474
+	. ' '.ltrim($atts)
3475 3475
 	. ' />';
3476 3476
 }
3477 3477
 
@@ -3485,10 +3485,10 @@  discard block
 block discarded – undo
3485 3485
  */
3486 3486
 function http_style_background($img, $att = '', $size = null) {
3487 3487
 	if ($size and is_numeric($size)) {
3488
-		$size = trim($size) . 'px';
3488
+		$size = trim($size).'px';
3489 3489
 	}
3490
-	return " style='background" .
3491
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3490
+	return " style='background".
3491
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3492 3492
 		. ($size ? "background-size:{$size};" : '')
3493 3493
 		. "'";
3494 3494
 }
@@ -3603,7 +3603,7 @@  discard block
 block discarded – undo
3603 3603
 		$img = http_img_pack(
3604 3604
 			$img,
3605 3605
 			$alt,
3606
-			$class ? " class='" . attribut_html($class) . "'" : '',
3606
+			$class ? " class='".attribut_html($class)."'" : '',
3607 3607
 			'',
3608 3608
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3609 3609
 		);
@@ -3688,7 +3688,7 @@  discard block
 block discarded – undo
3688 3688
 	$balise_svg_source = $balise_svg;
3689 3689
 
3690 3690
 	// entete XML à supprimer
3691
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3691
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3692 3692
 
3693 3693
 	// IE est toujours mon ami
3694 3694
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3706,9 +3706,9 @@  discard block
 block discarded – undo
3706 3706
 	// regler le alt
3707 3707
 	if ($alt) {
3708 3708
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3709
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3709
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3710 3710
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3711
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3711
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3712 3712
 		$balise_svg .= $title;
3713 3713
 	}
3714 3714
 	else {
@@ -3756,7 +3756,7 @@  discard block
 block discarded – undo
3756 3756
 	if (is_array($tableau)) {
3757 3757
 		foreach ($tableau as $k => $v) {
3758 3758
 			$res = recuperer_fond(
3759
-				'modeles/' . $modele,
3759
+				'modeles/'.$modele,
3760 3760
 				array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v]))
3761 3761
 			);
3762 3762
 			$texte .= $res;
@@ -3941,7 +3941,7 @@  discard block
 block discarded – undo
3941 3941
 	}
3942 3942
 
3943 3943
 	$c = serialize($c);
3944
-	$cle = calculer_cle_action($form . $c);
3944
+	$cle = calculer_cle_action($form.$c);
3945 3945
 	$c = "$cle:$c";
3946 3946
 
3947 3947
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3999,15 +3999,15 @@  discard block
 block discarded – undo
3999 3999
 	}
4000 4000
 	// toujours encoder l'url source dans le bloc ajax
4001 4001
 	$r = self();
4002
-	$r = ' data-origin="' . $r . '"';
4002
+	$r = ' data-origin="'.$r.'"';
4003 4003
 	$class = 'ajaxbloc';
4004 4004
 	if ($ajaxid and is_string($ajaxid)) {
4005 4005
 		// ajaxid est normalement conforme a un nom de classe css
4006 4006
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
4007
-		$class .= ' ajax-id-' . entites_html($ajaxid);
4007
+		$class .= ' ajax-id-'.entites_html($ajaxid);
4008 4008
 	}
4009 4009
 
4010
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4010
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4011 4011
 }
4012 4012
 
4013 4013
 /**
@@ -4051,7 +4051,7 @@  discard block
 block discarded – undo
4051 4051
 		$cle = substr($c, 0, $p);
4052 4052
 		$c = substr($c, $p + 1);
4053 4053
 
4054
-		if ($cle == calculer_cle_action($form . $c)) {
4054
+		if ($cle == calculer_cle_action($form.$c)) {
4055 4055
 			$env = @unserialize($c);
4056 4056
 			return $env;
4057 4057
 		}
@@ -4172,13 +4172,13 @@  discard block
 block discarded – undo
4172 4172
 				}
4173 4173
 			}
4174 4174
 		}
4175
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4175
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4176 4176
 	} else {
4177 4177
 		$bal = 'a';
4178 4178
 		$att = "href='$url'"
4179
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4180
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4181
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4179
+			. ($title ? " title='".attribut_html($title)."'" : '')
4180
+			. ($class ? " class='".attribut_html($class)."'" : '')
4181
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4182 4182
 			. $evt;
4183 4183
 	}
4184 4184
 	if ($libelle === null) {
@@ -4317,7 +4317,7 @@  discard block
 block discarded – undo
4317 4317
 
4318 4318
 	// Icône
4319 4319
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4320
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4320
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4321 4321
 
4322 4322
 	// Markup final
4323 4323
 	if ($type == 'lien') {
@@ -4592,20 +4592,20 @@  discard block
 block discarded – undo
4592 4592
 		$class_form = 'ajax';
4593 4593
 		$class = str_replace('ajax', '', $class);
4594 4594
 	}
4595
-	$class_btn = 'submit ' . trim($class);
4595
+	$class_btn = 'submit '.trim($class);
4596 4596
 
4597 4597
 	if ($confirm) {
4598
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4598
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4599 4599
 		if ($callback) {
4600 4600
 			$callback = "$confirm?($callback):false";
4601 4601
 		} else {
4602 4602
 			$callback = $confirm;
4603 4603
 		}
4604 4604
 	}
4605
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4605
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4606 4606
 	$title = $title ? " title='$title'" : '';
4607 4607
 
4608
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4608
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4609 4609
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4610 4610
 }
4611 4611
 
@@ -4670,14 +4670,14 @@  discard block
 block discarded – undo
4670 4670
 		$champ_titre = '';
4671 4671
 		if ($demande_titre) {
4672 4672
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4673
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4673
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4674 4674
 		}
4675 4675
 		include_spip('base/abstract_sql');
4676 4676
 		include_spip('base/connect_sql');
4677 4677
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4678
-			'*' . $champ_titre,
4678
+			'*'.$champ_titre,
4679 4679
 			$desc['table_sql'],
4680
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4680
+			id_table_objet($type_objet).' = '.intval($id_objet)
4681 4681
 		);
4682 4682
 
4683 4683
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4770,8 +4770,7 @@  discard block
 block discarded – undo
4770 4770
 	if (isset($ligne_sql['chapo'])) {
4771 4771
 		$chapo = $ligne_sql['chapo'];
4772 4772
 		$texte = strlen($descriptif) ?
4773
-			'' :
4774
-			"$chapo \n\n $texte";
4773
+			'' : "$chapo \n\n $texte";
4775 4774
 	}
4776 4775
 
4777 4776
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4846,7 +4845,7 @@  discard block
 block discarded – undo
4846 4845
 		return $texte;
4847 4846
 	}
4848 4847
 
4849
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4848
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4850 4849
 
4851 4850
 	// signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag
4852 4851
 	if (test_espace_prive()) {
@@ -4885,7 +4884,7 @@  discard block
 block discarded – undo
4885 4884
 	}
4886 4885
 	$url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect);
4887 4886
 
4888
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4887
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4889 4888
 }
4890 4889
 
4891 4890
 /**
@@ -4911,10 +4910,10 @@  discard block
 block discarded – undo
4911 4910
 function wrap($texte, $wrap) {
4912 4911
 	$balises = extraire_balises($wrap);
4913 4912
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4914
-		$texte = $wrap . $texte;
4913
+		$texte = $wrap.$texte;
4915 4914
 		$regs = array_reverse($regs[1]);
4916
-		$wrap = '</' . implode('></', $regs) . '>';
4917
-		$texte = $texte . $wrap;
4915
+		$wrap = '</'.implode('></', $regs).'>';
4916
+		$texte = $texte.$wrap;
4918 4917
 	}
4919 4918
 
4920 4919
 	return $texte;
@@ -4945,7 +4944,7 @@  discard block
 block discarded – undo
4945 4944
 
4946 4945
 	// caster $u en array si besoin
4947 4946
 	if (is_object($u)) {
4948
-		$u = (array)$u;
4947
+		$u = (array) $u;
4949 4948
 	}
4950 4949
 
4951 4950
 	if (is_array($u)) {
@@ -4967,7 +4966,7 @@  discard block
 block discarded – undo
4967 4966
 		// sinon on passe a la ligne et on indente
4968 4967
 		$i_str = str_pad('', $indent, ' ');
4969 4968
 		foreach ($u as $k => $v) {
4970
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4969
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4971 4970
 		}
4972 4971
 
4973 4972
 		return $out;
@@ -5021,7 +5020,7 @@  discard block
 block discarded – undo
5021 5020
  * @return string
5022 5021
  */
5023 5022
 function objet_icone($objet, $taille = 24, $class = '') {
5024
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
5023
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
5025 5024
 	$icone = chemin_image($icone);
5026 5025
 	$balise_img = charger_filtre('balise_img');
5027 5026
 
@@ -5047,7 +5046,7 @@  discard block
 block discarded – undo
5047 5046
  */
5048 5047
 function objet_T($objet, $chaine, $args = [], $options = []) {
5049 5048
 	$chaine = explode(':', $chaine);
5050
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
5049
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
5051 5050
 		return $t;
5052 5051
 	}
5053 5052
 	$chaine = implode(':', $chaine);
@@ -5113,7 +5112,7 @@  discard block
 block discarded – undo
5113 5112
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
5114 5113
 
5115 5114
 	// calculer le nom de la css
5116
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5115
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5117 5116
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
5118 5117
 	$contexte_implicite = calculer_contexte_implicite();
5119 5118
 
@@ -5121,14 +5120,14 @@  discard block
 block discarded – undo
5121 5120
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5122 5121
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5123 5122
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5124
-		$hash = md5($contexte_implicite['host'] . '::' . $cache);
5123
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5125 5124
 	}
5126 5125
 	else {
5127 5126
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5128 5127
 		ksort($contexte);
5129
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
5128
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
5130 5129
 	}
5131
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5130
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5132 5131
 
5133 5132
 	// mettre a jour le fichier si il n'existe pas
5134 5133
 	// ou trop ancien
@@ -5136,8 +5135,8 @@  discard block
 block discarded – undo
5136 5135
 	// et recopie sur le fichier cible uniquement si il change
5137 5136
 	if (
5138 5137
 		!file_exists($filename)
5139
-		or !file_exists($filename . '.last')
5140
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified'])
5138
+		or !file_exists($filename.'.last')
5139
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified'])
5141 5140
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5142 5141
 	) {
5143 5142
 		$contenu = $cache['texte'];
@@ -5161,10 +5160,10 @@  discard block
 block discarded – undo
5161 5160
 			}
5162 5161
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5163 5162
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5164
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5163
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5165 5164
 		}
5166 5165
 		// et ecrire le fichier si il change
5167
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5166
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5168 5167
 	}
5169 5168
 
5170 5169
 	return timestamp($filename);
@@ -5397,7 +5396,7 @@  discard block
 block discarded – undo
5397 5396
 	if ($e > 0 and strlen($mid) > 8) {
5398 5397
 		$mid = '***...***';
5399 5398
 	}
5400
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5399
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5401 5400
 }
5402 5401
 
5403 5402
 
@@ -5459,7 +5458,7 @@  discard block
 block discarded – undo
5459 5458
 		case 'id':
5460 5459
 		case 'anchor':
5461 5460
 			if (preg_match(',^\d,', $texte)) {
5462
-				$texte = substr($type, 0, 1) . $texte;
5461
+				$texte = substr($type, 0, 1).$texte;
5463 5462
 			}
5464 5463
 	}
5465 5464
 
@@ -5469,9 +5468,9 @@  discard block
 block discarded – undo
5469 5468
 
5470 5469
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5471 5470
 		if (preg_match(',^\d,', $texte)) {
5472
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5471
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5473 5472
 		}
5474
-		$texte .= $separateur . md5($original);
5473
+		$texte .= $separateur.md5($original);
5475 5474
 		$texte = substr($texte, 0, $longueur_mini);
5476 5475
 	}
5477 5476
 
Please login to merge, or discard this patch.