Completed
Push — master ( 0b0cf9...f2008e )
by cam
01:42
created
ecrire/inc/session.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
 	spip_log("supprimer sessions auteur $id_auteur", 'session');
82 82
 	if ($toutes || $id_auteur !== $GLOBALS['visiteur_session']['id_auteur']) {
83 83
 		if ($dir = opendir(_DIR_SESSIONS)) {
84
-			$t = $_SERVER['REQUEST_TIME']  - (4 * _RENOUVELLE_ALEA); // 48h par defaut
85
-			$t_short = $_SERVER['REQUEST_TIME']  - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
84
+			$t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut
85
+			$t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
86 86
 			while (($f = readdir($dir)) !== false) {
87 87
 				$nb_files++;
88 88
 				if (preg_match(',^[^\d-]*(-?\d+)_\w{32}\.php[3]?$,', $f, $regs)) {
89
-					$f = _DIR_SESSIONS . $f;
89
+					$f = _DIR_SESSIONS.$f;
90 90
 					if ($actives && $regs[1] == $id_auteur || $t > filemtime($f)) {
91 91
 						spip_unlink($f);
92 92
 					}
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		(!$cookie = lire_cookie_session())
174 174
 		|| intval($cookie) !== $id_auteur
175 175
 	) {
176
-		$cookie = $id_auteur . '_' . md5(uniqid(random_int(0, mt_getrandmax()), true));
176
+		$cookie = $id_auteur.'_'.md5(uniqid(random_int(0, mt_getrandmax()), true));
177 177
 	}
178 178
 
179 179
 	// Maintenant on sait qu'on a des choses à écrire
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	} else {
207 207
 		$fichier_session = chemin_fichier_session('alea_ephemere', $cookie);
208 208
 		if (!ecrire_fichier_session($fichier_session, $auteur)) {
209
-			spip_log('Echec ecriture fichier session ' . $fichier_session, 'session' . _LOG_HS);
209
+			spip_log('Echec ecriture fichier session '.$fichier_session, 'session'._LOG_HS);
210 210
 			include_spip('inc/minipres');
211 211
 			echo minipres();
212 212
 			exit;
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 	if (autoriser('ecrire', '', '', $auteur) && _DUREE_COOKIE_ADMIN) {
230 230
 		spip_setcookie(
231 231
 			'spip_admin',
232
-			'@' . ($auteur['email'] ?: $auteur['login']),
232
+			'@'.($auteur['email'] ?: $auteur['login']),
233 233
 			time() + max(_DUREE_COOKIE_ADMIN, $duree),
234
-			httponly: true
234
+			httponly : true
235 235
 		);
236 236
 	} else {
237 237
 		// sinon le supprimer ...
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 			$coef = 20;
270 270
 		}
271 271
 	}
272
-	return (int)(_RENOUVELLE_ALEA * $coef);
272
+	return (int) (_RENOUVELLE_ALEA * $coef);
273 273
 }
274 274
 
275 275
 /**
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
 			// Renouveler la session avec l'alea courant
383 383
 			include($fichier_session);
384
-			spip_log('renouvelle session ' . $GLOBALS['visiteur_session']['id_auteur'], 'session');
384
+			spip_log('renouvelle session '.$GLOBALS['visiteur_session']['id_auteur'], 'session');
385 385
 			spip_unlink($fichier_session);
386 386
 			ajouter_session($GLOBALS['visiteur_session']);
387 387
 		}
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 	}
631 631
 
632 632
 	// liste des sessions
633
-	$sessions = preg_files(_DIR_SESSIONS, '/' . $id_auteur . '_.*\.php$');
633
+	$sessions = preg_files(_DIR_SESSIONS, '/'.$id_auteur.'_.*\.php$');
634 634
 
635 635
 	// si on en a plus que la limite, supprimer les plus vieilles
636 636
 	// si ce ne sont pas des sessions anonymes car elles sont alors chacune differentes
@@ -708,12 +708,12 @@  discard block
 block discarded – undo
708 708
 	$auteur = preparer_ecriture_session($auteur);
709 709
 
710 710
 	// enregistrer les autres donnees du visiteur
711
-	$texte = '<' . "?php\n";
711
+	$texte = '<'."?php\n";
712 712
 	foreach ($auteur as $var => $val) {
713
-		$texte .= '$GLOBALS[\'visiteur_session\'][' . var_export($var, true) . '] = '
714
-			. var_export($val, true) . ";\n";
713
+		$texte .= '$GLOBALS[\'visiteur_session\']['.var_export($var, true).'] = '
714
+			. var_export($val, true).";\n";
715 715
 	}
716
-	$texte .= '?' . ">\n";
716
+	$texte .= '?'.">\n";
717 717
 
718 718
 	return ecrire_fichier($fichier, $texte);
719 719
 }
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 
738 738
 	$repertoire = sous_repertoire(_DIR_SESSIONS, '', false, $tantpis);
739 739
 	$id_auteur = intval($cookie_session);
740
-	return $repertoire . $id_auteur . '_' . md5($cookie_session . ' ' . $GLOBALS['meta'][$alea]) . '.php';
740
+	return $repertoire.$id_auteur.'_'.md5($cookie_session.' '.$GLOBALS['meta'][$alea]).'.php';
741 741
 }
742 742
 
743 743
 /**
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
  * @return string
766 766
  */
767 767
 function rejouer_session() {
768
-	return '<img src="' . generer_url_action('cookie', 'change_session=oui', true) . '" width="0" height="0" alt="" />';
768
+	return '<img src="'.generer_url_action('cookie', 'change_session=oui', true).'" width="0" height="0" alt="" />';
769 769
 }
770 770
 
771 771
 
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 		return $res;
781 781
 	}
782 782
 
783
-	return $res = md5($GLOBALS['ip'] . ($_SERVER['HTTP_USER_AGENT'] ?? ''));
783
+	return $res = md5($GLOBALS['ip'].($_SERVER['HTTP_USER_AGENT'] ?? ''));
784 784
 }
785 785
 
786 786
 
Please login to merge, or discard this patch.
ecrire/inc/charsets.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		$charset = 'cp1256';
90 90
 	}
91 91
 
92
-	if (find_in_path($charset . '.php', 'charsets/', true)) {
92
+	if (find_in_path($charset.'.php', 'charsets/', true)) {
93 93
 		return $charset;
94 94
 	} else {
95 95
 		spip_log("Erreur: pas de fichier de conversion 'charsets/$charset'");
@@ -190,38 +190,38 @@  discard block
 block discarded – undo
190 190
 
191 191
 	if (!isset($trans[$charset][$charset_cible])) {
192 192
 		$trans[$charset][$charset_cible] = [
193
-			$p . chr(128) => '&#8364;',
194
-			$p . chr(129) => ' ', # pas affecte
195
-			$p . chr(130) => '&#8218;',
196
-			$p . chr(131) => '&#402;',
197
-			$p . chr(132) => '&#8222;',
198
-			$p . chr(133) => '&#8230;',
199
-			$p . chr(134) => '&#8224;',
200
-			$p . chr(135) => '&#8225;',
201
-			$p . chr(136) => '&#710;',
202
-			$p . chr(137) => '&#8240;',
203
-			$p . chr(138) => '&#352;',
204
-			$p . chr(139) => '&#8249;',
205
-			$p . chr(140) => '&#338;',
206
-			$p . chr(141) => ' ', # pas affecte
207
-			$p . chr(142) => '&#381;',
208
-			$p . chr(143) => ' ', # pas affecte
209
-			$p . chr(144) => ' ', # pas affecte
210
-			$p . chr(145) => '&#8216;',
211
-			$p . chr(146) => '&#8217;',
212
-			$p . chr(147) => '&#8220;',
213
-			$p . chr(148) => '&#8221;',
214
-			$p . chr(149) => '&#8226;',
215
-			$p . chr(150) => '&#8211;',
216
-			$p . chr(151) => '&#8212;',
217
-			$p . chr(152) => '&#732;',
218
-			$p . chr(153) => '&#8482;',
219
-			$p . chr(154) => '&#353;',
220
-			$p . chr(155) => '&#8250;',
221
-			$p . chr(156) => '&#339;',
222
-			$p . chr(157) => ' ', # pas affecte
223
-			$p . chr(158) => '&#382;',
224
-			$p . chr(159) => '&#376;',
193
+			$p.chr(128) => '&#8364;',
194
+			$p.chr(129) => ' ', # pas affecte
195
+			$p.chr(130) => '&#8218;',
196
+			$p.chr(131) => '&#402;',
197
+			$p.chr(132) => '&#8222;',
198
+			$p.chr(133) => '&#8230;',
199
+			$p.chr(134) => '&#8224;',
200
+			$p.chr(135) => '&#8225;',
201
+			$p.chr(136) => '&#710;',
202
+			$p.chr(137) => '&#8240;',
203
+			$p.chr(138) => '&#352;',
204
+			$p.chr(139) => '&#8249;',
205
+			$p.chr(140) => '&#338;',
206
+			$p.chr(141) => ' ', # pas affecte
207
+			$p.chr(142) => '&#381;',
208
+			$p.chr(143) => ' ', # pas affecte
209
+			$p.chr(144) => ' ', # pas affecte
210
+			$p.chr(145) => '&#8216;',
211
+			$p.chr(146) => '&#8217;',
212
+			$p.chr(147) => '&#8220;',
213
+			$p.chr(148) => '&#8221;',
214
+			$p.chr(149) => '&#8226;',
215
+			$p.chr(150) => '&#8211;',
216
+			$p.chr(151) => '&#8212;',
217
+			$p.chr(152) => '&#732;',
218
+			$p.chr(153) => '&#8482;',
219
+			$p.chr(154) => '&#353;',
220
+			$p.chr(155) => '&#8250;',
221
+			$p.chr(156) => '&#339;',
222
+			$p.chr(157) => ' ', # pas affecte
223
+			$p.chr(158) => '&#382;',
224
+			$p.chr(159) => '&#376;',
225 225
 		];
226 226
 		if ($charset_cible != 'unicode') {
227 227
 			foreach ($trans[$charset][$charset_cible] as $k => $c) {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 			// Sinon, peut-etre connaissons-nous ce charset ?
368 368
 			if (!isset($trans[$charset]) && (($cset = load_charset($charset)) && is_array($GLOBALS['CHARSET'][$cset]))) {
369 369
 				foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) {
370
-					$trans[$charset][chr($key)] = '&#' . $val . ';';
370
+					$trans[$charset][chr($key)] = '&#'.$val.';';
371 371
 				}
372 372
 			}
373 373
 			if (isset($trans[$charset]) && (is_countable($trans[$charset]) ? count($trans[$charset]) : 0)) {
@@ -432,11 +432,11 @@  discard block
 block discarded – undo
432 432
 					$h = dechex($e);
433 433
 					if ($s = isset($CHARSET_REVERSE[$charset][$e])) {
434 434
 						$s = $CHARSET_REVERSE[$charset][$e];
435
-						$t['&#' . $e . ';'] = $t['&#0' . $e . ';'] = $t['&#00' . $e . ';'] = chr($s);
436
-						$t['&#x' . $h . ';'] = $t['&#x0' . $h . ';'] = $t['&#x00' . $h . ';'] = chr($s);
435
+						$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($s);
436
+						$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($s);
437 437
 					} else {
438
-						$t['&#' . $e . ';'] = $t['&#0' . $e . ';'] = $t['&#00' . $e . ';'] = chr($e);
439
-						$t['&#x' . $h . ';'] = $t['&#x0' . $h . ';'] = $t['&#x00' . $h . ';'] = chr($e);
438
+						$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($e);
439
+						$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($e);
440 440
 					}
441 441
 				}
442 442
 			}
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 			&& is_array($GLOBALS['CHARSET'][$cset]))
483 483
 		) {
484 484
 			foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) {
485
-				$trans[$charset][chr($key)] = unicode2charset('&#' . $val . ';');
485
+				$trans[$charset][chr($key)] = unicode2charset('&#'.$val.';');
486 486
 			}
487 487
 		}
488 488
 		if (is_countable($trans[$charset]) ? count($trans[$charset]) : 0) {
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 				}
589 589
 				$thisPos++;
590 590
 			}
591
-			$encodedLetter = '&#' . preg_replace('/^0+/', '', $decimalCode) . ';';
591
+			$encodedLetter = '&#'.preg_replace('/^0+/', '', $decimalCode).';';
592 592
 			$encodedString .= $encodedLetter;
593 593
 		}
594 594
 	}
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 			} // ignorer le BOM - http://www.unicode.org/faq/utf_bom.html
632 632
 			else {
633 633
 				if ($word != 65279) {
634
-					$texte .= '&#' . $word . ';';
634
+					$texte .= '&#'.$word.';';
635 635
 				}
636 636
 			}
637 637
 		}
@@ -659,13 +659,13 @@  discard block
 block discarded – undo
659 659
 		return chr($num);
660 660
 	}
661 661
 	if ($num < 2048) {
662
-		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
662
+		return chr(($num >> 6) + 192).chr(($num & 63) + 128);
663 663
 	}
664 664
 	if ($num < 65536) {
665
-		return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
665
+		return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
666 666
 	}
667 667
 	if ($num < 1_114_112) {
668
-		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
668
+		return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
669 669
 	}
670 670
 
671 671
 	return '';
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	while (preg_match(',&#0*(\d+);,S', $texte, $regs) && !isset($vu[$regs[1]])) {
733 733
 		$num = $regs[1];
734 734
 		$vu[$num] = true;
735
-		$s = '\u' . sprintf('%04x', $num);
735
+		$s = '\u'.sprintf('%04x', $num);
736 736
 		$texte = str_replace($regs[0], $s, $texte);
737 737
 	}
738 738
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
  **/
750 750
 function javascript_to_unicode($texte) {
751 751
 	while (preg_match(',%u([0-9A-F][0-9A-F][0-9A-F][0-9A-F]),', $texte, $regs)) {
752
-		$texte = str_replace($regs[0], '&#' . hexdec($regs[1]) . ';', $texte);
752
+		$texte = str_replace($regs[0], '&#'.hexdec($regs[1]).';', $texte);
753 753
 	}
754 754
 
755 755
 	return $texte;
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 		return '';
795 795
 	}
796 796
 
797
-	$table_translit = 'translit' . $complexe;
797
+	$table_translit = 'translit'.$complexe;
798 798
 
799 799
 	// 2. Translitterer grace a la table predefinie
800 800
 	if (!isset($trans[$complexe])) {
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
  *    true s'il a un BOM
890 890
  **/
891 891
 function bom_utf8($texte): bool {
892
-	return (substr($texte, 0, 3) === chr(0xEF) . chr(0xBB) . chr(0xBF));
892
+	return (substr($texte, 0, 3) === chr(0xEF).chr(0xBB).chr(0xBF));
893 893
 }
894 894
 
895 895
 /**
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 
1057 1057
 	$lettre1 = mb_strtoupper(spip_substr($c, 0, 1));
1058 1058
 
1059
-	return $lettre1 . spip_substr($c, 1);
1059
+	return $lettre1.spip_substr($c, 1);
1060 1060
 }
1061 1061
 
1062 1062
 /**
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +127 added lines, -128 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	if (strlen($dossier) && !str_ends_with($dossier, '/')) {
53 53
 		$dossier .= '/';
54 54
 	}
55
-	$f = str_replace('/', '_', $dossier) . $nom;
55
+	$f = str_replace('/', '_', $dossier).$nom;
56 56
 
57 57
 	if (function_exists($f)) {
58 58
 		return $f;
59 59
 	}
60
-	if (function_exists($g = $f . '_dist')) {
60
+	if (function_exists($g = $f.'_dist')) {
61 61
 		return $g;
62 62
 	}
63 63
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	// passer en minuscules (cf les balises de formulaires)
79 79
 	// et inclure le fichier
80 80
 	if (
81
-		!($inc = include_spip($dossier . ($d = strtolower($nom))))
81
+		!($inc = include_spip($dossier.($d = strtolower($nom))))
82 82
 		&& strlen(dirname($dossier))
83 83
 		&& dirname($dossier) != '.'
84 84
 	) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	// Echec : message d'erreur
99
-	spip_log("fonction $nom ($f ou $g) indisponible" .
99
+	spip_log("fonction $nom ($f ou $g) indisponible".
100 100
 		($inc ? '' : " (fichier $d absent de $dossier)"));
101 101
 
102 102
 	include_spip('inc/minipres');
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	echo minipres(
105 105
 		_T('forum_titre_erreur'),
106 106
 		$inc ?
107
-			_T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>'])
107
+			_T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>'])
108 108
 			. '<br />'
109
-			. _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>'])
109
+			. _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
110 110
 			:
111
-			_T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']),
112
-		['all_inline' => true,'status' => 404]
111
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
112
+		['all_inline' => true, 'status' => 404]
113 113
 	);
114 114
 	exit;
115 115
 }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *     - string : chemin du fichier trouvé
156 156
  **/
157 157
 function include_spip($f, $include = true) {
158
-	return find_in_path($f . '.php', '', $include);
158
+	return find_in_path($f.'.php', '', $include);
159 159
 }
160 160
 
161 161
 /**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  *     - string : chemin du fichier trouvé
176 176
  **/
177 177
 function require_spip($f) {
178
-	return find_in_path($f . '.php', '', 'required');
178
+	return find_in_path($f.'.php', '', 'required');
179 179
 }
180 180
 
181 181
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		// donc il faut l'inclure "en globals"
193 193
 		if ($f = find_in_path('mes_fonctions.php')) {
194 194
 			global $dossier_squelettes;
195
-			include_once(_ROOT_CWD . $f);
195
+			include_once(_ROOT_CWD.$f);
196 196
 		}
197 197
 
198 198
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	}
298 298
 
299 299
 	// appliquer notre fonction si elle existe
300
-	$fonc = 'execute_pipeline_' . strtolower($action);
300
+	$fonc = 'execute_pipeline_'.strtolower($action);
301 301
 	if (function_exists($fonc)) {
302 302
 		$val = $fonc($val);
303 303
 	} // plantage ?
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 function spip_log($message = null, $name = null) {
363 363
 	static $pre = [];
364 364
 	static $log;
365
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
365
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
366 366
 	if (!isset($regs[1]) || !$logname = $regs[1]) {
367 367
 		$logname = null;
368 368
 	}
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 		if (!is_string($message)) {
391 391
 			$message = print_r($message, true);
392 392
 		}
393
-		$log($pre[$niveau] . ' ' . $message, $logname);
393
+		$log($pre[$niveau].' '.$message, $logname);
394 394
 	}
395 395
 }
396 396
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	foreach ($regexp as $r => $e) {
598 598
 		$regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e));
599 599
 	}
600
-	$regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,';
600
+	$regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,';
601 601
 	$ajouts = array_flip(explode('|', $c));
602 602
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
603 603
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 			// Ajout. Pour une variable, remplacer au meme endroit,
625 625
 			// pour un tableau ce sera fait dans la prochaine boucle
626 626
 			elseif (!str_ends_with($r[1], '[]')) {
627
-				$url[$n] = $r[1] . '=' . $u;
627
+				$url[$n] = $r[1].'='.$u;
628 628
 				unset($ajouts[$r[1]]);
629 629
 			}
630 630
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -645,11 +645,11 @@  discard block
 block discarded – undo
645 645
 	} elseif ($testv) {
646 646
 		foreach ($ajouts as $k => $n) {
647 647
 			if (!is_array($v)) {
648
-				$url[] = $k . '=' . $u;
648
+				$url[] = $k.'='.$u;
649 649
 			} else {
650
-				$id = (str_ends_with($k, '[]')) ? $k : ($k . '[]');
650
+				$id = (str_ends_with($k, '[]')) ? $k : ($k.'[]');
651 651
 				foreach ($v as $w) {
652
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
652
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
653 653
 				}
654 654
 			}
655 655
 		}
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 
661 661
 	// recomposer l'adresse
662 662
 	if ($url) {
663
-		$a .= '?' . join($sep, $url);
663
+		$a .= '?'.join($sep, $url);
664 664
 	}
665 665
 
666
-	return $a . $ancre;
666
+	return $a.$ancre;
667 667
 }
668 668
 
669 669
 /**
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			translitteration($ancre)
694 694
 		);
695 695
 	}
696
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
696
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
697 697
 }
698 698
 
699 699
 /**
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 			if (str_starts_with($var, '^')) {
739 739
 				$var = substr($var, 1);
740 740
 			} else {
741
-				$var = '[^=&]*' . $var;
741
+				$var = '[^=&]*'.$var;
742 742
 			}
743 743
 			if (str_ends_with($var, '$')) {
744 744
 				$var = substr($var, 0, -1);
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 				$var .= '[^=&]*';
747 747
 			}
748 748
 		}
749
-		$preg_nettoyer = ',([?&])(' . implode('|', $preg_nettoyer_vars) . ')=[^&]*(&|$),i';
749
+		$preg_nettoyer = ',([?&])('.implode('|', $preg_nettoyer_vars).')=[^&]*(&|$),i';
750 750
 	}
751 751
 	if (empty($request_uri)) {
752 752
 		return $request_uri;
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
  * @return bool
834 834
  */
835 835
 function test_plugin_actif($plugin) {
836
-	return ($plugin && defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
836
+	return ($plugin && defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
837 837
 }
838 838
 
839 839
 /**
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 					$value = interdire_scripts($value, -1);
966 966
 				}
967 967
 				if (!empty($options['class'])) {
968
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
968
+					$value = "<span class='".$options['class']."'>$value</span>";
969 969
 				}
970 970
 				$text = str_replace("@$name@", (string) $value, (string) $text);
971 971
 				unset($args[$name]);
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 		// Si des variables n'ont pas ete inserees, le signaler
975 975
 		// (chaines de langues pas a jour)
976 976
 		if ($args) {
977
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
977
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
978 978
 		}
979 979
 	}
980 980
 
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 function joli_repertoire($rep) {
999 999
 	$a = substr($rep, 0, 1);
1000 1000
 	if ($a <> '.' && $a <> '/') {
1001
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
1001
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
1002 1002
 	}
1003 1003
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
1004 1004
 
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 			$p -= ($x * 1000);
1053 1053
 		}
1054 1054
 
1055
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1055
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1056 1056
 	}
1057 1057
 }
1058 1058
 
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 	if ($taches && count($taches) && !spip_connect()) {
1120 1120
 		return false;
1121 1121
 	}
1122
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1122
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1123 1123
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1124 1124
 		return $genie($taches);
1125 1125
 	}
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 
1223 1223
 	if ($queue_next_job_time == -1) {
1224 1224
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1225
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1225
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1226 1226
 		}
1227 1227
 		// utiliser un cache memoire si dispo
1228 1228
 		if (function_exists('cache_get') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) {
@@ -1292,8 +1292,8 @@  discard block
 block discarded – undo
1292 1292
 		$src = '';
1293 1293
 	}
1294 1294
 	if ($script) {
1295
-		$script = ("/*<![CDATA[*/\n" .
1296
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1295
+		$script = ("/*<![CDATA[*/\n".
1296
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1297 1297
 			'/*]]>*/');
1298 1298
 	}
1299 1299
 	if ($noscript) {
@@ -1382,13 +1382,13 @@  discard block
 block discarded – undo
1382 1382
 	if ($path_base == null) {
1383 1383
 		// Chemin standard depuis l'espace public
1384 1384
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1385
-			_DIR_RACINE . ':' .
1386
-			_DIR_RACINE . 'squelettes-dist/:' .
1387
-			_DIR_RACINE . 'prive/:' .
1385
+			_DIR_RACINE.':'.
1386
+			_DIR_RACINE.'squelettes-dist/:'.
1387
+			_DIR_RACINE.'prive/:'.
1388 1388
 			_DIR_RESTREINT;
1389 1389
 		// Ajouter squelettes/
1390
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1391
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1390
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1391
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1392 1392
 		}
1393 1393
 		foreach (explode(':', $path) as $dir) {
1394 1394
 			if (strlen($dir) && !str_ends_with($dir, '/')) {
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 		// Et le(s) dossier(s) des squelettes nommes
1401 1401
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1402 1402
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1403
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1403
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1404 1404
 			}
1405 1405
 		}
1406 1406
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 
1412 1412
 	if (is_array($dir_path) || strlen($dir_path)) {
1413 1413
 		$tete = '';
1414
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1414
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1415 1415
 			$tete = array_shift($path_base);
1416 1416
 		}
1417 1417
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 	// Et le(s) dossier(s) des squelettes nommes
1433 1433
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1434 1434
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1435
-			array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1435
+			array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1436 1436
 		}
1437 1437
 	}
1438 1438
 
@@ -1508,14 +1508,14 @@  discard block
 block discarded – undo
1508 1508
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1509 1509
 	if (
1510 1510
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1511
-		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg')
1511
+		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg')
1512 1512
 		&& ($f = find_in_theme("$file_svg_generique"))
1513 1513
 	) {
1514
-		if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) {
1514
+		if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) {
1515 1515
 			return $themefiles["$subdir$file"] = $fsize;
1516 1516
 		}
1517 1517
 		else {
1518
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1518
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1519 1519
 		}
1520 1520
 	}
1521 1521
 
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 			return $themefiles["$subdir$file"] = $f;
1526 1526
 		}
1527 1527
 	}
1528
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1528
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1529 1529
 
1530 1530
 	return $themefiles["$subdir$file"] = '';
1531 1531
 }
@@ -1633,8 +1633,8 @@  discard block
 block discarded – undo
1633 1633
 			return false;
1634 1634
 		}
1635 1635
 		if ($include && !isset($inc[$dirname][$file])) {
1636
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1637
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1636
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1637
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1638 1638
 		}
1639 1639
 
1640 1640
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1647,14 +1647,14 @@  discard block
 block discarded – undo
1647 1647
 	}
1648 1648
 
1649 1649
 	foreach (creer_chemin() as $dir) {
1650
-		if (!isset($dirs[$a = $dir . $dirname])) {
1651
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1650
+		if (!isset($dirs[$a = $dir.$dirname])) {
1651
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1652 1652
 		}
1653 1653
 		if ($dirs[$a]) {
1654
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1654
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1655 1655
 				if ($include && !isset($inc[$dirname][$file])) {
1656
-					include_once _ROOT_CWD . $a;
1657
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1656
+					include_once _ROOT_CWD.$a;
1657
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1658 1658
 				}
1659 1659
 				if (!defined('_SAUVER_CHEMIN')) {
1660 1660
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1664,7 +1664,7 @@  discard block
 block discarded – undo
1664 1664
 					define('_SAUVER_CHEMIN', true);
1665 1665
 				}
1666 1666
 
1667
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1667
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1668 1668
 			}
1669 1669
 		}
1670 1670
 	}
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
 		define('_SAUVER_CHEMIN', true);
1691 1691
 	}
1692 1692
 
1693
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1693
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1694 1694
 }
1695 1695
 
1696 1696
 function clear_path_cache() {
@@ -1760,12 +1760,12 @@  discard block
 block discarded – undo
1760 1760
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1761 1761
 	// on a pas encore inclus flock.php
1762 1762
 	if (!function_exists('preg_files')) {
1763
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1763
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1764 1764
 	}
1765 1765
 
1766 1766
 	// Parcourir le chemin
1767 1767
 	foreach (creer_chemin() as $d) {
1768
-		$f = $d . $dir;
1768
+		$f = $d.$dir;
1769 1769
 		if (@is_dir($f)) {
1770 1770
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1771 1771
 			foreach ($liste as $chemin) {
@@ -1817,8 +1817,8 @@  discard block
 block discarded – undo
1817 1817
 	if ($type === 'defaut') {
1818 1818
 		$objet = objet_type($quoi);
1819 1819
 		if (
1820
-			($f = charger_fonction('generer_' . $objet . '_url', 'urls', true))
1821
-			|| ($f = charger_fonction('generer_url_' . $objet, 'urls', true)) // deprecated
1820
+			($f = charger_fonction('generer_'.$objet.'_url', 'urls', true))
1821
+			|| ($f = charger_fonction('generer_url_'.$objet, 'urls', true)) // deprecated
1822 1822
 		) {
1823 1823
 			return $f;
1824 1824
 		}
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
 	}
1832 1832
 
1833 1833
 	// inclure le module d'url
1834
-	include_spip('urls/' . $url_type);
1834
+	include_spip('urls/'.$url_type);
1835 1835
 
1836 1836
 	switch ($quoi) {
1837 1837
 		case 'page':
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 	}
1932 1932
 
1933 1933
 	// On a ete gentil mais la ....
1934
-	spip_log("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect", _LOG_ERREUR);
1934
+	spip_log("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect", _LOG_ERREUR);
1935 1935
 
1936 1936
 	return '';
1937 1937
 }
@@ -1982,8 +1982,8 @@  discard block
 block discarded – undo
1982 1982
 	include_spip('base/connect_sql');
1983 1983
 	$id_type = id_table_objet($entite, $public);
1984 1984
 
1985
-	return _DIR_RACINE . get_spip_script('./')
1986
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1985
+	return _DIR_RACINE.get_spip_script('./')
1986
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1987 1987
 	. (!$args ? '' : "&$args")
1988 1988
 	. (!$ancre ? '' : "#$ancre");
1989 1989
 }
@@ -2152,7 +2152,7 @@  discard block
 block discarded – undo
2152 2152
 				!empty($_SERVER['QUERY_STRING'])
2153 2153
 				&& !str_contains($_SERVER['REQUEST_URI'], '?')
2154 2154
 			) {
2155
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2155
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2156 2156
 			}
2157 2157
 		}
2158 2158
 	}
@@ -2190,9 +2190,9 @@  discard block
 block discarded – undo
2190 2190
 		array_shift($myself);
2191 2191
 		$myself = implode('/', $myself);
2192 2192
 	}
2193
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2193
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2194 2194
 
2195
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2195
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2196 2196
 
2197 2197
 	return $url;
2198 2198
 }
@@ -2231,16 +2231,16 @@  discard block
 block discarded – undo
2231 2231
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
2232 2232
 	$script ??= '';
2233 2233
 	if (!$rel) {
2234
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2234
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2235 2235
 	} else {
2236 2236
 		if (!is_string($rel)) {
2237
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2237
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2238 2238
 		}
2239 2239
 	}
2240 2240
 
2241 2241
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2242 2242
 	if ($script && ($script <> 'accueil' || $rel)) {
2243
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2243
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2244 2244
 	} elseif ($args) {
2245 2245
 		$args = "?$args";
2246 2246
 	}
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 		$args .= "#$ancre";
2249 2249
 	}
2250 2250
 
2251
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2251
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2252 2252
 }
2253 2253
 
2254 2254
 //
@@ -2330,10 +2330,10 @@  discard block
 block discarded – undo
2330 2330
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2331 2331
 		}
2332 2332
 		if ($args) {
2333
-			$action .= (str_contains($action, '?') ? '&' : '?') . $args;
2333
+			$action .= (str_contains($action, '?') ? '&' : '?').$args;
2334 2334
 		}
2335 2335
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2336
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2336
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2337 2337
 	}
2338 2338
 
2339 2339
 	if (!$no_entities) {
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
 
2346 2346
 function generer_url_prive($script, $args = '', $no_entities = false) {
2347 2347
 
2348
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2348
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2349 2349
 }
2350 2350
 
2351 2351
 // Pour les formulaires en methode POST,
@@ -2380,8 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 	. "><div>\n"
2381 2381
 	. "<input type='hidden' name='exec' value='$script1' />"
2382 2382
 	. $corps
2383
-	. (!$submit ? '' :
2384
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2383
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2385 2384
 	. "</div></form>\n";
2386 2385
 }
2387 2386
 
@@ -2406,14 +2405,14 @@  discard block
 block discarded – undo
2406 2405
 		? generer_url_ecrire(_request('exec'))
2407 2406
 		: generer_url_public();
2408 2407
 
2409
-	return "\n<form action='" .
2410
-	$h .
2411
-	"'" .
2412
-	$atts .
2413
-	">\n" .
2414
-	'<div>' .
2415
-	"\n<input type='hidden' name='action' value='$script' />" .
2416
-	$corps .
2408
+	return "\n<form action='".
2409
+	$h.
2410
+	"'".
2411
+	$atts.
2412
+	">\n".
2413
+	'<div>'.
2414
+	"\n<input type='hidden' name='action' value='$script' />".
2415
+	$corps.
2417 2416
 	'</div></form>';
2418 2417
 }
2419 2418
 
@@ -2441,7 +2440,7 @@  discard block
 block discarded – undo
2441 2440
 		: generer_url_public('', '', false, false);
2442 2441
 	$url = parametre_url($url, 'action', $script);
2443 2442
 	if ($args) {
2444
-		$url .= quote_amp('&' . $args);
2443
+		$url .= quote_amp('&'.$args);
2445 2444
 	}
2446 2445
 
2447 2446
 	if ($no_entities) {
@@ -2475,9 +2474,9 @@  discard block
 block discarded – undo
2475 2474
 	}
2476 2475
 	$url =
2477 2476
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2478
-	. $script . '/'
2477
+	. $script.'/'
2479 2478
 	. ($path ? trim($path, '/') : '')
2480
-	. ($args ? '?' . quote_amp($args) : '');
2479
+	. ($args ? '?'.quote_amp($args) : '');
2481 2480
 
2482 2481
 	if ($no_entities) {
2483 2482
 		$url = str_replace('&amp;', '&', $url);
@@ -2526,22 +2525,22 @@  discard block
 block discarded – undo
2526 2525
 
2527 2526
 	// le nom du repertoire plugins/ activables/desactivables
2528 2527
 	if (!defined('_DIR_PLUGINS')) {
2529
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2528
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2530 2529
 	}
2531 2530
 
2532 2531
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2533 2532
 	if (!defined('_DIR_PLUGINS_DIST')) {
2534
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2533
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2535 2534
 	}
2536 2535
 
2537 2536
 	// le nom du repertoire des librairies
2538 2537
 	if (!defined('_DIR_LIB')) {
2539
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2538
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2540 2539
 	}
2541 2540
 
2542 2541
 	// répertoire des libs via Composer
2543 2542
 	if (!defined('_DIR_VENDOR')) {
2544
-		define('_DIR_VENDOR', _DIR_RACINE . 'vendor/');
2543
+		define('_DIR_VENDOR', _DIR_RACINE.'vendor/');
2545 2544
 	}
2546 2545
 
2547 2546
 	if (!defined('_DIR_IMG')) {
@@ -2551,29 +2550,29 @@  discard block
 block discarded – undo
2551 2550
 		define('_DIR_LOGOS', $pa);
2552 2551
 	}
2553 2552
 	if (!defined('_DIR_IMG_ICONES')) {
2554
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2553
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2555 2554
 	}
2556 2555
 
2557 2556
 	if (!defined('_DIR_DUMP')) {
2558
-		define('_DIR_DUMP', $ti . 'dump/');
2557
+		define('_DIR_DUMP', $ti.'dump/');
2559 2558
 	}
2560 2559
 	if (!defined('_DIR_SESSIONS')) {
2561
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2560
+		define('_DIR_SESSIONS', $ti.'sessions/');
2562 2561
 	}
2563 2562
 	if (!defined('_DIR_TRANSFERT')) {
2564
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2563
+		define('_DIR_TRANSFERT', $ti.'upload/');
2565 2564
 	}
2566 2565
 	if (!defined('_DIR_CACHE')) {
2567
-		define('_DIR_CACHE', $ti . 'cache/');
2566
+		define('_DIR_CACHE', $ti.'cache/');
2568 2567
 	}
2569 2568
 	if (!defined('_DIR_CACHE_XML')) {
2570
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2569
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2571 2570
 	}
2572 2571
 	if (!defined('_DIR_SKELS')) {
2573
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2572
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2574 2573
 	}
2575 2574
 	if (!defined('_DIR_AIDE')) {
2576
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2575
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2577 2576
 	}
2578 2577
 	if (!defined('_DIR_TMP')) {
2579 2578
 		define('_DIR_TMP', $ti);
@@ -2602,27 +2601,27 @@  discard block
 block discarded – undo
2602 2601
 	// Declaration des fichiers
2603 2602
 
2604 2603
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2605
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2604
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2606 2605
 	}
2607 2606
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2608
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2607
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2609 2608
 	}
2610 2609
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2611
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2610
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2612 2611
 	}
2613 2612
 	if (!defined('_CACHE_PIPELINES')) {
2614
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2613
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2615 2614
 	}
2616 2615
 	if (!defined('_CACHE_CHEMIN')) {
2617
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2616
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2618 2617
 	}
2619 2618
 
2620 2619
 	# attention .php obligatoire pour ecrire_fichier_securise
2621 2620
 	if (!defined('_FILE_META')) {
2622
-		define('_FILE_META', $ti . 'meta_cache.php');
2621
+		define('_FILE_META', $ti.'meta_cache.php');
2623 2622
 	}
2624 2623
 	if (!defined('_DIR_LOG')) {
2625
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2624
+		define('_DIR_LOG', _DIR_TMP.'log/');
2626 2625
 	}
2627 2626
 	if (!defined('_FILE_LOG')) {
2628 2627
 		define('_FILE_LOG', 'spip');
@@ -2638,7 +2637,7 @@  discard block
 block discarded – undo
2638 2637
 	if (!defined('_FILE_CONNECT')) {
2639 2638
 		define(
2640 2639
 			'_FILE_CONNECT',
2641
-			@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : false
2640
+			@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f : false
2642 2641
 		);
2643 2642
 	}
2644 2643
 
@@ -2649,7 +2648,7 @@  discard block
 block discarded – undo
2649 2648
 	if (!defined('_FILE_CHMOD')) {
2650 2649
 		define(
2651 2650
 			'_FILE_CHMOD',
2652
-			@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f : false
2651
+			@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f : false
2653 2652
 		);
2654 2653
 	}
2655 2654
 
@@ -2661,10 +2660,10 @@  discard block
 block discarded – undo
2661 2660
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2662 2661
 	}
2663 2662
 	if (!defined('_FILE_CONNECT_TMP')) {
2664
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2663
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2665 2664
 	}
2666 2665
 	if (!defined('_FILE_CHMOD_TMP')) {
2667
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2666
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2668 2667
 	}
2669 2668
 
2670 2669
 	// Definition des droits d'acces en ecriture
@@ -2682,13 +2681,13 @@  discard block
 block discarded – undo
2682 2681
 		define('_DEFAULT_CHARSET', 'utf-8');
2683 2682
 	}
2684 2683
 	if (!defined('_ROOT_PLUGINS')) {
2685
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2684
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2686 2685
 	}
2687 2686
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2688
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2687
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2689 2688
 	}
2690 2689
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2691
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2690
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2692 2691
 	}
2693 2692
 
2694 2693
 	// La taille des Log
@@ -2725,7 +2724,7 @@  discard block
 block discarded – undo
2725 2724
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2726 2725
 	// pour le rendre surchargeable, on va provoquer un reecriture
2727 2726
 	// systematique du noyau ou une baisse de perfs => a etudier)
2728
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2727
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2729 2728
 
2730 2729
 	// charger tout de suite le path et son cache
2731 2730
 	load_path_cache();
@@ -2761,7 +2760,7 @@  discard block
 block discarded – undo
2761 2760
 			!empty($_SERVER['QUERY_STRING'])
2762 2761
 			&& !strpos($_SERVER['REQUEST_URI'], '?')
2763 2762
 		) {
2764
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2763
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2765 2764
 		}
2766 2765
 	}
2767 2766
 
@@ -2797,7 +2796,7 @@  discard block
 block discarded – undo
2797 2796
 		) {
2798 2797
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2799 2798
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2800
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2799
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2801 2800
 			} else {
2802 2801
 				$uri_ref = '';
2803 2802
 			}
@@ -2891,7 +2890,7 @@  discard block
 block discarded – undo
2891 2890
 	}
2892 2891
 	if (!defined('_CACHE_RUBRIQUES')) {
2893 2892
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2894
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2893
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2895 2894
 	}
2896 2895
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2897 2896
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -3114,7 +3113,7 @@  discard block
 block discarded – undo
3114 3113
 					}
3115 3114
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3116 3115
 						spip_log($GLOBALS['visiteur_session']['nom']
3117
-							. ' ' . _VAR_MODE);
3116
+							. ' '._VAR_MODE);
3118 3117
 					}
3119 3118
 				} // pas autorise ?
3120 3119
 				else {
@@ -3129,7 +3128,7 @@  discard block
 block discarded – undo
3129 3128
 						if (!str_contains($self, 'page=login')) {
3130 3129
 							include_spip('inc/headers');
3131 3130
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3132
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3131
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3133 3132
 						}
3134 3133
 					}
3135 3134
 					// sinon tant pis
@@ -3179,10 +3178,10 @@  discard block
 block discarded – undo
3179 3178
 **/
3180 3179
 function verifier_visiteur() {
3181 3180
 	@spip_initialisation_core(
3182
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3183
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3184
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3185
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3181
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3182
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3183
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3184
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3186 3185
 	);
3187 3186
 
3188 3187
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3215,7 +3214,7 @@  discard block
 block discarded – undo
3215 3214
 	}
3216 3215
 
3217 3216
 	$h = (isset($_SERVER['PHP_AUTH_USER']) && !$GLOBALS['ignore_auth_http']);
3218
-	if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3217
+	if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3219 3218
 		$session = charger_fonction('session', 'inc');
3220 3219
 		if ($session()) {
3221 3220
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3295,7 +3294,7 @@  discard block
 block discarded – undo
3295 3294
 		if (!empty($GLOBALS['visiteur_session'])) {
3296 3295
 			include_spip('inc/session');
3297 3296
 			$cookie = lire_cookie_session();
3298
-			$s = serialize($GLOBALS['visiteur_session']) . '_' . ($cookie ?: '');
3297
+			$s = serialize($GLOBALS['visiteur_session']).'_'.($cookie ?: '');
3299 3298
 		}
3300 3299
 		$s = pipeline('definir_session', $s);
3301 3300
 		$session = ($s ? substr(md5($s), 0, 8) : '');
@@ -3343,8 +3342,8 @@  discard block
 block discarded – undo
3343 3342
 		foreach ($cookies_masques as $k) {
3344 3343
 			if (!empty($_COOKIE[$k])) {
3345 3344
 				$cookies_backup[$k] = $_COOKIE[$k];
3346
-				$_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3347
-				$_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3345
+				$_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []);
3346
+				$_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []);
3348 3347
 				$_COOKIE[$k] = $mask;
3349 3348
 			}
3350 3349
 		}
@@ -3462,11 +3461,11 @@  discard block
 block discarded – undo
3462 3461
 	$GLOBALS['_INC_PUBLIC']++;
3463 3462
 
3464 3463
 	// fix #4235
3465
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3464
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3466 3465
 
3467 3466
 
3468 3467
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3469
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3468
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3470 3469
 
3471 3470
 		$page = evaluer_fond($f, $contexte, $connect);
3472 3471
 		if ($page === '') {
@@ -3551,7 +3550,7 @@  discard block
 block discarded – undo
3551 3550
  * @return array|string
3552 3551
  */
3553 3552
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3554
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3553
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3555 3554
 	if (!$pathinfo) {
3556 3555
 		return $f;
3557 3556
 	}
Please login to merge, or discard this patch.
ecrire/inc/svg.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 	if (!file_exists($fichier)) {
58 58
 		include_spip('inc/filtres');
59
-		$fichier  = supprimer_timestamp($fichier);
59
+		$fichier = supprimer_timestamp($fichier);
60 60
 		if (!file_exists($fichier)) {
61 61
 			return false;
62 62
 		}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 function svg_change_balise_svg($svg, $old_balise_svg, $attributs) {
147 147
 	$new_balise_svg = '<svg';
148 148
 	foreach ($attributs as $k => $v) {
149
-		$new_balise_svg .= " $k=\"" . entites_html($v) . '"';
149
+		$new_balise_svg .= " $k=\"".entites_html($v).'"';
150 150
 	}
151 151
 	$new_balise_svg .= '>';
152 152
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 function svg_insert_shapes($svg, $shapes, $start = true) {
165 165
 
166 166
 	if ($start === false || $start === 'end') {
167
-		$svg = str_replace('</svg>', $shapes . '</svg>', $svg);
167
+		$svg = str_replace('</svg>', $shapes.'</svg>', $svg);
168 168
 	}
169 169
 	else {
170 170
 		$p = stripos($svg, '<svg');
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
  */
186 186
 function svg_clip_in_box($svg, $x, $y, $width, $height) {
187 187
 	$rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />";
188
-	$id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8);
188
+	$id = 'clip-'.substr(md5($rect.strlen($svg)), 0, 8);
189 189
 	$clippath = "<clipPath id=\"$id\">$rect</clipPath>";
190 190
 	$g = "<g clip-path=\"url(#$id)\">";
191
-	$svg = svg_insert_shapes($svg, $clippath . $g);
191
+	$svg = svg_insert_shapes($svg, $clippath.$g);
192 192
 	return svg_insert_shapes($svg, '</g>', false);
193 193
 }
194 194
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	) {
207 207
 		[$balise_svg, $attributs] = $svg_infos;
208 208
 		if (!isset($attributs['viewBox'])) {
209
-			$attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height'];
209
+			$attributs['viewBox'] = '0 0 '.$attributs['width'].' '.$attributs['height'];
210 210
 		}
211 211
 		$attributs['width'] = (string) $new_width;
212 212
 		$attributs['height'] = (string) $new_height;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	else {
230 230
 		$couleur = couleur_html_to_hex($couleur);
231 231
 	}
232
-	return '#' . ltrim($couleur, '#');
232
+	return '#'.ltrim($couleur, '#');
233 233
 }
234 234
 
235 235
 /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 function svg_couleur_to_rgb($couleur) {
241 241
 	if (str_starts_with($couleur, 'rgb(')) {
242 242
 		$c = explode(',', substr($couleur, 4));
243
-		return ['red' => (int) $c[0],'green' => (int) $c[1],'blue' => (int) $c[2]];
243
+		return ['red' => (int) $c[0], 'green' => (int) $c[1], 'blue' => (int) $c[2]];
244 244
 	}
245 245
 	return _couleur_hex_to_dec($couleur);
246 246
 }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 			$background_color = svg_couleur_to_hexa($background_color);
455 455
 			if (isset($attributs['viewBox'])) {
456 456
 				$viewBox = explode(' ', $attributs['viewBox']);
457
-				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>";
457
+				$rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\"/>";
458 458
 			}
459 459
 			else {
460 460
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			$background_color = svg_couleur_to_hexa($background_color);
485 485
 			if (isset($attributs['viewBox'])) {
486 486
 				$viewBox = explode(' ', $attributs['viewBox']);
487
-				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>";
487
+				$rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>";
488 488
 			}
489 489
 			else {
490 490
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 			$g = '<g';
514 514
 			foreach ($attributs as $k => $v) {
515 515
 				if (strlen($v)) {
516
-					$g .= " $k=\"" . attribut_html($v) . '"';
516
+					$g .= " $k=\"".attribut_html($v).'"';
517 517
 				}
518 518
 			}
519 519
 			if (strlen($g) > 2) {
@@ -541,10 +541,10 @@  discard block
 block discarded – undo
541 541
 	) {
542 542
 		if ($filter_def) {
543 543
 			[$balise_svg, ] = $svg_infos;
544
-			$filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8);
544
+			$filter_id = 'filter-'.substr(md5($filter_def.strlen($svg)), 0, 8);
545 545
 			$filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>";
546 546
 			$g = "<g filter=\"url(#$filter_id)\">";
547
-			$svg = svg_insert_shapes($svg, $filter . $g);
547
+			$svg = svg_insert_shapes($svg, $filter.$g);
548 548
 			$svg = svg_insert_shapes($svg, '</g>', false);
549 549
 		}
550 550
 		return $svg;
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
28 28
 }
29 29
 if (!defined('_INC_DISTANT_USER_AGENT')) {
30
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
30
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
31 31
 }
32 32
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
33 33
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
37 37
 }
38 38
 
39
-define('_REGEXP_COPIE_LOCALE', ',' 	.
39
+define('_REGEXP_COPIE_LOCALE', ','.
40 40
 	preg_replace(
41 41
 		'@^https?:@',
42 42
 		'https?:',
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 	// si c'est la protection de soi-meme, retourner le path
75 75
 	if ($mode !== 'force' && preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
76
-		$source = substr((string) _DIR_IMG, strlen((string) _DIR_RACINE)) . urldecode($match[1]);
76
+		$source = substr((string) _DIR_IMG, strlen((string) _DIR_RACINE)).urldecode($match[1]);
77 77
 
78 78
 		return @file_exists($source) ? $source : false;
79 79
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		return false;
94 94
 	}
95 95
 
96
-	$localrac = _DIR_RACINE . $local;
96
+	$localrac = _DIR_RACINE.$local;
97 97
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
98 98
 
99 99
 	// test d'existence du fichier
@@ -113,17 +113,17 @@  discard block
 block discarded – undo
113 113
 		if (!$taille_max) {
114 114
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
115 115
 		}
116
-		$localrac_tmp = $localrac . '.tmp';
116
+		$localrac_tmp = $localrac.'.tmp';
117 117
 		$res = recuperer_url(
118 118
 			$source,
119 119
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
120 120
 		);
121 121
 
122 122
 		if (!$res || !$res['length'] && $res['status'] != 304) {
123
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
123
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
124 124
 			@unlink($localrac_tmp);
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 || !$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
 			&& is_callable($callback_valider_url)
137 137
 			&& !$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
 		}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 	if (!$is_known_host) {
228 228
 		$host = trim($parsed_url['host'], '.');
229
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
229
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
230 230
 			$ip = gethostbyname($host);
231 231
 			if ($ip === $host) {
232 232
 				// Error condition for gethostbyname()
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				$ip = false;
247 247
 			}
248 248
 		}
249
-		if ($ip && ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
249
+		if ($ip && !filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
250 250
 			return false;
251 251
 		}
252 252
 	}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				}
328 328
 			}
329 329
 			if ($taille > 500) {
330
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
330
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
331 331
 			}
332 332
 		}
333 333
 
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 				foreach ($donnees as $cle => $valeur) {
361 361
 					if (is_array($valeur)) {
362 362
 						foreach ($valeur as $val2) {
363
-							$chaines[] = rawurlencode($cle) . '[]=' . rawurlencode((string) $val2);
363
+							$chaines[] = rawurlencode($cle).'[]='.rawurlencode((string) $val2);
364 364
 						}
365 365
 					} else {
366
-						$chaines[] = rawurlencode($cle) . '=' . rawurlencode((string) $valeur);
366
+						$chaines[] = rawurlencode($cle).'='.rawurlencode((string) $valeur);
367 367
 					}
368 368
 				}
369 369
 				$chaine = implode('&', $chaines);
@@ -466,13 +466,13 @@  discard block
 block discarded – undo
466 466
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
467 467
 	}
468 468
 
469
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
469
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
470 470
 
471 471
 	// Ajout des en-têtes spécifiques si besoin
472 472
 	$formatted_data = '';
473 473
 	if (!empty($options['headers'])) {
474 474
 		foreach ($options['headers'] as $champ => $valeur) {
475
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
475
+			$formatted_data .= $champ.': '.$valeur."\r\n";
476 476
 		}
477 477
 	}
478 478
 
@@ -480,9 +480,9 @@  discard block
 block discarded – undo
480 480
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
481 481
 		$head .= $formatted_data;
482 482
 		if (stripos($head, 'Content-Length:') === false) {
483
-			$head .= 'Content-Length: ' . strlen((string) $postdata) . "\r\n";
483
+			$head .= 'Content-Length: '.strlen((string) $postdata)."\r\n";
484 484
 		}
485
-		$formatted_data = $head . "\r\n" . $postdata;
485
+		$formatted_data = $head."\r\n".$postdata;
486 486
 		if (
487 487
 			strlen((string) $postdata) && !$methode_demandee
488 488
 		) {
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
496 496
 	$url = preg_replace(',^feed://,i', 'http://', $url);
497 497
 	if (!tester_url_absolue($url)) {
498
-		$url = 'http://' . $url;
498
+		$url = 'http://'.$url;
499 499
 	} elseif (str_starts_with($url, '//')) {
500
-		$url = 'http:' . $url;
500
+		$url = 'http:'.$url;
501 501
 	}
502 502
 
503 503
 	$url = url_to_ascii($url);
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		$options['if_modified_since']
527 527
 	);
528 528
 	if (!$handle) {
529
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
529
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
530 530
 
531 531
 		return false;
532 532
 	}
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 					'status' => 200,
557 557
 				];
558 558
 			} else {
559
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
559
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
560 560
 				return false;
561 561
 			}
562 562
 		} elseif ($res['location'] && $options['follow_location']) {
@@ -573,11 +573,11 @@  discard block
 block discarded – undo
573 573
 				$options['methode'] = 'GET';
574 574
 				$options['datas'] = '';
575 575
 			}
576
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
576
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
577 577
 
578 578
 			return recuperer_url($url, $options);
579 579
 		} elseif ($res['status'] !== 200) {
580
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
580
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
581 581
 		}
582 582
 		$result['status'] = $res['status'];
583 583
 		if (isset($res['headers'])) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 	// on ne veut que les entetes
598 598
 	if (!$options['taille_max'] || $options['methode'] == 'HEAD' || $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result, JSON_THROW_ON_ERROR), 'distant' . _LOG_DEBUG);
599
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result, JSON_THROW_ON_ERROR), 'distant'._LOG_DEBUG);
600 600
 		return $result;
601 601
 	}
602 602
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 	$gz = false;
608 608
 	if (preg_match(",\bContent-Encoding: .*gzip,is", (string) $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
609
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
610 610
 	}
611 611
 
612 612
 	// si on n'a pas deja récupéré le contenu par une methode detournée
@@ -650,10 +650,10 @@  discard block
 block discarded – undo
650 650
 		$trace = json_decode(json_encode($result, JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR);
651 651
 	} catch (JsonException $e) {
652 652
 		$trace = [];
653
-		spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_ERREUR);
653
+		spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_ERREUR);
654 654
 	}
655 655
 	$trace['page'] = '...';
656
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace, JSON_THROW_ON_ERROR), 'distant' . _LOG_DEBUG);
656
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace, JSON_THROW_ON_ERROR), 'distant'._LOG_DEBUG);
657 657
 
658 658
 	return $result;
659 659
 }
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 	$sig['url'] = $url;
708 708
 
709 709
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
710
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
710
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
711 711
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
712 712
 	$cache = "$sub$cache";
713 713
 
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 	$fp = false;
762 762
 	if ($fichier) {
763 763
 		include_spip('inc/acces');
764
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
764
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
765 765
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
766 766
 		if (!$fp && file_exists($fichier)) {
767 767
 			return filesize($fichier);
@@ -850,11 +850,11 @@  discard block
 block discarded – undo
850 850
 	}
851 851
 	$result['status'] = (int) $r[1];
852 852
 	while ($s = trim(fgets($handle, 16384))) {
853
-		$result['headers'][] = $s . "\n";
853
+		$result['headers'][] = $s."\n";
854 854
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
855 855
 		[, $d, $v] = $r;
856 856
 		$d = strtolower(trim($d));
857
-		if ( $d === 'location' && $result['status'] >= 300 && $result['status'] < 400) {
857
+		if ($d === 'location' && $result['status'] >= 300 && $result['status'] < 400) {
858 858
 			$result['location'] = $v;
859 859
 		} elseif ($d === 'last-modified') {
860 860
 			$result['last_modified'] = strtotime($v);
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 
903 903
 	// on se place tout le temps comme si on était a la racine
904 904
 	if (_DIR_RACINE) {
905
-		$d = preg_replace(',^' . preg_quote((string) _DIR_RACINE, ',') . ',', '', (string) $d);
905
+		$d = preg_replace(',^'.preg_quote((string) _DIR_RACINE, ',').',', '', (string) $d);
906 906
 	}
907 907
 
908 908
 	$m = md5($source);
@@ -910,18 +910,18 @@  discard block
 block discarded – undo
910 910
 	$filename =
911 911
 		$d
912 912
 		. substr(preg_replace(',[^\w-],', '', basename($source, $extension)), 0, 16)
913
-		. '-' . substr($m, 0, 8)
913
+		. '-'.substr($m, 0, 8)
914 914
 		. ".$extension";
915 915
 
916 916
 	// ancien nommage des fichiers distants : renommer le fichier a la volee si besoin pour eviter de dupliquer les caches
917 917
 	$legacy_filename =
918 918
 		$d
919
-		. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
919
+		. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
920 920
 		. substr($m, 0, 4)
921 921
 		. ".$extension";
922 922
 
923
-	if (file_exists(_DIR_RACINE . $legacy_filename)) {
924
-		@rename(_DIR_RACINE . $legacy_filename, $filename);
923
+	if (file_exists(_DIR_RACINE.$legacy_filename)) {
924
+		@rename(_DIR_RACINE.$legacy_filename, $filename);
925 925
 	}
926 926
 
927 927
 	return $filename;
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 	// Si c'est deja local pas de souci
947 947
 	if (!tester_url_absolue($source)) {
948 948
 		if (_DIR_RACINE) {
949
-			$source = preg_replace(',^' . preg_quote((string) _DIR_RACINE, ',') . ',', '', $source);
949
+			$source = preg_replace(',^'.preg_quote((string) _DIR_RACINE, ',').',', '', $source);
950 950
 		}
951 951
 
952 952
 		return $source;
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 		$ext
965 965
 		&& preg_match(',^\w+$,', $ext)
966 966
 		&& ($f = nom_fichier_copie_locale($source, $ext))
967
-		&& file_exists(_DIR_RACINE . $f)
967
+		&& file_exists(_DIR_RACINE.$f)
968 968
 	) {
969 969
 		return $f;
970 970
 	}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 
973 973
 	// Si c'est deja dans la table des documents,
974 974
 	// ramener le nom de sa copie potentielle
975
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
975
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
976 976
 
977 977
 	if ($ext) {
978 978
 		return nom_fichier_copie_locale($source, $ext);
@@ -983,9 +983,9 @@  discard block
 block discarded – undo
983 983
 
984 984
 	$ext = $path_parts ? $path_parts['extension'] : '';
985 985
 
986
-	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
986
+	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
987 987
 		$f = nom_fichier_copie_locale($source, $ext);
988
-		if (file_exists(_DIR_RACINE . $f)) {
988
+		if (file_exists(_DIR_RACINE.$f)) {
989 989
 			return $f;
990 990
 		}
991 991
 	}
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
 	// Ping  pour voir si son extension est connue et autorisee
994 994
 	// avec mise en cache du resultat du ping
995 995
 
996
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
996
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
997 997
 	if (
998 998
 		!@file_exists($cache)
999 999
 		|| !($path_parts = @unserialize(spip_file_get_contents($cache)))
@@ -1003,11 +1003,11 @@  discard block
 block discarded – undo
1003 1003
 		ecrire_fichier($cache, serialize($path_parts));
1004 1004
 	}
1005 1005
 	$ext = empty($path_parts['extension']) ? '' : $path_parts['extension'];
1006
-	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
1006
+	if ($ext && sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
1007 1007
 		return nom_fichier_copie_locale($source, $ext);
1008 1008
 	}
1009 1009
 
1010
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
1010
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
1011 1011
 	return null;
1012 1012
 }
1013 1013
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
 		} else {
1110 1110
 			if ($a['body']) {
1111 1111
 				$a['extension'] = corriger_extension($extension);
1112
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1112
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1113 1113
 				ecrire_fichier($a['fichier'], $a['body']);
1114 1114
 				$size_image = @spip_getimagesize($a['fichier']);
1115 1115
 				$a['largeur'] = (int) $size_image[0];
@@ -1181,20 +1181,20 @@  discard block
 block discarded – undo
1181 1181
 	$t = null;
1182 1182
 	if (in_array($mime_type, ['text/plain', '', 'application/octet-stream'])) {
1183 1183
 		if (!$t && preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)) {
1184
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1184
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1185 1185
 		}
1186 1186
 		if (
1187 1187
 			!$t
1188 1188
 			&& preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1189 1189
 			&& preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1190 1190
 		) {
1191
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1191
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1192 1192
 		}
1193 1193
 	}
1194 1194
 
1195 1195
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1196 1196
 	if (!$t) {
1197
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1197
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1198 1198
 	}
1199 1199
 
1200 1200
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1205,11 +1205,11 @@  discard block
 block discarded – undo
1205 1205
 		&& preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1206 1206
 	) {
1207 1207
 		# eviter xxx.3 => 3gp (> SPIP 3)
1208
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1208
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1209 1209
 	}
1210 1210
 
1211 1211
 	if ($t) {
1212
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1212
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1213 1213
 		return $t['extension'];
1214 1214
 	} else {
1215 1215
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 		}
1313 1313
 	} else {
1314 1314
 		$scheme = $t['scheme'];
1315
-		$noproxy = $scheme . '://';
1315
+		$noproxy = $scheme.'://';
1316 1316
 	}
1317 1317
 	if (isset($t['user'])) {
1318 1318
 		// user et pass doivent être passés en urlencodé dans l'URL, on redecode ici
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	}
1328 1328
 
1329 1329
 	if (!empty($t['query'])) {
1330
-		$path .= '?' . $t['query'];
1330
+		$path .= '?'.$t['query'];
1331 1331
 	}
1332 1332
 
1333 1333
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1401,29 +1401,29 @@  discard block
 block discarded – undo
1401 1401
 	$proxy_user = '';
1402 1402
 	$http_proxy = need_proxy($host);
1403 1403
 	if ($user) {
1404
-		$user = urlencode((string) $user[0]) . ':' . urlencode((string) $user[1]);
1404
+		$user = urlencode((string) $user[0]).':'.urlencode((string) $user[1]);
1405 1405
 	}
1406 1406
 
1407 1407
 	$connect = '';
1408 1408
 	if ($http_proxy) {
1409
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') && in_array($scheme, ['tls','ssl'])) {
1410
-			$path_host = ($user ? "$user@" : '') . $host . (($port != 80) ? ":$port" : '');
1411
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1409
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') && in_array($scheme, ['tls', 'ssl'])) {
1410
+			$path_host = ($user ? "$user@" : '').$host.(($port != 80) ? ":$port" : '');
1411
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1412 1412
 				. "Host: $path_host\r\n"
1413 1413
 				. "Proxy-Connection: Keep-Alive\r\n";
1414 1414
 		} else {
1415
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1415
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1416 1416
 				. ($user ? "$user@" : '')
1417
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1417
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1418 1418
 		}
1419 1419
 		$t2 = @parse_url($http_proxy);
1420 1420
 		$first_host = $t2['host'];
1421 1421
 		$first_port = ($t2['port'] ?? null) ?: 80;
1422 1422
 		if ($t2['user'] ?? null) {
1423
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1423
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1424 1424
 		}
1425 1425
 	} else {
1426
-		$first_host = $noproxy . $host;
1426
+		$first_host = $noproxy.$host;
1427 1427
 		$first_port = $port;
1428 1428
 	}
1429 1429
 
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
 		);
1447 1447
 		spip_log("Recuperer $path sur $first_host:$first_port par $f (via CONNECT)", 'connect');
1448 1448
 		if (!$f) {
1449
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1449
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1450 1450
 			return $errno;
1451 1451
 		}
1452 1452
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
 			|| ($res = explode(' ', $res)) === []
1460 1460
 			|| $res[1] !== '200'
1461 1461
 		) {
1462
-			spip_log("Echec CONNECT sur $first_host:$first_port", 'connect' . _LOG_INFO_IMPORTANTE);
1462
+			spip_log("Echec CONNECT sur $first_host:$first_port", 'connect'._LOG_INFO_IMPORTANTE);
1463 1463
 			fclose($f);
1464 1464
 
1465 1465
 			return false;
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 		} while (!$f && $ntry-- && $errno !== 110 && sleep(1));
1477 1477
 		spip_log("Recuperer $path sur $first_host:$first_port par $f");
1478 1478
 		if (!$f) {
1479
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1479
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1480 1480
 
1481 1481
 			return $errno;
1482 1482
 		}
@@ -1486,16 +1486,16 @@  discard block
 block discarded – undo
1486 1486
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1487 1487
 
1488 1488
 	$host_port = $host;
1489
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1489
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1490 1490
 		$host_port .= ":$port";
1491 1491
 	}
1492 1492
 	$req = "$method $path $vers\r\n"
1493 1493
 		. "Host: $host_port\r\n"
1494
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1495
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1494
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1495
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1496 1496
 		. ($site ? "Referer: $site/$referer\r\n" : '')
1497
-		. ($date ? 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n") : '')
1498
-		. ($user ? 'Authorization: Basic ' . base64_encode(urldecode($user)) . "\r\n" : '')
1497
+		. ($date ? 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n") : '')
1498
+		. ($user ? 'Authorization: Basic '.base64_encode(urldecode($user))."\r\n" : '')
1499 1499
 		. ($proxy_user ? "Proxy-Authorization: Basic $proxy_user\r\n" : '')
1500 1500
 		. (strpos($vers, '1.1') ? "Keep-Alive: 300\r\nConnection: keep-alive\r\n" : '');
1501 1501
 
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 // mais apres la fonction autoriser()
120 120
 if ($f = find_in_path('mes_fonctions.php')) {
121 121
 	global $dossier_squelettes;
122
-	include_once(_ROOT_CWD . $f);
122
+	include_once(_ROOT_CWD.$f);
123 123
 }
124 124
 
125 125
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		$qui = $GLOBALS['visiteur_session'] ?: [];
161 161
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
162 162
 	} elseif (is_numeric($qui)) {
163
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
163
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
164 164
 		if (!$qui) {
165 165
 			return false;
166 166
 		}
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	}
174 174
 
175 175
 	spip_log(
176
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
177
-		'autoriser' . _LOG_DEBUG
176
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
177
+		'autoriser'._LOG_DEBUG
178 178
 	);
179 179
 
180 180
 	$type = autoriser_type($type);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		isset($GLOBALS['autoriser_exception'][$faire][$type][$id])
185 185
 		&& autoriser_exception($faire, $type, $id, 'verifier') || isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) && autoriser_exception($faire, $type, '*', 'verifier')
186 186
 	) {
187
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
187
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
188 188
 		return true;
189 189
 	}
190 190
 
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
194 194
 	$fonctions = $type
195 195
 		? [
196
-			'autoriser_' . $type . '_' . $faire,
197
-			'autoriser_' . $type . '_' . $faire . '_dist',
198
-			'autoriser_' . $type,
199
-			'autoriser_' . $type . '_dist',
200
-			'autoriser_' . $faire,
201
-			'autoriser_' . $faire . '_dist',
196
+			'autoriser_'.$type.'_'.$faire,
197
+			'autoriser_'.$type.'_'.$faire.'_dist',
198
+			'autoriser_'.$type,
199
+			'autoriser_'.$type.'_dist',
200
+			'autoriser_'.$faire,
201
+			'autoriser_'.$faire.'_dist',
202 202
 			'autoriser_defaut',
203 203
 			'autoriser_defaut_dist'
204 204
 		]
205 205
 		: [
206
-			'autoriser_' . $faire,
207
-			'autoriser_' . $faire . '_dist',
206
+			'autoriser_'.$faire,
207
+			'autoriser_'.$faire.'_dist',
208 208
 			'autoriser_defaut',
209 209
 			'autoriser_defaut_dist'
210 210
 		];
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
 	}
219 219
 
220 220
 	spip_log(
221
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
222
-		'autoriser' . _LOG_DEBUG
221
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
222
+		'autoriser'._LOG_DEBUG
223 223
 	);
224 224
 
225 225
 	if (!is_bool($a)) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
386 386
 
387 387
 	// Le visiteur a-t-il un statut prevu par la config ?
388
-	if (str_contains((string) $GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',')) {
388
+	if (str_contains((string) $GLOBALS['meta']['preview'], ','.$qui['statut'].',')) {
389 389
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
390 390
 	}
391 391
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 				} // pas de champ passe a la demande => NIET
440 440
 				$previsu = explode(',', (string) $c['previsu']);
441 441
 				// regarder si ce statut est autorise pour l'auteur
442
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
442
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
443 443
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
444 444
 					// sinon l’auteur en session
445 445
 					include_spip('inc/securiser_action');
@@ -453,12 +453,12 @@  discard block
 block discarded – undo
453 453
 
454 454
 					if (!$id_auteur) {
455 455
 						return false;
456
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
456
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
457 457
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
458 458
 					} elseif (
459 459
 						!sql_countsel(
460 460
 							'spip_auteurs_liens',
461
-							'id_auteur=' . (int) $id_auteur . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . (int) $id
461
+							'id_auteur='.(int) $id_auteur.' AND objet='.sql_quote($type).' AND id_objet='.(int) $id
462 462
 						)
463 463
 					) {
464 464
 						return false;
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
 			// multilinguisme par secteur et objet rattaché à une rubrique
504 504
 			$primary = id_table_objet($type);
505 505
 			$id_rubrique = $table != 'spip_rubriques'
506
-				? sql_getfetsel('id_rubrique', "$table", "$primary=" . (int) $id)
506
+				? sql_getfetsel('id_rubrique', "$table", "$primary=".(int) $id)
507 507
 				: $id;
508
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique);
508
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique);
509 509
 			if (!$id_secteur > 0) {
510 510
 				$id_secteur = $id_rubrique;
511 511
 			}
512
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . (int) $id_secteur);
513
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . (int) $id);
512
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.(int) $id_secteur);
513
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".(int) $id);
514 514
 			if ($langue_secteur != $langue_objet) {
515 515
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
516 516
 				return true;
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
519 519
 				return false;
520 520
 			} else {
521
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . (int) $id);
521
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.(int) $id);
522 522
 				if ($id_parent != 0) {
523 523
 					// sous-rubriques : pas de choix de langue
524 524
 					return false;
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 
571 571
 	if (!isset($opt['statut'])) {
572 572
 		if (isset($desc['field']['statut'])) {
573
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . (int) $id);
573
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.(int) $id);
574 574
 		} else {
575 575
 			$statut = 'publie';
576 576
 		} // pas de statut => publie
@@ -735,11 +735,11 @@  discard block
 block discarded – undo
735 735
 		return false;
736 736
 	}
737 737
 
738
-	if (sql_countsel('spip_rubriques', 'id_parent=' . (int) $id)) {
738
+	if (sql_countsel('spip_rubriques', 'id_parent='.(int) $id)) {
739 739
 		return false;
740 740
 	}
741 741
 
742
-	if (sql_countsel('spip_articles', 'id_rubrique=' . (int) $id . " AND (statut<>'poubelle')")) {
742
+	if (sql_countsel('spip_articles', 'id_rubrique='.(int) $id." AND (statut<>'poubelle')")) {
743 743
 		return false;
744 744
 	}
745 745
 
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 	if (!$id) {
777 777
 		return false;
778 778
 	}
779
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
779
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
780 780
 
781 781
 	return $r && (
782 782
 		autoriser('publierdans', 'rubrique', $r['id_rubrique'], $qui, $opt)
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 			(!isset($opt['statut']) || !in_array($opt['statut'], ['publie', 'refuse'], true))
785 785
 			&& in_array($qui['statut'], ['0minirezo', '1comite'])
786 786
 			&& in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
787
-			&& auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
787
+			&& auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
788 788
 		)
789 789
 	);
790 790
 }
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		if (!$id) {
843 843
 			return false;
844 844
 		}
845
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . (int) $id);
845
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.(int) $id);
846 846
 	}
847 847
 
848 848
 	return
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 		in_array($statut, ['prop', 'publie'])
852 852
 		// sinon si on est auteur, on a le droit de le voir, evidemment !
853 853
 
854
-		|| $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']);
854
+		|| $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']);
855 855
 }
856 856
 
857 857
 
@@ -872,8 +872,8 @@  discard block
 block discarded – undo
872 872
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
873 873
 	# securite, mais on aurait pas du arriver ici !
874 874
 	if (
875
-		function_exists($f = 'autoriser_' . $type . '_voir')
876
-		|| function_exists($f = 'autoriser_' . $type . '_voir_dist')
875
+		function_exists($f = 'autoriser_'.$type.'_voir')
876
+		|| function_exists($f = 'autoriser_'.$type.'_voir_dist')
877 877
 	) {
878 878
 		return $f($faire, $type, $id, $qui, $opt);
879 879
 	}
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 	$n = sql_fetsel(
999 999
 		'A.id_article',
1000 1000
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1001
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1001
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1002 1002
 	);
1003 1003
 
1004 1004
 	return (bool) $n;
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 		&& ($r = sql_allfetsel(
1197 1197
 			'id_objet',
1198 1198
 			'spip_auteurs_liens',
1199
-			'id_auteur=' . (int) $id_auteur . " AND objet='rubrique' AND id_objet!=0"
1199
+			'id_auteur='.(int) $id_auteur." AND objet='rubrique' AND id_objet!=0"
1200 1200
 		))
1201 1201
 		&& (is_countable($r) ? count($r) : 0)
1202 1202
 	) {
@@ -1873,8 +1873,8 @@  discard block
 block discarded – undo
1873 1873
 function auteurs_objet($objet, $id_objet, $cond = '') {
1874 1874
 	$objet = objet_type($objet);
1875 1875
 	$where = [
1876
-		'objet=' . sql_quote($objet),
1877
-		'id_objet=' . (int) $id_objet
1876
+		'objet='.sql_quote($objet),
1877
+		'id_objet='.(int) $id_objet
1878 1878
 	];
1879 1879
 	if (!empty($cond)) {
1880 1880
 		if (is_array($cond)) {
Please login to merge, or discard this patch.
ecrire/tests/Texte/LiensTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 			['id_article', 'lang'],
24 24
 			'spip_articles',
25 25
 			[
26
-				'statut = ' . sql_quote('publie'),
27
-				'lang != ' . sql_quote('')
26
+				'statut = '.sql_quote('publie'),
27
+				'lang != '.sql_quote('')
28 28
 			],
29 29
 			limit: '0,1',
30 30
 		);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		// on se met dans une autre langue que celle de l'article
36 36
 		lang_select($lang === 'eo' ? 'fa' : 'eo');
37 37
 
38
-		$case = '[->' . $id_article . ']';
38
+		$case = '[->'.$id_article.']';
39 39
 		$propre = propre($case);
40 40
 		$this->assertEquals(
41 41
 			$lang,
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 	#[DataProvider('providerLiensClassCss')]
48 48
 	public function testLiensClassCss(string $table, ?string $short, bool $in) {
49
-		$id = sql_getfetsel(id_table_objet($table), $table, "statut='publie'", limit: '0,1');
49
+		$id = sql_getfetsel(id_table_objet($table), $table, "statut='publie'", limit : '0,1');
50 50
 		$type = objet_type($table);
51 51
 		if (!$id) {
52 52
 			$this->markTestSkipped(sprintf('Necessite un·e %s publié', $type));
Please login to merge, or discard this patch.
ecrire/public/assembler.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 	$GLOBALS['contexte'] = calculer_contexte();
35 35
 	$page = ['contexte_implicite' => calculer_contexte_implicite()];
36
-	$page['contexte_implicite']['cache'] = $fond . preg_replace(
36
+	$page['contexte_implicite']['cache'] = $fond.preg_replace(
37 37
 		',\.[a-zA-Z0-9]*$,',
38 38
 		'',
39 39
 		preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI'])
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			if ($page === '') {
134 134
 				$erreur = _T(
135 135
 					'info_erreur_squelette2',
136
-					['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES]
136
+					['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES]
137 137
 				);
138 138
 				erreur_squelette($erreur);
139 139
 				// eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	if (
175 175
 		$lastmodified && !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !isset($page['entetes']['Last-Modified'])
176 176
 	) {
177
-		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT';
177
+		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT';
178 178
 	}
179 179
 
180 180
 	// fermer la connexion apres les headers si requete HEAD
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		if (!defined('_CONTEXTE_IGNORE_LISTE_VARIABLES')) {
207 207
 			nettoyer_uri_var('');
208 208
 		}
209
-		$preg_ignore_variables = '/(' . implode('|',_CONTEXTE_IGNORE_LISTE_VARIABLES) . ')/';
209
+		$preg_ignore_variables = '/('.implode('|', _CONTEXTE_IGNORE_LISTE_VARIABLES).')/';
210 210
 	}
211 211
 
212 212
 	$contexte = [];
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		'spip_version_code' => $GLOBALS['spip_version_code'],
248 248
 	];
249 249
 	if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
250
-		$contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST'];
250
+		$contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST'];
251 251
 	}
252 252
 
253 253
 	return $contexte_implicite;
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 			}
583 583
 		}
584 584
 		if (is_null($id)) {
585
-			$msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
585
+			$msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
586 586
 			erreur_squelette($msg);
587 587
 			// on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant
588 588
 			$id = 0;
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 		}
626 626
 
627 627
 		if (preg_match(',^[a-z0-9_]+$,', $soustype)) {
628
-			if (!trouve_modele($fond = ($type . '_' . $soustype))) {
628
+			if (!trouve_modele($fond = ($type.'_'.$soustype))) {
629 629
 				$fond = '';
630 630
 				$class = $soustype;
631 631
 			}
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 		$compteur--;
641 641
 		return false;
642 642
 	}
643
-	$fond = 'modeles/' . $fond;
643
+	$fond = 'modeles/'.$fond;
644 644
 	// Creer le contexte
645 645
 	$contexte = $env;
646 646
 	// securiser le contexte des modèles : tout ce qui arrive de _request() doit être sanitizé
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 			if (is_scalar($v)) {
651 651
 				$v = spip_securise_valeur_env_modele($v);
652 652
 			} else {
653
-				array_walk_recursive($v, function (&$value, $index) {
653
+				array_walk_recursive($v, function(&$value, $index) {
654 654
 					$value = spip_securise_valeur_env_modele($value);
655 655
 				});
656 656
 			}
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 	// sinon, s'il y a un lien, on l'ajoute classiquement
696 696
 	if (
697 697
 		strstr(
698
-			' ' . ($classes = extraire_attribut($retour, 'class')) . ' ',
698
+			' '.($classes = extraire_attribut($retour, 'class')).' ',
699 699
 			'spip_lien_ok'
700 700
 		)
701 701
 	) {
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		);
707 707
 	} else {
708 708
 		if ($lien) {
709
-			$retour = '<a href="' . $lien['href'] . '" class="' . $lien['class'] . '">' . $retour . '</a>';
709
+			$retour = '<a href="'.$lien['href'].'" class="'.$lien['class'].'">'.$retour.'</a>';
710 710
 		}
711 711
 	}
712 712
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	if (is_numeric($valeur) || is_bool($valeur) || is_null($valeur)) {
732 732
 		return $valeur;
733 733
 	}
734
-	$valeur = (string)$valeur;
734
+	$valeur = (string) $valeur;
735 735
 	if (str_starts_with($valeur, '@') && is_numeric(substr($valeur, 1))) {
736 736
 		return $valeur;
737 737
 	}
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 		return $page;
752 752
 	}
753 753
 	// eval $page et affecte $res
754
-	include _ROOT_RESTREINT . 'public/evaluer_page.php';
754
+	include _ROOT_RESTREINT.'public/evaluer_page.php';
755 755
 
756 756
 	// Lever un drapeau (global) si le fond utilise #SESSION
757 757
 	// a destination de public/parametrer
@@ -819,16 +819,16 @@  discard block
 block discarded – undo
819 819
 			if (($pos = strpos($head, '<head>')) !== false) {
820 820
 				$head = substr_replace($head, $base, $pos + 6, 0);
821 821
 			} elseif (preg_match(',<head[^>]*>,i', $head, $r)) {
822
-				$head = str_replace($r[0], $r[0] . $base, $head);
822
+				$head = str_replace($r[0], $r[0].$base, $head);
823 823
 			}
824
-			$texte = $head . substr($texte, $poshead);
824
+			$texte = $head.substr($texte, $poshead);
825 825
 		}
826 826
 		if ($href_base) {
827 827
 			// gerer les ancres
828 828
 			$base = $_SERVER['REQUEST_URI'];
829 829
 			// pas de guillemets ni < dans l'URL qu'on insere dans le HTML
830 830
 			if (str_contains($base, "'") || str_contains($base, '"') || str_contains($base, '<')) {
831
-				$base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base);
831
+				$base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base);
832 832
 			}
833 833
 			if (str_contains($texte, "href='#")) {
834 834
 				$texte = str_replace("href='#", "href='$base#", $texte);
Please login to merge, or discard this patch.