Completed
Push — master ( 9ef159...478ba3 )
by cam
01:13
created
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		if (!$fonc) {
139 139
 			$fonc = $GLOBALS['debug_objets']['principal'];
140 140
 		}
141
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
141
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
142 142
 	}
143 143
 	if ($message === false) {
144 144
 		lang_select();
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	$fond = $GLOBALS['fond'] ?? '';
168 168
 	// une erreur critique sort $message en array
169 169
 	$debug = is_array($msg) ? $msg[1] : $msg;
170
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
170
+	spip_log('Debug: '.$debug.' ('.$fond.')');
171 171
 
172 172
 	return $msg;
173 173
 }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 function debusquer_bandeau($erreurs) {
176 176
 
177 177
 	if (!empty($erreurs)) {
178
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
178
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
179 179
 
180 180
 		return debusquer_navigation($erreurs, $n);
181 181
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -208,25 +208,25 @@  discard block
 block discarded – undo
208 208
 			$valeur_simple = [];
209 209
 			foreach ($valeur as $v) {
210 210
 				if (is_array($v)) {
211
-					$valeur_simple[] = 'array:' . count($v);
211
+					$valeur_simple[] = 'array:'.count($v);
212 212
 				} elseif (is_object($v)) {
213 213
 					$valeur_simple[] = get_class($v);
214 214
 				} elseif (is_string($v)) {
215
-					$valeur_simple[] = "'" . $v . "'";
215
+					$valeur_simple[] = "'".$v."'";
216 216
 				} else {
217 217
 					$valeur_simple[] = $v;
218 218
 				}
219 219
 			}
220 220
 			$n = count($valeur);
221
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
222
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
221
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
222
+			$valeur .= '['.join(', ', $valeur_simple).']';
223 223
 		} elseif (is_object($valeur)) {
224 224
 			$valeur = get_class($valeur);
225 225
 		} elseif (is_string($valeur)) {
226
-			$valeur = "'" . $valeur . "'";
226
+			$valeur = "'".$valeur."'";
227 227
 		}
228
-		$res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom))
229
-			. '</strong></td><td>:&nbsp;' . nl2br((string) entites_html($valeur))
228
+		$res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom))
229
+			. '</strong></td><td>:&nbsp;'.nl2br((string) entites_html($valeur))
230 230
 			. "</td></tr>\n";
231 231
 	}
232 232
 
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
 				$nom_code = $lieu->descr['nom'];
255 255
 				$skel = $lieu->descr['sourcefile'];
256 256
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
257
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
257
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
258 258
 				$skel = "<a href='$h3'><b>$skel</b></a>";
259 259
 				if ($boucle) {
260
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
260
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
261 261
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
262 262
 				}
263 263
 			}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	}
347 347
 
348 348
 	// Requete erronee
349
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
349
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
350 350
 		. spip_htmlspecialchars($msg)
351 351
 		. "\n<br /><span style='color: red'><b>"
352 352
 		. spip_htmlspecialchars($query)
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
362 362
 
363
-	$id = $nom . $boucle;
363
+	$id = $nom.$boucle;
364 364
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
365 365
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
366 366
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		}
407 407
 	}
408 408
 	}
409
-	$incl = ',' . $reg[1] . '[.]\w$,';
409
+	$incl = ','.$reg[1].'[.]\w$,';
410 410
 
411 411
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
412 412
 		if (preg_match($incl, $v)) {
@@ -421,16 +421,13 @@  discard block
 block discarded – undo
421 421
 	[$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom);
422 422
 
423 423
 	if (!$boucle) {
424
-		return !$ligne ? '' :
425
-			(' (' .
426
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
427
-					_T('squelette_ligne')) .
424
+		return !$ligne ? '' : (' ('.
425
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
428 426
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
429 427
 	} else {
430 428
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
431 429
 
432
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
433
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
430
+		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>)";
434 431
 	}
435 432
 }
436 433
 
@@ -452,14 +449,14 @@  discard block
 block discarded – undo
452 449
 
453 450
 	$s = preg_replace(
454 451
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
455
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
452
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
456 453
 		$s
457 454
 	);
458 455
 
459 456
 
460 457
 	$tableau = explode('<br />', $s);
461 458
 
462
-	$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";
459
+	$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";
463 460
 
464 461
 	$format10 = str_replace('white', 'lightgrey', $format);
465 462
 	$formaterr = 'color: red;';
@@ -503,7 +500,7 @@  discard block
 block discarded – undo
503 500
 	. '" style="cursor: pointer;">'
504 501
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
505 502
 	. '</div>
506
-	' . $res . "</div>\n";
503
+	' . $res."</div>\n";
507 504
 }
508 505
 
509 506
 // l'environnement graphique du debuggueur
@@ -525,14 +522,14 @@  discard block
 block discarded – undo
525 522
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
526 523
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
527 524
 				$texte .= $res2;
528
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
529
-				$legend = _T('zbug_' . $mode);
530
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
525
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
526
+				$legend = _T('zbug_'.$mode);
527
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
531 528
 				$texte = ancre_texte($texte, ['', '']);
532 529
 			}
533 530
 		} else {
534 531
 			if (strlen(trim($res))) {
535
-				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>";
532
+				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>";
536 533
 			} else {
537 534
 				// cas de l'appel sur erreur: montre la page
538 535
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -540,7 +537,7 @@  discard block
 block discarded – undo
540 537
 		}
541 538
 	} else {
542 539
 		$valider = charger_fonction('valider', 'xml');
543
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
540
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
544 541
 		// Si erreur, signaler leur nombre dans le formulaire admin
545 542
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
546 543
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -551,14 +548,14 @@  discard block
 block discarded – undo
551 548
 		} else {
552 549
 			$err = ": $err";
553 550
 		}
554
-		$legend = _T('validation') . ' ' . $err;
551
+		$legend = _T('validation').' '.$err;
555 552
 		$res = $id = '';
556 553
 	}
557 554
 
558 555
 	return !trim($texte) ? '' : (
559
-		"<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"
556
+		"<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"
560 557
 		. "<div id='debug_boucle'><fieldset$id><legend>"
561
-		. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
558
+		. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
562 559
 		. ($legend ?: $mode)
563 560
 		. '</a></legend>'
564 561
 		. $texte
@@ -569,7 +566,7 @@  discard block
 block discarded – undo
569 566
 
570 567
 function emboite_texte($res, $fonc = '', $self = '') {
571 568
 	$errs = $res->err;
572
-	$texte = $res->entete . ($errs ? '' : $res->page);
569
+	$texte = $res->entete.($errs ? '' : $res->page);
573 570
 
574 571
 	if (!$texte and !$errs) {
575 572
 		return [ancre_texte('', ['', '']), false];
@@ -625,7 +622,7 @@  discard block
 block discarded – undo
625 622
 		$err = "<h2 style='text-align: center'>"
626 623
 			. $i
627 624
 			. "<a href='#fin_err'>"
628
-			. ' ' . _T('erreur_texte')
625
+			. ' '._T('erreur_texte')
629 626
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
630 627
 			. $err
631 628
 			. " </table><a id='fin_err'></a>";
@@ -635,9 +632,9 @@  discard block
 block discarded – undo
635 632
 		[$msg, $fermant, $ouvrant] = $errs[0];
636 633
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
637 634
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
638
-		$err = $msg .
639
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
640
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
635
+		$err = $msg.
636
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
637
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
641 638
 
642 639
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
643 640
 	}
@@ -670,7 +667,7 @@  discard block
 block discarded – undo
670 667
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
671 668
 		);
672 669
 
673
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
670
+		$res .= "<fieldset id='f_".$nom."'><legend>"
674 671
 			. $t_skel
675 672
 			. ' '
676 673
 			. $sourcefile
@@ -685,7 +682,7 @@  discard block
 block discarded – undo
685 682
 			. "'>"
686 683
 			. _T('zbug_calcul')
687 684
 			. '</a></legend>'
688
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
685
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
689 686
 			. debusquer_contexte($contexte[$sourcefile])
690 687
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
691 688
 		. "</fieldset>\n";
@@ -706,33 +703,33 @@  discard block
 block discarded – undo
706 703
 			$nom = $boucle->id_boucle;
707 704
 			$req = $boucle->type_requete;
708 705
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
709
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
710
-
711
-			$res .= "\n<tr style='background-color: " .
712
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
713
-				"'><td  align='right'>$i</td><td>\n" .
714
-				"<a  class='debug_link_boucle' href='" .
715
-				$self2 .
716
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
717
-				_T('zbug_boucle') .
718
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
719
-				$self2 .
720
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
721
-				_T('zbug_resultat') .
722
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
723
-				$self2 .
724
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
725
-				_T('zbug_code') .
726
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
727
-				str_replace('var_mode=', 'var_profile=', $self2) .
728
-				"'>" .
729
-				_T('zbug_calcul') .
730
-				"</a></td><td>\n" .
731
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
732
-				"</td><td>\n" .
733
-				$req .
734
-				"</td><td>\n" .
735
-				spip_htmlspecialchars($crit) .
706
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
707
+
708
+			$res .= "\n<tr style='background-color: ".
709
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
710
+				"'><td  align='right'>$i</td><td>\n".
711
+				"<a  class='debug_link_boucle' href='".
712
+				$self2.
713
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
714
+				_T('zbug_boucle').
715
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
716
+				$self2.
717
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
718
+				_T('zbug_resultat').
719
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
720
+				$self2.
721
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
722
+				_T('zbug_code').
723
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
724
+				str_replace('var_mode=', 'var_profile=', $self2).
725
+				"'>".
726
+				_T('zbug_calcul').
727
+				"</a></td><td>\n".
728
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
729
+				"</td><td>\n".
730
+				$req.
731
+				"</td><td>\n".
732
+				spip_htmlspecialchars($crit).
736 733
 				'</td></tr>';
737 734
 		}
738 735
 	}
@@ -759,7 +756,7 @@  discard block
 block discarded – undo
759 756
 		}
760 757
 		//  permettre le copier/coller facile
761 758
 		// $res = ancre_texte($req, array(), true);
762
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
759
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
763 760
 		//  formatage et affichage des resultats bruts de la requete
764 761
 		$ress_req = spip_query($req);
765 762
 		$brut_sql = '';
@@ -769,10 +766,10 @@  discard block
 block discarded – undo
769 766
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
770 767
 		while ($retours_sql = sql_fetch($ress_req)) {
771 768
 			if ($num <= $max_aff) {
772
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
769
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
773 770
 				$brut_sql .= '<p>';
774 771
 				foreach ($retours_sql as $key => $val) {
775
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
772
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
776 773
 				}
777 774
 				$brut_sql .= '</p>';
778 775
 			}
@@ -783,14 +780,14 @@  discard block
 block discarded – undo
783 780
 			//  ne pas afficher les $contexte_inclus
784 781
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
785 782
 			if ($view) {
786
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
783
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
787 784
 			}
788 785
 		}
789 786
 	} elseif ($affiche == 'code') {
790 787
 		$legend = $nom;
791
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
788
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
792 789
 	} elseif ($affiche == 'boucle') {
793
-		$legend = _T('zbug_boucle') . ' ' . $nom;
790
+		$legend = _T('zbug_boucle').' '.$nom;
794 791
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
795 792
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
796 793
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -808,23 +805,23 @@  discard block
 block discarded – undo
808 805
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
809 806
 	include_spip('inc/texte'); // pour corriger_typo
810 807
 
811
-	return _DOCTYPE_ECRIRE .
812
-	html_lang_attributes() .
813
-	"<head>\n<title>" .
814
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
815
-		_T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' .
816
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
817
-	")</title>\n" .
818
-	"<meta http-equiv='Content-Type' content='text/html" .
819
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
820
-	"' />\n" .
808
+	return _DOCTYPE_ECRIRE.
809
+	html_lang_attributes().
810
+	"<head>\n<title>".
811
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
812
+		_T('admin_debug').' '.spip_htmlspecialchars($titre).' ('.
813
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
814
+	")</title>\n".
815
+	"<meta http-equiv='Content-Type' content='text/html".
816
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
817
+	"' />\n".
821 818
 	http_script('', 'jquery.js')
822
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
823
-	. "' type='text/css' />" .
824
-	"</head>\n" .
825
-	"<body style='margin:0 10px;'>\n" .
826
-	"<div id='spip-debug-header'>" .
827
-	$corps .
828
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
819
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
820
+	. "' type='text/css' />".
821
+	"</head>\n".
822
+	"<body style='margin:0 10px;'>\n".
823
+	"<div id='spip-debug-header'>".
824
+	$corps.
825
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
829 826
 	'</div></body></html>';
830 827
 }
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Spacing   +122 added lines, -123 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	if (strlen($dossier) and substr($dossier, -1) != '/') {
54 54
 		$dossier .= '/';
55 55
 	}
56
-	$f = str_replace('/', '_', $dossier) . $nom;
56
+	$f = str_replace('/', '_', $dossier).$nom;
57 57
 
58 58
 	if (function_exists($f)) {
59 59
 		return $f;
60 60
 	}
61
-	if (function_exists($g = $f . '_dist')) {
61
+	if (function_exists($g = $f.'_dist')) {
62 62
 		return $g;
63 63
 	}
64 64
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	// passer en minuscules (cf les balises de formulaires)
80 80
 	// et inclure le fichier
81 81
 	if (
82
-		!$inc = include_spip($dossier . ($d = strtolower($nom)))
82
+		!$inc = include_spip($dossier.($d = strtolower($nom)))
83 83
 		// si le fichier truc/machin/nom.php n'existe pas,
84 84
 		// la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions
85 85
 		and strlen(dirname($dossier)) and dirname($dossier) != '.'
@@ -98,19 +98,19 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	// Echec : message d'erreur
101
-	spip_log("fonction $nom ($f ou $g) indisponible" .
101
+	spip_log("fonction $nom ($f ou $g) indisponible".
102 102
 		($inc ? '' : " (fichier $d absent de $dossier)"));
103 103
 
104 104
 	include_spip('inc/minipres');
105 105
 	echo minipres(
106 106
 		_T('forum_titre_erreur'),
107 107
 		$inc ?
108
-			_T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>'])
108
+			_T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>'])
109 109
 			. '<br />'
110
-			. _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>'])
110
+			. _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
111 111
 			:
112
-			_T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']),
113
-		['all_inline' => true,'status' => 404]
112
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
113
+		['all_inline' => true, 'status' => 404]
114 114
 	);
115 115
 	exit;
116 116
 }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  *     - string : chemin du fichier trouvé
157 157
  **/
158 158
 function include_spip($f, $include = true) {
159
-	return find_in_path($f . '.php', '', $include);
159
+	return find_in_path($f.'.php', '', $include);
160 160
 }
161 161
 
162 162
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  *     - string : chemin du fichier trouvé
177 177
  **/
178 178
 function require_spip($f) {
179
-	return find_in_path($f . '.php', '', 'required');
179
+	return find_in_path($f.'.php', '', 'required');
180 180
 }
181 181
 
182 182
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		// donc il faut l'inclure "en globals"
194 194
 		if ($f = find_in_path('mes_fonctions.php')) {
195 195
 			global $dossier_squelettes;
196
-			include_once(_ROOT_CWD . $f);
196
+			include_once(_ROOT_CWD.$f);
197 197
 		}
198 198
 
199 199
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	}
299 299
 
300 300
 	// appliquer notre fonction si elle existe
301
-	$fonc = 'execute_pipeline_' . strtolower($action);
301
+	$fonc = 'execute_pipeline_'.strtolower($action);
302 302
 	if (function_exists($fonc)) {
303 303
 		$val = $fonc($val);
304 304
 	} // plantage ?
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 function spip_log($message = null, $name = null) {
364 364
 	static $pre = [];
365 365
 	static $log;
366
-	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs);
366
+	preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs);
367 367
 	if (!isset($regs[1]) or !$logname = $regs[1]) {
368 368
 		$logname = null;
369 369
 	}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 		if (!is_string($message)) {
392 392
 			$message = print_r($message, true);
393 393
 		}
394
-		$log($pre[$niveau] . ' ' . $message, $logname);
394
+		$log($pre[$niveau].' '.$message, $logname);
395 395
 	}
396 396
 }
397 397
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	foreach ($regexp as $r => $e) {
598 598
 		$regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e));
599 599
 	}
600
-	$regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,';
600
+	$regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,';
601 601
 	$ajouts = array_flip(explode('|', $c));
602 602
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
603 603
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 			// Ajout. Pour une variable, remplacer au meme endroit,
625 625
 			// pour un tableau ce sera fait dans la prochaine boucle
626 626
 			elseif (substr($r[1], -2) != '[]') {
627
-				$url[$n] = $r[1] . '=' . $u;
627
+				$url[$n] = $r[1].'='.$u;
628 628
 				unset($ajouts[$r[1]]);
629 629
 			}
630 630
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -645,11 +645,11 @@  discard block
 block discarded – undo
645 645
 	} elseif ($testv) {
646 646
 		foreach ($ajouts as $k => $n) {
647 647
 			if (!is_array($v)) {
648
-				$url[] = $k . '=' . $u;
648
+				$url[] = $k.'='.$u;
649 649
 			} else {
650
-				$id = (substr($k, -2) == '[]') ? $k : ($k . '[]');
650
+				$id = (substr($k, -2) == '[]') ? $k : ($k.'[]');
651 651
 				foreach ($v as $w) {
652
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
652
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
653 653
 				}
654 654
 			}
655 655
 		}
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 
661 661
 	// recomposer l'adresse
662 662
 	if ($url) {
663
-		$a .= '?' . join($sep, $url);
663
+		$a .= '?'.join($sep, $url);
664 664
 	}
665 665
 
666
-	return $a . $ancre;
666
+	return $a.$ancre;
667 667
 }
668 668
 
669 669
 /**
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 			translitteration($ancre)
696 696
 		);
697 697
 	}
698
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
698
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
699 699
 }
700 700
 
701 701
 /**
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
  * @return bool
812 812
  */
813 813
 function test_plugin_actif($plugin) {
814
-	return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false;
814
+	return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false;
815 815
 }
816 816
 
817 817
 /**
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 					$value = interdire_scripts($value, -1);
944 944
 				}
945 945
 				if (!empty($options['class'])) {
946
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
946
+					$value = "<span class='".$options['class']."'>$value</span>";
947 947
 				}
948 948
 				$text = str_replace("@$name@", $value, $text);
949 949
 				unset($args[$name]);
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 		// Si des variables n'ont pas ete inserees, le signaler
953 953
 		// (chaines de langues pas a jour)
954 954
 		if ($args) {
955
-			spip_log("$f:  variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG);
955
+			spip_log("$f:  variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG);
956 956
 		}
957 957
 	}
958 958
 
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 function joli_repertoire($rep) {
977 977
 	$a = substr($rep, 0, 1);
978 978
 	if ($a <> '.' and $a <> '/') {
979
-		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep;
979
+		$rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep;
980 980
 	}
981 981
 	$rep = preg_replace(',(^\.\.\/),', '', $rep);
982 982
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 			$p -= ($x * 1000);
1031 1031
 		}
1032 1032
 
1033
-		return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1033
+		return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p);
1034 1034
 	}
1035 1035
 }
1036 1036
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 	if ($taches and count($taches) and !spip_connect()) {
1098 1098
 		return false;
1099 1099
 	}
1100
-	spip_log('cron !', 'jq' . _LOG_DEBUG);
1100
+	spip_log('cron !', 'jq'._LOG_DEBUG);
1101 1101
 	if ($genie = charger_fonction('genie', 'inc', true)) {
1102 1102
 		return $genie($taches);
1103 1103
 	}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
 	if ($queue_next_job_time == -1) {
1203 1203
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
1204
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
1204
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
1205 1205
 		}
1206 1206
 		// utiliser un cache memoire si dispo
1207 1207
 		if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) {
@@ -1270,8 +1270,8 @@  discard block
 block discarded – undo
1270 1270
 		$src = '';
1271 1271
 	}
1272 1272
 	if ($script) {
1273
-		$script = ("/*<![CDATA[*/\n" .
1274
-			preg_replace(',</([^>]*)>,', '<\/\1>', $script) .
1273
+		$script = ("/*<![CDATA[*/\n".
1274
+			preg_replace(',</([^>]*)>,', '<\/\1>', $script).
1275 1275
 			'/*]]>*/');
1276 1276
 	}
1277 1277
 	if ($noscript) {
@@ -1357,13 +1357,13 @@  discard block
 block discarded – undo
1357 1357
 	if ($path_base == null) {
1358 1358
 		// Chemin standard depuis l'espace public
1359 1359
 		$path = defined('_SPIP_PATH') ? _SPIP_PATH :
1360
-			_DIR_RACINE . ':' .
1361
-			_DIR_RACINE . 'squelettes-dist/:' .
1362
-			_DIR_RACINE . 'prive/:' .
1360
+			_DIR_RACINE.':'.
1361
+			_DIR_RACINE.'squelettes-dist/:'.
1362
+			_DIR_RACINE.'prive/:'.
1363 1363
 			_DIR_RESTREINT;
1364 1364
 		// Ajouter squelettes/
1365
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
1366
-			$path = _DIR_RACINE . 'squelettes/:' . $path;
1365
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
1366
+			$path = _DIR_RACINE.'squelettes/:'.$path;
1367 1367
 		}
1368 1368
 		foreach (explode(':', $path) as $dir) {
1369 1369
 			if (strlen($dir) and substr($dir, -1) != '/') {
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 		// Et le(s) dossier(s) des squelettes nommes
1376 1376
 		if (strlen($GLOBALS['dossier_squelettes'])) {
1377 1377
 			foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1378
-				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/');
1378
+				array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/');
1379 1379
 			}
1380 1380
 		}
1381 1381
 		$GLOBALS['path_sig'] = md5(serialize($path_full));
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 
1387 1387
 	if (is_array($dir_path) or strlen($dir_path)) {
1388 1388
 		$tete = '';
1389
-		if (reset($path_base) == _DIR_RACINE . 'squelettes/') {
1389
+		if (reset($path_base) == _DIR_RACINE.'squelettes/') {
1390 1390
 			$tete = array_shift($path_base);
1391 1391
 		}
1392 1392
 		$dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path));
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 	// Et le(s) dossier(s) des squelettes nommes
1408 1408
 	if (strlen($GLOBALS['dossier_squelettes'])) {
1409 1409
 		foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) {
1410
-			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/');
1410
+			array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/');
1411 1411
 		}
1412 1412
 	}
1413 1413
 
@@ -1478,14 +1478,14 @@  discard block
 block discarded – undo
1478 1478
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
1479 1479
 	if (
1480 1480
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
1481
-		and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg'
1481
+		and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg'
1482 1482
 		and $f = find_in_theme("$file_svg_generique")
1483 1483
 	) {
1484
-		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1484
+		if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) {
1485 1485
 			return $themefiles["$subdir$file"] = $fsize;
1486 1486
 		}
1487 1487
 		else {
1488
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1488
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
1489 1489
 		}
1490 1490
 	}
1491 1491
 
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 			return $themefiles["$subdir$file"] = $f;
1496 1496
 		}
1497 1497
 	}
1498
-	spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme');
1498
+	spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme');
1499 1499
 
1500 1500
 	return $themefiles["$subdir$file"] = '';
1501 1501
 }
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 			return false;
1604 1604
 		}
1605 1605
 		if ($include and !isset($inc[$dirname][$file])) {
1606
-			include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1607
-			$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1606
+			include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
1607
+			$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1608 1608
 		}
1609 1609
 
1610 1610
 		return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file];
@@ -1617,14 +1617,14 @@  discard block
 block discarded – undo
1617 1617
 	}
1618 1618
 
1619 1619
 	foreach (creer_chemin() as $dir) {
1620
-		if (!isset($dirs[$a = $dir . $dirname])) {
1621
-			$dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a);
1620
+		if (!isset($dirs[$a = $dir.$dirname])) {
1621
+			$dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a);
1622 1622
 		}
1623 1623
 		if ($dirs[$a]) {
1624
-			if (file_exists(_ROOT_CWD . ($a .= $file))) {
1624
+			if (file_exists(_ROOT_CWD.($a .= $file))) {
1625 1625
 				if ($include and !isset($inc[$dirname][$file])) {
1626
-					include_once _ROOT_CWD . $a;
1627
-					$inc[$dirname][$file] = $inc[''][$dirname . $file] = true;
1626
+					include_once _ROOT_CWD.$a;
1627
+					$inc[$dirname][$file] = $inc[''][$dirname.$file] = true;
1628 1628
 				}
1629 1629
 				if (!defined('_SAUVER_CHEMIN')) {
1630 1630
 					// si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 					define('_SAUVER_CHEMIN', true);
1635 1635
 				}
1636 1636
 
1637
-				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a;
1637
+				return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a;
1638 1638
 			}
1639 1639
 		}
1640 1640
 	}
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 		define('_SAUVER_CHEMIN', true);
1661 1661
 	}
1662 1662
 
1663
-	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false;
1663
+	return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false;
1664 1664
 }
1665 1665
 
1666 1666
 function clear_path_cache() {
@@ -1730,12 +1730,12 @@  discard block
 block discarded – undo
1730 1730
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
1731 1731
 	// on a pas encore inclus flock.php
1732 1732
 	if (!function_exists('preg_files')) {
1733
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
1733
+		include_once _ROOT_RESTREINT.'inc/flock.php';
1734 1734
 	}
1735 1735
 
1736 1736
 	// Parcourir le chemin
1737 1737
 	foreach (creer_chemin() as $d) {
1738
-		$f = $d . $dir;
1738
+		$f = $d.$dir;
1739 1739
 		if (@is_dir($f)) {
1740 1740
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
1741 1741
 			foreach ($liste as $chemin) {
@@ -1785,9 +1785,9 @@  discard block
 block discarded – undo
1785 1785
 	if ($type === 'defaut') {
1786 1786
 		$objet = objet_type($quoi);
1787 1787
 		if (
1788
-			$f = charger_fonction('generer_' . $objet . '_url', 'urls', true)
1788
+			$f = charger_fonction('generer_'.$objet.'_url', 'urls', true)
1789 1789
 			// deprecated
1790
-			or $f = charger_fonction('generer_url_' . $objet, 'urls', true)
1790
+			or $f = charger_fonction('generer_url_'.$objet, 'urls', true)
1791 1791
 		) {
1792 1792
 			return $f;
1793 1793
 		}
@@ -1800,7 +1800,7 @@  discard block
 block discarded – undo
1800 1800
 	}
1801 1801
 
1802 1802
 	// inclure le module d'url
1803
-	include_spip('urls/' . $url_type);
1803
+	include_spip('urls/'.$url_type);
1804 1804
 
1805 1805
 	switch ($quoi) {
1806 1806
 		case 'page':
@@ -1956,8 +1956,8 @@  discard block
 block discarded – undo
1956 1956
 	include_spip('base/connect_sql');
1957 1957
 	$id_type = id_table_objet($entite, $public);
1958 1958
 
1959
-	return _DIR_RACINE . get_spip_script('./')
1960
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
1959
+	return _DIR_RACINE.get_spip_script('./')
1960
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
1961 1961
 	. (!$args ? '' : "&$args")
1962 1962
 	. (!$ancre ? '' : "#$ancre");
1963 1963
 }
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
 				!empty($_SERVER['QUERY_STRING'])
2129 2129
 				and !strpos($_SERVER['REQUEST_URI'], '?')
2130 2130
 			) {
2131
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2131
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2132 2132
 			}
2133 2133
 		}
2134 2134
 	}
@@ -2163,9 +2163,9 @@  discard block
 block discarded – undo
2163 2163
 		array_shift($myself);
2164 2164
 		$myself = implode('/', $myself);
2165 2165
 	}
2166
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
2166
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
2167 2167
 
2168
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
2168
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
2169 2169
 
2170 2170
 	return $url;
2171 2171
 }
@@ -2204,16 +2204,16 @@  discard block
 block discarded – undo
2204 2204
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
2205 2205
 	$script ??= '';
2206 2206
 	if (!$rel) {
2207
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
2207
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
2208 2208
 	} else {
2209 2209
 		if (!is_string($rel)) {
2210
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
2210
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
2211 2211
 		}
2212 2212
 	}
2213 2213
 
2214 2214
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
2215 2215
 	if ($script and ($script <> 'accueil' or $rel)) {
2216
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
2216
+		$args = "?exec=$script".(!$args ? '' : "&$args");
2217 2217
 	} elseif ($args) {
2218 2218
 		$args = "?$args";
2219 2219
 	}
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 		$args .= "#$ancre";
2222 2222
 	}
2223 2223
 
2224
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
2224
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
2225 2225
 }
2226 2226
 
2227 2227
 //
@@ -2303,10 +2303,10 @@  discard block
 block discarded – undo
2303 2303
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
2304 2304
 		}
2305 2305
 		if ($args) {
2306
-			$action .= (strpos($action, '?') !== false ? '&' : '?') . $args;
2306
+			$action .= (strpos($action, '?') !== false ? '&' : '?').$args;
2307 2307
 		}
2308 2308
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
2309
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
2309
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
2310 2310
 	}
2311 2311
 
2312 2312
 	if (!$no_entities) {
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
 
2319 2319
 function generer_url_prive($script, $args = '', $no_entities = false) {
2320 2320
 
2321
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
2321
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
2322 2322
 }
2323 2323
 
2324 2324
 // Pour les formulaires en methode POST,
@@ -2353,8 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 	. "><div>\n"
2354 2354
 	. "<input type='hidden' name='exec' value='$script1' />"
2355 2355
 	. $corps
2356
-	. (!$submit ? '' :
2357
-		("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>'))
2356
+	. (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>'))
2358 2357
 	. "</div></form>\n";
2359 2358
 }
2360 2359
 
@@ -2379,14 +2378,14 @@  discard block
 block discarded – undo
2379 2378
 		? generer_url_ecrire(_request('exec'))
2380 2379
 		: generer_url_public();
2381 2380
 
2382
-	return "\n<form action='" .
2383
-	$h .
2384
-	"'" .
2385
-	$atts .
2386
-	">\n" .
2387
-	'<div>' .
2388
-	"\n<input type='hidden' name='action' value='$script' />" .
2389
-	$corps .
2381
+	return "\n<form action='".
2382
+	$h.
2383
+	"'".
2384
+	$atts.
2385
+	">\n".
2386
+	'<div>'.
2387
+	"\n<input type='hidden' name='action' value='$script' />".
2388
+	$corps.
2390 2389
 	'</div></form>';
2391 2390
 }
2392 2391
 
@@ -2414,7 +2413,7 @@  discard block
 block discarded – undo
2414 2413
 		: generer_url_public('', '', false, false);
2415 2414
 	$url = parametre_url($url, 'action', $script);
2416 2415
 	if ($args) {
2417
-		$url .= quote_amp('&' . $args);
2416
+		$url .= quote_amp('&'.$args);
2418 2417
 	}
2419 2418
 
2420 2419
 	if ($no_entities) {
@@ -2448,9 +2447,9 @@  discard block
 block discarded – undo
2448 2447
 	}
2449 2448
 	$url =
2450 2449
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
2451
-	. $script . '/'
2450
+	. $script.'/'
2452 2451
 	. ($path ? trim($path, '/') : '')
2453
-	. ($args ? '?' . quote_amp($args) : '');
2452
+	. ($args ? '?'.quote_amp($args) : '');
2454 2453
 
2455 2454
 	if ($no_entities) {
2456 2455
 		$url = str_replace('&amp;', '&', $url);
@@ -2499,17 +2498,17 @@  discard block
 block discarded – undo
2499 2498
 
2500 2499
 	// le nom du repertoire plugins/ activables/desactivables
2501 2500
 	if (!defined('_DIR_PLUGINS')) {
2502
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
2501
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
2503 2502
 	}
2504 2503
 
2505 2504
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
2506 2505
 	if (!defined('_DIR_PLUGINS_DIST')) {
2507
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
2506
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
2508 2507
 	}
2509 2508
 
2510 2509
 	// le nom du repertoire des librairies
2511 2510
 	if (!defined('_DIR_LIB')) {
2512
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
2511
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
2513 2512
 	}
2514 2513
 
2515 2514
 	if (!defined('_DIR_IMG')) {
@@ -2519,29 +2518,29 @@  discard block
 block discarded – undo
2519 2518
 		define('_DIR_LOGOS', $pa);
2520 2519
 	}
2521 2520
 	if (!defined('_DIR_IMG_ICONES')) {
2522
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
2521
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
2523 2522
 	}
2524 2523
 
2525 2524
 	if (!defined('_DIR_DUMP')) {
2526
-		define('_DIR_DUMP', $ti . 'dump/');
2525
+		define('_DIR_DUMP', $ti.'dump/');
2527 2526
 	}
2528 2527
 	if (!defined('_DIR_SESSIONS')) {
2529
-		define('_DIR_SESSIONS', $ti . 'sessions/');
2528
+		define('_DIR_SESSIONS', $ti.'sessions/');
2530 2529
 	}
2531 2530
 	if (!defined('_DIR_TRANSFERT')) {
2532
-		define('_DIR_TRANSFERT', $ti . 'upload/');
2531
+		define('_DIR_TRANSFERT', $ti.'upload/');
2533 2532
 	}
2534 2533
 	if (!defined('_DIR_CACHE')) {
2535
-		define('_DIR_CACHE', $ti . 'cache/');
2534
+		define('_DIR_CACHE', $ti.'cache/');
2536 2535
 	}
2537 2536
 	if (!defined('_DIR_CACHE_XML')) {
2538
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
2537
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
2539 2538
 	}
2540 2539
 	if (!defined('_DIR_SKELS')) {
2541
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
2540
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
2542 2541
 	}
2543 2542
 	if (!defined('_DIR_AIDE')) {
2544
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
2543
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
2545 2544
 	}
2546 2545
 	if (!defined('_DIR_TMP')) {
2547 2546
 		define('_DIR_TMP', $ti);
@@ -2570,27 +2569,27 @@  discard block
 block discarded – undo
2570 2569
 	// Declaration des fichiers
2571 2570
 
2572 2571
 	if (!defined('_CACHE_PLUGINS_PATH')) {
2573
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
2572
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
2574 2573
 	}
2575 2574
 	if (!defined('_CACHE_PLUGINS_OPT')) {
2576
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
2575
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
2577 2576
 	}
2578 2577
 	if (!defined('_CACHE_PLUGINS_FCT')) {
2579
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
2578
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
2580 2579
 	}
2581 2580
 	if (!defined('_CACHE_PIPELINES')) {
2582
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
2581
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
2583 2582
 	}
2584 2583
 	if (!defined('_CACHE_CHEMIN')) {
2585
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
2584
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
2586 2585
 	}
2587 2586
 
2588 2587
 	# attention .php obligatoire pour ecrire_fichier_securise
2589 2588
 	if (!defined('_FILE_META')) {
2590
-		define('_FILE_META', $ti . 'meta_cache.php');
2589
+		define('_FILE_META', $ti.'meta_cache.php');
2591 2590
 	}
2592 2591
 	if (!defined('_DIR_LOG')) {
2593
-		define('_DIR_LOG', _DIR_TMP . 'log/');
2592
+		define('_DIR_LOG', _DIR_TMP.'log/');
2594 2593
 	}
2595 2594
 	if (!defined('_FILE_LOG')) {
2596 2595
 		define('_FILE_LOG', 'spip');
@@ -2607,8 +2606,8 @@  discard block
 block discarded – undo
2607 2606
 	if (!defined('_FILE_CONNECT')) {
2608 2607
 		define(
2609 2608
 			'_FILE_CONNECT',
2610
-			(@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f
2611
-			: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f
2609
+			(@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f
2610
+			: (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f
2612 2611
 			: false))
2613 2612
 		);
2614 2613
 	}
@@ -2620,7 +2619,7 @@  discard block
 block discarded – undo
2620 2619
 	if (!defined('_FILE_CHMOD')) {
2621 2620
 		define(
2622 2621
 			'_FILE_CHMOD',
2623
-			(@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f
2622
+			(@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f
2624 2623
 			: false)
2625 2624
 		);
2626 2625
 	}
@@ -2633,10 +2632,10 @@  discard block
 block discarded – undo
2633 2632
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
2634 2633
 	}
2635 2634
 	if (!defined('_FILE_CONNECT_TMP')) {
2636
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
2635
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
2637 2636
 	}
2638 2637
 	if (!defined('_FILE_CHMOD_TMP')) {
2639
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
2638
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
2640 2639
 	}
2641 2640
 
2642 2641
 	// Definition des droits d'acces en ecriture
@@ -2654,13 +2653,13 @@  discard block
 block discarded – undo
2654 2653
 		define('_DEFAULT_CHARSET', 'utf-8');
2655 2654
 	}
2656 2655
 	if (!defined('_ROOT_PLUGINS')) {
2657
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/');
2656
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/');
2658 2657
 	}
2659 2658
 	if (!defined('_ROOT_PLUGINS_DIST')) {
2660
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/');
2659
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/');
2661 2660
 	}
2662 2661
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
2663
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2662
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
2664 2663
 	}
2665 2664
 
2666 2665
 	// La taille des Log
@@ -2697,7 +2696,7 @@  discard block
 block discarded – undo
2697 2696
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
2698 2697
 	// pour le rendre surchargeable, on va provoquer un reecriture
2699 2698
 	// systematique du noyau ou une baisse de perfs => a etudier)
2700
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
2699
+	include_once _ROOT_RESTREINT.'inc/flock.php';
2701 2700
 
2702 2701
 	// charger tout de suite le path et son cache
2703 2702
 	load_path_cache();
@@ -2733,7 +2732,7 @@  discard block
 block discarded – undo
2733 2732
 			!empty($_SERVER['QUERY_STRING'])
2734 2733
 			and !strpos($_SERVER['REQUEST_URI'], '?')
2735 2734
 		) {
2736
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
2735
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
2737 2736
 		}
2738 2737
 	}
2739 2738
 
@@ -2769,7 +2768,7 @@  discard block
 block discarded – undo
2769 2768
 		) {
2770 2769
 			if (isset($GLOBALS['meta']['adresse_site'])) {
2771 2770
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
2772
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
2771
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
2773 2772
 			} else {
2774 2773
 				$uri_ref = '';
2775 2774
 			}
@@ -2863,7 +2862,7 @@  discard block
 block discarded – undo
2863 2862
 	}
2864 2863
 	if (!defined('_CACHE_RUBRIQUES')) {
2865 2864
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
2866
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
2865
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
2867 2866
 	}
2868 2867
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
2869 2868
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -3085,7 +3084,7 @@  discard block
 block discarded – undo
3085 3084
 					}
3086 3085
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
3087 3086
 						spip_log($GLOBALS['visiteur_session']['nom']
3088
-							. ' ' . _VAR_MODE);
3087
+							. ' '._VAR_MODE);
3089 3088
 					}
3090 3089
 				} // pas autorise ?
3091 3090
 				else {
@@ -3100,7 +3099,7 @@  discard block
 block discarded – undo
3100 3099
 						if (strpos($self, 'page=login') === false) {
3101 3100
 							include_spip('inc/headers');
3102 3101
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
3103
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
3102
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
3104 3103
 						}
3105 3104
 					}
3106 3105
 					// sinon tant pis
@@ -3150,10 +3149,10 @@  discard block
 block discarded – undo
3150 3149
 **/
3151 3150
 function verifier_visiteur() {
3152 3151
 	@spip_initialisation_core(
3153
-		(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
3154
-		(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
3155
-		(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
3156
-		(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
3152
+		(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
3153
+		(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
3154
+		(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
3155
+		(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
3157 3156
 	);
3158 3157
 
3159 3158
 	// Demarrer une session NON AUTHENTIFIEE si on donne son nom
@@ -3186,7 +3185,7 @@  discard block
 block discarded – undo
3186 3185
 	}
3187 3186
 
3188 3187
 	$h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']);
3189
-	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) {
3188
+	if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) {
3190 3189
 		$session = charger_fonction('session', 'inc');
3191 3190
 		if ($session()) {
3192 3191
 			return $GLOBALS['visiteur_session']['statut'];
@@ -3266,7 +3265,7 @@  discard block
 block discarded – undo
3266 3265
 			'definir_session',
3267 3266
 			$GLOBALS['visiteur_session']
3268 3267
 				? serialize($GLOBALS['visiteur_session'])
3269
-				. '_' . @$_COOKIE['spip_session']
3268
+				. '_'.@$_COOKIE['spip_session']
3270 3269
 				: ''
3271 3270
 		);
3272 3271
 		$session = $s ? substr(md5($s), 0, 8) : '';
@@ -3422,11 +3421,11 @@  discard block
 block discarded – undo
3422 3421
 	$GLOBALS['_INC_PUBLIC']++;
3423 3422
 
3424 3423
 	// fix #4235
3425
-	$cache_utilise_session_appelant	= ($GLOBALS['cache_utilise_session'] ?? null);
3424
+	$cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null);
3426 3425
 
3427 3426
 
3428 3427
 	foreach (is_array($fond) ? $fond : [$fond] as $f) {
3429
-		unset($GLOBALS['cache_utilise_session']);	// fix #4235
3428
+		unset($GLOBALS['cache_utilise_session']); // fix #4235
3430 3429
 
3431 3430
 		$page = evaluer_fond($f, $contexte, $connect);
3432 3431
 		if ($page === '') {
@@ -3511,7 +3510,7 @@  discard block
 block discarded – undo
3511 3510
  * @return array|string
3512 3511
  */
3513 3512
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
3514
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
3513
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
3515 3514
 	if (!$pathinfo) {
3516 3515
 		return $f;
3517 3516
 	}
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	// in fine renommer le prefixe si besoin
107 107
 	if (strpos($name, 'spip_') === 0) {
108
-		$name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5);
108
+		$name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5);
109 109
 	}
110 110
 
111 111
 	#spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	}
164 164
 	foreach ($_COOKIE as $name => $value) {
165 165
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
166
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
166
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
167 167
 			$_COOKIE[$spipname] = $value;
168 168
 			$GLOBALS[$spipname] = $value;
169 169
 		}
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
27 27
 }
28 28
 if (!defined('_INC_DISTANT_USER_AGENT')) {
29
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
29
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
30 30
 }
31 31
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
32 32
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
36 36
 }
37 37
 
38
-define('_REGEXP_COPIE_LOCALE', ',' 	.
38
+define('_REGEXP_COPIE_LOCALE', ','.
39 39
 	preg_replace(
40 40
 		'@^https?:@',
41 41
 		'https?:',
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// si c'est la protection de soi-meme, retourner le path
74 74
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
75
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
75
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
76 76
 
77 77
 		return @file_exists($source) ? $source : false;
78 78
 	}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		return false;
93 93
 	}
94 94
 
95
-	$localrac = _DIR_RACINE . $local;
95
+	$localrac = _DIR_RACINE.$local;
96 96
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
97 97
 
98 98
 	// test d'existence du fichier
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
 		if (!$taille_max) {
113 113
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
114 114
 		}
115
-		$localrac_tmp = $localrac . '.tmp';
115
+		$localrac_tmp = $localrac.'.tmp';
116 116
 		$res = recuperer_url(
117 117
 			$source,
118 118
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
119 119
 		);
120 120
 
121 121
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
122
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
122
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
123 123
 			@unlink($localrac_tmp);
124 124
 		}
125 125
 		else {
126
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
126
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
127 127
 		}
128 128
 		if (!$res or !$res['length']) {
129 129
 			// si $t c'est sans doute juste un not-modified-since
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		if ($callback_valider_url
135 135
 		  and is_callable($callback_valider_url)
136 136
 		  and !$callback_valider_url($res['url'])) {
137
-			spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
137
+			spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
138 138
 			@unlink($localrac_tmp);
139 139
 			return $t ? $local : false;
140 140
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 	if (!$is_known_host) {
227 227
 		$host = trim($parsed_url['host'], '.');
228
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
228
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
229 229
 			$ip = gethostbyname($host);
230 230
 			if ($ip === $host) {
231 231
 				// Error condition for gethostbyname()
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			}
247 247
 		}
248 248
 		if ($ip) {
249
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
249
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
250 250
 				return false;
251 251
 			}
252 252
 		}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	}
258 258
 
259 259
 	$port = $parsed_url['port'];
260
-	if ($port === 80  or $port === 443  or $port === 8080) {
260
+	if ($port === 80 or $port === 443 or $port === 8080) {
261 261
 		return $url;
262 262
 	}
263 263
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				}
328 328
 			}
329 329
 			if ($taille > 500) {
330
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
330
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
331 331
 			}
332 332
 		}
333 333
 
@@ -355,16 +355,16 @@  discard block
 block discarded – undo
355 355
 			}
356 356
 		} else {
357 357
 			// fabrique une chaine HTTP simple pour un POST
358
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
358
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
359 359
 			$chaine = [];
360 360
 			if (is_array($donnees)) {
361 361
 				foreach ($donnees as $cle => $valeur) {
362 362
 					if (is_array($valeur)) {
363 363
 						foreach ($valeur as $val2) {
364
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
364
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
365 365
 						}
366 366
 					} else {
367
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
367
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
368 368
 					}
369 369
 				}
370 370
 				$chaine = implode('&', $chaine);
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470 470
 	}
471 471
 
472
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
472
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
473 473
 
474 474
 	// Ajout des en-têtes spécifiques si besoin
475 475
 	$formatted_data = '';
476 476
 	if (!empty($options['headers'])) {
477 477
 		foreach ($options['headers'] as $champ => $valeur) {
478
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
478
+			$formatted_data .= $champ.': '.$valeur."\r\n";
479 479
 		}
480 480
 	}
481 481
 
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484 484
 		$head .= $formatted_data;
485 485
 		if (stripos($head, 'Content-Length:') === false) {
486
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
486
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
487 487
 		}
488
-		$formatted_data = $head . "\r\n" . $postdata;
488
+		$formatted_data = $head."\r\n".$postdata;
489 489
 		if (
490 490
 			strlen($postdata)
491 491
 			and !$methode_demandee
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500 500
 	$url = preg_replace(',^feed://,i', 'http://', $url);
501 501
 	if (!tester_url_absolue($url)) {
502
-		$url = 'http://' . $url;
502
+		$url = 'http://'.$url;
503 503
 	} elseif (strncmp($url, '//', 2) == 0) {
504
-		$url = 'http:' . $url;
504
+		$url = 'http:'.$url;
505 505
 	}
506 506
 
507 507
 	$url = url_to_ascii($url);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 		$options['if_modified_since']
531 531
 	);
532 532
 	if (!$handle) {
533
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
533
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
534 534
 
535 535
 		return false;
536 536
 	}
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 					'status' => 200,
561 561
 				];
562 562
 			} else {
563
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
563
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
564 564
 				return false;
565 565
 			}
566 566
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 					$options['datas'] = '';
577 577
 				}
578 578
 			}
579
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
579
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
580 580
 
581 581
 			return recuperer_url($url, $options);
582 582
 		} elseif ($res['status'] !== 200) {
583
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
583
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
584 584
 		}
585 585
 		$result['status'] = $res['status'];
586 586
 		if (isset($res['headers'])) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 	// on ne veut que les entetes
598 598
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
599
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
600 600
 		return $result;
601 601
 	}
602 602
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 	$gz = false;
608 608
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
609
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
610 610
 	}
611 611
 
612 612
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 
643 643
 	$trace = json_decode(json_encode($result), true);
644 644
 	$trace['page'] = '...';
645
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
645
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
646 646
 
647 647
 	return $result;
648 648
 }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	$sig['url'] = $url;
697 697
 
698 698
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
699
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
699
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
700 700
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
701 701
 	$cache = "$sub$cache";
702 702
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	$fp = false;
751 751
 	if ($fichier) {
752 752
 		include_spip('inc/acces');
753
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
753
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
754 754
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755 755
 		if (!$fp and file_exists($fichier)) {
756 756
 			return filesize($fichier);
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	}
810 810
 	$result['status'] = intval($r[1]);
811 811
 	while ($s = trim(fgets($handle, 16384))) {
812
-		$result['headers'][] = $s . "\n";
812
+		$result['headers'][] = $s."\n";
813 813
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814 814
 		[, $d, $v] = $r;
815 815
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -858,13 +858,13 @@  discard block
 block discarded – undo
858 858
 
859 859
 	// on se place tout le temps comme si on etait a la racine
860 860
 	if (_DIR_RACINE) {
861
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
861
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
862 862
 	}
863 863
 
864 864
 	$m = md5($source);
865 865
 
866 866
 	return $d
867
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
867
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
868 868
 	. substr($m, 0, 4)
869 869
 	. ".$extension";
870 870
 }
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 	// Si c'est deja local pas de souci
888 888
 	if (!tester_url_absolue($source)) {
889 889
 		if (_DIR_RACINE) {
890
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
890
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
891 891
 		}
892 892
 
893 893
 		return $source;
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		$ext
906 906
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
907 907
 		and $f = nom_fichier_copie_locale($source, $ext)
908
-		and file_exists(_DIR_RACINE . $f)
908
+		and file_exists(_DIR_RACINE.$f)
909 909
 	) {
910 910
 		return $f;
911 911
 	}
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 
914 914
 	// Si c'est deja dans la table des documents,
915 915
 	// ramener le nom de sa copie potentielle
916
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
916
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
917 917
 
918 918
 	if ($ext) {
919 919
 		return nom_fichier_copie_locale($source, $ext);
@@ -924,9 +924,9 @@  discard block
 block discarded – undo
924 924
 
925 925
 	$ext = $path_parts ? $path_parts['extension'] : '';
926 926
 
927
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
927
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
928 928
 		$f = nom_fichier_copie_locale($source, $ext);
929
-		if (file_exists(_DIR_RACINE . $f)) {
929
+		if (file_exists(_DIR_RACINE.$f)) {
930 930
 			return $f;
931 931
 		}
932 932
 	}
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 	// Ping  pour voir si son extension est connue et autorisee
935 935
 	// avec mise en cache du resultat du ping
936 936
 
937
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
937
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
938 938
 	if (
939 939
 		!@file_exists($cache)
940 940
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -944,10 +944,10 @@  discard block
 block discarded – undo
944 944
 		ecrire_fichier($cache, serialize($path_parts));
945 945
 	}
946 946
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
947
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
947
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
948 948
 		return nom_fichier_copie_locale($source, $ext);
949 949
 	}
950
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
950
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
951 951
 }
952 952
 
953 953
 
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		} else {
1044 1044
 			if ($a['body']) {
1045 1045
 				$a['extension'] = $extension;
1046
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1046
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1047 1047
 				ecrire_fichier($a['fichier'], $a['body']);
1048 1048
 				$size_image = @spip_getimagesize($a['fichier']);
1049 1049
 				$a['largeur'] = intval($size_image[0]);
@@ -1111,20 +1111,20 @@  discard block
 block discarded – undo
1111 1111
 			!$t
1112 1112
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1113 1113
 		) {
1114
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1114
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1115 1115
 		}
1116 1116
 		if (
1117 1117
 			!$t
1118 1118
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1119 1119
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1120 1120
 		) {
1121
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1121
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1122 1122
 		}
1123 1123
 	}
1124 1124
 
1125 1125
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1126 1126
 	if (!$t) {
1127
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1127
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1128 1128
 	}
1129 1129
 
1130 1130
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1135,11 +1135,11 @@  discard block
 block discarded – undo
1135 1135
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1136 1136
 	) {
1137 1137
 		# eviter xxx.3 => 3gp (> SPIP 3)
1138
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1138
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1139 1139
 	}
1140 1140
 
1141 1141
 	if ($t) {
1142
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1142
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1143 1143
 		return $t['extension'];
1144 1144
 	} else {
1145 1145
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 		}
1243 1243
 	} else {
1244 1244
 		$scheme = $t['scheme'];
1245
-		$noproxy = $scheme . '://';
1245
+		$noproxy = $scheme.'://';
1246 1246
 	}
1247 1247
 	if (isset($t['user'])) {
1248 1248
 		$user = [$t['user'], $t['pass']];
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 	}
1257 1257
 
1258 1258
 	if (!empty($t['query'])) {
1259
-		$path .= '?' . $t['query'];
1259
+		$path .= '?'.$t['query'];
1260 1260
 	}
1261 1261
 
1262 1262
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1330,29 +1330,29 @@  discard block
 block discarded – undo
1330 1330
 	$proxy_user = '';
1331 1331
 	$http_proxy = need_proxy($host);
1332 1332
 	if ($user) {
1333
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1333
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1334 1334
 	}
1335 1335
 
1336 1336
 	$connect = '';
1337 1337
 	if ($http_proxy) {
1338
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1339
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1340
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1338
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1339
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1340
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1341 1341
 				. "Host: $path_host\r\n"
1342 1342
 				. "Proxy-Connection: Keep-Alive\r\n";
1343 1343
 		} else {
1344
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1344
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1345 1345
 				. (!$user ? '' : "$user@")
1346
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1346
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1347 1347
 		}
1348 1348
 		$t2 = @parse_url($http_proxy);
1349 1349
 		$first_host = $t2['host'];
1350 1350
 		$port = ($t2['port'] ?? null) ?: 80;
1351 1351
 		if ($t2['user'] ?? null) {
1352
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1352
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1353 1353
 		}
1354 1354
 	} else {
1355
-		$first_host = $noproxy . $host;
1355
+		$first_host = $noproxy.$host;
1356 1356
 	}
1357 1357
 
1358 1358
 	if ($connect) {
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 		);
1375 1375
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1376 1376
 		if (!$f) {
1377
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1377
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1378 1378
 			return $errno;
1379 1379
 		}
1380 1380
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 			or !count($res = explode(' ', $res))
1388 1388
 			or $res[1] !== '200'
1389 1389
 		) {
1390
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1390
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1391 1391
 			fclose($f);
1392 1392
 
1393 1393
 			return false;
@@ -1404,7 +1404,7 @@  discard block
 block discarded – undo
1404 1404
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1405 1405
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1406 1406
 		if (!$f) {
1407
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1407
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1408 1408
 
1409 1409
 			return $errno;
1410 1410
 		}
@@ -1414,16 +1414,16 @@  discard block
 block discarded – undo
1414 1414
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1415 1415
 
1416 1416
 	$host_port = $host;
1417
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1417
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1418 1418
 		$host_port .= ":$port";
1419 1419
 	}
1420 1420
 	$req = "$method $path $vers\r\n"
1421 1421
 		. "Host: $host_port\r\n"
1422
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1423
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1422
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1423
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1424 1424
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1425
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1426
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1425
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1426
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1427 1427
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1428 1428
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1429 1429
 
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 // mais apres la fonction autoriser()
121 121
 if ($f = find_in_path('mes_fonctions.php')) {
122 122
 	global $dossier_squelettes;
123
-	include_once(_ROOT_CWD . $f);
123
+	include_once(_ROOT_CWD.$f);
124 124
 }
125 125
 
126 126
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$qui = $GLOBALS['visiteur_session'] ?: [];
163 163
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
164 164
 	} elseif (is_numeric($qui)) {
165
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
165
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
166 166
 	}
167 167
 
168 168
 	// Admins restreints, on construit ici (pas generique mais...)
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	}
173 173
 
174 174
 	spip_log(
175
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
176
-		'autoriser' . _LOG_DEBUG
175
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
176
+		'autoriser'._LOG_DEBUG
177 177
 	);
178 178
 
179 179
 	// passer par objet_type pour avoir les alias
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
190 190
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
191 191
 	) {
192
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
192
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
193 193
 		return true;
194 194
 	}
195 195
 
@@ -198,18 +198,18 @@  discard block
 block discarded – undo
198 198
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
199 199
 	$fonctions = $type
200 200
 		? [
201
-			'autoriser_' . $type . '_' . $faire,
202
-			'autoriser_' . $type . '_' . $faire . '_dist',
203
-			'autoriser_' . $type,
204
-			'autoriser_' . $type . '_dist',
205
-			'autoriser_' . $faire,
206
-			'autoriser_' . $faire . '_dist',
201
+			'autoriser_'.$type.'_'.$faire,
202
+			'autoriser_'.$type.'_'.$faire.'_dist',
203
+			'autoriser_'.$type,
204
+			'autoriser_'.$type.'_dist',
205
+			'autoriser_'.$faire,
206
+			'autoriser_'.$faire.'_dist',
207 207
 			'autoriser_defaut',
208 208
 			'autoriser_defaut_dist'
209 209
 		]
210 210
 		: [
211
-			'autoriser_' . $faire,
212
-			'autoriser_' . $faire . '_dist',
211
+			'autoriser_'.$faire,
212
+			'autoriser_'.$faire.'_dist',
213 213
 			'autoriser_defaut',
214 214
 			'autoriser_defaut_dist'
215 215
 		];
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	}
223 223
 
224 224
 	spip_log(
225
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
226
-		'autoriser' . _LOG_DEBUG
225
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
226
+		'autoriser'._LOG_DEBUG
227 227
 	);
228 228
 
229 229
 	return $a;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
373 373
 
374 374
 	// Le visiteur a-t-il un statut prevu par la config ?
375
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
375
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
376 376
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
377 377
 	}
378 378
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 				} // pas de champ passe a la demande => NIET
431 431
 				$previsu = explode(',', $c['previsu']);
432 432
 				// regarder si ce statut est autorise pour l'auteur
433
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
433
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
434 434
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
435 435
 					// sinon l’auteur en session
436 436
 					include_spip('inc/securiser_action');
@@ -444,12 +444,12 @@  discard block
 block discarded – undo
444 444
 
445 445
 					if (!$id_auteur) {
446 446
 						return false;
447
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
447
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
448 448
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
449 449
 					} elseif (
450 450
 						!sql_countsel(
451 451
 							'spip_auteurs_liens',
452
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
452
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
453 453
 						)
454 454
 					) {
455 455
 						return false;
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 			// multilinguisme par secteur et objet rattaché à une rubrique
495 495
 			$primary = id_table_objet($type);
496 496
 			if ($table != 'spip_rubriques') {
497
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
497
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
498 498
 			} else {
499 499
 				$id_rubrique = $id;
500 500
 			}
501
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
501
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
502 502
 			if (!$id_secteur > 0) {
503 503
 				$id_secteur = $id_rubrique;
504 504
 			}
505
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
506
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
505
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
506
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
507 507
 			if ($langue_secteur != $langue_objet) {
508 508
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
509 509
 				return true;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
512 512
 				return false;
513 513
 			} else {
514
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
514
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
515 515
 				if ($id_parent != 0) {
516 516
 					// sous-rubriques : pas de choix de langue
517 517
 					return false;
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 
564 564
 	if (!isset($opt['statut'])) {
565 565
 		if (isset($desc['field']['statut'])) {
566
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
566
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
567 567
 		} else {
568 568
 			$statut = 'publie';
569 569
 		} // pas de statut => publie
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
 		return false;
738 738
 	}
739 739
 
740
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
740
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
741 741
 		return false;
742 742
 	}
743 743
 
744
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
744
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
745 745
 		return false;
746 746
 	}
747 747
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	if (!$id) {
779 779
 		return false;
780 780
 	}
781
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
781
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
782 782
 
783 783
 	return
784 784
 		$r
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 				(!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true))
790 790
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
791 791
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
792
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
792
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
793 793
 			)
794 794
 		);
795 795
 }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 		if (!$id) {
848 848
 			return false;
849 849
 		}
850
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
850
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
851 851
 	}
852 852
 
853 853
 	return
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 		or
859 859
 		($id
860 860
 			and $qui['id_auteur']
861
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
861
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
862 862
 }
863 863
 
864 864
 
@@ -879,8 +879,8 @@  discard block
 block discarded – undo
879 879
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
880 880
 	# securite, mais on aurait pas du arriver ici !
881 881
 	if (
882
-		function_exists($f = 'autoriser_' . $type . '_voir')
883
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
882
+		function_exists($f = 'autoriser_'.$type.'_voir')
883
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
884 884
 	) {
885 885
 		return $f($faire, $type, $id, $qui, $opt);
886 886
 	}
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 	$n = sql_fetsel(
1012 1012
 		'A.id_article',
1013 1013
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1014
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1014
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1015 1015
 	);
1016 1016
 
1017 1017
 	return $n ? true : false;
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 		and $r = sql_allfetsel(
1224 1224
 			'id_objet',
1225 1225
 			'spip_auteurs_liens',
1226
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1226
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1227 1227
 		)
1228 1228
 		and is_countable($r) ? count($r) : 0
1229 1229
 	) {
@@ -1908,8 +1908,8 @@  discard block
 block discarded – undo
1908 1908
 function auteurs_objet($objet, $id_objet, $cond = '') {
1909 1909
 	$objet = objet_type($objet);
1910 1910
 	$where = [
1911
-		'objet=' . sql_quote($objet),
1912
-		'id_objet=' . intval($id_objet)
1911
+		'objet='.sql_quote($objet),
1912
+		'id_objet='.intval($id_objet)
1913 1913
 	];
1914 1914
 	if (!empty($cond)) {
1915 1915
 		if (is_array($cond)) {
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 	return sql_allfetsel(
1945 1945
 		'id_auteur',
1946 1946
 		'spip_auteurs_liens',
1947
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1947
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1948 1948
 	);
1949 1949
 }
1950 1950
 
Please login to merge, or discard this patch.
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	];
44 44
 	$options = array_merge($defaut, $options);
45 45
 	if (is_numeric($options['expires']) and $options['expires'] > 0) {
46
-		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT';
46
+		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT';
47 47
 	}
48 48
 
49 49
 	if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) {
73 73
 	// toujours envoyer un content type, meme vide !
74 74
 	header('Accept-Ranges: bytes');
75
-	header('Content-Type: ' . $content_type);
75
+	header('Content-Type: '.$content_type);
76 76
 
77 77
 	if ($attachment) {
78 78
 		$f = basename($fichier);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	else {
91 91
 		$f = basename($fichier);
92 92
 		header("Content-Disposition: inline; filename=\"$f\";");
93
-		header('Expires: ' . $expires); // set expiration time
93
+		header('Expires: '.$expires); // set expiration time
94 94
 	}
95 95
 }
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
143 143
 	if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
144 144
 		### Offset signifies where we should begin to read the file
145
-		$byteOffset = (int)$match[1];
145
+		$byteOffset = (int) $match[1];
146 146
 
147 147
 
148 148
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
149 149
 		if (isset($match[2])) {
150
-			$finishBytes = (int)$match[2];
150
+			$finishBytes = (int) $match[2];
151 151
 			$byteLength = $finishBytes + 1;
152 152
 		} else {
153 153
 			$finishBytes = $fileSize - 1;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 	// partial content
170 170
 	header('HTTP/1.1 206 Partial content');
171
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
171
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
172 172
 
173 173
 
174 174
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.
prive/objets/liste/auteurs_fonctions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 				and (
104 104
 					$newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur'])
105 105
 				));
106
-			$res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . "</li>";
106
+			$res[] = "<li class='pagination-item'>".lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination')."</li>";
107 107
 		}
108 108
 		if ($initiale) {
109 109
 			$memo = [
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 	if (!$initiale and !$url) {
118 118
 		if ((is_countable($res) ? count($res) : 0) > 1) {
119
-			$out = "<ul class='pagination-items'>" . implode(' ', $res) . "</ul>";
119
+			$out = "<ul class='pagination-items'>".implode(' ', $res)."</ul>";
120 120
 		}
121 121
 		$memo = null;
122 122
 		$res = [];
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	) {
158 158
 		return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self());
159 159
 	} elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) {
160
-		return 'mailto:' . $email;
160
+		return 'mailto:'.$email;
161 161
 	} else {
162 162
 		return '';
163 163
 	}
Please login to merge, or discard this patch.
ecrire/action/editer_logo.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	if ($logo) {
41 41
 		# TODO : deprecated, a supprimer -> anciens logos IMG/artonxx.png pas en base
42 42
 		if ((is_countable($logo) ? count($logo) : 0) < 6) {
43
-			spip_log("Supprimer ancien logo " . json_encode($logo, JSON_THROW_ON_ERROR), 'logo');
43
+			spip_log("Supprimer ancien logo ".json_encode($logo, JSON_THROW_ON_ERROR), 'logo');
44 44
 			spip_unlink($logo[0]);
45 45
 		}
46 46
 		elseif (
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		return $erreur;
90 90
 	}
91 91
 	// chercher dans la base
92
-	$mode_document = 'logo' . $mode;
92
+	$mode_document = 'logo'.$mode;
93 93
 
94 94
 	include_spip('inc/documents');
95 95
 	$erreur = '';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$tmp_name = false;
107 107
 		if (file_exists($source)) {
108 108
 			$tmp_name = $source;
109
-		} elseif (file_exists($f = determine_upload() . $source)) {
109
+		} elseif (file_exists($f = determine_upload().$source)) {
110 110
 			$tmp_name = $f;
111 111
 		}
112 112
 		if (!$tmp_name) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 	if (!is_numeric($id_document)) {
144 144
 		$erreur = ($id_document ?: 'Erreur inconnue');
145
-		spip_log("Erreur ajout logo : $erreur pour source=" . json_encode($source, JSON_THROW_ON_ERROR), 'logo');
145
+		spip_log("Erreur ajout logo : $erreur pour source=".json_encode($source, JSON_THROW_ON_ERROR), 'logo');
146 146
 		return $erreur;
147 147
 	}
148 148
 
@@ -175,23 +175,23 @@  discard block
 block discarded – undo
175 175
 	$GLOBALS['meta']['articles_modif'] = 'non';
176 176
 
177 177
 	foreach (['on', 'off'] as $mode) {
178
-		$nom_base = $type . $mode;
178
+		$nom_base = $type.$mode;
179 179
 		$dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG);
180 180
 
181
-		$files = glob($dir . $nom_base . '*');
181
+		$files = glob($dir.$nom_base.'*');
182 182
 		// est-ce que c'est une nouvelle tentative de migration ?
183 183
 		// dans ce cas les logos sont deja dans IMG/logo/
184 184
 		if (!(is_countable($files) ? count($files) : 0)) {
185
-			$files = glob($dir_logos . $nom_base . '*');
185
+			$files = glob($dir_logos.$nom_base.'*');
186 186
 			if (is_countable($files) ? count($files) : 0) {
187 187
 				// mais il faut verifier si ils ont pas deja ete migres pour tout ou partie
188 188
 				$filescheck = [];
189 189
 				foreach ($files as $file) {
190
-					$short = basename(dirname($file)) . DIRECTORY_SEPARATOR . basename($file);
190
+					$short = basename(dirname($file)).DIRECTORY_SEPARATOR.basename($file);
191 191
 					$filescheck[$short] = $file;
192 192
 				}
193 193
 				// trouver ceux deja migres
194
-				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck)) . " AND mode LIKE 'logo%'");
194
+				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck))." AND mode LIKE 'logo%'");
195 195
 				if (is_countable($deja) ? count($deja) : 0) {
196 196
 					$deja = array_column($deja, 'fichier');
197 197
 					$restant = array_diff(array_keys($filescheck), $deja);
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
 		}
212 212
 
213 213
 		$count = (is_countable($files) ? count($files) : 0);
214
-		spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE);
214
+		spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE);
215 215
 
216 216
 		$deja = [];
217 217
 		foreach ($files as $file) {
218
-			$logo = substr($file, strlen($dir . $nom_base));
218
+			$logo = substr($file, strlen($dir.$nom_base));
219 219
 			$logo = explode('.', $logo);
220 220
 			if (
221 221
 				is_numeric($logo[0])
@@ -226,16 +226,16 @@  discard block
 block discarded – undo
226 226
 					// if no logo in base
227 227
 					if (!$logo or (is_countable($logo) ? count($logo) : 0) < 6) {
228 228
 						foreach ($formats_logos as $format) {
229
-							if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) {
229
+							if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) {
230 230
 								if (isset($desc['field']['date_modif'])) {
231 231
 									$date_modif = sql_getfetsel('date_modif', $table, "$_id_objet=$id_objet");
232 232
 								} else {
233 233
 									$date_modif = null;
234 234
 								}
235 235
 								// logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre
236
-								@rename($d, $dir_logos . $nom);
236
+								@rename($d, $dir_logos.$nom);
237 237
 								// et on le declare comme nouveau logo
238
-								logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom);
238
+								logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom);
239 239
 								if ($date_modif) {
240 240
 									sql_updateq($table, ['date_modif' => $date_modif], "$_id_objet=$id_objet");
241 241
 								}
@@ -249,12 +249,12 @@  discard block
 block discarded – undo
249 249
 			// si le fichier est encore la on le move : rien a faire ici
250 250
 			// (sauf si c'est une re-migration : il est deja dans logo/ donc il bouge pas)
251 251
 			if ($dir !== $dir_logos and file_exists($file)) {
252
-				@rename($file, $dir_logos_erreurs . basename($file));
252
+				@rename($file, $dir_logos_erreurs.basename($file));
253 253
 			}
254 254
 
255 255
 			$count--;
256 256
 			if ($count % 250 === 0) {
257
-				spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE);
257
+				spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE);
258 258
 			}
259 259
 
260 260
 			if ($time_limit and time() > $time_limit) {
Please login to merge, or discard this patch.
ecrire/inc/install.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  **/
45 45
 function install_fichier_connexion($nom, $texte) {
46
-	$texte = '<' . "?php\n"
46
+	$texte = '<'."?php\n"
47 47
 		. "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n"
48 48
 		. $texte;
49 49
 
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 		return $regs;
113 113
 	} else {
114 114
 		$ar = '\s*\'([^\']*)\'';
115
-		$r = '\s*,' . $ar;
115
+		$r = '\s*,'.$ar;
116 116
 		$r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#";
117 117
 		if (preg_match($r, $s, $regs)) {
118
-			$regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';');
118
+			$regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';');
119 119
 			array_shift($regs);
120 120
 			array_shift($regs);
121 121
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	// Si on n'a pas la bonne version de PHP, c'est la fin
181 181
 	if ($err) {
182 182
 		die("<div class='error'>"
183
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"
183
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"
184 184
 			. "<li><strong>{$err[0]}</strong></li>\n</ul></div>");
185 185
 	}
186 186
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 	if ($err) {
203 203
 		echo "<div class='error'>"
204
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>";
204
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>";
205 205
 		foreach ($err as $e) {
206 206
 			echo "<li><strong>$e</strong></li>\n";
207 207
 		}
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
 
236 236
 function info_etape($titre, $complement = '') {
237
-	return '<h2>' . $titre . "</h2>\n" .
238
-	($complement ? '' . $complement . "\n" : '');
237
+	return '<h2>'.$titre."</h2>\n".
238
+	($complement ? ''.$complement."\n" : '');
239 239
 }
240 240
 
241 241
 /**
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
 		$code = _T('bouton_suivant');
250 250
 	}
251 251
 	static $suivant = 0;
252
-	$id = 'suivant' . (($suivant > 0) ? strval($suivant) : '');
252
+	$id = 'suivant'.(($suivant > 0) ? strval($suivant) : '');
253 253
 	$suivant += 1;
254 254
 
255
-	return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" .
256
-	$code .
255
+	return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"".
256
+	$code.
257 257
 	" >>\" /></p>\n";
258 258
 }
259 259
 
260 260
 function info_progression_etape($en_cours, $phase, $dir, $erreur = false) {
261 261
 	$intitule_etat = [];
262 262
 	//$en_cours = _request('etape')?_request('etape'):"";
263
-	$liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$');
263
+	$liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$');
264 264
 	$debut = 1;
265 265
 	$etat = 'ok';
266 266
 	$last = count($liste);
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
 			$aff_etapes .= "<li class='$class'><div class='fond'>";
301 301
 			$aff_etapes .= ($debut == $en_cours) ? '<strong>' : '';
302
-			$aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
302
+			$aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
303 303
 			$aff_etapes .= $intitule_etat["$phase"][$debut];
304 304
 			$aff_etapes .= ($debut == $en_cours) ? '</strong>' : '';
305 305
 			$aff_etapes .= '</div></li>';
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 
315 315
 
316 316
 function fieldset($legend, $champs = [], $apres = '', $avant = '') {
317
-	return "<fieldset>\n" .
318
-	$avant .
319
-	($legend ? '<legend>' . $legend . "</legend>\n" : '') .
320
-	fieldset_champs($champs) .
321
-	$apres .
317
+	return "<fieldset>\n".
318
+	$avant.
319
+	($legend ? '<legend>'.$legend."</legend>\n" : '').
320
+	fieldset_champs($champs).
321
+	$apres.
322 322
 	"</fieldset>\n";
323 323
 }
324 324
 
@@ -328,18 +328,18 @@  discard block
 block discarded – undo
328 328
 		$type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text');
329 329
 		$class = isset($contenu['hidden']) ? '' : "class='formo' size='40' ";
330 330
 		if (isset($contenu['alternatives'])) {
331
-			$fieldset .= $contenu['label'] . "\n";
331
+			$fieldset .= $contenu['label']."\n";
332 332
 			foreach ($contenu['alternatives'] as $valeur => $label) {
333
-				$fieldset .= "<input type='radio' name='" . $nom .
333
+				$fieldset .= "<input type='radio' name='".$nom.
334 334
 					"' id='$nom-$valeur' value='$valeur'"
335 335
 					. (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '')
336 336
 					. "/>\n";
337
-				$fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n";
337
+				$fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n";
338 338
 			}
339 339
 			$fieldset .= "<br />\n";
340 340
 		} else {
341
-			$fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n";
342
-			$fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'"
341
+			$fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n";
342
+			$fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'"
343 343
 				. (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '')
344 344
 				. ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '')
345 345
 				. " />\n";
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
 function install_select_serveur() {
353 353
 	$options = [];
354
-	$dir = _DIR_RESTREINT . 'req/';
354
+	$dir = _DIR_RESTREINT.'req/';
355 355
 	$d = opendir($dir);
356 356
 	if (!$d) {
357 357
 		return [];
@@ -359,17 +359,17 @@  discard block
 block discarded – undo
359 359
 	while (($f = readdir($d)) !== false) {
360 360
 		if (
361 361
 			(preg_match('/^(.*)[.]php$/', $f, $s))
362
-			and is_readable($f = $dir . $f)
362
+			and is_readable($f = $dir.$f)
363 363
 		) {
364 364
 			require_once($f);
365 365
 			$s = $s[1];
366
-			$v = 'spip_versions_' . $s;
366
+			$v = 'spip_versions_'.$s;
367 367
 			if (function_exists($v) and $v()) {
368 368
 				$titre = _T("install_select_type_$s");
369 369
 				// proposer mysql par defaut si dispo
370 370
 				$checked = ($s == 'mysql' ? " checked='checked'" : '');
371 371
 				$options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>"
372
-					. "<label for='$s'>" . ($titre ?: $s) . '</label></li>';
372
+					. "<label for='$s'>".($titre ?: $s).'</label></li>';
373 373
 			} else {
374 374
 				spip_log("$s: portage indisponible");
375 375
 			}
@@ -387,8 +387,8 @@  discard block
 block discarded – undo
387 387
 		"\n<input type='hidden' name='etape' value='$etape' />"
388 388
 		. $hidden
389 389
 		. (_request('echec') ?
390
-			('<p><b>' . _T('avis_connexion_echec_1') .
391
-				'</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>')
390
+			('<p><b>'._T('avis_connexion_echec_1').
391
+				'</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>')
392 392
 			: '')
393 393
 
394 394
 		. ($jquery ? http_script('', 'jquery.js') : '')
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 		});')
427 427
 
428 428
 		. ($server_db
429
-			? '<input type="hidden" name="server_db" value="' . $server_db . '" />'
429
+			? '<input type="hidden" name="server_db" value="'.$server_db.'" />'
430 430
 			. (($predef[0])
431
-				? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>')
431
+				? ('<h3>'._T('install_serveur_hebergeur').'</h3>')
432 432
 				: '')
433 433
 			: ('<fieldset><legend>'
434 434
 				. _T('install_select_type_db')
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
 				. "\n</ul>\n</div></fieldset>")
444 444
 		)
445 445
 		. '<div id="install_adresse_base_hebergeur">'
446
-		. '<p>' . _T('texte_connexion_mysql') . '</p>'
446
+		. '<p>'._T('texte_connexion_mysql').'</p>'
447 447
 		. ($predef[1]
448
-			? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>'
448
+			? '<h3>'._T('install_adresse_base_hebergeur').'</h3>'
449 449
 			: fieldset(
450 450
 				_T('entree_base_donnee_1'),
451 451
 				[
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
 		. '<div id="install_login_base_hebergeur">'
462 462
 		. ($predef[2]
463
-			? '<h3>' . _T('install_login_base_hebergeur') . '</h3>'
463
+			? '<h3>'._T('install_login_base_hebergeur').'</h3>'
464 464
 			: fieldset(
465 465
 				_T('entree_login_connexion_1'),
466 466
 				[
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 
476 476
 		. '<div id="install_pass_base_hebergeur">'
477 477
 		. ($predef[3]
478
-			? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>'
478
+			? '<h3>'._T('install_pass_base_hebergeur').'</h3>'
479 479
 			: fieldset(
480 480
 				_T('entree_mot_passe_1'),
481 481
 				[
@@ -497,20 +497,20 @@  discard block
 block discarded – undo
497 497
 function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) {
498 498
 	return ((defined('_INSTALL_HOST_DB'))
499 499
 		? ''
500
-		: "\n<input type='hidden' name='adresse_db'  value=\"" . spip_htmlspecialchars($adresse_db) . '" />'
500
+		: "\n<input type='hidden' name='adresse_db'  value=\"".spip_htmlspecialchars($adresse_db).'" />'
501 501
 	)
502 502
 	. ((defined('_INSTALL_USER_DB'))
503 503
 		? ''
504
-		: "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />'
504
+		: "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />'
505 505
 	)
506 506
 	. ((defined('_INSTALL_PASS_DB'))
507 507
 		? ''
508
-		: "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />'
508
+		: "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />'
509 509
 	)
510 510
 
511 511
 	. ((defined('_INSTALL_SERVER_DB'))
512 512
 		? ''
513
-		: "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />'
513
+		: "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />'
514 514
 	);
515 515
 }
516 516
 
Please login to merge, or discard this patch.