Completed
Push — master ( 81a660...8ce9c8 )
by cam
01:32
created
ecrire/public/parametrer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	} else {
79 79
 		// Preparer l'appel de la fonction principale du squelette
80 80
 
81
-		spip_timer($a = 'calcul page ' . random_int(0, 1000));
81
+		spip_timer($a = 'calcul page '.random_int(0, 1000));
82 82
 
83 83
 		// On cree un marqueur de notes unique lie a cette composition
84 84
 		// et on enregistre l'etat courant des globales de notes...
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 		try {
111 111
 			$page = $fonc(['cache' => $cache], [$contexte]);
112 112
 		} catch (Throwable $e) {
113
-			$msg = _T('zbug_erreur_execution_page') . " $sourcefile";
114
-			$full_msg = $msg . ' | File ' . $e->getFile() . ' Line ' . $e->getLine() . ' : ' . $e->getMessage();
113
+			$msg = _T('zbug_erreur_execution_page')." $sourcefile";
114
+			$full_msg = $msg.' | File '.$e->getFile().' Line '.$e->getLine().' : '.$e->getMessage();
115 115
 			$full_msg = str_replace(_ROOT_RACINE, '[…]/', $full_msg);
116 116
 			$corps = "<pre>$msg</pre>";
117 117
 			$page = analyse_resultat_skel($fond, ['cache' => $cache], $corps, $sourcefile);
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
 
143 143
 		$profile = spip_timer($a);
144 144
 		spip_log("calcul ($profile) [$skel] $infos"
145
-			. ' (' . strlen($page['texte']) . ' octets)');
145
+			. ' ('.strlen($page['texte']).' octets)');
146 146
 
147 147
 		if (defined('_CALCUL_PROFILER') && (int) $profile > _CALCUL_PROFILER) {
148 148
 			spip_log("calcul ($profile) [$skel] $infos"
149
-				. ' (' . strlen($page['texte']) . ' octets) | ' . $_SERVER['REQUEST_URI'], 'profiler' . _LOG_AVERTISSEMENT);
149
+				. ' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], 'profiler'._LOG_AVERTISSEMENT);
150 150
 		}
151 151
 
152 152
 		if ($debug) {
153 153
 			// si c'est ce que demande le debusqueur, lui passer la main
154 154
 			$t = strlen($page['texte']) ? $page['texte'] : ' ';
155
-			$GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t;
155
+			$GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t;
156 156
 			$GLOBALS['debug_objets']['courant'] = $courant;
157 157
 			$GLOBALS['debug_objets']['profile'][$sourcefile] = $profile;
158 158
 			if (
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		if (defined('_VAR_INCLURE') && _VAR_INCLURE) {
184 184
 			$page['sourcefile'] = $sourcefile;
185 185
 			$page['texte'] =
186
-				"<div class='inclure_blocs'><h6>" . $page['sourcefile'] . '</h6>' . $page['texte'] . '</div>'
186
+				"<div class='inclure_blocs'><h6>".$page['sourcefile'].'</h6>'.$page['texte'].'</div>'
187 187
 				. ($js_inclus ? '' : "<script type='text/javascript'>jQuery(function(){jQuery('.inclure_blocs > h6:first-child').hover(function(){jQuery(this).parent().addClass('hover')},function(){jQuery(this).parent().removeClass('hover')})});</script>");
188 188
 			$js_inclus = true;
189 189
 		}
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
 			$val = '';
221 221
 		} elseif (is_array($val)) {
222 222
 			if ($profondeur_max > 0) {
223
-				$val = 'array:' . count($val) . '(' . presenter_contexte($val, $profondeur_max - 1, 3) . ')';
223
+				$val = 'array:'.count($val).'('.presenter_contexte($val, $profondeur_max - 1, 3).')';
224 224
 			} else {
225
-				$val = 'array:' . count($val);
225
+				$val = 'array:'.count($val);
226 226
 			}
227 227
 		} elseif (is_object($val)) {
228 228
 			$val = $val::class;
229 229
 		} elseif (strlen("$val") > 30) {
230
-			$val = substr("$val", 0, 29) . '…';
230
+			$val = substr("$val", 0, 29).'…';
231 231
 			if (strstr($val, ' ')) {
232 232
 				$val = "'$val'";
233 233
 			}
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		} elseif (!strlen($val)) {
237 237
 			$val = "''";
238 238
 		}
239
-		$infos[] = $var . '=' . $val;
239
+		$infos[] = $var.'='.$val;
240 240
 	}
241 241
 	return implode(', ', $infos);
242 242
 }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 						. "?php include_spip('inc/headers');redirige_par_entete('"
305 305
 						. texte_script($url)
306 306
 						. "','',$status);"
307
-						. '?' . '>',
307
+						. '?'.'>',
308 308
 					'process_ins' => 'php',
309 309
 					'status' => $status
310 310
 				];
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Spacing   +87 added lines, -89 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		if (!$fonc) {
147 147
 			$fonc = $GLOBALS['debug_objets']['principal'];
148 148
 		}
149
-		$titre = $mode ? $mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc);
149
+		$titre = $mode ? $mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc);
150 150
 	}
151 151
 	if ($message === false) {
152 152
 		lang_select();
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	$fond = $GLOBALS['fond'] ?? '';
170 170
 	// une erreur critique sort $message en array
171 171
 	$debug = is_array($msg) ? $msg[1] : $msg;
172
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
172
+	spip_log('Debug: '.$debug.' ('.$fond.')');
173 173
 
174 174
 	return $msg;
175 175
 }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 function debusquer_bandeau($erreurs) {
178 178
 
179 179
 	if (!empty($erreurs)) {
180
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
180
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
181 181
 
182 182
 		return debusquer_navigation($erreurs, $n);
183 183
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -210,25 +210,25 @@  discard block
 block discarded – undo
210 210
 			$valeur_simple = [];
211 211
 			foreach ($valeur as $v) {
212 212
 				if (is_array($v)) {
213
-					$valeur_simple[] = 'array:' . count($v);
213
+					$valeur_simple[] = 'array:'.count($v);
214 214
 				} elseif (is_object($v)) {
215 215
 					$valeur_simple[] = $v::class;
216 216
 				} elseif (is_string($v)) {
217
-					$valeur_simple[] = "'" . $v . "'";
217
+					$valeur_simple[] = "'".$v."'";
218 218
 				} else {
219 219
 					$valeur_simple[] = $v;
220 220
 				}
221 221
 			}
222 222
 			$n = count($valeur);
223
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
224
-			$valeur .= '[' . implode(', ', $valeur_simple) . ']';
223
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
224
+			$valeur .= '['.implode(', ', $valeur_simple).']';
225 225
 		} elseif (is_object($valeur)) {
226 226
 			$valeur = $valeur::class;
227 227
 		} elseif (is_string($valeur)) {
228
-			$valeur = "'" . $valeur . "'";
228
+			$valeur = "'".$valeur."'";
229 229
 		}
230
-		$res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom))
231
-			. '</strong></td><td>:&nbsp;' . nl2br((string) entites_html($valeur))
230
+		$res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom))
231
+			. '</strong></td><td>:&nbsp;'.nl2br((string) entites_html($valeur))
232 232
 			. "</td></tr>\n";
233 233
 	}
234 234
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	if ($ligne) {
254 254
 		$msg .= " L$ligne";
255 255
 	}
256
-	spip_log($msg, 'debusquer' . _LOG_ERREUR);
256
+	spip_log($msg, 'debusquer'._LOG_ERREUR);
257 257
 }
258 258
 
259 259
 
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 				$nom_code = $lieu->descr['nom'];
279 279
 				$skel = $lieu->descr['sourcefile'];
280 280
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
281
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
281
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
282 282
 				$skel = "<a href='$h3'><b>$skel</b></a>";
283 283
 				if ($boucle) {
284
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
284
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
285 285
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
286 286
 				}
287 287
 			}
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 	}
371 371
 
372 372
 	// Requete erronee
373
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
373
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
374 374
 		. spip_htmlspecialchars($msg)
375 375
 		. "\n<br /><span style='color: red'><b>"
376 376
 		. spip_htmlspecialchars($query)
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
386 386
 
387
-	$id = $nom . $boucle;
387
+	$id = $nom.$boucle;
388 388
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
389 389
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
390 390
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	) {
433 433
 		$reg[1] = 'inconnu';
434 434
 	}
435
-	$incl = ',' . $reg[1] . '[.]\w$,';
435
+	$incl = ','.$reg[1].'[.]\w$,';
436 436
 
437 437
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
438 438
 		if (preg_match($incl, $v)) {
@@ -448,16 +448,14 @@  discard block
 block discarded – undo
448 448
 
449 449
 	if (!$boucle) {
450 450
 		return $ligne
451
-			? ' (' .
452
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
453
-					_T('squelette_ligne')) .
451
+			? ' ('.
452
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
454 453
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"
455 454
 			: '';
456 455
 	} else {
457 456
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
458 457
 
459
-		return $ligne ? " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" :
460
-			" (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)";
458
+		return $ligne ? " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" : " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)";
461 459
 	}
462 460
 }
463 461
 
@@ -479,14 +477,14 @@  discard block
 block discarded – undo
479 477
 
480 478
 	$s = preg_replace(
481 479
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
482
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
480
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
483 481
 		$s
484 482
 	);
485 483
 
486 484
 
487 485
 	$tableau = explode('<br />', $s);
488 486
 
489
-	$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" . (string) @strlen(count($tableau)) . "d</a></span> %s<br />\n";
487
+	$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".(string) @strlen(count($tableau))."d</a></span> %s<br />\n";
490 488
 
491 489
 	$format10 = str_replace('white', 'lightgrey', $format);
492 490
 	$formaterr = 'color: red;';
@@ -530,7 +528,7 @@  discard block
 block discarded – undo
530 528
 	. '" style="cursor: pointer;">'
531 529
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
532 530
 	. '</div>
533
-	' . $res . "</div>\n";
531
+	' . $res."</div>\n";
534 532
 }
535 533
 
536 534
 // l'environnement graphique du debuggueur
@@ -552,14 +550,14 @@  discard block
 block discarded – undo
552 550
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
553 551
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
554 552
 				$texte .= $res2;
555
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
556
-				$legend = _T('zbug_' . $mode);
557
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
553
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
554
+				$legend = _T('zbug_'.$mode);
555
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
558 556
 				$texte = ancre_texte($texte, ['', '']);
559 557
 			}
560 558
 		} else {
561 559
 			if (strlen(trim($res))) {
562
-				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>";
560
+				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>";
563 561
 			} else {
564 562
 				// cas de l'appel sur erreur: montre la page
565 563
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -567,7 +565,7 @@  discard block
 block discarded – undo
567 565
 		}
568 566
 	} else {
569 567
 		$valider = charger_fonction('valider', 'xml');
570
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
568
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
571 569
 		// Si erreur, signaler leur nombre dans le formulaire admin
572 570
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
573 571
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -578,14 +576,14 @@  discard block
 block discarded – undo
578 576
 		} else {
579 577
 			$err = ": $err";
580 578
 		}
581
-		$legend = _T('validation') . ' ' . $err;
579
+		$legend = _T('validation').' '.$err;
582 580
 		$res = $id = '';
583 581
 	}
584 582
 
585 583
 	return trim($texte)
586
-		? "<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"
584
+		? "<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"
587 585
 			. "<div id='debug_boucle'><fieldset$id><legend>"
588
-			. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
586
+			. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
589 587
 			. ($legend ?: $mode)
590 588
 			. '</a></legend>'
591 589
 			. $texte
@@ -597,7 +595,7 @@  discard block
 block discarded – undo
597 595
 
598 596
 function emboite_texte($res, $fonc = '', $self = '') {
599 597
 	$errs = $res->err;
600
-	$texte = $res->entete . ($errs ? '' : $res->page);
598
+	$texte = $res->entete.($errs ? '' : $res->page);
601 599
 
602 600
 	if (!$texte && !$errs) {
603 601
 		return [ancre_texte('', ['', '']), false];
@@ -653,7 +651,7 @@  discard block
 block discarded – undo
653 651
 		$err = "<h2 style='text-align: center'>"
654 652
 			. $i
655 653
 			. "<a href='#fin_err'>"
656
-			. ' ' . _T('erreur_texte')
654
+			. ' '._T('erreur_texte')
657 655
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
658 656
 			. $err
659 657
 			. " </table><a id='fin_err'></a>";
@@ -663,9 +661,9 @@  discard block
 block discarded – undo
663 661
 		[$msg, $fermant, $ouvrant] = $errs[0];
664 662
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
665 663
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
666
-		$err = $msg .
667
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
668
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
664
+		$err = $msg.
665
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
666
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
669 667
 
670 668
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
671 669
 	}
@@ -698,7 +696,7 @@  discard block
 block discarded – undo
698 696
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
699 697
 		) : '';
700 698
 
701
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
699
+		$res .= "<fieldset id='f_".$nom."'><legend>"
702 700
 			. $t_skel
703 701
 			. ' '
704 702
 			. $sourcefile
@@ -713,7 +711,7 @@  discard block
 block discarded – undo
713 711
 			. "'>"
714 712
 			. _T('zbug_calcul')
715 713
 			. '</a></legend>'
716
-			. ($temps ? "\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />" : (''))
714
+			. ($temps ? "\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />" : (''))
717 715
 			. debusquer_contexte($contexte[$sourcefile])
718 716
 		. ($nav ? "<table width='100%'>\n$nav</table>\n" : (''))
719 717
 		. "</fieldset>\n";
@@ -734,33 +732,33 @@  discard block
 block discarded – undo
734 732
 			$nom = $boucle->id_boucle;
735 733
 			$req = $boucle->type_requete;
736 734
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
737
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
738
-
739
-			$res .= "\n<tr style='background-color: " .
740
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
741
-				"'><td  align='right'>$i</td><td>\n" .
742
-				"<a  class='debug_link_boucle' href='" .
743
-				$self2 .
744
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
745
-				_T('zbug_boucle') .
746
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
747
-				$self2 .
748
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
749
-				_T('zbug_resultat') .
750
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
751
-				$self2 .
752
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
753
-				_T('zbug_code') .
754
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
755
-				str_replace('var_mode=', 'var_profile=', $self2) .
756
-				"'>" .
757
-				_T('zbug_calcul') .
758
-				"</a></td><td>\n" .
759
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
760
-				"</td><td>\n" .
761
-				$req .
762
-				"</td><td>\n" .
763
-				spip_htmlspecialchars($crit) .
735
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
736
+
737
+			$res .= "\n<tr style='background-color: ".
738
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
739
+				"'><td  align='right'>$i</td><td>\n".
740
+				"<a  class='debug_link_boucle' href='".
741
+				$self2.
742
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
743
+				_T('zbug_boucle').
744
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
745
+				$self2.
746
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
747
+				_T('zbug_resultat').
748
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
749
+				$self2.
750
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
751
+				_T('zbug_code').
752
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
753
+				str_replace('var_mode=', 'var_profile=', $self2).
754
+				"'>".
755
+				_T('zbug_calcul').
756
+				"</a></td><td>\n".
757
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
758
+				"</td><td>\n".
759
+				$req.
760
+				"</td><td>\n".
761
+				spip_htmlspecialchars($crit).
764 762
 				'</td></tr>';
765 763
 		}
766 764
 	}
@@ -787,7 +785,7 @@  discard block
 block discarded – undo
787 785
 		}
788 786
 		//  permettre le copier/coller facile
789 787
 		// $res = ancre_texte($req, array(), true);
790
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
788
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
791 789
 		//  formatage et affichage des resultats bruts de la requete
792 790
 		$ress_req = spip_query($req);
793 791
 		$brut_sql = '';
@@ -797,10 +795,10 @@  discard block
 block discarded – undo
797 795
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
798 796
 		while ($retours_sql = sql_fetch($ress_req)) {
799 797
 			if ($num <= $max_aff) {
800
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
798
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
801 799
 				$brut_sql .= '<p>';
802 800
 				foreach ($retours_sql as $key => $val) {
803
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
801
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
804 802
 				}
805 803
 				$brut_sql .= '</p>';
806 804
 			}
@@ -811,14 +809,14 @@  discard block
 block discarded – undo
811 809
 			//  ne pas afficher les $contexte_inclus
812 810
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
813 811
 			if ($view) {
814
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
812
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
815 813
 			}
816 814
 		}
817 815
 	} elseif ($affiche == 'code') {
818 816
 		$legend = $nom;
819
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
817
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
820 818
 	} elseif ($affiche == 'boucle') {
821
-		$legend = _T('zbug_boucle') . ' ' . $nom;
819
+		$legend = _T('zbug_boucle').' '.$nom;
822 820
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
823 821
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
824 822
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -836,23 +834,23 @@  discard block
 block discarded – undo
836 834
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
837 835
 	include_spip('inc/texte'); // pour corriger_typo
838 836
 
839
-	return _DOCTYPE_ECRIRE .
840
-	html_lang_attributes() .
841
-	"<head>\n<title>" .
842
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
843
-		_T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' .
844
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
845
-	")</title>\n" .
846
-	"<meta http-equiv='Content-Type' content='text/html" .
847
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
848
-	"' />\n" .
837
+	return _DOCTYPE_ECRIRE.
838
+	html_lang_attributes().
839
+	"<head>\n<title>".
840
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
841
+		_T('admin_debug').' '.spip_htmlspecialchars($titre).' ('.
842
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
843
+	")</title>\n".
844
+	"<meta http-equiv='Content-Type' content='text/html".
845
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
846
+	"' />\n".
849 847
 	http_script('', 'jquery.js')
850
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
851
-	. "' type='text/css' />" .
852
-	"</head>\n" .
853
-	"<body style='margin:0 10px;'>\n" .
854
-	"<div id='spip-debug-header'>" .
855
-	$corps .
856
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
848
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
849
+	. "' type='text/css' />".
850
+	"</head>\n".
851
+	"<body style='margin:0 10px;'>\n".
852
+	"<div id='spip-debug-header'>".
853
+	$corps.
854
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
857 855
 	'</div></body></html>';
858 856
 }
Please login to merge, or discard this patch.
ecrire/action/referencer_traduction.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$id_lier = sql_getfetsel(
56 56
 			'id_trad',
57 57
 			$table_objet_sql,
58
-			"$id_table_objet=" . (int) $id_trad . " AND NOT($id_table_objet=" . (int) $id_objet . ')'
58
+			"$id_table_objet=".(int) $id_trad." AND NOT($id_table_objet=".(int) $id_objet.')'
59 59
 		);
60 60
 		if ($id_lier === null) {
61 61
 			spip_log("echec lien de trad vers objet $objet/$id_objet incorrect ($id_trad)");
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
 			sql_updateq($table_objet_sql, ['id_trad' => $id_trad], "id_trad = $id_lier");
75 75
 		} // sinon ajouter notre objet dans le groupe
76 76
 		else {
77
-			sql_updateq($table_objet_sql, ['id_trad' => $id_lier], "$id_table_objet=" . (int) $id_objet);
77
+			sql_updateq($table_objet_sql, ['id_trad' => $id_lier], "$id_table_objet=".(int) $id_objet);
78 78
 		}
79 79
 	} // on a fourni un id_trad nul : sortir id_objet du groupe de trad
80 80
 	else {
81
-		$old_id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$id_table_objet=" . (int) $id_objet);
81
+		$old_id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$id_table_objet=".(int) $id_objet);
82 82
 		// supprimer le lien de traduction
83
-		sql_updateq($table_objet_sql, ['id_trad' => 0], "$id_table_objet=" . (int) $id_objet);
83
+		sql_updateq($table_objet_sql, ['id_trad' => 0], "$id_table_objet=".(int) $id_objet);
84 84
 
85 85
 		// Verifier si l'ancien groupe ne comporte plus qu'un seul objet. Alors mettre a zero.
86
-		$cpt = sql_countsel($table_objet_sql, 'id_trad=' . (int) $old_id_trad);
86
+		$cpt = sql_countsel($table_objet_sql, 'id_trad='.(int) $old_id_trad);
87 87
 		if ($cpt == 1) {
88
-			sql_updateq($table_objet_sql, ['id_trad' => 0], 'id_trad=' . (int) $old_id_trad);
88
+			sql_updateq($table_objet_sql, ['id_trad' => 0], 'id_trad='.(int) $old_id_trad);
89 89
 		}
90 90
 	}
91 91
 
Please login to merge, or discard this patch.
ecrire/action/tester_taille.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']);
76 76
 		if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) {
77 77
 			$t *= 0.9; // marge de securite
78
-			echo round($t / 1_000_000, 3) . ' Mpx';
78
+			echo round($t / 1_000_000, 3).' Mpx';
79 79
 		} else {
80 80
 			// c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue"
81 81
 			$t = 0;
@@ -111,19 +111,19 @@  discard block
 block discarded – undo
111 111
 	$image_source = chemin_image('test.png');
112 112
 	$GLOBALS['redirect'] = generer_url_action(
113 113
 		'tester_taille',
114
-		"i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test']
114
+		"i=$i&arg=".$GLOBALS['taille_min'].'-'.$GLOBALS['taille_test']
115 115
 	);
116 116
 
117 117
 	ob_start('action_tester_taille_error_handler');
118 118
 	filtrer('image_recadre', $image_source, $taille, $taille);
119
-	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
119
+	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
120 120
 
121 121
 	// si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee
122 122
 	// si $GLOBALS['taille_min']==0 (car on est au premier coup)
123 123
 	if ($GLOBALS['taille_min'] == 0) {
124 124
 		$taille = $GLOBALS['taille_max'];
125 125
 		filtrer('image_recadre', $image_source, $taille, $taille);
126
-		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
126
+		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
127 127
 	}
128 128
 	ob_end_clean();
129 129
 
Please login to merge, or discard this patch.
ecrire/action/supprimer_rubrique.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	return;
20 20
 }
21 21
 
22
-include_spip('inc/charsets');  # pour le nom de fichier
22
+include_spip('inc/charsets'); # pour le nom de fichier
23 23
 
24 24
 /**
25 25
  * Effacer une rubrique
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	if ((int) $id_rubrique) {
38
-		sql_delete('spip_rubriques', 'id_rubrique=' . (int) $id_rubrique);
38
+		sql_delete('spip_rubriques', 'id_rubrique='.(int) $id_rubrique);
39 39
 		// Les admin restreints qui n'administraient que cette rubrique
40 40
 		// deviennent redacteurs
41 41
 		// (il y a sans doute moyen de faire ca avec un having)
42 42
 
43
-		$q = sql_select('id_auteur', 'spip_auteurs_liens', "objet='rubrique' AND id_objet=" . (int) $id_rubrique);
43
+		$q = sql_select('id_auteur', 'spip_auteurs_liens', "objet='rubrique' AND id_objet=".(int) $id_rubrique);
44 44
 		while ($r = sql_fetch($q)) {
45 45
 			$id_auteur = $r['id_auteur'];
46 46
 			// degrader avant de supprimer la restriction d'admin
47 47
 			// section critique sur les droits
48 48
 			$n = sql_countsel(
49 49
 				'spip_auteurs_liens',
50
-				"objet='rubrique' AND id_objet!=" . (int) $id_rubrique . ' AND id_auteur=' . (int) $id_auteur
50
+				"objet='rubrique' AND id_objet!=".(int) $id_rubrique.' AND id_auteur='.(int) $id_auteur
51 51
 			);
52 52
 			if (!$n) {
53 53
 				include_spip('action/editer_auteur');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			}
56 56
 			sql_delete(
57 57
 				'spip_auteurs_liens',
58
-				"objet='rubrique' AND id_objet=" . (int) $id_rubrique . ' AND id_auteur=' . (int) $id_auteur
58
+				"objet='rubrique' AND id_objet=".(int) $id_rubrique.' AND id_auteur='.(int) $id_auteur
59 59
 			);
60 60
 		}
61 61
 		// menu_rubriques devra recalculer
Please login to merge, or discard this patch.
ecrire/action/session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		&& $_SERVER['REQUEST_METHOD'] == 'POST'
38 38
 	) {
39 39
 		include_spip('inc/session');
40
-		session_set('session_' . $var, $val = _request('val'));
40
+		session_set('session_'.$var, $val = _request('val'));
41 41
 		#spip_log("autosave:$var:$val",'autosave');
42 42
 	}
43 43
 
Please login to merge, or discard this patch.
ecrire/urls/page.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite
23 23
 define('_separateur_urls_page', '');
24 24
 # on peut indiquer '' si on a installe le .htaccess
25
-define('_debut_urls_page', get_spip_script('./') . '?');
25
+define('_debut_urls_page', get_spip_script('./').'?');
26 26
 #######
27 27
 /**
28 28
  * Generer l'url d'un objet SPIP
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 		}
39 39
 	}
40 40
 
41
-	$url = \_debut_urls_page . $objet . \_separateur_urls_page
42
-		. $id . \_terminaison_urls_page;
41
+	$url = \_debut_urls_page.$objet.\_separateur_urls_page
42
+		. $id.\_terminaison_urls_page;
43 43
 
44 44
 	if ($args) {
45 45
 		$args = strpos($url, '?') ? "&$args" : "?$args";
46 46
 	}
47 47
 
48
-	return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : '');
48
+	return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : '');
49 49
 }
50 50
 
51 51
 /**
Please login to merge, or discard this patch.
ecrire/prive.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // Script pour appeler un squelette apres s'etre authentifie
13 13
 
14
-include_once __DIR__ . '/inc_version.php';
14
+include_once __DIR__.'/inc_version.php';
15 15
 
16 16
 include_spip('inc/cookie');
17 17
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	// On reexecute pour deboucher sur le include public.
25 25
 	// autrement on insiste
26 26
 	if (is_array($var_auth)) {
27
-			$var_auth = '../?' . $_SERVER['QUERY_STRING'];
27
+			$var_auth = '../?'.$_SERVER['QUERY_STRING'];
28 28
 			spip_setcookie('spip_session', $_COOKIE['spip_session'], [
29 29
 				'expires' => time() + 3600 * 24 * 14
30 30
 			]);
@@ -34,4 +34,4 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // En somme, est prive' ce qui est publiquement nomme'...
37
-include __DIR__ . '/public.php';
37
+include __DIR__.'/public.php';
Please login to merge, or discard this patch.
ecrire/base/connect_sql.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18 18
 	return;
19 19
 }
20
-require_once _ROOT_RESTREINT . 'base/objets.php';
20
+require_once _ROOT_RESTREINT.'base/objets.php';
21 21
 
22 22
 
23 23
 /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 				defined('_DIR_CONNECT')
63 63
 				&& preg_match('/^[\w\.]*$/', $serveur)
64 64
 			) {
65
-				$f = _DIR_CONNECT . $serveur . '.php';
65
+				$f = _DIR_CONNECT.$serveur.'.php';
66 66
 				if (!is_readable($f) && !$install) {
67 67
 					// chercher une declaration de serveur dans le path
68 68
 					// qui peut servir à des plugins à declarer des connexions à une base sqlite
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	// chargement de la version du jeu de fonctions
111 111
 	// si pas dans le fichier par defaut
112 112
 	$type = $GLOBALS['db_ok']['type'];
113
-	$jeu = 'spip_' . $type . '_functions_' . $version;
114
-	if (!isset($GLOBALS[$jeu]) && !find_in_path($type . '_' . $version . '.php', 'req/', true)) {
113
+	$jeu = 'spip_'.$type.'_functions_'.$version;
114
+	if (!isset($GLOBALS[$jeu]) && !find_in_path($type.'_'.$version.'.php', 'req/', true)) {
115 115
 		spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS);
116 116
 		// ne plus reessayer
117 117
 		return $GLOBALS['connexions'][$index][$version] = [];
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 	$connexion = spip_connect($serveur);
172 172
 	$e = sql_errno($serveur);
173 173
 	$t = ($connexion['type'] ?? 'sql');
174
-	$m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']);
175
-	$f = $t . $serveur;
176
-	spip_log($m, $f . '.' . _LOG_ERREUR);
174
+	$m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']);
175
+	$f = $t.$serveur;
176
+	spip_log($m, $f.'.'._LOG_ERREUR);
177 177
 }
178 178
 
179 179
 /**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	// si en cours d'installation ou si db=@test@ on ne pose rien
260 260
 	// car c'est un test de connexion
261 261
 	if (!defined('_ECRIRE_INSTALL') && $db !== '@test@') {
262
-		$f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out';
262
+		$f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out';
263 263
 	} elseif ($db == '@test@') {
264 264
 		$db = '';
265 265
 	}
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	// En cas d'indisponibilite du serveur, eviter de le bombarder
299 299
 	if ($f) {
300 300
 		@touch($f);
301
-		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS);
301
+		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS);
302 302
 	}
303 303
 	return null;
304 304
 }
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
 	} elseif (is_array($a)) {
396 396
 		return implode(',', array_map('_q', $a));
397 397
 	} elseif (is_scalar($a)) {
398
-		return ("'" . addslashes($a) . "'");
398
+		return ("'".addslashes($a)."'");
399 399
 	} elseif ($a === null) {
400 400
 		return "''";
401 401
 	}
402
-	throw new \RuntimeException('Can’t use _q with ' . gettype($a));
402
+	throw new \RuntimeException('Can’t use _q with '.gettype($a));
403 403
 }
404 404
 
405 405
 /**
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 				$next = reset($textes);
451 451
 				if (
452 452
 					str_starts_with($next, "'")
453
-					&& strpos($query_echappees, $part . $next, $currentpos) === $nextpos
453
+					&& strpos($query_echappees, $part.$next, $currentpos) === $nextpos
454 454
 				) {
455 455
 					$part .= array_shift($textes);
456 456
 				}
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 			$parts[$k] = [
463 463
 				'texte' => $part,
464 464
 				'position' => $nextpos,
465
-				'placeholder' => '%' . $k . '$s',
465
+				'placeholder' => '%'.$k.'$s',
466 466
 			];
467 467
 			$currentpos = $nextpos + strlen($part);
468 468
 		}
Please login to merge, or discard this patch.