Completed
Push — master ( 716202...2bdd49 )
by cam
01:00
created
ecrire/inc/distant.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
27 27
 }
28 28
 if (!defined('_INC_DISTANT_USER_AGENT')) {
29
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
29
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
30 30
 }
31 31
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
32 32
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
36 36
 }
37 37
 
38
-define('_REGEXP_COPIE_LOCALE', ',' 	.
38
+define('_REGEXP_COPIE_LOCALE', ','.
39 39
 	preg_replace(
40 40
 		'@^https?:@',
41 41
 		'https?:',
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// si c'est la protection de soi-meme, retourner le path
74 74
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
75
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
75
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
76 76
 
77 77
 		return @file_exists($source) ? $source : false;
78 78
 	}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		return false;
93 93
 	}
94 94
 
95
-	$localrac = _DIR_RACINE . $local;
95
+	$localrac = _DIR_RACINE.$local;
96 96
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
97 97
 
98 98
 	// test d'existence du fichier
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
 		if (!$taille_max) {
113 113
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
114 114
 		}
115
-		$localrac_tmp = $localrac . '.tmp';
115
+		$localrac_tmp = $localrac.'.tmp';
116 116
 		$res = recuperer_url(
117 117
 			$source,
118 118
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
119 119
 		);
120 120
 
121 121
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
122
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
122
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
123 123
 			@unlink($localrac_tmp);
124 124
 		}
125 125
 		else {
126
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
126
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
127 127
 		}
128 128
 		if (!$res or !$res['length']) {
129 129
 			// si $t c'est sans doute juste un not-modified-since
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			and is_callable($callback_valider_url)
137 137
 			and !$callback_valider_url($res['url'])
138 138
 		) {
139
-			spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
139
+			spip_log('copie_locale : url finale '.$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
140 140
 			@unlink($localrac_tmp);
141 141
 			return $t ? $local : false;
142 142
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 	if (!$is_known_host) {
229 229
 		$host = trim($parsed_url['host'], '.');
230
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
230
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
231 231
 			$ip = gethostbyname($host);
232 232
 			if ($ip === $host) {
233 233
 				// Error condition for gethostbyname()
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			}
249 249
 		}
250 250
 		if ($ip) {
251
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
251
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
252 252
 				return false;
253 253
 			}
254 254
 		}
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	}
260 260
 
261 261
 	$port = $parsed_url['port'];
262
-	if ($port === 80  or $port === 443  or $port === 8080) {
262
+	if ($port === 80 or $port === 443 or $port === 8080) {
263 263
 		return $url;
264 264
 	}
265 265
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 				}
330 330
 			}
331 331
 			if ($taille > 500) {
332
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
332
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
333 333
 			}
334 334
 		}
335 335
 
@@ -357,16 +357,16 @@  discard block
 block discarded – undo
357 357
 			}
358 358
 		} else {
359 359
 			// fabrique une chaine HTTP simple pour un POST
360
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
360
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
361 361
 			$chaine = [];
362 362
 			if (is_array($donnees)) {
363 363
 				foreach ($donnees as $cle => $valeur) {
364 364
 					if (is_array($valeur)) {
365 365
 						foreach ($valeur as $val2) {
366
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
366
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
367 367
 						}
368 368
 					} else {
369
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
369
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
370 370
 					}
371 371
 				}
372 372
 				$chaine = implode('&', $chaine);
@@ -471,13 +471,13 @@  discard block
 block discarded – undo
471 471
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
472 472
 	}
473 473
 
474
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
474
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
475 475
 
476 476
 	// Ajout des en-têtes spécifiques si besoin
477 477
 	$formatted_data = '';
478 478
 	if (!empty($options['headers'])) {
479 479
 		foreach ($options['headers'] as $champ => $valeur) {
480
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
480
+			$formatted_data .= $champ.': '.$valeur."\r\n";
481 481
 		}
482 482
 	}
483 483
 
@@ -485,9 +485,9 @@  discard block
 block discarded – undo
485 485
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
486 486
 		$head .= $formatted_data;
487 487
 		if (stripos($head, 'Content-Length:') === false) {
488
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
488
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
489 489
 		}
490
-		$formatted_data = $head . "\r\n" . $postdata;
490
+		$formatted_data = $head."\r\n".$postdata;
491 491
 		if (
492 492
 			strlen($postdata)
493 493
 			and !$methode_demandee
@@ -501,9 +501,9 @@  discard block
 block discarded – undo
501 501
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
502 502
 	$url = preg_replace(',^feed://,i', 'http://', $url);
503 503
 	if (!tester_url_absolue($url)) {
504
-		$url = 'http://' . $url;
504
+		$url = 'http://'.$url;
505 505
 	} elseif (strncmp($url, '//', 2) == 0) {
506
-		$url = 'http:' . $url;
506
+		$url = 'http:'.$url;
507 507
 	}
508 508
 
509 509
 	$url = url_to_ascii($url);
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 		$options['if_modified_since']
533 533
 	);
534 534
 	if (!$handle) {
535
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
535
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
536 536
 
537 537
 		return false;
538 538
 	}
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 					'status' => 200,
563 563
 				];
564 564
 			} else {
565
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
565
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
566 566
 				return false;
567 567
 			}
568 568
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
 					$options['datas'] = '';
579 579
 				}
580 580
 			}
581
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
581
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
582 582
 
583 583
 			return recuperer_url($url, $options);
584 584
 		} elseif ($res['status'] !== 200) {
585
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
585
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
586 586
 		}
587 587
 		$result['status'] = $res['status'];
588 588
 		if (isset($res['headers'])) {
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 
599 599
 	// on ne veut que les entetes
600 600
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
601
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
601
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
602 602
 		return $result;
603 603
 	}
604 604
 
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 
609 609
 	$gz = false;
610 610
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
611
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
611
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
612 612
 	}
613 613
 
614 614
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 
645 645
 	$trace = json_decode(json_encode($result), true);
646 646
 	$trace['page'] = '...';
647
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
647
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
648 648
 
649 649
 	return $result;
650 650
 }
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 	$sig['url'] = $url;
699 699
 
700 700
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
701
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
701
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
702 702
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
703 703
 	$cache = "$sub$cache";
704 704
 
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	$fp = false;
753 753
 	if ($fichier) {
754 754
 		include_spip('inc/acces');
755
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
755
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
756 756
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
757 757
 		if (!$fp and file_exists($fichier)) {
758 758
 			return filesize($fichier);
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 	}
812 812
 	$result['status'] = intval($r[1]);
813 813
 	while ($s = trim(fgets($handle, 16384))) {
814
-		$result['headers'][] = $s . "\n";
814
+		$result['headers'][] = $s."\n";
815 815
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
816 816
 		[, $d, $v] = $r;
817 817
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -860,13 +860,13 @@  discard block
 block discarded – undo
860 860
 
861 861
 	// on se place tout le temps comme si on etait a la racine
862 862
 	if (_DIR_RACINE) {
863
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
863
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
864 864
 	}
865 865
 
866 866
 	$m = md5($source);
867 867
 
868 868
 	return $d
869
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
869
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
870 870
 	. substr($m, 0, 4)
871 871
 	. ".$extension";
872 872
 }
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 	// Si c'est deja local pas de souci
890 890
 	if (!tester_url_absolue($source)) {
891 891
 		if (_DIR_RACINE) {
892
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
892
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
893 893
 		}
894 894
 
895 895
 		return $source;
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
 		$ext
908 908
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
909 909
 		and $f = nom_fichier_copie_locale($source, $ext)
910
-		and file_exists(_DIR_RACINE . $f)
910
+		and file_exists(_DIR_RACINE.$f)
911 911
 	) {
912 912
 		return $f;
913 913
 	}
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 
916 916
 	// Si c'est deja dans la table des documents,
917 917
 	// ramener le nom de sa copie potentielle
918
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
918
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
919 919
 
920 920
 	if ($ext) {
921 921
 		return nom_fichier_copie_locale($source, $ext);
@@ -926,9 +926,9 @@  discard block
 block discarded – undo
926 926
 
927 927
 	$ext = $path_parts ? $path_parts['extension'] : '';
928 928
 
929
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
929
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
930 930
 		$f = nom_fichier_copie_locale($source, $ext);
931
-		if (file_exists(_DIR_RACINE . $f)) {
931
+		if (file_exists(_DIR_RACINE.$f)) {
932 932
 			return $f;
933 933
 		}
934 934
 	}
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 	// Ping  pour voir si son extension est connue et autorisee
937 937
 	// avec mise en cache du resultat du ping
938 938
 
939
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
939
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
940 940
 	if (
941 941
 		!@file_exists($cache)
942 942
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -946,10 +946,10 @@  discard block
 block discarded – undo
946 946
 		ecrire_fichier($cache, serialize($path_parts));
947 947
 	}
948 948
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
949
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
949
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
950 950
 		return nom_fichier_copie_locale($source, $ext);
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
 }
954 954
 
955 955
 
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 		} else {
1048 1048
 			if ($a['body']) {
1049 1049
 				$a['extension'] = $extension;
1050
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1050
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1051 1051
 				ecrire_fichier($a['fichier'], $a['body']);
1052 1052
 				$size_image = @spip_getimagesize($a['fichier']);
1053 1053
 				$a['largeur'] = intval($size_image[0]);
@@ -1115,20 +1115,20 @@  discard block
 block discarded – undo
1115 1115
 			!$t
1116 1116
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1117 1117
 		) {
1118
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1118
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1119 1119
 		}
1120 1120
 		if (
1121 1121
 			!$t
1122 1122
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1123 1123
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1124 1124
 		) {
1125
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1125
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1126 1126
 		}
1127 1127
 	}
1128 1128
 
1129 1129
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1130 1130
 	if (!$t) {
1131
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1131
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1132 1132
 	}
1133 1133
 
1134 1134
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1139,11 +1139,11 @@  discard block
 block discarded – undo
1139 1139
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1140 1140
 	) {
1141 1141
 		# eviter xxx.3 => 3gp (> SPIP 3)
1142
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1142
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1143 1143
 	}
1144 1144
 
1145 1145
 	if ($t) {
1146
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1146
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1147 1147
 		return $t['extension'];
1148 1148
 	} else {
1149 1149
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 		}
1247 1247
 	} else {
1248 1248
 		$scheme = $t['scheme'];
1249
-		$noproxy = $scheme . '://';
1249
+		$noproxy = $scheme.'://';
1250 1250
 	}
1251 1251
 	if (isset($t['user'])) {
1252 1252
 		$user = [$t['user'], $t['pass']];
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 	}
1261 1261
 
1262 1262
 	if (!empty($t['query'])) {
1263
-		$path .= '?' . $t['query'];
1263
+		$path .= '?'.$t['query'];
1264 1264
 	}
1265 1265
 
1266 1266
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1334,29 +1334,29 @@  discard block
 block discarded – undo
1334 1334
 	$proxy_user = '';
1335 1335
 	$http_proxy = need_proxy($host);
1336 1336
 	if ($user) {
1337
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1337
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1338 1338
 	}
1339 1339
 
1340 1340
 	$connect = '';
1341 1341
 	if ($http_proxy) {
1342
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1343
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1344
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1342
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1343
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1344
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1345 1345
 				. "Host: $path_host\r\n"
1346 1346
 				. "Proxy-Connection: Keep-Alive\r\n";
1347 1347
 		} else {
1348
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1348
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1349 1349
 				. (!$user ? '' : "$user@")
1350
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1350
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1351 1351
 		}
1352 1352
 		$t2 = @parse_url($http_proxy);
1353 1353
 		$first_host = $t2['host'];
1354 1354
 		$port = ($t2['port'] ?? null) ?: 80;
1355 1355
 		if ($t2['user'] ?? null) {
1356
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1356
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1357 1357
 		}
1358 1358
 	} else {
1359
-		$first_host = $noproxy . $host;
1359
+		$first_host = $noproxy.$host;
1360 1360
 	}
1361 1361
 
1362 1362
 	if ($connect) {
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 		);
1379 1379
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1380 1380
 		if (!$f) {
1381
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1381
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1382 1382
 			return $errno;
1383 1383
 		}
1384 1384
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 			or !count($res = explode(' ', $res))
1392 1392
 			or $res[1] !== '200'
1393 1393
 		) {
1394
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1394
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1395 1395
 			fclose($f);
1396 1396
 
1397 1397
 			return false;
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1409 1409
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1410 1410
 		if (!$f) {
1411
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1411
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1412 1412
 
1413 1413
 			return $errno;
1414 1414
 		}
@@ -1418,16 +1418,16 @@  discard block
 block discarded – undo
1418 1418
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1419 1419
 
1420 1420
 	$host_port = $host;
1421
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1421
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1422 1422
 		$host_port .= ":$port";
1423 1423
 	}
1424 1424
 	$req = "$method $path $vers\r\n"
1425 1425
 		. "Host: $host_port\r\n"
1426
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1427
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1426
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1427
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1428 1428
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1429
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1430
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1429
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1430
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1431 1431
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1432 1432
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1433 1433
 
Please login to merge, or discard this patch.
ecrire/install/etape_ldap2.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$adresse_ldap = filter_var($adresse_ldap, FILTER_SANITIZE_URL) ?: '';
49 49
 
50 50
 	$ldap_link = ldap_connect($adresse_ldap, $port_ldap);
51
-	$erreur = 'ldap_connect(' . spip_htmlspecialchars($adresse_ldap) . ', ' . spip_htmlspecialchars($port_ldap) . ')';
51
+	$erreur = 'ldap_connect('.spip_htmlspecialchars($adresse_ldap).', '.spip_htmlspecialchars($port_ldap).')';
52 52
 
53 53
 	if ($ldap_link) {
54 54
 		if (!ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap)) {
@@ -57,19 +57,19 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 		if ($tls === true) {
59 59
 			if (!ldap_start_tls($ldap_link)) {
60
-				$erreur = 'ldap_start_tls(' . spip_htmlspecialchars($ldap_link)
61
-					. ' ' . spip_htmlspecialchars($adresse_ldap)
62
-					. ', ' . spip_htmlspecialchars($port_ldap) . ')';
60
+				$erreur = 'ldap_start_tls('.spip_htmlspecialchars($ldap_link)
61
+					. ' '.spip_htmlspecialchars($adresse_ldap)
62
+					. ', '.spip_htmlspecialchars($port_ldap).')';
63 63
 				$ldap_link = false;
64 64
 			}
65 65
 		}
66 66
 		if ($ldap_link) {
67 67
 			$ldap_link = ldap_bind($ldap_link, $login_ldap, $pass_ldap);
68
-			$erreur = "ldap_bind('" . spip_htmlspecialchars($ldap_link)
69
-				. "', '" . spip_htmlspecialchars($login_ldap)
70
-				. "', '" . spip_htmlspecialchars($pass_ldap)
71
-				. "'): " . spip_htmlspecialchars($adresse_ldap)
72
-				. ', ' . spip_htmlspecialchars($port_ldap);
68
+			$erreur = "ldap_bind('".spip_htmlspecialchars($ldap_link)
69
+				. "', '".spip_htmlspecialchars($login_ldap)
70
+				. "', '".spip_htmlspecialchars($pass_ldap)
71
+				. "'): ".spip_htmlspecialchars($adresse_ldap)
72
+				. ', '.spip_htmlspecialchars($port_ldap);
73 73
 		}
74 74
 	}
75 75
 
@@ -77,22 +77,22 @@  discard block
 block discarded – undo
77 77
 		echo info_etape(
78 78
 			_T('titre_connexion_ldap'),
79 79
 			info_progression_etape(2, 'etape_ldap', 'install/')
80
-		),  _T('info_connexion_ldap_ok');
80
+		), _T('info_connexion_ldap_ok');
81 81
 		echo generer_form_ecrire('install', (
82 82
 			"\n<input type='hidden' name='etape' value='ldap3' />"
83
-			. "\n<input type='hidden' name='adresse_ldap' value=\"" . spip_htmlspecialchars($adresse_ldap) . '" />'
84
-			. "\n<input type='hidden' name='port_ldap' value=\"" . spip_htmlspecialchars($port_ldap) . '" />'
85
-			. "\n<input type='hidden' name='login_ldap' value=\"" . spip_htmlspecialchars($login_ldap) . '" />'
86
-			. "\n<input type='hidden' name='pass_ldap' value=\"" . spip_htmlspecialchars($pass_ldap) . '" />'
87
-			. "\n<input type='hidden' name='protocole_ldap' value=\"" . spip_htmlspecialchars($protocole_ldap) . '" />'
88
-			. "\n<input type='hidden' name='tls_ldap' value=\"" . spip_htmlspecialchars($tls_ldap) . '" />'
83
+			. "\n<input type='hidden' name='adresse_ldap' value=\"".spip_htmlspecialchars($adresse_ldap).'" />'
84
+			. "\n<input type='hidden' name='port_ldap' value=\"".spip_htmlspecialchars($port_ldap).'" />'
85
+			. "\n<input type='hidden' name='login_ldap' value=\"".spip_htmlspecialchars($login_ldap).'" />'
86
+			. "\n<input type='hidden' name='pass_ldap' value=\"".spip_htmlspecialchars($pass_ldap).'" />'
87
+			. "\n<input type='hidden' name='protocole_ldap' value=\"".spip_htmlspecialchars($protocole_ldap).'" />'
88
+			. "\n<input type='hidden' name='tls_ldap' value=\"".spip_htmlspecialchars($tls_ldap).'" />'
89 89
 			. bouton_suivant()));
90 90
 	} else {
91 91
 		echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true),
92
-			"<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>',
93
-			'<p>' . _T('avis_connexion_ldap_echec_2') .
94
-			"<br />\n" . _T('avis_connexion_ldap_echec_3') .
95
-			'<br /><br />' . $erreur . '<b> ?</b></p></div>';
92
+			"<div class='error'><p>"._T('avis_connexion_ldap_echec_1').'</p>',
93
+			'<p>'._T('avis_connexion_ldap_echec_2').
94
+			"<br />\n"._T('avis_connexion_ldap_echec_3').
95
+			'<br /><br />'.$erreur.'<b> ?</b></p></div>';
96 96
 	}
97 97
 
98 98
 	echo install_fin_html();
Please login to merge, or discard this patch.
ecrire/install/etape_3.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		= spip_connect_db($adresse_db, $port, $login_db, $pass_db, '', $server_db);
45 45
 
46 46
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
47
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
47
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
48 48
 
49 49
 	$fquery = sql_serveur('query', $server_db);
50 50
 	if ($choix_db == 'new_spip') {
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 			if (!$ok) {
55 55
 				$re = "Impossible de creer la base $re";
56 56
 				spip_log($re);
57
-				return '<p>' . _T('avis_connexion_erreur_creer_base') . "</p><!--\n$re\n-->";
57
+				return '<p>'._T('avis_connexion_erreur_creer_base')."</p><!--\n$re\n-->";
58 58
 			}
59 59
 		} else {
60 60
 			$re = "Le nom de la base doit correspondre a $re";
61 61
 			spip_log($re);
62 62
 
63
-			return '<p>' . _T('avis_connexion_erreur_nom_base') . "</p><!--\n$re\n-->";
63
+			return '<p>'._T('avis_connexion_erreur_nom_base')."</p><!--\n$re\n-->";
64 64
 		}
65 65
 	}
66 66
 
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
 		= spip_connect_db($adresse_db, $port, $login_db, $pass_db, $sel_db, $server_db);
72 72
 
73 73
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
74
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
74
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
75 75
 
76 76
 	// Completer le tableau decrivant la connexion
77 77
 
78 78
 	$GLOBALS['connexions'][$server_db]['prefixe'] = $table_prefix;
79 79
 	$GLOBALS['connexions'][$server_db]['db'] = $sel_db;
80 80
 
81
-	$old = sql_showbase($table_prefix . '_meta', $server_db);
81
+	$old = sql_showbase($table_prefix.'_meta', $server_db);
82 82
 	if ($old) {
83 83
 		$old = sql_fetch($old, $server_db);
84 84
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				$charset['charset'];
98 98
 			$charsetbase = $charset['charset'];
99 99
 		} else {
100
-			spip_log(_DEFAULT_CHARSET . ' inconnu du serveur SQL');
100
+			spip_log(_DEFAULT_CHARSET.' inconnu du serveur SQL');
101 101
 			$charsetbase = 'standard';
102 102
 		}
103 103
 		spip_log("Creation des tables. Codage $charsetbase");
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		if ($r) {
148 148
 			$r = sql_fetch($r, $server_db);
149 149
 		}
150
-		$version_installee = !$r ? 0 : (double)$r['valeur'];
150
+		$version_installee = !$r ? 0 : (double) $r['valeur'];
151 151
 		if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) {
152 152
 			$fupdateq(
153 153
 				'spip_meta',
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 				'',
157 157
 				$server_db
158 158
 			);
159
-			spip_log('nouvelle version installee: ' . $GLOBALS['spip_version_base']);
159
+			spip_log('nouvelle version installee: '.$GLOBALS['spip_version_base']);
160 160
 		}
161 161
 		// eliminer la derniere operation d'admin mal terminee
162 162
 		// notamment la mise a jour
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	if ($chmod_db) {
184 184
 		install_fichier_connexion(
185 185
 			_FILE_CHMOD_TMP,
186
-			"if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', " . sprintf('0%3o', $chmod_db) . ");\n"
186
+			"if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', ".sprintf('0%3o', $chmod_db).");\n"
187 187
 		);
188 188
 	}
189 189
 
@@ -246,16 +246,16 @@  discard block
 block discarded – undo
246 246
 
247 247
 
248 248
 function install_premier_auteur($email, $login, $nom, $pass, $hidden, $auteur_obligatoire) {
249
-	return info_progression_etape(3, 'etape_', 'install/') .
249
+	return info_progression_etape(3, 'etape_', 'install/').
250 250
 	info_etape(
251 251
 		_T('info_informations_personnelles'),
252
-		'<b>' . _T('texte_informations_personnelles_1') . '</b>' .
253
-		aider('install5', true) .
254
-		'<p>' .
252
+		'<b>'._T('texte_informations_personnelles_1').'</b>'.
253
+		aider('install5', true).
254
+		'<p>'.
255 255
 		($auteur_obligatoire ?
256 256
 			''
257 257
 			:
258
-			_T('texte_informations_personnelles_2') . ' ' . _T('info_laisser_champs_vides')
258
+			_T('texte_informations_personnelles_2').' '._T('info_laisser_champs_vides')
259 259
 		)
260 260
 	)
261 261
 	. generer_form_ecrire('install', (
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
 			_T('info_identification_publique'),
266 266
 			[
267 267
 				'nom' => [
268
-					'label' => '<b>' . _T('entree_signature') . "</b><br />\n" . _T('entree_nom_pseudo_1') . "\n",
268
+					'label' => '<b>'._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n",
269 269
 					'valeur' => $nom,
270 270
 					'required' => $auteur_obligatoire,
271 271
 				],
272 272
 				'email' => [
273
-					'label' => '<b>' . _T('entree_adresse_email') . "</b>\n",
273
+					'label' => '<b>'._T('entree_adresse_email')."</b>\n",
274 274
 					'valeur' => $email,
275 275
 				]
276 276
 			]
@@ -280,23 +280,23 @@  discard block
 block discarded – undo
280 280
 			_T('entree_identifiants_connexion'),
281 281
 			[
282 282
 				'login' => [
283
-					'label' => '<b>' . _T('entree_login') . "</b><br />\n" . _T(
283
+					'label' => '<b>'._T('entree_login')."</b><br />\n"._T(
284 284
 						'info_login_trop_court_car_pluriel',
285 285
 						['nb' => _LOGIN_TROP_COURT]
286
-					) . "\n",
286
+					)."\n",
287 287
 					'valeur' => $login,
288 288
 					'required' => $auteur_obligatoire,
289 289
 				],
290 290
 				'pass' => [
291
-					'label' => '<b>' . _T('entree_mot_passe') . "</b><br />\n" . _T(
291
+					'label' => '<b>'._T('entree_mot_passe')."</b><br />\n"._T(
292 292
 						'info_passe_trop_court_car_pluriel',
293 293
 						['nb' => _PASS_LONGUEUR_MINI]
294
-					) . "\n",
294
+					)."\n",
295 295
 					'valeur' => $pass,
296 296
 					'required' => $auteur_obligatoire,
297 297
 				],
298 298
 				'pass_verif' => [
299
-					'label' => '<b>' . _T('info_confirmer_passe') . "</b><br />\n",
299
+					'label' => '<b>'._T('info_confirmer_passe')."</b><br />\n",
300 300
 					'valeur' => $pass,
301 301
 					'required' => $auteur_obligatoire,
302 302
 				]
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 
341 341
 		if ($res) {
342 342
 			$res = info_progression_etape(2, 'etape_', 'install/', true)
343
-				. "<div class='error'><h3>" . _T('avis_operation_echec') . '</h3>'
343
+				. "<div class='error'><h3>"._T('avis_operation_echec').'</h3>'
344 344
 				. $res
345
-				. '<p>' . _T('texte_operation_echec') . '</p>'
345
+				. '<p>'._T('texte_operation_echec').'</p>'
346 346
 				. '</div>';
347 347
 		}
348 348
 	} else {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 
367 367
 		$hidden = predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db)
368 368
 			. (defined('_INSTALL_NAME_DB') ? ''
369
-				: "\n<input type='hidden' name='sel_db' value=\"" . spip_htmlspecialchars($sel_db) . '" />');
369
+				: "\n<input type='hidden' name='sel_db' value=\"".spip_htmlspecialchars($sel_db).'" />');
370 370
 
371 371
 		$auteur_obligatoire = ($ldap_present ? 0 : !sql_countsel('spip_auteurs', '', '', '', $server_db));
372 372
 
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +128 added lines, -129 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;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	// affichage "GIT [master: abcdef]"
235 235
 	$commit = $desc['commit_short'] ?? $desc['commit'];
236 236
 	if ($desc['branch']) {
237
-		$commit = $desc['branch'] . ': ' . $commit;
237
+		$commit = $desc['branch'].': '.$commit;
238 238
 	}
239 239
 	return "{$desc['vcs']} [$commit]";
240 240
 }
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 	}
254 254
 
255 255
 	// version installee par GIT
256
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
256
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
257 257
 		$currentHead = trim(substr($c, 4));
258
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
258
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
259 259
 			return [
260 260
 				'vcs' => 'GIT',
261 261
 				'branch' => basename($currentHead),
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
 		$dir = '.';
283 283
 	}
284 284
 	// version installee par SVN
285
-	if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) {
286
-		$db = new SQLite3($dir . '/.svn/wc.db');
285
+	if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) {
286
+		$db = new SQLite3($dir.'/.svn/wc.db');
287 287
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
288 288
 		if ($result) {
289 289
 			$row = $result->fetchArray();
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 
302 302
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
303 303
 // et laisser passer les fonctions personnelles baptisees image_...
304
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
305
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
306
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
307
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
308
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
309
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
304
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
305
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
306
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
307
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
308
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
309
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
310 310
 
311 311
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
312 312
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
  */
466 466
 function filtre_debug($val, $key = null) {
467 467
 	$debug = (
468
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
469
-		) . var_export($val, true);
468
+		is_null($key) ? '' : (var_export($key, true).' = ')
469
+		).var_export($val, true);
470 470
 
471 471
 	include_spip('inc/autoriser');
472 472
 	if (autoriser('webmestre')) {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 		$is_file = false;
523 523
 	}
524 524
 	if ($is_file) {
525
-		$is_local_file = function ($path) {
525
+		$is_local_file = function($path) {
526 526
 			if (strpos($path, '?') !== false) {
527 527
 				$path = supprimer_timestamp($path);
528 528
 				// remove ?24px added by find_in_theme on .svg files
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 					if ($mouseover = extraire_attribut($reduit, 'onmouseover')) {
572 572
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
573 573
 							$srcover = $match[1];
574
-							$srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args);
574
+							$srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args);
575 575
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
576 576
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
577 577
 						}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 	// " -> &quot; et tout ce genre de choses
973 973
 	$u = $GLOBALS['meta']['pcre_u'];
974 974
 	$texte = str_replace('&nbsp;', ' ', $texte);
975
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
975
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
976 976
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
977 977
 	$texte = entites_html($texte, false, false);
978 978
 	// mais bien echapper les double quotes !
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
  **/
1033 1033
 function supprimer_numero($texte) {
1034 1034
 	return preg_replace(
1035
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1035
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1036 1036
 		'',
1037 1037
 		$texte
1038 1038
 	);
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 function recuperer_numero($texte) {
1061 1061
 	if (
1062 1062
 		preg_match(
1063
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1063
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1064 1064
 			$texte,
1065 1065
 			$regs
1066 1066
 		)
@@ -1151,8 +1151,8 @@  discard block
 block discarded – undo
1151 1151
  **/
1152 1152
 function textebrut($texte) {
1153 1153
 	$u = $GLOBALS['meta']['pcre_u'];
1154
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1155
-	$texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte);
1154
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1155
+	$texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte);
1156 1156
 	$texte = preg_replace("/^\n+/", '', $texte);
1157 1157
 	$texte = preg_replace("/\n+$/", '', $texte);
1158 1158
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 		)
1187 1187
 	) {
1188 1188
 		foreach ($liens[0] as $a) {
1189
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1189
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1190 1190
 			$ablank = inserer_attribut($a, 'rel', $rel);
1191 1191
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1192 1192
 			$texte = str_replace($a, $ablank, $texte);
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 		foreach ($regs[0] as $a) {
1212 1212
 			$rel = extraire_attribut($a, 'rel') ?? '';
1213 1213
 			if (strpos($rel, 'nofollow') === false) {
1214
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1214
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1215 1215
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1216 1216
 				$texte = str_replace($a, $anofollow, $texte);
1217 1217
 			}
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 	$u = $GLOBALS['meta']['pcre_u'];
1241 1241
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1242 1242
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1243
-	$texte = preg_replace('@^\s*<br />@S' . $u, '', $texte);
1243
+	$texte = preg_replace('@^\s*<br />@S'.$u, '', $texte);
1244 1244
 
1245 1245
 	return $texte;
1246 1246
 }
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 		return $texte;
1272 1272
 	}
1273 1273
 	include_spip('inc/texte');
1274
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1274
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1275 1275
 		'div' : 'span';
1276 1276
 
1277 1277
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	}
1384 1384
 	$u = $GLOBALS['meta']['pcre_u'];
1385 1385
 	if ($textebrut) {
1386
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1386
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1387 1387
 	}
1388 1388
 	$texte = texte_backend($texte);
1389 1389
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 	# un message pour abs_url
1419 1419
 	$GLOBALS['mode_abs_url'] = 'url';
1420 1420
 	$url = trim($url);
1421
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1421
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1422 1422
 
1423 1423
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1424 1424
 }
@@ -1618,14 +1618,14 @@  discard block
 block discarded – undo
1618 1618
 	if (strpos($texte, '<') !== false) {
1619 1619
 		include_spip('inc/lien');
1620 1620
 		if (defined('_PREG_MODELE')) {
1621
-			$preg_modeles = '@' . _PREG_MODELE . '@imsS';
1621
+			$preg_modeles = '@'._PREG_MODELE.'@imsS';
1622 1622
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1623 1623
 		}
1624 1624
 	}
1625 1625
 
1626 1626
 	$debut = '';
1627 1627
 	$suite = $texte;
1628
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1628
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1629 1629
 		$debut .= substr($suite, 0, $t - 1);
1630 1630
 		$suite = substr($suite, $t);
1631 1631
 		$car = substr($suite, 0, 1);
@@ -1643,11 +1643,11 @@  discard block
 block discarded – undo
1643 1643
 			$suite = substr($suite, strlen($regs[0]));
1644 1644
 		}
1645 1645
 	}
1646
-	$texte = $debut . $suite;
1646
+	$texte = $debut.$suite;
1647 1647
 
1648 1648
 	$texte = echappe_retour($texte);
1649 1649
 
1650
-	return $texte . $fin;
1650
+	return $texte.$fin;
1651 1651
 }
1652 1652
 
1653 1653
 
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
 		}
1710 1710
 
1711 1711
 		foreach ($regs as $reg) {
1712
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1712
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1713 1713
 			$desc = $traduire($cle, $lang, true);
1714 1714
 			$l = $desc->langue;
1715 1715
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1823,9 +1823,9 @@  discard block
 block discarded – undo
1823 1823
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1824 1824
 					include_spip('inc/texte');
1825 1825
 					$trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad));
1826
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1826
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1827 1827
 					if ($mode === 'div') {
1828
-						$trad = rtrim($trad) . "\n\n";
1828
+						$trad = rtrim($trad)."\n\n";
1829 1829
 					}
1830 1830
 					$trad = code_echappement($trad, 'multi', false, $mode);
1831 1831
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -2025,7 +2025,7 @@  discard block
 block discarded – undo
2025 2025
 	if (is_array($balise)) {
2026 2026
 		array_walk(
2027 2027
 			$balise,
2028
-			function (&$a, $key, $t) {
2028
+			function(&$a, $key, $t) {
2029 2029
 				$a = extraire_attribut($a, $t);
2030 2030
 			},
2031 2031
 			$attribut
@@ -2122,14 +2122,14 @@  discard block
 block discarded – undo
2122 2122
 
2123 2123
 	if ($old !== null) {
2124 2124
 		// Remplacer l'ancien attribut du meme nom
2125
-		$balise = $r[1] . $insert . $r[5];
2125
+		$balise = $r[1].$insert.$r[5];
2126 2126
 	} else {
2127 2127
 		// preferer une balise " />" (comme <img />)
2128 2128
 		if (preg_match(',/>,', $balise)) {
2129
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
2129
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
2130 2130
 		} // sinon une balise <a ...> ... </a>
2131 2131
 		else {
2132
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
2132
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
2133 2133
 		}
2134 2134
 	}
2135 2135
 
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 		if (
2185 2185
 			$class_courante
2186 2186
 			and strpos($class_courante, (string) $c) !== false
2187
-			and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante)
2187
+			and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante)
2188 2188
 		) {
2189 2189
 			$is_class_presente = true;
2190 2190
 		}
@@ -2192,12 +2192,12 @@  discard block
 block discarded – undo
2192 2192
 			in_array($operation, ['ajouter', 'commuter'])
2193 2193
 			and !$is_class_presente
2194 2194
 		) {
2195
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2195
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2196 2196
 		} elseif (
2197 2197
 			in_array($operation, ['supprimer', 'commuter'])
2198 2198
 			and $is_class_presente
2199 2199
 		) {
2200
-			$class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new));
2200
+			$class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new));
2201 2201
 		}
2202 2202
 	}
2203 2203
 
@@ -2260,7 +2260,7 @@  discard block
 block discarded – undo
2260 2260
 // Quelques fonctions de calcul arithmetique
2261 2261
 //
2262 2262
 function floatstr($a) {
2263
- return str_replace(',', '.', (string)floatval($a));
2263
+ return str_replace(',', '.', (string) floatval($a));
2264 2264
 }
2265 2265
 function strize($f, $a, $b) {
2266 2266
  return floatstr($f(floatstr($a), floatstr($b)));
@@ -2396,13 +2396,13 @@  discard block
 block discarded – undo
2396 2396
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2397 2397
 		define('_TAGS_NOM_AUTEUR', '');
2398 2398
 	}
2399
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2399
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2400 2400
 	foreach ($tags_acceptes as $tag) {
2401 2401
 		if (strlen($tag)) {
2402
-			$remp1[] = '<' . trim($tag) . '>';
2403
-			$remp1[] = '</' . trim($tag) . '>';
2404
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2405
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2402
+			$remp1[] = '<'.trim($tag).'>';
2403
+			$remp1[] = '</'.trim($tag).'>';
2404
+			$remp2[] = '\x60'.trim($tag).'\x61';
2405
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2406 2406
 		}
2407 2407
 	}
2408 2408
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2522,10 +2522,10 @@  discard block
 block discarded – undo
2522 2522
 	$fichier = basename($url);
2523 2523
 
2524 2524
 	return '<a rel="enclosure"'
2525
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2526
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2527
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2528
-	. '>' . $fichier . '</a>';
2525
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2526
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2527
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2528
+	. '>'.$fichier.'</a>';
2529 2529
 }
2530 2530
 
2531 2531
 /**
@@ -2553,9 +2553,9 @@  discard block
 block discarded – undo
2553 2553
 			} # vieux data
2554 2554
 			$fichier = basename($url);
2555 2555
 			$enclosures[] = '<enclosure'
2556
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2557
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2558
-				. ($length ? ' length="' . $length . '"' : '')
2556
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2557
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2558
+				. ($length ? ' length="'.$length.'"' : '')
2559 2559
 				. ' />';
2560 2560
 		}
2561 2561
 	}
@@ -2581,7 +2581,7 @@  discard block
 block discarded – undo
2581 2581
 		if (extraire_attribut($e, 'rel') == 'tag') {
2582 2582
 			$subjects .= '<dc:subject>'
2583 2583
 				. texte_backend(textebrut($e))
2584
-				. '</dc:subject>' . "\n";
2584
+				. '</dc:subject>'."\n";
2585 2585
 		}
2586 2586
 	}
2587 2587
 
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 	if (is_array($texte)) {
2618 2618
 		array_walk(
2619 2619
 			$texte,
2620
-			function (&$a, $key, $t) {
2620
+			function(&$a, $key, $t) {
2621 2621
 				$a = extraire_balise($a, $t);
2622 2622
 			},
2623 2623
 			$tag
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
 	if (is_array($texte)) {
2666 2666
 		array_walk(
2667 2667
 			$texte,
2668
-			function (&$a, $key, $t) {
2668
+			function(&$a, $key, $t) {
2669 2669
 				$a = extraire_balises($a, $t);
2670 2670
 			},
2671 2671
 			$tag
@@ -2798,7 +2798,7 @@  discard block
 block discarded – undo
2798 2798
 		if ($fond != '404') {
2799 2799
 			$contexte = array_shift($p);
2800 2800
 			$contexte['page'] = $fond;
2801
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2801
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2802 2802
 		}
2803 2803
 	}
2804 2804
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2853,9 +2853,9 @@  discard block
 block discarded – undo
2853 2853
 			. '"'
2854 2854
 			. (is_null($val)
2855 2855
 				? ''
2856
-				: ' value="' . entites_html($val) . '"'
2856
+				: ' value="'.entites_html($val).'"'
2857 2857
 			)
2858
-			. ' type="hidden"' . "\n/>";
2858
+			. ' type="hidden"'."\n/>";
2859 2859
 	}
2860 2860
 
2861 2861
 	return join('', $hidden);
@@ -2965,7 +2965,7 @@  discard block
 block discarded – undo
2965 2965
 
2966 2966
 	return preg_replace_callback(
2967 2967
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2968
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2968
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2969 2969
 		$contenu
2970 2970
 	);
2971 2971
 }
@@ -3026,14 +3026,14 @@  discard block
 block discarded – undo
3026 3026
 	) {
3027 3027
 		$distant = true;
3028 3028
 		$cssf = parse_url($css);
3029
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
3029
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
3030 3030
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
3031 3031
 	} else {
3032 3032
 		$distant = false;
3033 3033
 		$cssf = $css;
3034 3034
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
3035 3035
 		//propose (rien a faire dans ce cas)
3036
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
3036
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
3037 3037
 		if (@file_exists($f)) {
3038 3038
 			return $f;
3039 3039
 		}
@@ -3043,7 +3043,7 @@  discard block
 block discarded – undo
3043 3043
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
3044 3044
 	$f = $dir_var
3045 3045
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
3046
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
3046
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
3047 3047
 
3048 3048
 	// la css peut etre distante (url absolue !)
3049 3049
 	if ($distant) {
@@ -3089,8 +3089,8 @@  discard block
 block discarded – undo
3089 3089
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
3090 3090
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
3091 3091
 			$css_direction = substr($css_direction, strlen($dir_var));
3092
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
3093
-			$css_direction = '/@@@@@@/' . $css_direction;
3092
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
3093
+			$css_direction = '/@@@@@@/'.$css_direction;
3094 3094
 		}
3095 3095
 		$src[] = $regs[0][$k];
3096 3096
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
 
3140 3140
 	$f = basename($css, '.css');
3141 3141
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3142
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3142
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3143 3143
 		. '.css';
3144 3144
 
3145 3145
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
 	if ($url_absolue_css == $css) {
3150 3150
 		if (
3151 3151
 			strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3152
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3152
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3153 3153
 		) {
3154 3154
 			include_spip('inc/distant');
3155 3155
 			$contenu = recuperer_url($css);
@@ -3261,7 +3261,7 @@  discard block
 block discarded – undo
3261 3261
 	$expression = str_replace('\/', '/', $expression);
3262 3262
 	$expression = str_replace('/', '\/', $expression);
3263 3263
 
3264
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3264
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3265 3265
 		if (isset($r[$capte])) {
3266 3266
 			return $r[$capte];
3267 3267
 		} else {
@@ -3299,7 +3299,7 @@  discard block
 block discarded – undo
3299 3299
 	$expression = str_replace('\/', '/', $expression);
3300 3300
 	$expression = str_replace('/', '\/', $expression);
3301 3301
 
3302
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3302
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3303 3303
 }
3304 3304
 
3305 3305
 
@@ -3318,7 +3318,7 @@  discard block
 block discarded – undo
3318 3318
 function traiter_doublons_documents(&$doublons, $letexte) {
3319 3319
 
3320 3320
 	// Verifier dans le texte & les notes (pas beau, helas)
3321
-	$t = $letexte . $GLOBALS['les_notes'];
3321
+	$t = $letexte.$GLOBALS['les_notes'];
3322 3322
 
3323 3323
 	if (
3324 3324
 		strstr($t, 'spip_document_') // evite le preg_match_all si inutile
@@ -3332,7 +3332,7 @@  discard block
 block discarded – undo
3332 3332
 		if (!isset($doublons['documents'])) {
3333 3333
 			$doublons['documents'] = '';
3334 3334
 		}
3335
-		$doublons['documents'] .= ',' . join(',', $matches[1]);
3335
+		$doublons['documents'] .= ','.join(',', $matches[1]);
3336 3336
 	}
3337 3337
 
3338 3338
 	return $letexte;
@@ -3389,7 +3389,7 @@  discard block
 block discarded – undo
3389 3389
 	if ($env) {
3390 3390
 		foreach ($env as $i => $j) {
3391 3391
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3392
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3392
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3393 3393
 			}
3394 3394
 		}
3395 3395
 	}
@@ -3428,7 +3428,7 @@  discard block
 block discarded – undo
3428 3428
 	if ($env) {
3429 3429
 		foreach ($env as $i => $j) {
3430 3430
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3431
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3431
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3432 3432
 			}
3433 3433
 		}
3434 3434
 	}
@@ -3502,10 +3502,10 @@  discard block
 block discarded – undo
3502 3502
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3503 3503
 	if (
3504 3504
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3505
-		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg'
3505
+		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg'
3506 3506
 		and file_exists($variante_svg_generique)
3507 3507
 	) {
3508
-		if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) {
3508
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) {
3509 3509
 			$img_file = $variante_svg_size;
3510 3510
 		}
3511 3511
 		else {
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 				return '';
3564 3564
 			}
3565 3565
 		}
3566
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3566
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3567 3567
 	}
3568 3568
 
3569 3569
 	if (file_exists($img_file)) {
@@ -3573,14 +3573,14 @@  discard block
 block discarded – undo
3573 3573
 		$alt = '';
3574 3574
 	}
3575 3575
 	elseif ($alt or $alt === '') {
3576
-		$alt = " alt='" . attribut_html($alt) . "'";
3576
+		$alt = " alt='".attribut_html($alt)."'";
3577 3577
 	}
3578 3578
 	else {
3579
-		$alt = " alt='" . attribut_html($title) . "'";
3579
+		$alt = " alt='".attribut_html($title)."'";
3580 3580
 	}
3581 3581
 	return "<img src='$img_file'$alt"
3582
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3583
-	. ' ' . ltrim($atts)
3582
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3583
+	. ' '.ltrim($atts)
3584 3584
 	. ' />';
3585 3585
 }
3586 3586
 
@@ -3594,10 +3594,10 @@  discard block
 block discarded – undo
3594 3594
  */
3595 3595
 function http_style_background($img, $att = '', $size = null) {
3596 3596
 	if ($size and is_numeric($size)) {
3597
-		$size = trim($size) . 'px';
3597
+		$size = trim($size).'px';
3598 3598
 	}
3599
-	return " style='background" .
3600
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3599
+	return " style='background".
3600
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3601 3601
 		. ($size ? "background-size:{$size};" : '')
3602 3602
 		. "'";
3603 3603
 }
@@ -3712,7 +3712,7 @@  discard block
 block discarded – undo
3712 3712
 		$img = http_img_pack(
3713 3713
 			$img,
3714 3714
 			$alt,
3715
-			$class ? " class='" . attribut_html($class) . "'" : '',
3715
+			$class ? " class='".attribut_html($class)."'" : '',
3716 3716
 			'',
3717 3717
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3718 3718
 		);
@@ -3797,7 +3797,7 @@  discard block
 block discarded – undo
3797 3797
 	$balise_svg_source = $balise_svg;
3798 3798
 
3799 3799
 	// entete XML à supprimer
3800
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3800
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3801 3801
 
3802 3802
 	// IE est toujours mon ami
3803 3803
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3815,9 +3815,9 @@  discard block
 block discarded – undo
3815 3815
 	// regler le alt
3816 3816
 	if ($alt) {
3817 3817
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3818
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3818
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3819 3819
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3820
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3820
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3821 3821
 		$balise_svg .= $title;
3822 3822
 	}
3823 3823
 	else {
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
 	if (is_array($tableau)) {
3866 3866
 		foreach ($tableau as $k => $v) {
3867 3867
 			$res = recuperer_fond(
3868
-				'modeles/' . $modele,
3868
+				'modeles/'.$modele,
3869 3869
 				array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v]))
3870 3870
 			);
3871 3871
 			$texte .= $res;
@@ -4050,7 +4050,7 @@  discard block
 block discarded – undo
4050 4050
 	}
4051 4051
 
4052 4052
 	$c = serialize($c);
4053
-	$cle = calculer_cle_action($form . $c);
4053
+	$cle = calculer_cle_action($form.$c);
4054 4054
 	$c = "$cle:$c";
4055 4055
 
4056 4056
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -4108,15 +4108,15 @@  discard block
 block discarded – undo
4108 4108
 	}
4109 4109
 	// toujours encoder l'url source dans le bloc ajax
4110 4110
 	$r = self();
4111
-	$r = ' data-origin="' . $r . '"';
4111
+	$r = ' data-origin="'.$r.'"';
4112 4112
 	$class = 'ajaxbloc';
4113 4113
 	if ($ajaxid and is_string($ajaxid)) {
4114 4114
 		// ajaxid est normalement conforme a un nom de classe css
4115 4115
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
4116
-		$class .= ' ajax-id-' . entites_html($ajaxid);
4116
+		$class .= ' ajax-id-'.entites_html($ajaxid);
4117 4117
 	}
4118 4118
 
4119
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4119
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4120 4120
 }
4121 4121
 
4122 4122
 /**
@@ -4160,7 +4160,7 @@  discard block
 block discarded – undo
4160 4160
 		$cle = substr($c, 0, $p);
4161 4161
 		$c = substr($c, $p + 1);
4162 4162
 
4163
-		if ($cle == calculer_cle_action($form . $c)) {
4163
+		if ($cle == calculer_cle_action($form.$c)) {
4164 4164
 			$env = @unserialize($c);
4165 4165
 			return $env;
4166 4166
 		}
@@ -4281,13 +4281,13 @@  discard block
 block discarded – undo
4281 4281
 				}
4282 4282
 			}
4283 4283
 		}
4284
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4284
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4285 4285
 	} else {
4286 4286
 		$bal = 'a';
4287 4287
 		$att = "href='$url'"
4288
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4289
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4290
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4288
+			. ($title ? " title='".attribut_html($title)."'" : '')
4289
+			. ($class ? " class='".attribut_html($class)."'" : '')
4290
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4291 4291
 			. $evt;
4292 4292
 	}
4293 4293
 	if ($libelle === null) {
@@ -4426,7 +4426,7 @@  discard block
 block discarded – undo
4426 4426
 
4427 4427
 	// Icône
4428 4428
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4429
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4429
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4430 4430
 
4431 4431
 	// Markup final
4432 4432
 	if ($type == 'lien') {
@@ -4701,20 +4701,20 @@  discard block
 block discarded – undo
4701 4701
 		$class_form = 'ajax';
4702 4702
 		$class = str_replace('ajax', '', $class);
4703 4703
 	}
4704
-	$class_btn = 'submit ' . trim($class);
4704
+	$class_btn = 'submit '.trim($class);
4705 4705
 
4706 4706
 	if ($confirm) {
4707
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4707
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4708 4708
 		if ($callback) {
4709 4709
 			$callback = "$confirm?($callback):false";
4710 4710
 		} else {
4711 4711
 			$callback = $confirm;
4712 4712
 		}
4713 4713
 	}
4714
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4714
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4715 4715
 	$title = $title ? " title='$title'" : '';
4716 4716
 
4717
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4717
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4718 4718
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4719 4719
 }
4720 4720
 
@@ -4779,14 +4779,14 @@  discard block
 block discarded – undo
4779 4779
 		$champ_titre = '';
4780 4780
 		if ($demande_titre) {
4781 4781
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4782
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4782
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4783 4783
 		}
4784 4784
 		include_spip('base/abstract_sql');
4785 4785
 		include_spip('base/connect_sql');
4786 4786
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4787
-			'*' . $champ_titre,
4787
+			'*'.$champ_titre,
4788 4788
 			$desc['table_sql'],
4789
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4789
+			id_table_objet($type_objet).' = '.intval($id_objet)
4790 4790
 		);
4791 4791
 
4792 4792
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4879,8 +4879,7 @@  discard block
 block discarded – undo
4879 4879
 	if (isset($ligne_sql['chapo'])) {
4880 4880
 		$chapo = $ligne_sql['chapo'];
4881 4881
 		$texte = strlen($descriptif) ?
4882
-			'' :
4883
-			"$chapo \n\n $texte";
4882
+			'' : "$chapo \n\n $texte";
4884 4883
 	}
4885 4884
 
4886 4885
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4955,7 +4954,7 @@  discard block
 block discarded – undo
4955 4954
 		return $texte;
4956 4955
 	}
4957 4956
 
4958
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4957
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4959 4958
 
4960 4959
 	// signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag
4961 4960
 	if (test_espace_prive()) {
@@ -4994,7 +4993,7 @@  discard block
 block discarded – undo
4994 4993
 	}
4995 4994
 	$url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect);
4996 4995
 
4997
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4996
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4998 4997
 }
4999 4998
 
5000 4999
 /**
@@ -5020,10 +5019,10 @@  discard block
 block discarded – undo
5020 5019
 function wrap($texte, $wrap) {
5021 5020
 	$balises = extraire_balises($wrap);
5022 5021
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
5023
-		$texte = $wrap . $texte;
5022
+		$texte = $wrap.$texte;
5024 5023
 		$regs = array_reverse($regs[1]);
5025
-		$wrap = '</' . implode('></', $regs) . '>';
5026
-		$texte = $texte . $wrap;
5024
+		$wrap = '</'.implode('></', $regs).'>';
5025
+		$texte = $texte.$wrap;
5027 5026
 	}
5028 5027
 
5029 5028
 	return $texte;
@@ -5054,7 +5053,7 @@  discard block
 block discarded – undo
5054 5053
 
5055 5054
 	// caster $u en array si besoin
5056 5055
 	if (is_object($u)) {
5057
-		$u = (array)$u;
5056
+		$u = (array) $u;
5058 5057
 	}
5059 5058
 
5060 5059
 	if (is_array($u)) {
@@ -5076,7 +5075,7 @@  discard block
 block discarded – undo
5076 5075
 		// sinon on passe a la ligne et on indente
5077 5076
 		$i_str = str_pad('', $indent, ' ');
5078 5077
 		foreach ($u as $k => $v) {
5079
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
5078
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
5080 5079
 		}
5081 5080
 
5082 5081
 		return $out;
@@ -5130,7 +5129,7 @@  discard block
 block discarded – undo
5130 5129
  * @return string
5131 5130
  */
5132 5131
 function objet_icone($objet, $taille = 24, $class = '') {
5133
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
5132
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
5134 5133
 	$icone = chemin_image($icone);
5135 5134
 	$balise_img = charger_filtre('balise_img');
5136 5135
 
@@ -5156,7 +5155,7 @@  discard block
 block discarded – undo
5156 5155
  */
5157 5156
 function objet_T($objet, $chaine, $args = [], $options = []) {
5158 5157
 	$chaine = explode(':', $chaine);
5159
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
5158
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
5160 5159
 		return $t;
5161 5160
 	}
5162 5161
 	$chaine = implode(':', $chaine);
@@ -5222,7 +5221,7 @@  discard block
 block discarded – undo
5222 5221
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
5223 5222
 
5224 5223
 	// calculer le nom de la css
5225
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5224
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5226 5225
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
5227 5226
 	$contexte_implicite = calculer_contexte_implicite();
5228 5227
 
@@ -5230,14 +5229,14 @@  discard block
 block discarded – undo
5230 5229
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5231 5230
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5232 5231
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5233
-		$hash = md5($contexte_implicite['host'] . '::' . $cache);
5232
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5234 5233
 	}
5235 5234
 	else {
5236 5235
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5237 5236
 		ksort($contexte);
5238
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
5237
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
5239 5238
 	}
5240
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5239
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5241 5240
 
5242 5241
 	// mettre a jour le fichier si il n'existe pas
5243 5242
 	// ou trop ancien
@@ -5245,8 +5244,8 @@  discard block
 block discarded – undo
5245 5244
 	// et recopie sur le fichier cible uniquement si il change
5246 5245
 	if (
5247 5246
 		!file_exists($filename)
5248
-		or !file_exists($filename . '.last')
5249
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified'])
5247
+		or !file_exists($filename.'.last')
5248
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified'])
5250 5249
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5251 5250
 	) {
5252 5251
 		$contenu = $cache['texte'];
@@ -5270,10 +5269,10 @@  discard block
 block discarded – undo
5270 5269
 			}
5271 5270
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5272 5271
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5273
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5272
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5274 5273
 		}
5275 5274
 		// et ecrire le fichier si il change
5276
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5275
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5277 5276
 	}
5278 5277
 
5279 5278
 	return timestamp($filename);
@@ -5506,7 +5505,7 @@  discard block
 block discarded – undo
5506 5505
 	if ($e > 0 and strlen($mid) > 8) {
5507 5506
 		$mid = '***...***';
5508 5507
 	}
5509
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5508
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5510 5509
 }
5511 5510
 
5512 5511
 
@@ -5568,7 +5567,7 @@  discard block
 block discarded – undo
5568 5567
 		case 'id':
5569 5568
 		case 'anchor':
5570 5569
 			if (preg_match(',^\d,', $texte)) {
5571
-				$texte = substr($type, 0, 1) . $texte;
5570
+				$texte = substr($type, 0, 1).$texte;
5572 5571
 			}
5573 5572
 	}
5574 5573
 
@@ -5578,9 +5577,9 @@  discard block
 block discarded – undo
5578 5577
 
5579 5578
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5580 5579
 		if (preg_match(',^\d,', $texte)) {
5581
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5580
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5582 5581
 		}
5583
-		$texte .= $separateur . md5($original);
5582
+		$texte .= $separateur.md5($original);
5584 5583
 		$texte = substr($texte, 0, $longueur_mini);
5585 5584
 	}
5586 5585
 
Please login to merge, or discard this patch.
ecrire/inc/filtres_mini.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	if ($query) {
48
-		$url .= '?' . $query;
48
+		$url .= '?'.$query;
49 49
 	}
50 50
 
51
-	return '/' . preg_replace(',^/,S', '', $url);
51
+	return '/'.preg_replace(',^/,S', '', $url);
52 52
 }
53 53
 
54 54
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) {
79 79
 		$r = array_pad($r, 3, '');
80 80
 
81
-		return $r[1] . resolve_path($r[2]);
81
+		return $r[1].resolve_path($r[2]);
82 82
 	}
83 83
 
84 84
 	# L'url site spip est un lien absolu aussi
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 	}
100 100
 	switch (substr($lien, 0, 1)) {
101 101
 		case '/':
102
-			return $debut . resolve_path($lien);
102
+			return $debut.resolve_path($lien);
103 103
 		case '#':
104
-			return $debut . resolve_path($dir . $mot . $get . $lien);
104
+			return $debut.resolve_path($dir.$mot.$get.$lien);
105 105
 		case '':
106
-			return $debut . resolve_path($dir . $mot . $get . $hash);
106
+			return $debut.resolve_path($dir.$mot.$get.$hash);
107 107
 		default:
108
-			return $debut . resolve_path($dir . $lien);
108
+			return $debut.resolve_path($dir.$lien);
109 109
 	}
110 110
 }
111 111
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		return '';
134 134
 	}
135 135
 	if (!$base) {
136
-		$base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
136
+		$base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
137 137
 	}
138 138
 
139 139
 	return suivre_lien($base, $url);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  * @param array $protocoles_autorises
157 157
  * @return bool
158 158
  */
159
-function protocole_verifier($url_absolue, $protocoles_autorises = ['http','https']) {
159
+function protocole_verifier($url_absolue, $protocoles_autorises = ['http', 'https']) {
160 160
 
161 161
 	if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) {
162 162
 		$protocole = $m[1];
Please login to merge, or discard this patch.
ecrire/public/references.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	$select = true
125 125
 ) {
126 126
 	if (!is_string($defaut)) {
127
-		$defaut = '($Pile[0][\'' . strtolower($nom_champ) . '\'] ?? null)';
127
+		$defaut = '($Pile[0][\''.strtolower($nom_champ).'\'] ?? null)';
128 128
 	}
129 129
 
130 130
 	$idb_origine = $idb;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			}
158 158
 			// renseigner la boucle source de ce champ pour les traitements
159 159
 			$boucles[$idb_origine]->index_champ[$nom_champ_origine] = $idb;
160
-			$champ = '$Pile[$SP' . ($i ? "-$i" : '') . '][\'' . $c . '\']';
160
+			$champ = '$Pile[$SP'.($i ? "-$i" : '').'][\''.$c.'\']';
161 161
 			if (!$joker) {
162 162
 				return index_compose($conditionnel, $champ);
163 163
 			}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 function index_compose($conditionnel, $defaut) {
199 199
 	while ($c = array_pop($conditionnel)) {
200 200
 		// si on passe defaut = '', ne pas générer d'erreur de compilation.
201
-		$defaut = "($c:(" . ($defaut ?: "''") . '))';
201
+		$defaut = "($c:(".($defaut ?: "''").'))';
202 202
 	}
203 203
 
204 204
 	return $defaut;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	if (!$r) {
246 246
 		$joker = false; // indiquer a l'appelant
247 247
 		# continuer pour chercher l'erreur suivante
248
-		return ["'#" . $r . ':' . $nom_champ . "'", ''];
248
+		return ["'#".$r.':'.$nom_champ."'", ''];
249 249
 	}
250 250
 
251 251
 	$desc = $boucles[$idb]->show;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	if (preg_match('/^(.*)\.(.*)$/', $nom_champ, $r)) {
288 288
 		[, $_table, $_nom_champ] = $r;
289 289
 		if ($cle = trouver_jointure_champ($_nom_champ, $boucles[$idb], [$_table])) {
290
-			$_alias = $cle . '_' . $_nom_champ;
290
+			$_alias = $cle.'_'.$_nom_champ;
291 291
 			return index_exception(
292 292
 				$boucles[$idb],
293 293
 				$desc,
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 			$t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep);
368 368
 		}
369 369
 		if ($t == null) {
370
-			[$e, $x] = $excep;  #PHP4 affecte de gauche a droite
371
-			$excep = $x;    #PHP5 de droite a gauche !
370
+			[$e, $x] = $excep; #PHP4 affecte de gauche a droite
371
+			$excep = $x; #PHP5 de droite a gauche !
372 372
 			$j = $trouver_table($e, $boucle->sql_serveur);
373 373
 			if (!$j) {
374 374
 				return ['', ''];
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 					$l = (preg_split('/\s*,\s*/', $k));
381 381
 					$k = $desc['key']['PRIMARY KEY'];
382 382
 					if (!in_array($k, $l)) {
383
-						spip_log("jointure impossible $e " . join(',', $l));
383
+						spip_log("jointure impossible $e ".join(',', $l));
384 384
 
385 385
 						return ['', ''];
386 386
 					}
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	// demander a SQL de gerer le synonyme
397 397
 	// ca permet que excep soit dynamique (Cedric, 2/3/06)
398 398
 	if ($excep != $nom_champ) {
399
-		$excep .= ' AS ' . $nom_champ;
399
+		$excep .= ' AS '.$nom_champ;
400 400
 	}
401 401
 
402 402
 	return ["$t.$excep", $nom_champ];
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 		join(',', $collecte),
631 631
 		($collecte ? $param : substr($param, 1)), # virer la virgule
632 632
 		memoriser_contexte_compil($p),
633
-		(!$supp ? '' : (', ' . join(',', $supp)))
633
+		(!$supp ? '' : (', '.join(',', $supp)))
634 634
 	);
635 635
 
636 636
 	$p->interdire_scripts = false;
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	$nom = $p->id_boucle;
733 733
 
734 734
 	if ($nom and trouver_nom_serveur_distant($p)) {
735
-		spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit'));
735
+		spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit'));
736 736
 
737 737
 		return false;
738 738
 	}
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			(strpos($ps, 'typo') !== false)
818 818
 		)
819 819
 	) {
820
-		$ps = 'traiter_doublons_documents($doublons, ' . $ps . ')';
820
+		$ps = 'traiter_doublons_documents($doublons, '.$ps.')';
821 821
 	}
822 822
 
823 823
 	// La protection des champs par |safehtml est assuree par les extensions
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 function compose_filtres_args($p, $args, $sep) {
936 936
 	$arglist = '';
937 937
 	foreach ($args as $arg) {
938
-		$arglist .= $sep .
938
+		$arglist .= $sep.
939 939
 			calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle);
940 940
 	}
941 941
 
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
 	while ($b != '') {
986 986
 		foreach ($p->boucles[$b]->criteres as $critere) {
987 987
 			if ($critere->op == $motif) {
988
-				$p->code = '$Pile[$SP' . (($n == 0) ? '' : "-$n") .
988
+				$p->code = '$Pile[$SP'.(($n == 0) ? '' : "-$n").
989 989
 					"]['$champ']";
990 990
 				$b = '';
991 991
 				break 2;
@@ -1013,6 +1013,6 @@  discard block
 block discarded – undo
1013 1013
  */
1014 1014
 function zbug_presenter_champ($p, $champ = '') {
1015 1015
 	$balise = $champ ?: $p->nom_champ;
1016
-	$explicite = $p->nom_boucle ? $p->nom_boucle . ':' : '';
1016
+	$explicite = $p->nom_boucle ? $p->nom_boucle.':' : '';
1017 1017
 	return "#{$explicite}{$balise}";
1018 1018
 }
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
  */
359 359
 function balise_DOSSIER_SQUELETTE_dist($p) {
360 360
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
361
-	$p->code = "_DIR_RACINE . '$code'" .
361
+	$p->code = "_DIR_RACINE . '$code'".
362 362
 		$p->interdire_scripts = false;
363 363
 
364 364
 	return $p;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
  */
378 378
 function balise_SQUELETTE_dist($p) {
379 379
 	$code = addslashes($p->descr['sourcefile']);
380
-	$p->code = "'$code'" .
380
+	$p->code = "'$code'".
381 381
 		$p->interdire_scripts = false;
382 382
 
383 383
 	return $p;
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
  **/
430 430
 function balise_NOM_SITE_dist($p) {
431 431
 	if (!$p->etoile) {
432
-		$p->code = 'supprimer_numero(calculer_url(' .
433
-			champ_sql('url_site', $p) . ',' .
434
-			champ_sql('nom_site', $p) .
432
+		$p->code = 'supprimer_numero(calculer_url('.
433
+			champ_sql('url_site', $p).','.
434
+			champ_sql('nom_site', $p).
435 435
 			", 'titre', \$connect, false))";
436 436
 	} else {
437 437
 		$p->code = champ_sql('nom_site', $p);
@@ -582,8 +582,8 @@  discard block
 block discarded – undo
582 582
  *     Pile complétée par le code à générer
583 583
  **/
584 584
 function balise_POPULARITE_ABSOLUE_dist($p) {
585
-	$p->code = 'ceil(' .
586
-		champ_sql('popularite', $p) .
585
+	$p->code = 'ceil('.
586
+		champ_sql('popularite', $p).
587 587
 		')';
588 588
 	$p->interdire_scripts = false;
589 589
 
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);
665 665
 ;
666 666
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
667
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
667
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
668 668
 	}
669 669
 	$p->interdire_scripts = true;
670 670
 
@@ -804,16 +804,16 @@  discard block
 block discarded – undo
804 804
 	$trouver_table = charger_fonction('trouver_table', 'base');
805 805
 	if ($desc = $trouver_table(table_objet_sql($type_objet))) {
806 806
 		if (isset($desc['field']['descriptif'])) {
807
-			$_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ',';
807
+			$_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).',';
808 808
 		}
809 809
 		if (isset($desc['field']['texte'])) {
810
-			$_ligne .= "'texte' => " . champ_sql('texte', $p) . ',';
810
+			$_ligne .= "'texte' => ".champ_sql('texte', $p).',';
811 811
 		}
812 812
 		if (isset($desc['field']['chapo'])) {
813
-			$_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ',';
813
+			$_ligne .= "'chapo' => ".champ_sql('chapo', $p).',';
814 814
 		}
815 815
 		if (isset($desc['introduction_longueur'])) {
816
-			$_introduction_longueur = "'" . $desc['introduction_longueur'] . "'";
816
+			$_introduction_longueur = "'".$desc['introduction_longueur']."'";
817 817
 		}
818 818
 	}
819 819
 	$_ligne .= ')';
@@ -909,10 +909,10 @@  discard block
 block discarded – undo
909 909
 		$p->code = sprintf(
910 910
 			CODE_RECUPERER_FOND,
911 911
 			"'modeles/lesauteurs'",
912
-			"array('objet'=>'" . $objet .
913
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
914
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
915
-			($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) .
912
+			"array('objet'=>'".$objet.
913
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
914
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
915
+			($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)).
916 916
 			')',
917 917
 			"'trim'=>true, 'compil'=>array($c)",
918 918
 			_q($connect)
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
 					$m = trim($m);
982 982
 					if ($m != "''") {
983 983
 						if (!preg_match(',\W,', $m)) {
984
-							$m = $boucle->id_table . ".$m";
984
+							$m = $boucle->id_table.".$m";
985 985
 						}
986 986
 
987 987
 						$m .= ' AS titre_rang';
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 	$f_pagination = chercher_filtre('pagination');
1143 1143
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1144 1144
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1145
-		: ("'debut" . substr($type, 1));
1145
+		: ("'debut".substr($type, 1));
1146 1146
 
1147 1147
 	$p->code = sprintf(
1148 1148
 		CODE_PAGINATION,
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']];
1286 1286
 		erreur_squelette($msg, $p);
1287 1287
 	} else {
1288
-		$p->code = 'find_in_path((string)' . $arg . ')';
1288
+		$p->code = 'find_in_path((string)'.$arg.')';
1289 1289
 	}
1290 1290
 
1291 1291
 	$p->interdire_scripts = false;
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']];
1321 1321
 		erreur_squelette($msg, $p);
1322 1322
 	} else {
1323
-		$p->code = 'chemin_image((string)' . $arg . ')';
1323
+		$p->code = 'chemin_image((string)'.$arg.')';
1324 1324
 	}
1325 1325
 
1326 1326
 	$p->interdire_scripts = false;
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1375 1375
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1376 1376
 		if ($src) {
1377
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1377
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1378 1378
 		} else {
1379 1379
 			$p->code = 'serialize($Pile[0]??[])';
1380 1380
 		}
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
 	$_sinon = interprete_argument_balise(2, $p);
1428 1428
 	$_unserialize = sinon(interprete_argument_balise(3, $p), 'false');
1429 1429
 
1430
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1431
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1430
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1431
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1432 1432
 
1433 1433
 	return $p;
1434 1434
 }
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 		$err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']];
1522 1522
 		erreur_squelette($err_b_s_a, $p);
1523 1523
 	} else {
1524
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1524
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1525 1525
 	}
1526 1526
 
1527 1527
 	$p->interdire_scripts = false;
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
 			)
1570 1570
 		) {
1571 1571
 			$p->code = /* $r[1]. */
1572
-				'(' . $r[2] . ')';
1572
+				'('.$r[2].')';
1573 1573
 		} else {
1574 1574
 			$p->code = "eval('return '.$php.';')";
1575 1575
 		}
@@ -1813,9 +1813,9 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
 		// noter la duree du cache dans un entete proprietaire
1815 1815
 
1816
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1816
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1817 1817
 			. $duree
1818
-			. '"); ?' . "'.'>'";
1818
+			. '"); ?'."'.'>'";
1819 1819
 
1820 1820
 		// Remplir le header Cache-Control
1821 1821
 		// cas #CACHE{0}
@@ -1836,9 +1836,9 @@  discard block
 block discarded – undo
1836 1836
 				$pa == 'cache-client'
1837 1837
 				and $duree > 0
1838 1838
 			) {
1839
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1839
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1840 1840
 					. $duree
1841
-					. '"); ?' . "'.'>'";
1841
+					. '"); ?'."'.'>'";
1842 1842
 				// il semble logique, si on cache-client, de ne pas invalider
1843 1843
 				$pa = 'statique';
1844 1844
 			}
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
 				$pa == 'statique'
1848 1848
 				and $duree > 0
1849 1849
 			) {
1850
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1850
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1851 1851
 			}
1852 1852
 		}
1853 1853
 	} else {
@@ -2011,9 +2011,9 @@  discard block
 block discarded – undo
2011 2011
 		if ($p->etoile) {
2012 2012
 			$_options[] = "'etoile'=>true";
2013 2013
 		}
2014
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')';
2014
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')';
2015 2015
 
2016
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2016
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2017 2017
 		if ($flag_env) {
2018 2018
 			$_l = "array_merge(\$Pile[0],$_l)";
2019 2019
 		}
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']];
2024 2024
 		erreur_squelette($msg, $p);
2025 2025
 	} else {
2026
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2026
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2027 2027
 	}
2028 2028
 
2029 2029
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 		unset($_contexte[1]);
2072 2072
 
2073 2073
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2074
-			$nom = "'modeles/" . substr($nom, 1);
2074
+			$nom = "'modeles/".substr($nom, 1);
2075 2075
 		} else {
2076 2076
 			$nom = "'modeles/' . $nom";
2077 2077
 		}
@@ -2088,8 +2088,8 @@  discard block
 block discarded – undo
2088 2088
 			$primary = $p->boucles[$p->id_boucle]->primary;
2089 2089
 			if (!strpos($primary, ',')) {
2090 2090
 				$id = champ_sql($primary, $p);
2091
-				$_contexte[] = "'$primary'=>" . $id;
2092
-				$_contexte[] = "'id'=>" . $id;
2091
+				$_contexte[] = "'$primary'=>".$id;
2092
+				$_contexte[] = "'id'=>".$id;
2093 2093
 			}
2094 2094
 		}
2095 2095
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2101,11 +2101,11 @@  discard block
 block discarded – undo
2101 2101
 		$_options = memoriser_contexte_compil($p);
2102 2102
 		$_options = "'compil'=>array($_options), 'trim'=>true";
2103 2103
 		if (isset($_contexte['ajax'])) {
2104
-			$_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2104
+			$_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2105 2105
 			unset($_contexte['ajax']);
2106 2106
 		}
2107 2107
 
2108
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2108
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2109 2109
 		if ($flag_env) {
2110 2110
 			$_l = "array_merge(\$Pile[0],$_l)";
2111 2111
 		}
@@ -2215,12 +2215,12 @@  discard block
 block discarded – undo
2215 2215
 function balise_DOUBLONS_dist($p) {
2216 2216
 	if ($type = interprete_argument_balise(1, $p)) {
2217 2217
 		if ($famille = interprete_argument_balise(2, $p)) {
2218
-			$type .= '.' . $famille;
2218
+			$type .= '.'.$famille;
2219 2219
 		}
2220
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2220
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2221 2221
 		if (!$p->etoile) {
2222 2222
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2223
-				. $p->code . ')))';
2223
+				. $p->code.')))';
2224 2224
 		}
2225 2225
 	} else {
2226 2226
 		$p->code = '$doublons';
@@ -2349,7 +2349,7 @@  discard block
 block discarded – undo
2349 2349
 			$_code[] = "$_key => $_val";
2350 2350
 		}
2351 2351
 	} while ($_key && $_val);
2352
-	$p->code = 'array(' . join(', ', $_code) . ')';
2352
+	$p->code = 'array('.join(', ', $_code).')';
2353 2353
 	$p->interdire_scripts = false;
2354 2354
 
2355 2355
 	return $p;
@@ -2376,7 +2376,7 @@  discard block
 block discarded – undo
2376 2376
 	while ($_val = interprete_argument_balise($n++, $p)) {
2377 2377
 		$_code[] = $_val;
2378 2378
 	}
2379
-	$p->code = 'array(' . join(', ', $_code) . ')';
2379
+	$p->code = 'array('.join(', ', $_code).')';
2380 2380
 	$p->interdire_scripts = false;
2381 2381
 
2382 2382
 	return $p;
@@ -2421,10 +2421,10 @@  discard block
 block discarded – undo
2421 2421
 		$_code[] = $_v;
2422 2422
 	}
2423 2423
 
2424
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(
2424
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(
2425 2425
 		', ',
2426 2426
 		$_code
2427
-	) . ')?" ":"")';
2427
+	).')?" ":"")';
2428 2428
 	$p->interdire_scripts = false;
2429 2429
 
2430 2430
 	return $p;
@@ -2457,7 +2457,7 @@  discard block
 block discarded – undo
2457 2457
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2458 2458
 
2459 2459
 	$f = chercher_filtre('info_plugin');
2460
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2460
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2461 2461
 
2462 2462
 	return $p;
2463 2463
 }
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
 	}
2690 2690
 
2691 2691
 	// Différentes infos relatives au tri présentes dans les modificateurs
2692
-	$_tri_nom = $boucle->modificateur['tri_nom'] ; // nom du paramètre définissant le tri
2692
+	$_tri_nom = $boucle->modificateur['tri_nom']; // nom du paramètre définissant le tri
2693 2693
 	$_tri_champ = $boucle->modificateur['tri_champ']; // champ actuel utilisé le tri
2694 2694
 	$_tri_sens = $boucle->modificateur['tri_sens']; // sens de tri actuel
2695 2695
 	$_tri_liste_sens_defaut = $boucle->modificateur['tri_liste_sens_defaut']; // sens par défaut pour chaque champ
@@ -2784,7 +2784,7 @@  discard block
 block discarded – undo
2784 2784
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2785 2785
 	}
2786 2786
 
2787
-	$p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')";
2787
+	$p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')";
2788 2788
 	$p->interdire_scripts = false;
2789 2789
 
2790 2790
 	return $p;
Please login to merge, or discard this patch.
ecrire/auth/spip.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$row = sql_fetsel(
50 50
 			'*',
51 51
 			'spip_auteurs',
52
-			'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'",
52
+			'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'",
53 53
 			'',
54 54
 			'',
55 55
 			'',
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
 		// legacy = md5 ou sha256
79 79
 		case 32:
80 80
 			// tres anciens mots de passe encodes en md5(alea.pass)
81
-			$hash = md5($row['alea_actuel'] . $pass);
81
+			$hash = md5($row['alea_actuel'].$pass);
82 82
 			$methode = 'md5';
83 83
 		case 64:
84 84
 			if (empty($hash)) {
85 85
 				// anciens mots de passe encodes en sha256(alea.pass)
86 86
 				include_spip('auth/sha256.inc');
87
-				$hash = spip_sha256($row['alea_actuel'] . $pass);
87
+				$hash = spip_sha256($row['alea_actuel'].$pass);
88 88
 				$methode = 'sha256';
89 89
 			}
90 90
 			if ($row['pass'] === $hash) {
91
-				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth' . _LOG_DEBUG);
91
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG);
92 92
 				// ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth
93 93
 				if (!empty($row['backup_cles'])) {
94
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
94
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
95 95
 				}
96 96
 				break;
97 97
 			}
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
 				and !empty($row['backup_cles'])
110 110
 			) {
111 111
 				if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) {
112
-					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE);
112
+					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE);
113 113
 					if ($cles->save()) {
114 114
 						$secret = $cles->getSecretAuth();
115 115
 					}
116 116
 					else {
117
-						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
117
+						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
118 118
 						// et on echoue car on ne veut pas que la situation reste telle quelle
119
-						raler_fichier(_DIR_ETC . 'cles.php');
119
+						raler_fichier(_DIR_ETC.'cles.php');
120 120
 					}
121 121
 				}
122 122
 				else {
123
-					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR);
124
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
123
+					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR);
124
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
125 125
 				}
126 126
 			}
127 127
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				unset($row);
130 130
 			}
131 131
 			else {
132
-				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth' . _LOG_DEBUG);
132
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG);
133 133
 			}
134 134
 			break;
135 135
 	}
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 			@sql_update(
177 177
 				'spip_auteurs',
178 178
 				$set,
179
-				'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote(
179
+				'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote(
180 180
 					$row['pass'],
181 181
 					$serveur,
182 182
 					'text'
@@ -224,24 +224,24 @@  discard block
 block discarded – undo
224 224
 
225 225
 	// si force, on ne verifie pas la presence d'un backup chez un webmestre
226 226
 	if ($force) {
227
-		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE);
227
+		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE);
228 228
 		$secret = $cles->getSecretAuth(true);
229 229
 		return true;
230 230
 	}
231 231
 
232
-	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''");
232
+	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''");
233 233
 	$has_backup = array_column($has_backup, 'id_auteur');
234 234
 	if (empty($has_backup)) {
235
-		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE);
235
+		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE);
236 236
 		if ($secret = $cles->getSecretAuth(true)) {
237 237
 			return true;
238 238
 		}
239
-		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
239
+		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
240 240
 		// et on echoue car on ne veut pas que la situation reste telle quelle
241
-		raler_fichier(_DIR_ETC . 'cles.php');
241
+		raler_fichier(_DIR_ETC.'cles.php');
242 242
 	}
243 243
 	else {
244
-		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR);
244
+		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR);
245 245
 	}
246 246
 	return false;
247 247
 }
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 	$flux['data'] .=
259 259
 		  '<script type="text/javascript">/*<![CDATA[*/'
260 260
 		. "$js\n"
261
-		. "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "',"
262
-		. "'page_auteur': '" . generer_url_public('informer_auteur') . "',"
261
+		. "var login_info={'login':'".$flux['args']['contexte']['var_login']."',"
262
+		. "'page_auteur': '".generer_url_public('informer_auteur')."',"
263 263
 		. "'informe_auteur_en_cours':false,"
264 264
 		. "'attente_informe':0};"
265 265
 		. "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});"
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 		} else {
303 303
 			$n = sql_countsel(
304 304
 				'spip_auteurs',
305
-				'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'",
305
+				'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'",
306 306
 				'',
307 307
 				'',
308 308
 				$serveur
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	}
331 331
 	if (
332 332
 		!$id_auteur = intval($id_auteur)
333
-		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
333
+		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
334 334
 	) {
335 335
 		return false;
336 336
 	}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 		$anciens = sql_allfetsel(
346 346
 			'id_auteur',
347 347
 			'spip_auteurs',
348
-			'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'",
348
+			'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'",
349 349
 			'',
350 350
 			'',
351 351
 			'',
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 		$r = sql_getfetsel(
380 380
 			'login',
381 381
 			'spip_auteurs',
382
-			"statut<>'5poubelle'" .
383
-			' AND (length(pass)>0)' .
382
+			"statut<>'5poubelle'".
383
+			' AND (length(pass)>0)'.
384 384
 			" AND (login=$l)",
385 385
 			'',
386 386
 			'',
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
 		return sql_getfetsel(
400 400
 			'login',
401 401
 			'spip_auteurs',
402
-			"statut<>'5poubelle'" .
403
-			' AND (length(pass)>0)' .
402
+			"statut<>'5poubelle'".
403
+			' AND (length(pass)>0)'.
404 404
 			" AND (login<>'' AND (nom=$l OR email=$l))",
405 405
 			'',
406 406
 			'',
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 
470 470
 	if (
471 471
 		!$id_auteur = intval($id_auteur)
472
-		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
472
+		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
473 473
 	) {
474 474
 		return false;
475 475
 	}
@@ -530,8 +530,8 @@  discard block
 block discarded – undo
530 530
 		or isset($champs['statut'])
531 531
 		or (isset($options['all']) and $options['all'])
532 532
 	) {
533
-		$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
534
-		$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
533
+		$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
534
+		$htpasswd = _DIR_TMP._AUTH_USER_FILE;
535 535
 
536 536
 		// Cette variable de configuration peut etre posee par un plugin
537 537
 		// par exemple acces_restreint ;
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 			and !@file_exists($htaccess)
542 542
 		) {
543 543
 			spip_unlink($htpasswd);
544
-			spip_unlink($htpasswd . '-admin');
544
+			spip_unlink($htpasswd.'-admin');
545 545
 
546 546
 			return;
547 547
 		}
@@ -559,16 +559,16 @@  discard block
 block discarded – undo
559 559
 		);
560 560
 		while ($t = sql_fetch($s)) {
561 561
 			if (strlen($t['login']) and strlen($t['htpass'])) {
562
-				$p1 .= $t['login'] . ':' . $t['htpass'] . "\n";
562
+				$p1 .= $t['login'].':'.$t['htpass']."\n";
563 563
 				if ($t['statut'] == '0minirezo') {
564
-					$p2 .= $t['login'] . ':' . $t['htpass'] . "\n";
564
+					$p2 .= $t['login'].':'.$t['htpass']."\n";
565 565
 				}
566 566
 			}
567 567
 		}
568 568
 		sql_free($s);
569 569
 		if ($p1) {
570 570
 			ecrire_fichier($htpasswd, $p1);
571
-			ecrire_fichier($htpasswd . '-admin', $p2);
571
+			ecrire_fichier($htpasswd.'-admin', $p2);
572 572
 			spip_log("Ecriture de $htpasswd et $htpasswd-admin");
573 573
 		}
574 574
 	}
Please login to merge, or discard this patch.
ecrire/src/Chiffrer/Chiffrement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		$nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
32 32
 		$padded_message = sodium_pad($message, 16);
33 33
 		$encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key);
34
-		$encoded = base64_encode($salt . $nonce . $encrypted);
34
+		$encoded = base64_encode($salt.$nonce.$encrypted);
35 35
 		sodium_memzero($key);
36 36
 		sodium_memzero($nonce);
37 37
 		sodium_memzero($salt);
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 		$decoded = base64_decode($encoded);
49 49
 		$salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES);
50 50
 		$nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
51
-		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
51
+		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES +\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
52 52
 		$key = self::deriveKeyFromPassword($key, $salt);
53 53
 		$padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key);
54 54
 		sodium_memzero($key);
55 55
 		sodium_memzero($nonce);
56 56
 		sodium_memzero($salt);
57 57
 		if ($padded_message === false) {
58
-			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG);
58
+			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer'._LOG_DEBUG);
59 59
 			return null;
60 60
 		}
61 61
 		$message = sodium_unpad($padded_message, 16);
Please login to merge, or discard this patch.