Completed
Push — master ( 60e317...04d2a0 )
by cam
01:28 queued 10s
created
ecrire/inc/bandeau.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			$_id = $e['id_table_objet'];
51 51
 			if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) {
52 52
 				$table = $e['table_objet_sql'];
53
-				$row = sql_fetsel('*', $table, "$_id=" . intval($id));
53
+				$row = sql_fetsel('*', $table, "$_id=".intval($id));
54 54
 				if (isset($row['id_rubrique'])) {
55 55
 					$contexte['id_rubrique'] = $row['id_rubrique'];
56 56
 					if (isset($row['id_secteur'])) {
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
118 118
 					+ [
119 119
 						$id => new Bouton(
120
-							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
121
-							$infos['titre'],  // titre
120
+							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
121
+							$infos['titre'], // titre
122 122
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
123 123
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
124 124
 						)
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
136 136
 					+ [
137 137
 						$id => new Bouton(
138
-							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
139
-							$infos['titre'],  // titre
138
+							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
139
+							$infos['titre'], // titre
140 140
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
141 141
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
142 142
 						)
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			$libelles = $isfavoris = $favoris = [];
182 182
 			foreach ($menu->sousmenu as $key => $item) {
183 183
 				$libelles[$key] = strtolower(translitteration(_T($item->libelle)));
184
-				$isfavoris[$key] = (bool)$item->favori;
184
+				$isfavoris[$key] = (bool) $item->favori;
185 185
 				$favoris[$key] = $item->favori;
186 186
 			}
187 187
 			if ($avec_favoris) {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		$url = str_replace('&', '&', $url);
224 224
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
225 225
 			if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) {
226
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique']));
226
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique']));
227 227
 			}
228 228
 			$val = _request($matches[2], $contexte);
229 229
 			$url = parametre_url($url, $matches[1], $val ?: '', '&');
Please login to merge, or discard this patch.
ecrire/inc/presenter_enfants.php 1 patch
Spacing   +25 added lines, -26 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	$result = sql_select(
44 44
 		'id_rubrique, id_parent, titre, descriptif, lang',
45 45
 		'spip_rubriques',
46
-		'id_parent=' . intval($collection),
46
+		'id_parent='.intval($collection),
47 47
 		'',
48 48
 		'0+titre,titre',
49 49
 		"$debut,$limite"
@@ -74,19 +74,18 @@  discard block
 block discarded – undo
74 74
 				}
75 75
 			}
76 76
 
77
-			$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' :
78
-					http_img_pack(
77
+			$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack(
79 78
 						'auteur-0minirezo-16.png',
80 79
 						'',
81 80
 						" width='16' height='16'",
82 81
 						_T('image_administrer_rubrique')
83
-					)) .
84
-				" <a class='titremlien' dir='$lang_dir'" .
85
-				($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') .
86
-				" href='" .
87
-				generer_url_entite($id_rubrique, 'rubrique') .
88
-				"'><span class='titre'>" .
89
-				$rang . $titre
82
+					)).
83
+				" <a class='titremlien' dir='$lang_dir'".
84
+				($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : '').
85
+				" href='".
86
+				generer_url_entite($id_rubrique, 'rubrique').
87
+				"'><span class='titre'>".
88
+				$rang.$titre
90 89
 				. '</span>'
91 90
 				. (is_string($logo) ? $logo : '')
92 91
 				. '</a>';
@@ -96,8 +95,8 @@  discard block
 block discarded – undo
96 95
 				;
97 96
 
98 97
 			$res[] =
99
-				debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) .
100
-				$les_sous_enfants .
98
+				debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre).
99
+				$les_sous_enfants.
101 100
 				fin_cadre_sous_rub();
102 101
 		}
103 102
 	}
@@ -116,7 +115,7 @@  discard block
 block discarded – undo
116 115
  *  Le contenu du bloc dépliable
117 116
  */
118 117
 function sous_enfant_rub($collection2) {
119
-	$nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2));
118
+	$nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2));
120 119
 
121 120
 	$retour = '';
122 121
 	$pagination = '';
@@ -128,23 +127,23 @@  discard block
 block discarded – undo
128 127
 	 * Si > 500 on affiche une pagination
129 128
 	 */
130 129
 	if ($nb > $limite) {
131
-		$debut = _request('debut_rubrique' . $collection2) ?: $debut;
130
+		$debut = _request('debut_rubrique'.$collection2) ?: $debut;
132 131
 		$pagination = chercher_filtre('pagination');
133
-		$pagination = '<p class="pagination">' . $pagination(
132
+		$pagination = '<p class="pagination">'.$pagination(
134 133
 			$nb,
135
-			'_rubrique' . $collection2,
134
+			'_rubrique'.$collection2,
136 135
 			$debut,
137 136
 			$limite,
138 137
 			true,
139 138
 			'prive'
140
-		) . '</p>';
139
+		).'</p>';
141 140
 		$limite = $debut + $limite;
142 141
 	}
143 142
 
144 143
 	$result = sql_select(
145 144
 		'id_rubrique, id_parent, titre, lang',
146 145
 		'spip_rubriques',
147
-		'id_parent=' . intval($collection2),
146
+		'id_parent='.intval($collection2),
148 147
 		'',
149 148
 		'0+titre,titre',
150 149
 		"$debut,$limite"
@@ -164,14 +163,14 @@  discard block
 block discarded – undo
164 163
 		changer_typo($row['lang']);
165 164
 		$lang_dir = lang_dir($row['lang']);
166 165
 		if (autoriser('voir', 'rubrique', $id_rubrique2)) {
167
-			$retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_url_entite(
166
+			$retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_url_entite(
168 167
 				$id_rubrique2,
169 168
 				'rubrique'
170
-			) . "'>" . $rang2 . $titre2 . "</a></li>\n";
169
+			)."'>".$rang2.$titre2."</a></li>\n";
171 170
 		}
172 171
 	}
173 172
 
174
-	$retour = $pagination . $retour . $pagination;
173
+	$retour = $pagination.$retour.$pagination;
175 174
 
176 175
 	if (!$retour) {
177 176
 		return '';
@@ -180,7 +179,7 @@  discard block
 block discarded – undo
180 179
 	return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2")
181 180
 	. "\n<ul class='liste-items sous-sous-rub'>\n"
182 181
 	. $retour
183
-	. "</ul>\n" . fin_block() . "\n\n";
182
+	. "</ul>\n".fin_block()."\n\n";
184 183
 }
185 184
 
186 185
 /**
@@ -199,13 +198,13 @@  discard block
 block discarded – undo
199 198
 	$debut = 0;
200 199
 	$limite = 500;
201 200
 
202
-	$nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique));
201
+	$nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique));
203 202
 
204 203
 	if ($nb > $limite) {
205
-		$debut = _request('debut_rubrique' . $id_rubrique) ?: $debut;
204
+		$debut = _request('debut_rubrique'.$id_rubrique) ?: $debut;
206 205
 		$pagination = chercher_filtre('pagination');
207
-		$pagination = '<br class="nettoyeur"><p class="pagination">' .
208
-			$pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') .
206
+		$pagination = '<br class="nettoyeur"><p class="pagination">'.
207
+			$pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive').
209 208
 		'</p>';
210 209
 	}
211 210
 
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_mini.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 	$hsl = _couleur_hex_to_hsl($couleur);
205 205
 	$hsl = [
206 206
 		'h' => round($hsl['h'] * 360),
207
-		's' => round($hsl['s'] * 100) . '%',
208
-		'l' => round($hsl['l'] * 100) . '%'
207
+		's' => round($hsl['s'] * 100).'%',
208
+		'l' => round($hsl['l'] * 100).'%'
209 209
 	];
210 210
 	if ($format === null) {
211 211
 		return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})";
@@ -384,11 +384,11 @@  discard block
 block discarded – undo
384 384
 	$process = 'AUTO'
385 385
 ) {
386 386
 	// PHP 7+ type hint
387
-	$img = (string)$img;
388
-	$taille_x = (int)$taille_x;
389
-	$taille_y = (int)$taille_y;
390
-	$force = (bool)$force;
391
-	$process = (string)$process;
387
+	$img = (string) $img;
388
+	$taille_x = (int) $taille_x;
389
+	$taille_y = (int) $taille_y;
390
+	$force = (bool) $force;
391
+	$process = (string) $process;
392 392
 
393 393
 	if (!$img) {
394 394
 		return '';
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
 	$process = 'AUTO'
466 466
 ) {
467 467
 	// PHP 7+ type hint
468
-	$img = (string)$img;
469
-	$taille = (int)$taille;
470
-	$taille_y = (int)$taille_y;
471
-	$force = (bool)$force;
472
-	$process = (string)$process;
468
+	$img = (string) $img;
469
+	$taille = (int) $taille;
470
+	$taille_y = (int) $taille_y;
471
+	$force = (bool) $force;
472
+	$process = (string) $process;
473 473
 
474 474
 	// Determiner la taille x,y maxi
475 475
 	// prendre le reglage de previsu par defaut
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 	$background_color = 'white'
513 513
 ) {
514 514
 	if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') {
515
-		return image_reduire(image_recadre($im, $width . ':' . $height, '-', $position, $background_color), $width, $height);
515
+		return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height);
516 516
 	} else { return image_passe_partout($im, $width, $height);
517 517
 	}
518 518
 }
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
  **/
534 534
 function image_reduire_par($img, $val = 1, $force = false) {
535 535
 	// PHP 7+ type hint
536
-	$img = (string)$img;
537
-	$val = (int)$val;
538
-	$force = (bool)$force;
536
+	$img = (string) $img;
537
+	$val = (int) $val;
538
+	$force = (bool) $force;
539 539
 
540 540
 	[$hauteur, $largeur] = taille_image($img);
541 541
 
Please login to merge, or discard this patch.
ecrire/inc/log.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 
54 54
 	// si spip_log() dans mes_options, ou repertoire log/ non present, poser dans tmp/
55 55
 	if (!defined('_DIR_LOG') or !$test_repertoire[$d]) {
56
-		$logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log';
56
+		$logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log';
57 57
 	}
58 58
 
59 59
 	$rotate = 0;
60
-	$pid = '(pid ' . @getmypid() . ')';
60
+	$pid = '(pid '.@getmypid().')';
61 61
 
62 62
 	// accepter spip_log( Array )
63 63
 	if (!is_string($message)) {
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 			$fi = substr($fi, strlen(_ROOT_RACINE));
73 73
 		}
74 74
 		$fu = $debug[2]['function'] ?? '';
75
-		$debugverb = "$fi:L$l:$fu" . '():';
75
+		$debugverb = "$fi:L$l:$fu".'():';
76 76
 	}
77 77
 
78
-	$m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' '
78
+	$m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' '
79 79
 		//distinguer les logs prives et publics dans les grep
80 80
 		. $debugverb
81 81
 		. (test_espace_prive() ? ':Pri:' : ':Pub:')
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 		$rotate-- > 0
101 101
 		and function_exists('spip_unlink')
102 102
 	) {
103
-		spip_unlink($logfile . '.' . $rotate);
103
+		spip_unlink($logfile.'.'.$rotate);
104 104
 		while ($rotate--) {
105
-			@rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1));
105
+			@rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1));
106 106
 		}
107 107
 	}
108 108
 
Please login to merge, or discard this patch.
ecrire/inc/envoyer_mail.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 	// ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin
136 136
 	if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) {
137
-		$from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')';
137
+		$from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')';
138 138
 	}
139 139
 
140 140
 	// nettoyer les &eacute; &#8217, &emdash; etc...
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		if (!_TEST_EMAIL_DEST) {
172 172
 			return false;
173 173
 		} else {
174
-			$texte = "Dest : $destinataire\r\n" . $texte;
174
+			$texte = "Dest : $destinataire\r\n".$texte;
175 175
 			$destinataire = _TEST_EMAIL_DEST;
176 176
 		}
177 177
 	}
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	// Ajouter le Content-Type et consort s'il n'y est pas deja
196 196
 	if (strpos($headers, 'Content-Type: ') === false) {
197 197
 		$type =
198
-			"Content-Type: text/plain;charset=\"$charset\";\n" .
198
+			"Content-Type: text/plain;charset=\"$charset\";\n".
199 199
 			"Content-Transfer-Encoding: 8bit\n";
200 200
 	} else {
201 201
 		$type = '';
@@ -207,17 +207,17 @@  discard block
 block discarded – undo
207 207
 		$domain = $domain[0];
208 208
 	}
209 209
 	else {
210
-		$domain = '@unknown-' . md5($from) . '.org';
210
+		$domain = '@unknown-'.md5($from).'.org';
211 211
 	}
212
-	$uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain;
212
+	$uniq = random_int(0, mt_getrandmax()).'_'.md5($to.$texte).$domain;
213 213
 
214 214
 	// Si multi-part, s'en servir comme borne ...
215 215
 	if ($parts) {
216
-		$texte = "--$uniq\n$type\n" . $texte . "\n";
216
+		$texte = "--$uniq\n$type\n".$texte."\n";
217 217
 		foreach ($parts as $part) {
218
-			$n = strlen($part[1]) . ($part[0] ? "\n" : '');
218
+			$n = strlen($part[1]).($part[0] ? "\n" : '');
219 219
 			$e = join("\n", $part[0]);
220
-			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1];
220
+			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1];
221 221
 		}
222 222
 		$texte .= "\n\n--$uniq--\n";
223 223
 		// Si boundary n'est pas entre guillemets,
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 	// .. et s'en servir pour plaire a SpamAssassin
229 229
 
230
-	$mid = 'Message-Id: <' . $uniq . '>';
230
+	$mid = 'Message-Id: <'.$uniq.'>';
231 231
 
232 232
 	// indispensable pour les sites qui collent d'office From: serveur-http
233 233
 	// sauf si deja mis par l'envoyeur
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.