Completed
Push — master ( fb0017...92433c )
by cam
01:14
created
ecrire/auth/spip.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$row = sql_fetsel(
50 50
 			'*',
51 51
 			'spip_auteurs',
52
-			'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'",
52
+			'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'",
53 53
 			'',
54 54
 			'',
55 55
 			'',
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
 		// legacy = md5 ou sha256
78 78
 		case 32:
79 79
 			// tres anciens mots de passe encodes en md5(alea.pass)
80
-			$hash = md5($row['alea_actuel'] . $pass);
80
+			$hash = md5($row['alea_actuel'].$pass);
81 81
 			$methode = 'md5';
82 82
 		case 64:
83 83
 			if (empty($hash)) {
84 84
 				// anciens mots de passe encodes en sha256(alea.pass)
85 85
 				include_spip('auth/sha256.inc');
86
-				$hash = spip_sha256($row['alea_actuel'] . $pass);
86
+				$hash = spip_sha256($row['alea_actuel'].$pass);
87 87
 				$methode = 'sha256';
88 88
 			}
89 89
 			if ($row['pass'] === $hash) {
90
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via $methode", 'auth' . _LOG_DEBUG);
90
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG);
91 91
 				// ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth
92 92
 				if (!empty($row['backup_cles'])) {
93
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
93
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
94 94
 				}
95 95
 				break;
96 96
 			}
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 				and !empty($row['backup_cles'])
109 109
 			) {
110 110
 				if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) {
111
-					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE);
111
+					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE);
112 112
 					if ($cles->save()) {
113 113
 						$secret = $cles->getSecretAuth();
114 114
 					}
115 115
 					else {
116
-						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
116
+						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
117 117
 						// et on echoue car on ne veut pas que la situation reste telle quelle
118
-						raler_fichier(_DIR_ETC . 'cles.php');
118
+						raler_fichier(_DIR_ETC.'cles.php');
119 119
 					}
120 120
 				}
121 121
 				else {
122
-					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR);
123
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
122
+					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR);
123
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
124 124
 				}
125 125
 			}
126 126
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				unset($row);
129 129
 			}
130 130
 			else {
131
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG);
131
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG);
132 132
 			}
133 133
 			break;
134 134
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			@sql_update(
176 176
 				'spip_auteurs',
177 177
 				$set,
178
-				'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote(
178
+				'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote(
179 179
 					$row['pass'],
180 180
 					$serveur,
181 181
 					'text'
@@ -223,24 +223,24 @@  discard block
 block discarded – undo
223 223
 
224 224
 	// si force, on ne verifie pas la presence d'un backup chez un webmestre
225 225
 	if ($force) {
226
-		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE);
226
+		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE);
227 227
 		$secret = $cles->getSecretAuth(true);
228 228
 		return true;
229 229
 	}
230 230
 
231
-	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''");
231
+	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''");
232 232
 	$has_backup = array_column($has_backup, 'id_auteur');
233 233
 	if (empty($has_backup)) {
234
-		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE);
234
+		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE);
235 235
 		if ($secret = $cles->getSecretAuth(true)) {
236 236
 			return true;
237 237
 		}
238
-		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
238
+		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
239 239
 		// et on echoue car on ne veut pas que la situation reste telle quelle
240
-		raler_fichier(_DIR_ETC . 'cles.php');
240
+		raler_fichier(_DIR_ETC.'cles.php');
241 241
 	}
242 242
 	else {
243
-		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR);
243
+		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR);
244 244
 	}
245 245
 	return false;
246 246
 }
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	$flux['data'] .=
258 258
 		  '<script type="text/javascript">/*<![CDATA[*/'
259 259
 		. "$js\n"
260
-		. "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "',"
261
-		. "'page_auteur': '" . generer_url_public('informer_auteur') . "',"
260
+		. "var login_info={'login':'".$flux['args']['contexte']['var_login']."',"
261
+		. "'page_auteur': '".generer_url_public('informer_auteur')."',"
262 262
 		. "'informe_auteur_en_cours':false,"
263 263
 		. "'attente_informe':0};"
264 264
 		. "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});"
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		} else {
302 302
 			$n = sql_countsel(
303 303
 				'spip_auteurs',
304
-				'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'",
304
+				'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'",
305 305
 				'',
306 306
 				'',
307 307
 				$serveur
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	}
330 330
 	if (
331 331
 		!$id_auteur = intval($id_auteur)
332
-		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
332
+		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
333 333
 	) {
334 334
 		return false;
335 335
 	}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		$anciens = sql_allfetsel(
345 345
 			'id_auteur',
346 346
 			'spip_auteurs',
347
-			'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'",
347
+			'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'",
348 348
 			'',
349 349
 			'',
350 350
 			'',
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 		$r = sql_getfetsel(
379 379
 			'login',
380 380
 			'spip_auteurs',
381
-			"statut<>'5poubelle'" .
382
-			' AND (length(pass)>0)' .
381
+			"statut<>'5poubelle'".
382
+			' AND (length(pass)>0)'.
383 383
 			" AND (login=$l)",
384 384
 			'',
385 385
 			'',
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 		return sql_getfetsel(
399 399
 			'login',
400 400
 			'spip_auteurs',
401
-			"statut<>'5poubelle'" .
402
-			' AND (length(pass)>0)' .
401
+			"statut<>'5poubelle'".
402
+			' AND (length(pass)>0)'.
403 403
 			" AND (login<>'' AND (nom=$l OR email=$l))",
404 404
 			'',
405 405
 			'',
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
 	if (
470 470
 		!$id_auteur = intval($id_auteur)
471
-		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
471
+		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
472 472
 	) {
473 473
 		return false;
474 474
 	}
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 		or isset($champs['statut'])
530 530
 		or (isset($options['all']) and $options['all'])
531 531
 	) {
532
-		$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
533
-		$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
532
+		$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
533
+		$htpasswd = _DIR_TMP._AUTH_USER_FILE;
534 534
 
535 535
 		// Cette variable de configuration peut etre posee par un plugin
536 536
 		// par exemple acces_restreint ;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			and !@file_exists($htaccess)
541 541
 		) {
542 542
 			spip_unlink($htpasswd);
543
-			spip_unlink($htpasswd . '-admin');
543
+			spip_unlink($htpasswd.'-admin');
544 544
 
545 545
 			return;
546 546
 		}
@@ -558,16 +558,16 @@  discard block
 block discarded – undo
558 558
 		);
559 559
 		while ($t = sql_fetch($s)) {
560 560
 			if (strlen($t['login']) and strlen($t['htpass'])) {
561
-				$p1 .= $t['login'] . ':' . $t['htpass'] . "\n";
561
+				$p1 .= $t['login'].':'.$t['htpass']."\n";
562 562
 				if ($t['statut'] == '0minirezo') {
563
-					$p2 .= $t['login'] . ':' . $t['htpass'] . "\n";
563
+					$p2 .= $t['login'].':'.$t['htpass']."\n";
564 564
 				}
565 565
 			}
566 566
 		}
567 567
 		sql_free($s);
568 568
 		if ($p1) {
569 569
 			ecrire_fichier($htpasswd, $p1);
570
-			ecrire_fichier($htpasswd . '-admin', $p2);
570
+			ecrire_fichier($htpasswd.'-admin', $p2);
571 571
 			spip_log("Ecriture de $htpasswd et $htpasswd-admin");
572 572
 		}
573 573
 	}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 // mais apres la fonction autoriser()
121 121
 if ($f = find_in_path('mes_fonctions.php')) {
122 122
 	global $dossier_squelettes;
123
-	include_once(_ROOT_CWD . $f);
123
+	include_once(_ROOT_CWD.$f);
124 124
 }
125 125
 
126 126
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$qui = $GLOBALS['visiteur_session'] ?: [];
163 163
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
164 164
 	} elseif (is_numeric($qui)) {
165
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
165
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
166 166
 		if (!$qui) {
167 167
 			return false;
168 168
 		}
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	}
176 176
 
177 177
 	spip_log(
178
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
179
-		'autoriser' . _LOG_DEBUG
178
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
179
+		'autoriser'._LOG_DEBUG
180 180
 	);
181 181
 
182 182
 	// passer par objet_type pour avoir les alias
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
193 193
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
194 194
 	) {
195
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
195
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
196 196
 		return true;
197 197
 	}
198 198
 
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
202 202
 	$fonctions = $type
203 203
 		? [
204
-			'autoriser_' . $type . '_' . $faire,
205
-			'autoriser_' . $type . '_' . $faire . '_dist',
206
-			'autoriser_' . $type,
207
-			'autoriser_' . $type . '_dist',
208
-			'autoriser_' . $faire,
209
-			'autoriser_' . $faire . '_dist',
204
+			'autoriser_'.$type.'_'.$faire,
205
+			'autoriser_'.$type.'_'.$faire.'_dist',
206
+			'autoriser_'.$type,
207
+			'autoriser_'.$type.'_dist',
208
+			'autoriser_'.$faire,
209
+			'autoriser_'.$faire.'_dist',
210 210
 			'autoriser_defaut',
211 211
 			'autoriser_defaut_dist'
212 212
 		]
213 213
 		: [
214
-			'autoriser_' . $faire,
215
-			'autoriser_' . $faire . '_dist',
214
+			'autoriser_'.$faire,
215
+			'autoriser_'.$faire.'_dist',
216 216
 			'autoriser_defaut',
217 217
 			'autoriser_defaut_dist'
218 218
 		];
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 	}
226 226
 
227 227
 	spip_log(
228
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
229
-		'autoriser' . _LOG_DEBUG
228
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
229
+		'autoriser'._LOG_DEBUG
230 230
 	);
231 231
 
232 232
 	return $a;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
376 376
 
377 377
 	// Le visiteur a-t-il un statut prevu par la config ?
378
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
378
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
379 379
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
380 380
 	}
381 381
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 				} // pas de champ passe a la demande => NIET
434 434
 				$previsu = explode(',', $c['previsu']);
435 435
 				// regarder si ce statut est autorise pour l'auteur
436
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
436
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
437 437
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
438 438
 					// sinon l’auteur en session
439 439
 					include_spip('inc/securiser_action');
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 
448 448
 					if (!$id_auteur) {
449 449
 						return false;
450
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
450
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
451 451
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
452 452
 					} elseif (
453 453
 						!sql_countsel(
454 454
 							'spip_auteurs_liens',
455
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
455
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
456 456
 						)
457 457
 					) {
458 458
 						return false;
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
 			// multilinguisme par secteur et objet rattaché à une rubrique
498 498
 			$primary = id_table_objet($type);
499 499
 			if ($table != 'spip_rubriques') {
500
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
500
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
501 501
 			} else {
502 502
 				$id_rubrique = $id;
503 503
 			}
504
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
504
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
505 505
 			if (!$id_secteur > 0) {
506 506
 				$id_secteur = $id_rubrique;
507 507
 			}
508
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
509
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
508
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
509
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
510 510
 			if ($langue_secteur != $langue_objet) {
511 511
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
512 512
 				return true;
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
515 515
 				return false;
516 516
 			} else {
517
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
517
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
518 518
 				if ($id_parent != 0) {
519 519
 					// sous-rubriques : pas de choix de langue
520 520
 					return false;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 
567 567
 	if (!isset($opt['statut'])) {
568 568
 		if (isset($desc['field']['statut'])) {
569
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
569
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
570 570
 		} else {
571 571
 			$statut = 'publie';
572 572
 		} // pas de statut => publie
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 		return false;
741 741
 	}
742 742
 
743
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
743
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
744 744
 		return false;
745 745
 	}
746 746
 
747
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
747
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
748 748
 		return false;
749 749
 	}
750 750
 
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 	if (!$id) {
782 782
 		return false;
783 783
 	}
784
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
784
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
785 785
 
786 786
 	return
787 787
 		$r
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 				(!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true))
793 793
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
794 794
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
795
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
795
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
796 796
 			)
797 797
 		);
798 798
 }
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 		if (!$id) {
851 851
 			return false;
852 852
 		}
853
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
853
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
854 854
 	}
855 855
 
856 856
 	return
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 		or
862 862
 		($id
863 863
 			and $qui['id_auteur']
864
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
864
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
865 865
 }
866 866
 
867 867
 
@@ -882,8 +882,8 @@  discard block
 block discarded – undo
882 882
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
883 883
 	# securite, mais on aurait pas du arriver ici !
884 884
 	if (
885
-		function_exists($f = 'autoriser_' . $type . '_voir')
886
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
885
+		function_exists($f = 'autoriser_'.$type.'_voir')
886
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
887 887
 	) {
888 888
 		return $f($faire, $type, $id, $qui, $opt);
889 889
 	}
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 	$n = sql_fetsel(
1015 1015
 		'A.id_article',
1016 1016
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1017
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1017
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1018 1018
 	);
1019 1019
 
1020 1020
 	return $n ? true : false;
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		and $r = sql_allfetsel(
1227 1227
 			'id_objet',
1228 1228
 			'spip_auteurs_liens',
1229
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1229
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1230 1230
 		)
1231 1231
 		and is_countable($r) ? count($r) : 0
1232 1232
 	) {
@@ -1911,8 +1911,8 @@  discard block
 block discarded – undo
1911 1911
 function auteurs_objet($objet, $id_objet, $cond = '') {
1912 1912
 	$objet = objet_type($objet);
1913 1913
 	$where = [
1914
-		'objet=' . sql_quote($objet),
1915
-		'id_objet=' . intval($id_objet)
1914
+		'objet='.sql_quote($objet),
1915
+		'id_objet='.intval($id_objet)
1916 1916
 	];
1917 1917
 	if (!empty($cond)) {
1918 1918
 		if (is_array($cond)) {
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 	return sql_allfetsel(
1948 1948
 		'id_auteur',
1949 1949
 		'spip_auteurs_liens',
1950
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1950
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1951 1951
 	);
1952 1952
 }
1953 1953
 
Please login to merge, or discard this patch.
ecrire/inc/informer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	include_spip('inc/texte');
21 21
 	$titre = $descriptif = '';
22 22
 	if ($type === 'rubrique') {
23
-		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id));
23
+		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id));
24 24
 		if ($row) {
25 25
 			$titre = typo($row['titre']);
26 26
 			$descriptif = propre($row['descriptif']);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				include_spip('inc/filtres_images_mini');
43 43
 				$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
44 44
 				if ($res) {
45
-					$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
45
+					$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
46 46
 				}
47 47
 			}
48 48
 		}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 		'  '
65 65
 	);
66 66
 
67
-	$js_func = $do . '_selection_titre';
67
+	$js_func = $do.'_selection_titre';
68 68
 
69 69
 	return "<div style='display: none;'>"
70
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
71
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
70
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
71
+	. "<input type='text' id='".$rac."_sel2' value=\""
72 72
 	. entites_html($titre)
73 73
 	. '" />'
74 74
 	. '</div>'
75 75
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
76 76
 	. '<div class="informer__item">'
77 77
 	. (!$res ? '' : $res)
78
-	. "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>'
79
-	. (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>')
78
+	. "<p class='informer__titre'><b>".safehtml($titre).'</b></p>'
79
+	. (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>')
80 80
 	. '</div>'
81
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
81
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
82 82
 	. "<input type='submit' class='fondo btn submit' value='"
83 83
 	. _T('bouton_choisir')
84 84
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.
ecrire/inc/commencer_page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$titre = '['
91 91
 		. $nom_site_spip
92 92
 		. ']'
93
-		. ($titre ? ' ' . textebrut(typo($titre)) : '');
93
+		. ($titre ? ' '.textebrut(typo($titre)) : '');
94 94
 
95 95
 	return _DOCTYPE_ECRIRE
96 96
 	. html_lang_attributes()
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) {
134 134
 
135 135
 	$res = pipeline('body_prive', "<body class='"
136
-		. init_body_class() . ' ' . _request('exec') . "'"
136
+		. init_body_class().' '._request('exec')."'"
137 137
 		. ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '')
138 138
 		. '>');
139 139
 
Please login to merge, or discard this patch.
ecrire/action/editer_objet.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function objet_modifier($objet, $id, $set = null) {
78 78
 	if (($t = objet_type($objet)) !== $objet) {
79
-		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
79
+		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
80 80
 		$objet = $t;
81 81
 	}
82 82
 	if (
83
-		include_spip('action/editer_' . $objet)
84
-		and function_exists($modifier = $objet . '_modifier')
83
+		include_spip('action/editer_'.$objet)
84
+		and function_exists($modifier = $objet.'_modifier')
85 85
 	) {
86 86
 		return $modifier($id, $set);
87 87
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$trouver_table = charger_fonction('trouver_table', 'base');
91 91
 	$desc = $trouver_table($table_sql);
92 92
 	if (!$desc or !isset($desc['field'])) {
93
-		spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR);
93
+		spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR);
94 94
 
95 95
 		return _L("Erreur objet $objet inconnu");
96 96
 	}
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 function objet_inserer($objet, $id_parent = null, $set = null) {
171 171
 	$d = null;
172 172
 	if (($t = objet_type($objet)) !== $objet) {
173
-		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
173
+		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
174 174
 		$objet = $t;
175 175
 	}
176 176
 	if (
177
-		include_spip('action/editer_' . $objet)
178
-		and function_exists($inserer = $objet . '_inserer')
177
+		include_spip('action/editer_'.$objet)
178
+		and function_exists($inserer = $objet.'_inserer')
179 179
 	) {
180 180
 		return $inserer($id_parent, $set);
181 181
 	}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			$row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1');
197 197
 			$id_rubrique = $row['id_rubrique'];
198 198
 		} else {
199
-			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
199
+			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
200 200
 		}
201 201
 
202 202
 		$champs['id_rubrique'] = $id_rubrique;
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
  */
315 315
 function objet_instituer($objet, $id, $c, $calcul_rub = true) {
316 316
 	if (($t = objet_type($objet)) !== $objet) {
317
-		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
317
+		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
318 318
 		$objet = $t;
319 319
 	}
320 320
 	if (
321
-		include_spip('action/editer_' . $objet)
322
-		and function_exists($instituer = $objet . '_instituer')
321
+		include_spip('action/editer_'.$objet)
322
+		and function_exists($instituer = $objet.'_instituer')
323 323
 	) {
324 324
 		return $instituer($id, $c, $calcul_rub);
325 325
 	}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	$sel[] = ($champ_date ? "$champ_date as date" : "'' as date");
349 349
 	$sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique');
350 350
 
351
-	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id));
351
+	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id));
352 352
 
353 353
 	$id_rubrique = $row['id_rubrique'];
354 354
 	$statut_ancien = $statut = $row['statut'];
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			if ($s != 'publie' and autoriser('modifier', $objet, $id)) {
372 372
 				$statut = $champs['statut'] = $s;
373 373
 			} else {
374
-				spip_log("editer_objet $objet #$id refus " . json_encode($c, JSON_THROW_ON_ERROR), 'editer' . _LOG_INFO_IMPORTANTE);
374
+				spip_log("editer_objet $objet #$id refus ".json_encode($c, JSON_THROW_ON_ERROR), 'editer'._LOG_INFO_IMPORTANTE);
375 375
 			}
376 376
 		}
377 377
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		and isset($c['id_parent'])
402 402
 		and $id_parent = $c['id_parent']
403 403
 		and $id_parent != $id_rubrique
404
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
404
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
405 405
 	) {
406 406
 		$champs['id_rubrique'] = $id_parent;
407 407
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	// Si on deplace l'objet
501 501
 	// changer aussi son secteur et sa langue (si heritee)
502 502
 	if (isset($champs['id_rubrique'])) {
503
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
503
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
504 504
 		$langue = $row_rub['lang'];
505 505
 
506 506
 		if (isset($desc['field']['id_secteur'])) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 				sql_fetsel(
513 513
 					'1',
514 514
 					$table_sql,
515
-					id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
515
+					id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
516 516
 				)
517 517
 			) {
518 518
 				$champs['lang'] = $langue;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 	if (!$champs) {
524 524
 		return;
525 525
 	}
526
-	sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id));
526
+	sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id));
527 527
 
528 528
 	// Changer le statut des rubriques concernees
529 529
 	if ($cond) {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
  */
568 568
 function objet_lire($objet, $valeur_id, $options = []) {
569 569
 	if (($t = objet_type($objet)) !== $objet) {
570
-		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
570
+		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
571 571
 		$objet = $t;
572 572
 	}
573 573
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 	) {
590 590
 		// Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet.
591 591
 		if (
592
-			include_spip('action/editer_' . $objet)
592
+			include_spip('action/editer_'.$objet)
593 593
 			and function_exists($lire = "{$objet}_lire_champs")
594 594
 		) {
595 595
 			$valeurs = $lire($objet, $valeur_id, $champ_id);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 			// La condition est appliquée sur le champ désigné par l'utilisateur.
601 601
 			$where = [
602
-				$champ_id . '=' . sql_quote($valeur_id)
602
+				$champ_id.'='.sql_quote($valeur_id)
603 603
 			];
604 604
 
605 605
 			// Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide.
Please login to merge, or discard this patch.
ecrire/inc/bandeau.php 1 patch
Spacing   +6 added lines, -6 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'])) {
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
115 115
 					+ [
116 116
 						$id => new Bouton(
117
-							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
118
-							$infos['titre'],  // titre
117
+							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
118
+							$infos['titre'], // titre
119 119
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
120 120
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
121 121
 						)
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
133 133
 					+ [
134 134
 						$id => new Bouton(
135
-							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
136
-							$infos['titre'],  // titre
135
+							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
136
+							$infos['titre'], // titre
137 137
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
138 138
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
139 139
 						)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		$url = str_replace('&amp;', '&', $url);
221 221
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
222 222
 			if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) {
223
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique']));
223
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique']));
224 224
 			}
225 225
 			$val = _request($matches[2], $contexte);
226 226
 			$url = parametre_url($url, $matches[1], $val ?: '', '&');
Please login to merge, or discard this patch.
ecrire/inc/lang.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 function changer_langue($lang, $liste_langues = null) {
41 41
 
42 42
 	if (is_null($liste_langues)) {
43
-		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
43
+		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? '');
44 44
 	} else {
45 45
 		if (is_array($liste_langues)) {
46 46
 			$liste_langues = implode(',', $liste_langues);
47 47
 		}
48 48
 	}
49
-	$liste_langues = ',' . $liste_langues . ',';
49
+	$liste_langues = ','.$liste_langues.',';
50 50
 
51 51
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
52 52
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	}
193 193
 	foreach ($langues as $l) {
194 194
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
195
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
195
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
196 196
 	}
197 197
 
198 198
 	if (!test_espace_prive()) {
@@ -210,23 +210,21 @@  discard block
 block discarded – undo
210 210
 		$base,
211 211
 		$cible,
212 212
 		(select_langues($nom_select, $change, $ret)
213
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
213
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
214 214
 		" method='post'"
215 215
 	);
216 216
 }
217 217
 
218 218
 function select_langues($nom_select, $change, $options, $label = '') {
219 219
 	static $cpt = 0;
220
-	$id = 'menu_langues' . $cpt++;
220
+	$id = 'menu_langues'.$cpt++;
221 221
 
222 222
 	return
223
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
223
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
224 224
 		"<select name='$nom_select' id='$id' "
225 225
 		. ((!test_espace_prive()) ?
226
-			("class='forml menu_langues'") :
227
-			(($nom_select == 'var_lang_ecrire') ?
228
-				("class='lang_ecrire'") :
229
-				"class='fondl'"))
226
+			("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ?
227
+				("class='lang_ecrire'") : "class='fondl'"))
230 228
 		. $change
231 229
 		. ">\n"
232 230
 		. $options
@@ -352,7 +350,7 @@  discard block
 block discarded – undo
352 350
 		and (!isset($GLOBALS['spip_lang'])
353 351
 			or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
354 352
 	) {
355
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
353
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
356 354
 	}
357 355
 	// en theorie là, la globale est définie, sinon c'est un problème.
358 356
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -455,7 +453,7 @@  discard block
 block discarded – undo
455 453
 	if (!isset($GLOBALS['meta']['langue_site'])) {
456 454
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
457 455
 		$GLOBALS['meta']['langue_site'] = $tout =
458
-			(!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false))
456
+			(!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false))
459 457
 				? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ','));
460 458
 		ecrire_meta('langue_site', $tout);
461 459
 	}
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		$infos['url_voir'] = $infos['type'];
707 707
 	}
708 708
 	if (!isset($infos['url_edit'])) {
709
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
709
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
710 710
 	}
711 711
 	if (!isset($infos['icone_objet'])) {
712 712
 		$infos['icone_objet'] = $infos['type'];
@@ -718,48 +718,48 @@  discard block
 block discarded – undo
718 718
 		$infos['texte_retour'] = 'icone_retour';
719 719
 	}
720 720
 	if (!isset($infos['texte_modifier'])) {
721
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
721
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer'])) {
724
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
724
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_creer_associer'])) {
727
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
727
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
728 728
 	}
729 729
 	if (!isset($infos['texte_ajouter'])) {
730 730
 		// Ajouter un X
731
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
731
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objets'])) {
734
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
734
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
735 735
 	}
736 736
 	if (!isset($infos['texte_objet'])) {
737
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
737
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
738 738
 	}
739 739
 	if (!isset($infos['texte_logo_objet'])) {
740 740
 		// objet:titre_logo_objet "Logo de ce X"
741
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
741
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
742 742
 	}
743 743
 	if (!isset($infos['texte_langue_objet'])) {
744 744
 		// objet:texte_langue_objet "Langue de ce X"
745
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
745
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
746 746
 	}
747 747
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
748 748
 		// "Ce X est une traduction du X numéro :"
749
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
749
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
750 750
 	}
751 751
 
752 752
 	// objet:info_aucun_objet
753 753
 	if (!isset($infos['info_aucun_objet'])) {
754
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
754
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
755 755
 	}
756 756
 	// objet:info_1_objet
757 757
 	if (!isset($infos['info_1_objet'])) {
758
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
758
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
759 759
 	}
760 760
 	// objet:info_nb_objets
761 761
 	if (!isset($infos['info_nb_objets'])) {
762
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
762
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
763 763
 	}
764 764
 
765 765
 	if (!isset($infos['champs_editables'])) {
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 		}
960 960
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
961 961
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
962
-		$spip = $connexion['prefixe'] . '_';
962
+		$spip = $connexion['prefixe'].'_';
963 963
 		foreach ($ts as $t) {
964 964
 			$t = substr($t, strlen($spip));
965 965
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1028,10 +1028,10 @@  discard block
 block discarded – undo
1028 1028
 	if ($serveur !== false) {
1029 1029
 		$t = lister_tables_spip($serveur);
1030 1030
 		$trouver_table = charger_fonction('trouver_table', 'base');
1031
-		$typetrim = rtrim($type, 's') . 's';
1031
+		$typetrim = rtrim($type, 's').'s';
1032 1032
 		if (
1033 1033
 			(isset($t[$typetrim]) or in_array($typetrim, $t))
1034
-			and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1034
+			and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1035 1035
 		) {
1036 1036
 			return $desc['id_table'];
1037 1037
 		} elseif (
@@ -1041,11 +1041,11 @@  discard block
 block discarded – undo
1041 1041
 			return $desc['id_table'];
1042 1042
 		}
1043 1043
 
1044
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1044
+		spip_log('table_objet('.$type.') calculee sans verification');
1045 1045
 		#spip_log(debug_backtrace(),'db');
1046 1046
 	}
1047 1047
 
1048
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1048
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1049 1049
 }
1050 1050
 
1051 1051
 /**
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1230 1230
 	// voir si une fonction est definie pour faire le boulot
1231 1231
 	// elle a la priorite dans ce cas
1232
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1232
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1233 1233
 		return $f($objet, $id_objet, $serveur);
1234 1234
 	}
1235 1235
 
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 		$boucle->sql_serveur = $serveur;
1252 1252
 		$boucle->select[] = $id_table_objet;
1253 1253
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1254
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet);
1254
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet);
1255 1255
 
1256 1256
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1257 1257
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 						? "{$parent_methode['source_champ']} = $id_objet"
1379 1379
 						: "$cle_objet = $id_objet";
1380 1380
 					if (isset($parent_methode['source_champ_type'])) {
1381
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1381
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1382 1382
 					}
1383 1383
 					// -- Condition supplémentaire sur la détection du parent
1384 1384
 					if (isset($parent_methode['table_condition'])) {
@@ -1502,11 +1502,11 @@  discard block
 block discarded – undo
1502 1502
 			$where = [];
1503 1503
 			// -- L'identifiant du parent
1504 1504
 			if (isset($_methode_parent['champ'])) {
1505
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1505
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1506 1506
 			}
1507 1507
 			// -- Si le parent est variable
1508 1508
 			if (isset($_methode_parent['champ_type'])) {
1509
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1509
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1510 1510
 			}
1511 1511
 
1512 1512
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.
ecrire/public/criteres.php 1 patch
Spacing   +165 added lines, -170 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	$boucle = &$boucles[$idb];
48 48
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
49 49
 
50
-	$c = ["'='", "'$boucle->id_table." . "$id_parent'", 0];
50
+	$c = ["'='", "'$boucle->id_table."."$id_parent'", 0];
51 51
 	$boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c);
52 52
 }
53 53
 
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 	$id = $boucle->primary;
71 71
 
72 72
 	if ($not or !$id) {
73
-		return ['zbug_critere_inconnu', ['critere' => $not . $crit->op]];
73
+		return ['zbug_critere_inconnu', ['critere' => $not.$crit->op]];
74 74
 	}
75 75
 	$arg = kwote(calculer_argument_precedent($idb, $id, $boucles));
76
-	$boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg];
76
+	$boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg];
77 77
 }
78 78
 
79 79
 
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	$not = ($crit->not ? '' : 'NOT');
105 105
 
106 106
 	// le doublon s'applique sur un type de boucle (article)
107
-	$nom = "'" . $boucle->type_requete . "'";
107
+	$nom = "'".$boucle->type_requete."'";
108 108
 
109 109
 	// compléter le nom avec un nom précisé {doublons nom}
110 110
 	// on obtient $nom = "'article' . 'nom'"
111 111
 	if (isset($crit->param[0])) {
112
-		$nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent);
112
+		$nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent);
113 113
 	}
114 114
 
115 115
 	// code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP)
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
 	// $doublons et son index, ici $nom
122 122
 
123 123
 	// debut du code "sql_in('articles.id_article', "
124
-	$debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', ";
124
+	$debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', ";
125 125
 	// lecture des données du doublon "$doublons[$doublon_index[] = "
126 126
 	// Attention : boucle->doublons désigne une variable qu'on affecte
127
-	$debut_doub = '$doublons[' . (!$not ? '' : ($boucle->doublons . '[]= '));
127
+	$debut_doub = '$doublons['.(!$not ? '' : ($boucle->doublons.'[]= '));
128 128
 
129 129
 	// le debut complet du code des doublons
130
-	$debut_doub = $debut_in . $debut_doub;
130
+	$debut_doub = $debut_in.$debut_doub;
131 131
 
132 132
 	// nom du doublon "('article' . 'nom')]"
133 133
 	$fin_doub = "($nom)]";
@@ -137,22 +137,22 @@  discard block
 block discarded – undo
137 137
 	foreach ($boucle->where as $k => $w) {
138 138
 		if (strpos($w[0], $debut_doub) === 0) {
139 139
 			// fusionner le sql_in (du where)
140
-			$boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr($w[0], strlen($debut_in));
140
+			$boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr($w[0], strlen($debut_in));
141 141
 			// fusionner l'initialisation (du hash) pour faire plus joli
142 142
 			$x = strpos($boucle->hash, $init_comment);
143 143
 			$len = strlen($init_comment);
144 144
 			$boucle->hash =
145
-				substr($boucle->hash, 0, $x + $len) . $init_code . substr($boucle->hash, $x + $len);
145
+				substr($boucle->hash, 0, $x + $len).$init_code.substr($boucle->hash, $x + $len);
146 146
 
147 147
 			return;
148 148
 		}
149 149
 	}
150 150
 
151 151
 	// mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante
152
-	$boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"];
152
+	$boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"];
153 153
 
154 154
 	// déclarer le doublon s'il n'existe pas encore
155
-	$boucle->hash .= $init_comment . $init_code;
155
+	$boucle->hash .= $init_comment.$init_code;
156 156
 
157 157
 
158 158
 	# la ligne suivante avait l'intention d'eviter une collecte deja faite
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	$deux = $deux[0]->texte;
215 215
 	if ($deux) {
216 216
 		$boucles[$idb]->limit =
217
-			'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"';
217
+			'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"';
218 218
 	} else {
219 219
 		calculer_critere_DEFAUT_dist($idb, $boucles, $crit);
220 220
 	}
@@ -276,26 +276,26 @@  discard block
 block discarded – undo
276 276
 		$type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent);
277 277
 	}
278 278
 
279
-	$debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr($type, 1));
279
+	$debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr($type, 1));
280 280
 	$boucle->modificateur['debut_nom'] = $type;
281 281
 	$partie =
282 282
 		// tester si le numero de page demande est de la forme '@yyy'
283
-		'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n"
283
+		'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n"
284 284
 		. "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n"
285
-		. "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n"
286
-		. "\t\t" . '$iter->seek(0);' . "\n"
285
+		. "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n"
286
+		. "\t\t".'$iter->seek(0);'."\n"
287 287
 		. "\t}\n"
288
-		. "\t" . '$debut_boucle = intval($debut_boucle)';
288
+		. "\t".'$debut_boucle = intval($debut_boucle)';
289 289
 
290 290
 	$boucle->hash .= '
291
-	$command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');';
291
+	$command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');';
292 292
 
293 293
 	$boucle->total_parties = $pas;
294 294
 	calculer_parties($boucles, $idb, $partie, 'p+');
295 295
 	// ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id
296 296
 	// sauf si pas de primaire, ou si primaire composee
297 297
 	// dans ce cas, on ne sait pas gerer une pagination indirecte
298
-	$t = $boucle->id_table . '.' . $boucle->primary;
298
+	$t = $boucle->id_table.'.'.$boucle->primary;
299 299
 	if (
300 300
 		$boucle->primary
301 301
 		and !preg_match('/[,\s]/', $boucle->primary)
@@ -342,24 +342,24 @@  discard block
 block discarded – undo
342 342
 	$boucle->hash .= '
343 343
 	// RECHERCHE'
344 344
 		. ($crit->cond ? '
345
-	if (!strlen(' . $quoi . ')){
345
+	if (!strlen(' . $quoi.')){
346 346
 		list($rech_select, $rech_where) = array("0 as points","");
347
-	} else' : '') . '
347
+	} else' : '').'
348 348
 	{
349 349
 		$prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\');
350
-		list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '");
350
+		list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'");
351 351
 	}
352 352
 	';
353 353
 
354 354
 
355
-	$t = $boucle->id_table . '.' . $boucle->primary;
355
+	$t = $boucle->id_table.'.'.$boucle->primary;
356 356
 	if (!in_array($t, $boucles[$idb]->select)) {
357 357
 		$boucle->select[] = $t;
358 358
 	} # pour postgres, neuneu ici
359 359
 	// jointure uniquement sur le serveur principal
360 360
 	// (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal)
361 361
 	if (!$boucle->sql_serveur) {
362
-		$boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"];
362
+		$boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"];
363 363
 		$boucle->from['resultats'] = 'spip_resultats';
364 364
 	}
365 365
 	$boucle->select[] = '$rech_select';
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	$c =
427 427
 		[
428 428
 			"'OR'",
429
-			["'='", "'$table." . "id_trad'", "'$table.$prim'"],
429
+			["'='", "'$table."."id_trad'", "'$table.$prim'"],
430 430
 			["'='", "'$table.id_trad'", "'0'"]
431 431
 		];
432 432
 	$boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c);
@@ -449,13 +449,13 @@  discard block
 block discarded – undo
449 449
 	$boucle = &$boucles[$idb];
450 450
 	$arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles));
451 451
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
452
-	$mparent = $boucle->id_table . '.' . $id_parent;
452
+	$mparent = $boucle->id_table.'.'.$id_parent;
453 453
 
454 454
 	if ($boucle->type_requete == 'rubriques' or isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) {
455 455
 		$boucle->where[] = ["'='", "'$mparent'", $arg];
456 456
 	} // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist()
457 457
 	else {
458
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]];
458
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]];
459 459
 	}
460 460
 }
461 461
 
@@ -508,16 +508,15 @@  discard block
 block discarded – undo
508 508
 		if (count(trouver_champs_decomposes($champ, $desc)) > 1) {
509 509
 			$decompose = decompose_champ_id_objet($champ);
510 510
 			$champ = array_shift($decompose);
511
-			$boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"'];
511
+			$boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"'];
512 512
 		}
513 513
 	} else {
514 514
 		$cle = $boucle->id_table;
515 515
 	}
516 516
 
517
-	$c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)"
518
-		. ($not ? ", 'NOT'" : '') . ')';
519
-	$boucle->where[] = !$crit->cond ? $c :
520
-		("($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')');
517
+	$c = "sql_in('$cle".".$champ', calcul_branche_in($arg)"
518
+		. ($not ? ", 'NOT'" : '').')';
519
+	$boucle->where[] = !$crit->cond ? $c : ("($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')');
521 520
 }
522 521
 
523 522
 /**
@@ -537,9 +536,9 @@  discard block
 block discarded – undo
537 536
 	$not = ($crit->not ? 'NOT' : '');
538 537
 	$serveur = $boucle->sql_serveur;
539 538
 
540
-	$c = "sql_in('" .
541
-		$boucle->id_table . '.' . $boucle->primary
542
-		. "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')";
539
+	$c = "sql_in('".
540
+		$boucle->id_table.'.'.$boucle->primary
541
+		. "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')";
543 542
 
544 543
 	$boucle->where[] = $c;
545 544
 }
@@ -571,7 +570,7 @@  discard block
 block discarded – undo
571 570
 				$t = table_objet_sql($r[1]);
572 571
 				$t = array_search($t, $boucles[$idb]->from);
573 572
 				if ($t) {
574
-					$t .= '.' . $r[2];
573
+					$t .= '.'.$r[2];
575 574
 				}
576 575
 			}
577 576
 		} else {
@@ -586,7 +585,7 @@  discard block
 block discarded – undo
586 585
 			$boucles[$idb]->select[] = $t;
587 586
 		}
588 587
 	} else {
589
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
588
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
590 589
 	}
591 590
 }
592 591
 
@@ -656,25 +655,25 @@  discard block
 block discarded – undo
656 655
 				(false !== $i = strpos($boucle->order[$n - 1], 'ASC'))
657 656
 				or (false !== $i = strpos($boucle->order[$n - 1], 'DESC'))
658 657
 			) {
659
-				$boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0);
658
+				$boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0);
660 659
 			} else {
661
-				$boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate'];
660
+				$boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate'];
662 661
 			}
663 662
 		}
664 663
 	} else {
665
-		return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]);
664
+		return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]);
666 665
 	}
667 666
 }
668 667
 
669 668
 function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') {
670 669
 	$boucle = $boucles[$idb];
671
-	$alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')';
672
-	$var = '$champs_' . $idb;
670
+	$alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')';
671
+	$var = '$champs_'.$idb;
673 672
 	$desc = (strpos($boucle->in, (string) "static $var =") !== false);
674 673
 	if (!$desc) {
675 674
 		$desc = $boucle->show['field'];
676 675
 		$desc = implode(',', array_map('_q', array_keys($desc)));
677
-		$boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');';
676
+		$boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');';
678 677
 	}
679 678
 	if ($desc) {
680 679
 		$alt = "(in_array(\$x, $var)  ? $alt :(\$x$suffix))";
@@ -749,7 +748,7 @@  discard block
 block discarded – undo
749 748
 		$sens = " . ' DESC'";
750 749
 	}
751 750
 	if (isset($boucle->modificateur['collate'])) {
752
-		$collecte = ' . ' . $boucle->modificateur['collate'];
751
+		$collecte = ' . '.$boucle->modificateur['collate'];
753 752
 	}
754 753
 
755 754
 	// Pour chaque paramètre du critère
@@ -771,14 +770,14 @@  discard block
 block discarded – undo
771 770
 			if (preg_match(',^(\w+)[\s]+(.*)$,', $par, $m)) {
772 771
 				$expression = trim($m[1]);
773 772
 				$champ = trim($m[2]);
774
-				if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) {
773
+				if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) {
775 774
 					$order = $f($idb, $boucles, $crit, $tri, $champ);
776 775
 				} else {
777
-					return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
776
+					return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
778 777
 				}
779 778
 
780 779
 			// tris de la forme {par champ} ou {par FONCTION(champ)}
781
-			} elseif ($boucle->type_requete == 'DATA' or preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', $par, $match)) {
780
+			} elseif ($boucle->type_requete == 'DATA' or preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', $par, $match)) {
782 781
 				// {par FONCTION(champ)}
783 782
 				if (isset($match) and count($match) > 2) {
784 783
 					$par = substr($match[2], 1, -1);
@@ -788,7 +787,7 @@  discard block
 block discarded – undo
788 787
 				if ($par == 'hasard') {
789 788
 					$order = calculer_critere_par_hasard($idb, $boucles, $crit);
790 789
 				} elseif ($par == 'date' and !empty($boucle->show['date'])) {
791
-					$order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'";
790
+					$order = "'".$boucle->id_table.'.'.$boucle->show['date']."'";
792 791
 				} else {
793 792
 					// cas général {par champ}, {par table.champ}, ...
794 793
 					$order = calculer_critere_par_champ($idb, $boucles, $crit, $par);
@@ -797,7 +796,7 @@  discard block
 block discarded – undo
797 796
 
798 797
 			// on ne sait pas traiter…
799 798
 			else {
800
-				return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
799
+				return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
801 800
 			}
802 801
 
803 802
 			// En cas d'erreur de squelette retournée par une fonction
@@ -817,14 +816,14 @@  discard block
 block discarded – undo
817 816
 
818 817
 		if ($fct) {
819 818
 			if (preg_match("/^\s*'(.*)'\s*$/", $order, $r)) {
820
-				$order = "'$fct(" . $r[1] . ")'";
819
+				$order = "'$fct(".$r[1].")'";
821 820
 			} else {
822 821
 				$order = "'$fct(' . $order . ')'";
823 822
 			}
824 823
 		}
825
-		$t = $order . $collecte . $sens;
824
+		$t = $order.$collecte.$sens;
826 825
 		if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) {
827
-			$t = $r[1] . $r[2];
826
+			$t = $r[1].$r[2];
828 827
 		}
829 828
 
830 829
 		$boucle->order[] = $t;
@@ -874,16 +873,16 @@  discard block
 block discarded – undo
874 873
 function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) {
875 874
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
876 875
 	if (is_array($_champ)) {
877
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]];
876
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]];
878 877
 	}
879 878
 	$boucle = &$boucles[$idb];
880
-	$texte = '0+' . $_champ;
879
+	$texte = '0+'.$_champ;
881 880
 	$suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent);
882 881
 	if ($suite !== "''") {
883
-		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "';
882
+		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "';
884 883
 	}
885
-	$asnum = 'num' . ($boucle->order ? count($boucle->order) : '');
886
-	$boucle->select[] = $texte . " AS $asnum";
884
+	$asnum = 'num'.($boucle->order ? count($boucle->order) : '');
885
+	$boucle->select[] = $texte." AS $asnum";
887 886
 
888 887
 	$orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ);
889 888
 	$orderassinum = trim($orderassinum, "'");
@@ -912,13 +911,13 @@  discard block
 block discarded – undo
912 911
 function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) {
913 912
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
914 913
 	if (is_array($_champ)) {
915
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]];
914
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]];
916 915
 	}
917 916
 	$boucle = &$boucles[$idb];
918
-	$texte = '0+' . $_champ;
917
+	$texte = '0+'.$_champ;
919 918
 	$suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent);
920 919
 	if ($suite !== "''") {
921
-		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "';
920
+		$texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "';
922 921
 	}
923 922
 
924 923
 	$as = false;
@@ -934,8 +933,8 @@  discard block
 block discarded – undo
934 933
 	}
935 934
 
936 935
 	if (!$as) {
937
-		$as = 'sinum' . ($boucle->order ? count($boucle->order) : '');
938
-		$boucle->select[] = $select . $as;
936
+		$as = 'sinum'.($boucle->order ? count($boucle->order) : '');
937
+		$boucle->select[] = $select.$as;
939 938
 	}
940 939
 	$order = "'$as'";
941 940
 	return $order;
@@ -960,10 +959,10 @@  discard block
 block discarded – undo
960 959
 function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) {
961 960
 	$_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true);
962 961
 	if (is_array($_champ)) {
963
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]];
962
+		return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]];
964 963
 	}
965 964
 	$boucle = &$boucles[$idb];
966
-	$boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\"";
965
+	$boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\"";
967 966
 	$order = "'multi'";
968 967
 	return $order;
969 968
 }
@@ -989,7 +988,7 @@  discard block
 block discarded – undo
989 988
 
990 989
 	// le champ existe dans la table, pas de souci (le plus commun)
991 990
 	if (isset($desc['field'][$par])) {
992
-		$par = $boucle->id_table . '.' . $par;
991
+		$par = $boucle->id_table.'.'.$par;
993 992
 	}
994 993
 	// le champ est peut être une jointure
995 994
 	else {
@@ -1010,24 +1009,24 @@  discard block
 block discarded – undo
1010 1009
 		// Sinon on cherche le champ dans les tables possibles de jointures
1011 1010
 		// Si la table est déjà dans le from, on la réutilise.
1012 1011
 		if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) {
1013
-			$par = $infos['alias'] . '.' . $champ;
1012
+			$par = $infos['alias'].'.'.$champ;
1014 1013
 		} elseif (
1015 1014
 			$boucle->jointures_explicites
1016 1015
 			and $alias = trouver_jointure_champ($champ, $boucle, explode(' ', $boucle->jointures_explicites), false, $table)
1017 1016
 		) {
1018
-			$par = $alias . '.' . $champ;
1017
+			$par = $alias.'.'.$champ;
1019 1018
 		} elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) {
1020
-			$par = $alias . '.' . $champ;
1019
+			$par = $alias.'.'.$champ;
1021 1020
 		// en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même)
1022 1021
 		} elseif (
1023 1022
 			$table_alias
1024 1023
 			and isset($boucle->from[$table_alias])
1025 1024
 			and $infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias])
1026 1025
 		) {
1027
-			$par = $infos['alias'] . '.' . $champ;
1026
+			$par = $infos['alias'].'.'.$champ;
1028 1027
 		} elseif ($table) {
1029 1028
 			// On avait table + champ, mais on ne les a pas trouvés
1030
-			return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]];
1029
+			return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]];
1031 1030
 		} else {
1032 1031
 			// Sinon tant pis, ca doit etre un champ synthetise (cf points)
1033 1032
 		}
@@ -1051,7 +1050,7 @@  discard block
 block discarded – undo
1051 1050
 	if (!$t) {
1052 1051
 		$t = trouver_jointure_champ($champ, $boucle);
1053 1052
 	}
1054
-	return !$t ? '' : ("'" . $t . '.' . $champ . "'");
1053
+	return !$t ? '' : ("'".$t.'.'.$champ."'");
1055 1054
 }
1056 1055
 
1057 1056
 /**
@@ -1096,9 +1095,9 @@  discard block
 block discarded – undo
1096 1095
 				$boucle->default_order[] = ' DESC';
1097 1096
 			}
1098 1097
 		} else {
1099
-			$t = $boucle->order[$n - 1] . " . $order";
1098
+			$t = $boucle->order[$n - 1]." . $order";
1100 1099
 			if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) {
1101
-				$t = $r[1] . $r[2];
1100
+				$t = $r[1].$r[2];
1102 1101
 			}
1103 1102
 			$boucle->order[$n - 1] = $t;
1104 1103
 		}
@@ -1135,7 +1134,7 @@  discard block
 block discarded – undo
1135 1134
 
1136 1135
 	$_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent);
1137 1136
 
1138
-	$order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens";
1137
+	$order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens";
1139 1138
 	$boucle->order[] = $order;
1140 1139
 }
1141 1140
 
@@ -1144,7 +1143,7 @@  discard block
 block discarded – undo
1144 1143
 	$params = $crit->param;
1145 1144
 
1146 1145
 	if ((is_countable($params) ? count($params) : 0) < 1) {
1147
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
1146
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
1148 1147
 	}
1149 1148
 
1150 1149
 	$boucle = &$boucles[$idb];
@@ -1165,7 +1164,7 @@  discard block
 block discarded – undo
1165 1164
 	if (((is_countable($date) ? count($date) : 0) == 1) and ($date[0]->type == 'texte')) {
1166 1165
 		$date = $date[0]->texte;
1167 1166
 		if (!isset($fields[$date])) {
1168
-			return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]];
1167
+			return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]];
1169 1168
 		}
1170 1169
 	} else {
1171 1170
 		$a = calculer_liste($date, $idb, $boucles, $parent);
@@ -1177,38 +1176,38 @@  discard block
 block discarded – undo
1177 1176
 		$date = "'.(($cond)\n?\$a:\"$defaut\").'";
1178 1177
 	}
1179 1178
 	$annee = $params ? array_shift($params) : '';
1180
-	$annee = "\n" . 'sprintf("%04d", ($x = ' .
1181
-		calculer_liste($annee, $idb, $boucles, $parent) .
1179
+	$annee = "\n".'sprintf("%04d", ($x = '.
1180
+		calculer_liste($annee, $idb, $boucles, $parent).
1182 1181
 		') ? $x : date("Y"))';
1183 1182
 
1184 1183
 	$mois = $params ? array_shift($params) : '';
1185
-	$mois = "\n" . 'sprintf("%02d", ($x = ' .
1186
-		calculer_liste($mois, $idb, $boucles, $parent) .
1184
+	$mois = "\n".'sprintf("%02d", ($x = '.
1185
+		calculer_liste($mois, $idb, $boucles, $parent).
1187 1186
 		') ? $x : date("m"))';
1188 1187
 
1189 1188
 	$jour = $params ? array_shift($params) : '';
1190
-	$jour = "\n" . 'sprintf("%02d", ($x = ' .
1191
-		calculer_liste($jour, $idb, $boucles, $parent) .
1189
+	$jour = "\n".'sprintf("%02d", ($x = '.
1190
+		calculer_liste($jour, $idb, $boucles, $parent).
1192 1191
 		') ? $x : date("d"))';
1193 1192
 
1194 1193
 	$annee2 = $params ? array_shift($params) : '';
1195
-	$annee2 = "\n" . 'sprintf("%04d", ($x = ' .
1196
-		calculer_liste($annee2, $idb, $boucles, $parent) .
1194
+	$annee2 = "\n".'sprintf("%04d", ($x = '.
1195
+		calculer_liste($annee2, $idb, $boucles, $parent).
1197 1196
 		') ? $x : date("Y"))';
1198 1197
 
1199 1198
 	$mois2 = $params ? array_shift($params) : '';
1200
-	$mois2 = "\n" . 'sprintf("%02d", ($x = ' .
1201
-		calculer_liste($mois2, $idb, $boucles, $parent) .
1199
+	$mois2 = "\n".'sprintf("%02d", ($x = '.
1200
+		calculer_liste($mois2, $idb, $boucles, $parent).
1202 1201
 		') ? $x : date("m"))';
1203 1202
 
1204 1203
 	$jour2 = $params ? array_shift($params) : '';
1205
-	$jour2 = "\n" . 'sprintf("%02d", ($x = ' .
1206
-		calculer_liste($jour2, $idb, $boucles, $parent) .
1204
+	$jour2 = "\n".'sprintf("%02d", ($x = '.
1205
+		calculer_liste($jour2, $idb, $boucles, $parent).
1207 1206
 		') ? $x : date("d"))';
1208 1207
 
1209
-	$date = $boucle->id_table . ".$date";
1208
+	$date = $boucle->id_table.".$date";
1210 1209
 
1211
-	$quote_end = ",'" . $boucle->sql_serveur . "','text'";
1210
+	$quote_end = ",'".$boucle->sql_serveur."','text'";
1212 1211
 	if ($type == 'jour') {
1213 1212
 		$boucle->where[] = [
1214 1213
 			"'='",
@@ -1280,14 +1279,13 @@  discard block
 block discarded – undo
1280 1279
 	[$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2);
1281 1280
 
1282 1281
 	if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) {
1283
-		$boucle->limit = $a11 . ',' . $a21;
1282
+		$boucle->limit = $a11.','.$a21;
1284 1283
 	} else {
1285 1284
 		// 3 dans {1/3}, {2,3} ou {1,n-3}
1286 1285
 		$boucle->total_parties = ($a21 != 'n') ? $a21 : $a22;
1287 1286
 		// 2 dans {2/3}, {2,5}, {n-2,1}
1288 1287
 		$partie = ($a11 != 'n') ? $a11 : $a12;
1289
-		$mode = (($op == '/') ? '/' :
1290
-			(($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+'));
1288
+		$mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+'));
1291 1289
 		// cas simple {0,#ENV{truc}} compilons le en LIMIT :
1292 1290
 		if ($a11 !== 'n' and $a21 !== 'n' and $mode == '++' and $op == ',') {
1293 1291
 			$boucle->limit =
@@ -1333,8 +1331,7 @@  discard block
 block discarded – undo
1333 1331
 	// {1/3}
1334 1332
 	if ($op1 == '/') {
1335 1333
 		$pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)";
1336
-		$totpos = is_numeric($total_parties) ? ($total_parties) :
1337
-			"($total_parties ? $total_parties : 1)";
1334
+		$totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)";
1338 1335
 		$fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1";
1339 1336
 		$debut = !$pmoins1 ? 0 : "ceil(($nombre_boucle * $pmoins1)/$totpos);";
1340 1337
 	} else {
@@ -1345,15 +1342,13 @@  discard block
 block discarded – undo
1345 1342
 
1346 1343
 		// cas {x,n-1}
1347 1344
 		if ($op2 == '-') {
1348
-			$fin = '$debut_boucle + ' . $nombre_boucle . ' - '
1349
-				. (is_numeric($total_parties) ? ($total_parties + 1) :
1350
-					($total_parties . ' - 1'));
1345
+			$fin = '$debut_boucle + '.$nombre_boucle.' - '
1346
+				. (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1'));
1351 1347
 		} else {
1352 1348
 			// {x,1} ou {pagination}
1353 1349
 			$fin = '$debut_boucle'
1354 1350
 				. (is_numeric($total_parties) ?
1355
-					(($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) :
1356
-					('+' . $total_parties . ' - 1'));
1351
+					(($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1'));
1357 1352
 		}
1358 1353
 
1359 1354
 		// {pagination}, gerer le debut_xx=-1 pour tout voir
@@ -1371,11 +1366,11 @@  discard block
 block discarded – undo
1371 1366
 	// Utiliser min pour rabattre $fin_boucle sur total_boucle.
1372 1367
 
1373 1368
 	$boucles[$id_boucle]->mode_partie = "\n\t"
1374
-		. '$debut_boucle = ' . $debut . ";\n	"
1369
+		. '$debut_boucle = '.$debut.";\n	"
1375 1370
 		. "\$debut_boucle = intval(\$debut_boucle);\n	"
1376
-		. '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n	"
1377
-		. '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n	"
1378
-		. '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);'
1371
+		. '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n	"
1372
+		. '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n	"
1373
+		. '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);'
1379 1374
 		. "\n\tif (\$debut_boucle>0"
1380 1375
 		. " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']"
1381 1376
 		. " AND \$iter->seek(\$debut_boucle,'continue'))"
@@ -1460,16 +1455,16 @@  discard block
 block discarded – undo
1460 1455
 		// critere personnalise ?
1461 1456
 		if (
1462 1457
 			(!$serveur or
1463
-				((!function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere))
1464
-					and (!function_exists($f = $f . '_dist'))
1465
-					and (!function_exists($f = 'critere_' . $serveur . '_' . $critere))
1466
-					and (!function_exists($f = $f . '_dist'))
1458
+				((!function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere))
1459
+					and (!function_exists($f = $f.'_dist'))
1460
+					and (!function_exists($f = 'critere_'.$serveur.'_'.$critere))
1461
+					and (!function_exists($f = $f.'_dist'))
1467 1462
 				)
1468 1463
 			)
1469
-			and (!function_exists($f = 'critere_' . $table . '_' . $critere))
1470
-			and (!function_exists($f = $f . '_dist'))
1471
-			and (!function_exists($f = 'critere_' . $critere))
1472
-			and (!function_exists($f = $f . '_dist'))
1464
+			and (!function_exists($f = 'critere_'.$table.'_'.$critere))
1465
+			and (!function_exists($f = $f.'_dist'))
1466
+			and (!function_exists($f = 'critere_'.$critere))
1467
+			and (!function_exists($f = $f.'_dist'))
1473 1468
 		) {
1474 1469
 			// fonction critere standard
1475 1470
 			$f = $defaut;
@@ -1500,9 +1495,9 @@  discard block
 block discarded – undo
1500 1495
  */
1501 1496
 function kwote($lisp, $serveur = '', $type = '') {
1502 1497
 	if (preg_match(_CODE_QUOTE, $lisp, $r)) {
1503
-		return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"';
1498
+		return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"';
1504 1499
 	} else {
1505
-		return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')";
1500
+		return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')";
1506 1501
 	}
1507 1502
 }
1508 1503
 
@@ -1524,7 +1519,7 @@  discard block
 block discarded – undo
1524 1519
 function critere_IN_dist($idb, &$boucles, $crit) {
1525 1520
 	$r = calculer_critere_infixe($idb, $boucles, $crit);
1526 1521
 	if (!$r) {
1527
-		return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']];
1522
+		return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']];
1528 1523
 	}
1529 1524
 	[$arg, $op, $val, $col, $where_complement] = $r;
1530 1525
 
@@ -1549,8 +1544,8 @@  discard block
 block discarded – undo
1549 1544
 				"'NOT'",
1550 1545
 				[
1551 1546
 					"'IN'",
1552
-					"'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'",
1553
-					["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where]
1547
+					"'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'",
1548
+					["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where]
1554 1549
 				]
1555 1550
 			];
1556 1551
 		}
@@ -1567,22 +1562,22 @@  discard block
 block discarded – undo
1567 1562
 	$descr = $boucles[$idb]->descr;
1568 1563
 	$cpt = &$num[$descr['nom']][$descr['gram']][$idb];
1569 1564
 
1570
-	$var = '$in' . $cpt++;
1565
+	$var = '$in'.$cpt++;
1571 1566
 	$x = "\n\t$var = array();";
1572 1567
 	foreach ($val as $k => $v) {
1573 1568
 		if (preg_match(",^(\n//.*\n)?'(.*)'$,", $v, $r)) {
1574 1569
 			// optimiser le traitement des constantes
1575 1570
 			if (is_numeric($r[2])) {
1576
-				$x .= "\n\t$var" . "[]= $r[2];";
1571
+				$x .= "\n\t$var"."[]= $r[2];";
1577 1572
 			} else {
1578
-				$x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';';
1573
+				$x .= "\n\t$var".'[]= '.sql_quote($r[2]).';';
1579 1574
 			}
1580 1575
 		} else {
1581 1576
 			// Pour permettre de passer des tableaux de valeurs
1582 1577
 			// on repere l'utilisation brute de #ENV**{X},
1583 1578
 			// c'est-a-dire sa  traduction en ($PILE[0][X]).
1584 1579
 			// et on deballe mais en rajoutant l'anti XSS
1585
-			$x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);";
1580
+			$x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);";
1586 1581
 		}
1587 1582
 	}
1588 1583
 
@@ -1596,7 +1591,7 @@  discard block
 block discarded – undo
1596 1591
 		$boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))";
1597 1592
 	}
1598 1593
 
1599
-	return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')';
1594
+	return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')';
1600 1595
 }
1601 1596
 
1602 1597
 /**
@@ -1669,7 +1664,7 @@  discard block
 block discarded – undo
1669 1664
 		$champs = array_diff($champs, array_keys($boucle->modificateur['criteres']));
1670 1665
 	}
1671 1666
 	// nous aider en mode debug.
1672
-	$boucle->debug[] = 'id_ : ' . implode(', ', $champs);
1667
+	$boucle->debug[] = 'id_ : '.implode(', ', $champs);
1673 1668
 	$boucle->modificateur['id_'] = $champs;
1674 1669
 
1675 1670
 	// créer un critère {id_xxx?} de chaque champ retenu
@@ -1921,8 +1916,8 @@  discard block
 block discarded – undo
1921 1916
 				"'NOT'",
1922 1917
 				[
1923 1918
 					"'IN'",
1924
-					"'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'",
1925
-					["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where]
1919
+					"'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'",
1920
+					["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where]
1926 1921
 				]
1927 1922
 			];
1928 1923
 		}
@@ -1933,7 +1928,7 @@  discard block
 block discarded – undo
1933 1928
 	if ($crit->cond) {
1934 1929
 		$pred = calculer_argument_precedent($idb, $col, $boucles);
1935 1930
 		if ($col === 'date' or $col === 'date_redac') {
1936
-			if ($pred === "\$Pile[0]['" . $col . "']") {
1931
+			if ($pred === "\$Pile[0]['".$col."']") {
1937 1932
 				$pred = "(\$Pile[0]['{$col}_default']?'':$pred)";
1938 1933
 			}
1939 1934
 		}
@@ -2096,7 +2091,7 @@  discard block
 block discarded – undo
2096 2091
 		// defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon
2097 2092
 		// prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut
2098 2093
 		if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", $val[0], $r)) {
2099
-			$val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"';
2094
+			$val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"';
2100 2095
 		}
2101 2096
 		// sinon expliciter les
2102 2097
 		// sql_quote(truc) en sql_quote(truc,'',type)
@@ -2112,14 +2107,14 @@  discard block
 block discarded – undo
2112 2107
 		) {
2113 2108
 			$r = $r[1]
2114 2109
 				. ((isset($r[2]) and $r[2]) ? $r[2] : ",''")
2115
-				. ",'" . addslashes($type_cast_quote) . "'";
2110
+				. ",'".addslashes($type_cast_quote)."'";
2116 2111
 			$val[0] = "sql_quote($r)";
2117 2112
 		}
2118 2113
 		elseif (
2119 2114
 			strpos($val[0], '@@defaultcast@@') !== false
2120 2115
 			and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)
2121 2116
 		) {
2122
-			$val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')";
2117
+			$val[0] = substr($val[0], 0, -strlen($r[0]))."'".addslashes($type_cast_quote)."')";
2123 2118
 		}
2124 2119
 	}
2125 2120
 
@@ -2127,7 +2122,7 @@  discard block
 block discarded – undo
2127 2122
 		strpos($val[0], '@@defaultcast@@') !== false
2128 2123
 		and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)
2129 2124
 	) {
2130
-		$val[0] = substr($val[0], 0, -strlen($r[0])) . "'char')";
2125
+		$val[0] = substr($val[0], 0, -strlen($r[0]))."'char')";
2131 2126
 	}
2132 2127
 
2133 2128
 	// Indicateur pour permettre aux fonctionx boucle_X de modifier
@@ -2143,7 +2138,7 @@  discard block
 block discarded – undo
2143 2138
 	// inserer le nom de la table SQL devant le nom du champ
2144 2139
 	if ($table) {
2145 2140
 		if ($col[0] == '`') {
2146
-			$arg = "$table." . substr($col, 1, -1);
2141
+			$arg = "$table.".substr($col, 1, -1);
2147 2142
 		} else {
2148 2143
 			$arg = "$table.$col";
2149 2144
 		}
@@ -2277,9 +2272,9 @@  discard block
 block discarded – undo
2277 2272
  **/
2278 2273
 function primary_doublee($decompose, $table) {
2279 2274
 	$e1 = reset($decompose);
2280
-	$e2 = "sql_quote('" . end($decompose) . "')";
2275
+	$e2 = "sql_quote('".end($decompose)."')";
2281 2276
 
2282
-	return ["'='", "'$table." . $e1 . "'", $e2];
2277
+	return ["'='", "'$table.".$e1."'", $e2];
2283 2278
 }
2284 2279
 
2285 2280
 /**
@@ -2318,7 +2313,7 @@  discard block
 block discarded – undo
2318 2313
 		$checkarrivee
2319 2314
 		and is_string($checkarrivee)
2320 2315
 		and $a = table_objet($checkarrivee)
2321
-		and in_array($a . '_liens', $joints)
2316
+		and in_array($a.'_liens', $joints)
2322 2317
 	) {
2323 2318
 		if ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee)) {
2324 2319
 			return $res;
@@ -2338,12 +2333,12 @@  discard block
 block discarded – undo
2338 2333
 				// la table est déjà dans le FROM, on vérifie si le champ est utilisé.
2339 2334
 				$joindre = false;
2340 2335
 				foreach ($cols as $col) {
2341
-					$c = '/\b' . $t . ".$col" . '\b/';
2336
+					$c = '/\b'.$t.".$col".'\b/';
2342 2337
 					if (trouver_champ($c, $boucle->where)) {
2343 2338
 						$joindre = true;
2344 2339
 					} else {
2345 2340
 						// mais ca peut etre dans le FIELD pour le Having
2346
-						$c = "/FIELD.$t" . ".$col,/";
2341
+						$c = "/FIELD.$t".".$col,/";
2347 2342
 						if (trouver_champ($c, $boucle->select)) {
2348 2343
 							$joindre = true;
2349 2344
 						}
@@ -2389,7 +2384,7 @@  discard block
 block discarded – undo
2389 2384
 	$primary_arrivee = id_table_objet($checkarrivee);
2390 2385
 
2391 2386
 	// [FIXME] $checkarrivee peut-il arriver avec false ????
2392
-	$intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens');
2387
+	$intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens');
2393 2388
 	$arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee);
2394 2389
 
2395 2390
 	if (!$intermediaire or !$arrivee) {
@@ -2493,7 +2488,7 @@  discard block
 block discarded – undo
2493 2488
 			} elseif ($crit->cond and ($col == 'date' or $col == 'date_redac')) {
2494 2489
 				// un critere conditionnel sur date est traite a part
2495 2490
 				// car la date est mise d'office par SPIP,
2496
-				$defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])";
2491
+				$defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])";
2497 2492
 			}
2498 2493
 
2499 2494
 			$val = calculer_argument_precedent($idb, $val, $boucles, $defaut);
@@ -2525,7 +2520,7 @@  discard block
 block discarded – undo
2525 2520
 			and (($p == "'") or ($p == '"'))
2526 2521
 			and $params[0][1]->type == 'champ'
2527 2522
 		) {
2528
-			$val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p";
2523
+			$val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p";
2529 2524
 		} else {
2530 2525
 			foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) {
2531 2526
 				$a = calculer_liste($p, $idb, $boucles, $parent);
@@ -2541,7 +2536,7 @@  discard block
 block discarded – undo
2541 2536
 	$fct = $args_sql = '';
2542 2537
 	// fonction SQL ?
2543 2538
 	// chercher FONCTION(champ) tel que CONCAT(titre,descriptif)
2544
-	if (preg_match('/^(.*)' . SQL_ARGS . '$/', $col, $m)) {
2539
+	if (preg_match('/^(.*)'.SQL_ARGS.'$/', $col, $m)) {
2545 2540
 		$fct = $m[1];
2546 2541
 		preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a);
2547 2542
 		$col = $a[1];
@@ -2628,7 +2623,7 @@  discard block
 block discarded – undo
2628 2623
 		# Recherche de l'existence du champ date_xxxx,
2629 2624
 		# si oui choisir ce champ, sinon choisir xxxx
2630 2625
 		if (isset($table['field']["date$suite"])) {
2631
-			$date_orig = 'date' . $suite;
2626
+			$date_orig = 'date'.$suite;
2632 2627
 		} else {
2633 2628
 			$date_orig = substr($suite, 1);
2634 2629
 		}
@@ -2648,12 +2643,12 @@  discard block
 block discarded – undo
2648 2643
 		}
2649 2644
 	}
2650 2645
 
2651
-	$date_compare = "\"' . normaliser_date(" .
2652
-		calculer_argument_precedent($idb, $pred, $boucles) .
2646
+	$date_compare = "\"' . normaliser_date(".
2647
+		calculer_argument_precedent($idb, $pred, $boucles).
2653 2648
 		") . '\"";
2654 2649
 
2655 2650
 	$col_vraie = $date_orig;
2656
-	$date_orig = $boucle->id_table . '.' . $date_orig;
2651
+	$date_orig = $boucle->id_table.'.'.$date_orig;
2657 2652
 
2658 2653
 	switch ($col) {
2659 2654
 		case 'date':
@@ -2673,26 +2668,26 @@  discard block
 block discarded – undo
2673 2668
 			break;
2674 2669
 		case 'age':
2675 2670
 			$col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig);
2676
-			$col_vraie = '';// comparer a un int (par defaut)
2671
+			$col_vraie = ''; // comparer a un int (par defaut)
2677 2672
 			break;
2678 2673
 		case 'age_relatif':
2679 2674
 			$col = calculer_param_date($date_compare, $date_orig);
2680
-			$col_vraie = '';// comparer a un int (par defaut)
2675
+			$col_vraie = ''; // comparer a un int (par defaut)
2681 2676
 			break;
2682 2677
 		case 'jour_relatif':
2683
-			$col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))';
2684
-			$col_vraie = '';// comparer a un int (par defaut)
2678
+			$col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))';
2679
+			$col_vraie = ''; // comparer a un int (par defaut)
2685 2680
 			break;
2686 2681
 		case 'mois_relatif':
2687
-			$col = 'MONTH(' . $date_compare . ')-MONTH(' .
2688
-				$date_orig . ')+12*(YEAR(' . $date_compare .
2689
-				')-YEAR(' . $date_orig . '))';
2690
-			$col_vraie = '';// comparer a un int (par defaut)
2682
+			$col = 'MONTH('.$date_compare.')-MONTH('.
2683
+				$date_orig.')+12*(YEAR('.$date_compare.
2684
+				')-YEAR('.$date_orig.'))';
2685
+			$col_vraie = ''; // comparer a un int (par defaut)
2691 2686
 			break;
2692 2687
 		case 'annee_relatif':
2693
-			$col = 'YEAR(' . $date_compare . ')-YEAR(' .
2694
-				$date_orig . ')';
2695
-			$col_vraie = '';// comparer a un int (par defaut)
2688
+			$col = 'YEAR('.$date_compare.')-YEAR('.
2689
+				$date_orig.')';
2690
+			$col_vraie = ''; // comparer a un int (par defaut)
2696 2691
 			break;
2697 2692
 	}
2698 2693
 
@@ -2753,10 +2748,10 @@  discard block
 block discarded – undo
2753 2748
 	}
2754 2749
 
2755 2750
 	$boucle->hash .= '
2756
-	$command[\'sourcemode\'] = ' . array_shift($args) . ";\n";
2751
+	$command[\'sourcemode\'] = ' . array_shift($args).";\n";
2757 2752
 
2758 2753
 	$boucle->hash .= '
2759
-	$command[\'source\'] = array(' . join(', ', $args) . ");\n";
2754
+	$command[\'source\'] = array(' . join(', ', $args).");\n";
2760 2755
 }
2761 2756
 
2762 2757
 /**
@@ -2775,7 +2770,7 @@  discard block
 block discarded – undo
2775 2770
 function critere_DATA_datacache_dist($idb, &$boucles, $crit) {
2776 2771
 	$boucle = &$boucles[$idb];
2777 2772
 	$boucle->hash .= '
2778
-	$command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2773
+	$command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';';
2779 2774
 }
2780 2775
 
2781 2776
 
@@ -2794,7 +2789,7 @@  discard block
 block discarded – undo
2794 2789
 	$boucle->hash .= '$command[\'args\']=array();';
2795 2790
 	foreach ($crit->param as $param) {
2796 2791
 		$boucle->hash .= '
2797
-			$command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2792
+			$command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';';
2798 2793
 	}
2799 2794
 }
2800 2795
 
@@ -2813,14 +2808,14 @@  discard block
 block discarded – undo
2813 2808
  */
2814 2809
 function critere_DATA_liste_dist($idb, &$boucles, $crit) {
2815 2810
 	$boucle = &$boucles[$idb];
2816
-	$boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n";
2811
+	$boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n";
2817 2812
 	foreach ($crit->param as $param) {
2818
-		$boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste(
2813
+		$boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste(
2819 2814
 			$param,
2820 2815
 			$idb,
2821 2816
 			$boucles,
2822 2817
 			$boucles[$idb]->id_parent
2823
-		) . ";\n";
2818
+		).";\n";
2824 2819
 	}
2825 2820
 }
2826 2821
 
@@ -2847,14 +2842,14 @@  discard block
 block discarded – undo
2847 2842
  */
2848 2843
 function critere_DATA_enum_dist($idb, &$boucles, $crit) {
2849 2844
 	$boucle = &$boucles[$idb];
2850
-	$boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n";
2845
+	$boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n";
2851 2846
 	foreach ($crit->param as $param) {
2852
-		$boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste(
2847
+		$boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste(
2853 2848
 			$param,
2854 2849
 			$idb,
2855 2850
 			$boucles,
2856 2851
 			$boucles[$idb]->id_parent
2857
-		) . ";\n";
2852
+		).";\n";
2858 2853
 	}
2859 2854
 }
2860 2855
 
@@ -2873,7 +2868,7 @@  discard block
 block discarded – undo
2873 2868
 	$boucle = &$boucles[$idb];
2874 2869
 	foreach ($crit->param as $param) {
2875 2870
 		$boucle->hash .= '
2876
-			$command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';';
2871
+			$command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';';
2877 2872
 	}
2878 2873
 }
2879 2874
 
@@ -2914,7 +2909,7 @@  discard block
 block discarded – undo
2914 2909
 	if ($crit->param) {
2915 2910
 		foreach ($crit->param as $param) {
2916 2911
 			$boucle->hash .= "\t\$command['si'][] = "
2917
-				. calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n";
2912
+				. calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n";
2918 2913
 		}
2919 2914
 		// interdire {si 0} aussi !
2920 2915
 	} else {
@@ -2938,7 +2933,7 @@  discard block
 block discarded – undo
2938 2933
 function critere_POUR_tableau_dist($idb, &$boucles, $crit) {
2939 2934
 	$boucle = &$boucles[$idb];
2940 2935
 	$boucle->hash .= '
2941
-	$command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ');
2936
+	$command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).');
2942 2937
 	$command[\'sourcemode\'] = \'table\';';
2943 2938
 }
2944 2939
 
@@ -2973,7 +2968,7 @@  discard block
 block discarded – undo
2973 2968
 	$id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent';
2974 2969
 
2975 2970
 	$in = 'IN';
2976
-	$where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"];
2971
+	$where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"];
2977 2972
 	if ($not) {
2978 2973
 		$where = ["'NOT'", $where];
2979 2974
 	}
Please login to merge, or discard this patch.