Completed
Push — master ( 073957...bb1fc1 )
by cam
01:05
created
ecrire/install/etape_ldap2.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		echo info_etape(
78 78
 			_T('titre_connexion_ldap'),
79 79
 			info_progression_etape(2, 'etape_ldap', 'install/')
80
-		),  _T('info_connexion_ldap_ok');
80
+		), _T('info_connexion_ldap_ok');
81 81
 		echo generer_form_ecrire('install', (
82 82
 			"\n<input type='hidden' name='etape' value='ldap3' />"
83 83
 			. "\n<input type='hidden' name='adresse_ldap' value=\"".spip_htmlspecialchars($adresse_ldap)."\" />"
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 			. bouton_suivant()));
90 90
 	} else {
91 91
 		echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true),
92
-			"<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>',
93
-			'<p>' . _T('avis_connexion_ldap_echec_2') .
94
-			"<br />\n" . _T('avis_connexion_ldap_echec_3') .
95
-			'<br /><br />' . $erreur . '<b> ?</b></p></div>';
92
+			"<div class='error'><p>"._T('avis_connexion_ldap_echec_1').'</p>',
93
+			'<p>'._T('avis_connexion_ldap_echec_2').
94
+			"<br />\n"._T('avis_connexion_ldap_echec_3').
95
+			'<br /><br />'.$erreur.'<b> ?</b></p></div>';
96 96
 	}
97 97
 
98 98
 	echo install_fin_html();
Please login to merge, or discard this patch.
ecrire/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.