Completed
Push — master ( c3f20e...6d7580 )
by cam
01:15
created
ecrire/inc/texte_mini.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 	// celle du texte) et public (spip_lang est la langue du texte)
45 45
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
46 46
 
47
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
47
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
48 48
 	if ($dir == 'rtl') {
49 49
 		$p .= '_rtl';
50 50
 	}
51 51
 
52 52
 	if (!isset($GLOBALS[$p])) {
53
-		$GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>';
53
+		$GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>';
54 54
 	}
55 55
 
56 56
 	return $GLOBALS[$p];
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 
70 70
 if (!defined('_BALISES_BLOCS_REGEXP')) {
71
-	define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
71
+	define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
72 72
 }
73 73
 
74 74
 //
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	// Tester si on echappe en span ou en div
87 87
 	if (is_null($mode) or !in_array($mode, ['div', 'span'])) {
88
-		$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span';
88
+		$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span';
89 89
 	}
90 90
 
91 91
 	// Decouper en morceaux, base64 a des probleme selon la taille de la pile
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	) {
121 121
 		foreach ($matches as $m) {
122 122
 			if ($m[1] === 'code') {
123
-				$code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>';
123
+				$code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>';
124 124
 				$pre = str_replace($m[0], $code, $pre);
125 125
 			}
126 126
 		}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 // Echapper les <code>...</ code>
132 132
 function traiter_echap_code_dist($regs) {
133
-	[, , $att, $corps] = $regs;
133
+	[,, $att, $corps] = $regs;
134 134
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
135 135
 
136 136
 	// ne pas mettre le <div...> s'il n'y a qu'une ligne
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$echap = nl2br($echap);
142 142
 		$echap = "<div style='text-align: left;' "
143 143
 			. "class='spip_code' dir='ltr'><code$att>"
144
-			. $echap . '</code></div>';
144
+			. $echap.'</code></div>';
145 145
 	} else {
146
-		$echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>';
146
+		$echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>';
147 147
 	}
148 148
 
149 149
 	$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 			} // sinon les traiter selon le cas
230 230
 			else {
231 231
 				if (
232
-					function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1]))
233
-					or function_exists($f = $f . '_dist')
232
+					function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1]))
233
+					or function_exists($f = $f.'_dist')
234 234
 				) {
235 235
 					$echap = $f($regs);
236 236
 				}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	// dans une callback autonommee
252 252
 	if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) {
253 253
 		if (
254
-			strpos($letexte, '<' . '?') !== false and preg_match_all(
254
+			strpos($letexte, '<'.'?') !== false and preg_match_all(
255 255
 				',<[?].*($|[?]>),UisS',
256 256
 				$letexte,
257 257
 				$matches,
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			strpos($letexte, '<') !== false
284 284
 			and
285 285
 			preg_match_all(
286
-				',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS',
286
+				',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS',
287 287
 				$letexte,
288 288
 				$regs,
289 289
 				PREG_SET_ORDER
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 					}
301 301
 				}
302 302
 				if ($at) {
303
-					$rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>';
303
+					$rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>';
304 304
 					foreach ($at as $attr => $a) {
305 305
 						$rempl = inserer_attribut($rempl, $attr, $a);
306 306
 					}
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	$texte = nettoyer_raccourcis_typo($texte);
382 382
 
383 383
 	// balises de sauts de ligne et paragraphe
384
-	$texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte);
385
-	$texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte);
384
+	$texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte);
385
+	$texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte);
386 386
 
387 387
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
388 388
 	$texte = str_replace("\n\n", "\r", $texte);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	// supprimer les tags
391 391
 	$texte = supprimer_tags($texte);
392 392
 	$texte = trim(str_replace("\n", ' ', $texte));
393
-	$texte .= "\n";  // marquer la fin
393
+	$texte .= "\n"; // marquer la fin
394 394
 
395 395
 	// corriger la longueur de coupe
396 396
 	// en fonction de la presence de caracteres utf
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	// couper au mot precedent
406 406
 	$long = spip_substr($texte, 0, max($taille - 4, 1));
407 407
 	$u = $GLOBALS['meta']['pcre_u'];
408
-	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
408
+	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
409 409
 	if (is_null($suite)) {
410 410
 		$suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : '&nbsp;(...)');
411 411
 	}
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	if (spip_strlen($court) < max(0.75 * $taille, 2)) {
416 416
 		$points = '';
417 417
 		$long = spip_substr($texte, 0, $taille);
418
-		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
418
+		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
419 419
 		// encore trop court ? couper au caractere
420 420
 		if (spip_strlen($texte) < 0.75 * $taille) {
421 421
 			$texte = $long;
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	// supprimer l'eventuelle entite finale mal coupee
435 435
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
436 436
 
437
-	return quote_amp(trim($texte)) . $points;
437
+	return quote_amp(trim($texte)).$points;
438 438
 }
439 439
 
440 440
 
@@ -446,16 +446,16 @@  discard block
 block discarded – undo
446 446
 				define('_PROTEGE_JS_MODELES', creer_uniqid());
447 447
 			}
448 448
 			foreach ($r as $regs) {
449
-				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
449
+				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t);
450 450
 			}
451 451
 		}
452
-		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
452
+		if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) {
453 453
 			if (!defined('_PROTEGE_PHP_MODELES')) {
454 454
 				include_spip('inc/acces');
455 455
 				define('_PROTEGE_PHP_MODELES', creer_uniqid());
456 456
 			}
457 457
 			foreach ($r as $regs) {
458
-				$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t);
458
+				$t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t);
459 459
 			}
460 460
 		}
461 461
 	}
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 		if (!function_exists('attribut_html')) {
529 529
 			include_spip('inc/filtres');
530 530
 		}
531
-		$texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte;
531
+		$texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte;
532 532
 	}
533 533
 
534 534
 	return $texte;
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
  **/
599 599
 function supprime_img($letexte, $message = null) {
600 600
 	if ($message === null) {
601
-		$message = '(' . _T('img_indisponible') . ')';
601
+		$message = '('._T('img_indisponible').')';
602 602
 	}
603 603
 
604 604
 	return preg_replace(
605
-		',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
605
+		',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
606 606
 		$message,
607 607
 		$letexte
608 608
 	);
Please login to merge, or discard this patch.
ecrire/inc/lang.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 function changer_langue($lang, $liste_langues = null) {
41 41
 
42 42
 	if (is_null($liste_langues)) {
43
-		$liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'];
43
+		$liste_langues = @$GLOBALS['meta']['langues_proposees'].','.@$GLOBALS['meta']['langues_multilingue'];
44 44
 	}
45 45
 	else {
46 46
 		if (is_array($liste_langues)) {
47 47
 			$liste_langues = implode(',', $liste_langues);
48 48
 		}
49 49
 	}
50
-	$liste_langues = ',' . $liste_langues . ',';
50
+	$liste_langues = ','.$liste_langues.',';
51 51
 
52 52
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
53 53
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 	foreach ($langues as $l) {
195 195
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
196
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
196
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
197 197
 	}
198 198
 
199 199
 	if (!test_espace_prive()) {
@@ -211,23 +211,21 @@  discard block
 block discarded – undo
211 211
 		$base,
212 212
 		$cible,
213 213
 		(select_langues($nom_select, $change, $ret)
214
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
214
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
215 215
 		" method='post'"
216 216
 	);
217 217
 }
218 218
 
219 219
 function select_langues($nom_select, $change, $options, $label = '') {
220 220
 	static $cpt = 0;
221
-	$id = 'menu_langues' . $cpt++;
221
+	$id = 'menu_langues'.$cpt++;
222 222
 
223 223
 	return
224
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
224
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
225 225
 		"<select name='$nom_select' id='$id' "
226 226
 		. ((!test_espace_prive()) ?
227
-			("class='forml menu_langues'") :
228
-			(($nom_select == 'var_lang_ecrire') ?
229
-				("class='lang_ecrire'") :
230
-				"class='fondl'"))
227
+			("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ?
228
+				("class='lang_ecrire'") : "class='fondl'"))
231 229
 		. $change
232 230
 		. ">\n"
233 231
 		. $options
@@ -353,7 +351,7 @@  discard block
 block discarded – undo
353 351
 		and (!isset($GLOBALS['spip_lang'])
354 352
 			or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
355 353
 	) {
356
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
354
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
357 355
 	}
358 356
 	// en theorie là, la globale est définie, sinon c'est un problème.
359 357
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -456,7 +454,7 @@  discard block
 block discarded – undo
456 454
 	if (!isset($GLOBALS['meta']['langue_site'])) {
457 455
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
458 456
 		$GLOBALS['meta']['langue_site'] = $tout =
459
-			(!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false))
457
+			(!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false))
460 458
 				? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ','));
461 459
 		ecrire_meta('langue_site', $tout);
462 460
 	}
Please login to merge, or discard this patch.
ecrire/xml/valider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 							. $pere
62 62
 							. '</b>'
63 63
 							. (!$bons_peres ? ''
64
-								: ('<p style="font-size: 80%"> ' . _T('zxml_mais_de') . ' <b>' . $bons_peres . '</b></p>')));
64
+								: ('<p style="font-size: 80%"> '._T('zxml_mais_de').' <b>'.$bons_peres.'</b></p>')));
65 65
 					} elseif ($this->dtc->regles[$pere][0] == '/') {
66 66
 						$frat = substr($depth, 2);
67 67
 						if (!isset($this->fratrie[$frat])) {
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 		if (!isset($a[$name])) {
99 99
 			$bons = join(', ', array_keys($a));
100 100
 			if ($bons) {
101
-				$bons = " title=' " .
102
-					_T('zxml_connus_attributs') .
103
-					'&nbsp;: ' .
104
-					$bons .
101
+				$bons = " title=' ".
102
+					_T('zxml_connus_attributs').
103
+					'&nbsp;: '.
104
+					$bons.
105 105
 					"'";
106 106
 			}
107 107
 			$bons .= " style='font-weight: bold'";
108 108
 			coordonnees_erreur($this, " <b>$name</b> "
109
-				. _T('zxml_inconnu_attribut') . ' ' . _T('zxml_de')
109
+				. _T('zxml_inconnu_attribut').' '._T('zxml_de')
110 110
 				. " <a$bons>$bal</a> ("
111 111
 				. _T('zxml_survoler')
112 112
 				. ')');
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 			if (!preg_match('/^\w+$/', $type)) {
116 116
 				$this->valider_motif($phraseur, $name, $val, $bal, $type);
117 117
 			} else {
118
-				if (method_exists($this, $f = 'validerAttribut_' . $type)) {
118
+				if (method_exists($this, $f = 'validerAttribut_'.$type)) {
119 119
 					$this->$f($phraseur, $name, $val, $bal);
120 120
 				}
121 121
 			}
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 				. " <b>$bal</b> "
165 165
 				. _T('zxml_non_conforme')
166 166
 				. '</p><p>'
167
-				. '<b>' . $motif . '</b>');
167
+				. '<b>'.$motif.'</b>');
168 168
 		}
169 169
 	}
170 170
 
171 171
 	public function valider_idref($nom, $ligne, $col) {
172 172
 		if (!isset($this->ids[$nom])) {
173
-			$this->err[] = [" <p><b>$nom</b> " . _T('zxml_inconnu_id'), $ligne, $col];
173
+			$this->err[] = [" <p><b>$nom</b> "._T('zxml_inconnu_id'), $ligne, $col];
174 174
 		}
175 175
 	}
176 176
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		// controler que les balises devant etre vides le sont
218 218
 		if ($vide) {
219 219
 			if ($n <> ($k + $c)) {
220
-				coordonnees_erreur($this, " <p><b>$name</b> " . _T('zxml_nonvide_balise'));
220
+				coordonnees_erreur($this, " <p><b>$name</b> "._T('zxml_nonvide_balise'));
221 221
 			}
222 222
 			// pour les regles PCDATA ou iteration de disjonction, tout est fait
223 223
 		} elseif ($regle and ($regle != '*')) {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			$d = $this->ouvrant[$d];
253 253
 			preg_match('/^\s*(\S+)/', $d, $m);
254 254
 			if (isset($this->dtc->pcdata[$m[1]]) and ($this->dtc->pcdata[$m[1]])) {
255
-				coordonnees_erreur($this, ' <p><b>' . $m[1] . '</b> '
255
+				coordonnees_erreur($this, ' <p><b>'.$m[1].'</b> '
256 256
 					. _T('zxml_nonvide_balise')); // message a affiner
257 257
 			}
258 258
 		}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	public function phraserTout($phraseur, $data) {
297 297
 		xml_parsestring($this, $data);
298 298
 
299
-		if (!$this->dtc or preg_match(',^' . _MESSAGE_DOCTYPE . ',', $data)) {
299
+		if (!$this->dtc or preg_match(',^'._MESSAGE_DOCTYPE.',', $data)) {
300 300
 			$this->err[] = ['DOCTYPE ?', 0, 0];
301 301
 		} else {
302 302
 			$this->valider_passe2();
Please login to merge, or discard this patch.
ecrire/public/compiler.php 1 patch
Spacing   +108 added lines, -117 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 						: calculer_liste($val, $p->descr, $boucles, $id_boucle);
121 121
 					if ($var !== 1) {
122 122
 						$val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
123
-							. $val . ($echap ? ") . '" : ' ');
123
+							. $val.($echap ? ") . '" : ' ');
124 124
 					} else {
125 125
 						$val = $echap ? "'.$val.'" : $val;
126 126
 					}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	if (!$lang) {
142 142
 		$lang = '$GLOBALS["spip_lang"]';
143 143
 	}
144
-	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' ');
144
+	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' ');
145 145
 
146 146
 	return $l;
147 147
 }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	$_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
172 172
 	if (is_string($p->texte)) {
173 173
 		$fichier = $p->texte;
174
-		$code = '"' . str_replace('"', '\"', $fichier) . '"';
174
+		$code = '"'.str_replace('"', '\"', $fichier).'"';
175 175
 	} else {
176 176
 		$code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
177 177
 		if ($code and preg_match("/^'([^']*)'/s", $code, $r)) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		return false;
221 221
 	} // j'aurais voulu toucher le fond ...
222 222
 
223
-	$contexte = 'array(' . $_contexte . ')';
223
+	$contexte = 'array('.$_contexte.')';
224 224
 
225 225
 	if ($env) {
226 226
 		$contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
@@ -235,16 +235,16 @@  discard block
 block discarded – undo
235 235
 			$_options[] = $ajax;
236 236
 		}
237 237
 		$code = " ' . argumenter_squelette($code) . '";
238
-		$code = 'echo ' . sprintf(
238
+		$code = 'echo '.sprintf(
239 239
 			CODE_RECUPERER_FOND,
240 240
 			$code,
241 241
 			$contexte,
242 242
 			implode(',', $_options),
243 243
 			"_request(\\'connect\\') ?? \\'\\'"
244
-		) . ';';
244
+		).';';
245 245
 	}
246 246
 
247
-	return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'";
247
+	return "\n'<'.'".'?php '.$code."\n?'."."'>'";
248 248
 }
249 249
 
250 250
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 					$id = $id_table;
325 325
 					$statut = preg_replace(',\W,', '', $s['champ']); // securite
326 326
 				}
327
-				$mstatut = $id . '.' . $statut;
327
+				$mstatut = $id.'.'.$statut;
328 328
 
329 329
 				$arg_ignore_previsu = ($ignore_previsu ? ',true' : '');
330 330
 				include_spip('public/quete');
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
 					isset($s['post_date']) and $s['post_date']
333 333
 					and $GLOBALS['meta']['post_dates'] == 'non'
334 334
 				) {
335
-					$date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
335
+					$date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite
336 336
 					array_unshift(
337 337
 						$boucle->where,
338 338
 						$echapper ?
339
-							"\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
339
+							"\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)"
340 340
 							:
341 341
 							quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
342 342
 					);
@@ -345,9 +345,9 @@  discard block
 block discarded – undo
345 345
 					$boucle->where,
346 346
 					$echapper ?
347 347
 						"\nquete_condition_statut('$mstatut',"
348
-						. _q($s['previsu']) . ','
349
-						. _q($s['publie']) . ','
350
-						. _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
348
+						. _q($s['previsu']).','
349
+						. _q($s['publie']).','
350
+						. _q($boucle->sql_serveur)."$arg_ignore_previsu)"
351 351
 						:
352 352
 						quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
353 353
 				);
@@ -381,14 +381,14 @@  discard block
 block discarded – undo
381 381
 	if (_request('var_mode_affiche') != 'resultat') {
382 382
 		$trace = '';
383 383
 	} else {
384
-		$_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
384
+		$_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle;
385 385
 		$_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
386 386
 		$trace = "
387 387
 		if (empty($_trace)) { 
388 388
 			$_trace = []; 
389 389
 		}
390 390
 		if (count($_trace) < 3) { 
391
-			$_trace" . '[] = $t0; 
391
+			$_trace".'[] = $t0; 
392 392
 		}';
393 393
 	}
394 394
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	return
423 423
 		// Numrows[$nom] peut ne pas être encore defini
424 424
 		"\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
425
-		. "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';'
425
+		. "\n\t\$t0 = ".$boucles[$id_boucle]->return.';'
426 426
 		. "\n\t\$Numrows['$nom'] = (\$save_numrows);"
427 427
 		. $trace
428 428
 		. "\n\treturn \$t0;";
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 	// faudrait expanser le foreach a la compil, car y en a souvent qu'un
491 491
 	// et puis faire un [] plutot qu'un "','."
492 492
 	if ($boucle->doublons) {
493
-		$corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
493
+		$corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '.
494 494
 			index_pile($id_boucle, $primary, $boucles)
495 495
 			. "; // doublons\n";
496 496
 	}
@@ -518,13 +518,13 @@  discard block
 block discarded – undo
518 518
 		$corps .=
519 519
 			"\n\t\tlang_select_public("
520 520
 			. index_pile($id_boucle, 'lang', $boucles)
521
-			. ", '" . $boucle->lang_select . "'"
521
+			. ", '".$boucle->lang_select."'"
522 522
 			. (in_array($type_boucle, [
523 523
 				'articles',
524 524
 				'rubriques',
525 525
 				'hierarchie',
526 526
 				'breves'
527
-			]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
527
+			]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '')
528 528
 			. ');';
529 529
 	} else {
530 530
 		$init_lang = '';
@@ -546,20 +546,16 @@  discard block
 block discarded – undo
546 546
 
547 547
 	// gestion optimale des separateurs et des boucles constantes
548 548
 	if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) {
549
-		$code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
549
+		$code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'");
550 550
 	}
551 551
 
552 552
 	$corps .=
553 553
 		((!$boucle->separateur) ?
554
-			(($constant && !$corps && !$flag_cpt) ? $return :
555
-				(($return === "''") ? '' :
556
-					("\n\t\t" . '$t0 .= ' . $return . ';'))) :
557
-			("\n\t\t\$t1 " .
554
+			(($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ".
558 555
 				((strpos($return, '$t1.') === 0) ?
559
-					('.=' . substr($return, 4)) :
560
-					('= ' . $return)) .
561
-				";\n\t\t" .
562
-				'$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
556
+					('.='.substr($return, 4)) : ('= '.$return)).
557
+				";\n\t\t".
558
+				'$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;"));
563 559
 
564 560
 	// Calculer les invalideurs si c'est une boucle non constante et si on
565 561
 	// souhaite invalider ces elements
@@ -641,7 +637,7 @@  discard block
 block discarded – undo
641 637
 		$corps,
642 638
 		$fin_lang,
643 639
 		$trace,
644
-		'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
640
+		'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile'])
645 641
 	);
646 642
 
647 643
 #	var_dump($a);exit;
@@ -662,25 +658,24 @@  discard block
 block discarded – undo
662 658
  **/
663 659
 function calculer_requete_sql($boucle) {
664 660
 	$init = [];
665
-	$init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
666
-	$init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
661
+	$init[] = calculer_dec('table', "'".$boucle->id_table."'");
662
+	$init[] = calculer_dec('id', "'".$boucle->id_boucle."'");
667 663
 	# En absence de champ c'est un decompte :
668 664
 	$init[] = calculer_dec('from', calculer_from($boucle));
669 665
 	$init[] = calculer_dec('type', calculer_from_type($boucle));
670 666
 	$init[] = calculer_dec(
671 667
 		'groupby',
672
-		'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')'
668
+		'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')'
673 669
 	);
674
-	$init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")');
675
-	$init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')');
670
+	$init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")');
671
+	$init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')');
676 672
 	$init[] = calculer_dec('where', calculer_dump_array($boucle->where));
677 673
 	$init[] = calculer_dec('join', calculer_dump_join($boucle->join));
678 674
 	$init[] = calculer_dec(
679 675
 		'limit',
680 676
 		(
681 677
 			strpos($boucle->limit, 'intval') === false ?
682
-			"'" . ($boucle->limit) . "'" :
683
-			$boucle->limit
678
+			"'".($boucle->limit)."'" : $boucle->limit
684 679
 		)
685 680
 	);
686 681
 	$init[] = calculer_dec('having', calculer_dump_array($boucle->having));
@@ -689,17 +684,17 @@  discard block
 block discarded – undo
689 684
 	// ou recalculée à chaque passage (vide)
690 685
 	foreach ($init as $i) {
691 686
 		if (reset($i)) {
692
-			$s .= "\n\t\t" . end($i);
687
+			$s .= "\n\t\t".end($i);
693 688
 		} # statique
694 689
 		else {
695
-			$d .= "\n\t" . end($i);
690
+			$d .= "\n\t".end($i);
696 691
 		} # dynamique
697 692
 	}
698 693
 
699 694
 	return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
700 695
 	. $boucle->in
701 696
 	. $boucle->hash
702
-	. "\n\t" . 'if (!isset($command[\'table\'])) {'
697
+	. "\n\t".'if (!isset($command[\'table\'])) {'
703 698
 	. $s
704 699
 	. "\n\t}"
705 700
 	. $d;
@@ -782,7 +777,7 @@  discard block
 block discarded – undo
782 777
  *    - index 1 : Code de l'affectation
783 778
  **/
784 779
 function calculer_dec($nom, $val) {
785
-	$static = 'if (!isset($command[\'' . $nom . '\'])) ';
780
+	$static = 'if (!isset($command[\''.$nom.'\'])) ';
786 781
 	// si une variable apparait dans le calcul de la clause
787 782
 	// il faut la re-evaluer a chaque passage
788 783
 	if (
@@ -799,7 +794,7 @@  discard block
 block discarded – undo
799 794
 		$static = '';
800 795
 	}
801 796
 
802
-	return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';'];
797
+	return [$static, '$command[\''.$nom.'\'] = '.$val.';'];
803 798
 }
804 799
 
805 800
 /**
@@ -824,27 +819,27 @@  discard block
 block discarded – undo
824 819
 	}
825 820
 	$res = '';
826 821
 	if ($a and $a[0] == "'?'") {
827
-		return ('(' . calculer_dump_array($a[1]) .
828
-			' ? ' . calculer_dump_array($a[2]) .
829
-			' : ' . calculer_dump_array($a[3]) .
822
+		return ('('.calculer_dump_array($a[1]).
823
+			' ? '.calculer_dump_array($a[2]).
824
+			' : '.calculer_dump_array($a[3]).
830 825
 			')');
831 826
 	} else {
832 827
 		foreach ($a as $k => $v) {
833
-			$showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
834
-			$res .= ', ' . $showk . calculer_dump_array($v);
828
+			$showk = (is_numeric($k) ? '' : sql_quote($k).' => ');
829
+			$res .= ', '.$showk.calculer_dump_array($v);
835 830
 		}
836 831
 
837
-		return "\n\t\t\tarray(" . substr($res, 2) . ')';
832
+		return "\n\t\t\tarray(".substr($res, 2).')';
838 833
 	}
839 834
 }
840 835
 
841 836
 function calculer_dump_join($a) {
842 837
 	$res = '';
843 838
 	foreach ($a as $k => $v) {
844
-		$res .= ", '$k' => array(" . implode(',', $v) . ')';
839
+		$res .= ", '$k' => array(".implode(',', $v).')';
845 840
 	}
846 841
 
847
-	return 'array(' . substr($res, 2) . ')';
842
+	return 'array('.substr($res, 2).')';
848 843
 }
849 844
 
850 845
 /**
@@ -861,7 +856,7 @@  discard block
 block discarded – undo
861 856
 		$res .= ",'$k' => '$v'";
862 857
 	}
863 858
 
864
-	return 'array(' . substr($res, 1) . ')';
859
+	return 'array('.substr($res, 1).')';
865 860
 }
866 861
 
867 862
 /**
@@ -879,7 +874,7 @@  discard block
 block discarded – undo
879 874
 		$res .= ",'$k' => '$v'";
880 875
 	}
881 876
 
882
-	return 'array(' . substr($res, 1) . ')';
877
+	return 'array('.substr($res, 1).')';
883 878
 }
884 879
 
885 880
 function calculer_order(&$boucle) {
@@ -948,19 +943,19 @@  discard block
 block discarded – undo
948 943
 				) {
949 944
 					$res .= " .\n$tab$code";
950 945
 				} else {
951
-					$res = substr($res, 0, -1) . substr($code, 1);
946
+					$res = substr($res, 0, -1).substr($code, 1);
952 947
 				}
953 948
 			}
954 949
 
955
-			return '(' . substr($res, 2 + $descr['niv']) . ')';
950
+			return '('.substr($res, 2 + $descr['niv']).')';
956 951
 		}
957 952
 	} else {
958
-		$nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: '');
953
+		$nom = $descr['nom'].$id_boucle.($descr['niv'] ?: '');
959 954
 
960
-		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(
955
+		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join(
961 956
 			" ,\n$tab",
962 957
 			$codes
963
-		) . ')))';
958
+		).')))';
964 959
 	}
965 960
 }
966 961
 
@@ -987,7 +982,7 @@  discard block
 block discarded – undo
987 982
 			// texte seul
988 983
 			case 'texte':
989 984
 				$code = sandbox_composer_texte($p->texte, $p);
990
-				$commentaire = strlen($p->texte) . ' signes';
985
+				$commentaire = strlen($p->texte).' signes';
991 986
 				$avant = '';
992 987
 				$apres = '';
993 988
 				$altern = "''";
@@ -996,14 +991,14 @@  discard block
 block discarded – undo
996 991
 			case 'polyglotte':
997 992
 				$code = '';
998 993
 				foreach ($p->traductions as $k => $v) {
999
-					$code .= ",'" .
1000
-						str_replace(['\\', "'"], ['\\\\', "\\'"], $k) .
1001
-						"' => '" .
1002
-						str_replace(['\\', "'"], ['\\\\', "\\'"], $v) .
994
+					$code .= ",'".
995
+						str_replace(['\\', "'"], ['\\\\', "\\'"], $k).
996
+						"' => '".
997
+						str_replace(['\\', "'"], ['\\\\', "\\'"], $v).
1003 998
 						"'";
1004 999
 				}
1005
-				$code = 'choisir_traduction(array(' .
1006
-					substr($code, 1) .
1000
+				$code = 'choisir_traduction(array('.
1001
+					substr($code, 1).
1007 1002
 					'))';
1008 1003
 				$commentaire = '&';
1009 1004
 				$avant = '';
@@ -1019,7 +1014,7 @@  discard block
 block discarded – undo
1019 1014
 					$err_e_c = true;
1020 1015
 					$code = "''";
1021 1016
 				} else {
1022
-					$commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1017
+					$commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>';
1023 1018
 					$avant = '';
1024 1019
 					$apres = '';
1025 1020
 					$altern = "''";
@@ -1048,8 +1043,8 @@  discard block
 block discarded – undo
1048 1043
 					$err_e_c = true;
1049 1044
 					$code = "''";
1050 1045
 				} else {
1051
-					$code = 'BOUCLE' .
1052
-						str_replace('-', '_', $nom) . $descr['nom'] .
1046
+					$code = 'BOUCLE'.
1047
+						str_replace('-', '_', $nom).$descr['nom'].
1053 1048
 						'($Cache, $Pile, $doublons, $Numrows, $SP)';
1054 1049
 					$commentaire = "?$nom";
1055 1050
 					if (
@@ -1091,24 +1086,22 @@  discard block
 block discarded – undo
1091 1086
 				foreach ($p->arg as $k => $v) {
1092 1087
 					$_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1093 1088
 					if ($k) {
1094
-						$l[] = _q($k) . ' => ' . $_v;
1089
+						$l[] = _q($k).' => '.$_v;
1095 1090
 					} else {
1096 1091
 						$code = $_v;
1097 1092
 					}
1098 1093
 				}
1099 1094
 				// Si le module n'est pas fourni, l'expliciter sauf si calculé
1100 1095
 				if ($p->module) {
1101
-					$m = $p->module . ':' . $p->nom_champ;
1096
+					$m = $p->module.':'.$p->nom_champ;
1102 1097
 				} elseif ($p->nom_champ) {
1103
-					$m = MODULES_IDIOMES . ':' . $p->nom_champ;
1098
+					$m = MODULES_IDIOMES.':'.$p->nom_champ;
1104 1099
 				} else {
1105 1100
 					$m = '';
1106 1101
 				}
1107 1102
 
1108
-				$code = (!$code ? "'$m'" :
1109
-						($m ? "'$m' . $code" :
1110
-							("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1111
-					. (!$l ? '' : (', array(' . implode(",\n", $l) . ')'));
1103
+				$code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))")))
1104
+					. (!$l ? '' : (', array('.implode(",\n", $l).')'));
1112 1105
 				$code = "_T($code)";
1113 1106
 				if ($p->param) {
1114 1107
 					$p->id_boucle = $id_boucle;
@@ -1130,7 +1123,7 @@  discard block
 block discarded – undo
1130 1123
 				$p->type_requete = $type;
1131 1124
 
1132 1125
 				$code = calculer_champ($p);
1133
-				$commentaire = '#' . $p->nom_champ . $p->etoile;
1126
+				$commentaire = '#'.$p->nom_champ.$p->etoile;
1134 1127
 				$avant = calculer_liste(
1135 1128
 					$p->avant,
1136 1129
 					$descr,
@@ -1170,10 +1163,9 @@  discard block
 block discarded – undo
1170 1163
 		if ($code != "''") {
1171 1164
 			$code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1172 1165
 			$codes[] = (($mode == 'validation') ?
1173
-				"array($code, '$commentaire', " . $p->ligne . ')'
1166
+				"array($code, '$commentaire', ".$p->ligne.')'
1174 1167
 				: (($mode == 'code') ?
1175
-					"\n// $commentaire\n$code" :
1176
-					$code));
1168
+					"\n// $commentaire\n$code" : $code));
1177 1169
 		}
1178 1170
 	} // foreach
1179 1171
 
@@ -1229,19 +1221,19 @@  discard block
 block discarded – undo
1229 1221
 			$cond = '';
1230 1222
 		} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1231 1223
 			$t = $r[2];
1232
-			$cond = '!' . $r[1];
1224
+			$cond = '!'.$r[1];
1233 1225
 		} else {
1234 1226
 			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) {
1235 1227
 				$t = $r[2];
1236 1228
 				$cond = $r[1];
1237 1229
 			} else {
1238
-				$t = '$t' . $n;
1230
+				$t = '$t'.$n;
1239 1231
 				$cond = "($t = $code)!==''";
1240 1232
 			}
1241 1233
 		}
1242 1234
 
1243
-		$res = (!$avant ? '' : "$avant . ") .
1244
-			$t .
1235
+		$res = (!$avant ? '' : "$avant . ").
1236
+			$t.
1245 1237
 			(!$apres ? '' : " . $apres");
1246 1238
 
1247 1239
 		if ($res !== $t) {
@@ -1292,12 +1284,12 @@  discard block
 block discarded – undo
1292 1284
 
1293 1285
 	// rendre inertes les echappements de #[](){}<>
1294 1286
 	$i = 0;
1295
-	while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) {
1287
+	while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) {
1296 1288
 		$i++;
1297 1289
 	}
1298 1290
 	$squelette = preg_replace_callback(
1299 1291
 		',\\\\([#[()\]{}<>]),',
1300
-		fn($a) => "$inerte-" . ord($a[1]) . '-',
1292
+		fn($a) => "$inerte-".ord($a[1]).'-',
1301 1293
 		$squelette,
1302 1294
 		-1,
1303 1295
 		$esc
@@ -1313,7 +1305,7 @@  discard block
 block discarded – undo
1313 1305
 	// Phraser le squelette, selon sa grammaire
1314 1306
 
1315 1307
 	$boucles = [];
1316
-	$f = charger_fonction('phraser_' . $gram, 'public');
1308
+	$f = charger_fonction('phraser_'.$gram, 'public');
1317 1309
 
1318 1310
 	$squelette = $f($squelette, '', $boucles, $descr);
1319 1311
 
@@ -1329,7 +1321,7 @@  discard block
 block discarded – undo
1329 1321
 			);
1330 1322
 			$boucles[$i]->descr['squelette'] = preg_replace_callback(
1331 1323
 				",$inerte-(\d+)-,",
1332
-				fn($a) => '\\\\' . chr($a[1]),
1324
+				fn($a) => '\\\\'.chr($a[1]),
1333 1325
 				$boucle->descr['squelette']
1334 1326
 			);
1335 1327
 		}
@@ -1340,19 +1332,19 @@  discard block
 block discarded – undo
1340 1332
 		include_spip('public/decompiler');
1341 1333
 		foreach ($boucles as $id => $boucle) {
1342 1334
 			if ($id) {
1343
-				$decomp = "\n/* BOUCLE " .
1344
-					$boucle->type_requete .
1345
-					' ' .
1346
-					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1347
-					($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1335
+				$decomp = "\n/* BOUCLE ".
1336
+					$boucle->type_requete.
1337
+					' '.
1338
+					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')).
1339
+					($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : '').
1348 1340
 					" */\n";
1349 1341
 			} else {
1350
-				$decomp = ("\n/*\n" .
1342
+				$decomp = ("\n/*\n".
1351 1343
 					str_replace('*/', '* /', public_decompiler($squelette, $gram))
1352 1344
 					. "\n*/");
1353 1345
 			}
1354
-			$boucles[$id]->return = $decomp . $boucle->return;
1355
-			$GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1346
+			$boucles[$id]->return = $decomp.$boucle->return;
1347
+			$GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return;
1356 1348
 		}
1357 1349
 	}
1358 1350
 
@@ -1375,7 +1367,7 @@  discard block
 block discarded – undo
1375 1367
 		}
1376 1368
 	}
1377 1369
 	foreach ($boucles as $id => $boucle) {
1378
-		$GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1370
+		$GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle;
1379 1371
 	}
1380 1372
 	$descr['documents'] = compile_inclure_doublons($squelette);
1381 1373
 
@@ -1466,8 +1458,7 @@  discard block
 block discarded – undo
1466 1458
 						} else {
1467 1459
 							$boucles[$id]->type_requete = false;
1468 1460
 							$boucle = $boucles[$id];
1469
-							$x = (!$boucle->sql_serveur ? '' :
1470
-									($boucle->sql_serveur . ':')) .
1461
+							$x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')).
1471 1462
 								$type;
1472 1463
 							$msg = [
1473 1464
 								'zbug_table_inconnue',
@@ -1557,13 +1548,13 @@  discard block
 block discarded – undo
1557 1548
 			if (
1558 1549
 				// fonction de boucle avec serveur & table
1559 1550
 				(!$serveur or
1560
-					((!function_exists($f = 'boucle_' . $serveur . '_' . $table))
1561
-						and (!function_exists($f = $f . '_dist'))
1551
+					((!function_exists($f = 'boucle_'.$serveur.'_'.$table))
1552
+						and (!function_exists($f = $f.'_dist'))
1562 1553
 					)
1563 1554
 				)
1564 1555
 				// fonction de boucle avec table
1565
-				and (!function_exists($f = 'boucle_' . $table))
1566
-				and (!function_exists($f = $f . '_dist'))
1556
+				and (!function_exists($f = 'boucle_'.$table))
1557
+				and (!function_exists($f = $f.'_dist'))
1567 1558
 			) {
1568 1559
 				// fonction de boucle standard
1569 1560
 				if (!function_exists($f = 'boucle_DEFAUT')) {
@@ -1571,20 +1562,20 @@  discard block
 block discarded – undo
1571 1562
 				}
1572 1563
 			}
1573 1564
 
1574
-			$req = "\n\n\tstatic \$command = array();\n\t" .
1575
-				"static \$connect;\n\t" .
1576
-				"\$command['connect'] = \$connect = " .
1577
-				_q($boucle->sql_serveur) .
1578
-				';' .
1565
+			$req = "\n\n\tstatic \$command = array();\n\t".
1566
+				"static \$connect;\n\t".
1567
+				"\$command['connect'] = \$connect = ".
1568
+				_q($boucle->sql_serveur).
1569
+				';'.
1579 1570
 				$f($id, $boucles);
1580 1571
 		} else {
1581 1572
 			$req = ("\n\treturn '';");
1582 1573
 		}
1583 1574
 
1584 1575
 		$boucles[$id]->return =
1585
-			"\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom .
1586
-			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1587
-			$req .
1576
+			"\n\nfunction BOUCLE".strtr($id, '-', '_').$nom.
1577
+			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'.
1578
+			$req.
1588 1579
 			"\n}\n";
1589 1580
 	}
1590 1581
 
@@ -1594,7 +1585,7 @@  discard block
 block discarded – undo
1594 1585
 		return false;
1595 1586
 	}
1596 1587
 
1597
-	$principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1588
+	$principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1598 1589
 '
1599 1590
 		// reporter de maniere securisee les doublons inclus
1600 1591
 		. '
@@ -1602,15 +1593,15 @@  discard block
 block discarded – undo
1602 1593
 		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
1603 1594
 
1604 1595
 	$connect = ' .
1605
-		_q($connect) . ';
1596
+		_q($connect).';
1606 1597
 	$page = ' .
1607 1598
 		// ATTENTION, le calcul de l'expression $corps affectera $Cache
1608 1599
 		// c'est pourquoi on l'affecte a la variable auxiliaire $page.
1609 1600
 		// avant de referencer $Cache
1610
-		$corps . ';
1601
+		$corps.';
1611 1602
 
1612 1603
 	return analyse_resultat_skel(' . var_export($nom, true)
1613
-		. ', $Cache, $page, ' . var_export($sourcefile, true) . ');
1604
+		. ', $Cache, $page, '.var_export($sourcefile, true).');
1614 1605
 }';
1615 1606
 
1616 1607
 	$secondes = spip_timer('calcul_skel');
@@ -1624,10 +1615,10 @@  discard block
 block discarded – undo
1624 1615
 	$code->return = '
1625 1616
 //
1626 1617
 // Fonction principale du squelette ' .
1627
-		$sourcefile .
1628
-		($connect ? " pour $connect" : '') .
1629
-		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1630
-		"\n//\n" .
1618
+		$sourcefile.
1619
+		($connect ? " pour $connect" : '').
1620
+		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes").
1621
+		"\n//\n".
1631 1622
 		$principal;
1632 1623
 
1633 1624
 	$boucles[''] = $code;
@@ -1679,7 +1670,7 @@  discard block
 block discarded – undo
1679 1670
  **/
1680 1671
 function requeteur_data_dist(&$boucles, &$boucle, &$id) {
1681 1672
 	include_spip('iterateur/data');
1682
-	if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1673
+	if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) {
1683 1674
 		$g = charger_fonction('data', 'iterateur');
1684 1675
 		$boucles[$id] = $g($boucle);
1685 1676
 		// from[0] stocke le type de data (rss, yql, ...)
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		if (!$fonc) {
149 149
 			$fonc = $GLOBALS['debug_objets']['principal'];
150 150
 		}
151
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
151
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
152 152
 	}
153 153
 	if ($message === false) {
154 154
 		lang_select();
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	$fond = $GLOBALS['fond'] ?? '';
178 178
 	// une erreur critique sort $message en array
179 179
 	$debug = is_array($msg) ? $msg[1] : $msg;
180
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
180
+	spip_log('Debug: '.$debug.' ('.$fond.')');
181 181
 
182 182
 	return $msg;
183 183
 }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 function debusquer_bandeau($erreurs) {
186 186
 
187 187
 	if (!empty($erreurs)) {
188
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
188
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
189 189
 
190 190
 		return debusquer_navigation($erreurs, $n);
191 191
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -218,25 +218,25 @@  discard block
 block discarded – undo
218 218
 			$valeur_simple = [];
219 219
 			foreach ($valeur as $v) {
220 220
 				if (is_array($v)) {
221
-					$valeur_simple[] = 'array:' . count($v);
221
+					$valeur_simple[] = 'array:'.count($v);
222 222
 				} elseif (is_object($v)) {
223 223
 					$valeur_simple[] = get_class($v);
224 224
 				} elseif (is_string($v)) {
225
-					$valeur_simple[] = "'" . $v . "'";
225
+					$valeur_simple[] = "'".$v."'";
226 226
 				} else {
227 227
 					$valeur_simple[] = $v;
228 228
 				}
229 229
 			}
230 230
 			$n = count($valeur);
231
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
232
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
231
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
232
+			$valeur .= '['.join(', ', $valeur_simple).']';
233 233
 		} elseif (is_object($valeur)) {
234 234
 			$valeur = get_class($valeur);
235 235
 		} elseif (is_string($valeur)) {
236
-			$valeur = "'" . $valeur . "'";
236
+			$valeur = "'".$valeur."'";
237 237
 		}
238
-		$res .= "\n<tr><td><strong>" . nl2br(entites_html($nom))
239
-			. '</strong></td><td>:&nbsp;' . nl2br(entites_html($valeur))
238
+		$res .= "\n<tr><td><strong>".nl2br(entites_html($nom))
239
+			. '</strong></td><td>:&nbsp;'.nl2br(entites_html($valeur))
240 240
 			. "</td></tr>\n";
241 241
 	}
242 242
 
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 				$nom_code = $lieu->descr['nom'];
265 265
 				$skel = $lieu->descr['sourcefile'];
266 266
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
267
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
267
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
268 268
 				$skel = "<a href='$h3'><b>$skel</b></a>";
269 269
 				if ($boucle) {
270
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
270
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
271 271
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
272 272
 				}
273 273
 			}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 	}
357 357
 
358 358
 	// Requete erronee
359
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
359
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
360 360
 		. spip_htmlspecialchars($msg)
361 361
 		. "\n<br /><span style='color: red'><b>"
362 362
 		. spip_htmlspecialchars($query)
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 
371 371
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
372 372
 
373
-	$id = $nom . $boucle;
373
+	$id = $nom.$boucle;
374 374
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
375 375
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
376 376
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		}
417 417
 	}
418 418
 	}
419
-	$incl = ',' . $reg[1] . '[.]\w$,';
419
+	$incl = ','.$reg[1].'[.]\w$,';
420 420
 
421 421
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
422 422
 		if (preg_match($incl, $v)) {
@@ -431,16 +431,13 @@  discard block
 block discarded – undo
431 431
 	[$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom);
432 432
 
433 433
 	if (!$boucle) {
434
-		return !$ligne ? '' :
435
-			(' (' .
436
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
437
-					_T('squelette_ligne')) .
434
+		return !$ligne ? '' : (' ('.
435
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
438 436
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
439 437
 	} else {
440 438
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
441 439
 
442
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
443
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
440
+		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
444 441
 	}
445 442
 }
446 443
 
@@ -462,14 +459,14 @@  discard block
 block discarded – undo
462 459
 
463 460
 	$s = preg_replace(
464 461
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
465
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
462
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
466 463
 		$s
467 464
 	);
468 465
 
469 466
 
470 467
 	$tableau = explode('<br />', $s);
471 468
 
472
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
469
+	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n";
473 470
 
474 471
 	$format10 = str_replace('white', 'lightgrey', $format);
475 472
 	$formaterr = 'color: red;';
@@ -513,7 +510,7 @@  discard block
 block discarded – undo
513 510
 	. '" style="cursor: pointer;">'
514 511
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
515 512
 	. '</div>
516
-	' . $res . "</div>\n";
513
+	' . $res."</div>\n";
517 514
 }
518 515
 
519 516
 // l'environnement graphique du debuggueur
@@ -535,14 +532,14 @@  discard block
 block discarded – undo
535 532
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
536 533
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
537 534
 				$texte .= $res2;
538
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
539
-				$legend = _T('zbug_' . $mode);
540
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
535
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
536
+				$legend = _T('zbug_'.$mode);
537
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
541 538
 				$texte = ancre_texte($texte, ['', '']);
542 539
 			}
543 540
 		} else {
544 541
 			if (strlen(trim($res))) {
545
-				return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
542
+				return "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
546 543
 			} else {
547 544
 				// cas de l'appel sur erreur: montre la page
548 545
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -550,7 +547,7 @@  discard block
 block discarded – undo
550 547
 		}
551 548
 	} else {
552 549
 		$valider = charger_fonction('valider', 'xml');
553
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
550
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
554 551
 		// Si erreur, signaler leur nombre dans le formulaire admin
555 552
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
556 553
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -561,14 +558,14 @@  discard block
 block discarded – undo
561 558
 		} else {
562 559
 			$err = ": $err";
563 560
 		}
564
-		$legend = _T('validation') . ' ' . $err;
561
+		$legend = _T('validation').' '.$err;
565 562
 		$res = $id = '';
566 563
 	}
567 564
 
568 565
 	return !trim($texte) ? '' : (
569
-		"<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
566
+		"<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
570 567
 		. "<div id='debug_boucle'><fieldset$id><legend>"
571
-		. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
568
+		. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
572 569
 		. ($legend ?: $mode)
573 570
 		. '</a></legend>'
574 571
 		. $texte
@@ -579,7 +576,7 @@  discard block
 block discarded – undo
579 576
 
580 577
 function emboite_texte($res, $fonc = '', $self = '') {
581 578
 	$errs = $res->err;
582
-	$texte = $res->entete . ($errs ? '' : $res->page);
579
+	$texte = $res->entete.($errs ? '' : $res->page);
583 580
 
584 581
 	if (!$texte and !$errs) {
585 582
 		return [ancre_texte('', ['', '']), false];
@@ -635,7 +632,7 @@  discard block
 block discarded – undo
635 632
 		$err = "<h2 style='text-align: center'>"
636 633
 			. $i
637 634
 			. "<a href='#fin_err'>"
638
-			. ' ' . _T('erreur_texte')
635
+			. ' '._T('erreur_texte')
639 636
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
640 637
 			. $err
641 638
 			. " </table><a id='fin_err'></a>";
@@ -645,9 +642,9 @@  discard block
 block discarded – undo
645 642
 		[$msg, $fermant, $ouvrant] = $errs[0];
646 643
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
647 644
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
648
-		$err = $msg .
649
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
650
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
645
+		$err = $msg.
646
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
647
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
651 648
 
652 649
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
653 650
 	}
@@ -680,7 +677,7 @@  discard block
 block discarded – undo
680 677
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
681 678
 		);
682 679
 
683
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
680
+		$res .= "<fieldset id='f_".$nom."'><legend>"
684 681
 			. $t_skel
685 682
 			. ' '
686 683
 			. $sourcefile
@@ -695,7 +692,7 @@  discard block
 block discarded – undo
695 692
 			. "'>"
696 693
 			. _T('zbug_calcul')
697 694
 			. '</a></legend>'
698
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
695
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
699 696
 			. debusquer_contexte($contexte[$sourcefile])
700 697
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
701 698
 		. "</fieldset>\n";
@@ -716,33 +713,33 @@  discard block
 block discarded – undo
716 713
 			$nom = $boucle->id_boucle;
717 714
 			$req = $boucle->type_requete;
718 715
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
719
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
720
-
721
-			$res .= "\n<tr style='background-color: " .
722
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
723
-				"'><td  align='right'>$i</td><td>\n" .
724
-				"<a  class='debug_link_boucle' href='" .
725
-				$self2 .
726
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
727
-				_T('zbug_boucle') .
728
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
729
-				$self2 .
730
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
731
-				_T('zbug_resultat') .
732
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
733
-				$self2 .
734
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
735
-				_T('zbug_code') .
736
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
737
-				str_replace('var_mode=', 'var_profile=', $self2) .
738
-				"'>" .
739
-				_T('zbug_calcul') .
740
-				"</a></td><td>\n" .
741
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
742
-				"</td><td>\n" .
743
-				$req .
744
-				"</td><td>\n" .
745
-				spip_htmlspecialchars($crit) .
716
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
717
+
718
+			$res .= "\n<tr style='background-color: ".
719
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
720
+				"'><td  align='right'>$i</td><td>\n".
721
+				"<a  class='debug_link_boucle' href='".
722
+				$self2.
723
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
724
+				_T('zbug_boucle').
725
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
726
+				$self2.
727
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
728
+				_T('zbug_resultat').
729
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
730
+				$self2.
731
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
732
+				_T('zbug_code').
733
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
734
+				str_replace('var_mode=', 'var_profile=', $self2).
735
+				"'>".
736
+				_T('zbug_calcul').
737
+				"</a></td><td>\n".
738
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
739
+				"</td><td>\n".
740
+				$req.
741
+				"</td><td>\n".
742
+				spip_htmlspecialchars($crit).
746 743
 				'</td></tr>';
747 744
 		}
748 745
 	}
@@ -769,7 +766,7 @@  discard block
 block discarded – undo
769 766
 		}
770 767
 		//  permettre le copier/coller facile
771 768
 		// $res = ancre_texte($req, array(), true);
772
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
769
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
773 770
 		//  formatage et affichage des resultats bruts de la requete
774 771
 		$ress_req = spip_query($req);
775 772
 		$brut_sql = '';
@@ -779,10 +776,10 @@  discard block
 block discarded – undo
779 776
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
780 777
 		while ($retours_sql = sql_fetch($ress_req)) {
781 778
 			if ($num <= $max_aff) {
782
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
779
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
783 780
 				$brut_sql .= '<p>';
784 781
 				foreach ($retours_sql as $key => $val) {
785
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
782
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
786 783
 				}
787 784
 				$brut_sql .= '</p>';
788 785
 			}
@@ -793,14 +790,14 @@  discard block
 block discarded – undo
793 790
 			//  ne pas afficher les $contexte_inclus
794 791
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
795 792
 			if ($view) {
796
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
793
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
797 794
 			}
798 795
 		}
799 796
 	} elseif ($affiche == 'code') {
800 797
 		$legend = $nom;
801
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
798
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
802 799
 	} elseif ($affiche == 'boucle') {
803
-		$legend = _T('zbug_boucle') . ' ' . $nom;
800
+		$legend = _T('zbug_boucle').' '.$nom;
804 801
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
805 802
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
806 803
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -818,23 +815,23 @@  discard block
 block discarded – undo
818 815
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
819 816
 	include_spip('inc/texte'); // pour corriger_typo
820 817
 
821
-	return _DOCTYPE_ECRIRE .
822
-	html_lang_attributes() .
823
-	"<head>\n<title>" .
824
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
825
-		_T('admin_debug') . ' ' . $titre . ' (' .
826
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
827
-	")</title>\n" .
828
-	"<meta http-equiv='Content-Type' content='text/html" .
829
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
830
-	"' />\n" .
818
+	return _DOCTYPE_ECRIRE.
819
+	html_lang_attributes().
820
+	"<head>\n<title>".
821
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
822
+		_T('admin_debug').' '.$titre.' ('.
823
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
824
+	")</title>\n".
825
+	"<meta http-equiv='Content-Type' content='text/html".
826
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
827
+	"' />\n".
831 828
 	http_script('', 'jquery.js')
832
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
833
-	. "' type='text/css' />" .
834
-	"</head>\n" .
835
-	"<body style='margin:0 10px;'>\n" .
836
-	"<div id='spip-debug-header'>" .
837
-	$corps .
838
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
829
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
830
+	. "' type='text/css' />".
831
+	"</head>\n".
832
+	"<body style='margin:0 10px;'>\n".
833
+	"<div id='spip-debug-header'>".
834
+	$corps.
835
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
839 836
 	'</div></body></html>';
840 837
 }
Please login to merge, or discard this patch.
ecrire/public/phraser_html.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
  * Nom d'une balise #TOTO
49 49
  *
50 50
  * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */
51
-define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})");
51
+define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})");
52 52
 /** Balise complète [...(#TOTO) ... ] */
53
-define('CHAMP_ETENDU', '/\[([^]\[]*)\(' . NOM_DE_CHAMP . '([^[)]*\)[^]\[]*)\]/S');
53
+define('CHAMP_ETENDU', '/\[([^]\[]*)\('.NOM_DE_CHAMP.'([^[)]*\)[^]\[]*)\]/S');
54 54
 
55 55
 define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S');
56 56
 define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims');
57 57
 define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS');
58
-define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s');
58
+define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s');
59 59
 
60 60
 /** Champ sql dans parenthèse ex: (id_article) */
61 61
 define('SQL_ARGS', '(\([^)]*\))');
62 62
 /** Fonction SQL sur un champ ex: SUM(visites) */
63
-define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?');
63
+define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?');
64 64
 
65 65
 function phraser_inclure($texte, $ligne, $result) {
66 66
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
  * @return array
216 216
  **/
217 217
 function phraser_champs($texte, $ligne, $result) {
218
-	while (preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match)) {
218
+	while (preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match)) {
219 219
 		$p = strpos($texte, (string) $match[0]);
220 220
 		// texte après la balise
221 221
 		$suite = substr($texte, $p + strlen($match[0]));
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 			$collecte[] = $champ;
364 364
 			$args = ltrim($regs[count($regs) - 1]);
365 365
 		} else {
366
-			if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) {
366
+			if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) {
367 367
 				// 0 est un aveu d'impuissance. A completer
368 368
 				$arg = phraser_champs_exterieurs($arg, 0, $sep, $result);
369 369
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) {
448 448
 	$res = [];
449 449
 	while (($p = strpos($texte, (string) "%$sep")) !== false) {
450
-		if (!preg_match(',^%' . preg_quote($sep) . '([0-9]+)@,', substr($texte, $p), $m)) {
450
+		if (!preg_match(',^%'.preg_quote($sep).'([0-9]+)@,', substr($texte, $p), $m)) {
451 451
 			break;
452 452
 		}
453 453
 		$debut = substr($texte, 0, $p);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 			$pos_apres = 0;
488 488
 			$result = phraser_args($match[7], ')', $sep, $result, $champ, $pos_apres);
489 489
 			phraser_vieux($champ);
490
-			$champ->avant =	phraser_champs_exterieurs($match[1], $n, $sep, $result);
490
+			$champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result);
491 491
 			$debut = substr($match[7], $pos_apres + 1);
492 492
 			if (!empty($debut)) {
493 493
 				$n += substr_count(substr($texte, 0, strpos($texte, $debut)), "\n");
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 					// une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"}
619 619
 					if (preg_match(',^(["\'])(.*)\1$,', $m[4])) {
620 620
 						$c = null;
621
-						eval('$c = ' . $m[4] . ';');
621
+						eval('$c = '.$m[4].';');
622 622
 						if (isset($c)) {
623 623
 							$m[4] = $c;
624 624
 						}
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 					if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', $param, $m)) {
699 699
 						$crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', '');
700 700
 					} elseif (
701
-						preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC .
701
+						preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC.
702 702
 						')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', $param, $m)
703 703
 					) {
704 704
 						$a2 = trim($m[8]);
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 						);
716 716
 						$crit->exclus = $m[1];
717 717
 					} elseif (
718
-						preg_match('/^([!]?)\s*(' .
719
-						CHAMP_SQL_PLUS_FONC .
718
+						preg_match('/^([!]?)\s*('.
719
+						CHAMP_SQL_PLUS_FONC.
720 720
 						')\s*(\??)(.*)$/is', $param, $m)
721 721
 					) {
722 722
 						// contient aussi les comparaisons implicites !
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 			}
862 862
 
863 863
 			// trouver sa position de depart reelle : au <Bxx> ou au <BBxx>
864
-			$precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>';
864
+			$precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>';
865 865
 			$pos_precond = strpos($texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme);
866 866
 			if (
867 867
 				$pos_precond !== false
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
 				$boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle);
873 873
 			}
874 874
 
875
-			$preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>';
875
+			$preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>';
876 876
 			$pos_preaff = strpos($texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme);
877 877
 			if (
878 878
 				$pos_preaff !== false
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
 	$pos_anonyme_next = null;
921 921
 	// si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme
922 922
 	if (!strlen($id_boucle)) {
923
-		$pos_anonyme_next = strpos($texte, BALISE_BOUCLE . '(', $pos_courante);
923
+		$pos_anonyme_next = strpos($texte, BALISE_BOUCLE.'(', $pos_courante);
924 924
 	}
925 925
 
926 926
 	//
927 927
 	// 1. Recuperer la partie conditionnelle apres
928 928
 	//
929
-	$apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>';
929
+	$apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>';
930 930
 	$pos_apres = strpos($texte, $apres_boucle, $pos_courante);
931 931
 	if (
932 932
 		$pos_apres !== false
@@ -935,13 +935,13 @@  discard block
 block discarded – undo
935 935
 		$boucle['pos_postcond'] = $pos_apres;
936 936
 		$pos_apres += strlen($apres_boucle);
937 937
 		$boucle['pos_postcond_inside'] = $pos_apres;
938
-		$pos_courante = $pos_apres ;
938
+		$pos_courante = $pos_apres;
939 939
 	}
940 940
 
941 941
 	//
942 942
 	// 2. Récuperer la partie alternative apres
943 943
 	//
944
-	$altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>';
944
+	$altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>';
945 945
 	$pos_altern = strpos($texte, $altern_boucle, $pos_courante);
946 946
 	if (
947 947
 		$pos_altern !== false
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 	//
957 957
 	// 3. Recuperer la partie footer non alternative
958 958
 	//
959
-	$postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>';
959
+	$postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>';
960 960
 	$pos_postaff = strpos($texte, $postaff_boucle, $pos_courante);
961 961
 	if (
962 962
 		$pos_postaff !== false
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 		$boucle['pos_postaff'] = $pos_postaff;
966 966
 		$pos_postaff += strlen($postaff_boucle);
967 967
 		$boucle['pos_postaff_inside'] = $pos_postaff;
968
-		$pos_courante = $pos_postaff ;
968
+		$pos_courante = $pos_postaff;
969 969
 	}
970 970
 
971 971
 	return $boucle;
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
  * @return string
1006 1006
  */
1007 1007
 function public_generer_boucle_placeholder($id_boucle, &$boucle, $boucle_placeholder, $nb_lignes) {
1008
-	$placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']';
1008
+	$placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']';
1009 1009
 	//memoriser la boucle a reinjecter
1010 1010
 	$id_boucle = "$id_boucle";
1011 1011
 	phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle);
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 	// definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette
1019 1019
 	if (is_null($boucle_placeholder)) {
1020 1020
 		do {
1021
-			$boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid()));
1021
+			$boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid()));
1022 1022
 		} while (strpos($texte, $boucle_placeholder) !== false);
1023 1023
 	}
1024 1024
 
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
 
1039 1039
 		// boucle anonyme ?
1040 1040
 		if (!strlen($id_boucle)) {
1041
-			$id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8);
1041
+			$id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8);
1042 1042
 		}
1043 1043
 
1044 1044
 		$pos_debut_boucle = $pos_courante;
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
 
1052 1052
 			$pos_avant = $boucle['pos_precond_inside'];
1053 1053
 			$result->avant = substr($texte, $pos_avant, $pos_courante - $pos_avant);
1054
-			$ligne_avant = $ligne_debut_texte +  public_compte_ligne($texte, $pos_debut_texte, $pos_avant);
1054
+			$ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant);
1055 1055
 		}
1056 1056
 
1057 1057
 		// Regarder si on a une partie inconditionnelle avant <BB_xxx>
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 
1061 1061
 			$pos_preaff = $boucle['pos_preaff_inside'];
1062 1062
 			$result->preaff = substr($texte, $pos_preaff, $end_preaff - $pos_preaff);
1063
-			$ligne_preaff = $ligne_debut_texte +  public_compte_ligne($texte, $pos_debut_texte, $pos_preaff);
1063
+			$ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff);
1064 1064
 		}
1065 1065
 
1066 1066
 		$result->id_boucle = $id_boucle;
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 		} else {
1118 1118
 			$pos_milieu += 1;
1119 1119
 
1120
-			$fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>';
1120
+			$fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>';
1121 1121
 			$pos_fin = strpos($texte, $fin_boucle, $pos_milieu);
1122 1122
 			if ($pos_fin === false) {
1123 1123
 				$err_b = [
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 			else {
1131 1131
 				// verifier une eventuelle imbrication d'une boucle homonyme
1132 1132
 				// (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur)
1133
-				$search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '(';
1133
+				$search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'(';
1134 1134
 				$search_from = $pos_milieu;
1135 1135
 				$nb_open = 1;
1136 1136
 				$nb_close = 1;
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
 		if ($boucle['pos_postcond']) {
1171 1171
 			$result->apres = substr($texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante);
1172 1172
 			$ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']);
1173
-			$pos_courante = $boucle['pos_postcond_inside'] ;
1173
+			$pos_courante = $boucle['pos_postcond_inside'];
1174 1174
 		}
1175 1175
 
1176 1176
 
Please login to merge, or discard this patch.
ecrire/install/etape_ldap4.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	if ($fail) {
40 40
 		echo info_etape(_T('info_chemin_acces_annuaire')),
41 41
 		info_progression_etape(3, 'etape_ldap', 'install/', true),
42
-			"<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'),
43
-			' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>';
42
+			"<div class='error'><p><b>"._T('avis_operation_echec').'</b></p><p>'._T('avis_chemin_invalide_1'),
43
+			' (<tt>'.spip_htmlspecialchars($base_ldap).'</tt>) '._T('avis_chemin_invalide_2').'</p></div>';
44 44
 	} else {
45 45
 		info_etape(_T('info_reglage_ldap'));
46 46
 		echo info_progression_etape(4, 'etape_ldap', 'install/');
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 
54 54
 		$res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap'])
55 55
 			. "<input type='hidden' name='etape' value='ldap5' />"
56
-			. "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />"
56
+			. "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />"
57 57
 			. fieldset(
58 58
 				_T('info_statut_utilisateurs_1'),
59 59
 				[
60 60
 					'statut_ldap' => [
61
-						'label' => _T('info_statut_utilisateurs_2') . '<br />',
61
+						'label' => _T('info_statut_utilisateurs_2').'<br />',
62 62
 						'valeur' => $statut_ldap,
63 63
 						'alternatives' => $statuts
64 64
 					]
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 
76 76
 function liste_statuts_ldap() {
77 77
 	$recom = [
78
-		'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'),
79
-		'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'),
80
-		'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />')
78
+		'info_administrateurs' => ('<b>'._T('info_administrateur_1').'</b> '._T('info_administrateur_2').'<br />'),
79
+		'info_redacteurs' => ('<b>'._T('info_redacteur_1').'</b> '._T('info_redacteur_2').'<br />'),
80
+		'info_visiteurs' => ('<b>'._T('info_visiteur_1').'</b> '._T('info_visiteur_2').'<br />')
81 81
 	];
82 82
 
83 83
 	$res = [];
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 function install_ldap_correspondances() {
94 94
 	$champs = [];
95 95
 	foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) {
96
-		$nom = 'ldap_' . $champ;
96
+		$nom = 'ldap_'.$champ;
97 97
 		$val = is_array($v) ? join(',', $v) : strval($v);
98 98
 		$champs[$nom] = [
99
-			'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />',
99
+			'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]).'<br />',
100 100
 			'valeur' => $val
101 101
 		];
102 102
 	}
103 103
 
104 104
 	return !$champs ?
105
-		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />');
105
+		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />');
106 106
 }
Please login to merge, or discard this patch.
ecrire/install/etape_3.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		= spip_connect_db($adresse_db, $port, $login_db, $pass_db, '', $server_db);
45 45
 
46 46
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
47
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
47
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
48 48
 
49 49
 	$fquery = sql_serveur('query', $server_db);
50 50
 	if ($choix_db == 'new_spip') {
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 			if (!$ok) {
55 55
 				$re = "Impossible de creer la base $re";
56 56
 				spip_log($re);
57
-				return '<p>' . _T('avis_connexion_erreur_creer_base') . "</p><!--\n$re\n-->";
57
+				return '<p>'._T('avis_connexion_erreur_creer_base')."</p><!--\n$re\n-->";
58 58
 			}
59 59
 		} else {
60 60
 			$re = "Le nom de la base doit correspondre a $re";
61 61
 			spip_log($re);
62 62
 
63
-			return '<p>' . _T('avis_connexion_erreur_nom_base') . "</p><!--\n$re\n-->";
63
+			return '<p>'._T('avis_connexion_erreur_nom_base')."</p><!--\n$re\n-->";
64 64
 		}
65 65
 	}
66 66
 
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
 		= spip_connect_db($adresse_db, $port, $login_db, $pass_db, $sel_db, $server_db);
72 72
 
73 73
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
74
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
74
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
75 75
 
76 76
 	// Completer le tableau decrivant la connexion
77 77
 
78 78
 	$GLOBALS['connexions'][$server_db]['prefixe'] = $table_prefix;
79 79
 	$GLOBALS['connexions'][$server_db]['db'] = $sel_db;
80 80
 
81
-	$old = sql_showbase($table_prefix . '_meta', $server_db);
81
+	$old = sql_showbase($table_prefix.'_meta', $server_db);
82 82
 	if ($old) {
83 83
 		$old = sql_fetch($old, $server_db);
84 84
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				$charset['charset'];
98 98
 			$charsetbase = $charset['charset'];
99 99
 		} else {
100
-			spip_log(_DEFAULT_CHARSET . ' inconnu du serveur SQL');
100
+			spip_log(_DEFAULT_CHARSET.' inconnu du serveur SQL');
101 101
 			$charsetbase = 'standard';
102 102
 		}
103 103
 		spip_log("Creation des tables. Codage $charsetbase");
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		if ($r) {
148 148
 			$r = sql_fetch($r, $server_db);
149 149
 		}
150
-		$version_installee = !$r ? 0 : (double)$r['valeur'];
150
+		$version_installee = !$r ? 0 : (double) $r['valeur'];
151 151
 		if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) {
152 152
 			$fupdateq(
153 153
 				'spip_meta',
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 				'',
157 157
 				$server_db
158 158
 			);
159
-			spip_log('nouvelle version installee: ' . $GLOBALS['spip_version_base']);
159
+			spip_log('nouvelle version installee: '.$GLOBALS['spip_version_base']);
160 160
 		}
161 161
 		// eliminer la derniere operation d'admin mal terminee
162 162
 		// notamment la mise a jour
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	if ($chmod_db) {
184 184
 		install_fichier_connexion(
185 185
 			_FILE_CHMOD_TMP,
186
-			"if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', " . sprintf('0%3o', $chmod_db) . ");\n"
186
+			"if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', ".sprintf('0%3o', $chmod_db).");\n"
187 187
 		);
188 188
 	}
189 189
 
@@ -246,16 +246,16 @@  discard block
 block discarded – undo
246 246
 
247 247
 
248 248
 function install_premier_auteur($email, $login, $nom, $pass, $hidden, $auteur_obligatoire) {
249
-	return info_progression_etape(3, 'etape_', 'install/') .
249
+	return info_progression_etape(3, 'etape_', 'install/').
250 250
 	info_etape(
251 251
 		_T('info_informations_personnelles'),
252
-		'<b>' . _T('texte_informations_personnelles_1') . '</b>' .
253
-		aider('install5', true) .
254
-		'<p>' .
252
+		'<b>'._T('texte_informations_personnelles_1').'</b>'.
253
+		aider('install5', true).
254
+		'<p>'.
255 255
 		($auteur_obligatoire ?
256 256
 			''
257 257
 			:
258
-			_T('texte_informations_personnelles_2') . ' ' . _T('info_laisser_champs_vides')
258
+			_T('texte_informations_personnelles_2').' '._T('info_laisser_champs_vides')
259 259
 		)
260 260
 	)
261 261
 	. generer_form_ecrire('install', (
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
 			_T('info_identification_publique'),
266 266
 			[
267 267
 				'nom' => [
268
-					'label' => '<b>' . _T('entree_signature') . "</b><br />\n" . _T('entree_nom_pseudo_1') . "\n",
268
+					'label' => '<b>'._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n",
269 269
 					'valeur' => $nom,
270 270
 					'required' => $auteur_obligatoire,
271 271
 				],
272 272
 				'email' => [
273
-					'label' => '<b>' . _T('entree_adresse_email') . "</b>\n",
273
+					'label' => '<b>'._T('entree_adresse_email')."</b>\n",
274 274
 					'valeur' => $email,
275 275
 				]
276 276
 			]
@@ -280,23 +280,23 @@  discard block
 block discarded – undo
280 280
 			_T('entree_identifiants_connexion'),
281 281
 			[
282 282
 				'login' => [
283
-					'label' => '<b>' . _T('entree_login') . "</b><br />\n" . _T(
283
+					'label' => '<b>'._T('entree_login')."</b><br />\n"._T(
284 284
 						'info_login_trop_court_car_pluriel',
285 285
 						['nb' => _LOGIN_TROP_COURT]
286
-					) . "\n",
286
+					)."\n",
287 287
 					'valeur' => $login,
288 288
 					'required' => $auteur_obligatoire,
289 289
 				],
290 290
 				'pass' => [
291
-					'label' => '<b>' . _T('entree_mot_passe') . "</b><br />\n" . _T(
291
+					'label' => '<b>'._T('entree_mot_passe')."</b><br />\n"._T(
292 292
 						'info_passe_trop_court_car_pluriel',
293 293
 						['nb' => _PASS_LONGUEUR_MINI]
294
-					) . "\n",
294
+					)."\n",
295 295
 					'valeur' => $pass,
296 296
 					'required' => $auteur_obligatoire,
297 297
 				],
298 298
 				'pass_verif' => [
299
-					'label' => '<b>' . _T('info_confirmer_passe') . "</b><br />\n",
299
+					'label' => '<b>'._T('info_confirmer_passe')."</b><br />\n",
300 300
 					'valeur' => $pass,
301 301
 					'required' => $auteur_obligatoire,
302 302
 				]
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 
341 341
 		if ($res) {
342 342
 			$res = info_progression_etape(2, 'etape_', 'install/', true)
343
-				. "<div class='error'><h3>" . _T('avis_operation_echec') . '</h3>'
343
+				. "<div class='error'><h3>"._T('avis_operation_echec').'</h3>'
344 344
 				. $res
345
-				. '<p>' . _T('texte_operation_echec') . '</p>'
345
+				. '<p>'._T('texte_operation_echec').'</p>'
346 346
 				. '</div>';
347 347
 		}
348 348
 	} else {
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
27 27
 }
28 28
 if (!defined('_INC_DISTANT_USER_AGENT')) {
29
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
29
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
30 30
 }
31 31
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
32 32
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
36 36
 }
37 37
 
38
-define('_REGEXP_COPIE_LOCALE', ',' 	.
38
+define('_REGEXP_COPIE_LOCALE', ','.
39 39
 	preg_replace(
40 40
 		'@^https?:@',
41 41
 		'https?:',
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 	// si c'est la protection de soi-meme, retourner le path
72 72
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
73
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
73
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
74 74
 
75 75
 		return @file_exists($source) ? $source : false;
76 76
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		return false;
91 91
 	}
92 92
 
93
-	$localrac = _DIR_RACINE . $local;
93
+	$localrac = _DIR_RACINE.$local;
94 94
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
95 95
 
96 96
 	// test d'existence du fichier
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 			['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
116 116
 		);
117 117
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
118
-			spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
118
+			spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
119 119
 		}
120 120
 		else {
121
-			spip_log("copie_locale : recuperation $source sur $localrac OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
121
+			spip_log("copie_locale : recuperation $source sur $localrac OK | taille ".$res['length'].' status '.$res['status'], 'distant');
122 122
 		}
123 123
 		if (!$res or !$res['length']) {
124 124
 			// si $t c'est sans doute juste un not-modified-since
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
 	if (!$is_known_host) {
209 209
 		$host = trim($parsed_url['host'], '.');
210
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
210
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
211 211
 			$ip = gethostbyname($host);
212 212
 			if ($ip === $host) {
213 213
 				// Error condition for gethostbyname()
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			}
229 229
 		}
230 230
 		if ($ip) {
231
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
231
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
232 232
 				return false;
233 233
 			}
234 234
 		}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	}
240 240
 
241 241
 	$port = $parsed_url['port'];
242
-	if ($port === 80  or $port === 443  or $port === 8080) {
242
+	if ($port === 80 or $port === 443 or $port === 8080) {
243 243
 		return $url;
244 244
 	}
245 245
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 				}
310 310
 			}
311 311
 			if ($taille > 500) {
312
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
312
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
313 313
 			}
314 314
 		}
315 315
 
@@ -337,16 +337,16 @@  discard block
 block discarded – undo
337 337
 			}
338 338
 		} else {
339 339
 			// fabrique une chaine HTTP simple pour un POST
340
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
340
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
341 341
 			$chaine = [];
342 342
 			if (is_array($donnees)) {
343 343
 				foreach ($donnees as $cle => $valeur) {
344 344
 					if (is_array($valeur)) {
345 345
 						foreach ($valeur as $val2) {
346
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
346
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
347 347
 						}
348 348
 					} else {
349
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
349
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
350 350
 					}
351 351
 				}
352 352
 				$chaine = implode('&', $chaine);
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
452 452
 	}
453 453
 
454
-	spip_log("recuperer_url " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG);
454
+	spip_log("recuperer_url ".$options['methode']." sur $url", 'distant'._LOG_DEBUG);
455 455
 
456 456
 	// Ajout des en-têtes spécifiques si besoin
457 457
 	$formatted_data = '';
458 458
 	if (!empty($options['headers'])) {
459 459
 		foreach ($options['headers'] as $champ => $valeur) {
460
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
460
+			$formatted_data .= $champ.': '.$valeur."\r\n";
461 461
 		}
462 462
 	}
463 463
 
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
466 466
 		$head .= $formatted_data;
467 467
 		if (stripos($head, 'Content-Length:') === false) {
468
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
468
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
469 469
 		}
470
-		$formatted_data = $head . "\r\n" . $postdata;
470
+		$formatted_data = $head."\r\n".$postdata;
471 471
 		if (
472 472
 			strlen($postdata)
473 473
 			and !$methode_demandee
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
482 482
 	$url = preg_replace(',^feed://,i', 'http://', $url);
483 483
 	if (!tester_url_absolue($url)) {
484
-		$url = 'http://' . $url;
484
+		$url = 'http://'.$url;
485 485
 	} elseif (strncmp($url, '//', 2) == 0) {
486
-		$url = 'http:' . $url;
486
+		$url = 'http:'.$url;
487 487
 	}
488 488
 
489 489
 	$url = url_to_ascii($url);
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 		$options['if_modified_since']
513 513
 	);
514 514
 	if (!$handle) {
515
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
515
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
516 516
 
517 517
 		return false;
518 518
 	}
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 					'status' => 200,
543 543
 				];
544 544
 			} else {
545
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
545
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
546 546
 				return false;
547 547
 			}
548 548
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -558,11 +558,11 @@  discard block
 block discarded – undo
558 558
 					$options['datas'] = '';
559 559
 				}
560 560
 			}
561
-			spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG);
561
+			spip_log("recuperer_url recommence ".$options['methode']." sur $url", 'distant'._LOG_DEBUG);
562 562
 
563 563
 			return recuperer_url($url, $options);
564 564
 		} elseif ($res['status'] !== 200) {
565
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
565
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
566 566
 		}
567 567
 		$result['status'] = $res['status'];
568 568
 		if (isset($res['headers'])) {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 
579 579
 	// on ne veut que les entetes
580 580
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
581
-		spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
581
+		spip_log("RESULTAT recuperer_url ".$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
582 582
 		return $result;
583 583
 	}
584 584
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 
589 589
 	$gz = false;
590 590
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
591
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
591
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
592 592
 	}
593 593
 
594 594
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 
625 625
 	$trace = json_decode(json_encode($result), true);
626 626
 	$trace['page'] = '...';
627
-	spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
627
+	spip_log("RESULTAT recuperer_url ".$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
628 628
 
629 629
 	return $result;
630 630
 }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 	$sig['url'] = $url;
679 679
 
680 680
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
681
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
681
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
682 682
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
683 683
 	$cache = "$sub$cache";
684 684
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	$fp = false;
733 733
 	if ($fichier) {
734 734
 		include_spip('inc/acces');
735
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
735
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
736 736
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
737 737
 		if (!$fp and file_exists($fichier)) {
738 738
 			return filesize($fichier);
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	}
792 792
 	$result['status'] = intval($r[1]);
793 793
 	while ($s = trim(fgets($handle, 16384))) {
794
-		$result['headers'][] = $s . "\n";
794
+		$result['headers'][] = $s."\n";
795 795
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
796 796
 		[, $d, $v] = $r;
797 797
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
 
841 841
 	// on se place tout le temps comme si on etait a la racine
842 842
 	if (_DIR_RACINE) {
843
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
843
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
844 844
 	}
845 845
 
846 846
 	$m = md5($source);
847 847
 
848 848
 	return $d
849
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
849
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
850 850
 	. substr($m, 0, 4)
851 851
 	. ".$extension";
852 852
 }
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 	// Si c'est deja local pas de souci
870 870
 	if (!tester_url_absolue($source)) {
871 871
 		if (_DIR_RACINE) {
872
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
872
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
873 873
 		}
874 874
 
875 875
 		return $source;
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 		$ext
888 888
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
889 889
 		and $f = nom_fichier_copie_locale($source, $ext)
890
-		and file_exists(_DIR_RACINE . $f)
890
+		and file_exists(_DIR_RACINE.$f)
891 891
 	) {
892 892
 		return $f;
893 893
 	}
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 
896 896
 	// Si c'est deja dans la table des documents,
897 897
 	// ramener le nom de sa copie potentielle
898
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
898
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
899 899
 
900 900
 	if ($ext) {
901 901
 		return nom_fichier_copie_locale($source, $ext);
@@ -906,9 +906,9 @@  discard block
 block discarded – undo
906 906
 
907 907
 	$ext = $path_parts ? $path_parts['extension'] : '';
908 908
 
909
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
909
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
910 910
 		$f = nom_fichier_copie_locale($source, $ext);
911
-		if (file_exists(_DIR_RACINE . $f)) {
911
+		if (file_exists(_DIR_RACINE.$f)) {
912 912
 			return $f;
913 913
 		}
914 914
 	}
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	// Ping  pour voir si son extension est connue et autorisee
917 917
 	// avec mise en cache du resultat du ping
918 918
 
919
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
919
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
920 920
 	if (
921 921
 		!@file_exists($cache)
922 922
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -926,10 +926,10 @@  discard block
 block discarded – undo
926 926
 		ecrire_fichier($cache, serialize($path_parts));
927 927
 	}
928 928
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
929
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
929
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
930 930
 		return nom_fichier_copie_locale($source, $ext);
931 931
 	}
932
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
932
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
933 933
 }
934 934
 
935 935
 
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 		} else {
1014 1014
 			if ($a['body']) {
1015 1015
 				$a['extension'] = $extension;
1016
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1016
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1017 1017
 				ecrire_fichier($a['fichier'], $a['body']);
1018 1018
 				$size_image = @spip_getimagesize($a['fichier']);
1019 1019
 				$a['largeur'] = intval($size_image[0]);
@@ -1081,20 +1081,20 @@  discard block
 block discarded – undo
1081 1081
 			!$t
1082 1082
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1083 1083
 		) {
1084
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1084
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1085 1085
 		}
1086 1086
 		if (
1087 1087
 			!$t
1088 1088
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1089 1089
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1090 1090
 		) {
1091
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1091
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1092 1092
 		}
1093 1093
 	}
1094 1094
 
1095 1095
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1096 1096
 	if (!$t) {
1097
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1097
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1098 1098
 	}
1099 1099
 
1100 1100
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1105,11 +1105,11 @@  discard block
 block discarded – undo
1105 1105
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1106 1106
 	) {
1107 1107
 		# eviter xxx.3 => 3gp (> SPIP 3)
1108
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1108
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1109 1109
 	}
1110 1110
 
1111 1111
 	if ($t) {
1112
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1112
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1113 1113
 		return $t['extension'];
1114 1114
 	} else {
1115 1115
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 		}
1213 1213
 	} else {
1214 1214
 		$scheme = $t['scheme'];
1215
-		$noproxy = $scheme . '://';
1215
+		$noproxy = $scheme.'://';
1216 1216
 	}
1217 1217
 	if (isset($t['user'])) {
1218 1218
 		$user = [$t['user'], $t['pass']];
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 	}
1227 1227
 
1228 1228
 	if (!empty($t['query'])) {
1229
-		$path .= '?' . $t['query'];
1229
+		$path .= '?'.$t['query'];
1230 1230
 	}
1231 1231
 
1232 1232
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1300,20 +1300,20 @@  discard block
 block discarded – undo
1300 1300
 	$proxy_user = '';
1301 1301
 	$http_proxy = need_proxy($host);
1302 1302
 	if ($user) {
1303
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1303
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1304 1304
 	}
1305 1305
 
1306 1306
 	$connect = '';
1307 1307
 	if ($http_proxy) {
1308
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1309
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1310
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1308
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1309
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1310
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1311 1311
 				. "Host: $path_host\r\n"
1312 1312
 				. "Proxy-Connection: Keep-Alive\r\n";
1313 1313
 		} else {
1314
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1314
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1315 1315
 				. (!$user ? '' : "$user@")
1316
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1316
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1317 1317
 		}
1318 1318
 		$t2 = @parse_url($http_proxy);
1319 1319
 		$first_host = $t2['host'];
@@ -1321,10 +1321,10 @@  discard block
 block discarded – undo
1321 1321
 			$port = 80;
1322 1322
 		}
1323 1323
 		if ($t2['user']) {
1324
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1324
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1325 1325
 		}
1326 1326
 	} else {
1327
-		$first_host = $noproxy . $host;
1327
+		$first_host = $noproxy.$host;
1328 1328
 	}
1329 1329
 
1330 1330
 	if ($connect) {
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 		);
1347 1347
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1348 1348
 		if (!$f) {
1349
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1349
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1350 1350
 			return $errno;
1351 1351
 		}
1352 1352
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
 			or !count($res = explode(' ', $res))
1360 1360
 			or $res[1] !== '200'
1361 1361
 		) {
1362
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1362
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1363 1363
 			fclose($f);
1364 1364
 
1365 1365
 			return false;
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1377 1377
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1378 1378
 		if (!$f) {
1379
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1379
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1380 1380
 
1381 1381
 			return $errno;
1382 1382
 		}
@@ -1386,16 +1386,16 @@  discard block
 block discarded – undo
1386 1386
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1387 1387
 
1388 1388
 	$host_port = $host;
1389
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1389
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1390 1390
 		$host_port .= ":$port";
1391 1391
 	}
1392 1392
 	$req = "$method $path $vers\r\n"
1393 1393
 		. "Host: $host_port\r\n"
1394
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1395
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1394
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1395
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1396 1396
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1397
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1398
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1397
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1398
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1399 1399
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1400 1400
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1401 1401
 
Please login to merge, or discard this patch.