Completed
Push — master ( 11381c...fc67b6 )
by cam
01:49
created
ecrire/action/calculer_taille_cache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@
 block discarded – undo
42 42
 			'ecrire:taille_cache_image',
43 43
 			[
44 44
 				'dir' => joli_repertoire(_DIR_VAR),
45
-				'taille' => '<b>' . (taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet') . '</b>'
45
+				'taille' => '<b>'.(taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet').'</b>'
46 46
 			]
47 47
 		);
48 48
 	} else {
49 49
 		include_spip('inc/invalideur');
50 50
 		$taille =
51 51
 			calculer_taille_dossier(_DIR_CACHE_XML)
52
-			+ calculer_taille_dossier(_DIR_CACHE . 'skel/')
53
-			+ calculer_taille_dossier(_DIR_CACHE . 'wheels/')
54
-			+ calculer_taille_dossier(_DIR_CACHE . 'contextes/');
52
+			+ calculer_taille_dossier(_DIR_CACHE.'skel/')
53
+			+ calculer_taille_dossier(_DIR_CACHE.'wheels/')
54
+			+ calculer_taille_dossier(_DIR_CACHE.'contextes/');
55 55
 		$taille += (int) taille_du_cache();
56 56
 		if ($taille <= 150000) {
57 57
 			$res = _T('taille_cache_vide');
Please login to merge, or discard this patch.
ecrire/action/menu_rubriques.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 	// on renvoi un 401 qui fait echouer la requete ajax silencieusement
39 39
 	if (!autoriser('ecrire')) {
40 40
 		$retour =
41
-		'<ul class="deroulant__sous-menu" data-profondeur="1">' .
42
-			'<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' .
43
-				'<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' .
44
-					'<span class="libelle">' . _T('public:lien_connecter') . '</span>' .
45
-				'</a>' .
46
-			'</li>' .
41
+		'<ul class="deroulant__sous-menu" data-profondeur="1">'.
42
+			'<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'.
43
+				'<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'.
44
+					'<span class="libelle">'._T('public:lien_connecter').'</span>'.
45
+				'</a>'.
46
+			'</li>'.
47 47
 		'</ul>';
48 48
 		include_spip('inc/actions');
49 49
 		ajax_retour($retour);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 
53 53
 	if ($date = (int) _request('date')) {
54
-		header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT');
54
+		header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date).' GMT');
55 55
 	}
56 56
 
57 57
 	$r = gen_liste_rubriques();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		&& !strstr((string) $_SERVER['SERVER_SOFTWARE'], 'IIS/')
62 62
 	) {
63 63
 		include_spip('inc/headers');
64
-		header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']);
64
+		header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']);
65 65
 		http_response_code(304);
66 66
 		exit;
67 67
 	} else {
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
  **/
85 85
 function menu_rubriques($complet = true) {
86 86
 	$ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">'
87
-		. '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">'
88
-		. '<span class="libelle">' . _T('info_tout_site') . '</span>'
87
+		. '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">'
88
+		. '<span class="libelle">'._T('info_tout_site').'</span>'
89 89
 		. '</a>'
90 90
 		. '</li>';
91 91
 
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 	static $zmax = 6;
145 145
 	$profondeur_next = $profondeur + 1;
146 146
 
147
-	$nav = '<a class="deroulant__lien" href="' . generer_objet_url($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">"
148
-		. '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>'
147
+	$nav = '<a class="deroulant__lien" href="'.generer_objet_url($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">"
148
+		. '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>'
149 149
 		. "</a>\n";
150 150
 
151 151
 	// Limiter volontairement le nombre de sous-menus
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	}
182 182
 	$zmax++;
183 183
 
184
-	return $ret . "</ul></li>\n";
184
+	return $ret."</ul></li>\n";
185 185
 }
186 186
 
187 187
 
Please login to merge, or discard this patch.
ecrire/src/Afficher/Minipage/AbstractPage.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 
66 66
 		$page_title = ($options['page_title'] ?? $GLOBALS['meta']['nom_site']);
67 67
 		$doctype = ($options['doctype'] ?? '<!DOCTYPE html>');
68
-		$doctype = trim((string) $doctype) . "\n";
68
+		$doctype = trim((string) $doctype)."\n";
69 69
 		$charset = ($options['charset'] ?? 'utf-8');
70 70
 		$all_inline = ($options['all_inline'] ?? true);
71 71
 		$onLoad = ($options['onLoad'] ?? '');
72 72
 		if ($onLoad) {
73
-			$onLoad = ' onload="' . attribut_html($onLoad) . '"';
73
+			$onLoad = ' onload="'.attribut_html($onLoad).'"';
74 74
 		}
75 75
 
76 76
 		# envoyer le charset
77 77
 		if (!headers_sent()) {
78
-			header('Content-Type: text/html; charset=' . $charset);
78
+			header('Content-Type: text/html; charset='.$charset);
79 79
 		}
80 80
 
81 81
 		$css = '';
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			. "--minipage-color-theme--s: $s;"
95 95
 			. "--minipage-color-theme--l: $l;}";
96 96
 		$vars = file_get_contents(find_in_theme('minipage.vars.css'));
97
-		$inline .= "\n" . trim($vars);
97
+		$inline .= "\n".trim($vars);
98 98
 		if (function_exists('minifier')) {
99 99
 			$inline = minifier($inline, 'css');
100 100
 		}
@@ -121,31 +121,31 @@  discard block
 block discarded – undo
121 121
 			}
122 122
 			$css = "$inline\n$css";
123 123
 			if (!empty($options['css'])) {
124
-				$css .= "\n" . $options['css'];
124
+				$css .= "\n".$options['css'];
125 125
 			}
126 126
 			$css = "<style type='text/css'>$css</style>";
127 127
 		} else {
128 128
 			$css = "<style type='text/css'>$inline</style>";
129 129
 			foreach ($files as $name) {
130 130
 				$file = timestamp(direction_css($name));
131
-				$css .= "<link rel='stylesheet' href='" . attribut_html($file) . "' type='text/css' />\n";
131
+				$css .= "<link rel='stylesheet' href='".attribut_html($file)."' type='text/css' />\n";
132 132
 			}
133 133
 			if (!empty($options['css'])) {
134
-				$css .= "<style type='text/css'>" . $options['css'] . '</style>';
134
+				$css .= "<style type='text/css'>".$options['css'].'</style>';
135 135
 			}
136 136
 		}
137 137
 
138
-		return $doctype .
139
-			html_lang_attributes() .
140
-			"<head>\n" .
141
-			'<title>' .
142
-			textebrut($page_title) .
143
-			"</title>\n" .
144
-			"<meta name=\"viewport\" content=\"width=device-width\" />\n" .
145
-			$css .
146
-			(empty($options['head']) ? '' : $options['head']) .
147
-			"</head>\n" .
148
-			"<body{$onLoad} class=\"minipage" . ($this::TYPE ? ' minipage--' . $this::TYPE : '') . "\">\n" .
138
+		return $doctype.
139
+			html_lang_attributes().
140
+			"<head>\n".
141
+			'<title>'.
142
+			textebrut($page_title).
143
+			"</title>\n".
144
+			"<meta name=\"viewport\" content=\"width=device-width\" />\n".
145
+			$css.
146
+			(empty($options['head']) ? '' : $options['head']).
147
+			"</head>\n".
148
+			"<body{$onLoad} class=\"minipage".($this::TYPE ? ' minipage--'.$this::TYPE : '')."\">\n".
149 149
 			"\t<div class=\"minipage-bloc\">\n";
150 150
 	}
151 151
 
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	protected function ouvreCorps($options = []) {
158 158
 		$url_site = url_de_base();
159
-		$header = "<header>\n" .
160
-			'<h1><a href="' . attribut_html($url_site) . '">' . interdire_scripts($GLOBALS['meta']['nom_site'] ?? '') . "</a></h1>\n";
159
+		$header = "<header>\n".
160
+			'<h1><a href="'.attribut_html($url_site).'">'.interdire_scripts($GLOBALS['meta']['nom_site'] ?? '')."</a></h1>\n";
161 161
 
162 162
 		$titre = ($options['titre'] ?? '');
163 163
 		if ($titre) {
164
-			$header .= '<h2>' . interdire_scripts($titre) . '</h2>';
164
+			$header .= '<h2>'.interdire_scripts($titre).'</h2>';
165 165
 		}
166 166
 		$header .= '</header>';
167 167
 
168
-		return $header . "<div class='corps'>\n";
168
+		return $header."<div class='corps'>\n";
169 169
 	}
170 170
 
171 171
 	/**
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
 		if (isset($options['footer'])) {
180 180
 			$footer = $options['footer'];
181 181
 		} else {
182
-			$footer = '<a href="' . attribut_html($url_site) . '">' . _T('retour') . "</a>\n";
182
+			$footer = '<a href="'.attribut_html($url_site).'">'._T('retour')."</a>\n";
183 183
 		}
184 184
 		if (!empty($footer)) {
185 185
 			$footer = "<footer>\n{$footer}</footer>";
186 186
 		}
187 187
 
188
-		return "</div>\n" . $footer;
188
+		return "</div>\n".$footer;
189 189
 	}
190 190
 
191 191
 
Please login to merge, or discard this patch.
ecrire/public/criteres.php 1 patch
Spacing   +159 added lines, -163 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	$boucle = &$boucles[$idb];
51 51
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
52 52
 
53
-	$c = ["'='", "'$boucle->id_table." . "$id_parent'", 0];
53
+	$c = ["'='", "'$boucle->id_table."."$id_parent'", 0];
54 54
 	$boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c);
55 55
 }
56 56
 
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	$id = $boucle->primary;
74 74
 
75 75
 	if ($not || !$id) {
76
-		return ['zbug_critere_inconnu', ['critere' => $not . $crit->op]];
76
+		return ['zbug_critere_inconnu', ['critere' => $not.$crit->op]];
77 77
 	}
78 78
 	$arg = kwote(calculer_argument_precedent($idb, $id, $boucles));
79
-	$boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg];
79
+	$boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg];
80 80
 }
81 81
 
82 82
 
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 	$not = ($crit->not ? '' : 'NOT');
108 108
 
109 109
 	// le doublon s'applique sur un type de boucle (article)
110
-	$nom = "'" . $boucle->type_requete . "'";
110
+	$nom = "'".$boucle->type_requete."'";
111 111
 
112 112
 	// compléter le nom avec un nom précisé {doublons nom}
113 113
 	// on obtient $nom = "'article' . 'nom'"
114 114
 	if (isset($crit->param[0])) {
115
-		$nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent);
115
+		$nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent);
116 116
 	}
117 117
 
118 118
 	// code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP)
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
 	// $doublons et son index, ici $nom
125 125
 
126 126
 	// debut du code "sql_in('articles.id_article', "
127
-	$debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', ";
127
+	$debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', ";
128 128
 	// lecture des données du doublon "$doublons[$doublon_index[] = "
129 129
 	// Attention : boucle->doublons désigne une variable qu'on affecte
130
-	$debut_doub = '$doublons[' . ($not ? $boucle->doublons . '[]= ' : (''));
130
+	$debut_doub = '$doublons['.($not ? $boucle->doublons.'[]= ' : (''));
131 131
 
132 132
 	// le debut complet du code des doublons
133
-	$debut_doub = $debut_in . $debut_doub;
133
+	$debut_doub = $debut_in.$debut_doub;
134 134
 
135 135
 	// nom du doublon "('article' . 'nom')]"
136 136
 	$fin_doub = "($nom)]";
@@ -140,22 +140,22 @@  discard block
 block discarded – undo
140 140
 	foreach ($boucle->where as $k => $w) {
141 141
 		if (str_starts_with((string) $w[0], $debut_doub)) {
142 142
 			// fusionner le sql_in (du where)
143
-			$boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr((string) $w[0], strlen($debut_in));
143
+			$boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr((string) $w[0], strlen($debut_in));
144 144
 			// fusionner l'initialisation (du hash) pour faire plus joli
145 145
 			$x = strpos((string) $boucle->hash, $init_comment);
146 146
 			$len = strlen($init_comment);
147 147
 			$boucle->hash =
148
-				substr((string) $boucle->hash, 0, $x + $len) . $init_code . substr((string) $boucle->hash, $x + $len);
148
+				substr((string) $boucle->hash, 0, $x + $len).$init_code.substr((string) $boucle->hash, $x + $len);
149 149
 
150 150
 			return;
151 151
 		}
152 152
 	}
153 153
 
154 154
 	// mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante
155
-	$boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"];
155
+	$boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"];
156 156
 
157 157
 	// déclarer le doublon s'il n'existe pas encore
158
-	$boucle->hash .= $init_comment . $init_code;
158
+	$boucle->hash .= $init_comment.$init_code;
159 159
 
160 160
 
161 161
 	# la ligne suivante avait l'intention d'eviter une collecte deja faite
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	$deux = $deux[0]->texte;
218 218
 	if ($deux) {
219 219
 		$boucles[$idb]->limit =
220
-			'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"';
220
+			'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"';
221 221
 	} else {
222 222
 		calculer_critere_DEFAUT_dist($idb, $boucles, $crit);
223 223
 	}
@@ -280,26 +280,26 @@  discard block
 block discarded – undo
280 280
 		$type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent);
281 281
 	}
282 282
 
283
-	$debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr((string) $type, 1));
283
+	$debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr((string) $type, 1));
284 284
 	$boucle->modificateur['debut_nom'] = $type;
285 285
 	$partie =
286 286
 		// tester si le numero de page demande est de la forme '@yyy'
287
-		'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n"
287
+		'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n"
288 288
 		. "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n"
289
-		. "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n"
290
-		. "\t\t" . '$iter->seek(0);' . "\n"
289
+		. "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n"
290
+		. "\t\t".'$iter->seek(0);'."\n"
291 291
 		. "\t}\n"
292
-		. "\t" . '$debut_boucle = intval($debut_boucle)';
292
+		. "\t".'$debut_boucle = intval($debut_boucle)';
293 293
 
294 294
 	$boucle->hash .= '
295
-	$command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');';
295
+	$command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');';
296 296
 
297 297
 	$boucle->total_parties = $pas;
298 298
 	calculer_parties($boucles, $idb, $partie, 'p+');
299 299
 	// ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id
300 300
 	// sauf si pas de primaire, ou si primaire composee
301 301
 	// dans ce cas, on ne sait pas gerer une pagination indirecte
302
-	$t = $boucle->id_table . '.' . $boucle->primary;
302
+	$t = $boucle->id_table.'.'.$boucle->primary;
303 303
 	if (
304 304
 		$boucle->primary
305 305
 		&& !preg_match('/[,\s]/', (string) $boucle->primary)
@@ -346,24 +346,24 @@  discard block
 block discarded – undo
346 346
 	$boucle->hash .= '
347 347
 	// RECHERCHE'
348 348
 		. ($crit->cond ? '
349
-	if (!strlen(' . $quoi . ')){
349
+	if (!strlen(' . $quoi.')){
350 350
 		list($rech_select, $rech_where) = array("0 as points","");
351
-	} else' : '') . '
351
+	} else' : '').'
352 352
 	{
353 353
 		$prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\');
354
-		list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '");
354
+		list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'");
355 355
 	}
356 356
 	';
357 357
 
358 358
 
359
-	$t = $boucle->id_table . '.' . $boucle->primary;
359
+	$t = $boucle->id_table.'.'.$boucle->primary;
360 360
 	if (!in_array($t, $boucles[$idb]->select)) {
361 361
 		$boucle->select[] = $t;
362 362
 	} # pour postgres, neuneu ici
363 363
 	// jointure uniquement sur le serveur principal
364 364
 	// (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal)
365 365
 	if (!$boucle->sql_serveur) {
366
-		$boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"];
366
+		$boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"];
367 367
 		$boucle->from['resultats'] = 'spip_resultats';
368 368
 	}
369 369
 	$boucle->select[] = '$rech_select';
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 	$c =
431 431
 		[
432 432
 			"'OR'",
433
-			["'='", "'$table." . "id_trad'", "'$table.$prim'"],
433
+			["'='", "'$table."."id_trad'", "'$table.$prim'"],
434 434
 			["'='", "'$table.id_trad'", "'0'"]
435 435
 		];
436 436
 	$boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c);
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 	$boucle = &$boucles[$idb];
454 454
 	$arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles));
455 455
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
456
-	$mparent = $boucle->id_table . '.' . $id_parent;
456
+	$mparent = $boucle->id_table.'.'.$id_parent;
457 457
 
458 458
 	if ($boucle->type_requete == 'rubriques' || isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) {
459 459
 		$boucle->where[] = ["'='", "'$mparent'", $arg];
460 460
 	} // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist()
461 461
 	else {
462
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]];
462
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]];
463 463
 	}
464 464
 }
465 465
 
@@ -512,16 +512,16 @@  discard block
 block discarded – undo
512 512
 		if (count(trouver_champs_decomposes($champ, $desc)) > 1) {
513 513
 			$decompose = decompose_champ_id_objet($champ);
514 514
 			$champ = array_shift($decompose);
515
-			$boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"'];
515
+			$boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"'];
516 516
 		}
517 517
 	} else {
518 518
 		$cle = $boucle->id_table;
519 519
 	}
520 520
 
521
-	$c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)"
522
-		. ($not ? ", 'NOT'" : '') . ')';
521
+	$c = "sql_in('$cle".".$champ', calcul_branche_in($arg)"
522
+		. ($not ? ", 'NOT'" : '').')';
523 523
 	$boucle->where[] = $crit->cond
524
-		? "($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')'
524
+		? "($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')'
525 525
 		: $c;
526 526
 }
527 527
 
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 	$not = ($crit->not ? 'NOT' : '');
543 543
 	$serveur = $boucle->sql_serveur;
544 544
 
545
-	$c = "sql_in('" .
546
-		$boucle->id_table . '.' . $boucle->primary
547
-		. "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')";
545
+	$c = "sql_in('".
546
+		$boucle->id_table.'.'.$boucle->primary
547
+		. "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')";
548 548
 
549 549
 	$boucle->where[] = $c;
550 550
 }
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 				$t = table_objet_sql($r[1]);
577 577
 				$t = array_search($t, $boucles[$idb]->from);
578 578
 				if ($t) {
579
-					$t .= '.' . $r[2];
579
+					$t .= '.'.$r[2];
580 580
 				}
581 581
 			}
582 582
 		} else {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 			$boucles[$idb]->select[] = $t;
592 592
 		}
593 593
 	} else {
594
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
594
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
595 595
 	}
596 596
 }
597 597
 
@@ -661,25 +661,25 @@  discard block
 block discarded – undo
661 661
 				(false !== $i = strpos((string) $boucle->order[$n - 1], 'ASC'))
662 662
 				|| (false !== $i = strpos((string) $boucle->order[$n - 1], 'DESC'))
663 663
 			) {
664
-				$boucle->order[$n - 1] = substr_replace((string) $boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0);
664
+				$boucle->order[$n - 1] = substr_replace((string) $boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0);
665 665
 			} else {
666
-				$boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate'];
666
+				$boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate'];
667 667
 			}
668 668
 		}
669 669
 	} else {
670
-		return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]);
670
+		return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]);
671 671
 	}
672 672
 }
673 673
 
674 674
 function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') {
675 675
 	$boucle = $boucles[$idb];
676
-	$alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')';
677
-	$var = '$champs_' . $idb;
676
+	$alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')';
677
+	$var = '$champs_'.$idb;
678 678
 	$desc = (str_contains((string) $boucle->in, (string) "static $var ="));
679 679
 	if (!$desc) {
680 680
 		$desc = $boucle->show['field'];
681 681
 		$desc = implode(',', array_map('_q', array_keys($desc)));
682
-		$boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');';
682
+		$boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');';
683 683
 	}
684 684
 	if ($desc) {
685 685
 		$alt = "(in_array(\$x, $var)  ? $alt :(\$x$suffix))";
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 		$sens = " . ' DESC'";
755 755
 	}
756 756
 	if (isset($boucle->modificateur['collate'])) {
757
-		$collecte = ' . ' . $boucle->modificateur['collate'];
757
+		$collecte = ' . '.$boucle->modificateur['collate'];
758 758
 	}
759 759
 
760 760
 	// Pour chaque paramètre du critère
@@ -776,14 +776,14 @@  discard block
 block discarded – undo
776 776
 			if (preg_match(',^(\w+)[\s]+(.*)$,', (string) $par, $m)) {
777 777
 				$expression = trim($m[1]);
778 778
 				$champ = trim($m[2]);
779
-				if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) {
779
+				if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) {
780 780
 					$order = $f($idb, $boucles, $crit, $tri, $champ);
781 781
 				} else {
782
-					return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
782
+					return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
783 783
 				}
784 784
 
785 785
 			// tris de la forme {par champ} ou {par FONCTION(champ)}
786
-			} elseif ($boucle->type_requete == 'DATA' || preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', (string) $par, $match)) {
786
+			} elseif ($boucle->type_requete == 'DATA' || preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', (string) $par, $match)) {
787 787
 				// {par FONCTION(champ)}
788 788
 				if (isset($match) && count($match) > 2) {
789 789
 					$par = substr($match[2], 1, -1);
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 				if ($par == 'hasard') {
794 794
 					$order = calculer_critere_par_hasard($idb, $boucles, $crit);
795 795
 				} elseif ($par == 'date' && !empty($boucle->show['date'])) {
796
-					$order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'";
796
+					$order = "'".$boucle->id_table.'.'.$boucle->show['date']."'";
797 797
 				} else {
798 798
 					// cas général {par champ}, {par table.champ}, ...
799 799
 					$order = calculer_critere_par_champ($idb, $boucles, $crit, $par);
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 
803 803
 			// on ne sait pas traiter…
804 804
 			else {
805
-				return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
805
+				return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
806 806
 			}
807 807
 
808 808
 			// En cas d'erreur de squelette retournée par une fonction
@@ -822,12 +822,12 @@  discard block
 block discarded – undo
822 822
 
823 823
 		if ($fct) {
824 824
 			$order = preg_match("/^\s*'(.*)'\s*$/", (string) $order, $r)
825
-				? "'$fct(" . $r[1] . ")'"
825
+				? "'$fct(".$r[1].")'"
826 826
 				: "'$fct(' . $order . ')'";
827 827
 		}
828
-		$t = $order . $collecte . $sens;
828
+		$t = $order.$collecte.$sens;
829 829
 		if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) {
830
-			$t = $r[1] . $r[2];
830
+			$t = $r[1].$r[2];
831 831
 		}
832 832
 
833 833
 		$boucle->order[] = $t;
@@ -877,16 +877,16 @@  discard block
 block discarded – undo
877 877
 function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) {
878 878
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
879 879
 	if (is_array($_champ)) {
880
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]];
880
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]];
881 881
 	}
882 882
 	$boucle = &$boucles[$idb];
883
-	$texte = '0+' . $_champ;
883
+	$texte = '0+'.$_champ;
884 884
 	$suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent);
885 885
 	if ($suite !== "''") {
886
-		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "';
886
+		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "';
887 887
 	}
888
-	$asnum = 'num' . ($boucle->order ? count($boucle->order) : '');
889
-	$boucle->select[] = $texte . " AS $asnum";
888
+	$asnum = 'num'.($boucle->order ? count($boucle->order) : '');
889
+	$boucle->select[] = $texte." AS $asnum";
890 890
 
891 891
 	$orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ);
892 892
 	$orderassinum = trim($orderassinum, "'");
@@ -913,13 +913,13 @@  discard block
 block discarded – undo
913 913
 function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) {
914 914
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
915 915
 	if (is_array($_champ)) {
916
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]];
916
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]];
917 917
 	}
918 918
 	$boucle = &$boucles[$idb];
919
-	$texte = '0+' . $_champ;
919
+	$texte = '0+'.$_champ;
920 920
 	$suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent);
921 921
 	if ($suite !== "''") {
922
-		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "';
922
+		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "';
923 923
 	}
924 924
 
925 925
 	$as = false;
@@ -935,8 +935,8 @@  discard block
 block discarded – undo
935 935
 	}
936 936
 
937 937
 	if (!$as) {
938
-		$as = 'sinum' . ($boucle->order ? count($boucle->order) : '');
939
-		$boucle->select[] = $select . $as;
938
+		$as = 'sinum'.($boucle->order ? count($boucle->order) : '');
939
+		$boucle->select[] = $select.$as;
940 940
 	}
941 941
 	return "'$as'";
942 942
 }
@@ -960,10 +960,10 @@  discard block
 block discarded – undo
960 960
 function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) {
961 961
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
962 962
 	if (is_array($_champ)) {
963
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]];
963
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]];
964 964
 	}
965 965
 	$boucle = &$boucles[$idb];
966
-	$boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\"";
966
+	$boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\"";
967 967
 	return "'multi'";
968 968
 }
969 969
 
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 
989 989
 	// le champ existe dans la table, pas de souci (le plus commun)
990 990
 	if (isset($desc['field'][$par])) {
991
-		$par = $boucle->id_table . '.' . $par;
991
+		$par = $boucle->id_table.'.'.$par;
992 992
 	}
993 993
 	// le champ est peut être une jointure
994 994
 	else {
@@ -1009,24 +1009,24 @@  discard block
 block discarded – undo
1009 1009
 		// Sinon on cherche le champ dans les tables possibles de jointures
1010 1010
 		// Si la table est déjà dans le from, on la réutilise.
1011 1011
 		if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) {
1012
-			$par = $infos['alias'] . '.' . $champ;
1012
+			$par = $infos['alias'].'.'.$champ;
1013 1013
 		} elseif (
1014 1014
 			$boucle->jointures_explicites
1015 1015
 			&& ($alias = trouver_jointure_champ($champ, $boucle, explode(' ', (string) $boucle->jointures_explicites), false, $table))
1016 1016
 		) {
1017
-			$par = $alias . '.' . $champ;
1017
+			$par = $alias.'.'.$champ;
1018 1018
 		} elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) {
1019
-			$par = $alias . '.' . $champ;
1019
+			$par = $alias.'.'.$champ;
1020 1020
 		// en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même)
1021 1021
 		} elseif (
1022 1022
 			$table_alias
1023 1023
 			&& isset($boucle->from[$table_alias])
1024 1024
 			&& ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias]))
1025 1025
 		) {
1026
-			$par = $infos['alias'] . '.' . $champ;
1026
+			$par = $infos['alias'].'.'.$champ;
1027 1027
 		} elseif ($table) {
1028 1028
 			// On avait table + champ, mais on ne les a pas trouvés
1029
-			return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
1029
+			return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
1030 1030
 		} else {
1031 1031
 			// Sinon tant pis, ca doit etre un champ synthetise (cf points)
1032 1032
 		}
@@ -1077,9 +1077,9 @@  discard block
 block discarded – undo
1077 1077
 				$boucle->default_order[] = ' DESC';
1078 1078
 			}
1079 1079
 		} else {
1080
-			$t = $boucle->order[$n - 1] . " . $order";
1080
+			$t = $boucle->order[$n - 1]." . $order";
1081 1081
 			if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) {
1082
-				$t = $r[1] . $r[2];
1082
+				$t = $r[1].$r[2];
1083 1083
 			}
1084 1084
 			$boucle->order[$n - 1] = $t;
1085 1085
 		}
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 
1117 1117
 	$_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent);
1118 1118
 
1119
-	$order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens";
1119
+	$order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens";
1120 1120
 	$boucle->order[] = $order;
1121 1121
 }
1122 1122
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 	$params = $crit->param;
1126 1126
 
1127 1127
 	if ((is_countable($params) ? count($params) : 0) < 1) {
1128
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
1128
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
1129 1129
 	}
1130 1130
 
1131 1131
 	$boucle = &$boucles[$idb];
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 	if ((is_countable($date) ? count($date) : 0) == 1 && $date[0]->type == 'texte') {
1147 1147
 		$date = $date[0]->texte;
1148 1148
 		if (!isset($fields[$date])) {
1149
-			return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]];
1149
+			return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]];
1150 1150
 		}
1151 1151
 	} else {
1152 1152
 		$a = calculer_liste($date, $idb, $boucles, $parent);
@@ -1158,38 +1158,38 @@  discard block
 block discarded – undo
1158 1158
 		$date = "'.(($cond)\n?\$a:\"$defaut\").'";
1159 1159
 	}
1160 1160
 	$annee = $params ? array_shift($params) : '';
1161
-	$annee = "\n" . 'sprintf("%04d", ($x = ' .
1162
-		calculer_liste($annee, $idb, $boucles, $parent) .
1161
+	$annee = "\n".'sprintf("%04d", ($x = '.
1162
+		calculer_liste($annee, $idb, $boucles, $parent).
1163 1163
 		') ? $x : date("Y"))';
1164 1164
 
1165 1165
 	$mois = $params ? array_shift($params) : '';
1166
-	$mois = "\n" . 'sprintf("%02d", ($x = ' .
1167
-		calculer_liste($mois, $idb, $boucles, $parent) .
1166
+	$mois = "\n".'sprintf("%02d", ($x = '.
1167
+		calculer_liste($mois, $idb, $boucles, $parent).
1168 1168
 		') ? $x : date("m"))';
1169 1169
 
1170 1170
 	$jour = $params ? array_shift($params) : '';
1171
-	$jour = "\n" . 'sprintf("%02d", ($x = ' .
1172
-		calculer_liste($jour, $idb, $boucles, $parent) .
1171
+	$jour = "\n".'sprintf("%02d", ($x = '.
1172
+		calculer_liste($jour, $idb, $boucles, $parent).
1173 1173
 		') ? $x : date("d"))';
1174 1174
 
1175 1175
 	$annee2 = $params ? array_shift($params) : '';
1176
-	$annee2 = "\n" . 'sprintf("%04d", ($x = ' .
1177
-		calculer_liste($annee2, $idb, $boucles, $parent) .
1176
+	$annee2 = "\n".'sprintf("%04d", ($x = '.
1177
+		calculer_liste($annee2, $idb, $boucles, $parent).
1178 1178
 		') ? $x : date("Y"))';
1179 1179
 
1180 1180
 	$mois2 = $params ? array_shift($params) : '';
1181
-	$mois2 = "\n" . 'sprintf("%02d", ($x = ' .
1182
-		calculer_liste($mois2, $idb, $boucles, $parent) .
1181
+	$mois2 = "\n".'sprintf("%02d", ($x = '.
1182
+		calculer_liste($mois2, $idb, $boucles, $parent).
1183 1183
 		') ? $x : date("m"))';
1184 1184
 
1185 1185
 	$jour2 = $params ? array_shift($params) : '';
1186
-	$jour2 = "\n" . 'sprintf("%02d", ($x = ' .
1187
-		calculer_liste($jour2, $idb, $boucles, $parent) .
1186
+	$jour2 = "\n".'sprintf("%02d", ($x = '.
1187
+		calculer_liste($jour2, $idb, $boucles, $parent).
1188 1188
 		') ? $x : date("d"))';
1189 1189
 
1190
-	$date = $boucle->id_table . ".$date";
1190
+	$date = $boucle->id_table.".$date";
1191 1191
 
1192
-	$quote_end = ",'" . $boucle->sql_serveur . "','text'";
1192
+	$quote_end = ",'".$boucle->sql_serveur."','text'";
1193 1193
 	if ($type == 'jour') {
1194 1194
 		$boucle->where[] = [
1195 1195
 			"'='",
@@ -1261,14 +1261,13 @@  discard block
 block discarded – undo
1261 1261
 	[$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2);
1262 1262
 
1263 1263
 	if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) {
1264
-		$boucle->limit = $a11 . ',' . $a21;
1264
+		$boucle->limit = $a11.','.$a21;
1265 1265
 	} else {
1266 1266
 		// 3 dans {1/3}, {2,3} ou {1,n-3}
1267 1267
 		$boucle->total_parties = ($a21 != 'n') ? $a21 : $a22;
1268 1268
 		// 2 dans {2/3}, {2,5}, {n-2,1}
1269 1269
 		$partie = ($a11 != 'n') ? $a11 : $a12;
1270
-		$mode = (($op == '/') ? '/' :
1271
-			(($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+'));
1270
+		$mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+'));
1272 1271
 		// cas simple {0,#ENV{truc}} compilons le en LIMIT :
1273 1272
 		if ($a11 !== 'n' && $a21 !== 'n' && $mode == '++' && $op == ',') {
1274 1273
 			$boucle->limit =
@@ -1314,8 +1313,7 @@  discard block
 block discarded – undo
1314 1313
 	// {1/3}
1315 1314
 	if ($op1 == '/') {
1316 1315
 		$pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)";
1317
-		$totpos = is_numeric($total_parties) ? ($total_parties) :
1318
-			"($total_parties ? $total_parties : 1)";
1316
+		$totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)";
1319 1317
 		$fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1";
1320 1318
 		$debut = $pmoins1 ? "ceil(($nombre_boucle * $pmoins1)/$totpos);" : 0;
1321 1319
 	} else {
@@ -1326,15 +1324,13 @@  discard block
 block discarded – undo
1326 1324
 
1327 1325
 		// cas {x,n-1}
1328 1326
 		if ($op2 == '-') {
1329
-			$fin = '$debut_boucle + ' . $nombre_boucle . ' - '
1330
-				. (is_numeric($total_parties) ? ($total_parties + 1) :
1331
-					($total_parties . ' - 1'));
1327
+			$fin = '$debut_boucle + '.$nombre_boucle.' - '
1328
+				. (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1'));
1332 1329
 		} else {
1333 1330
 			// {x,1} ou {pagination}
1334 1331
 			$fin = '$debut_boucle'
1335 1332
 				. (is_numeric($total_parties) ?
1336
-					(($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) :
1337
-					('+' . $total_parties . ' - 1'));
1333
+					(($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1'));
1338 1334
 		}
1339 1335
 
1340 1336
 		// {pagination}, gerer le debut_xx=-1 pour tout voir
@@ -1352,11 +1348,11 @@  discard block
 block discarded – undo
1352 1348
 	// Utiliser min pour rabattre $fin_boucle sur total_boucle.
1353 1349
 
1354 1350
 	$boucles[$id_boucle]->mode_partie = "\n\t"
1355
-		. '$debut_boucle = ' . $debut . ";\n	"
1351
+		. '$debut_boucle = '.$debut.";\n	"
1356 1352
 		. "\$debut_boucle = intval(\$debut_boucle);\n	"
1357
-		. '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n	"
1358
-		. '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n	"
1359
-		. '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);'
1353
+		. '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n	"
1354
+		. '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n	"
1355
+		. '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);'
1360 1356
 		. "\n\tif (\$debut_boucle>0"
1361 1357
 		. " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']"
1362 1358
 		. " AND \$iter->seek(\$debut_boucle,'continue'))"
@@ -1441,14 +1437,14 @@  discard block
 block discarded – undo
1441 1437
 		// critere personnalise ?
1442 1438
 		if (
1443 1439
 			(!$serveur
1444
-				|| !function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere)
1440
+				|| !function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere)
1445 1441
 				&& !function_exists($f .= '_dist')
1446
-				&& !function_exists($f = 'critere_' . $serveur . '_' . $critere)
1442
+				&& !function_exists($f = 'critere_'.$serveur.'_'.$critere)
1447 1443
 				&& !function_exists($f .= '_dist')
1448 1444
 			)
1449
-			&& !function_exists($f = 'critere_' . $table . '_' . $critere)
1445
+			&& !function_exists($f = 'critere_'.$table.'_'.$critere)
1450 1446
 			&& !function_exists($f .= '_dist')
1451
-			&& !function_exists($f = 'critere_' . $critere)
1447
+			&& !function_exists($f = 'critere_'.$critere)
1452 1448
 			&& !function_exists($f .= '_dist')
1453 1449
 		) {
1454 1450
 			// fonction critere standard
@@ -1480,9 +1476,9 @@  discard block
 block discarded – undo
1480 1476
  */
1481 1477
 function kwote($lisp, $serveur = '', $type = '') {
1482 1478
 	if (preg_match(_CODE_QUOTE, $lisp, $r)) {
1483
-		return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"';
1479
+		return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"';
1484 1480
 	} else {
1485
-		return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')";
1481
+		return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')";
1486 1482
 	}
1487 1483
 }
1488 1484
 
@@ -1504,7 +1500,7 @@  discard block
 block discarded – undo
1504 1500
 function critere_IN_dist($idb, &$boucles, $crit) {
1505 1501
 	$r = calculer_critere_infixe($idb, $boucles, $crit);
1506 1502
 	if (!$r) {
1507
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
1503
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
1508 1504
 	}
1509 1505
 	[$arg, $op, $val, $col, $where_complement] = $r;
1510 1506
 
@@ -1529,8 +1525,8 @@  discard block
 block discarded – undo
1529 1525
 				"'NOT'",
1530 1526
 				[
1531 1527
 					"'IN'",
1532
-					"'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'",
1533
-					["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where]
1528
+					"'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'",
1529
+					["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where]
1534 1530
 				]
1535 1531
 			];
1536 1532
 		}
@@ -1547,22 +1543,22 @@  discard block
 block discarded – undo
1547 1543
 	$descr = $boucles[$idb]->descr;
1548 1544
 	$cpt = &$num[$descr['nom']][$descr['gram']][$idb];
1549 1545
 
1550
-	$var = '$in' . $cpt++;
1546
+	$var = '$in'.$cpt++;
1551 1547
 	$x = "\n\t$var = array();";
1552 1548
 	foreach ($val as $k => $v) {
1553 1549
 		if (preg_match(",^(\n//.*\n)?'(.*)'$,", (string) $v, $r)) {
1554 1550
 			// optimiser le traitement des constantes
1555 1551
 			if (is_numeric($r[2])) {
1556
-				$x .= "\n\t$var" . "[]= $r[2];";
1552
+				$x .= "\n\t$var"."[]= $r[2];";
1557 1553
 			} else {
1558
-				$x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';';
1554
+				$x .= "\n\t$var".'[]= '.sql_quote($r[2]).';';
1559 1555
 			}
1560 1556
 		} else {
1561 1557
 			// Pour permettre de passer des tableaux de valeurs
1562 1558
 			// on repere l'utilisation brute de #ENV**{X},
1563 1559
 			// c'est-a-dire sa  traduction en ($PILE[0][X]).
1564 1560
 			// et on deballe mais en rajoutant l'anti XSS
1565
-			$x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);";
1561
+			$x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);";
1566 1562
 		}
1567 1563
 	}
1568 1564
 
@@ -1576,7 +1572,7 @@  discard block
 block discarded – undo
1576 1572
 		$boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))";
1577 1573
 	}
1578 1574
 
1579
-	return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')';
1575
+	return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')';
1580 1576
 }
1581 1577
 
1582 1578
 /**
@@ -1649,7 +1645,7 @@  discard block
 block discarded – undo
1649 1645
 		$champs = array_diff($champs, array_keys($boucle->modificateur['criteres']));
1650 1646
 	}
1651 1647
 	// nous aider en mode debug.
1652
-	$boucle->debug[] = 'id_ : ' . implode(', ', $champs);
1648
+	$boucle->debug[] = 'id_ : '.implode(', ', $champs);
1653 1649
 	$boucle->modificateur['id_'] = $champs;
1654 1650
 
1655 1651
 	// créer un critère {id_xxx?} de chaque champ retenu
@@ -1904,8 +1900,8 @@  discard block
 block discarded – undo
1904 1900
 				"'NOT'",
1905 1901
 				[
1906 1902
 					"'IN'",
1907
-					"'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'",
1908
-					["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where]
1903
+					"'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'",
1904
+					["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where]
1909 1905
 				]
1910 1906
 			];
1911 1907
 		}
@@ -1915,7 +1911,7 @@  discard block
 block discarded – undo
1915 1911
 	// traiter a part la date, elle est mise d'office par SPIP,
1916 1912
 	if ($crit->cond) {
1917 1913
 		$pred = calculer_argument_precedent($idb, $col, $boucles);
1918
-		if (($col === 'date' || $col === 'date_redac') && $pred === "\$Pile[0]['" . $col . "']") {
1914
+		if (($col === 'date' || $col === 'date_redac') && $pred === "\$Pile[0]['".$col."']") {
1919 1915
 			$pred = "(\$Pile[0]['{$col}_default']?'':$pred)";
1920 1916
 		}
1921 1917
 
@@ -2077,7 +2073,7 @@  discard block
 block discarded – undo
2077 2073
 		// defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon
2078 2074
 		// prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut
2079 2075
 		if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", (string) $val[0], $r)) {
2080
-			$val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"';
2076
+			$val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"';
2081 2077
 		}
2082 2078
 		// sinon expliciter les
2083 2079
 		// sql_quote(truc) en sql_quote(truc,'',type)
@@ -2092,14 +2088,14 @@  discard block
 block discarded – undo
2092 2088
 		) {
2093 2089
 			$r = $r[1]
2094 2090
 				. ((isset($r[2]) && $r[2]) ? $r[2] : ",''")
2095
-				. ",'" . addslashes((string) $type_cast_quote) . "'";
2091
+				. ",'".addslashes((string) $type_cast_quote)."'";
2096 2092
 			$val[0] = "sql_quote($r)";
2097 2093
 		}
2098 2094
 		elseif (
2099 2095
 			str_contains((string) $val[0], '@@defaultcast@@')
2100 2096
 			&& preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r)
2101 2097
 		) {
2102
-			$val[0] = substr((string) $val[0], 0, -strlen($r[0])) . "'" . addslashes((string) $type_cast_quote) . "')";
2098
+			$val[0] = substr((string) $val[0], 0, -strlen($r[0]))."'".addslashes((string) $type_cast_quote)."')";
2103 2099
 		}
2104 2100
 	}
2105 2101
 
@@ -2107,7 +2103,7 @@  discard block
 block discarded – undo
2107 2103
 		str_contains((string) $val[0], '@@defaultcast@@')
2108 2104
 		&& preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r)
2109 2105
 	) {
2110
-		$val[0] = substr((string) $val[0], 0, -strlen($r[0])) . "'char')";
2106
+		$val[0] = substr((string) $val[0], 0, -strlen($r[0]))."'char')";
2111 2107
 	}
2112 2108
 
2113 2109
 	// Indicateur pour permettre aux fonctionx boucle_X de modifier
@@ -2122,7 +2118,7 @@  discard block
 block discarded – undo
2122 2118
 
2123 2119
 	// inserer le nom de la table SQL devant le nom du champ
2124 2120
 	if ($table) {
2125
-		$arg = $col[0] == '`' ? "$table." . substr((string) $col, 1, -1) : "$table.$col";
2121
+		$arg = $col[0] == '`' ? "$table.".substr((string) $col, 1, -1) : "$table.$col";
2126 2122
 	} else {
2127 2123
 		$arg = $col;
2128 2124
 	}
@@ -2251,9 +2247,9 @@  discard block
 block discarded – undo
2251 2247
  **/
2252 2248
 function primary_doublee($decompose, $table) {
2253 2249
 	$e1 = reset($decompose);
2254
-	$e2 = "sql_quote('" . end($decompose) . "')";
2250
+	$e2 = "sql_quote('".end($decompose)."')";
2255 2251
 
2256
-	return ["'='", "'$table." . $e1 . "'", $e2];
2252
+	return ["'='", "'$table.".$e1."'", $e2];
2257 2253
 }
2258 2254
 
2259 2255
 /**
@@ -2292,7 +2288,7 @@  discard block
 block discarded – undo
2292 2288
 		$checkarrivee
2293 2289
 		&& is_string($checkarrivee)
2294 2290
 		&& ($a = table_objet($checkarrivee))
2295
-		&& in_array($a . '_liens', $joints)
2291
+		&& in_array($a.'_liens', $joints)
2296 2292
 		&& ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee))
2297 2293
 	) {
2298 2294
 		return $res;
@@ -2311,12 +2307,12 @@  discard block
 block discarded – undo
2311 2307
 				// la table est déjà dans le FROM, on vérifie si le champ est utilisé.
2312 2308
 				$joindre = false;
2313 2309
 				foreach ($cols as $col) {
2314
-					$c = '/\b' . $t . ".$col" . '\b/';
2310
+					$c = '/\b'.$t.".$col".'\b/';
2315 2311
 					if (trouver_champ($c, $boucle->where)) {
2316 2312
 						$joindre = true;
2317 2313
 					} else {
2318 2314
 						// mais ca peut etre dans le FIELD pour le Having
2319
-						$c = "/FIELD.$t" . ".$col,/";
2315
+						$c = "/FIELD.$t".".$col,/";
2320 2316
 						if (trouver_champ($c, $boucle->select)) {
2321 2317
 							$joindre = true;
2322 2318
 						}
@@ -2362,7 +2358,7 @@  discard block
 block discarded – undo
2362 2358
 	$primary_arrivee = id_table_objet($checkarrivee);
2363 2359
 
2364 2360
 	// [FIXME] $checkarrivee peut-il arriver avec false ????
2365
-	$intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens');
2361
+	$intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens');
2366 2362
 	$arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee);
2367 2363
 
2368 2364
 	if (!$intermediaire || !$arrivee) {
@@ -2466,7 +2462,7 @@  discard block
 block discarded – undo
2466 2462
 			} elseif ($crit->cond && ($col == 'date' || $col == 'date_redac')) {
2467 2463
 				// un critere conditionnel sur date est traite a part
2468 2464
 				// car la date est mise d'office par SPIP,
2469
-				$defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])";
2465
+				$defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])";
2470 2466
 			}
2471 2467
 
2472 2468
 			$val = calculer_argument_precedent($idb, $val, $boucles, $defaut);
@@ -2498,7 +2494,7 @@  discard block
 block discarded – undo
2498 2494
 			&& ($p == "'" || $p == '"')
2499 2495
 			&& $params[0][1]->type == 'champ'
2500 2496
 		) {
2501
-			$val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p";
2497
+			$val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p";
2502 2498
 		} else {
2503 2499
 			foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) {
2504 2500
 				$a = calculer_liste($p, $idb, $boucles, $parent);
@@ -2513,7 +2509,7 @@  discard block
 block discarded – undo
2513 2509
 	$fct = $args_sql = '';
2514 2510
 	// fonction SQL ?
2515 2511
 	// chercher FONCTION(champ) tel que CONCAT(titre,descriptif)
2516
-	if (preg_match('/^(.*)' . SQL_ARGS . '$/', (string) $col, $m)) {
2512
+	if (preg_match('/^(.*)'.SQL_ARGS.'$/', (string) $col, $m)) {
2517 2513
 		$fct = $m[1];
2518 2514
 		preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a);
2519 2515
 		$col = $a[1];
@@ -2599,7 +2595,7 @@  discard block
 block discarded – undo
2599 2595
 	if (isset($regs[3]) && ($suite = $regs[3])) {
2600 2596
 		# Recherche de l'existence du champ date_xxxx,
2601 2597
 		# si oui choisir ce champ, sinon choisir xxxx
2602
-		$date_orig = isset($table['field']["date$suite"]) ? 'date' . $suite : substr($suite, 1);
2598
+		$date_orig = isset($table['field']["date$suite"]) ? 'date'.$suite : substr($suite, 1);
2603 2599
 
2604 2600
 		$pred = $date_orig;
2605 2601
 	} else { // Sinon il FAUT avoir déclaré le champ date officiel dans l'API objet
@@ -2616,12 +2612,12 @@  discard block
 block discarded – undo
2616 2612
 		}
2617 2613
 	}
2618 2614
 
2619
-	$date_compare = "\"' . normaliser_date(" .
2620
-		calculer_argument_precedent($idb, $pred, $boucles) .
2615
+	$date_compare = "\"' . normaliser_date(".
2616
+		calculer_argument_precedent($idb, $pred, $boucles).
2621 2617
 		") . '\"";
2622 2618
 
2623 2619
 	$col_vraie = $date_orig;
2624
-	$date_orig = $boucle->id_table . '.' . $date_orig;
2620
+	$date_orig = $boucle->id_table.'.'.$date_orig;
2625 2621
 
2626 2622
 	switch ($col) {
2627 2623
 		case 'date':
@@ -2641,26 +2637,26 @@  discard block
 block discarded – undo
2641 2637
 			break;
2642 2638
 		case 'age':
2643 2639
 			$col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig);
2644
-			$col_vraie = '';// comparer a un int (par defaut)
2640
+			$col_vraie = ''; // comparer a un int (par defaut)
2645 2641
 			break;
2646 2642
 		case 'age_relatif':
2647 2643
 			$col = calculer_param_date($date_compare, $date_orig);
2648
-			$col_vraie = '';// comparer a un int (par defaut)
2644
+			$col_vraie = ''; // comparer a un int (par defaut)
2649 2645
 			break;
2650 2646
 		case 'jour_relatif':
2651
-			$col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))';
2652
-			$col_vraie = '';// comparer a un int (par defaut)
2647
+			$col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))';
2648
+			$col_vraie = ''; // comparer a un int (par defaut)
2653 2649
 			break;
2654 2650
 		case 'mois_relatif':
2655
-			$col = 'MONTH(' . $date_compare . ')-MONTH(' .
2656
-				$date_orig . ')+12*(YEAR(' . $date_compare .
2657
-				')-YEAR(' . $date_orig . '))';
2658
-			$col_vraie = '';// comparer a un int (par defaut)
2651
+			$col = 'MONTH('.$date_compare.')-MONTH('.
2652
+				$date_orig.')+12*(YEAR('.$date_compare.
2653
+				')-YEAR('.$date_orig.'))';
2654
+			$col_vraie = ''; // comparer a un int (par defaut)
2659 2655
 			break;
2660 2656
 		case 'annee_relatif':
2661
-			$col = 'YEAR(' . $date_compare . ')-YEAR(' .
2662
-				$date_orig . ')';
2663
-			$col_vraie = '';// comparer a un int (par defaut)
2657
+			$col = 'YEAR('.$date_compare.')-YEAR('.
2658
+				$date_orig.')';
2659
+			$col_vraie = ''; // comparer a un int (par defaut)
2664 2660
 			break;
2665 2661
 	}
2666 2662
 
@@ -2718,10 +2714,10 @@  discard block
 block discarded – undo
2718 2714
 	}
2719 2715
 
2720 2716
 	$boucle->hash .= '
2721
-	$command[\'sourcemode\'] = ' . array_shift($args) . ";\n";
2717
+	$command[\'sourcemode\'] = ' . array_shift($args).";\n";
2722 2718
 
2723 2719
 	$boucle->hash .= '
2724
-	$command[\'source\'] = array(' . implode(', ', $args) . ");\n";
2720
+	$command[\'source\'] = array(' . implode(', ', $args).");\n";
2725 2721
 }
2726 2722
 
2727 2723
 /**
@@ -2740,7 +2736,7 @@  discard block
 block discarded – undo
2740 2736
 function critere_DATA_datacache_dist($idb, &$boucles, $crit) {
2741 2737
 	$boucle = &$boucles[$idb];
2742 2738
 	$boucle->hash .= '
2743
-	$command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2739
+	$command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';';
2744 2740
 }
2745 2741
 
2746 2742
 
@@ -2759,7 +2755,7 @@  discard block
 block discarded – undo
2759 2755
 	$boucle->hash .= '$command[\'args\']=array();';
2760 2756
 	foreach ($crit->param as $param) {
2761 2757
 		$boucle->hash .= '
2762
-			$command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2758
+			$command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';';
2763 2759
 	}
2764 2760
 }
2765 2761
 
@@ -2778,14 +2774,14 @@  discard block
 block discarded – undo
2778 2774
  */
2779 2775
 function critere_DATA_liste_dist($idb, &$boucles, $crit) {
2780 2776
 	$boucle = &$boucles[$idb];
2781
-	$boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n";
2777
+	$boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n";
2782 2778
 	foreach ($crit->param as $param) {
2783
-		$boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste(
2779
+		$boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste(
2784 2780
 			$param,
2785 2781
 			$idb,
2786 2782
 			$boucles,
2787 2783
 			$boucles[$idb]->id_parent
2788
-		) . ";\n";
2784
+		).";\n";
2789 2785
 	}
2790 2786
 }
2791 2787
 
@@ -2812,14 +2808,14 @@  discard block
 block discarded – undo
2812 2808
  */
2813 2809
 function critere_DATA_enum_dist($idb, &$boucles, $crit) {
2814 2810
 	$boucle = &$boucles[$idb];
2815
-	$boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n";
2811
+	$boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n";
2816 2812
 	foreach ($crit->param as $param) {
2817
-		$boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste(
2813
+		$boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste(
2818 2814
 			$param,
2819 2815
 			$idb,
2820 2816
 			$boucles,
2821 2817
 			$boucles[$idb]->id_parent
2822
-		) . ";\n";
2818
+		).";\n";
2823 2819
 	}
2824 2820
 }
2825 2821
 
@@ -2838,7 +2834,7 @@  discard block
 block discarded – undo
2838 2834
 	$boucle = &$boucles[$idb];
2839 2835
 	foreach ($crit->param as $param) {
2840 2836
 		$boucle->hash .= '
2841
-			$command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2837
+			$command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';';
2842 2838
 	}
2843 2839
 }
2844 2840
 
@@ -2879,7 +2875,7 @@  discard block
 block discarded – undo
2879 2875
 	if ($crit->param) {
2880 2876
 		foreach ($crit->param as $param) {
2881 2877
 			$boucle->hash .= "\t\$command['si'][] = "
2882
-				. calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n";
2878
+				. calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n";
2883 2879
 		}
2884 2880
 		// interdire {si 0} aussi !
2885 2881
 	} else {
@@ -2917,7 +2913,7 @@  discard block
 block discarded – undo
2917 2913
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
2918 2914
 
2919 2915
 	$in = 'IN';
2920
-	$where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"];
2916
+	$where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"];
2921 2917
 	if ($not) {
2922 2918
 		$where = ["'NOT'", $where];
2923 2919
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 		}
44 44
 		if (preg_match('#^([12]\d{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
45 45
 			$regs = array_pad($regs, 4, null); // eviter notice php
46
-			$date = $regs[1] . '-00-00' . $regs[3];
46
+			$date = $regs[1].'-00-00'.$regs[3];
47 47
 		} else {
48 48
 			if (preg_match('#^([12]\d{3}[-/][01]?\d)([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
49 49
 				$regs = array_pad($regs, 4, null); // eviter notice php
50
-				$date = preg_replace('@/@', '-', (string) $regs[1]) . '-00' . $regs[3];
50
+				$date = preg_replace('@/@', '-', (string) $regs[1]).'-00'.$regs[3];
51 51
 			} else {
52 52
 				$date = date('Y-m-d H:i:s', strtotime($date));
53 53
 			}
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	$letexte ??= '';
75 75
 	if (
76 76
 		!$verif_format_date
77
-		|| in_array(strlen($letexte), [10,19]) && preg_match('/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/', $letexte)
77
+		|| in_array(strlen($letexte), [10, 19]) && preg_match('/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/', $letexte)
78 78
 	) {
79 79
 		if (strncmp('0000-00-00', $letexte, 10) == 0) {
80 80
 			return '';
@@ -359,39 +359,39 @@  discard block
 block discarded – undo
359 359
 	if ($decal > 3600 * 24 * 30) {
360 360
 		$mois = floor($decal / (3600 * 24 * 30));
361 361
 		$delai = $mois < 2
362
-			? "$mois " . _T('date_un_mois')
363
-			: "$mois " . _T('date_mois');
362
+			? "$mois "._T('date_un_mois')
363
+			: "$mois "._T('date_mois');
364 364
 	} else {
365 365
 		if ($decal > 3600 * 24 * 7) {
366 366
 			$semaines = floor($decal / (3600 * 24 * 7));
367 367
 			$delai = $semaines < 2
368
-				? "$semaines " . _T('date_une_semaine')
369
-				: "$semaines " . _T('date_semaines');
368
+				? "$semaines "._T('date_une_semaine')
369
+				: "$semaines "._T('date_semaines');
370 370
 		} else {
371 371
 			if ($decal > 3600 * 24) {
372 372
 				$jours = floor($decal / (3600 * 24));
373 373
 				if ($jours < 2) {
374 374
 					return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier');
375 375
 				} else {
376
-					$delai = "$jours " . _T('date_jours');
376
+					$delai = "$jours "._T('date_jours');
377 377
 				}
378 378
 			} else {
379 379
 				if ($decal >= 3600) {
380 380
 					$heures = floor($decal / 3600);
381 381
 					$delai = $heures < 2
382
-						? "$heures " . _T('date_une_heure')
383
-						: "$heures " . _T('date_heures');
382
+						? "$heures "._T('date_une_heure')
383
+						: "$heures "._T('date_heures');
384 384
 				} else {
385 385
 					if ($decal >= 60) {
386 386
 						$minutes = floor($decal / 60);
387 387
 						$delai = $minutes < 2
388
-							? "$minutes " . _T('date_une_minute')
389
-							: "$minutes " . _T('date_minutes');
388
+							? "$minutes "._T('date_une_minute')
389
+							: "$minutes "._T('date_minutes');
390 390
 					} else {
391 391
 						$secondes = ceil($decal);
392 392
 						$delai = $secondes < 2
393
-							? "$secondes " . _T('date_une_seconde')
394
-							: "$secondes " . _T('date_secondes');
393
+							? "$secondes "._T('date_une_seconde')
394
+							: "$secondes "._T('date_secondes');
395 395
 					}
396 396
 				}
397 397
 			}
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		$njour = 0;
482 482
 	} else {
483 483
 		$njour = (int) $jour;
484
-		if ($jourth = _T('date_jnum' . $jour)) {
484
+		if ($jourth = _T('date_jnum'.$jour)) {
485 485
 			$jour = $jourth;
486 486
 		}
487 487
 	}
@@ -489,10 +489,10 @@  discard block
 block discarded – undo
489 489
 	$mois = (int) $mois;
490 490
 	if ($mois > 0 && $mois < 13) {
491 491
 		/* Traiter le cas "abbr" pour les noms de mois */
492
-		$param = ((isset($options['param']) && $options['param'] === 'abbr') ? '_' . $options['param'] : '');
493
-		$nommois = _T('date_mois_' . $mois . $param);
492
+		$param = ((isset($options['param']) && $options['param'] === 'abbr') ? '_'.$options['param'] : '');
493
+		$nommois = _T('date_mois_'.$mois.$param);
494 494
 		$jourmois = $jour
495
-			? _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois])
495
+			? _T('date_de_mois_'.$mois, ['j' => $jour, 'nommois' => $nommois])
496 496
 			: $nommois;
497 497
 	} else {
498 498
 		$nommois = '';
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	}
501 501
 
502 502
 	if ($annee < 0) {
503
-		$annee = -$annee . ' ' . _T('date_avant_jc');
503
+		$annee = -$annee.' '._T('date_avant_jc');
504 504
 		$avjc = true;
505 505
 	} else {
506 506
 		$avjc = false;
@@ -526,11 +526,11 @@  discard block
 block discarded – undo
526 526
 				}
527 527
 			}
528 528
 			if ($vue == 'saison') {
529
-				return $saison ? _T('date_saison_' . $saison) : '';
529
+				return $saison ? _T('date_saison_'.$saison) : '';
530 530
 			} else {
531 531
 				return $saison ? trim((string) _T(
532 532
 					'date_fmt_saison_annee',
533
-					['saison' => _T('date_saison_' . $saison), 'annee' => $annee]
533
+					['saison' => _T('date_saison_'.$saison), 'annee' => $annee]
534 534
 				)) : '';
535 535
 			}
536 536
 
@@ -607,9 +607,9 @@  discard block
 block discarded – undo
607 607
 			}
608 608
 			$nom = mktime(1, 1, 1, $mois, $njour, $annee);
609 609
 			$nom = 1 + (int) date('w', $nom);
610
-			$param = ((isset($options['param']) && $options['param']) ? '_' . $options['param'] : '');
610
+			$param = ((isset($options['param']) && $options['param']) ? '_'.$options['param'] : '');
611 611
 
612
-			return _T('date_jour_' . $nom . $param);
612
+			return _T('date_jour_'.$nom.$param);
613 613
 
614 614
 		case 'mois_annee':
615 615
 			if ($avjc) {
@@ -1005,8 +1005,8 @@  discard block
 block discarded – undo
1005 1005
 
1006 1006
 	$dtstart = $dtend = $dtabbr = '';
1007 1007
 	if (str_contains($forme, 'hcal')) {
1008
-		$dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1009
-		$dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1008
+		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
1009
+		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
1010 1010
 		$dtabbr = '</abbr>';
1011 1011
 	}
1012 1012
 
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 			}
1055 1055
 		} else {
1056 1056
 			$s = $dtabbr && $dtstart
1057
-				? $dtstart . spip_ucfirst($s) . $dtabbr
1057
+				? $dtstart.spip_ucfirst($s).$dtabbr
1058 1058
 				: spip_ucfirst($s);
1059 1059
 		}
1060 1060
 	} else {
@@ -1073,8 +1073,8 @@  discard block
 block discarded – undo
1073 1073
 				$date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1074 1074
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1075 1075
 			}
1076
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1077
-			$date_fin = $dtend . $date_fin . $dtabbr;
1076
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1077
+			$date_fin = $dtend.$date_fin.$dtabbr;
1078 1078
 
1079 1079
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1080 1080
 		} else {
@@ -1091,8 +1091,8 @@  discard block
 block discarded – undo
1091 1091
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1092 1092
 			}
1093 1093
 
1094
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1095
-			$date_fin = $dtend . $date_fin . $dtabbr;
1094
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1095
+			$date_fin = $dtend.$date_fin.$dtabbr;
1096 1096
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1097 1097
 		}
1098 1098
 	}
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 		$d = date('Y-m-d');
1200 1200
 	}
1201 1201
 
1202
-	return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1202
+	return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2);
1203 1203
 }
1204 1204
 
1205 1205
 /**
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 		$d = date('Y-m-d');
1220 1220
 	}
1221 1221
 
1222
-	return substr($d, 0, 4) . substr($d, 5, 2);
1222
+	return substr($d, 0, 4).substr($d, 5, 2);
1223 1223
 }
1224 1224
 
1225 1225
 /**
Please login to merge, or discard this patch.
ecrire/inc/chercher_logo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@
 block discarded – undo
37 37
 	$mode = preg_replace(',\W,', '', $mode);
38 38
 	if ($mode) {
39 39
 		// chercher dans la base
40
-		$mode_document = 'logo' . $mode;
40
+		$mode_document = 'logo'.$mode;
41 41
 		$objet = objet_type($_id_objet);
42 42
 		$doc = sql_fetsel(
43 43
 			'D.*',
44 44
 			'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document',
45
-			'D.mode=' . sql_quote($mode_document) . ' AND L.objet=' . sql_quote($objet) . ' AND id_objet=' . $id
45
+			'D.mode='.sql_quote($mode_document).' AND L.objet='.sql_quote($objet).' AND id_objet='.$id
46 46
 		);
47 47
 		if ($doc) {
48 48
 			include_spip('inc/documents');
Please login to merge, or discard this patch.
prive/formulaires/editer_liens.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	// L'éditabilité :) est définie par un test permanent (par exemple "associermots") ET le 4ème argument
106 106
 	include_spip('inc/autoriser');
107 107
 	$editable = ($editable
108
-		&& autoriser('associer' . $table_source, $objet, $id_objet)
108
+		&& autoriser('associer'.$table_source, $objet, $id_objet)
109 109
 		&& 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 = '';
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 function lien_retrouver_qualif($objet_lien, $lien) {
425 425
 	// un role est défini dans la liaison
426 426
 	$defs = explode('-', $lien);
427
-	[$objet1, , $objet2, , $role] = array_pad($defs, 5, null);
427
+	[$objet1,, $objet2,, $role] = array_pad($defs, 5, null);
428 428
 	$colonne_role = $objet_lien == $objet1 ? roles_colonne($objet1, $objet2) : roles_colonne($objet2, $objet1);
429 429
 
430 430
 	// cas ou le role est defini en 5e argument de l'action sur le lien (suppression, ajout rapide sans autre attribut)
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 		do {
599 599
 			$t = array_shift($trace);
600 600
 			$function = $t['function'] ?? '';
601
-			if (str_starts_with((string) $function, 'formulaires_' . $form)) {
601
+			if (str_starts_with((string) $function, 'formulaires_'.$form)) {
602 602
 				if (isset($t['args'])) {
603 603
 					$args = json_encode($t['args'], JSON_THROW_ON_ERROR);
604 604
 				}
Please login to merge, or discard this patch.
rector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 use Rector\Php71\Rector\FuncCall\CountOnNullRector;
10 10
 use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
11 11
 
12
-return static function (RectorConfig $rectorConfig): void {
12
+return static function(RectorConfig $rectorConfig): void {
13 13
     $rectorConfig->paths([
14
-        __DIR__ . '/ecrire',
15
-        __DIR__ . '/prive',
16
-        __DIR__ . '/spip.php',
17
-        __DIR__ . '/index.php',
14
+        __DIR__.'/ecrire',
15
+        __DIR__.'/prive',
16
+        __DIR__.'/spip.php',
17
+        __DIR__.'/index.php',
18 18
     ]);
19 19
 
20 20
 	$rectorConfig->sets([
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	]);
23 23
 
24 24
     $rectorConfig->skip([
25
-        __DIR__ . '/ecrire/lang',
25
+        __DIR__.'/ecrire/lang',
26 26
 		FinalizePublicClassConstantRector::class,
27 27
 		NullToStrictStringFuncCallArgRector::class,
28 28
 		CountOnNullRector::class,
Please login to merge, or discard this patch.
ecrire/public/fonctions.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		$texte = $intro;
87 87
 	} else {
88 88
 		if (
89
-			!str_contains("\n" . $texte, "\n|")
89
+			!str_contains("\n".$texte, "\n|")
90 90
 			&& strlen($texte) > 2.5 * $longueur
91 91
 		) {
92 92
 			if (str_contains($texte, '<multi')) {
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 	if ($pas < 1) {
171 171
 		return '';
172 172
 	}
173
-	$ancre = 'pagination' . $nom; // #pagination_articles
174
-	$debut = 'debut' . $nom; // 'debut_articles'
173
+	$ancre = 'pagination'.$nom; // #pagination_articles
174
+	$debut = 'debut'.$nom; // 'debut_articles'
175 175
 
176 176
 	// n'afficher l'ancre qu'une fois
177
-	$bloc_ancre = isset($ancres[$ancre]) ? '' : ($ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>");
177
+	$bloc_ancre = isset($ancres[$ancre]) ? '' : ($ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>");
178 178
 	// liste = false : on ne veut que l'ancre
179 179
 	if (!$liste) {
180 180
 		return $ancres[$ancre];
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
 	if ($modele) {
205 205
 		$pagination['type_pagination'] = $modele;
206
-		$modele = trouver_fond('pagination_' . $modele, 'modeles') ? '_' . $modele : '';
206
+		$modele = trouver_fond('pagination_'.$modele, 'modeles') ? '_'.$modele : '';
207 207
 	}
208 208
 
209 209
 	if (!defined('_PAGINATION_NOMBRE_LIENS_MAX')) {
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 function lister_objets_avec_logos($type) {
279 279
 
280 280
 	$objet = objet_type($type);
281
-	$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));
281
+	$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));
282 282
 	if ($ids) {
283 283
 		$ids = array_column($ids, 'id_objet');
284 284
 		return implode(',', $ids);
@@ -473,16 +473,16 @@  discard block
 block discarded – undo
473 473
 
474 474
 	// Classes : on indique le sens de tri et l'item exposé
475 475
 	if (!$is_sens_fixe) {
476
-		$classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc');
476
+		$classe .= ' item-tri item-tri_'.($tri_sens_actuel === 1 ? 'asc' : 'desc');
477 477
 	}
478 478
 	if ($champ_ou_sens === $tri_champ) {
479 479
 		$classe .= ' item-tri_actif';
480 480
 	}
481 481
 
482 482
 	// Si on n'est pas en mode "Tout afficher" de la pagination
483
-	if ($nom_pagination && parametre_url($url, 'debut' . $nom_pagination) !== '-1') {
483
+	if ($nom_pagination && parametre_url($url, 'debut'.$nom_pagination) !== '-1') {
484 484
 		// reset la pagination quand on change de mode ou de sens de tri
485
-		$url = parametre_url($url, 'debut' . $nom_pagination, '');
485
+		$url = parametre_url($url, 'debut'.$nom_pagination, '');
486 486
 	}
487 487
 
488 488
 	// Lien
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function tri_champ_order($t, $from = null, $senstri = '') {
520 520
 	if (str_starts_with($t, 'multi ')) {
521
-		return 'multi' . $senstri;
521
+		return 'multi'.$senstri;
522 522
 	}
523 523
 
524 524
 	$champ = $t;
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	return match ($prefixe) {
549 549
 		'num ' => "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}, 0+$champ{$senstri}",
550 550
 		'sinum ' => "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}",
551
-		default => $champ . $senstri,
551
+		default => $champ.$senstri,
552 552
 	};
553 553
 }
554 554
 
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		$l = couleur_hex_to_hsl($couleur, 'l');
650 650
 		$styles .= ":root {--spip-login-color-theme--hs: {$hs};--spip-login-color-theme--l: {$l};}\n";
651 651
 	}
652
-	$logo_bg = _DIR_IMG . 'spip_fond_login.jpg';
652
+	$logo_bg = _DIR_IMG.'spip_fond_login.jpg';
653 653
 	if (file_exists($logo_bg)) {
654 654
 		include_spip('inc/filtres_images_mini');
655 655
 		$logo_mini = image_reduire($logo_bg, 64, 64);
Please login to merge, or discard this patch.