Completed
Push — master ( 11f8d8...e4a3b1 )
by cam
01:03
created
ecrire/inc/presentation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	];
46 46
 	$style_titre_mapping = ['couleur' => 'topper', 'trait-couleur' => 'section'];
47 47
 	$c = $style_mapping[$style] ?? 'simple';
48
-	$class = $c . ($class ? " $class" : '');
48
+	$class = $c.($class ? " $class" : '');
49 49
 	if (!$padding) {
50
-		$class .= ($class ? ' ' : '') . 'no-padding';
50
+		$class .= ($class ? ' ' : '').'no-padding';
51 51
 	}
52 52
 
53 53
 	//($id?"id='$id' ":"")
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 		if ($fonction) {
63 63
 			// 2 images pour composer l'icone : le fond (article) en background,
64 64
 			// la fonction (new) en image
65
-			$icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n" .
65
+			$icone = http_img_pack($fonction, '', "class='cadre-icone' width='$size' height='$size'\n".
66 66
 				http_style_background($fond, 'no-repeat center center', $size));
67 67
 		} else {
68 68
 			$icone = http_img_pack($fond, '', "class='cadre-icone' width='$size' height='$size'");
69 69
 		}
70
-		$titre = $icone . $titre;
70
+		$titre = $icone.$titre;
71 71
 	}
72 72
 
73 73
 	return boite_ouvrir($titre, $class, $style_titre_mapping[$style] ?? '', $id);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	$titre,
182 182
 	$ze_logo = ''
183 183
 ) {
184
-	return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n";
184
+	return "<h1 class = 'grostitre'>".$ze_logo.' '.typo($titre)."</h1>\n";
185 185
 }
186 186
 
187 187
 // La boite des raccourcis
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 // https://code.spip.net/@bloc_des_raccourcis
190 190
 function bloc_des_raccourcis($bloc) {
191 191
 	return creer_colonne_droite()
192
-	. boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer();
192
+	. boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis').$bloc.boite_fermer();
193 193
 }
194 194
 
195 195
 //
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +35 added lines, -36 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	if (
219 219
 		$config_fonc
220 220
 		and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
221
-		and $config_fonc !== $table_objet . '_edit_config'
221
+		and $config_fonc !== $table_objet.'_edit_config'
222 222
 	) {
223 223
 		if (
224 224
 			$args = test_formulaire_inclus_par_modele()
@@ -233,12 +233,12 @@  discard block
 block discarded – undo
233 233
 	// Appel direct dans un squelette
234 234
 	if (!$row) {
235 235
 		if (!$new or $lier_trad) {
236
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
236
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
237 237
 				$row = $select($id, $id_parent, $lier_trad);
238 238
 				// si on a une fonction precharger, elle pu faire un reglage de langue
239 239
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
240 240
 			} else {
241
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
241
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
242 242
 			}
243 243
 			if (!$new) {
244 244
 				$md5 = controles_md5($row);
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	if ($config_fonc) {
289 289
 		$contexte['config'] = $config = $config_fonc($contexte);
290 290
 		if (!$lang_default) {
291
-			$lang_default = $config['langue'] ?? session_get('lang') ;
291
+			$lang_default = $config['langue'] ?? session_get('lang');
292 292
 		}
293 293
 	}
294 294
 	$config = $config + [
@@ -312,13 +312,12 @@  discard block
 block discarded – undo
312 312
 		unset($contexte['lang']);
313 313
 	}
314 314
 
315
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
316
-		(!$lier_trad ? '' :
317
-			("\n<input type='hidden' name='lier_trad' value='" .
318
-				$lier_trad .
319
-				"' />" .
320
-				"\n<input type='hidden' name='changer_lang' value='" .
321
-				$lang_default .
315
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
316
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
317
+				$lier_trad.
318
+				"' />".
319
+				"\n<input type='hidden' name='changer_lang' value='".
320
+				$lang_default.
322 321
 				"' />"))
323 322
 		. $hidden
324 323
 		. ($md5 ?? '');
@@ -358,14 +357,14 @@  discard block
 block discarded – undo
358 357
 	$aider = charger_fonction('aider', 'inc');
359 358
 	if (strlen($texte) > 28 * 1024) {
360 359
 		$texte = str_replace("\r\n", "\n", $texte);
361
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
360
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
362 361
 		if ($pos > 0 and $pos < 32 * 1024) {
363
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
362
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
364 363
 			$suite = substr($texte, $pos + 2);
365 364
 		} else {
366
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
365
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
367 366
 			if (!($pos > 0 and $pos < 32 * 1024)) {
368
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
367
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
369 368
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
370 369
 			} else {
371 370
 				$decalage = 1;
@@ -396,13 +395,13 @@  discard block
 block discarded – undo
396 395
 	}
397 396
 
398 397
 	include_spip('inc/barre');
399
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
398
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
400 399
 	$nombre = 0;
401 400
 
402 401
 	while (strlen($texte) > 29 * 1024) {
403 402
 		$nombre++;
404 403
 		[$texte1, $texte] = coupe_trop_long($texte);
405
-		$textes_supplement .= '<br />' .
404
+		$textes_supplement .= '<br />'.
406 405
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
407 406
 	}
408 407
 
@@ -485,7 +484,7 @@  discard block
 block discarded – undo
485 484
 	$ctr = [];
486 485
 	foreach ($data as $key => $val) {
487 486
 		$m = md5($val ?? '');
488
-		$k = $prefixe . $key;
487
+		$k = $prefixe.$key;
489 488
 
490 489
 		switch ($format) {
491 490
 			case 'html':
@@ -498,7 +497,7 @@  discard block
 block discarded – undo
498 497
 	}
499 498
 
500 499
 	if ($format === 'html') {
501
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
500
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
502 501
 	} else {
503 502
 		return $ctr;
504 503
 	}
@@ -650,7 +649,7 @@  discard block
 block discarded – undo
650 649
 	// On elimine les donnees non modifiees par le formulaire (mais
651 650
 	// potentiellement modifiees entre temps par un autre utilisateur)
652 651
 	foreach ($champs as $key => $val) {
653
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
652
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
654 653
 			if (is_scalar($val) and $m == md5($val)) {
655 654
 				unset($champs[$key]);
656 655
 			}
@@ -679,7 +678,7 @@  discard block
 block discarded – undo
679 678
 	// de conflit.
680 679
 	$ctrh = $ctrq = $conflits = [];
681 680
 	foreach (array_keys($champs) as $key) {
682
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
681
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
683 682
 			$ctrh[$key] = $m;
684 683
 			$ctrq[] = $key;
685 684
 		}
@@ -713,9 +712,9 @@  discard block
 block discarded – undo
713 712
  */
714 713
 function display_conflit_champ($x) {
715 714
 	if (strstr($x, "\n") or strlen($x) > 80) {
716
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
715
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
717 716
 	} else {
718
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
717
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
719 718
 	}
720 719
 }
721 720
 
@@ -755,11 +754,11 @@  discard block
 block discarded – undo
755 754
 		) : $champ;
756 755
 
757 756
 		$diffs[] = "<h2>$titre</h2>\n"
758
-			. '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n"
759
-			. "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n"
760
-			. '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>'
757
+			. '<h3>'._T('info_conflit_edition_differences')."</h3>\n"
758
+			. "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n"
759
+			. '<h4>'._T('info_conflit_edition_votre_version').'</h4>'
761 760
 			. display_conflit_champ($a['post'])
762
-			. '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>'
761
+			. '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>'
763 762
 			. display_conflit_champ($base);
764 763
 	}
765 764
 
@@ -767,16 +766,16 @@  discard block
 block discarded – undo
767 766
 		$id = uniqid(random_int(0, mt_getrandmax()));
768 767
 		$redirect = "<form action='$redirect' method='get'
769 768
 			id='$id'
770
-			style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n"
769
+			style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n"
771 770
 			. form_hidden($redirect)
772
-			. "<input type='submit' value='" . _T('icone_retour') . "' />
771
+			. "<input type='submit' value='"._T('icone_retour')."' />
773 772
 		</form>\n";
774 773
 
775 774
 		// pour les documents, on est probablement en ajax : il faut ajaxer
776 775
 		if (_AJAX) {
777 776
 			$redirect .= '<script type="text/javascript">'
778
-				. 'setTimeout(function(){$("#' . $id . '")
779
-			.ajaxForm({target:$("#' . $id . '").parent()});
777
+				. 'setTimeout(function(){$("#'.$id.'")
778
+			.ajaxForm({target:$("#' . $id.'").parent()});
780 779
 			}, 200);'
781 780
 				. "</script>\n";
782 781
 		}
@@ -795,9 +794,9 @@  discard block
 block discarded – undo
795 794
 .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; }
796 795
 .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; }
797 796
 </style>'
798
-		. '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>'
799
-		. '<p>' . _T('texte_conflit_edition_correction') . '</p>'
800
-		. "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>"
797
+		. '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>'
798
+		. '<p>'._T('texte_conflit_edition_correction').'</p>'
799
+		. "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>"
801 800
 		. join("\n", $diffs)
802 801
 		. "</div>\n"
803 802
 
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +129 added lines, -130 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	include_fichiers_fonctions();
99
-	foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) {
99
+	foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) {
100 100
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
101 101
 		// fonction ou name\space\fonction
102 102
 		if (is_callable($f)) {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	// affichage "GIT [master: abcdef]"
224 224
 	$commit = $desc['commit_short'] ?? $desc['commit'];
225 225
 	if ($desc['branch']) {
226
-		$commit = $desc['branch'] . ': ' . $commit;
226
+		$commit = $desc['branch'].': '.$commit;
227 227
 	}
228 228
 	return "{$desc['vcs']} [$commit]";
229 229
 }
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 	}
243 243
 
244 244
 	// version installee par GIT
245
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
245
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
246 246
 		$currentHead = trim(substr($c, 4));
247
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
247
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
248 248
 			return [
249 249
 				'vcs' => 'GIT',
250 250
 				'branch' => basename($currentHead),
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 		$dir = '.';
272 272
 	}
273 273
 	// version installee par SVN
274
-	if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) {
275
-		$db = new SQLite3($dir . '/.svn/wc.db');
274
+	if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) {
275
+		$db = new SQLite3($dir.'/.svn/wc.db');
276 276
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
277 277
 		if ($result) {
278 278
 			$row = $result->fetchArray();
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
 
291 291
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
292 292
 // et laisser passer les fonctions personnelles baptisees image_...
293
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
294
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
295
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
296
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
297
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
298
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
293
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
294
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
295
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
296
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
297
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
298
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
299 299
 
300 300
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
301 301
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -454,8 +454,8 @@  discard block
 block discarded – undo
454 454
  */
455 455
 function filtre_debug($val, $key = null) {
456 456
 	$debug = (
457
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
458
-		) . var_export($val, true);
457
+		is_null($key) ? '' : (var_export($key, true).' = ')
458
+		).var_export($val, true);
459 459
 
460 460
 	include_spip('inc/autoriser');
461 461
 	if (autoriser('webmestre')) {
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 		$is_file = false;
510 510
 	}
511 511
 	if ($is_file) {
512
-		$is_local_file = function ($path) {
512
+		$is_local_file = function($path) {
513 513
 			if (strpos($path, '?') !== false) {
514 514
 				$path = supprimer_timestamp($path);
515 515
 				// remove ?24px added by find_in_theme on .svg files
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
562 562
 							$srcover = $match[1];
563 563
 							array_shift($args);
564
-							array_unshift($args, "<img src='" . $match[1] . "' />");
564
+							array_unshift($args, "<img src='".$match[1]."' />");
565 565
 							$srcover_filter = call_user_func_array($filtre, $args);
566 566
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
567 567
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 	// " -> &quot; et tout ce genre de choses
929 929
 	$u = $GLOBALS['meta']['pcre_u'];
930 930
 	$texte = str_replace('&nbsp;', ' ', $texte);
931
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
931
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
932 932
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
933 933
 	$texte = entites_html($texte, false, false);
934 934
 	// mais bien echapper les double quotes !
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
  **/
989 989
 function supprimer_numero($texte) {
990 990
 	return preg_replace(
991
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
991
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
992 992
 		'',
993 993
 		$texte
994 994
 	);
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 function recuperer_numero($texte) {
1017 1017
 	if (
1018 1018
 		preg_match(
1019
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1019
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1020 1020
 			$texte,
1021 1021
 			$regs
1022 1022
 		)
@@ -1107,8 +1107,8 @@  discard block
 block discarded – undo
1107 1107
  **/
1108 1108
 function textebrut($texte) {
1109 1109
 	$u = $GLOBALS['meta']['pcre_u'];
1110
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1111
-	$texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte);
1110
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1111
+	$texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte);
1112 1112
 	$texte = preg_replace("/^\n+/", '', $texte);
1113 1113
 	$texte = preg_replace("/\n+$/", '', $texte);
1114 1114
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 		)
1143 1143
 	) {
1144 1144
 		foreach ($liens[0] as $a) {
1145
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1145
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1146 1146
 			$ablank = inserer_attribut($a, 'rel', $rel);
1147 1147
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1148 1148
 			$texte = str_replace($a, $ablank, $texte);
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 		foreach ($regs[0] as $a) {
1168 1168
 			$rel = extraire_attribut($a, 'rel');
1169 1169
 			if (strpos($rel, 'nofollow') === false) {
1170
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1170
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1171 1171
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1172 1172
 				$texte = str_replace($a, $anofollow, $texte);
1173 1173
 			}
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 	$u = $GLOBALS['meta']['pcre_u'];
1197 1197
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1198 1198
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1199
-	$texte = preg_replace('@^\s*<br />@S' . $u, '', $texte);
1199
+	$texte = preg_replace('@^\s*<br />@S'.$u, '', $texte);
1200 1200
 
1201 1201
 	return $texte;
1202 1202
 }
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
 		return $texte;
1228 1228
 	}
1229 1229
 	include_spip('inc/texte');
1230
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1230
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1231 1231
 		'div' : 'span';
1232 1232
 
1233 1233
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 	}
1340 1340
 	$u = $GLOBALS['meta']['pcre_u'];
1341 1341
 	if ($textebrut) {
1342
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1342
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1343 1343
 	}
1344 1344
 	$texte = texte_backend($texte);
1345 1345
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 	# un message pour abs_url
1375 1375
 	$GLOBALS['mode_abs_url'] = 'url';
1376 1376
 	$url = trim($url);
1377
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1377
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1378 1378
 
1379 1379
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1380 1380
 }
@@ -1578,14 +1578,14 @@  discard block
 block discarded – undo
1578 1578
 	if (strpos($texte, '<') !== false) {
1579 1579
 		include_spip('inc/lien');
1580 1580
 		if (defined('_PREG_MODELE')) {
1581
-			$preg_modeles = '@' . _PREG_MODELE . '@imsS';
1581
+			$preg_modeles = '@'._PREG_MODELE.'@imsS';
1582 1582
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1583 1583
 		}
1584 1584
 	}
1585 1585
 
1586 1586
 	$debut = '';
1587 1587
 	$suite = $texte;
1588
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1588
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1589 1589
 		$debut .= substr($suite, 0, $t - 1);
1590 1590
 		$suite = substr($suite, $t);
1591 1591
 		$car = substr($suite, 0, 1);
@@ -1603,11 +1603,11 @@  discard block
 block discarded – undo
1603 1603
 			$suite = substr($suite, strlen($regs[0]));
1604 1604
 		}
1605 1605
 	}
1606
-	$texte = $debut . $suite;
1606
+	$texte = $debut.$suite;
1607 1607
 
1608 1608
 	$texte = echappe_retour($texte);
1609 1609
 
1610
-	return $texte . $fin;
1610
+	return $texte.$fin;
1611 1611
 }
1612 1612
 
1613 1613
 
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
 		}
1670 1670
 
1671 1671
 		foreach ($regs as $reg) {
1672
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1672
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1673 1673
 			$desc = $traduire($cle, $lang, true);
1674 1674
 			$l = $desc->langue;
1675 1675
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1783,9 +1783,9 @@  discard block
 block discarded – undo
1783 1783
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1784 1784
 					include_spip('inc/texte');
1785 1785
 					$trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad));
1786
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1786
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1787 1787
 					if ($mode === 'div') {
1788
-						$trad = rtrim($trad) . "\n\n";
1788
+						$trad = rtrim($trad)."\n\n";
1789 1789
 					}
1790 1790
 					$trad = code_echappement($trad, 'multi', false, $mode);
1791 1791
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
 	if (is_array($balise)) {
1982 1982
 		array_walk(
1983 1983
 			$balise,
1984
-			function (&$a, $key, $t) {
1984
+			function(&$a, $key, $t) {
1985 1985
 				$a = extraire_attribut($a, $t);
1986 1986
 			},
1987 1987
 			$attribut
@@ -2073,14 +2073,14 @@  discard block
 block discarded – undo
2073 2073
 
2074 2074
 	if ($old !== null) {
2075 2075
 		// Remplacer l'ancien attribut du meme nom
2076
-		$balise = $r[1] . $insert . $r[5];
2076
+		$balise = $r[1].$insert.$r[5];
2077 2077
 	} else {
2078 2078
 		// preferer une balise " />" (comme <img />)
2079 2079
 		if (preg_match(',/>,', $balise)) {
2080
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
2080
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
2081 2081
 		} // sinon une balise <a ...> ... </a>
2082 2082
 		else {
2083
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
2083
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
2084 2084
 		}
2085 2085
 	}
2086 2086
 
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
 		if (
2136 2136
 			$class_courante
2137 2137
 			and strpos($class_courante, (string) $c) !== false
2138
-			and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante)
2138
+			and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante)
2139 2139
 		) {
2140 2140
 			$is_class_presente = true;
2141 2141
 		}
@@ -2143,12 +2143,12 @@  discard block
 block discarded – undo
2143 2143
 			in_array($operation, ['ajouter', 'commuter'])
2144 2144
 			and !$is_class_presente
2145 2145
 		) {
2146
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2146
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2147 2147
 		} elseif (
2148 2148
 			in_array($operation, ['supprimer', 'commuter'])
2149 2149
 			and $is_class_presente
2150 2150
 		) {
2151
-			$class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new));
2151
+			$class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new));
2152 2152
 		}
2153 2153
 	}
2154 2154
 
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 // Quelques fonctions de calcul arithmetique
2212 2212
 //
2213 2213
 function floatstr($a) {
2214
- return str_replace(',', '.', (string)floatval($a));
2214
+ return str_replace(',', '.', (string) floatval($a));
2215 2215
 }
2216 2216
 function strize($f, $a, $b) {
2217 2217
  return floatstr($f(floatstr($a), floatstr($b)));
@@ -2347,13 +2347,13 @@  discard block
 block discarded – undo
2347 2347
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2348 2348
 		define('_TAGS_NOM_AUTEUR', '');
2349 2349
 	}
2350
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2350
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2351 2351
 	foreach ($tags_acceptes as $tag) {
2352 2352
 		if (strlen($tag)) {
2353
-			$remp1[] = '<' . trim($tag) . '>';
2354
-			$remp1[] = '</' . trim($tag) . '>';
2355
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2356
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2353
+			$remp1[] = '<'.trim($tag).'>';
2354
+			$remp1[] = '</'.trim($tag).'>';
2355
+			$remp2[] = '\x60'.trim($tag).'\x61';
2356
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2357 2357
 		}
2358 2358
 	}
2359 2359
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2407,7 +2407,7 @@  discard block
 block discarded – undo
2407 2407
 				. http_img_pack(
2408 2408
 					'attachment-16.png',
2409 2409
 					$t,
2410
-					'title="' . attribut_html($t) . '"'
2410
+					'title="'.attribut_html($t).'"'
2411 2411
 				)
2412 2412
 				. '</a>',
2413 2413
 				$tag
@@ -2471,10 +2471,10 @@  discard block
 block discarded – undo
2471 2471
 	$fichier = basename($url);
2472 2472
 
2473 2473
 	return '<a rel="enclosure"'
2474
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2475
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2476
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2477
-	. '>' . $fichier . '</a>';
2474
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2475
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2476
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2477
+	. '>'.$fichier.'</a>';
2478 2478
 }
2479 2479
 
2480 2480
 /**
@@ -2502,9 +2502,9 @@  discard block
 block discarded – undo
2502 2502
 			} # vieux data
2503 2503
 			$fichier = basename($url);
2504 2504
 			$enclosures[] = '<enclosure'
2505
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2506
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2507
-				. ($length ? ' length="' . $length . '"' : '')
2505
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2506
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2507
+				. ($length ? ' length="'.$length.'"' : '')
2508 2508
 				. ' />';
2509 2509
 		}
2510 2510
 	}
@@ -2530,7 +2530,7 @@  discard block
 block discarded – undo
2530 2530
 		if (extraire_attribut($e, 'rel') == 'tag') {
2531 2531
 			$subjects .= '<dc:subject>'
2532 2532
 				. texte_backend(textebrut($e))
2533
-				. '</dc:subject>' . "\n";
2533
+				. '</dc:subject>'."\n";
2534 2534
 		}
2535 2535
 	}
2536 2536
 
@@ -2566,7 +2566,7 @@  discard block
 block discarded – undo
2566 2566
 	if (is_array($texte)) {
2567 2567
 		array_walk(
2568 2568
 			$texte,
2569
-			function (&$a, $key, $t) {
2569
+			function(&$a, $key, $t) {
2570 2570
 				$a = extraire_balise($a, $t);
2571 2571
 			},
2572 2572
 			$tag
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	if (is_array($texte)) {
2615 2615
 		array_walk(
2616 2616
 			$texte,
2617
-			function (&$a, $key, $t) {
2617
+			function(&$a, $key, $t) {
2618 2618
 				$a = extraire_balises($a, $t);
2619 2619
 			},
2620 2620
 			$tag
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
 		if ($fond != '404') {
2747 2747
 			$contexte = array_shift($p);
2748 2748
 			$contexte['page'] = $fond;
2749
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2749
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2750 2750
 		}
2751 2751
 	}
2752 2752
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2801,9 +2801,9 @@  discard block
 block discarded – undo
2801 2801
 			. '"'
2802 2802
 			. (is_null($val)
2803 2803
 				? ''
2804
-				: ' value="' . entites_html($val) . '"'
2804
+				: ' value="'.entites_html($val).'"'
2805 2805
 			)
2806
-			. ' type="hidden"' . "\n/>";
2806
+			. ' type="hidden"'."\n/>";
2807 2807
 	}
2808 2808
 
2809 2809
 	return join('', $hidden);
@@ -2913,7 +2913,7 @@  discard block
 block discarded – undo
2913 2913
 
2914 2914
 	return preg_replace_callback(
2915 2915
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2916
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2916
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2917 2917
 		$contenu
2918 2918
 	);
2919 2919
 }
@@ -2974,14 +2974,14 @@  discard block
 block discarded – undo
2974 2974
 	) {
2975 2975
 		$distant = true;
2976 2976
 		$cssf = parse_url($css);
2977
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
2977
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
2978 2978
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
2979 2979
 	} else {
2980 2980
 		$distant = false;
2981 2981
 		$cssf = $css;
2982 2982
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2983 2983
 		//propose (rien a faire dans ce cas)
2984
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2984
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2985 2985
 		if (@file_exists($f)) {
2986 2986
 			return $f;
2987 2987
 		}
@@ -2991,7 +2991,7 @@  discard block
 block discarded – undo
2991 2991
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2992 2992
 	$f = $dir_var
2993 2993
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2994
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2994
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2995 2995
 
2996 2996
 	// la css peut etre distante (url absolue !)
2997 2997
 	if ($distant) {
@@ -3037,8 +3037,8 @@  discard block
 block discarded – undo
3037 3037
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
3038 3038
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
3039 3039
 			$css_direction = substr($css_direction, strlen($dir_var));
3040
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
3041
-			$css_direction = '/@@@@@@/' . $css_direction;
3040
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
3041
+			$css_direction = '/@@@@@@/'.$css_direction;
3042 3042
 		}
3043 3043
 		$src[] = $regs[0][$k];
3044 3044
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3087,7 +3087,7 @@  discard block
 block discarded – undo
3087 3087
 
3088 3088
 	$f = basename($css, '.css');
3089 3089
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3090
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3090
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3091 3091
 		. '.css';
3092 3092
 
3093 3093
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3097,7 +3097,7 @@  discard block
 block discarded – undo
3097 3097
 	if ($url_absolue_css == $css) {
3098 3098
 		if (
3099 3099
 			strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3100
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3100
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3101 3101
 		) {
3102 3102
 			include_spip('inc/distant');
3103 3103
 			$contenu = recuperer_url($css);
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
 	$expression = str_replace('\/', '/', $expression);
3210 3210
 	$expression = str_replace('/', '\/', $expression);
3211 3211
 
3212
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3212
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3213 3213
 		if (isset($r[$capte])) {
3214 3214
 			return $r[$capte];
3215 3215
 		} else {
@@ -3247,7 +3247,7 @@  discard block
 block discarded – undo
3247 3247
 	$expression = str_replace('\/', '/', $expression);
3248 3248
 	$expression = str_replace('/', '\/', $expression);
3249 3249
 
3250
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3250
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3251 3251
 }
3252 3252
 
3253 3253
 
@@ -3266,7 +3266,7 @@  discard block
 block discarded – undo
3266 3266
 function traiter_doublons_documents(&$doublons, $letexte) {
3267 3267
 
3268 3268
 	// Verifier dans le texte & les notes (pas beau, helas)
3269
-	$t = $letexte . $GLOBALS['les_notes'];
3269
+	$t = $letexte.$GLOBALS['les_notes'];
3270 3270
 
3271 3271
 	if (
3272 3272
 		strstr($t, 'spip_document_') // evite le preg_match_all si inutile
@@ -3280,7 +3280,7 @@  discard block
 block discarded – undo
3280 3280
 		if (!isset($doublons['documents'])) {
3281 3281
 			$doublons['documents'] = '';
3282 3282
 		}
3283
-		$doublons['documents'] .= ',' . join(',', $matches[1]);
3283
+		$doublons['documents'] .= ','.join(',', $matches[1]);
3284 3284
 	}
3285 3285
 
3286 3286
 	return $letexte;
@@ -3337,7 +3337,7 @@  discard block
 block discarded – undo
3337 3337
 	if ($env) {
3338 3338
 		foreach ($env as $i => $j) {
3339 3339
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3340
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3340
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3341 3341
 			}
3342 3342
 		}
3343 3343
 	}
@@ -3376,7 +3376,7 @@  discard block
 block discarded – undo
3376 3376
 	if ($env) {
3377 3377
 		foreach ($env as $i => $j) {
3378 3378
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3379
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3379
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3380 3380
 			}
3381 3381
 		}
3382 3382
 	}
@@ -3450,10 +3450,10 @@  discard block
 block discarded – undo
3450 3450
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3451 3451
 	if (
3452 3452
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3453
-		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg'
3453
+		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg'
3454 3454
 		and file_exists($variante_svg_generique)
3455 3455
 	) {
3456
-		if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) {
3456
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) {
3457 3457
 			$img_file = $variante_svg_size;
3458 3458
 		}
3459 3459
 		else {
@@ -3511,7 +3511,7 @@  discard block
 block discarded – undo
3511 3511
 				return '';
3512 3512
 			}
3513 3513
 		}
3514
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3514
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3515 3515
 	}
3516 3516
 
3517 3517
 	if (file_exists($img_file)) {
@@ -3521,14 +3521,14 @@  discard block
 block discarded – undo
3521 3521
 		$alt = '';
3522 3522
 	}
3523 3523
 	elseif ($alt or $alt === '') {
3524
-		$alt = " alt='" . attribut_html($alt) . "'";
3524
+		$alt = " alt='".attribut_html($alt)."'";
3525 3525
 	}
3526 3526
 	else {
3527
-		$alt = " alt='" . attribut_html($title) . "'";
3527
+		$alt = " alt='".attribut_html($title)."'";
3528 3528
 	}
3529 3529
 	return "<img src='$img_file'$alt"
3530
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3531
-	. ' ' . ltrim($atts)
3530
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3531
+	. ' '.ltrim($atts)
3532 3532
 	. ' />';
3533 3533
 }
3534 3534
 
@@ -3542,10 +3542,10 @@  discard block
 block discarded – undo
3542 3542
  */
3543 3543
 function http_style_background($img, $att = '', $size = null) {
3544 3544
 	if ($size and is_numeric($size)) {
3545
-		$size = trim($size) . 'px';
3545
+		$size = trim($size).'px';
3546 3546
 	}
3547
-	return " style='background" .
3548
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3547
+	return " style='background".
3548
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3549 3549
 		. ($size ? "background-size:{$size};" : '')
3550 3550
 		. "'";
3551 3551
 }
@@ -3660,7 +3660,7 @@  discard block
 block discarded – undo
3660 3660
 		$img = http_img_pack(
3661 3661
 			$img,
3662 3662
 			$alt,
3663
-			$class ? " class='" . attribut_html($class) . "'" : '',
3663
+			$class ? " class='".attribut_html($class)."'" : '',
3664 3664
 			'',
3665 3665
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3666 3666
 		);
@@ -3745,7 +3745,7 @@  discard block
 block discarded – undo
3745 3745
 	$balise_svg_source = $balise_svg;
3746 3746
 
3747 3747
 	// entete XML à supprimer
3748
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3748
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3749 3749
 
3750 3750
 	// IE est toujours mon ami
3751 3751
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3763,9 +3763,9 @@  discard block
 block discarded – undo
3763 3763
 	// regler le alt
3764 3764
 	if ($alt) {
3765 3765
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3766
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3766
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3767 3767
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3768
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3768
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3769 3769
 		$balise_svg .= $title;
3770 3770
 	}
3771 3771
 	else {
@@ -3813,7 +3813,7 @@  discard block
 block discarded – undo
3813 3813
 	if (is_array($tableau)) {
3814 3814
 		foreach ($tableau as $k => $v) {
3815 3815
 			$res = recuperer_fond(
3816
-				'modeles/' . $modele,
3816
+				'modeles/'.$modele,
3817 3817
 				array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v]))
3818 3818
 			);
3819 3819
 			$texte .= $res;
@@ -3998,7 +3998,7 @@  discard block
 block discarded – undo
3998 3998
 	}
3999 3999
 
4000 4000
 	$c = serialize($c);
4001
-	$cle = calculer_cle_action($form . $c);
4001
+	$cle = calculer_cle_action($form.$c);
4002 4002
 	$c = "$cle:$c";
4003 4003
 
4004 4004
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -4056,15 +4056,15 @@  discard block
 block discarded – undo
4056 4056
 	}
4057 4057
 	// toujours encoder l'url source dans le bloc ajax
4058 4058
 	$r = self();
4059
-	$r = ' data-origin="' . $r . '"';
4059
+	$r = ' data-origin="'.$r.'"';
4060 4060
 	$class = 'ajaxbloc';
4061 4061
 	if ($ajaxid and is_string($ajaxid)) {
4062 4062
 		// ajaxid est normalement conforme a un nom de classe css
4063 4063
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
4064
-		$class .= ' ajax-id-' . entites_html($ajaxid);
4064
+		$class .= ' ajax-id-'.entites_html($ajaxid);
4065 4065
 	}
4066 4066
 
4067
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4067
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4068 4068
 }
4069 4069
 
4070 4070
 /**
@@ -4108,7 +4108,7 @@  discard block
 block discarded – undo
4108 4108
 		$cle = substr($c, 0, $p);
4109 4109
 		$c = substr($c, $p + 1);
4110 4110
 
4111
-		if ($cle == calculer_cle_action($form . $c)) {
4111
+		if ($cle == calculer_cle_action($form.$c)) {
4112 4112
 			$env = @unserialize($c);
4113 4113
 			return $env;
4114 4114
 		}
@@ -4229,13 +4229,13 @@  discard block
 block discarded – undo
4229 4229
 				}
4230 4230
 			}
4231 4231
 		}
4232
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4232
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4233 4233
 	} else {
4234 4234
 		$bal = 'a';
4235 4235
 		$att = "href='$url'"
4236
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4237
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4238
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4236
+			. ($title ? " title='".attribut_html($title)."'" : '')
4237
+			. ($class ? " class='".attribut_html($class)."'" : '')
4238
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4239 4239
 			. $evt;
4240 4240
 	}
4241 4241
 	if ($libelle === null) {
@@ -4374,7 +4374,7 @@  discard block
 block discarded – undo
4374 4374
 
4375 4375
 	// Icône
4376 4376
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4377
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4377
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4378 4378
 
4379 4379
 	// Markup final
4380 4380
 	if ($type == 'lien') {
@@ -4651,20 +4651,20 @@  discard block
 block discarded – undo
4651 4651
 		$class_form = 'ajax';
4652 4652
 		$class = str_replace('ajax', '', $class);
4653 4653
 	}
4654
-	$class_btn = 'submit ' . trim($class);
4654
+	$class_btn = 'submit '.trim($class);
4655 4655
 
4656 4656
 	if ($confirm) {
4657
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4657
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4658 4658
 		if ($callback) {
4659 4659
 			$callback = "$confirm?($callback):false";
4660 4660
 		} else {
4661 4661
 			$callback = $confirm;
4662 4662
 		}
4663 4663
 	}
4664
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4664
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4665 4665
 	$title = $title ? " title='$title'" : '';
4666 4666
 
4667
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4667
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4668 4668
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4669 4669
 }
4670 4670
 
@@ -4729,14 +4729,14 @@  discard block
 block discarded – undo
4729 4729
 		$champ_titre = '';
4730 4730
 		if ($demande_titre) {
4731 4731
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4732
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4732
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4733 4733
 		}
4734 4734
 		include_spip('base/abstract_sql');
4735 4735
 		include_spip('base/connect_sql');
4736 4736
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4737
-			'*' . $champ_titre,
4737
+			'*'.$champ_titre,
4738 4738
 			$desc['table_sql'],
4739
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4739
+			id_table_objet($type_objet).' = '.intval($id_objet)
4740 4740
 		);
4741 4741
 
4742 4742
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4814,8 +4814,7 @@  discard block
 block discarded – undo
4814 4814
 	if (isset($ligne_sql['chapo'])) {
4815 4815
 		$chapo = $ligne_sql['chapo'];
4816 4816
 		$texte = strlen($descriptif) ?
4817
-			'' :
4818
-			"$chapo \n\n $texte";
4817
+			'' : "$chapo \n\n $texte";
4819 4818
 	}
4820 4819
 
4821 4820
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4882,7 +4881,7 @@  discard block
 block discarded – undo
4882 4881
 		return $texte;
4883 4882
 	}
4884 4883
 
4885
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4884
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4886 4885
 
4887 4886
 	// Fournir $connect et $Pile[0] au traitement si besoin
4888 4887
 	$Pile = [0 => $env];
@@ -4916,7 +4915,7 @@  discard block
 block discarded – undo
4916 4915
 	}
4917 4916
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4918 4917
 
4919
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4918
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4920 4919
 }
4921 4920
 
4922 4921
 
@@ -4935,10 +4934,10 @@  discard block
 block discarded – undo
4935 4934
 function wrap($texte, $wrap) {
4936 4935
 	$balises = extraire_balises($wrap);
4937 4936
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4938
-		$texte = $wrap . $texte;
4937
+		$texte = $wrap.$texte;
4939 4938
 		$regs = array_reverse($regs[1]);
4940
-		$wrap = '</' . implode('></', $regs) . '>';
4941
-		$texte = $texte . $wrap;
4939
+		$wrap = '</'.implode('></', $regs).'>';
4940
+		$texte = $texte.$wrap;
4942 4941
 	}
4943 4942
 
4944 4943
 	return $texte;
@@ -4969,7 +4968,7 @@  discard block
 block discarded – undo
4969 4968
 
4970 4969
 	// caster $u en array si besoin
4971 4970
 	if (is_object($u)) {
4972
-		$u = (array)$u;
4971
+		$u = (array) $u;
4973 4972
 	}
4974 4973
 
4975 4974
 	if (is_array($u)) {
@@ -4991,7 +4990,7 @@  discard block
 block discarded – undo
4991 4990
 		// sinon on passe a la ligne et on indente
4992 4991
 		$i_str = str_pad('', $indent, ' ');
4993 4992
 		foreach ($u as $k => $v) {
4994
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4993
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4995 4994
 		}
4996 4995
 
4997 4996
 		return $out;
@@ -5045,7 +5044,7 @@  discard block
 block discarded – undo
5045 5044
  * @return string
5046 5045
  */
5047 5046
 function objet_icone($objet, $taille = 24, $class = '') {
5048
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
5047
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
5049 5048
 	$icone = chemin_image($icone);
5050 5049
 	$balise_img = charger_filtre('balise_img');
5051 5050
 
@@ -5071,7 +5070,7 @@  discard block
 block discarded – undo
5071 5070
  */
5072 5071
 function objet_T($objet, $chaine, $args = [], $options = []) {
5073 5072
 	$chaine = explode(':', $chaine);
5074
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
5073
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
5075 5074
 		return $t;
5076 5075
 	}
5077 5076
 	$chaine = implode(':', $chaine);
@@ -5137,7 +5136,7 @@  discard block
 block discarded – undo
5137 5136
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
5138 5137
 
5139 5138
 	// calculer le nom de la css
5140
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5139
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5141 5140
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
5142 5141
 	$contexte_implicite = calculer_contexte_implicite();
5143 5142
 
@@ -5145,14 +5144,14 @@  discard block
 block discarded – undo
5145 5144
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5146 5145
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5147 5146
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5148
-		$hash = md5($contexte_implicite['host'] . '::' . $cache);
5147
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5149 5148
 	}
5150 5149
 	else {
5151 5150
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5152 5151
 		ksort($contexte);
5153
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
5152
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
5154 5153
 	}
5155
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5154
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5156 5155
 
5157 5156
 	// mettre a jour le fichier si il n'existe pas
5158 5157
 	// ou trop ancien
@@ -5160,8 +5159,8 @@  discard block
 block discarded – undo
5160 5159
 	// et recopie sur le fichier cible uniquement si il change
5161 5160
 	if (
5162 5161
 		!file_exists($filename)
5163
-		or !file_exists($filename . '.last')
5164
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified'])
5162
+		or !file_exists($filename.'.last')
5163
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified'])
5165 5164
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5166 5165
 	) {
5167 5166
 		$contenu = $cache['texte'];
@@ -5182,10 +5181,10 @@  discard block
 block discarded – undo
5182 5181
 			}
5183 5182
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5184 5183
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5185
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5184
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5186 5185
 		}
5187 5186
 		// et ecrire le fichier si il change
5188
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5187
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5189 5188
 	}
5190 5189
 
5191 5190
 	return timestamp($filename);
@@ -5411,7 +5410,7 @@  discard block
 block discarded – undo
5411 5410
 	if ($e > 0 and strlen($mid) > 8) {
5412 5411
 		$mid = '***...***';
5413 5412
 	}
5414
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5413
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5415 5414
 }
5416 5415
 
5417 5416
 
@@ -5473,7 +5472,7 @@  discard block
 block discarded – undo
5473 5472
 		case 'id':
5474 5473
 		case 'anchor':
5475 5474
 			if (preg_match(',^\d,', $texte)) {
5476
-				$texte = substr($type, 0, 1) . $texte;
5475
+				$texte = substr($type, 0, 1).$texte;
5477 5476
 			}
5478 5477
 	}
5479 5478
 
@@ -5483,9 +5482,9 @@  discard block
 block discarded – undo
5483 5482
 
5484 5483
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5485 5484
 		if (preg_match(',^\d,', $texte)) {
5486
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5485
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5487 5486
 		}
5488
-		$texte .= $separateur . md5($original);
5487
+		$texte .= $separateur.md5($original);
5489 5488
 		$texte = substr($texte, 0, $longueur_mini);
5490 5489
 	}
5491 5490
 
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	$s = '';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 			if (!$s) {
43 43
 				$s = random_int(0, mt_getrandmax());
44 44
 			}
45
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
45
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
46 46
 		}
47
-		$r = unpack('Cr', pack('H2', $s . $s));
47
+		$r = unpack('Cr', pack('H2', $s.$s));
48 48
 		$x = $r['r'] & 63;
49 49
 		if ($x < 10) {
50 50
 			$x = chr($x + 48);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	static $seeded;
83 83
 
84 84
 	if (!$seeded) {
85
-		$seed = (int)round(((float)microtime() + 1) * time());
85
+		$seed = (int) round(((float) microtime() + 1) * time());
86 86
 		mt_srand($seed);
87 87
 		$seeded = true;
88 88
 	}
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
169 169
 		}
170 170
 	} else {
171
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur));
171
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur));
172 172
 		if (!$low_sec) {
173 173
 			$low_sec = creer_pass_aleatoire();
174
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur));
174
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur));
175 175
 		}
176 176
 	}
177 177
 
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 	foreach ($args as $val => $var) {
196 196
 		if ($var) {
197 197
 			if ($val <> 'statut') {
198
-				$a .= ':' . $val . '-' . $var;
198
+				$a .= ':'.$val.'-'.$var;
199 199
 			}
200
-			$b .= $val . '=' . $var . '&';
200
+			$b .= $val.'='.$var.'&';
201 201
 		}
202 202
 	}
203 203
 	$a = substr($a, 1);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
  *     Clé
228 228
  **/
229 229
 function afficher_low_sec($id_auteur, $action = '') {
230
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
230
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
231 231
 }
232 232
 
233 233
 /**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	if (!$id_auteur = intval($id_auteur)) {
259 259
 		return;
260 260
 	} // jamais trop prudent ;)
261
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur));
261
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur));
262 262
 }
263 263
 
264 264
 /**
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 function initialiser_sel() {
270 270
 	if (!isset($GLOBALS['htsalt'])) {
271 271
 		if (CRYPT_MD5) {
272
-			$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
272
+			$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
273 273
 		} else {
274 274
 			$GLOBALS['htsalt'] = '';
275 275
 		}
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
  *     - void sinon.
292 292
  **/
293 293
 function ecrire_acces() {
294
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
295
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
294
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
295
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
296 296
 
297 297
 	// Cette variable de configuration peut etre posee par un plugin
298 298
 	// par exemple acces_restreint ;
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		and !@file_exists($htaccess)
304 304
 	) {
305 305
 		spip_unlink($htpasswd);
306
-		spip_unlink($htpasswd . '-admin');
306
+		spip_unlink($htpasswd.'-admin');
307 307
 		return;
308 308
 	}
309 309
 
@@ -332,10 +332,10 @@  discard block
 block discarded – undo
332 332
 	$pwd_all = ''; // login:htpass pour tous
333 333
 	$pwd_admin = ''; // login:htpass pour les admins
334 334
 
335
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
335
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
336 336
 	while ($row = sql_fetch($res)) {
337 337
 		if (strlen($row['login']) and strlen($row['htpass'])) {
338
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
338
+			$ligne = $row['login'].':'.$row['htpass']."\n";
339 339
 			$pwd_all .= $ligne;
340 340
 			if ($row['statut'] == '0minirezo') {
341 341
 				$pwd_admin .= $ligne;
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
  * @return boolean
381 381
  */
382 382
 function verifier_htaccess($rep, $force = false) {
383
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
383
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
384 384
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
385 385
 		return true;
386 386
 	}
@@ -409,17 +409,17 @@  discard block
 block discarded – undo
409 409
 		fputs($ht, $deny);
410 410
 		fclose($ht);
411 411
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
412
-		$t = rtrim($rep, '/') . '/.ok';
412
+		$t = rtrim($rep, '/').'/.ok';
413 413
 		if ($ht = @fopen($t, 'w')) {
414 414
 			@fclose($ht);
415 415
 			include_spip('inc/distant');
416 416
 			$t = substr($t, strlen(_DIR_RACINE));
417
-			$t = url_de_base() . $t;
417
+			$t = url_de_base().$t;
418 418
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
419 419
 			$ht = ($ht['status'] ?? null) === 403;
420 420
 		}
421 421
 	}
422
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
422
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
423 423
 
424 424
 	return $ht;
425 425
 }
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
446 446
 	$dirs[] = ['extension' => 'distant'];
447 447
 	foreach ($dirs as $e) {
448
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
448
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
449 449
 			if ($f) {
450 450
 				verifier_htaccess($dir);
451 451
 			} else {
452
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
452
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
453 453
 			}
454 454
 		}
455 455
 	}
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
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 // mais apres la fonction autoriser()
116 116
 if ($f = find_in_path('mes_fonctions.php')) {
117 117
 	global $dossier_squelettes;
118
-	include_once(_ROOT_CWD . $f);
118
+	include_once(_ROOT_CWD.$f);
119 119
 }
120 120
 
121 121
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		$qui = $GLOBALS['visiteur_session'] ?: [];
158 158
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
159 159
 	} elseif (is_numeric($qui)) {
160
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
160
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
161 161
 	}
162 162
 
163 163
 	// Admins restreints, on construit ici (pas generique mais...)
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	}
168 168
 
169 169
 	spip_log(
170
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
171
-		'autoriser' . _LOG_DEBUG
170
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
171
+		'autoriser'._LOG_DEBUG
172 172
 	);
173 173
 
174 174
 	// passer par objet_type pour avoir les alias
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
185 185
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
186 186
 	) {
187
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
187
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
188 188
 		return true;
189 189
 	}
190 190
 
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
194 194
 	$fonctions = $type
195 195
 		? [
196
-			'autoriser_' . $type . '_' . $faire,
197
-			'autoriser_' . $type . '_' . $faire . '_dist',
198
-			'autoriser_' . $type,
199
-			'autoriser_' . $type . '_dist',
200
-			'autoriser_' . $faire,
201
-			'autoriser_' . $faire . '_dist',
196
+			'autoriser_'.$type.'_'.$faire,
197
+			'autoriser_'.$type.'_'.$faire.'_dist',
198
+			'autoriser_'.$type,
199
+			'autoriser_'.$type.'_dist',
200
+			'autoriser_'.$faire,
201
+			'autoriser_'.$faire.'_dist',
202 202
 			'autoriser_defaut',
203 203
 			'autoriser_defaut_dist'
204 204
 		]
205 205
 		: [
206
-			'autoriser_' . $faire,
207
-			'autoriser_' . $faire . '_dist',
206
+			'autoriser_'.$faire,
207
+			'autoriser_'.$faire.'_dist',
208 208
 			'autoriser_defaut',
209 209
 			'autoriser_defaut_dist'
210 210
 		];
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
 	spip_log(
220
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
221
-		'autoriser' . _LOG_DEBUG
220
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
221
+		'autoriser'._LOG_DEBUG
222 222
 	);
223 223
 
224 224
 	return $a;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 function autoriser_previsualiser_dist(string $faire, string $type, int $id, array $qui, array $opt): bool {
354 354
 
355 355
 	// Le visiteur a-t-il un statut prevu par la config ?
356
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
356
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
357 357
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
358 358
 	}
359 359
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 				} // pas de champ passe a la demande => NIET
411 411
 				$previsu = explode(',', $c['previsu']);
412 412
 				// regarder si ce statut est autorise pour l'auteur
413
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
413
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
414 414
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
415 415
 					// sinon l’auteur en session
416 416
 					include_spip('inc/securiser_action');
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
 
425 425
 					if (!$id_auteur) {
426 426
 						return false;
427
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
427
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
428 428
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
429 429
 					} elseif (
430 430
 						!sql_countsel(
431 431
 							'spip_auteurs_liens',
432
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
432
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
433 433
 						)
434 434
 					) {
435 435
 						return false;
@@ -472,16 +472,16 @@  discard block
 block discarded – undo
472 472
 			// multilinguisme par secteur et objet rattaché à une rubrique
473 473
 			$primary = id_table_objet($type);
474 474
 			if ($table != 'spip_rubriques') {
475
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
475
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
476 476
 			} else {
477 477
 				$id_rubrique = $id;
478 478
 			}
479
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
479
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
480 480
 			if (!$id_secteur > 0) {
481 481
 				$id_secteur = $id_rubrique;
482 482
 			}
483
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
484
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
483
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
484
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
485 485
 			if ($langue_secteur != $langue_objet) {
486 486
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
487 487
 				return true;
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
490 490
 				return false;
491 491
 			} else {
492
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
492
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
493 493
 				if ($id_parent != 0) {
494 494
 					// sous-rubriques : pas de choix de langue
495 495
 					return false;
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
 	if (!isset($opt['statut'])) {
539 539
 		if (isset($desc['field']['statut'])) {
540
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
540
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
541 541
 		} else {
542 542
 			$statut = 'publie';
543 543
 		} // pas de statut => publie
@@ -697,11 +697,11 @@  discard block
 block discarded – undo
697 697
 		return false;
698 698
 	}
699 699
 
700
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
700
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
701 701
 		return false;
702 702
 	}
703 703
 
704
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
704
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
705 705
 		return false;
706 706
 	}
707 707
 
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 	if (!$id) {
737 737
 		return false;
738 738
 	}
739
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
739
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
740 740
 
741 741
 	return
742 742
 		$r
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 				(!isset($opt['statut']) or $opt['statut'] !== 'publie')
748 748
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
749 749
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
750
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
750
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
751 751
 			)
752 752
 		);
753 753
 }
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 		if (!$id) {
802 802
 			return false;
803 803
 		}
804
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
804
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
805 805
 	}
806 806
 
807 807
 	return
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 		or
813 813
 		($id
814 814
 			and $qui['id_auteur']
815
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
815
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
816 816
 }
817 817
 
818 818
 
@@ -831,8 +831,8 @@  discard block
 block discarded – undo
831 831
 function autoriser_voir_dist(string $faire, string $type, int $id, array $qui, array $opt): bool {
832 832
 	# securite, mais on aurait pas du arriver ici !
833 833
 	if (
834
-		function_exists($f = 'autoriser_' . $type . '_voir')
835
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
834
+		function_exists($f = 'autoriser_'.$type.'_voir')
835
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
836 836
 	) {
837 837
 		return $f($faire, $type, $id, $qui, $opt);
838 838
 	}
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 	$n = sql_fetsel(
954 954
 		'A.id_article',
955 955
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
956
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
956
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
957 957
 	);
958 958
 
959 959
 	return $n ? true : false;
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 		and $r = sql_allfetsel(
1156 1156
 			'id_objet',
1157 1157
 			'spip_auteurs_liens',
1158
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1158
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1159 1159
 		)
1160 1160
 		and is_countable($r) ? count($r) : 0
1161 1161
 	) {
@@ -1771,8 +1771,8 @@  discard block
 block discarded – undo
1771 1771
 function auteurs_objet($objet, $id_objet, $cond = '') {
1772 1772
 	$objet = objet_type($objet);
1773 1773
 	$where = [
1774
-		'objet=' . sql_quote($objet),
1775
-		'id_objet=' . intval($id_objet)
1774
+		'objet='.sql_quote($objet),
1775
+		'id_objet='.intval($id_objet)
1776 1776
 	];
1777 1777
 	if (!empty($cond)) {
1778 1778
 		if (is_array($cond)) {
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 	return sql_allfetsel(
1808 1808
 		'id_auteur',
1809 1809
 		'spip_auteurs_liens',
1810
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1810
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1811 1811
 	);
1812 1812
 }
1813 1813
 
Please login to merge, or discard this patch.
ecrire/inc/session.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	spip_log("supprimer sessions auteur $id_auteur", 'session');
83 83
 	if ($toutes or $id_auteur !== $GLOBALS['visiteur_session']['id_auteur']) {
84 84
 		if ($dir = opendir(_DIR_SESSIONS)) {
85
-			$t = $_SERVER['REQUEST_TIME']  - (4 * _RENOUVELLE_ALEA); // 48h par defaut
86
-			$t_short = $_SERVER['REQUEST_TIME']  - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
85
+			$t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut
86
+			$t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
87 87
 			$t = time() - (4 * _RENOUVELLE_ALEA);
88 88
 			while (($f = readdir($dir)) !== false) {
89 89
 				$nb_files++;
90 90
 				if (preg_match(',^[^\d-]*(-?\d+)_\w{32}\.php[3]?$,', $f, $regs)) {
91
-					$f = _DIR_SESSIONS . $f;
91
+					$f = _DIR_SESSIONS.$f;
92 92
 					if (($actives and $regs[1] == $id_auteur) or ($t > filemtime($f))) {
93 93
 						spip_unlink($f);
94 94
 					}
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 
172 172
 	if (
173 173
 		!isset($_COOKIE['spip_session'])
174
-		or !preg_match(',^' . $id_auteur . '_,', $_COOKIE['spip_session'])
174
+		or !preg_match(',^'.$id_auteur.'_,', $_COOKIE['spip_session'])
175 175
 	) {
176
-		$_COOKIE['spip_session'] = $id_auteur . '_' . md5(uniqid(random_int(0, mt_getrandmax()), true));
176
+		$_COOKIE['spip_session'] = $id_auteur.'_'.md5(uniqid(random_int(0, mt_getrandmax()), true));
177 177
 	}
178 178
 
179 179
 	// Maintenant on sait qu'on a des choses à écrire
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	} else {
207 207
 		$fichier_session = fichier_session('alea_ephemere');
208 208
 		if (!ecrire_fichier_session($fichier_session, $auteur)) {
209
-			spip_log('Echec ecriture fichier session ' . $fichier_session, 'session' . _LOG_HS);
209
+			spip_log('Echec ecriture fichier session '.$fichier_session, 'session'._LOG_HS);
210 210
 			include_spip('inc/minipres');
211 211
 			echo minipres();
212 212
 			exit;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		include_spip('inc/autoriser');
230 230
 	}
231 231
 	if (autoriser('ecrire', '', '', $auteur) and _DUREE_COOKIE_ADMIN) {
232
-		spip_setcookie('spip_admin', '@' . ($auteur['email'] ?: $auteur['login']), [
232
+		spip_setcookie('spip_admin', '@'.($auteur['email'] ?: $auteur['login']), [
233 233
 			'expires' => time() + max(_DUREE_COOKIE_ADMIN, $duree)
234 234
 		]);
235 235
 	} // sinon le supprimer ...
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 			$coef = 20;
271 271
 		}
272 272
 	}
273
-	return (int)(_RENOUVELLE_ALEA * $coef);
273
+	return (int) (_RENOUVELLE_ALEA * $coef);
274 274
 }
275 275
 
276 276
 /**
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 			// Renouveler la session avec l'alea courant
320 320
 			include($fichier_session);
321
-			spip_log('renouvelle session ' . $GLOBALS['visiteur_session']['id_auteur'], 'session');
321
+			spip_log('renouvelle session '.$GLOBALS['visiteur_session']['id_auteur'], 'session');
322 322
 			spip_unlink($fichier_session);
323 323
 			ajouter_session($GLOBALS['visiteur_session']);
324 324
 		}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		}
351 351
 	} else {
352 352
 		if ($change) {
353
-			spip_log("rejoue session $fichier_session " . $_COOKIE['spip_session'], 'session');
353
+			spip_log("rejoue session $fichier_session ".$_COOKIE['spip_session'], 'session');
354 354
 			if ($fichier_session) {
355 355
 				spip_unlink($fichier_session);
356 356
 			}
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	}
568 568
 
569 569
 	// liste des sessions
570
-	$sessions = preg_files(_DIR_SESSIONS, '/' . $id_auteur . '_.*\.php$');
570
+	$sessions = preg_files(_DIR_SESSIONS, '/'.$id_auteur.'_.*\.php$');
571 571
 
572 572
 	// si on en a plus que la limite, supprimer les plus vieilles
573 573
 	// si ce ne sont pas des sessions anonymes car elles sont alors chacune differentes
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	$auteur = preparer_ecriture_session($auteur);
649 649
 
650 650
 	// enregistrer les autres donnees du visiteur
651
-	$texte = '<' . "?php\n";
651
+	$texte = '<'."?php\n";
652 652
 	foreach ($auteur as $var => $val) {
653
-		$texte .= '$GLOBALS[\'visiteur_session\'][' . var_export($var, true) . '] = '
654
-			. var_export($val, true) . ";\n";
653
+		$texte .= '$GLOBALS[\'visiteur_session\']['.var_export($var, true).'] = '
654
+			. var_export($val, true).";\n";
655 655
 	}
656
-	$texte .= '?' . ">\n";
656
+	$texte .= '?'.">\n";
657 657
 
658 658
 	return ecrire_fichier($fichier, $texte);
659 659
 }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 		$repertoire = sous_repertoire(_DIR_SESSIONS, '', false, $tantpis);
684 684
 		$c = $_COOKIE['spip_session'];
685 685
 
686
-		return $repertoire . intval($c) . '_' . md5($c . ' ' . $GLOBALS['meta'][$alea]) . '.php';
686
+		return $repertoire.intval($c).'_'.md5($c.' '.$GLOBALS['meta'][$alea]).'.php';
687 687
 	}
688 688
 }
689 689
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
  * @return string
702 702
  */
703 703
 function rejouer_session() {
704
-	return '<img src="' . generer_url_action('cookie', 'change_session=oui', true) . '" width="0" height="0" alt="" />';
704
+	return '<img src="'.generer_url_action('cookie', 'change_session=oui', true).'" width="0" height="0" alt="" />';
705 705
 }
706 706
 
707 707
 
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 		return $res;
717 717
 	}
718 718
 
719
-	return $res = md5($GLOBALS['ip'] . ($_SERVER['HTTP_USER_AGENT'] ?? ''));
719
+	return $res = md5($GLOBALS['ip'].($_SERVER['HTTP_USER_AGENT'] ?? ''));
720 720
 }
721 721
 
722 722
 
Please login to merge, or discard this patch.
ecrire/base/delete_all.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,5 +51,5 @@
 block discarded – undo
51 51
 	}
52 52
 	$d = is_countable($delete) ? count($delete) : 0;
53 53
 	$r = count($res);
54
-	spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE);
54
+	spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE);
55 55
 }
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$infos['url_voir'] = $infos['type'];
704 704
 	}
705 705
 	if (!isset($infos['url_edit'])) {
706
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
706
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
707 707
 	}
708 708
 	if (!isset($infos['icone_objet'])) {
709 709
 		$infos['icone_objet'] = $infos['type'];
@@ -715,48 +715,48 @@  discard block
 block discarded – undo
715 715
 		$infos['texte_retour'] = 'icone_retour';
716 716
 	}
717 717
 	if (!isset($infos['texte_modifier'])) {
718
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
718
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
719 719
 	}
720 720
 	if (!isset($infos['texte_creer'])) {
721
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
721
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer_associer'])) {
724
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
724
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_ajouter'])) {
727 727
 		// Ajouter un X
728
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
728
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
729 729
 	}
730 730
 	if (!isset($infos['texte_objets'])) {
731
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
731
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objet'])) {
734
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
734
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
735 735
 	}
736 736
 	if (!isset($infos['texte_logo_objet'])) {
737 737
 		// objet:titre_logo_objet "Logo de ce X"
738
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
738
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
739 739
 	}
740 740
 	if (!isset($infos['texte_langue_objet'])) {
741 741
 		// objet:texte_langue_objet "Langue de ce X"
742
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
742
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
743 743
 	}
744 744
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
745 745
 		// "Ce X est une traduction du X numéro :"
746
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
746
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
747 747
 	}
748 748
 
749 749
 	// objet:info_aucun_objet
750 750
 	if (!isset($infos['info_aucun_objet'])) {
751
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
751
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
752 752
 	}
753 753
 	// objet:info_1_objet
754 754
 	if (!isset($infos['info_1_objet'])) {
755
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
755
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
756 756
 	}
757 757
 	// objet:info_nb_objets
758 758
 	if (!isset($infos['info_nb_objets'])) {
759
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
759
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
760 760
 	}
761 761
 
762 762
 	if (!isset($infos['champs_editables'])) {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 		}
957 957
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
958 958
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
959
-		$spip = $connexion['prefixe'] . '_';
959
+		$spip = $connexion['prefixe'].'_';
960 960
 		foreach ($ts as $t) {
961 961
 			$t = substr($t, strlen($spip));
962 962
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1025,10 +1025,10 @@  discard block
 block discarded – undo
1025 1025
 	if ($serveur !== false) {
1026 1026
 		$t = lister_tables_spip($serveur);
1027 1027
 		$trouver_table = charger_fonction('trouver_table', 'base');
1028
-		$typetrim = rtrim($type, 's') . 's';
1028
+		$typetrim = rtrim($type, 's').'s';
1029 1029
 		if (
1030 1030
 			(isset($t[$typetrim]) or in_array($typetrim, $t))
1031
-			and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1031
+			and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1032 1032
 		) {
1033 1033
 			return $desc['id_table'];
1034 1034
 		} elseif (
@@ -1038,11 +1038,11 @@  discard block
 block discarded – undo
1038 1038
 			return $desc['id_table'];
1039 1039
 		}
1040 1040
 
1041
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1041
+		spip_log('table_objet('.$type.') calculee sans verification');
1042 1042
 		#spip_log(debug_backtrace(),'db');
1043 1043
 	}
1044 1044
 
1045
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1045
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1046 1046
 }
1047 1047
 
1048 1048
 /**
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1227 1227
 	// voir si une fonction est definie pour faire le boulot
1228 1228
 	// elle a la priorite dans ce cas
1229
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1229
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1230 1230
 		return $f($objet, $id_objet, $serveur);
1231 1231
 	}
1232 1232
 
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
 		$boucle->sql_serveur = $serveur;
1249 1249
 		$boucle->select[] = $id_table_objet;
1250 1250
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1251
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet);
1251
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet);
1252 1252
 
1253 1253
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1254 1254
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 						? "{$parent_methode['source_champ']} = $id_objet"
1376 1376
 						: "${cle_objet} = $id_objet";
1377 1377
 					if (isset($parent_methode['source_champ_type'])) {
1378
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1378
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1379 1379
 					}
1380 1380
 					// -- Condition supplémentaire sur la détection du parent
1381 1381
 					if (isset($parent_methode['table_condition'])) {
@@ -1499,11 +1499,11 @@  discard block
 block discarded – undo
1499 1499
 			$where = [];
1500 1500
 			// -- L'identifiant du parent
1501 1501
 			if (isset($_methode_parent['champ'])) {
1502
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1502
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1503 1503
 			}
1504 1504
 			// -- Si le parent est variable
1505 1505
 			if (isset($_methode_parent['champ_type'])) {
1506
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1506
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1507 1507
 			}
1508 1508
 
1509 1509
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.
ecrire/base/abstract_sql.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	if ($compil_info) {
55 55
 		$contexte_compil = [
56
-			$trace[0]['file'],// sourcefile
56
+			$trace[0]['file'], // sourcefile
57 57
 			'', //nom
58
-			(isset($trace[1]) ? $trace[1]['function'] . "(){\n" : '')
59
-			. $trace[0]['function'] . '();'
58
+			(isset($trace[1]) ? $trace[1]['function']."(){\n" : '')
59
+			. $trace[0]['function'].'();'
60 60
 			. (isset($trace[1]) ? "\n}" : ''), //id_boucle
61 61
 			$trace[0]['line'], // ligne
62 62
 			$GLOBALS['spip_lang'], // lang
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		return $contexte_compil;
66 66
 	}
67 67
 
68
-	$message = count($trace) ? $trace[0]['file'] . ' L' . $trace[0]['line'] : '';
68
+	$message = count($trace) ? $trace[0]['file'].' L'.$trace[0]['line'] : '';
69 69
 	$f = [];
70 70
 	while (count($trace) and $t = array_shift($trace)) {
71 71
 		if (in_array($t['function'], ['include_once', 'include_spip', 'find_in_path'])) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$f[] = $t['function'];
75 75
 	}
76 76
 	if (count($f)) {
77
-		$message .= ' [' . implode('(),', $f) . '()]';
77
+		$message .= ' ['.implode('(),', $f).'()]';
78 78
 	}
79 79
 
80 80
 	return $message;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		// le debug, c'est pour ce qui a ete produit par le compilateur
268 268
 		if (isset($GLOBALS['debug']['aucasou'])) {
269 269
 			[$table, $id, ] = $GLOBALS['debug']['aucasou'];
270
-			$nom = $GLOBALS['debug_objets']['courant'] . $id;
270
+			$nom = $GLOBALS['debug_objets']['courant'].$id;
271 271
 			$GLOBALS['debug_objets']['requete'][$nom] = $query;
272 272
 		}
273 273
 		$res = $f($select, $from, $where, $groupby, $orderby, $limit, $having, $serveur, true);
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
 	// la globale n'est remplie qu'apres l'appel de sql_serveur.
1145 1145
 	if ($spip == null) {
1146 1146
 		$connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1147
-		$spip = $connexion['prefixe'] . '\_%';
1147
+		$spip = $connexion['prefixe'].'\_%';
1148 1148
 	}
1149 1149
 
1150 1150
 	return $f($spip, $serveur, $option !== false);
@@ -2302,9 +2302,9 @@  discard block
 block discarded – undo
2302 2302
 		$jour = 0;
2303 2303
 	}
2304 2304
 
2305
-	return sprintf('%04u', $annee) . '-' . sprintf('%02u', $mois) . '-'
2306
-	. sprintf('%02u', $jour) . ' ' . sprintf('%02u', $h) . ':'
2307
-	. sprintf('%02u', $m) . ':' . sprintf('%02u', $s);
2305
+	return sprintf('%04u', $annee).'-'.sprintf('%02u', $mois).'-'
2306
+	. sprintf('%02u', $jour).' '.sprintf('%02u', $h).':'
2307
+	. sprintf('%02u', $m).':'.sprintf('%02u', $s);
2308 2308
 }
2309 2309
 
2310 2310
 
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
  */
2367 2367
 function prefixer_table_spip($table, $prefixe) {
2368 2368
 	if ($prefixe) {
2369
-		$table = preg_replace('/^spip_/', $prefixe . '_', $table);
2369
+		$table = preg_replace('/^spip_/', $prefixe.'_', $table);
2370 2370
 	}
2371 2371
 	return $table;
2372 2372
 }
Please login to merge, or discard this patch.