Completed
Push — master ( 9cd19c...f32c85 )
by cam
01:48
created
ecrire/inc/modifier.php 2 patches
Indentation   +257 added lines, -257 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -39,28 +39,28 @@  discard block
 block discarded – undo
39 39
  *     Tableau des champs et valeurs collectées
40 40
  */
41 41
 function collecter_requests($white_list, $black_list = [], $set = null, $tous = false) {
42
-	$c = $set;
43
-	if (!$c) {
44
-		$c = [];
45
-		foreach ($white_list as $champ) {
46
-			// on ne collecte que les champs reellement envoyes par defaut.
47
-			// le cas d'un envoi de valeur NULL peut du coup poser probleme.
48
-			$val = _request($champ);
49
-			if ($tous or $val !== null) {
50
-				$c[$champ] = $val;
51
-			}
52
-		}
53
-		// on ajoute toujours la lang en saisie possible
54
-		// meme si pas prevu au depart pour l'objet concerne
55
-		if ($l = _request('changer_lang')) {
56
-			$c['lang'] = $l;
57
-		}
58
-	}
59
-	foreach ($black_list as $champ) {
60
-		unset($c[$champ]);
61
-	}
62
-
63
-	return $c;
42
+    $c = $set;
43
+    if (!$c) {
44
+        $c = [];
45
+        foreach ($white_list as $champ) {
46
+            // on ne collecte que les champs reellement envoyes par defaut.
47
+            // le cas d'un envoi de valeur NULL peut du coup poser probleme.
48
+            $val = _request($champ);
49
+            if ($tous or $val !== null) {
50
+                $c[$champ] = $val;
51
+            }
52
+        }
53
+        // on ajoute toujours la lang en saisie possible
54
+        // meme si pas prevu au depart pour l'objet concerne
55
+        if ($l = _request('changer_lang')) {
56
+            $c['lang'] = $l;
57
+        }
58
+    }
59
+    foreach ($black_list as $champ) {
60
+        unset($c[$champ]);
61
+    }
62
+
63
+    return $c;
64 64
 }
65 65
 
66 66
 /**
@@ -97,238 +97,238 @@  discard block
 block discarded – undo
97 97
  *     - chaîne : Texte d'un message d'erreur
98 98
  */
99 99
 function objet_modifier_champs($objet, $id_objet, $options, $c = null, $serveur = '') {
100
-	if (!$id_objet = intval($id_objet)) {
101
-		spip_log('Erreur $id_objet non defini', 'warn');
102
-
103
-		return _T('erreur_technique_enregistrement_impossible');
104
-	}
105
-
106
-	include_spip('inc/filtres');
107
-
108
-	$table_objet = table_objet($objet, $serveur);
109
-	$spip_table_objet = table_objet_sql($objet, $serveur);
110
-	$id_table_objet = id_table_objet($objet, $serveur);
111
-	$trouver_table = charger_fonction('trouver_table', 'base');
112
-	$desc = $trouver_table($spip_table_objet, $serveur);
113
-
114
-	// Appels incomplets (sans $c)
115
-	if (!is_array($c)) {
116
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
117
-
118
-		return _T('erreur_technique_enregistrement_impossible');
119
-	}
120
-
121
-	// Securite : certaines variables ne sont jamais acceptees ici
122
-	// car elles ne relevent pas de autoriser(xxx, modifier) ;
123
-	// il faut passer par instituer_XX()
124
-	// TODO: faut-il passer ces variables interdites
125
-	// dans un fichier de description separe ?
126
-	unset($c['statut']);
127
-	unset($c['id_parent']);
128
-	unset($c['id_rubrique']);
129
-	unset($c['id_secteur']);
130
-
131
-	// Gerer les champs non vides
132
-	if (isset($options['nonvide']) and is_array($options['nonvide'])) {
133
-		foreach ($options['nonvide'] as $champ => $sinon) {
134
-			if (isset($c[$champ]) and $c[$champ] === '') {
135
-				$c[$champ] = $sinon;
136
-			}
137
-		}
138
-	}
139
-
140
-	// N'accepter que les champs qui existent
141
-	// TODO: ici aussi on peut valider les contenus
142
-	// en fonction du type
143
-	$champs = array_intersect_key($c, $desc['field']);
144
-
145
-	// Nettoyer les valeurs
146
-	$champs = array_map('corriger_caracteres', $champs);
147
-
148
-	// On récupère l'état avant toute modification
149
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
150
-
151
-	// Envoyer aux plugins
152
-	$champs = pipeline(
153
-		'pre_edition',
154
-		[
155
-			'args' => [
156
-				'table' => $spip_table_objet, // compatibilite
157
-				'table_objet' => $table_objet,
158
-				'spip_table_objet' => $spip_table_objet,
159
-				'desc' => $desc,
160
-				'type' => $objet,
161
-				'id_objet' => $id_objet,
162
-				'data' => $options['data'] ?? null,
163
-				'champs' => $options['champs'] ?? [], // [doc] c'est quoi ?
164
-				'champs_anciens' => $row, // état du contenu avant modif
165
-				'serveur' => $serveur,
166
-				'action' => $options['action'] ?? 'modifier'
167
-			],
168
-			'data' => $champs
169
-		]
170
-	);
171
-
172
-	if (!$champs) {
173
-		return false;
174
-	}
175
-
176
-
177
-	// marquer le fait que l'objet est travaille par toto a telle date
178
-	if ($GLOBALS['meta']['articles_modif'] != 'non') {
179
-		include_spip('inc/drapeau_edition');
180
-		signale_edition($id_objet, $GLOBALS['visiteur_session'], $objet);
181
-	}
182
-
183
-	// Verifier si les mises a jour sont pertinentes, datees, en conflit etc
184
-	include_spip('inc/editer');
185
-	if (!isset($options['data']) or is_null($options['data'])) {
186
-		$options['data'] = &$_POST;
187
-	}
188
-	$conflits = controler_md5($champs, $options['data'], $objet, $id_objet, $serveur);
189
-	// cas hypothetique : normalement inc/editer verifie en amont le conflit edition
190
-	// et gere l'interface
191
-	// ici on ne renvoie donc qu'un messsage d'erreur, au cas ou on y arrive quand meme
192
-	if ($conflits) {
193
-		return _T('titre_conflit_edition');
194
-	}
195
-
196
-	if ($champs) {
197
-		// cas particulier de la langue : passer par instituer_langue_objet
198
-		if (isset($champs['lang'])) {
199
-			if ($changer_lang = $champs['lang']) {
200
-				$id_rubrique = 0;
201
-				if (isset($desc['field']['id_rubrique'])) {
202
-					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
203
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
204
-				}
205
-				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
206
-				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
207
-			}
208
-			// on laisse 'lang' dans $champs,
209
-			// ca permet de passer dans le pipeline post_edition et de journaliser
210
-			// et ca ne gene pas qu'on refasse un sql_updateq dessus apres l'avoir
211
-			// deja pris en compte
212
-		}
213
-
214
-		// la modif peut avoir lieu
215
-
216
-		// faut-il ajouter date_modif ?
217
-		if (
218
-			!empty($options['date_modif'])
219
-			and !isset($champs[$options['date_modif']])
220
-		) {
221
-			$champs[$options['date_modif']] = date('Y-m-d H:i:s');
222
-		}
223
-
224
-		// allez on commit la modif
225
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), $serveur);
226
-
227
-		// on verifie si elle est bien passee
228
-		$moof = sql_fetsel(
229
-			array_keys($champs),
230
-			$spip_table_objet,
231
-			"$id_table_objet=" . intval($id_objet),
232
-			[],
233
-			[],
234
-			'',
235
-			[],
236
-			$serveur
237
-		);
238
-		// si difference entre les champs, reperer les champs mal enregistres
239
-		if ($moof != $champs) {
240
-			$liste = [];
241
-			foreach ($moof as $k => $v) {
242
-				if (
243
-					$v !== $champs[$k]
244
-					// ne pas alerter si le champ est numerique est que les valeurs sont equivalentes
245
-					and (!is_numeric($v) or intval($v) !== intval($champs[$k]))
246
-					// ne pas alerter si le champ est date, qu'on a envoye une valeur vide et qu'on recupere une date nulle
247
-					and (strlen($champs[$k]) or !in_array($v, ['0000-00-00 00:00:00', '0000-00-00']))
248
-				) {
249
-					$liste[] = $k;
250
-					$conflits[$k]['post'] = $champs[$k];
251
-					$conflits[$k]['save'] = $v;
252
-
253
-					// cas specifique MySQL+emoji : si l'un est la
254
-					// conversion utf8_noplanes de l'autre alors c'est OK
255
-					if (defined('_MYSQL_NOPLANES') && _MYSQL_NOPLANES) {
256
-						include_spip('inc/charsets');
257
-						if ($v == utf8_noplanes($champs[$k])) {
258
-							array_pop($liste);
259
-						}
260
-					}
261
-				}
262
-			}
263
-			// si un champ n'a pas ete correctement enregistre, loger et retourner une erreur
264
-			// c'est un cas exceptionnel
265
-			if (count($liste)) {
266
-				spip_log(
267
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
268
-					'modifier.' . _LOG_CRITIQUE
269
-				);
270
-
271
-				return _T(
272
-					'erreur_technique_enregistrement_champs',
273
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
274
-				);
275
-			}
276
-		}
277
-
278
-		// Invalider les caches
279
-		if (isset($options['invalideur']) and $options['invalideur']) {
280
-			include_spip('inc/invalideur');
281
-			if (is_array($options['invalideur'])) {
282
-				array_map('suivre_invalideur', $options['invalideur']);
283
-			} else {
284
-				suivre_invalideur($options['invalideur']);
285
-			}
286
-		}
287
-
288
-		// Notifications, gestion des revisions...
289
-		// en standard, appelle |nouvelle_revision ci-dessous
290
-		pipeline(
291
-			'post_edition',
292
-			[
293
-				'args' => [
294
-					'table' => $spip_table_objet,
295
-					'table_objet' => $table_objet,
296
-					'spip_table_objet' => $spip_table_objet,
297
-					'desc' => $desc,
298
-					'type' => $objet,
299
-					'id_objet' => $id_objet,
300
-					'champs' => $options['champs'] ?? [], // [doc] kesako ?
301
-					'champs_anciens' => $row, // état du contenu avant modif
302
-					'serveur' => $serveur,
303
-					'action' => $options['action'] ?? 'modifier'
304
-				],
305
-				'data' => $champs
306
-			]
307
-		);
308
-	}
309
-
310
-	// journaliser l'affaire
311
-	// message a affiner :-)
312
-	include_spip('inc/filtres_mini');
313
-	$qui = '';
314
-	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
315
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
316
-	}
317
-	if (!empty($GLOBALS['visiteur_session']['nom'])) {
318
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
319
-	}
320
-	if ($qui == '') {
321
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
322
-	}
323
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
324
-		'+',
325
-		'+',
326
-		array_diff(array_keys($champs), ['date_modif'])
327
-	) . ')'), [
328
-		'faire' => 'modifier',
329
-		'quoi' => $objet,
330
-		'id' => $id_objet
331
-	]);
332
-
333
-	return '';
100
+    if (!$id_objet = intval($id_objet)) {
101
+        spip_log('Erreur $id_objet non defini', 'warn');
102
+
103
+        return _T('erreur_technique_enregistrement_impossible');
104
+    }
105
+
106
+    include_spip('inc/filtres');
107
+
108
+    $table_objet = table_objet($objet, $serveur);
109
+    $spip_table_objet = table_objet_sql($objet, $serveur);
110
+    $id_table_objet = id_table_objet($objet, $serveur);
111
+    $trouver_table = charger_fonction('trouver_table', 'base');
112
+    $desc = $trouver_table($spip_table_objet, $serveur);
113
+
114
+    // Appels incomplets (sans $c)
115
+    if (!is_array($c)) {
116
+        spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
117
+
118
+        return _T('erreur_technique_enregistrement_impossible');
119
+    }
120
+
121
+    // Securite : certaines variables ne sont jamais acceptees ici
122
+    // car elles ne relevent pas de autoriser(xxx, modifier) ;
123
+    // il faut passer par instituer_XX()
124
+    // TODO: faut-il passer ces variables interdites
125
+    // dans un fichier de description separe ?
126
+    unset($c['statut']);
127
+    unset($c['id_parent']);
128
+    unset($c['id_rubrique']);
129
+    unset($c['id_secteur']);
130
+
131
+    // Gerer les champs non vides
132
+    if (isset($options['nonvide']) and is_array($options['nonvide'])) {
133
+        foreach ($options['nonvide'] as $champ => $sinon) {
134
+            if (isset($c[$champ]) and $c[$champ] === '') {
135
+                $c[$champ] = $sinon;
136
+            }
137
+        }
138
+    }
139
+
140
+    // N'accepter que les champs qui existent
141
+    // TODO: ici aussi on peut valider les contenus
142
+    // en fonction du type
143
+    $champs = array_intersect_key($c, $desc['field']);
144
+
145
+    // Nettoyer les valeurs
146
+    $champs = array_map('corriger_caracteres', $champs);
147
+
148
+    // On récupère l'état avant toute modification
149
+    $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
150
+
151
+    // Envoyer aux plugins
152
+    $champs = pipeline(
153
+        'pre_edition',
154
+        [
155
+            'args' => [
156
+                'table' => $spip_table_objet, // compatibilite
157
+                'table_objet' => $table_objet,
158
+                'spip_table_objet' => $spip_table_objet,
159
+                'desc' => $desc,
160
+                'type' => $objet,
161
+                'id_objet' => $id_objet,
162
+                'data' => $options['data'] ?? null,
163
+                'champs' => $options['champs'] ?? [], // [doc] c'est quoi ?
164
+                'champs_anciens' => $row, // état du contenu avant modif
165
+                'serveur' => $serveur,
166
+                'action' => $options['action'] ?? 'modifier'
167
+            ],
168
+            'data' => $champs
169
+        ]
170
+    );
171
+
172
+    if (!$champs) {
173
+        return false;
174
+    }
175
+
176
+
177
+    // marquer le fait que l'objet est travaille par toto a telle date
178
+    if ($GLOBALS['meta']['articles_modif'] != 'non') {
179
+        include_spip('inc/drapeau_edition');
180
+        signale_edition($id_objet, $GLOBALS['visiteur_session'], $objet);
181
+    }
182
+
183
+    // Verifier si les mises a jour sont pertinentes, datees, en conflit etc
184
+    include_spip('inc/editer');
185
+    if (!isset($options['data']) or is_null($options['data'])) {
186
+        $options['data'] = &$_POST;
187
+    }
188
+    $conflits = controler_md5($champs, $options['data'], $objet, $id_objet, $serveur);
189
+    // cas hypothetique : normalement inc/editer verifie en amont le conflit edition
190
+    // et gere l'interface
191
+    // ici on ne renvoie donc qu'un messsage d'erreur, au cas ou on y arrive quand meme
192
+    if ($conflits) {
193
+        return _T('titre_conflit_edition');
194
+    }
195
+
196
+    if ($champs) {
197
+        // cas particulier de la langue : passer par instituer_langue_objet
198
+        if (isset($champs['lang'])) {
199
+            if ($changer_lang = $champs['lang']) {
200
+                $id_rubrique = 0;
201
+                if (isset($desc['field']['id_rubrique'])) {
202
+                    $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
203
+                    $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
204
+                }
205
+                $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
206
+                $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
207
+            }
208
+            // on laisse 'lang' dans $champs,
209
+            // ca permet de passer dans le pipeline post_edition et de journaliser
210
+            // et ca ne gene pas qu'on refasse un sql_updateq dessus apres l'avoir
211
+            // deja pris en compte
212
+        }
213
+
214
+        // la modif peut avoir lieu
215
+
216
+        // faut-il ajouter date_modif ?
217
+        if (
218
+            !empty($options['date_modif'])
219
+            and !isset($champs[$options['date_modif']])
220
+        ) {
221
+            $champs[$options['date_modif']] = date('Y-m-d H:i:s');
222
+        }
223
+
224
+        // allez on commit la modif
225
+        sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), $serveur);
226
+
227
+        // on verifie si elle est bien passee
228
+        $moof = sql_fetsel(
229
+            array_keys($champs),
230
+            $spip_table_objet,
231
+            "$id_table_objet=" . intval($id_objet),
232
+            [],
233
+            [],
234
+            '',
235
+            [],
236
+            $serveur
237
+        );
238
+        // si difference entre les champs, reperer les champs mal enregistres
239
+        if ($moof != $champs) {
240
+            $liste = [];
241
+            foreach ($moof as $k => $v) {
242
+                if (
243
+                    $v !== $champs[$k]
244
+                    // ne pas alerter si le champ est numerique est que les valeurs sont equivalentes
245
+                    and (!is_numeric($v) or intval($v) !== intval($champs[$k]))
246
+                    // ne pas alerter si le champ est date, qu'on a envoye une valeur vide et qu'on recupere une date nulle
247
+                    and (strlen($champs[$k]) or !in_array($v, ['0000-00-00 00:00:00', '0000-00-00']))
248
+                ) {
249
+                    $liste[] = $k;
250
+                    $conflits[$k]['post'] = $champs[$k];
251
+                    $conflits[$k]['save'] = $v;
252
+
253
+                    // cas specifique MySQL+emoji : si l'un est la
254
+                    // conversion utf8_noplanes de l'autre alors c'est OK
255
+                    if (defined('_MYSQL_NOPLANES') && _MYSQL_NOPLANES) {
256
+                        include_spip('inc/charsets');
257
+                        if ($v == utf8_noplanes($champs[$k])) {
258
+                            array_pop($liste);
259
+                        }
260
+                    }
261
+                }
262
+            }
263
+            // si un champ n'a pas ete correctement enregistre, loger et retourner une erreur
264
+            // c'est un cas exceptionnel
265
+            if (count($liste)) {
266
+                spip_log(
267
+                    "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
268
+                    'modifier.' . _LOG_CRITIQUE
269
+                );
270
+
271
+                return _T(
272
+                    'erreur_technique_enregistrement_champs',
273
+                    ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
274
+                );
275
+            }
276
+        }
277
+
278
+        // Invalider les caches
279
+        if (isset($options['invalideur']) and $options['invalideur']) {
280
+            include_spip('inc/invalideur');
281
+            if (is_array($options['invalideur'])) {
282
+                array_map('suivre_invalideur', $options['invalideur']);
283
+            } else {
284
+                suivre_invalideur($options['invalideur']);
285
+            }
286
+        }
287
+
288
+        // Notifications, gestion des revisions...
289
+        // en standard, appelle |nouvelle_revision ci-dessous
290
+        pipeline(
291
+            'post_edition',
292
+            [
293
+                'args' => [
294
+                    'table' => $spip_table_objet,
295
+                    'table_objet' => $table_objet,
296
+                    'spip_table_objet' => $spip_table_objet,
297
+                    'desc' => $desc,
298
+                    'type' => $objet,
299
+                    'id_objet' => $id_objet,
300
+                    'champs' => $options['champs'] ?? [], // [doc] kesako ?
301
+                    'champs_anciens' => $row, // état du contenu avant modif
302
+                    'serveur' => $serveur,
303
+                    'action' => $options['action'] ?? 'modifier'
304
+                ],
305
+                'data' => $champs
306
+            ]
307
+        );
308
+    }
309
+
310
+    // journaliser l'affaire
311
+    // message a affiner :-)
312
+    include_spip('inc/filtres_mini');
313
+    $qui = '';
314
+    if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
315
+        $qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
316
+    }
317
+    if (!empty($GLOBALS['visiteur_session']['nom'])) {
318
+        $qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
319
+    }
320
+    if ($qui == '') {
321
+        $qui = '#ip:' . $GLOBALS['ip'] . '#';
322
+    }
323
+    journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
324
+        '+',
325
+        '+',
326
+        array_diff(array_keys($champs), ['date_modif'])
327
+    ) . ')'), [
328
+        'faire' => 'modifier',
329
+        'quoi' => $objet,
330
+        'id' => $id_objet
331
+    ]);
332
+
333
+    return '';
334 334
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 	// Appels incomplets (sans $c)
115 115
 	if (!is_array($c)) {
116
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
116
+		spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c');
117 117
 
118 118
 		return _T('erreur_technique_enregistrement_impossible');
119 119
 	}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	$champs = array_map('corriger_caracteres', $champs);
147 147
 
148 148
 	// On récupère l'état avant toute modification
149
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
149
+	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet);
150 150
 
151 151
 	// Envoyer aux plugins
152 152
 	$champs = pipeline(
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 				$id_rubrique = 0;
201 201
 				if (isset($desc['field']['id_rubrique'])) {
202 202
 					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
203
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
203
+					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet));
204 204
 				}
205 205
 				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
206 206
 				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
 		}
223 223
 
224 224
 		// allez on commit la modif
225
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), $serveur);
225
+		sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), $serveur);
226 226
 
227 227
 		// on verifie si elle est bien passee
228 228
 		$moof = sql_fetsel(
229 229
 			array_keys($champs),
230 230
 			$spip_table_objet,
231
-			"$id_table_objet=" . intval($id_objet),
231
+			"$id_table_objet=".intval($id_objet),
232 232
 			[],
233 233
 			[],
234 234
 			'',
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
 			// c'est un cas exceptionnel
265 265
 			if (count($liste)) {
266 266
 				spip_log(
267
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
268
-					'modifier.' . _LOG_CRITIQUE
267
+					"Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true),
268
+					'modifier.'._LOG_CRITIQUE
269 269
 				);
270 270
 
271 271
 				return _T(
272 272
 					'erreur_technique_enregistrement_champs',
273
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
273
+					['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"]
274 274
 				);
275 275
 			}
276 276
 		}
@@ -312,19 +312,19 @@  discard block
 block discarded – undo
312 312
 	include_spip('inc/filtres_mini');
313 313
 	$qui = '';
314 314
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
315
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
315
+		$qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#';
316 316
 	}
317 317
 	if (!empty($GLOBALS['visiteur_session']['nom'])) {
318
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
318
+		$qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#';
319 319
 	}
320 320
 	if ($qui == '') {
321
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
321
+		$qui = '#ip:'.$GLOBALS['ip'].'#';
322 322
 	}
323
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
323
+	journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join(
324 324
 		'+',
325 325
 		'+',
326 326
 		array_diff(array_keys($champs), ['date_modif'])
327
-	) . ')'), [
327
+	).')'), [
328 328
 		'faire' => 'modifier',
329 329
 		'quoi' => $objet,
330 330
 		'id' => $id_objet
Please login to merge, or discard this patch.