Completed
Push — master ( 2d11dc...df46b5 )
by cam
01:03
created
ecrire/public/fonctions.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$texte = $intro;
85 85
 	} else {
86 86
 		if (
87
-			strpos("\n" . $texte, "\n|") === false
87
+			strpos("\n".$texte, "\n|") === false
88 88
 			and strlen($texte) > 2.5 * $longueur
89 89
 		) {
90 90
 			if (strpos($texte, '<multi') !== false) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	if ($pas < 1) {
169 169
 		return '';
170 170
 	}
171
-	$ancre = 'pagination' . $nom; // #pagination_articles
172
-	$debut = 'debut' . $nom; // 'debut_articles'
171
+	$ancre = 'pagination'.$nom; // #pagination_articles
172
+	$debut = 'debut'.$nom; // 'debut_articles'
173 173
 
174 174
 	// n'afficher l'ancre qu'une fois
175 175
 	if (!isset($ancres[$ancre])) {
176
-		$bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>";
176
+		$bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>";
177 177
 	} else {
178 178
 		$bloc_ancre = '';
179 179
 	}
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 
206 206
 	if ($modele) {
207 207
 		$pagination['type_pagination'] = $modele;
208
-		if (trouver_fond('pagination_' . $modele, 'modeles')) {
209
-			$modele = '_' . $modele;
208
+		if (trouver_fond('pagination_'.$modele, 'modeles')) {
209
+			$modele = '_'.$modele;
210 210
 		}
211 211
 		else {
212 212
 			$modele = '';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 function lister_objets_avec_logos($type) {
292 292
 
293 293
 	$objet = objet_type($type);
294
-	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet));
294
+	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet));
295 295
 	if ($ids) {
296 296
 		$ids = array_column($ids, 'id_objet');
297 297
 		return implode(',', $ids);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 
485 485
 	// Classes : on indique le sens de tri et l'item exposé
486 486
 	if (!$is_sens_fixe) {
487
-		$classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc');
487
+		$classe .= ' item-tri item-tri_'.($tri_sens_actuel === 1 ? 'asc' : 'desc');
488 488
 	}
489 489
 	if ($champ_ou_sens === $tri_champ) {
490 490
 		$classe .= ' item-tri_actif';
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
  */
524 524
 function tri_champ_order($t, $from = null, $senstri = '') {
525 525
 	if (strncmp($t, 'multi ', 6) == 0) {
526
-		return 'multi' . $senstri;
526
+		return 'multi'.$senstri;
527 527
 	}
528 528
 
529 529
 	$champ = $t;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		case 'sinum ':
558 558
 			return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}";
559 559
 		default:
560
-			return $champ . $senstri;
560
+			return $champ.$senstri;
561 561
 	}
562 562
 }
563 563
 
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +24 added lines, -25 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
 	}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	if (
221 221
 		$config_fonc
222 222
 		and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
223
-		and $config_fonc !== $table_objet . '_edit_config'
223
+		and $config_fonc !== $table_objet.'_edit_config'
224 224
 	) {
225 225
 		if (
226 226
 			$args = test_formulaire_inclus_par_modele()
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 	// Appel direct dans un squelette
236 236
 	if (!$row) {
237 237
 		if (!$new or $lier_trad) {
238
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
238
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
239 239
 				$row = $select($id, $id_parent, $lier_trad);
240 240
 				// si on a une fonction precharger, elle pu faire un reglage de langue
241 241
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
242 242
 			} else {
243
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
243
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
244 244
 			}
245 245
 			if (!$new) {
246 246
 				$md5 = controles_md5($row ?: []);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	if ($config_fonc) {
291 291
 		$contexte['config'] = $config = $config_fonc($contexte);
292 292
 		if (!$lang_default) {
293
-			$lang_default = $config['langue'] ?? session_get('lang') ;
293
+			$lang_default = $config['langue'] ?? session_get('lang');
294 294
 		}
295 295
 	}
296 296
 	$config = $config + [
@@ -314,13 +314,12 @@  discard block
 block discarded – undo
314 314
 		unset($contexte['lang']);
315 315
 	}
316 316
 
317
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
318
-		(!$lier_trad ? '' :
319
-			("\n<input type='hidden' name='lier_trad' value='" .
320
-				$lier_trad .
321
-				"' />" .
322
-				"\n<input type='hidden' name='changer_lang' value='" .
323
-				$lang_default .
317
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
318
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
319
+				$lier_trad.
320
+				"' />".
321
+				"\n<input type='hidden' name='changer_lang' value='".
322
+				$lang_default.
324 323
 				"' />"))
325 324
 		. $hidden
326 325
 		. ($md5 ?? '');
@@ -360,14 +359,14 @@  discard block
 block discarded – undo
360 359
 	$aider = charger_fonction('aider', 'inc');
361 360
 	if (strlen($texte) > 28 * 1024) {
362 361
 		$texte = str_replace("\r\n", "\n", $texte);
363
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
362
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
364 363
 		if ($pos > 0 and $pos < 32 * 1024) {
365
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
364
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
366 365
 			$suite = substr($texte, $pos + 2);
367 366
 		} else {
368
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
367
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
369 368
 			if (!($pos > 0 and $pos < 32 * 1024)) {
370
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
369
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
371 370
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
372 371
 			} else {
373 372
 				$decalage = 1;
@@ -398,13 +397,13 @@  discard block
 block discarded – undo
398 397
 	}
399 398
 
400 399
 	include_spip('inc/barre');
401
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
400
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
402 401
 	$nombre = 0;
403 402
 
404 403
 	while (strlen($texte) > 29 * 1024) {
405 404
 		$nombre++;
406 405
 		[$texte1, $texte] = coupe_trop_long($texte);
407
-		$textes_supplement .= '<br />' .
406
+		$textes_supplement .= '<br />'.
408 407
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
409 408
 	}
410 409
 
@@ -487,7 +486,7 @@  discard block
 block discarded – undo
487 486
 	$ctr = [];
488 487
 	foreach ($data as $key => $val) {
489 488
 		$m = md5($val ?? '');
490
-		$k = $prefixe . $key;
489
+		$k = $prefixe.$key;
491 490
 
492 491
 		switch ($format) {
493 492
 			case 'html':
@@ -500,7 +499,7 @@  discard block
 block discarded – undo
500 499
 	}
501 500
 
502 501
 	if ($format === 'html') {
503
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
502
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
504 503
 	} else {
505 504
 		return $ctr;
506 505
 	}
@@ -652,7 +651,7 @@  discard block
 block discarded – undo
652 651
 	// On elimine les donnees non modifiees par le formulaire (mais
653 652
 	// potentiellement modifiees entre temps par un autre utilisateur)
654 653
 	foreach ($champs as $key => $val) {
655
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
654
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
656 655
 			if (is_scalar($val) and $m == md5($val)) {
657 656
 				unset($champs[$key]);
658 657
 			}
@@ -681,7 +680,7 @@  discard block
 block discarded – undo
681 680
 	// de conflit.
682 681
 	$ctrh = $ctrq = $conflits = [];
683 682
 	foreach (array_keys($champs) as $key) {
684
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
683
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
685 684
 			$ctrh[$key] = $m;
686 685
 			$ctrq[] = $key;
687 686
 		}
@@ -715,8 +714,8 @@  discard block
 block discarded – undo
715 714
  */
716 715
 function display_conflit_champ($x) {
717 716
 	if (strstr($x, "\n") or strlen($x) > 80) {
718
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
717
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
719 718
 	} else {
720
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
719
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
721 720
 	}
722 721
 }
Please login to merge, or discard this patch.
prive/formulaires/editer_liens.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	// L'éditabilité :) est définie par un test permanent (par exemple "associermots") ET le 4ème argument
107 107
 	include_spip('inc/autoriser');
108
-	$editable = ($editable and autoriser('associer' . $table_source, $objet, $id_objet)
108
+	$editable = ($editable and autoriser('associer'.$table_source, $objet, $id_objet)
109 109
 		and autoriser('modifier', $objet, $id_objet));
110 110
 
111 111
 	if (
@@ -119,15 +119,15 @@  discard block
 block discarded – undo
119 119
 
120 120
 	// squelettes de vue et de d'association
121 121
 	// ils sont différents si des rôles sont définis.
122
-	$skel_vue = $table_source . '_lies';
123
-	$skel_ajout = $table_source . '_associer';
122
+	$skel_vue = $table_source.'_lies';
123
+	$skel_ajout = $table_source.'_associer';
124 124
 
125 125
 	// description des roles
126 126
 	include_spip('inc/roles');
127 127
 	if ($roles = roles_presents($objet_source, $objet)) {
128 128
 		// on demande de nouveaux squelettes en conséquence
129
-		$skel_vue = $table_source . '_roles_lies';
130
-		$skel_ajout = $table_source . '_roles_associer';
129
+		$skel_vue = $table_source.'_roles_lies';
130
+		$skel_ajout = $table_source.'_roles_associer';
131 131
 	}
132 132
 
133 133
 	$oups = '';
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 function lien_retrouver_qualif($objet_lien, $lien) {
427 427
 	// un role est défini dans la liaison
428 428
 	$defs = explode('-', $lien);
429
-	[$objet1, , $objet2, , $role] = array_pad($defs, 5, null);
429
+	[$objet1,, $objet2,, $role] = array_pad($defs, 5, null);
430 430
 	if ($objet_lien == $objet1) {
431 431
 		$colonne_role = roles_colonne($objet1, $objet2);
432 432
 	} else {
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
 		if (is_callable($f)) {
102 102
 			return $f;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	// affichage "GIT [master: abcdef]"
235 235
 	$commit = $desc['commit_short'] ?? $desc['commit'];
236 236
 	if ($desc['branch']) {
237
-		$commit = $desc['branch'] . ': ' . $commit;
237
+		$commit = $desc['branch'].': '.$commit;
238 238
 	}
239 239
 	return "{$desc['vcs']} [$commit]";
240 240
 }
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 	}
254 254
 
255 255
 	// version installee par GIT
256
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
256
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
257 257
 		$currentHead = trim(substr($c, 4));
258
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
258
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
259 259
 			return [
260 260
 				'vcs' => 'GIT',
261 261
 				'branch' => basename($currentHead),
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
 		$dir = '.';
283 283
 	}
284 284
 	// version installee par SVN
285
-	if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) {
286
-		$db = new SQLite3($dir . '/.svn/wc.db');
285
+	if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) {
286
+		$db = new SQLite3($dir.'/.svn/wc.db');
287 287
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
288 288
 		if ($result) {
289 289
 			$row = $result->fetchArray();
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 
302 302
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
303 303
 // et laisser passer les fonctions personnelles baptisees image_...
304
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
305
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
306
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
307
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
308
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
309
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
304
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
305
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
306
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
307
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
308
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
309
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
310 310
 
311 311
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
312 312
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
  */
466 466
 function filtre_debug($val, $key = null) {
467 467
 	$debug = (
468
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
469
-		) . var_export($val, true);
468
+		is_null($key) ? '' : (var_export($key, true).' = ')
469
+		).var_export($val, true);
470 470
 
471 471
 	include_spip('inc/autoriser');
472 472
 	if (autoriser('webmestre')) {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 		$is_file = false;
523 523
 	}
524 524
 	if ($is_file) {
525
-		$is_local_file = function ($path) {
525
+		$is_local_file = function($path) {
526 526
 			if (strpos($path, '?') !== false) {
527 527
 				$path = supprimer_timestamp($path);
528 528
 				// remove ?24px added by find_in_theme on .svg files
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 					if ($mouseover = extraire_attribut($reduit, 'onmouseover')) {
572 572
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
573 573
 							$srcover = $match[1];
574
-							$srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args);
574
+							$srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args);
575 575
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
576 576
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
577 577
 						}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 	// " -> &quot; et tout ce genre de choses
973 973
 	$u = $GLOBALS['meta']['pcre_u'];
974 974
 	$texte = str_replace('&nbsp;', ' ', $texte);
975
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
975
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
976 976
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
977 977
 	$texte = entites_html($texte, false, false);
978 978
 	// mais bien echapper les double quotes !
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
  **/
1033 1033
 function supprimer_numero($texte) {
1034 1034
 	return preg_replace(
1035
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1035
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1036 1036
 		'',
1037 1037
 		$texte
1038 1038
 	);
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 function recuperer_numero($texte) {
1061 1061
 	if (
1062 1062
 		preg_match(
1063
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1063
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1064 1064
 			$texte,
1065 1065
 			$regs
1066 1066
 		)
@@ -1151,8 +1151,8 @@  discard block
 block discarded – undo
1151 1151
  **/
1152 1152
 function textebrut($texte) {
1153 1153
 	$u = $GLOBALS['meta']['pcre_u'];
1154
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1155
-	$texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte);
1154
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1155
+	$texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte);
1156 1156
 	$texte = preg_replace("/^\n+/", '', $texte);
1157 1157
 	$texte = preg_replace("/\n+$/", '', $texte);
1158 1158
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 		)
1187 1187
 	) {
1188 1188
 		foreach ($liens[0] as $a) {
1189
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1189
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1190 1190
 			$ablank = inserer_attribut($a, 'rel', $rel);
1191 1191
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1192 1192
 			$texte = str_replace($a, $ablank, $texte);
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 		foreach ($regs[0] as $a) {
1212 1212
 			$rel = extraire_attribut($a, 'rel') ?? '';
1213 1213
 			if (strpos($rel, 'nofollow') === false) {
1214
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1214
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1215 1215
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1216 1216
 				$texte = str_replace($a, $anofollow, $texte);
1217 1217
 			}
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 	$u = $GLOBALS['meta']['pcre_u'];
1241 1241
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1242 1242
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1243
-	$texte = preg_replace('@^\s*<br />@S' . $u, '', $texte);
1243
+	$texte = preg_replace('@^\s*<br />@S'.$u, '', $texte);
1244 1244
 
1245 1245
 	return $texte;
1246 1246
 }
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 		return $texte;
1272 1272
 	}
1273 1273
 	include_spip('inc/texte');
1274
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1274
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1275 1275
 		'div' : 'span';
1276 1276
 
1277 1277
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	}
1384 1384
 	$u = $GLOBALS['meta']['pcre_u'];
1385 1385
 	if ($textebrut) {
1386
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1386
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1387 1387
 	}
1388 1388
 	$texte = texte_backend($texte);
1389 1389
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 	# un message pour abs_url
1419 1419
 	$GLOBALS['mode_abs_url'] = 'url';
1420 1420
 	$url = trim($url);
1421
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1421
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1422 1422
 
1423 1423
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1424 1424
 }
@@ -1618,14 +1618,14 @@  discard block
 block discarded – undo
1618 1618
 	if (strpos($texte, '<') !== false) {
1619 1619
 		include_spip('inc/lien');
1620 1620
 		if (defined('_PREG_MODELE')) {
1621
-			$preg_modeles = '@' . _PREG_MODELE . '@imsS';
1621
+			$preg_modeles = '@'._PREG_MODELE.'@imsS';
1622 1622
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1623 1623
 		}
1624 1624
 	}
1625 1625
 
1626 1626
 	$debut = '';
1627 1627
 	$suite = $texte;
1628
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1628
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1629 1629
 		$debut .= substr($suite, 0, $t - 1);
1630 1630
 		$suite = substr($suite, $t);
1631 1631
 		$car = substr($suite, 0, 1);
@@ -1643,11 +1643,11 @@  discard block
 block discarded – undo
1643 1643
 			$suite = substr($suite, strlen($regs[0]));
1644 1644
 		}
1645 1645
 	}
1646
-	$texte = $debut . $suite;
1646
+	$texte = $debut.$suite;
1647 1647
 
1648 1648
 	$texte = echappe_retour($texte);
1649 1649
 
1650
-	return $texte . $fin;
1650
+	return $texte.$fin;
1651 1651
 }
1652 1652
 
1653 1653
 
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
 		}
1710 1710
 
1711 1711
 		foreach ($regs as $reg) {
1712
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1712
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1713 1713
 			$desc = $traduire($cle, $lang, true);
1714 1714
 			$l = $desc->langue;
1715 1715
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1823,9 +1823,9 @@  discard block
 block discarded – undo
1823 1823
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1824 1824
 					include_spip('inc/texte');
1825 1825
 					$trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad));
1826
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1826
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1827 1827
 					if ($mode === 'div') {
1828
-						$trad = rtrim($trad) . "\n\n";
1828
+						$trad = rtrim($trad)."\n\n";
1829 1829
 					}
1830 1830
 					$trad = code_echappement($trad, 'multi', false, $mode);
1831 1831
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -2025,7 +2025,7 @@  discard block
 block discarded – undo
2025 2025
 	if (is_array($balise)) {
2026 2026
 		array_walk(
2027 2027
 			$balise,
2028
-			function (&$a, $key, $t) {
2028
+			function(&$a, $key, $t) {
2029 2029
 				$a = extraire_attribut($a, $t);
2030 2030
 			},
2031 2031
 			$attribut
@@ -2122,14 +2122,14 @@  discard block
 block discarded – undo
2122 2122
 
2123 2123
 	if ($old !== null) {
2124 2124
 		// Remplacer l'ancien attribut du meme nom
2125
-		$balise = $r[1] . $insert . $r[5];
2125
+		$balise = $r[1].$insert.$r[5];
2126 2126
 	} else {
2127 2127
 		// preferer une balise " />" (comme <img />)
2128 2128
 		if (preg_match(',/>,', $balise)) {
2129
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
2129
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
2130 2130
 		} // sinon une balise <a ...> ... </a>
2131 2131
 		else {
2132
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
2132
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
2133 2133
 		}
2134 2134
 	}
2135 2135
 
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 		if (
2185 2185
 			$class_courante
2186 2186
 			and strpos($class_courante, (string) $c) !== false
2187
-			and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante)
2187
+			and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante)
2188 2188
 		) {
2189 2189
 			$is_class_presente = true;
2190 2190
 		}
@@ -2192,12 +2192,12 @@  discard block
 block discarded – undo
2192 2192
 			in_array($operation, ['ajouter', 'commuter'])
2193 2193
 			and !$is_class_presente
2194 2194
 		) {
2195
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2195
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2196 2196
 		} elseif (
2197 2197
 			in_array($operation, ['supprimer', 'commuter'])
2198 2198
 			and $is_class_presente
2199 2199
 		) {
2200
-			$class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new));
2200
+			$class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new));
2201 2201
 		}
2202 2202
 	}
2203 2203
 
@@ -2260,7 +2260,7 @@  discard block
 block discarded – undo
2260 2260
 // Quelques fonctions de calcul arithmetique
2261 2261
 //
2262 2262
 function floatstr($a) {
2263
- return str_replace(',', '.', (string)floatval($a));
2263
+ return str_replace(',', '.', (string) floatval($a));
2264 2264
 }
2265 2265
 function strize($f, $a, $b) {
2266 2266
  return floatstr($f(floatstr($a), floatstr($b)));
@@ -2396,13 +2396,13 @@  discard block
 block discarded – undo
2396 2396
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2397 2397
 		define('_TAGS_NOM_AUTEUR', '');
2398 2398
 	}
2399
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2399
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2400 2400
 	foreach ($tags_acceptes as $tag) {
2401 2401
 		if (strlen($tag)) {
2402
-			$remp1[] = '<' . trim($tag) . '>';
2403
-			$remp1[] = '</' . trim($tag) . '>';
2404
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2405
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2402
+			$remp1[] = '<'.trim($tag).'>';
2403
+			$remp1[] = '</'.trim($tag).'>';
2404
+			$remp2[] = '\x60'.trim($tag).'\x61';
2405
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2406 2406
 		}
2407 2407
 	}
2408 2408
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2522,10 +2522,10 @@  discard block
 block discarded – undo
2522 2522
 	$fichier = basename($url);
2523 2523
 
2524 2524
 	return '<a rel="enclosure"'
2525
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2526
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2527
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2528
-	. '>' . $fichier . '</a>';
2525
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2526
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2527
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2528
+	. '>'.$fichier.'</a>';
2529 2529
 }
2530 2530
 
2531 2531
 /**
@@ -2553,9 +2553,9 @@  discard block
 block discarded – undo
2553 2553
 			} # vieux data
2554 2554
 			$fichier = basename($url);
2555 2555
 			$enclosures[] = '<enclosure'
2556
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2557
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2558
-				. ($length ? ' length="' . $length . '"' : '')
2556
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2557
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2558
+				. ($length ? ' length="'.$length.'"' : '')
2559 2559
 				. ' />';
2560 2560
 		}
2561 2561
 	}
@@ -2581,7 +2581,7 @@  discard block
 block discarded – undo
2581 2581
 		if (extraire_attribut($e, 'rel') == 'tag') {
2582 2582
 			$subjects .= '<dc:subject>'
2583 2583
 				. texte_backend(textebrut($e))
2584
-				. '</dc:subject>' . "\n";
2584
+				. '</dc:subject>'."\n";
2585 2585
 		}
2586 2586
 	}
2587 2587
 
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 	if (is_array($texte)) {
2618 2618
 		array_walk(
2619 2619
 			$texte,
2620
-			function (&$a, $key, $t) {
2620
+			function(&$a, $key, $t) {
2621 2621
 				$a = extraire_balise($a, $t);
2622 2622
 			},
2623 2623
 			$tag
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
 	if (is_array($texte)) {
2666 2666
 		array_walk(
2667 2667
 			$texte,
2668
-			function (&$a, $key, $t) {
2668
+			function(&$a, $key, $t) {
2669 2669
 				$a = extraire_balises($a, $t);
2670 2670
 			},
2671 2671
 			$tag
@@ -2798,7 +2798,7 @@  discard block
 block discarded – undo
2798 2798
 		if ($fond != '404') {
2799 2799
 			$contexte = array_shift($p);
2800 2800
 			$contexte['page'] = $fond;
2801
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2801
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2802 2802
 		}
2803 2803
 	}
2804 2804
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2853,9 +2853,9 @@  discard block
 block discarded – undo
2853 2853
 			. '"'
2854 2854
 			. (is_null($val)
2855 2855
 				? ''
2856
-				: ' value="' . entites_html($val) . '"'
2856
+				: ' value="'.entites_html($val).'"'
2857 2857
 			)
2858
-			. ' type="hidden"' . "\n/>";
2858
+			. ' type="hidden"'."\n/>";
2859 2859
 	}
2860 2860
 
2861 2861
 	return join('', $hidden);
@@ -2965,7 +2965,7 @@  discard block
 block discarded – undo
2965 2965
 
2966 2966
 	return preg_replace_callback(
2967 2967
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2968
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2968
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2969 2969
 		$contenu
2970 2970
 	);
2971 2971
 }
@@ -3026,14 +3026,14 @@  discard block
 block discarded – undo
3026 3026
 	) {
3027 3027
 		$distant = true;
3028 3028
 		$cssf = parse_url($css);
3029
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
3029
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
3030 3030
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
3031 3031
 	} else {
3032 3032
 		$distant = false;
3033 3033
 		$cssf = $css;
3034 3034
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
3035 3035
 		//propose (rien a faire dans ce cas)
3036
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
3036
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
3037 3037
 		if (@file_exists($f)) {
3038 3038
 			return $f;
3039 3039
 		}
@@ -3043,7 +3043,7 @@  discard block
 block discarded – undo
3043 3043
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
3044 3044
 	$f = $dir_var
3045 3045
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
3046
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
3046
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
3047 3047
 
3048 3048
 	// la css peut etre distante (url absolue !)
3049 3049
 	if ($distant) {
@@ -3089,8 +3089,8 @@  discard block
 block discarded – undo
3089 3089
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
3090 3090
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
3091 3091
 			$css_direction = substr($css_direction, strlen($dir_var));
3092
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
3093
-			$css_direction = '/@@@@@@/' . $css_direction;
3092
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
3093
+			$css_direction = '/@@@@@@/'.$css_direction;
3094 3094
 		}
3095 3095
 		$src[] = $regs[0][$k];
3096 3096
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
 
3140 3140
 	$f = basename($css, '.css');
3141 3141
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3142
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3142
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3143 3143
 		. '.css';
3144 3144
 
3145 3145
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
 	if ($url_absolue_css == $css) {
3150 3150
 		if (
3151 3151
 			strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3152
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3152
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3153 3153
 		) {
3154 3154
 			include_spip('inc/distant');
3155 3155
 			$contenu = recuperer_url($css);
@@ -3261,7 +3261,7 @@  discard block
 block discarded – undo
3261 3261
 	$expression = str_replace('\/', '/', $expression);
3262 3262
 	$expression = str_replace('/', '\/', $expression);
3263 3263
 
3264
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3264
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3265 3265
 		if (isset($r[$capte])) {
3266 3266
 			return $r[$capte];
3267 3267
 		} else {
@@ -3299,7 +3299,7 @@  discard block
 block discarded – undo
3299 3299
 	$expression = str_replace('\/', '/', $expression);
3300 3300
 	$expression = str_replace('/', '\/', $expression);
3301 3301
 
3302
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3302
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3303 3303
 }
3304 3304
 
3305 3305
 
@@ -3318,7 +3318,7 @@  discard block
 block discarded – undo
3318 3318
 function traiter_doublons_documents(&$doublons, $letexte) {
3319 3319
 
3320 3320
 	// Verifier dans le texte & les notes (pas beau, helas)
3321
-	$t = $letexte . $GLOBALS['les_notes'];
3321
+	$t = $letexte.$GLOBALS['les_notes'];
3322 3322
 
3323 3323
 	if (
3324 3324
 		strstr($t, 'spip_document_') // evite le preg_match_all si inutile
@@ -3332,7 +3332,7 @@  discard block
 block discarded – undo
3332 3332
 		if (!isset($doublons['documents'])) {
3333 3333
 			$doublons['documents'] = '';
3334 3334
 		}
3335
-		$doublons['documents'] .= ',' . join(',', $matches[1]);
3335
+		$doublons['documents'] .= ','.join(',', $matches[1]);
3336 3336
 	}
3337 3337
 
3338 3338
 	return $letexte;
@@ -3389,7 +3389,7 @@  discard block
 block discarded – undo
3389 3389
 	if ($env) {
3390 3390
 		foreach ($env as $i => $j) {
3391 3391
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3392
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3392
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3393 3393
 			}
3394 3394
 		}
3395 3395
 	}
@@ -3428,7 +3428,7 @@  discard block
 block discarded – undo
3428 3428
 	if ($env) {
3429 3429
 		foreach ($env as $i => $j) {
3430 3430
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3431
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3431
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3432 3432
 			}
3433 3433
 		}
3434 3434
 	}
@@ -3502,10 +3502,10 @@  discard block
 block discarded – undo
3502 3502
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3503 3503
 	if (
3504 3504
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3505
-		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg'
3505
+		and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg'
3506 3506
 		and file_exists($variante_svg_generique)
3507 3507
 	) {
3508
-		if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) {
3508
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) {
3509 3509
 			$img_file = $variante_svg_size;
3510 3510
 		}
3511 3511
 		else {
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
 				return '';
3564 3564
 			}
3565 3565
 		}
3566
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3566
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3567 3567
 	}
3568 3568
 
3569 3569
 	if (file_exists($img_file)) {
@@ -3573,14 +3573,14 @@  discard block
 block discarded – undo
3573 3573
 		$alt = '';
3574 3574
 	}
3575 3575
 	elseif ($alt or $alt === '') {
3576
-		$alt = " alt='" . attribut_html($alt) . "'";
3576
+		$alt = " alt='".attribut_html($alt)."'";
3577 3577
 	}
3578 3578
 	else {
3579
-		$alt = " alt='" . attribut_html($title) . "'";
3579
+		$alt = " alt='".attribut_html($title)."'";
3580 3580
 	}
3581
-	return "<img src='" . attribut_html($img_file) . "'$alt"
3582
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3583
-	. ' ' . ltrim($atts)
3581
+	return "<img src='".attribut_html($img_file)."'$alt"
3582
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3583
+	. ' '.ltrim($atts)
3584 3584
 	. ' />';
3585 3585
 }
3586 3586
 
@@ -3594,10 +3594,10 @@  discard block
 block discarded – undo
3594 3594
  */
3595 3595
 function http_style_background($img, $att = '', $size = null) {
3596 3596
 	if ($size and is_numeric($size)) {
3597
-		$size = trim($size) . 'px';
3597
+		$size = trim($size).'px';
3598 3598
 	}
3599
-	return " style='background" .
3600
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3599
+	return " style='background".
3600
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3601 3601
 		. ($size ? "background-size:{$size};" : '')
3602 3602
 		. "'";
3603 3603
 }
@@ -3712,7 +3712,7 @@  discard block
 block discarded – undo
3712 3712
 		$img = http_img_pack(
3713 3713
 			$img,
3714 3714
 			$alt,
3715
-			$class ? " class='" . attribut_html($class) . "'" : '',
3715
+			$class ? " class='".attribut_html($class)."'" : '',
3716 3716
 			'',
3717 3717
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3718 3718
 		);
@@ -3797,7 +3797,7 @@  discard block
 block discarded – undo
3797 3797
 	$balise_svg_source = $balise_svg;
3798 3798
 
3799 3799
 	// entete XML à supprimer
3800
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3800
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3801 3801
 
3802 3802
 	// IE est toujours mon ami
3803 3803
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3815,9 +3815,9 @@  discard block
 block discarded – undo
3815 3815
 	// regler le alt
3816 3816
 	if ($alt) {
3817 3817
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3818
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3818
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3819 3819
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3820
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3820
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3821 3821
 		$balise_svg .= $title;
3822 3822
 	}
3823 3823
 	else {
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
 	if (is_array($tableau)) {
3866 3866
 		foreach ($tableau as $k => $v) {
3867 3867
 			$res = recuperer_fond(
3868
-				'modeles/' . $modele,
3868
+				'modeles/'.$modele,
3869 3869
 				array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v]))
3870 3870
 			);
3871 3871
 			$texte .= $res;
@@ -4050,7 +4050,7 @@  discard block
 block discarded – undo
4050 4050
 	}
4051 4051
 
4052 4052
 	$c = serialize($c);
4053
-	$cle = calculer_cle_action($form . $c);
4053
+	$cle = calculer_cle_action($form.$c);
4054 4054
 	$c = "$cle:$c";
4055 4055
 
4056 4056
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -4108,15 +4108,15 @@  discard block
 block discarded – undo
4108 4108
 	}
4109 4109
 	// toujours encoder l'url source dans le bloc ajax
4110 4110
 	$r = self();
4111
-	$r = ' data-origin="' . $r . '"';
4111
+	$r = ' data-origin="'.$r.'"';
4112 4112
 	$class = 'ajaxbloc';
4113 4113
 	if ($ajaxid and is_string($ajaxid)) {
4114 4114
 		// ajaxid est normalement conforme a un nom de classe css
4115 4115
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
4116
-		$class .= ' ajax-id-' . entites_html($ajaxid);
4116
+		$class .= ' ajax-id-'.entites_html($ajaxid);
4117 4117
 	}
4118 4118
 
4119
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4119
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
4120 4120
 }
4121 4121
 
4122 4122
 /**
@@ -4160,7 +4160,7 @@  discard block
 block discarded – undo
4160 4160
 		$cle = substr($c, 0, $p);
4161 4161
 		$c = substr($c, $p + 1);
4162 4162
 
4163
-		if ($cle == calculer_cle_action($form . $c)) {
4163
+		if ($cle == calculer_cle_action($form.$c)) {
4164 4164
 			$env = @unserialize($c);
4165 4165
 			return $env;
4166 4166
 		}
@@ -4281,13 +4281,13 @@  discard block
 block discarded – undo
4281 4281
 				}
4282 4282
 			}
4283 4283
 		}
4284
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4284
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4285 4285
 	} else {
4286 4286
 		$bal = 'a';
4287 4287
 		$att = "href='$url'"
4288
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4289
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4290
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4288
+			. ($title ? " title='".attribut_html($title)."'" : '')
4289
+			. ($class ? " class='".attribut_html($class)."'" : '')
4290
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4291 4291
 			. $evt;
4292 4292
 	}
4293 4293
 	if ($libelle === null) {
@@ -4426,7 +4426,7 @@  discard block
 block discarded – undo
4426 4426
 
4427 4427
 	// Icône
4428 4428
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4429
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4429
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4430 4430
 
4431 4431
 	// Markup final
4432 4432
 	if ($type == 'lien') {
@@ -4701,20 +4701,20 @@  discard block
 block discarded – undo
4701 4701
 		$class_form = 'ajax';
4702 4702
 		$class = str_replace('ajax', '', $class);
4703 4703
 	}
4704
-	$class_btn = 'submit ' . trim($class);
4704
+	$class_btn = 'submit '.trim($class);
4705 4705
 
4706 4706
 	if ($confirm) {
4707
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4707
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4708 4708
 		if ($callback) {
4709 4709
 			$callback = "$confirm?($callback):false";
4710 4710
 		} else {
4711 4711
 			$callback = $confirm;
4712 4712
 		}
4713 4713
 	}
4714
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4714
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4715 4715
 	$title = $title ? " title='$title'" : '';
4716 4716
 
4717
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4717
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4718 4718
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4719 4719
 }
4720 4720
 
@@ -4779,14 +4779,14 @@  discard block
 block discarded – undo
4779 4779
 		$champ_titre = '';
4780 4780
 		if ($demande_titre) {
4781 4781
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4782
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4782
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4783 4783
 		}
4784 4784
 		include_spip('base/abstract_sql');
4785 4785
 		include_spip('base/connect_sql');
4786 4786
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4787
-			'*' . $champ_titre,
4787
+			'*'.$champ_titre,
4788 4788
 			$desc['table_sql'],
4789
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4789
+			id_table_objet($type_objet).' = '.intval($id_objet)
4790 4790
 		);
4791 4791
 
4792 4792
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4879,8 +4879,7 @@  discard block
 block discarded – undo
4879 4879
 	if (isset($ligne_sql['chapo'])) {
4880 4880
 		$chapo = $ligne_sql['chapo'];
4881 4881
 		$texte = strlen($descriptif) ?
4882
-			'' :
4883
-			"$chapo \n\n $texte";
4882
+			'' : "$chapo \n\n $texte";
4884 4883
 	}
4885 4884
 
4886 4885
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4955,7 +4954,7 @@  discard block
 block discarded – undo
4955 4954
 		return $texte;
4956 4955
 	}
4957 4956
 
4958
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4957
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4959 4958
 
4960 4959
 	// signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag
4961 4960
 	if (test_espace_prive()) {
@@ -4994,7 +4993,7 @@  discard block
 block discarded – undo
4994 4993
 	}
4995 4994
 	$url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect);
4996 4995
 
4997
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4996
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4998 4997
 }
4999 4998
 
5000 4999
 /**
@@ -5020,10 +5019,10 @@  discard block
 block discarded – undo
5020 5019
 function wrap($texte, $wrap) {
5021 5020
 	$balises = extraire_balises($wrap);
5022 5021
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
5023
-		$texte = $wrap . $texte;
5022
+		$texte = $wrap.$texte;
5024 5023
 		$regs = array_reverse($regs[1]);
5025
-		$wrap = '</' . implode('></', $regs) . '>';
5026
-		$texte = $texte . $wrap;
5024
+		$wrap = '</'.implode('></', $regs).'>';
5025
+		$texte = $texte.$wrap;
5027 5026
 	}
5028 5027
 
5029 5028
 	return $texte;
@@ -5054,7 +5053,7 @@  discard block
 block discarded – undo
5054 5053
 
5055 5054
 	// caster $u en array si besoin
5056 5055
 	if (is_object($u)) {
5057
-		$u = (array)$u;
5056
+		$u = (array) $u;
5058 5057
 	}
5059 5058
 
5060 5059
 	if (is_array($u)) {
@@ -5076,7 +5075,7 @@  discard block
 block discarded – undo
5076 5075
 		// sinon on passe a la ligne et on indente
5077 5076
 		$i_str = str_pad('', $indent, ' ');
5078 5077
 		foreach ($u as $k => $v) {
5079
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
5078
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
5080 5079
 		}
5081 5080
 
5082 5081
 		return $out;
@@ -5130,7 +5129,7 @@  discard block
 block discarded – undo
5130 5129
  * @return string
5131 5130
  */
5132 5131
 function objet_icone($objet, $taille = 24, $class = '') {
5133
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
5132
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
5134 5133
 	$icone = chemin_image($icone);
5135 5134
 	$balise_img = charger_filtre('balise_img');
5136 5135
 
@@ -5156,7 +5155,7 @@  discard block
 block discarded – undo
5156 5155
  */
5157 5156
 function objet_T($objet, $chaine, $args = [], $options = []) {
5158 5157
 	$chaine = explode(':', $chaine);
5159
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
5158
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
5160 5159
 		return $t;
5161 5160
 	}
5162 5161
 	$chaine = implode(':', $chaine);
@@ -5222,7 +5221,7 @@  discard block
 block discarded – undo
5222 5221
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
5223 5222
 
5224 5223
 	// calculer le nom de la css
5225
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5224
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5226 5225
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
5227 5226
 	$contexte_implicite = calculer_contexte_implicite();
5228 5227
 
@@ -5230,14 +5229,14 @@  discard block
 block discarded – undo
5230 5229
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5231 5230
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5232 5231
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5233
-		$hash = md5($contexte_implicite['host'] . '::' . $cache);
5232
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5234 5233
 	}
5235 5234
 	else {
5236 5235
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5237 5236
 		ksort($contexte);
5238
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
5237
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
5239 5238
 	}
5240
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5239
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5241 5240
 
5242 5241
 	// mettre a jour le fichier si il n'existe pas
5243 5242
 	// ou trop ancien
@@ -5245,8 +5244,8 @@  discard block
 block discarded – undo
5245 5244
 	// et recopie sur le fichier cible uniquement si il change
5246 5245
 	if (
5247 5246
 		!file_exists($filename)
5248
-		or !file_exists($filename . '.last')
5249
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified'])
5247
+		or !file_exists($filename.'.last')
5248
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified'])
5250 5249
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5251 5250
 	) {
5252 5251
 		$contenu = $cache['texte'];
@@ -5270,10 +5269,10 @@  discard block
 block discarded – undo
5270 5269
 			}
5271 5270
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5272 5271
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5273
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5272
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5274 5273
 		}
5275 5274
 		// et ecrire le fichier si il change
5276
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5275
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5277 5276
 	}
5278 5277
 
5279 5278
 	return timestamp($filename);
@@ -5506,7 +5505,7 @@  discard block
 block discarded – undo
5506 5505
 	if ($e > 0 and strlen($mid) > 8) {
5507 5506
 		$mid = '***...***';
5508 5507
 	}
5509
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5508
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5510 5509
 }
5511 5510
 
5512 5511
 
@@ -5568,7 +5567,7 @@  discard block
 block discarded – undo
5568 5567
 		case 'id':
5569 5568
 		case 'anchor':
5570 5569
 			if (preg_match(',^\d,', $texte)) {
5571
-				$texte = substr($type, 0, 1) . $texte;
5570
+				$texte = substr($type, 0, 1).$texte;
5572 5571
 			}
5573 5572
 	}
5574 5573
 
@@ -5578,9 +5577,9 @@  discard block
 block discarded – undo
5578 5577
 
5579 5578
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5580 5579
 		if (preg_match(',^\d,', $texte)) {
5581
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5580
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5582 5581
 		}
5583
-		$texte .= $separateur . md5($original);
5582
+		$texte .= $separateur.md5($original);
5584 5583
 		$texte = substr($texte, 0, $longueur_mini);
5585 5584
 	}
5586 5585
 
Please login to merge, or discard this patch.
ecrire/src/Chiffrer/SpipCles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 final class SpipCles {
17 17
 	private static array $instances = [];
18 18
 
19
-	private string $file = _DIR_ETC . 'cles.php';
19
+	private string $file = _DIR_ETC.'cles.php';
20 20
 	private Cles $cles;
21 21
 
22 22
 	public static function instance(string $file = ''): self {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		// et par extension tous les passwords
118 118
 		if (!empty($cles_potentielles['secret_des_auth'])) {
119 119
 			if (!Password::verifier($password_clair, $password_hash, $cles_potentielles['secret_des_auth'])) {
120
-				spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer' . _LOG_INFO_IMPORTANTE);
120
+				spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer'._LOG_INFO_IMPORTANTE);
121 121
 				unset($cles_potentielles['secret_des_auth']);
122 122
 			}
123 123
 		}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		foreach ($cles_potentielles as $name => $key) {
128 128
 			if (!$this->cles->has($name)) {
129 129
 				$this->cles->set($name, $key);
130
-				spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer' . _LOG_INFO_IMPORTANTE);
130
+				spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer'._LOG_INFO_IMPORTANTE);
131 131
 				$restauration = true;
132 132
 			}
133 133
 		}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 				return $this->cles->get($name);
146 146
 			}
147 147
 			// sinon loger et annule la cle generee car il ne faut pas l'utiliser
148
-			spip_log('Echec ecriture du fichier cle ' . $this->file . " ; impossible de generer une cle $name", 'chiffrer' . _LOG_ERREUR);
148
+			spip_log('Echec ecriture du fichier cle '.$this->file." ; impossible de generer une cle $name", 'chiffrer'._LOG_ERREUR);
149 149
 			$this->cles->delete($name);
150 150
 		}
151 151
 		return null;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	private function getMetaKey(string $name, bool $autoInit = true): ?string {
155 155
 		if (!isset($GLOBALS['meta'][$name])) {
156 156
 			include_spip('base/abstract_sql');
157
-			$GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = ' . sql_quote($name, '', 'string'));
157
+			$GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = '.sql_quote($name, '', 'string'));
158 158
 		}
159 159
 		$key = base64_decode($GLOBALS['meta'][$name] ?? '');
160 160
 		if (strlen($key) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
Please login to merge, or discard this patch.
ecrire/inc/modifier.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 	// Appels incomplets (sans $c)
115 115
 	if (!is_array($c)) {
116
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
116
+		spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c');
117 117
 
118 118
 		return _T('erreur_technique_enregistrement_impossible');
119 119
 	}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	// N'accepter que les champs qui existent dans la table
141 141
 	$champs = array_intersect_key($c, $desc['field']);
142 142
 	// et dont la valeur n'est pas null
143
-	$champs = array_filter($champs, static function ($var) {
143
+	$champs = array_filter($champs, static function($var) {
144 144
 		return $var !== null;
145 145
 	});
146 146
 	// TODO: ici aussi on peut valider les contenus
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	$champs = array_map('corriger_caracteres', $champs);
151 151
 
152 152
 	// On récupère l'état avant toute modification
153
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
153
+	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet);
154 154
 
155 155
 	// Envoyer aux plugins
156 156
 	$champs = pipeline(
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				$id_rubrique = 0;
206 206
 				if (isset($desc['field']['id_rubrique'])) {
207 207
 					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
208
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
208
+					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet));
209 209
 				}
210 210
 				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
211 211
 				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
 		}
228 228
 
229 229
 		// allez on commit la modif
230
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), [], $serveur);
230
+		sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), [], $serveur);
231 231
 
232 232
 		// on verifie si elle est bien passee
233 233
 		$moof = sql_fetsel(
234 234
 			array_keys($champs),
235 235
 			$spip_table_objet,
236
-			"$id_table_objet=" . intval($id_objet),
236
+			"$id_table_objet=".intval($id_objet),
237 237
 			[],
238 238
 			[],
239 239
 			'',
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
 			// c'est un cas exceptionnel
270 270
 			if (count($liste)) {
271 271
 				spip_log(
272
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
273
-					'modifier.' . _LOG_CRITIQUE
272
+					"Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true),
273
+					'modifier.'._LOG_CRITIQUE
274 274
 				);
275 275
 
276 276
 				return _T(
277 277
 					'erreur_technique_enregistrement_champs',
278
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
278
+					['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"]
279 279
 				);
280 280
 			}
281 281
 		}
@@ -317,18 +317,18 @@  discard block
 block discarded – undo
317 317
 	include_spip('inc/filtres_mini');
318 318
 	$qui = '';
319 319
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
320
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
320
+		$qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#';
321 321
 	}
322 322
 	if (!empty($GLOBALS['visiteur_session']['nom'])) {
323
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
323
+		$qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#';
324 324
 	}
325 325
 	if ($qui == '') {
326
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
326
+		$qui = '#ip:'.$GLOBALS['ip'].'#';
327 327
 	}
328
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
328
+	journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join(
329 329
 		'+',
330 330
 		array_diff(array_keys($champs), ['date_modif'])
331
-	) . ')'), [
331
+	).')'), [
332 332
 		'faire' => 'modifier',
333 333
 		'quoi' => $objet,
334 334
 		'id' => $id_objet
Please login to merge, or discard this patch.
ecrire/auth/spip.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$row = sql_fetsel(
50 50
 			'*',
51 51
 			'spip_auteurs',
52
-			'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'",
52
+			'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'",
53 53
 			'',
54 54
 			'',
55 55
 			'',
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
 		// legacy = md5 ou sha256
78 78
 		case 32:
79 79
 			// tres anciens mots de passe encodes en md5(alea.pass)
80
-			$hash = md5($row['alea_actuel'] . $pass);
80
+			$hash = md5($row['alea_actuel'].$pass);
81 81
 			$methode = 'md5';
82 82
 		case 64:
83 83
 			if (empty($hash)) {
84 84
 				// anciens mots de passe encodes en sha256(alea.pass)
85 85
 				include_spip('auth/sha256.inc');
86
-				$hash = spip_sha256($row['alea_actuel'] . $pass);
86
+				$hash = spip_sha256($row['alea_actuel'].$pass);
87 87
 				$methode = 'sha256';
88 88
 			}
89 89
 			if ($row['pass'] === $hash) {
90
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via $methode", 'auth' . _LOG_DEBUG);
90
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG);
91 91
 				// ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth
92 92
 				if (!empty($row['backup_cles'])) {
93
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
93
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
94 94
 				}
95 95
 				break;
96 96
 			}
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 				and !empty($row['backup_cles'])
109 109
 			) {
110 110
 				if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) {
111
-					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE);
111
+					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE);
112 112
 					if ($cles->save()) {
113 113
 						$secret = $cles->getSecretAuth();
114 114
 					}
115 115
 					else {
116
-						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
116
+						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
117 117
 						// et on echoue car on ne veut pas que la situation reste telle quelle
118
-						raler_fichier(_DIR_ETC . 'cles.php');
118
+						raler_fichier(_DIR_ETC.'cles.php');
119 119
 					}
120 120
 				}
121 121
 				else {
122
-					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR);
123
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
122
+					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR);
123
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
124 124
 				}
125 125
 			}
126 126
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				unset($row);
129 129
 			}
130 130
 			else {
131
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG);
131
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG);
132 132
 			}
133 133
 			break;
134 134
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			@sql_update(
176 176
 				'spip_auteurs',
177 177
 				$set,
178
-				'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote(
178
+				'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote(
179 179
 					$row['pass'],
180 180
 					$serveur,
181 181
 					'text'
@@ -223,24 +223,24 @@  discard block
 block discarded – undo
223 223
 
224 224
 	// si force, on ne verifie pas la presence d'un backup chez un webmestre
225 225
 	if ($force) {
226
-		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE);
226
+		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE);
227 227
 		$secret = $cles->getSecretAuth(true);
228 228
 		return true;
229 229
 	}
230 230
 
231
-	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''");
231
+	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''");
232 232
 	$has_backup = array_column($has_backup, 'id_auteur');
233 233
 	if (empty($has_backup)) {
234
-		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE);
234
+		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE);
235 235
 		if ($secret = $cles->getSecretAuth(true)) {
236 236
 			return true;
237 237
 		}
238
-		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
238
+		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
239 239
 		// et on echoue car on ne veut pas que la situation reste telle quelle
240
-		raler_fichier(_DIR_ETC . 'cles.php');
240
+		raler_fichier(_DIR_ETC.'cles.php');
241 241
 	}
242 242
 	else {
243
-		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR);
243
+		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR);
244 244
 	}
245 245
 	return false;
246 246
 }
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	$flux['data'] .=
258 258
 		  '<script type="text/javascript">/*<![CDATA[*/'
259 259
 		. "$js\n"
260
-		. "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "',"
261
-		. "'page_auteur': '" . generer_url_public('informer_auteur') . "',"
260
+		. "var login_info={'login':'".$flux['args']['contexte']['var_login']."',"
261
+		. "'page_auteur': '".generer_url_public('informer_auteur')."',"
262 262
 		. "'informe_auteur_en_cours':false,"
263 263
 		. "'attente_informe':0};"
264 264
 		. "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});"
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		} else {
302 302
 			$n = sql_countsel(
303 303
 				'spip_auteurs',
304
-				'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'",
304
+				'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'",
305 305
 				'',
306 306
 				'',
307 307
 				$serveur
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	}
330 330
 	if (
331 331
 		!$id_auteur = intval($id_auteur)
332
-		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
332
+		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
333 333
 	) {
334 334
 		return false;
335 335
 	}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		$anciens = sql_allfetsel(
345 345
 			'id_auteur',
346 346
 			'spip_auteurs',
347
-			'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'",
347
+			'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'",
348 348
 			'',
349 349
 			'',
350 350
 			'',
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 		$r = sql_getfetsel(
379 379
 			'login',
380 380
 			'spip_auteurs',
381
-			"statut<>'5poubelle'" .
382
-			' AND (length(pass)>0)' .
381
+			"statut<>'5poubelle'".
382
+			' AND (length(pass)>0)'.
383 383
 			" AND (login=$l)",
384 384
 			'',
385 385
 			'',
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 		return sql_getfetsel(
399 399
 			'login',
400 400
 			'spip_auteurs',
401
-			"statut<>'5poubelle'" .
402
-			' AND (length(pass)>0)' .
401
+			"statut<>'5poubelle'".
402
+			' AND (length(pass)>0)'.
403 403
 			" AND (login<>'' AND (nom=$l OR email=$l))",
404 404
 			'',
405 405
 			'',
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
 	if (
470 470
 		!$id_auteur = intval($id_auteur)
471
-		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
471
+		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
472 472
 	) {
473 473
 		return false;
474 474
 	}
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 		or isset($champs['statut'])
530 530
 		or (isset($options['all']) and $options['all'])
531 531
 	) {
532
-		$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
533
-		$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
532
+		$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
533
+		$htpasswd = _DIR_TMP._AUTH_USER_FILE;
534 534
 
535 535
 		// Cette variable de configuration peut etre posee par un plugin
536 536
 		// par exemple acces_restreint ;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			and !@file_exists($htaccess)
541 541
 		) {
542 542
 			spip_unlink($htpasswd);
543
-			spip_unlink($htpasswd . '-admin');
543
+			spip_unlink($htpasswd.'-admin');
544 544
 
545 545
 			return;
546 546
 		}
@@ -558,16 +558,16 @@  discard block
 block discarded – undo
558 558
 		);
559 559
 		while ($t = sql_fetch($s)) {
560 560
 			if (strlen($t['login']) and strlen($t['htpass'])) {
561
-				$p1 .= $t['login'] . ':' . $t['htpass'] . "\n";
561
+				$p1 .= $t['login'].':'.$t['htpass']."\n";
562 562
 				if ($t['statut'] == '0minirezo') {
563
-					$p2 .= $t['login'] . ':' . $t['htpass'] . "\n";
563
+					$p2 .= $t['login'].':'.$t['htpass']."\n";
564 564
 				}
565 565
 			}
566 566
 		}
567 567
 		sql_free($s);
568 568
 		if ($p1) {
569 569
 			ecrire_fichier($htpasswd, $p1);
570
-			ecrire_fichier($htpasswd . '-admin', $p2);
570
+			ecrire_fichier($htpasswd.'-admin', $p2);
571 571
 			spip_log("Ecriture de $htpasswd et $htpasswd-admin");
572 572
 		}
573 573
 	}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 // mais apres la fonction autoriser()
121 121
 if ($f = find_in_path('mes_fonctions.php')) {
122 122
 	global $dossier_squelettes;
123
-	include_once(_ROOT_CWD . $f);
123
+	include_once(_ROOT_CWD.$f);
124 124
 }
125 125
 
126 126
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$qui = $GLOBALS['visiteur_session'] ?: [];
163 163
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
164 164
 	} elseif (is_numeric($qui)) {
165
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
165
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
166 166
 		if (!$qui) {
167 167
 			return false;
168 168
 		}
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	}
176 176
 
177 177
 	spip_log(
178
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
179
-		'autoriser' . _LOG_DEBUG
178
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
179
+		'autoriser'._LOG_DEBUG
180 180
 	);
181 181
 
182 182
 	// passer par objet_type pour avoir les alias
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
193 193
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
194 194
 	) {
195
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
195
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
196 196
 		return true;
197 197
 	}
198 198
 
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
202 202
 	$fonctions = $type
203 203
 		? [
204
-			'autoriser_' . $type . '_' . $faire,
205
-			'autoriser_' . $type . '_' . $faire . '_dist',
206
-			'autoriser_' . $type,
207
-			'autoriser_' . $type . '_dist',
208
-			'autoriser_' . $faire,
209
-			'autoriser_' . $faire . '_dist',
204
+			'autoriser_'.$type.'_'.$faire,
205
+			'autoriser_'.$type.'_'.$faire.'_dist',
206
+			'autoriser_'.$type,
207
+			'autoriser_'.$type.'_dist',
208
+			'autoriser_'.$faire,
209
+			'autoriser_'.$faire.'_dist',
210 210
 			'autoriser_defaut',
211 211
 			'autoriser_defaut_dist'
212 212
 		]
213 213
 		: [
214
-			'autoriser_' . $faire,
215
-			'autoriser_' . $faire . '_dist',
214
+			'autoriser_'.$faire,
215
+			'autoriser_'.$faire.'_dist',
216 216
 			'autoriser_defaut',
217 217
 			'autoriser_defaut_dist'
218 218
 		];
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 	}
226 226
 
227 227
 	spip_log(
228
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
229
-		'autoriser' . _LOG_DEBUG
228
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
229
+		'autoriser'._LOG_DEBUG
230 230
 	);
231 231
 
232 232
 	return $a;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
376 376
 
377 377
 	// Le visiteur a-t-il un statut prevu par la config ?
378
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
378
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
379 379
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
380 380
 	}
381 381
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 				} // pas de champ passe a la demande => NIET
434 434
 				$previsu = explode(',', $c['previsu']);
435 435
 				// regarder si ce statut est autorise pour l'auteur
436
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
436
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
437 437
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
438 438
 					// sinon l’auteur en session
439 439
 					include_spip('inc/securiser_action');
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 
448 448
 					if (!$id_auteur) {
449 449
 						return false;
450
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
450
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
451 451
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
452 452
 					} elseif (
453 453
 						!sql_countsel(
454 454
 							'spip_auteurs_liens',
455
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
455
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
456 456
 						)
457 457
 					) {
458 458
 						return false;
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
 			// multilinguisme par secteur et objet rattaché à une rubrique
498 498
 			$primary = id_table_objet($type);
499 499
 			if ($table != 'spip_rubriques') {
500
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
500
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
501 501
 			} else {
502 502
 				$id_rubrique = $id;
503 503
 			}
504
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
504
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
505 505
 			if (!$id_secteur > 0) {
506 506
 				$id_secteur = $id_rubrique;
507 507
 			}
508
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
509
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
508
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
509
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
510 510
 			if ($langue_secteur != $langue_objet) {
511 511
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
512 512
 				return true;
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
515 515
 				return false;
516 516
 			} else {
517
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
517
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
518 518
 				if ($id_parent != 0) {
519 519
 					// sous-rubriques : pas de choix de langue
520 520
 					return false;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 
567 567
 	if (!isset($opt['statut'])) {
568 568
 		if (isset($desc['field']['statut'])) {
569
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
569
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
570 570
 		} else {
571 571
 			$statut = 'publie';
572 572
 		} // pas de statut => publie
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 		return false;
741 741
 	}
742 742
 
743
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
743
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
744 744
 		return false;
745 745
 	}
746 746
 
747
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
747
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
748 748
 		return false;
749 749
 	}
750 750
 
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 	if (!$id) {
782 782
 		return false;
783 783
 	}
784
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
784
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
785 785
 
786 786
 	return
787 787
 		$r
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 				(!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true))
793 793
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
794 794
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
795
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
795
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
796 796
 			)
797 797
 		);
798 798
 }
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 		if (!$id) {
851 851
 			return false;
852 852
 		}
853
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
853
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
854 854
 	}
855 855
 
856 856
 	return
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 		or
862 862
 		($id
863 863
 			and $qui['id_auteur']
864
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
864
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
865 865
 }
866 866
 
867 867
 
@@ -882,8 +882,8 @@  discard block
 block discarded – undo
882 882
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
883 883
 	# securite, mais on aurait pas du arriver ici !
884 884
 	if (
885
-		function_exists($f = 'autoriser_' . $type . '_voir')
886
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
885
+		function_exists($f = 'autoriser_'.$type.'_voir')
886
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
887 887
 	) {
888 888
 		return $f($faire, $type, $id, $qui, $opt);
889 889
 	}
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 	$n = sql_fetsel(
1015 1015
 		'A.id_article',
1016 1016
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1017
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1017
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1018 1018
 	);
1019 1019
 
1020 1020
 	return $n ? true : false;
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		and $r = sql_allfetsel(
1227 1227
 			'id_objet',
1228 1228
 			'spip_auteurs_liens',
1229
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1229
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1230 1230
 		)
1231 1231
 		and is_countable($r) ? count($r) : 0
1232 1232
 	) {
@@ -1911,8 +1911,8 @@  discard block
 block discarded – undo
1911 1911
 function auteurs_objet($objet, $id_objet, $cond = '') {
1912 1912
 	$objet = objet_type($objet);
1913 1913
 	$where = [
1914
-		'objet=' . sql_quote($objet),
1915
-		'id_objet=' . intval($id_objet)
1914
+		'objet='.sql_quote($objet),
1915
+		'id_objet='.intval($id_objet)
1916 1916
 	];
1917 1917
 	if (!empty($cond)) {
1918 1918
 		if (is_array($cond)) {
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 	return sql_allfetsel(
1948 1948
 		'id_auteur',
1949 1949
 		'spip_auteurs_liens',
1950
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1950
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1951 1951
 	);
1952 1952
 }
1953 1953
 
Please login to merge, or discard this patch.
ecrire/inc/informer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	include_spip('inc/texte');
21 21
 	$titre = $descriptif = '';
22 22
 	if ($type === 'rubrique') {
23
-		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id));
23
+		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id));
24 24
 		if ($row) {
25 25
 			$titre = typo($row['titre']);
26 26
 			$descriptif = propre($row['descriptif']);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				include_spip('inc/filtres_images_mini');
43 43
 				$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
44 44
 				if ($res) {
45
-					$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
45
+					$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
46 46
 				}
47 47
 			}
48 48
 		}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 		'  '
65 65
 	);
66 66
 
67
-	$js_func = $do . '_selection_titre';
67
+	$js_func = $do.'_selection_titre';
68 68
 
69 69
 	return "<div style='display: none;'>"
70
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
71
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
70
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
71
+	. "<input type='text' id='".$rac."_sel2' value=\""
72 72
 	. entites_html($titre)
73 73
 	. '" />'
74 74
 	. '</div>'
75 75
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
76 76
 	. '<div class="informer__item">'
77 77
 	. (!$res ? '' : $res)
78
-	. "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>'
79
-	. (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>')
78
+	. "<p class='informer__titre'><b>".safehtml($titre).'</b></p>'
79
+	. (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>')
80 80
 	. '</div>'
81
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
81
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
82 82
 	. "<input type='submit' class='fondo btn submit' value='"
83 83
 	. _T('bouton_choisir')
84 84
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.