Completed
Push — master ( 5e73c9...220241 )
by cam
01:00
created
ecrire/req/sqlite_generique.php 1 patch
Indentation   +1622 added lines, -1622 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 // TODO: get/set_caracteres ?
@@ -44,91 +44,91 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function req_sqlite_dist($addr, $port, $login, $pass, $db = '', $prefixe = '', $sqlite_version = '')
46 46
 {
47
-	static $last_connect = [];
48
-
49
-	// si provient de selectdb
50
-	// un code pour etre sur que l'on vient de select_db()
51
-	if (strpos($db, $code = '@selectdb@') !== false) {
52
-		foreach (['addr', 'port', 'login', 'pass', 'prefixe'] as $a) {
53
-			$$a = $last_connect[$a];
54
-		}
55
-		$db = str_replace($code, '', $db);
56
-	}
57
-
58
-	/*
47
+    static $last_connect = [];
48
+
49
+    // si provient de selectdb
50
+    // un code pour etre sur que l'on vient de select_db()
51
+    if (strpos($db, $code = '@selectdb@') !== false) {
52
+        foreach (['addr', 'port', 'login', 'pass', 'prefixe'] as $a) {
53
+            $$a = $last_connect[$a];
54
+        }
55
+        $db = str_replace($code, '', $db);
56
+    }
57
+
58
+    /*
59 59
 	 * En sqlite, seule l'adresse du fichier est importante.
60 60
 	 * Ce sera $db le nom,
61 61
 	 * le path est $addr
62 62
 	 * (_DIR_DB si $addr est vide)
63 63
 	 */
64
-	_sqlite_init();
65
-
66
-	// determiner le dossier de la base : $addr ou _DIR_DB
67
-	$f = _DIR_DB;
68
-	if ($addr and str_contains($addr, '/')) {
69
-		$f = rtrim($addr, '/') . '/';
70
-	}
71
-
72
-	// un nom de base demande et impossible d'obtenir la base, on s'en va :
73
-	// il faut que la base existe ou que le repertoire parent soit writable
74
-	if ($db and !is_file($f .= $db . '.sqlite') and !is_writable(dirname($f))) {
75
-		spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.' . _LOG_HS);
76
-
77
-		return false;
78
-	}
79
-
80
-	// charger les modules sqlite au besoin
81
-	if (!_sqlite_charger_version($sqlite_version)) {
82
-		spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.' . _LOG_HS);
83
-
84
-		return false;
85
-	}
86
-
87
-	// chargement des constantes
88
-	// il ne faut pas definir les constantes avant d'avoir charge les modules sqlite
89
-	$define = 'spip_sqlite' . $sqlite_version . '_constantes';
90
-	$define();
91
-
92
-	$ok = false;
93
-	if (!$db) {
94
-		// si pas de db ->
95
-		// base temporaire tant qu'on ne connait pas son vrai nom
96
-		// pour tester la connexion
97
-		$db = '_sqlite' . $sqlite_version . '_install';
98
-		$tmp = _DIR_DB . $db . '.sqlite';
99
-		$ok = $link = new \PDO("sqlite:$tmp");
100
-	} else {
101
-		// Ouvrir (eventuellement creer la base)
102
-		$ok = $link = new \PDO("sqlite:$f");
103
-	}
104
-
105
-	if (!$ok) {
106
-		$e = _sqlite_last_error_from_link($link);
107
-		spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.' . _LOG_HS);
108
-
109
-		return false;
110
-	}
111
-
112
-	if ($link) {
113
-		$last_connect = [
114
-			'addr' => $addr,
115
-			'port' => $port,
116
-			'login' => $login,
117
-			'pass' => $pass,
118
-			'db' => $db,
119
-			'prefixe' => $prefixe,
120
-		];
121
-		// etre sur qu'on definit bien les fonctions a chaque nouvelle connexion
122
-		include_spip('req/sqlite_fonctions');
123
-		_sqlite_init_functions($link);
124
-	}
125
-
126
-	return [
127
-		'db' => $db,
128
-		'prefixe' => $prefixe ? $prefixe : $db,
129
-		'link' => $link,
130
-		'total_requetes' => 0,
131
-	];
64
+    _sqlite_init();
65
+
66
+    // determiner le dossier de la base : $addr ou _DIR_DB
67
+    $f = _DIR_DB;
68
+    if ($addr and str_contains($addr, '/')) {
69
+        $f = rtrim($addr, '/') . '/';
70
+    }
71
+
72
+    // un nom de base demande et impossible d'obtenir la base, on s'en va :
73
+    // il faut que la base existe ou que le repertoire parent soit writable
74
+    if ($db and !is_file($f .= $db . '.sqlite') and !is_writable(dirname($f))) {
75
+        spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.' . _LOG_HS);
76
+
77
+        return false;
78
+    }
79
+
80
+    // charger les modules sqlite au besoin
81
+    if (!_sqlite_charger_version($sqlite_version)) {
82
+        spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.' . _LOG_HS);
83
+
84
+        return false;
85
+    }
86
+
87
+    // chargement des constantes
88
+    // il ne faut pas definir les constantes avant d'avoir charge les modules sqlite
89
+    $define = 'spip_sqlite' . $sqlite_version . '_constantes';
90
+    $define();
91
+
92
+    $ok = false;
93
+    if (!$db) {
94
+        // si pas de db ->
95
+        // base temporaire tant qu'on ne connait pas son vrai nom
96
+        // pour tester la connexion
97
+        $db = '_sqlite' . $sqlite_version . '_install';
98
+        $tmp = _DIR_DB . $db . '.sqlite';
99
+        $ok = $link = new \PDO("sqlite:$tmp");
100
+    } else {
101
+        // Ouvrir (eventuellement creer la base)
102
+        $ok = $link = new \PDO("sqlite:$f");
103
+    }
104
+
105
+    if (!$ok) {
106
+        $e = _sqlite_last_error_from_link($link);
107
+        spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.' . _LOG_HS);
108
+
109
+        return false;
110
+    }
111
+
112
+    if ($link) {
113
+        $last_connect = [
114
+            'addr' => $addr,
115
+            'port' => $port,
116
+            'login' => $login,
117
+            'pass' => $pass,
118
+            'db' => $db,
119
+            'prefixe' => $prefixe,
120
+        ];
121
+        // etre sur qu'on definit bien les fonctions a chaque nouvelle connexion
122
+        include_spip('req/sqlite_fonctions');
123
+        _sqlite_init_functions($link);
124
+    }
125
+
126
+    return [
127
+        'db' => $db,
128
+        'prefixe' => $prefixe ? $prefixe : $db,
129
+        'link' => $link,
130
+        'total_requetes' => 0,
131
+    ];
132 132
 }
133 133
 
134 134
 
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
  */
149 149
 function spip_sqlite_query($query, $serveur = '', $requeter = true)
150 150
 {
151
-	#spip_log("spip_sqlite_query() > $query",'sqlite.'._LOG_DEBUG);
152
-	#_sqlite_init(); // fait la premiere fois dans spip_sqlite
153
-	$query = Sqlite::traduire_requete($query, $serveur);
154
-	if (!$requeter) {
155
-		return $query;
156
-	}
157
-
158
-	return Sqlite::executer_requete($query, $serveur);
151
+    #spip_log("spip_sqlite_query() > $query",'sqlite.'._LOG_DEBUG);
152
+    #_sqlite_init(); // fait la premiere fois dans spip_sqlite
153
+    $query = Sqlite::traduire_requete($query, $serveur);
154
+    if (!$requeter) {
155
+        return $query;
156
+    }
157
+
158
+    return Sqlite::executer_requete($query, $serveur);
159 159
 }
160 160
 
161 161
 
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 function spip_sqlite_alter($query, $serveur = '', $requeter = true)
174 174
 {
175 175
 
176
-	$query = spip_sqlite_query("ALTER $query", $serveur, false);
177
-	// traduire la requete pour recuperer les bons noms de table
178
-	$query = Sqlite::traduire_requete($query, $serveur);
176
+    $query = spip_sqlite_query("ALTER $query", $serveur, false);
177
+    // traduire la requete pour recuperer les bons noms de table
178
+    $query = Sqlite::traduire_requete($query, $serveur);
179 179
 
180
-	/*
180
+    /*
181 181
 		 * la il faut faire les transformations
182 182
 		 * si ALTER TABLE x (DROP|CHANGE) y
183 183
 		 *
@@ -186,251 +186,251 @@  discard block
 block discarded – undo
186 186
 		 * 3) faire chaque requete independemment
187 187
 		 */
188 188
 
189
-	// 1
190
-	if (preg_match('/\s*(ALTER(\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
191
-		$debut = $regs[1];
192
-		$table = $regs[3];
193
-		$suite = $regs[4];
194
-	} else {
195
-		spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.' . _LOG_ERREUR);
196
-
197
-		return false;
198
-	}
199
-
200
-	// 2
201
-	// il faudrait une regexp pour eviter de spliter ADD PRIMARY KEY (colA, colB)
202
-	// tout en cassant "ADD PRIMARY KEY (colA, colB), ADD INDEX (chose)"... en deux
203
-	// ou revoir l'api de sql_alter en creant un
204
-	// sql_alter_table($table,array($actions));
205
-	$todo = explode(',', $suite);
206
-
207
-	// on remet les morceaux dechires ensembles... que c'est laid !
208
-	$todo2 = [];
209
-	$i = 0;
210
-	$ouverte = false;
211
-	while ($do = array_shift($todo)) {
212
-		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
213
-		$o = (str_contains($do, '('));
214
-		$f = (str_contains($do, ')'));
215
-		if ($o and !$f) {
216
-			$ouverte = true;
217
-		} elseif ($f) {
218
-			$ouverte = false;
219
-		}
220
-		if (!$ouverte) {
221
-			$i++;
222
-		}
223
-	}
224
-
225
-	// 3
226
-	$resultats = [];
227
-	foreach ($todo2 as $do) {
228
-		$do = trim($do);
229
-		if (
230
-			!preg_match('/(DROP PRIMARY KEY|DROP KEY|DROP INDEX|DROP COLUMN|DROP'
231
-				. '|CHANGE COLUMN|CHANGE|MODIFY|RENAME TO|RENAME'
232
-				. '|ADD PRIMARY KEY|ADD KEY|ADD INDEX|ADD UNIQUE KEY|ADD UNIQUE'
233
-				. '|ADD COLUMN|ADD'
234
-				. ')\s*([^\s]*)\s*(.*)?/i', $do, $matches)
235
-		) {
236
-			spip_log(
237
-				"SQLite : Probleme de ALTER TABLE, utilisation non reconnue dans : $do \n(requete d'origine : $query)",
238
-				'sqlite.' . _LOG_ERREUR
239
-			);
240
-
241
-			return false;
242
-		}
243
-
244
-		$cle = strtoupper($matches[1]);
245
-		$colonne_origine = $matches[2];
246
-		$colonne_destination = '';
247
-
248
-		$def = $matches[3];
249
-
250
-		// eluder une eventuelle clause before|after|first inutilisable
251
-		$defr = rtrim(preg_replace('/(BEFORE|AFTER|FIRST)(.*)$/is', '', $def));
252
-		$defo = $defr; // garder la def d'origine pour certains cas
253
-		// remplacer les definitions venant de mysql
254
-		$defr = _sqlite_remplacements_definitions_table($defr);
255
-
256
-		// reinjecter dans le do
257
-		$do = str_replace($def, $defr, $do);
258
-		$def = $defr;
259
-
260
-		switch ($cle) {
261
-				// suppression d'un index
262
-			case 'DROP KEY':
263
-			case 'DROP INDEX':
264
-				$nom_index = $colonne_origine;
265
-				spip_sqlite_drop_index($nom_index, $table, $serveur);
266
-				break;
267
-
268
-				// suppression d'une pk
269
-			case 'DROP PRIMARY KEY':
270
-				if (
271
-					!_sqlite_modifier_table(
272
-						$table,
273
-						$colonne_origine,
274
-						['key' => ['PRIMARY KEY' => '']],
275
-						$serveur
276
-					)
277
-				) {
278
-					return false;
279
-				}
280
-				break;
281
-				// suppression d'une colonne
282
-			case 'DROP COLUMN':
283
-			case 'DROP':
284
-				if (
285
-					!_sqlite_modifier_table(
286
-						$table,
287
-						[$colonne_origine => ''],
288
-						[],
289
-						$serveur
290
-					)
291
-				) {
292
-					return false;
293
-				}
294
-				break;
295
-
296
-			case 'CHANGE COLUMN':
297
-			case 'CHANGE':
298
-				// recuperer le nom de la future colonne
299
-				// on reprend la def d'origine car _sqlite_modifier_table va refaire la translation
300
-				// en tenant compte de la cle primaire (ce qui est mieux)
301
-				$def = trim($defo);
302
-				$colonne_destination = substr($def, 0, strpos($def, ' '));
303
-				$def = substr($def, strlen($colonne_destination) + 1);
304
-
305
-				if (
306
-					!_sqlite_modifier_table(
307
-						$table,
308
-						[$colonne_origine => $colonne_destination],
309
-						['field' => [$colonne_destination => $def]],
310
-						$serveur
311
-					)
312
-				) {
313
-					return false;
314
-				}
315
-				break;
316
-
317
-			case 'MODIFY':
318
-				// on reprend la def d'origine car _sqlite_modifier_table va refaire la translation
319
-				// en tenant compte de la cle primaire (ce qui est mieux)
320
-				if (
321
-					!_sqlite_modifier_table(
322
-						$table,
323
-						$colonne_origine,
324
-						['field' => [$colonne_origine => $defo]],
325
-						$serveur
326
-					)
327
-				) {
328
-					return false;
329
-				}
330
-				break;
331
-
332
-				// pas geres en sqlite2
333
-			case 'RENAME':
334
-				$do = 'RENAME TO' . substr($do, 6);
335
-			case 'RENAME TO':
336
-				if (!Sqlite::executer_requete("$debut $do", $serveur)) {
337
-					spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.' . _LOG_ERREUR);
338
-
339
-					return false;
340
-				}
341
-				break;
342
-
343
-				// ajout d'une pk
344
-			case 'ADD PRIMARY KEY':
345
-				$pk = trim(substr($do, 16));
346
-				$pk = ($pk[0] == '(') ? substr($pk, 1, -1) : $pk;
347
-				if (
348
-					!_sqlite_modifier_table(
349
-						$table,
350
-						$colonne_origine,
351
-						['key' => ['PRIMARY KEY' => $pk]],
352
-						$serveur
353
-					)
354
-				) {
355
-					return false;
356
-				}
357
-				break;
358
-				// ajout d'un index
359
-			case 'ADD UNIQUE KEY':
360
-			case 'ADD UNIQUE':
361
-				$unique = true;
362
-			case 'ADD INDEX':
363
-			case 'ADD KEY':
364
-				if (!isset($unique)) {
365
-					$unique = false;
366
-				}
367
-				// peut etre "(colonne)" ou "nom_index (colonnes)"
368
-				// bug potentiel si qqn met "(colonne, colonne)"
369
-				//
370
-				// nom_index (colonnes)
371
-				if ($def) {
372
-					$colonnes = substr($def, 1, -1);
373
-					$nom_index = $colonne_origine;
374
-				} else {
375
-					// (colonne)
376
-					if ($colonne_origine[0] == '(') {
377
-						$colonnes = substr($colonne_origine, 1, -1);
378
-						if (str_contains(',', $colonnes)) {
379
-							spip_log('SQLite : Erreur, impossible de creer un index sur plusieurs colonnes'
380
-								. " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.' . _LOG_ERREUR);
381
-							break;
382
-						} else {
383
-							$nom_index = $colonnes;
384
-						}
385
-					} // nom_index
386
-					else {
387
-						$nom_index = $colonnes = $colonne_origine;
388
-					}
389
-				}
390
-				spip_sqlite_create_index($nom_index, $table, $colonnes, $unique, $serveur);
391
-				break;
392
-
393
-				// pas geres en sqlite2
394
-			case 'ADD COLUMN':
395
-				$do = 'ADD' . substr($do, 10);
396
-			case 'ADD':
397
-			default:
398
-				if (!preg_match(',primary\s+key,i', $do)) {
399
-					if (!Sqlite::executer_requete("$debut $do", $serveur)) {
400
-						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
401
-
402
-						return false;
403
-					}
404
-					break;
405
-				}
406
-				// ou si la colonne est aussi primary key
407
-				// cas du add id_truc int primary key
408
-				// ajout d'une colonne qui passe en primary key directe
409
-				else {
410
-					$def = trim(substr($do, 3));
411
-					$colonne_ajoutee = substr($def, 0, strpos($def, ' '));
412
-					$def = substr($def, strlen($colonne_ajoutee) + 1);
413
-					$opts = [];
414
-					if (preg_match(',primary\s+key,i', $def)) {
415
-						$opts['key'] = ['PRIMARY KEY' => $colonne_ajoutee];
416
-						$def = preg_replace(',primary\s+key,i', '', $def);
417
-					}
418
-					$opts['field'] = [$colonne_ajoutee => $def];
419
-					if (!_sqlite_modifier_table($table, [$colonne_ajoutee], $opts, $serveur)) {
420
-						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
421
-
422
-						return false;
423
-					}
424
-				}
425
-				break;
426
-		}
427
-		// tout est bon, ouf !
428
-		spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.' . _LOG_INFO);
429
-	}
430
-
431
-	spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.' . _LOG_INFO);
432
-
433
-	return true;
189
+    // 1
190
+    if (preg_match('/\s*(ALTER(\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
191
+        $debut = $regs[1];
192
+        $table = $regs[3];
193
+        $suite = $regs[4];
194
+    } else {
195
+        spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.' . _LOG_ERREUR);
196
+
197
+        return false;
198
+    }
199
+
200
+    // 2
201
+    // il faudrait une regexp pour eviter de spliter ADD PRIMARY KEY (colA, colB)
202
+    // tout en cassant "ADD PRIMARY KEY (colA, colB), ADD INDEX (chose)"... en deux
203
+    // ou revoir l'api de sql_alter en creant un
204
+    // sql_alter_table($table,array($actions));
205
+    $todo = explode(',', $suite);
206
+
207
+    // on remet les morceaux dechires ensembles... que c'est laid !
208
+    $todo2 = [];
209
+    $i = 0;
210
+    $ouverte = false;
211
+    while ($do = array_shift($todo)) {
212
+        $todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
213
+        $o = (str_contains($do, '('));
214
+        $f = (str_contains($do, ')'));
215
+        if ($o and !$f) {
216
+            $ouverte = true;
217
+        } elseif ($f) {
218
+            $ouverte = false;
219
+        }
220
+        if (!$ouverte) {
221
+            $i++;
222
+        }
223
+    }
224
+
225
+    // 3
226
+    $resultats = [];
227
+    foreach ($todo2 as $do) {
228
+        $do = trim($do);
229
+        if (
230
+            !preg_match('/(DROP PRIMARY KEY|DROP KEY|DROP INDEX|DROP COLUMN|DROP'
231
+                . '|CHANGE COLUMN|CHANGE|MODIFY|RENAME TO|RENAME'
232
+                . '|ADD PRIMARY KEY|ADD KEY|ADD INDEX|ADD UNIQUE KEY|ADD UNIQUE'
233
+                . '|ADD COLUMN|ADD'
234
+                . ')\s*([^\s]*)\s*(.*)?/i', $do, $matches)
235
+        ) {
236
+            spip_log(
237
+                "SQLite : Probleme de ALTER TABLE, utilisation non reconnue dans : $do \n(requete d'origine : $query)",
238
+                'sqlite.' . _LOG_ERREUR
239
+            );
240
+
241
+            return false;
242
+        }
243
+
244
+        $cle = strtoupper($matches[1]);
245
+        $colonne_origine = $matches[2];
246
+        $colonne_destination = '';
247
+
248
+        $def = $matches[3];
249
+
250
+        // eluder une eventuelle clause before|after|first inutilisable
251
+        $defr = rtrim(preg_replace('/(BEFORE|AFTER|FIRST)(.*)$/is', '', $def));
252
+        $defo = $defr; // garder la def d'origine pour certains cas
253
+        // remplacer les definitions venant de mysql
254
+        $defr = _sqlite_remplacements_definitions_table($defr);
255
+
256
+        // reinjecter dans le do
257
+        $do = str_replace($def, $defr, $do);
258
+        $def = $defr;
259
+
260
+        switch ($cle) {
261
+                // suppression d'un index
262
+            case 'DROP KEY':
263
+            case 'DROP INDEX':
264
+                $nom_index = $colonne_origine;
265
+                spip_sqlite_drop_index($nom_index, $table, $serveur);
266
+                break;
267
+
268
+                // suppression d'une pk
269
+            case 'DROP PRIMARY KEY':
270
+                if (
271
+                    !_sqlite_modifier_table(
272
+                        $table,
273
+                        $colonne_origine,
274
+                        ['key' => ['PRIMARY KEY' => '']],
275
+                        $serveur
276
+                    )
277
+                ) {
278
+                    return false;
279
+                }
280
+                break;
281
+                // suppression d'une colonne
282
+            case 'DROP COLUMN':
283
+            case 'DROP':
284
+                if (
285
+                    !_sqlite_modifier_table(
286
+                        $table,
287
+                        [$colonne_origine => ''],
288
+                        [],
289
+                        $serveur
290
+                    )
291
+                ) {
292
+                    return false;
293
+                }
294
+                break;
295
+
296
+            case 'CHANGE COLUMN':
297
+            case 'CHANGE':
298
+                // recuperer le nom de la future colonne
299
+                // on reprend la def d'origine car _sqlite_modifier_table va refaire la translation
300
+                // en tenant compte de la cle primaire (ce qui est mieux)
301
+                $def = trim($defo);
302
+                $colonne_destination = substr($def, 0, strpos($def, ' '));
303
+                $def = substr($def, strlen($colonne_destination) + 1);
304
+
305
+                if (
306
+                    !_sqlite_modifier_table(
307
+                        $table,
308
+                        [$colonne_origine => $colonne_destination],
309
+                        ['field' => [$colonne_destination => $def]],
310
+                        $serveur
311
+                    )
312
+                ) {
313
+                    return false;
314
+                }
315
+                break;
316
+
317
+            case 'MODIFY':
318
+                // on reprend la def d'origine car _sqlite_modifier_table va refaire la translation
319
+                // en tenant compte de la cle primaire (ce qui est mieux)
320
+                if (
321
+                    !_sqlite_modifier_table(
322
+                        $table,
323
+                        $colonne_origine,
324
+                        ['field' => [$colonne_origine => $defo]],
325
+                        $serveur
326
+                    )
327
+                ) {
328
+                    return false;
329
+                }
330
+                break;
331
+
332
+                // pas geres en sqlite2
333
+            case 'RENAME':
334
+                $do = 'RENAME TO' . substr($do, 6);
335
+            case 'RENAME TO':
336
+                if (!Sqlite::executer_requete("$debut $do", $serveur)) {
337
+                    spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.' . _LOG_ERREUR);
338
+
339
+                    return false;
340
+                }
341
+                break;
342
+
343
+                // ajout d'une pk
344
+            case 'ADD PRIMARY KEY':
345
+                $pk = trim(substr($do, 16));
346
+                $pk = ($pk[0] == '(') ? substr($pk, 1, -1) : $pk;
347
+                if (
348
+                    !_sqlite_modifier_table(
349
+                        $table,
350
+                        $colonne_origine,
351
+                        ['key' => ['PRIMARY KEY' => $pk]],
352
+                        $serveur
353
+                    )
354
+                ) {
355
+                    return false;
356
+                }
357
+                break;
358
+                // ajout d'un index
359
+            case 'ADD UNIQUE KEY':
360
+            case 'ADD UNIQUE':
361
+                $unique = true;
362
+            case 'ADD INDEX':
363
+            case 'ADD KEY':
364
+                if (!isset($unique)) {
365
+                    $unique = false;
366
+                }
367
+                // peut etre "(colonne)" ou "nom_index (colonnes)"
368
+                // bug potentiel si qqn met "(colonne, colonne)"
369
+                //
370
+                // nom_index (colonnes)
371
+                if ($def) {
372
+                    $colonnes = substr($def, 1, -1);
373
+                    $nom_index = $colonne_origine;
374
+                } else {
375
+                    // (colonne)
376
+                    if ($colonne_origine[0] == '(') {
377
+                        $colonnes = substr($colonne_origine, 1, -1);
378
+                        if (str_contains(',', $colonnes)) {
379
+                            spip_log('SQLite : Erreur, impossible de creer un index sur plusieurs colonnes'
380
+                                . " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.' . _LOG_ERREUR);
381
+                            break;
382
+                        } else {
383
+                            $nom_index = $colonnes;
384
+                        }
385
+                    } // nom_index
386
+                    else {
387
+                        $nom_index = $colonnes = $colonne_origine;
388
+                    }
389
+                }
390
+                spip_sqlite_create_index($nom_index, $table, $colonnes, $unique, $serveur);
391
+                break;
392
+
393
+                // pas geres en sqlite2
394
+            case 'ADD COLUMN':
395
+                $do = 'ADD' . substr($do, 10);
396
+            case 'ADD':
397
+            default:
398
+                if (!preg_match(',primary\s+key,i', $do)) {
399
+                    if (!Sqlite::executer_requete("$debut $do", $serveur)) {
400
+                        spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
401
+
402
+                        return false;
403
+                    }
404
+                    break;
405
+                }
406
+                // ou si la colonne est aussi primary key
407
+                // cas du add id_truc int primary key
408
+                // ajout d'une colonne qui passe en primary key directe
409
+                else {
410
+                    $def = trim(substr($do, 3));
411
+                    $colonne_ajoutee = substr($def, 0, strpos($def, ' '));
412
+                    $def = substr($def, strlen($colonne_ajoutee) + 1);
413
+                    $opts = [];
414
+                    if (preg_match(',primary\s+key,i', $def)) {
415
+                        $opts['key'] = ['PRIMARY KEY' => $colonne_ajoutee];
416
+                        $def = preg_replace(',primary\s+key,i', '', $def);
417
+                    }
418
+                    $opts['field'] = [$colonne_ajoutee => $def];
419
+                    if (!_sqlite_modifier_table($table, [$colonne_ajoutee], $opts, $serveur)) {
420
+                        spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
421
+
422
+                        return false;
423
+                    }
424
+                }
425
+                break;
426
+        }
427
+        // tout est bon, ouf !
428
+        spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.' . _LOG_INFO);
429
+    }
430
+
431
+    spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.' . _LOG_INFO);
432
+
433
+    return true;
434 434
 }
435 435
 
436 436
 /**
@@ -452,38 +452,38 @@  discard block
 block discarded – undo
452 452
  *     - true si la requête réussie, false sinon.
453 453
  */
454 454
 function spip_sqlite_create(
455
-	$nom,
456
-	$champs,
457
-	$cles,
458
-	$autoinc = false,
459
-	$temporary = false,
460
-	$serveur = '',
461
-	$requeter = true
455
+    $nom,
456
+    $champs,
457
+    $cles,
458
+    $autoinc = false,
459
+    $temporary = false,
460
+    $serveur = '',
461
+    $requeter = true
462 462
 ) {
463
-	$query = _sqlite_requete_create($nom, $champs, $cles, $autoinc, $temporary, $ifnotexists = true, $serveur, $requeter);
464
-	if (!$query) {
465
-		return false;
466
-	}
467
-	$res = spip_sqlite_query($query, $serveur, $requeter);
468
-
469
-	// SQLite ne cree pas les KEY sur les requetes CREATE TABLE
470
-	// il faut donc les faire creer ensuite
471
-	if (!$requeter) {
472
-		return $res;
473
-	}
474
-
475
-	$ok = $res ? true : false;
476
-	if ($ok) {
477
-		foreach ($cles as $k => $v) {
478
-			if (preg_match(',^(UNIQUE KEY|KEY|UNIQUE)\s,i', $k, $m)) {
479
-				$index = trim(substr($k, strlen($m[1])));
480
-				$unique = (strlen($m[1]) > 3);
481
-				$ok &= spip_sqlite_create_index($index, $nom, $v, $unique, $serveur);
482
-			}
483
-		}
484
-	}
485
-
486
-	return $ok ? true : false;
463
+    $query = _sqlite_requete_create($nom, $champs, $cles, $autoinc, $temporary, $ifnotexists = true, $serveur, $requeter);
464
+    if (!$query) {
465
+        return false;
466
+    }
467
+    $res = spip_sqlite_query($query, $serveur, $requeter);
468
+
469
+    // SQLite ne cree pas les KEY sur les requetes CREATE TABLE
470
+    // il faut donc les faire creer ensuite
471
+    if (!$requeter) {
472
+        return $res;
473
+    }
474
+
475
+    $ok = $res ? true : false;
476
+    if ($ok) {
477
+        foreach ($cles as $k => $v) {
478
+            if (preg_match(',^(UNIQUE KEY|KEY|UNIQUE)\s,i', $k, $m)) {
479
+                $index = trim(substr($k, strlen($m[1])));
480
+                $unique = (strlen($m[1]) > 3);
481
+                $ok &= spip_sqlite_create_index($index, $nom, $v, $unique, $serveur);
482
+            }
483
+        }
484
+    }
485
+
486
+    return $ok ? true : false;
487 487
 }
488 488
 
489 489
 /**
@@ -497,21 +497,21 @@  discard block
 block discarded – undo
497 497
  **/
498 498
 function spip_sqlite_create_base($nom, $serveur = '', $option = true)
499 499
 {
500
-	$f = $nom . '.sqlite';
501
-	if (strpos($nom, '/') === false) {
502
-		$f = _DIR_DB . $f;
503
-	}
500
+    $f = $nom . '.sqlite';
501
+    if (strpos($nom, '/') === false) {
502
+        $f = _DIR_DB . $f;
503
+    }
504 504
 
505
-	$ok = new \PDO("sqlite:$f");
505
+    $ok = new \PDO("sqlite:$f");
506 506
 
507
-	if ($ok) {
508
-		unset($ok);
507
+    if ($ok) {
508
+        unset($ok);
509 509
 
510
-		return true;
511
-	}
512
-	unset($ok);
510
+        return true;
511
+    }
512
+    unset($ok);
513 513
 
514
-	return false;
514
+    return false;
515 515
 }
516 516
 
517 517
 
@@ -533,22 +533,22 @@  discard block
 block discarded – undo
533 533
  */
534 534
 function spip_sqlite_create_view($nom, $query_select, $serveur = '', $requeter = true)
535 535
 {
536
-	if (!$query_select) {
537
-		return false;
538
-	}
539
-	// vue deja presente
540
-	if (sql_showtable($nom, false, $serveur)) {
541
-		spip_log(
542
-			"Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)",
543
-			'sqlite.' . _LOG_ERREUR
544
-		);
545
-
546
-		return false;
547
-	}
548
-
549
-	$query = "CREATE VIEW $nom AS " . $query_select;
550
-
551
-	return spip_sqlite_query($query, $serveur, $requeter);
536
+    if (!$query_select) {
537
+        return false;
538
+    }
539
+    // vue deja presente
540
+    if (sql_showtable($nom, false, $serveur)) {
541
+        spip_log(
542
+            "Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)",
543
+            'sqlite.' . _LOG_ERREUR
544
+        );
545
+
546
+        return false;
547
+    }
548
+
549
+    $query = "CREATE VIEW $nom AS " . $query_select;
550
+
551
+    return spip_sqlite_query($query, $serveur, $requeter);
552 552
 }
553 553
 
554 554
 /**
@@ -571,54 +571,54 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function spip_sqlite_create_index($nom, $table, $champs, $unique = '', $serveur = '', $requeter = true)
573 573
 {
574
-	if (!($nom or $table or $champs)) {
575
-		spip_log(
576
-			"Champ manquant pour creer un index sqlite ($nom, $table, (" . join(',', $champs) . '))',
577
-			'sqlite.' . _LOG_ERREUR
578
-		);
579
-
580
-		return false;
581
-	}
582
-
583
-	// SQLite ne differentie pas noms des index en fonction des tables
584
-	// il faut donc creer des noms uniques d'index pour une base sqlite
585
-	$nom = $table . '_' . $nom;
586
-	// enlever d'eventuelles parentheses deja presentes sur champs
587
-	if (!is_array($champs)) {
588
-		if ($champs[0] == '(') {
589
-			$champs = substr($champs, 1, -1);
590
-		}
591
-		$champs = [$champs];
592
-		// supprimer l'info de longueur d'index mysql en fin de champ
593
-		$champs = preg_replace(',\(\d+\)$,', '', $champs);
594
-	}
595
-
596
-	$ifnotexists = '';
597
-	$version = spip_sqlite_fetch(spip_sqlite_query('select sqlite_version() AS sqlite_version', $serveur), '', $serveur);
598
-	if (!function_exists('spip_version_compare')) {
599
-		include_spip('plugins/installer');
600
-	}
601
-
602
-	if ($version and spip_version_compare($version['sqlite_version'], '3.3.0', '>=')) {
603
-		$ifnotexists = ' IF NOT EXISTS';
604
-	} else {
605
-		/* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
606
-		$a = spip_sqlite_showtable($table, $serveur);
607
-		if (isset($a['key']['KEY ' . $nom])) {
608
-			return true;
609
-		}
610
-	}
611
-
612
-	$query = 'CREATE ' . ($unique ? 'UNIQUE ' : '') . "INDEX$ifnotexists $nom ON $table (" . join(',', $champs) . ')';
613
-	$res = spip_sqlite_query($query, $serveur, $requeter);
614
-	if (!$requeter) {
615
-		return $res;
616
-	}
617
-	if ($res) {
618
-		return true;
619
-	} else {
620
-		return false;
621
-	}
574
+    if (!($nom or $table or $champs)) {
575
+        spip_log(
576
+            "Champ manquant pour creer un index sqlite ($nom, $table, (" . join(',', $champs) . '))',
577
+            'sqlite.' . _LOG_ERREUR
578
+        );
579
+
580
+        return false;
581
+    }
582
+
583
+    // SQLite ne differentie pas noms des index en fonction des tables
584
+    // il faut donc creer des noms uniques d'index pour une base sqlite
585
+    $nom = $table . '_' . $nom;
586
+    // enlever d'eventuelles parentheses deja presentes sur champs
587
+    if (!is_array($champs)) {
588
+        if ($champs[0] == '(') {
589
+            $champs = substr($champs, 1, -1);
590
+        }
591
+        $champs = [$champs];
592
+        // supprimer l'info de longueur d'index mysql en fin de champ
593
+        $champs = preg_replace(',\(\d+\)$,', '', $champs);
594
+    }
595
+
596
+    $ifnotexists = '';
597
+    $version = spip_sqlite_fetch(spip_sqlite_query('select sqlite_version() AS sqlite_version', $serveur), '', $serveur);
598
+    if (!function_exists('spip_version_compare')) {
599
+        include_spip('plugins/installer');
600
+    }
601
+
602
+    if ($version and spip_version_compare($version['sqlite_version'], '3.3.0', '>=')) {
603
+        $ifnotexists = ' IF NOT EXISTS';
604
+    } else {
605
+        /* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
606
+        $a = spip_sqlite_showtable($table, $serveur);
607
+        if (isset($a['key']['KEY ' . $nom])) {
608
+            return true;
609
+        }
610
+    }
611
+
612
+    $query = 'CREATE ' . ($unique ? 'UNIQUE ' : '') . "INDEX$ifnotexists $nom ON $table (" . join(',', $champs) . ')';
613
+    $res = spip_sqlite_query($query, $serveur, $requeter);
614
+    if (!$requeter) {
615
+        return $res;
616
+    }
617
+    if ($res) {
618
+        return true;
619
+    } else {
620
+        return false;
621
+    }
622 622
 }
623 623
 
624 624
 /**
@@ -636,31 +636,31 @@  discard block
 block discarded – undo
636 636
  */
637 637
 function spip_sqlite_count($r, $serveur = '', $requeter = true)
638 638
 {
639
-	if (!$r) {
640
-		return 0;
641
-	}
642
-
643
-	// select ou autre (insert, update,...) ?
644
-	// (link,requete) a compter
645
-	if (is_array($r->spipSqliteRowCount)) {
646
-		list($link, $query) = $r->spipSqliteRowCount;
647
-		// amelioration possible a tester intensivement : pas de order by pour compter !
648
-		// $query = preg_replace(",ORDER BY .+(LIMIT\s|HAVING\s|GROUP BY\s|$),Uims","\\1",$query);
649
-		$query = "SELECT count(*) as zzzzsqlitecount FROM ($query)";
650
-		$l = $link->query($query);
651
-		$i = 0;
652
-		if ($l and $z = $l->fetch()) {
653
-			$i = $z['zzzzsqlitecount'];
654
-		}
655
-		$r->spipSqliteRowCount = $i;
656
-	}
657
-	if (isset($r->spipSqliteRowCount)) {
658
-		// Ce compte est faux s'il y a des limit dans la requete :(
659
-		// il retourne le nombre d'enregistrements sans le limit
660
-		return $r->spipSqliteRowCount;
661
-	} else {
662
-		return $r->rowCount();
663
-	}
639
+    if (!$r) {
640
+        return 0;
641
+    }
642
+
643
+    // select ou autre (insert, update,...) ?
644
+    // (link,requete) a compter
645
+    if (is_array($r->spipSqliteRowCount)) {
646
+        list($link, $query) = $r->spipSqliteRowCount;
647
+        // amelioration possible a tester intensivement : pas de order by pour compter !
648
+        // $query = preg_replace(",ORDER BY .+(LIMIT\s|HAVING\s|GROUP BY\s|$),Uims","\\1",$query);
649
+        $query = "SELECT count(*) as zzzzsqlitecount FROM ($query)";
650
+        $l = $link->query($query);
651
+        $i = 0;
652
+        if ($l and $z = $l->fetch()) {
653
+            $i = $z['zzzzsqlitecount'];
654
+        }
655
+        $r->spipSqliteRowCount = $i;
656
+    }
657
+    if (isset($r->spipSqliteRowCount)) {
658
+        // Ce compte est faux s'il y a des limit dans la requete :(
659
+        // il retourne le nombre d'enregistrements sans le limit
660
+        return $r->spipSqliteRowCount;
661
+    } else {
662
+        return $r->rowCount();
663
+    }
664 664
 }
665 665
 
666 666
 
@@ -679,30 +679,30 @@  discard block
 block discarded – undo
679 679
  *     - false si la requête a échouée
680 680
  **/
681 681
 function spip_sqlite_countsel(
682
-	$from = [],
683
-	$where = [],
684
-	$groupby = '',
685
-	$having = [],
686
-	$serveur = '',
687
-	$requeter = true
682
+    $from = [],
683
+    $where = [],
684
+    $groupby = '',
685
+    $having = [],
686
+    $serveur = '',
687
+    $requeter = true
688 688
 ) {
689
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
690
-	$r = spip_sqlite_select(
691
-		"COUNT($c)",
692
-		$from,
693
-		$where,
694
-		'',
695
-		'',
696
-		'',
697
-		$having,
698
-		$serveur,
699
-		$requeter
700
-	);
701
-	if ((is_resource($r) or is_object($r)) && $requeter) { // ressource : sqlite2, object : sqlite3
702
-		list($r) = spip_sqlite_fetch($r, SPIP_SQLITE3_NUM, $serveur);
703
-	}
704
-
705
-	return $r;
689
+    $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
690
+    $r = spip_sqlite_select(
691
+        "COUNT($c)",
692
+        $from,
693
+        $where,
694
+        '',
695
+        '',
696
+        '',
697
+        $having,
698
+        $serveur,
699
+        $requeter
700
+    );
701
+    if ((is_resource($r) or is_object($r)) && $requeter) { // ressource : sqlite2, object : sqlite3
702
+        list($r) = spip_sqlite_fetch($r, SPIP_SQLITE3_NUM, $serveur);
703
+    }
704
+
705
+    return $r;
706 706
 }
707 707
 
708 708
 
@@ -720,24 +720,24 @@  discard block
 block discarded – undo
720 720
  **/
721 721
 function spip_sqlite_delete($table, $where = '', $serveur = '', $requeter = true)
722 722
 {
723
-	$res = spip_sqlite_query(
724
-		_sqlite_calculer_expression('DELETE FROM', $table, ',')
725
-			. _sqlite_calculer_expression('WHERE', $where),
726
-		$serveur,
727
-		$requeter
728
-	);
729
-
730
-	// renvoyer la requete inerte si demandee
731
-	if (!$requeter) {
732
-		return $res;
733
-	}
734
-
735
-	if ($res) {
736
-		$link = _sqlite_link($serveur);
737
-		return $res->rowCount();
738
-	} else {
739
-		return false;
740
-	}
723
+    $res = spip_sqlite_query(
724
+        _sqlite_calculer_expression('DELETE FROM', $table, ',')
725
+            . _sqlite_calculer_expression('WHERE', $where),
726
+        $serveur,
727
+        $requeter
728
+    );
729
+
730
+    // renvoyer la requete inerte si demandee
731
+    if (!$requeter) {
732
+        return $res;
733
+    }
734
+
735
+    if ($res) {
736
+        $link = _sqlite_link($serveur);
737
+        return $res->rowCount();
738
+    } else {
739
+        return false;
740
+    }
741 741
 }
742 742
 
743 743
 
@@ -754,15 +754,15 @@  discard block
 block discarded – undo
754 754
  */
755 755
 function spip_sqlite_drop_table($table, $exist = '', $serveur = '', $requeter = true)
756 756
 {
757
-	if ($exist) {
758
-		$exist = ' IF EXISTS';
759
-	}
760
-
761
-	if (spip_sqlite_query("DROP TABLE$exist $table", $serveur, $requeter)) {
762
-		return true;
763
-	} else {
764
-		return false;
765
-	}
757
+    if ($exist) {
758
+        $exist = ' IF EXISTS';
759
+    }
760
+
761
+    if (spip_sqlite_query("DROP TABLE$exist $table", $serveur, $requeter)) {
762
+        return true;
763
+    } else {
764
+        return false;
765
+    }
766 766
 }
767 767
 
768 768
 
@@ -779,11 +779,11 @@  discard block
 block discarded – undo
779 779
  */
780 780
 function spip_sqlite_drop_view($view, $exist = '', $serveur = '', $requeter = true)
781 781
 {
782
-	if ($exist) {
783
-		$exist = ' IF EXISTS';
784
-	}
782
+    if ($exist) {
783
+        $exist = ' IF EXISTS';
784
+    }
785 785
 
786
-	return spip_sqlite_query("DROP VIEW$exist $view", $serveur, $requeter);
786
+    return spip_sqlite_query("DROP VIEW$exist $view", $serveur, $requeter);
787 787
 }
788 788
 
789 789
 /**
@@ -798,20 +798,20 @@  discard block
 block discarded – undo
798 798
  */
799 799
 function spip_sqlite_drop_index($nom, $table, $serveur = '', $requeter = true)
800 800
 {
801
-	if (!($nom or $table)) {
802
-		spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.' . _LOG_ERREUR);
801
+    if (!($nom or $table)) {
802
+        spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.' . _LOG_ERREUR);
803 803
 
804
-		return false;
805
-	}
804
+        return false;
805
+    }
806 806
 
807
-	// SQLite ne differentie pas noms des index en fonction des tables
808
-	// il faut donc creer des noms uniques d'index pour une base sqlite
809
-	$index = $table . '_' . $nom;
810
-	$exist = ' IF EXISTS';
807
+    // SQLite ne differentie pas noms des index en fonction des tables
808
+    // il faut donc creer des noms uniques d'index pour une base sqlite
809
+    $index = $table . '_' . $nom;
810
+    $exist = ' IF EXISTS';
811 811
 
812
-	$query = "DROP INDEX$exist $index";
812
+    $query = "DROP INDEX$exist $index";
813 813
 
814
-	return spip_sqlite_query($query, $serveur, $requeter);
814
+    return spip_sqlite_query($query, $serveur, $requeter);
815 815
 }
816 816
 
817 817
 /**
@@ -828,29 +828,29 @@  discard block
 block discarded – undo
828 828
  **/
829 829
 function spip_sqlite_error($query = '', $serveur = '')
830 830
 {
831
-	$link = _sqlite_link($serveur);
832
-
833
-	if ($link) {
834
-		$errs = $link->errorInfo();
835
-		$s = _sqlite_last_error_from_link($link);
836
-	} else {
837
-		$s = ': aucune ressource sqlite (link)';
838
-	}
839
-	if ($s) {
840
-		$trace = debug_backtrace();
841
-		if ($trace[0]['function'] != 'spip_sqlite_error') {
842
-			spip_log("$s - $query - " . sql_error_backtrace(), 'sqlite.' . _LOG_ERREUR);
843
-		}
844
-	}
845
-
846
-	return $s;
831
+    $link = _sqlite_link($serveur);
832
+
833
+    if ($link) {
834
+        $errs = $link->errorInfo();
835
+        $s = _sqlite_last_error_from_link($link);
836
+    } else {
837
+        $s = ': aucune ressource sqlite (link)';
838
+    }
839
+    if ($s) {
840
+        $trace = debug_backtrace();
841
+        if ($trace[0]['function'] != 'spip_sqlite_error') {
842
+            spip_log("$s - $query - " . sql_error_backtrace(), 'sqlite.' . _LOG_ERREUR);
843
+        }
844
+    }
845
+
846
+    return $s;
847 847
 }
848 848
 
849 849
 function _sqlite_last_error_from_link($link)
850 850
 {
851
-	if ($link) {
852
-		$errs = $link->errorInfo();
853
-		/*
851
+    if ($link) {
852
+        $errs = $link->errorInfo();
853
+        /*
854 854
 			$errs[0]
855 855
 				numero SQLState ('HY000' souvent lors d'une erreur)
856 856
 				http://www.easysoft.com/developer/interfaces/odbc/sqlstate_status_return_codes.html
@@ -860,11 +860,11 @@  discard block
 block discarded – undo
860 860
 			$errs[2]
861 861
 				Le texte du message d'erreur
862 862
 		*/
863
-		if (ltrim($errs[0], '0')) { // 00000 si pas d'erreur
864
-			return "$errs[2]";
865
-		}
866
-	}
867
-	return '';
863
+        if (ltrim($errs[0], '0')) { // 00000 si pas d'erreur
864
+            return "$errs[2]";
865
+        }
866
+    }
867
+    return '';
868 868
 }
869 869
 
870 870
 /**
@@ -882,23 +882,23 @@  discard block
 block discarded – undo
882 882
  **/
883 883
 function spip_sqlite_errno($serveur = '')
884 884
 {
885
-	$link = _sqlite_link($serveur);
886
-
887
-	if ($link) {
888
-		$t = $link->errorInfo();
889
-		$s = ltrim($t[0], '0'); // 00000 si pas d'erreur
890
-		if ($s) {
891
-			$s .= ' / ' . $t[1];
892
-		} // ajoute l'erreur du moteur SQLite
893
-	} else {
894
-		$s = ': aucune ressource sqlite (link)';
895
-	}
896
-
897
-	if ($s) {
898
-		spip_log("Erreur sqlite $s", 'sqlite.' . _LOG_ERREUR);
899
-	}
900
-
901
-	return $s ? $s : 0;
885
+    $link = _sqlite_link($serveur);
886
+
887
+    if ($link) {
888
+        $t = $link->errorInfo();
889
+        $s = ltrim($t[0], '0'); // 00000 si pas d'erreur
890
+        if ($s) {
891
+            $s .= ' / ' . $t[1];
892
+        } // ajoute l'erreur du moteur SQLite
893
+    } else {
894
+        $s = ': aucune ressource sqlite (link)';
895
+    }
896
+
897
+    if ($s) {
898
+        spip_log("Erreur sqlite $s", 'sqlite.' . _LOG_ERREUR);
899
+    }
900
+
901
+    return $s ? $s : 0;
902 902
 }
903 903
 
904 904
 
@@ -915,19 +915,19 @@  discard block
 block discarded – undo
915 915
  */
916 916
 function spip_sqlite_explain($query, $serveur = '', $requeter = true)
917 917
 {
918
-	if (strpos(ltrim($query), 'SELECT') !== 0) {
919
-		return [];
920
-	}
921
-
922
-	$query = Sqlite::traduire_requete($query, $serveur);
923
-	$query = 'EXPLAIN ' . $query;
924
-	if (!$requeter) {
925
-		return $query;
926
-	}
927
-	// on ne trace pas ces requetes, sinon on obtient un tracage sans fin...
928
-	$r = Sqlite::executer_requete($query, $serveur, false);
929
-
930
-	return $r ? spip_sqlite_fetch($r, null, $serveur) : false; // hum ? etrange ca... a verifier
918
+    if (strpos(ltrim($query), 'SELECT') !== 0) {
919
+        return [];
920
+    }
921
+
922
+    $query = Sqlite::traduire_requete($query, $serveur);
923
+    $query = 'EXPLAIN ' . $query;
924
+    if (!$requeter) {
925
+        return $query;
926
+    }
927
+    // on ne trace pas ces requetes, sinon on obtient un tracage sans fin...
928
+    $r = Sqlite::executer_requete($query, $serveur, false);
929
+
930
+    return $r ? spip_sqlite_fetch($r, null, $serveur) : false; // hum ? etrange ca... a verifier
931 931
 }
932 932
 
933 933
 
@@ -948,35 +948,35 @@  discard block
 block discarded – undo
948 948
 function spip_sqlite_fetch($r, $t = '', $serveur = '', $requeter = true)
949 949
 {
950 950
 
951
-	$link = _sqlite_link($serveur);
952
-	$t = $t ? $t : SPIP_SQLITE3_ASSOC;
953
-
954
-	if (!$r) {
955
-		return false;
956
-	}
957
-
958
-	$retour = $r->fetch($t);
959
-
960
-	if (!$retour) {
961
-		if ($r->errorCode() === '00000') {
962
-			return null;
963
-		}
964
-		return false;
965
-	}
966
-
967
-	// Renvoie des 'table.titre' au lieu de 'titre' tout court ! pff !
968
-	// suppression de 'table.' pour toutes les cles (c'est un peu violent !)
969
-	// c'est couteux : on ne verifie que la premiere ligne pour voir si on le fait ou non
970
-	if (str_contains(implode('', array_keys($retour)), '.')) {
971
-		foreach ($retour as $cle => $val) {
972
-			if (($pos = strpos($cle, '.')) !== false) {
973
-				$retour[substr($cle, $pos + 1)] = &$retour[$cle];
974
-				unset($retour[$cle]);
975
-			}
976
-		}
977
-	}
978
-
979
-	return $retour;
951
+    $link = _sqlite_link($serveur);
952
+    $t = $t ? $t : SPIP_SQLITE3_ASSOC;
953
+
954
+    if (!$r) {
955
+        return false;
956
+    }
957
+
958
+    $retour = $r->fetch($t);
959
+
960
+    if (!$retour) {
961
+        if ($r->errorCode() === '00000') {
962
+            return null;
963
+        }
964
+        return false;
965
+    }
966
+
967
+    // Renvoie des 'table.titre' au lieu de 'titre' tout court ! pff !
968
+    // suppression de 'table.' pour toutes les cles (c'est un peu violent !)
969
+    // c'est couteux : on ne verifie que la premiere ligne pour voir si on le fait ou non
970
+    if (str_contains(implode('', array_keys($retour)), '.')) {
971
+        foreach ($retour as $cle => $val) {
972
+            if (($pos = strpos($cle, '.')) !== false) {
973
+                $retour[substr($cle, $pos + 1)] = &$retour[$cle];
974
+                unset($retour[$cle]);
975
+            }
976
+        }
977
+    }
978
+
979
+    return $retour;
980 980
 }
981 981
 
982 982
 /**
@@ -990,8 +990,8 @@  discard block
 block discarded – undo
990 990
  **/
991 991
 function spip_sqlite_seek($r, $row_number, $serveur = '', $requeter = true)
992 992
 {
993
-	// encore un truc de bien fichu : PDO ne PEUT PAS faire de seek ou de rewind...
994
-	return false;
993
+    // encore un truc de bien fichu : PDO ne PEUT PAS faire de seek ou de rewind...
994
+    return false;
995 995
 }
996 996
 
997 997
 
@@ -1008,10 +1008,10 @@  discard block
 block discarded – undo
1008 1008
  */
1009 1009
 function spip_sqlite_free(&$r, $serveur = '', $requeter = true)
1010 1010
 {
1011
-	unset($r);
1011
+    unset($r);
1012 1012
 
1013
-	return true;
1014
-	//return sqlite_free_result($r);
1013
+    return true;
1014
+    //return sqlite_free_result($r);
1015 1015
 }
1016 1016
 
1017 1017
 
@@ -1027,8 +1027,8 @@  discard block
 block discarded – undo
1027 1027
  */
1028 1028
 function spip_sqlite_get_charset($charset = [], $serveur = '', $requeter = true)
1029 1029
 {
1030
-	//$c = !$charset ? '' : (" LIKE "._q($charset['charset']));
1031
-	//return spip_sqlite_fetch(sqlite_query(_sqlite_link($serveur), "SHOW CHARACTER SET$c"), NULL, $serveur);
1030
+    //$c = !$charset ? '' : (" LIKE "._q($charset['charset']));
1031
+    //return spip_sqlite_fetch(sqlite_query(_sqlite_link($serveur), "SHOW CHARACTER SET$c"), NULL, $serveur);
1032 1032
 }
1033 1033
 
1034 1034
 
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
  **/
1045 1045
 function spip_sqlite_hex($v)
1046 1046
 {
1047
-	return hexdec($v);
1047
+    return hexdec($v);
1048 1048
 }
1049 1049
 
1050 1050
 
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
  **/
1068 1068
 function spip_sqlite_in($val, $valeurs, $not = '', $serveur = '', $requeter = true)
1069 1069
 {
1070
-	return "($val $not IN ($valeurs))";
1070
+    return "($val $not IN ($valeurs))";
1071 1071
 }
1072 1072
 
1073 1073
 
@@ -1096,20 +1096,20 @@  discard block
 block discarded – undo
1096 1096
 function spip_sqlite_insert($table, $champs, $valeurs, $desc = [], $serveur = '', $requeter = true)
1097 1097
 {
1098 1098
 
1099
-	$query = "INSERT INTO $table " . ($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES');
1100
-	if ($r = spip_sqlite_query($query, $serveur, $requeter)) {
1101
-		if (!$requeter) {
1102
-			return $r;
1103
-		}
1104
-		$nb = Sqlite::last_insert_id($serveur);
1105
-	} else {
1106
-		$nb = false;
1107
-	}
1099
+    $query = "INSERT INTO $table " . ($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES');
1100
+    if ($r = spip_sqlite_query($query, $serveur, $requeter)) {
1101
+        if (!$requeter) {
1102
+            return $r;
1103
+        }
1104
+        $nb = Sqlite::last_insert_id($serveur);
1105
+    } else {
1106
+        $nb = false;
1107
+    }
1108 1108
 
1109
-	$err = spip_sqlite_error($query, $serveur);
1109
+    $err = spip_sqlite_error($query, $serveur);
1110 1110
 
1111
-	// cas particulier : ne pas substituer la reponse spip_sqlite_query si on est en profilage
1112
-	return isset($_GET['var_profile']) ? $r : $nb;
1111
+    // cas particulier : ne pas substituer la reponse spip_sqlite_query si on est en profilage
1112
+    return isset($_GET['var_profile']) ? $r : $nb;
1113 1113
 }
1114 1114
 
1115 1115
 
@@ -1135,28 +1135,28 @@  discard block
 block discarded – undo
1135 1135
  **/
1136 1136
 function spip_sqlite_insertq($table, $couples = [], $desc = [], $serveur = '', $requeter = true)
1137 1137
 {
1138
-	if (!$desc) {
1139
-		$desc = description_table($table, $serveur);
1140
-	}
1141
-	if (!$desc) {
1142
-		die("$table insertion sans description");
1143
-	}
1144
-	$fields = isset($desc['field']) ? $desc['field'] : [];
1145
-
1146
-	foreach ($couples as $champ => $val) {
1147
-		$couples[$champ] = _sqlite_calculer_cite($val, $fields[$champ]);
1148
-	}
1149
-
1150
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1151
-	$couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1152
-
1153
-	$cles = $valeurs = '';
1154
-	if (count($couples)) {
1155
-		$cles = '(' . join(',', array_keys($couples)) . ')';
1156
-		$valeurs = '(' . join(',', $couples) . ')';
1157
-	}
1158
-
1159
-	return spip_sqlite_insert($table, $cles, $valeurs, $desc, $serveur, $requeter);
1138
+    if (!$desc) {
1139
+        $desc = description_table($table, $serveur);
1140
+    }
1141
+    if (!$desc) {
1142
+        die("$table insertion sans description");
1143
+    }
1144
+    $fields = isset($desc['field']) ? $desc['field'] : [];
1145
+
1146
+    foreach ($couples as $champ => $val) {
1147
+        $couples[$champ] = _sqlite_calculer_cite($val, $fields[$champ]);
1148
+    }
1149
+
1150
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1151
+    $couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1152
+
1153
+    $cles = $valeurs = '';
1154
+    if (count($couples)) {
1155
+        $cles = '(' . join(',', array_keys($couples)) . ')';
1156
+        $valeurs = '(' . join(',', $couples) . ')';
1157
+    }
1158
+
1159
+    return spip_sqlite_insert($table, $cles, $valeurs, $desc, $serveur, $requeter);
1160 1160
 }
1161 1161
 
1162 1162
 
@@ -1181,70 +1181,70 @@  discard block
 block discarded – undo
1181 1181
  **/
1182 1182
 function spip_sqlite_insertq_multi($table, $tab_couples = [], $desc = [], $serveur = '', $requeter = true)
1183 1183
 {
1184
-	if (!$desc) {
1185
-		$desc = description_table($table, $serveur);
1186
-	}
1187
-	if (!$desc) {
1188
-		die("$table insertion sans description");
1189
-	}
1190
-	if (!isset($desc['field'])) {
1191
-		$desc['field'] = [];
1192
-	}
1193
-
1194
-	// recuperer les champs 'timestamp' pour mise a jour auto de ceux-ci
1195
-	$maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur);
1196
-
1197
-	// seul le nom de la table est a traduire ici :
1198
-	// le faire une seule fois au debut
1199
-	$query_start = "INSERT INTO $table ";
1200
-	$query_start = Sqlite::traduire_requete($query_start, $serveur);
1201
-
1202
-	// ouvrir une transaction
1203
-	if ($requeter) {
1204
-		Sqlite::demarrer_transaction($serveur);
1205
-	}
1206
-
1207
-	while ($couples = array_shift($tab_couples)) {
1208
-		foreach ($couples as $champ => $val) {
1209
-			$couples[$champ] = _sqlite_calculer_cite($val, $desc['field'][$champ]);
1210
-		}
1211
-
1212
-		// inserer les champs timestamp par defaut
1213
-		$couples = array_merge($maj, $couples);
1214
-
1215
-		$champs = $valeurs = '';
1216
-		if (count($couples)) {
1217
-			$champs = '(' . join(',', array_keys($couples)) . ')';
1218
-			$valeurs = '(' . join(',', $couples) . ')';
1219
-			$query = $query_start . "$champs VALUES $valeurs";
1220
-		} else {
1221
-			$query = $query_start . 'DEFAULT VALUES';
1222
-		}
1223
-
1224
-		if ($requeter) {
1225
-			$retour = Sqlite::executer_requete($query, $serveur);
1226
-		}
1227
-
1228
-		// sur le dernier couple uniquement
1229
-		if (!count($tab_couples)) {
1230
-			$nb = 0;
1231
-			if ($requeter) {
1232
-				$nb = Sqlite::last_insert_id($serveur);
1233
-			} else {
1234
-				return $query;
1235
-			}
1236
-		}
1237
-
1238
-		$err = spip_sqlite_error($query, $serveur);
1239
-	}
1240
-
1241
-	if ($requeter) {
1242
-		Sqlite::finir_transaction($serveur);
1243
-	}
1244
-
1245
-	// renvoie le dernier id d'autoincrement ajoute
1246
-	// cas particulier : ne pas substituer la reponse spip_sqlite_query si on est en profilage
1247
-	return isset($_GET['var_profile']) ? $retour : $nb;
1184
+    if (!$desc) {
1185
+        $desc = description_table($table, $serveur);
1186
+    }
1187
+    if (!$desc) {
1188
+        die("$table insertion sans description");
1189
+    }
1190
+    if (!isset($desc['field'])) {
1191
+        $desc['field'] = [];
1192
+    }
1193
+
1194
+    // recuperer les champs 'timestamp' pour mise a jour auto de ceux-ci
1195
+    $maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur);
1196
+
1197
+    // seul le nom de la table est a traduire ici :
1198
+    // le faire une seule fois au debut
1199
+    $query_start = "INSERT INTO $table ";
1200
+    $query_start = Sqlite::traduire_requete($query_start, $serveur);
1201
+
1202
+    // ouvrir une transaction
1203
+    if ($requeter) {
1204
+        Sqlite::demarrer_transaction($serveur);
1205
+    }
1206
+
1207
+    while ($couples = array_shift($tab_couples)) {
1208
+        foreach ($couples as $champ => $val) {
1209
+            $couples[$champ] = _sqlite_calculer_cite($val, $desc['field'][$champ]);
1210
+        }
1211
+
1212
+        // inserer les champs timestamp par defaut
1213
+        $couples = array_merge($maj, $couples);
1214
+
1215
+        $champs = $valeurs = '';
1216
+        if (count($couples)) {
1217
+            $champs = '(' . join(',', array_keys($couples)) . ')';
1218
+            $valeurs = '(' . join(',', $couples) . ')';
1219
+            $query = $query_start . "$champs VALUES $valeurs";
1220
+        } else {
1221
+            $query = $query_start . 'DEFAULT VALUES';
1222
+        }
1223
+
1224
+        if ($requeter) {
1225
+            $retour = Sqlite::executer_requete($query, $serveur);
1226
+        }
1227
+
1228
+        // sur le dernier couple uniquement
1229
+        if (!count($tab_couples)) {
1230
+            $nb = 0;
1231
+            if ($requeter) {
1232
+                $nb = Sqlite::last_insert_id($serveur);
1233
+            } else {
1234
+                return $query;
1235
+            }
1236
+        }
1237
+
1238
+        $err = spip_sqlite_error($query, $serveur);
1239
+    }
1240
+
1241
+    if ($requeter) {
1242
+        Sqlite::finir_transaction($serveur);
1243
+    }
1244
+
1245
+    // renvoie le dernier id d'autoincrement ajoute
1246
+    // cas particulier : ne pas substituer la reponse spip_sqlite_query si on est en profilage
1247
+    return isset($_GET['var_profile']) ? $retour : $nb;
1248 1248
 }
1249 1249
 
1250 1250
 
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
  **/
1261 1261
 function spip_sqlite_preferer_transaction($serveur = '', $requeter = true)
1262 1262
 {
1263
-	return true;
1263
+    return true;
1264 1264
 }
1265 1265
 
1266 1266
 /**
@@ -1278,12 +1278,12 @@  discard block
 block discarded – undo
1278 1278
  **/
1279 1279
 function spip_sqlite_demarrer_transaction($serveur = '', $requeter = true)
1280 1280
 {
1281
-	if (!$requeter) {
1282
-		return 'BEGIN TRANSACTION';
1283
-	}
1284
-	Sqlite::demarrer_transaction($serveur);
1281
+    if (!$requeter) {
1282
+        return 'BEGIN TRANSACTION';
1283
+    }
1284
+    Sqlite::demarrer_transaction($serveur);
1285 1285
 
1286
-	return true;
1286
+    return true;
1287 1287
 }
1288 1288
 
1289 1289
 /**
@@ -1298,12 +1298,12 @@  discard block
 block discarded – undo
1298 1298
  **/
1299 1299
 function spip_sqlite_terminer_transaction($serveur = '', $requeter = true)
1300 1300
 {
1301
-	if (!$requeter) {
1302
-		return 'COMMIT';
1303
-	}
1304
-	Sqlite::finir_transaction($serveur);
1301
+    if (!$requeter) {
1302
+        return 'COMMIT';
1303
+    }
1304
+    Sqlite::finir_transaction($serveur);
1305 1305
 
1306
-	return true;
1306
+    return true;
1307 1307
 }
1308 1308
 
1309 1309
 
@@ -1319,27 +1319,27 @@  discard block
 block discarded – undo
1319 1319
  **/
1320 1320
 function spip_sqlite_listdbs($serveur = '', $requeter = true)
1321 1321
 {
1322
-	_sqlite_init();
1323
-
1324
-	if (!is_dir($d = substr(_DIR_DB, 0, -1))) {
1325
-		return [];
1326
-	}
1327
-
1328
-	include_spip('inc/flock');
1329
-	$bases = preg_files($d, $pattern = '(.*)\.sqlite$');
1330
-	$bds = [];
1331
-
1332
-	foreach ($bases as $b) {
1333
-		// pas de bases commencant pas sqlite
1334
-		// (on s'en sert pour l'installation pour simuler la presence d'un serveur)
1335
-		// les bases sont de la forme _sqliteX_tmp_spip_install.sqlite
1336
-		if (strpos($b, '_sqlite')) {
1337
-			continue;
1338
-		}
1339
-		$bds[] = preg_replace(";.*/$pattern;iS", '$1', $b);
1340
-	}
1341
-
1342
-	return $bds;
1322
+    _sqlite_init();
1323
+
1324
+    if (!is_dir($d = substr(_DIR_DB, 0, -1))) {
1325
+        return [];
1326
+    }
1327
+
1328
+    include_spip('inc/flock');
1329
+    $bases = preg_files($d, $pattern = '(.*)\.sqlite$');
1330
+    $bds = [];
1331
+
1332
+    foreach ($bases as $b) {
1333
+        // pas de bases commencant pas sqlite
1334
+        // (on s'en sert pour l'installation pour simuler la presence d'un serveur)
1335
+        // les bases sont de la forme _sqliteX_tmp_spip_install.sqlite
1336
+        if (strpos($b, '_sqlite')) {
1337
+            continue;
1338
+        }
1339
+        $bds[] = preg_replace(";.*/$pattern;iS", '$1', $b);
1340
+    }
1341
+
1342
+    return $bds;
1343 1343
 }
1344 1344
 
1345 1345
 
@@ -1355,9 +1355,9 @@  discard block
 block discarded – undo
1355 1355
  */
1356 1356
 function spip_sqlite_multi($objet, $lang)
1357 1357
 {
1358
-	$r = 'EXTRAIRE_MULTI(' . $objet . ", '" . $lang . "') AS multi";
1358
+    $r = 'EXTRAIRE_MULTI(' . $objet . ", '" . $lang . "') AS multi";
1359 1359
 
1360
-	return $r;
1360
+    return $r;
1361 1361
 }
1362 1362
 
1363 1363
 
@@ -1375,15 +1375,15 @@  discard block
 block discarded – undo
1375 1375
  **/
1376 1376
 function spip_sqlite_optimize($table, $serveur = '', $requeter = true)
1377 1377
 {
1378
-	static $do = false;
1379
-	if ($requeter and $do) {
1380
-		return true;
1381
-	}
1382
-	if ($requeter) {
1383
-		$do = true;
1384
-	}
1385
-
1386
-	return spip_sqlite_query('VACUUM', $serveur, $requeter);
1378
+    static $do = false;
1379
+    if ($requeter and $do) {
1380
+        return true;
1381
+    }
1382
+    if ($requeter) {
1383
+        $do = true;
1384
+    }
1385
+
1386
+    return spip_sqlite_query('VACUUM', $serveur, $requeter);
1387 1387
 }
1388 1388
 
1389 1389
 
@@ -1401,15 +1401,15 @@  discard block
 block discarded – undo
1401 1401
  */
1402 1402
 function spip_sqlite_quote($v, $type = '')
1403 1403
 {
1404
-	if (!is_array($v)) {
1405
-		return _sqlite_calculer_cite($v, $type);
1406
-	}
1407
-	// si c'est un tableau, le parcourir en propageant le type
1408
-	foreach ($v as $k => $r) {
1409
-		$v[$k] = spip_sqlite_quote($r, $type);
1410
-	}
1411
-
1412
-	return join(',', $v);
1404
+    if (!is_array($v)) {
1405
+        return _sqlite_calculer_cite($v, $type);
1406
+    }
1407
+    // si c'est un tableau, le parcourir en propageant le type
1408
+    foreach ($v as $k => $r) {
1409
+        $v[$k] = spip_sqlite_quote($r, $type);
1410
+    }
1411
+
1412
+    return join(',', $v);
1413 1413
 }
1414 1414
 
1415 1415
 
@@ -1427,9 +1427,9 @@  discard block
 block discarded – undo
1427 1427
  **/
1428 1428
 function spip_sqlite_date_proche($champ, $interval, $unite)
1429 1429
 {
1430
-	$op = (($interval <= 0) ? '>' : '<');
1430
+    $op = (($interval <= 0) ? '>' : '<');
1431 1431
 
1432
-	return "($champ $op datetime('" . date('Y-m-d H:i:s') . "', '$interval $unite'))";
1432
+    return "($champ $op datetime('" . date('Y-m-d H:i:s') . "', '$interval $unite'))";
1433 1433
 }
1434 1434
 
1435 1435
 
@@ -1448,48 +1448,48 @@  discard block
 block discarded – undo
1448 1448
  */
1449 1449
 function spip_sqlite_repair($table, $serveur = '', $requeter = true)
1450 1450
 {
1451
-	if (
1452
-		$desc = spip_sqlite_showtable($table, $serveur)
1453
-		and isset($desc['field'])
1454
-		and is_array($desc['field'])
1455
-	) {
1456
-		foreach ($desc['field'] as $c => $d) {
1457
-			if (
1458
-				preg_match(',^(tinytext|mediumtext|text|longtext|varchar|char),i', $d)
1459
-				and stripos($d, 'NOT NULL') !== false
1460
-				and stripos($d, 'DEFAULT') === false
1461
-				/* pas touche aux cles primaires */
1462
-				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1463
-			) {
1464
-				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT ''", $serveur);
1465
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1466
-			}
1467
-			if (
1468
-				preg_match(',^(INTEGER),i', $d)
1469
-				and stripos($d, 'NOT NULL') !== false
1470
-				and stripos($d, 'DEFAULT') === false
1471
-				/* pas touche aux cles primaires */
1472
-				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1473
-			) {
1474
-				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0'", $serveur);
1475
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1476
-			}
1477
-			if (
1478
-				preg_match(',^(datetime),i', $d)
1479
-				and stripos($d, 'NOT NULL') !== false
1480
-				and stripos($d, 'DEFAULT') === false
1481
-				/* pas touche aux cles primaires */
1482
-				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1483
-			) {
1484
-				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0000-00-00 00:00:00'", $serveur);
1485
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1486
-			}
1487
-		}
1488
-
1489
-		return [' OK '];
1490
-	}
1491
-
1492
-	return [' ERROR '];
1451
+    if (
1452
+        $desc = spip_sqlite_showtable($table, $serveur)
1453
+        and isset($desc['field'])
1454
+        and is_array($desc['field'])
1455
+    ) {
1456
+        foreach ($desc['field'] as $c => $d) {
1457
+            if (
1458
+                preg_match(',^(tinytext|mediumtext|text|longtext|varchar|char),i', $d)
1459
+                and stripos($d, 'NOT NULL') !== false
1460
+                and stripos($d, 'DEFAULT') === false
1461
+                /* pas touche aux cles primaires */
1462
+                and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1463
+            ) {
1464
+                spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT ''", $serveur);
1465
+                spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1466
+            }
1467
+            if (
1468
+                preg_match(',^(INTEGER),i', $d)
1469
+                and stripos($d, 'NOT NULL') !== false
1470
+                and stripos($d, 'DEFAULT') === false
1471
+                /* pas touche aux cles primaires */
1472
+                and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1473
+            ) {
1474
+                spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0'", $serveur);
1475
+                spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1476
+            }
1477
+            if (
1478
+                preg_match(',^(datetime),i', $d)
1479
+                and stripos($d, 'NOT NULL') !== false
1480
+                and stripos($d, 'DEFAULT') === false
1481
+                /* pas touche aux cles primaires */
1482
+                and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1483
+            ) {
1484
+                spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0000-00-00 00:00:00'", $serveur);
1485
+                spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1486
+            }
1487
+        }
1488
+
1489
+        return [' OK '];
1490
+    }
1491
+
1492
+    return [' ERROR '];
1493 1493
 }
1494 1494
 
1495 1495
 
@@ -1519,25 +1519,25 @@  discard block
 block discarded – undo
1519 1519
  **/
1520 1520
 function spip_sqlite_replace($table, $couples, $desc = [], $serveur = '', $requeter = true)
1521 1521
 {
1522
-	if (!$desc) {
1523
-		$desc = description_table($table, $serveur);
1524
-	}
1525
-	if (!$desc) {
1526
-		die("$table insertion sans description");
1527
-	}
1528
-	$fields = isset($desc['field']) ? $desc['field'] : [];
1529
-
1530
-	foreach ($couples as $champ => $val) {
1531
-		$couples[$champ] = _sqlite_calculer_cite($val, $fields[$champ]);
1532
-	}
1533
-
1534
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1535
-	$couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1536
-
1537
-	return spip_sqlite_query("REPLACE INTO $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1538
-		',',
1539
-		$couples
1540
-	) . ')', $serveur);
1522
+    if (!$desc) {
1523
+        $desc = description_table($table, $serveur);
1524
+    }
1525
+    if (!$desc) {
1526
+        die("$table insertion sans description");
1527
+    }
1528
+    $fields = isset($desc['field']) ? $desc['field'] : [];
1529
+
1530
+    foreach ($couples as $champ => $val) {
1531
+        $couples[$champ] = _sqlite_calculer_cite($val, $fields[$champ]);
1532
+    }
1533
+
1534
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1535
+    $couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1536
+
1537
+    return spip_sqlite_query("REPLACE INTO $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1538
+        ',',
1539
+        $couples
1540
+    ) . ')', $serveur);
1541 1541
 }
1542 1542
 
1543 1543
 
@@ -1568,13 +1568,13 @@  discard block
 block discarded – undo
1568 1568
 function spip_sqlite_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true)
1569 1569
 {
1570 1570
 
1571
-	// boucler pour trainter chaque requete independemment
1572
-	foreach ($tab_couples as $couples) {
1573
-		$retour = spip_sqlite_replace($table, $couples, $desc, $serveur, $requeter);
1574
-	}
1571
+    // boucler pour trainter chaque requete independemment
1572
+    foreach ($tab_couples as $couples) {
1573
+        $retour = spip_sqlite_replace($table, $couples, $desc, $serveur, $requeter);
1574
+    }
1575 1575
 
1576
-	// renvoie le dernier id
1577
-	return $retour;
1576
+    // renvoie le dernier id
1577
+    return $retour;
1578 1578
 }
1579 1579
 
1580 1580
 
@@ -1601,44 +1601,44 @@  discard block
 block discarded – undo
1601 1601
  *     - array  : Tableau décrivant requête et temps d'exécution si var_profile actif pour tracer.
1602 1602
  */
1603 1603
 function spip_sqlite_select(
1604
-	$select,
1605
-	$from,
1606
-	$where = '',
1607
-	$groupby = '',
1608
-	$orderby = '',
1609
-	$limit = '',
1610
-	$having = '',
1611
-	$serveur = '',
1612
-	$requeter = true
1604
+    $select,
1605
+    $from,
1606
+    $where = '',
1607
+    $groupby = '',
1608
+    $orderby = '',
1609
+    $limit = '',
1610
+    $having = '',
1611
+    $serveur = '',
1612
+    $requeter = true
1613 1613
 ) {
1614 1614
 
1615
-	// version() n'est pas connu de sqlite
1616
-	$select = str_replace('version()', 'sqlite_version()', $select);
1617
-
1618
-	// recomposer from
1619
-	$from = (!is_array($from) ? $from : _sqlite_calculer_select_as($from));
1620
-
1621
-	$query =
1622
-		_sqlite_calculer_expression('SELECT', $select, ', ')
1623
-		. _sqlite_calculer_expression('FROM', $from, ', ')
1624
-		. _sqlite_calculer_expression('WHERE', $where)
1625
-		. _sqlite_calculer_expression('GROUP BY', $groupby, ',')
1626
-		. _sqlite_calculer_expression('HAVING', $having)
1627
-		. ($orderby ? ("\nORDER BY " . _sqlite_calculer_order($orderby)) : '')
1628
-		. ($limit ? "\nLIMIT $limit" : '');
1629
-
1630
-	// dans un select, on doit renvoyer la requête en cas d'erreur
1631
-	$res = spip_sqlite_query($query, $serveur, $requeter);
1632
-	// texte de la requete demande ?
1633
-	if (!$requeter) {
1634
-		return $res;
1635
-	}
1636
-	// erreur survenue ?
1637
-	if ($res === false) {
1638
-		return Sqlite::traduire_requete($query, $serveur);
1639
-	}
1640
-
1641
-	return $res;
1615
+    // version() n'est pas connu de sqlite
1616
+    $select = str_replace('version()', 'sqlite_version()', $select);
1617
+
1618
+    // recomposer from
1619
+    $from = (!is_array($from) ? $from : _sqlite_calculer_select_as($from));
1620
+
1621
+    $query =
1622
+        _sqlite_calculer_expression('SELECT', $select, ', ')
1623
+        . _sqlite_calculer_expression('FROM', $from, ', ')
1624
+        . _sqlite_calculer_expression('WHERE', $where)
1625
+        . _sqlite_calculer_expression('GROUP BY', $groupby, ',')
1626
+        . _sqlite_calculer_expression('HAVING', $having)
1627
+        . ($orderby ? ("\nORDER BY " . _sqlite_calculer_order($orderby)) : '')
1628
+        . ($limit ? "\nLIMIT $limit" : '');
1629
+
1630
+    // dans un select, on doit renvoyer la requête en cas d'erreur
1631
+    $res = spip_sqlite_query($query, $serveur, $requeter);
1632
+    // texte de la requete demande ?
1633
+    if (!$requeter) {
1634
+        return $res;
1635
+    }
1636
+    // erreur survenue ?
1637
+    if ($res === false) {
1638
+        return Sqlite::traduire_requete($query, $serveur);
1639
+    }
1640
+
1641
+    return $res;
1642 1642
 }
1643 1643
 
1644 1644
 
@@ -1658,32 +1658,32 @@  discard block
 block discarded – undo
1658 1658
  **/
1659 1659
 function spip_sqlite_selectdb($db, $serveur = '', $requeter = true)
1660 1660
 {
1661
-	_sqlite_init();
1662
-
1663
-	// interdire la creation d'une nouvelle base,
1664
-	// sauf si on est dans l'installation
1665
-	if (
1666
-		!is_file($f = _DIR_DB . $db . '.sqlite')
1667
-		&& (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)
1668
-	) {
1669
-		spip_log("Il est interdit de creer la base $db", 'sqlite.' . _LOG_HS);
1670
-
1671
-		return false;
1672
-	}
1673
-
1674
-	// se connecter a la base indiquee
1675
-	// avec les identifiants connus
1676
-	$index = $serveur ? $serveur : 0;
1677
-
1678
-	if ($link = spip_connect_db('', '', '', '', '@selectdb@' . $db, $serveur, '', '')) {
1679
-		if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) {
1680
-			return $db;
1681
-		}
1682
-	} else {
1683
-		spip_log("Impossible de selectionner la base $db", 'sqlite.' . _LOG_HS);
1684
-	}
1685
-
1686
-	return false;
1661
+    _sqlite_init();
1662
+
1663
+    // interdire la creation d'une nouvelle base,
1664
+    // sauf si on est dans l'installation
1665
+    if (
1666
+        !is_file($f = _DIR_DB . $db . '.sqlite')
1667
+        && (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)
1668
+    ) {
1669
+        spip_log("Il est interdit de creer la base $db", 'sqlite.' . _LOG_HS);
1670
+
1671
+        return false;
1672
+    }
1673
+
1674
+    // se connecter a la base indiquee
1675
+    // avec les identifiants connus
1676
+    $index = $serveur ? $serveur : 0;
1677
+
1678
+    if ($link = spip_connect_db('', '', '', '', '@selectdb@' . $db, $serveur, '', '')) {
1679
+        if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) {
1680
+            return $db;
1681
+        }
1682
+    } else {
1683
+        spip_log("Impossible de selectionner la base $db", 'sqlite.' . _LOG_HS);
1684
+    }
1685
+
1686
+    return false;
1687 1687
 }
1688 1688
 
1689 1689
 
@@ -1699,8 +1699,8 @@  discard block
 block discarded – undo
1699 1699
  */
1700 1700
 function spip_sqlite_set_charset($charset, $serveur = '', $requeter = true)
1701 1701
 {
1702
-	# spip_log("Gestion charset sql a ecrire : "."SET NAMES "._q($charset), 'sqlite.'._LOG_ERREUR);
1703
-	# return spip_sqlite_query("SET NAMES ". spip_sqlite_quote($charset), $serveur); //<-- Passe pas !
1702
+    # spip_log("Gestion charset sql a ecrire : "."SET NAMES "._q($charset), 'sqlite.'._LOG_ERREUR);
1703
+    # return spip_sqlite_query("SET NAMES ". spip_sqlite_quote($charset), $serveur); //<-- Passe pas !
1704 1704
 }
1705 1705
 
1706 1706
 
@@ -1719,24 +1719,24 @@  discard block
 block discarded – undo
1719 1719
  **/
1720 1720
 function spip_sqlite_showbase($match, $serveur = '', $requeter = true)
1721 1721
 {
1722
-	// type est le type d'entrée : table / index / view
1723
-	// on ne retourne que les tables (?) et non les vues...
1724
-	# ESCAPE non supporte par les versions sqlite <3
1725
-	#	return spip_sqlite_query("SELECT name FROM sqlite_master WHERE type='table' AND tbl_name LIKE "._q($match)." ESCAPE '\'", $serveur, $requeter);
1726
-	$match = preg_quote($match);
1727
-	$match = str_replace('\\\_', '[[TIRETBAS]]', $match);
1728
-	$match = str_replace('\\\%', '[[POURCENT]]', $match);
1729
-	$match = str_replace('_', '.', $match);
1730
-	$match = str_replace('%', '.*', $match);
1731
-	$match = str_replace('[[TIRETBAS]]', '_', $match);
1732
-	$match = str_replace('[[POURCENT]]', '%', $match);
1733
-	$match = "^$match$";
1734
-
1735
-	return spip_sqlite_query(
1736
-		"SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP " . _q($match),
1737
-		$serveur,
1738
-		$requeter
1739
-	);
1722
+    // type est le type d'entrée : table / index / view
1723
+    // on ne retourne que les tables (?) et non les vues...
1724
+    # ESCAPE non supporte par les versions sqlite <3
1725
+    #	return spip_sqlite_query("SELECT name FROM sqlite_master WHERE type='table' AND tbl_name LIKE "._q($match)." ESCAPE '\'", $serveur, $requeter);
1726
+    $match = preg_quote($match);
1727
+    $match = str_replace('\\\_', '[[TIRETBAS]]', $match);
1728
+    $match = str_replace('\\\%', '[[POURCENT]]', $match);
1729
+    $match = str_replace('_', '.', $match);
1730
+    $match = str_replace('%', '.*', $match);
1731
+    $match = str_replace('[[TIRETBAS]]', '_', $match);
1732
+    $match = str_replace('[[POURCENT]]', '%', $match);
1733
+    $match = "^$match$";
1734
+
1735
+    return spip_sqlite_query(
1736
+        "SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP " . _q($match),
1737
+        $serveur,
1738
+        $requeter
1739
+    );
1740 1740
 }
1741 1741
 
1742 1742
 /**
@@ -1755,19 +1755,19 @@  discard block
 block discarded – undo
1755 1755
  **/
1756 1756
 function spip_sqlite_table_exists(string $table, $serveur = '', $requeter = true)
1757 1757
 {
1758
-	$r = spip_sqlite_query(
1759
-		'SELECT name FROM sqlite_master WHERE'
1760
-			. ' type=\'table\''
1761
-			. ' AND name=' . spip_sqlite_quote($table, 'string')
1762
-			. ' AND name NOT LIKE \'sqlite_%\'',
1763
-		$serveur,
1764
-		$requeter
1765
-	);
1766
-	if (!$requeter) {
1767
-		return $r;
1768
-	}
1769
-	$res = spip_sqlite_fetch($r);
1770
-	return (bool) $res;
1758
+    $r = spip_sqlite_query(
1759
+        'SELECT name FROM sqlite_master WHERE'
1760
+            . ' type=\'table\''
1761
+            . ' AND name=' . spip_sqlite_quote($table, 'string')
1762
+            . ' AND name NOT LIKE \'sqlite_%\'',
1763
+        $serveur,
1764
+        $requeter
1765
+    );
1766
+    if (!$requeter) {
1767
+        return $r;
1768
+    }
1769
+    $res = spip_sqlite_fetch($r);
1770
+    return (bool) $res;
1771 1771
 }
1772 1772
 
1773 1773
 define('_SQLITE_RE_SHOW_TABLE', '/^[^(),]*\(((?:[^()]*\((?:[^()]*\([^()]*\))?[^()]*\)[^()]*)*[^()]*)\)[^()]*$/');
@@ -1791,129 +1791,129 @@  discard block
 block discarded – undo
1791 1791
  */
1792 1792
 function spip_sqlite_showtable($nom_table, $serveur = '', $requeter = true)
1793 1793
 {
1794
-	$query =
1795
-		'SELECT sql, type FROM'
1796
-		. ' (SELECT * FROM sqlite_master UNION ALL'
1797
-		. ' SELECT * FROM sqlite_temp_master)'
1798
-		. " WHERE tbl_name LIKE '$nom_table'"
1799
-		. " AND type!='meta' AND sql NOT NULL AND name NOT LIKE 'sqlite_%'"
1800
-		. ' ORDER BY substr(type,2,1), name';
1801
-
1802
-	$a = spip_sqlite_query($query, $serveur, $requeter);
1803
-	if (!$a) {
1804
-		return '';
1805
-	}
1806
-	if (!$requeter) {
1807
-		return $a;
1808
-	}
1809
-	if (!($a = spip_sqlite_fetch($a, null, $serveur))) {
1810
-		return '';
1811
-	}
1812
-	$vue = ($a['type'] == 'view'); // table | vue
1813
-
1814
-	// c'est une table
1815
-	// il faut parser le create
1816
-	if (!$vue) {
1817
-		if (!preg_match(_SQLITE_RE_SHOW_TABLE, array_shift($a), $r)) {
1818
-			return '';
1819
-		} else {
1820
-			$desc = $r[1];
1821
-			// extraction d'une KEY éventuelle en prenant garde de ne pas
1822
-			// relever un champ dont le nom contient KEY (ex. ID_WHISKEY)
1823
-			if (preg_match('/^(.*?),([^,]*\sKEY[ (].*)$/s', $desc, $r)) {
1824
-				$namedkeys = $r[2];
1825
-				$desc = $r[1];
1826
-			} else {
1827
-				$namedkeys = '';
1828
-			}
1829
-
1830
-			$fields = [];
1831
-			$keys = [];
1832
-
1833
-			// enlever les contenus des valeurs DEFAULT 'xxx' qui pourraient perturber
1834
-			// par exemple s'il contiennent une virgule.
1835
-			// /!\ cela peut aussi echapper le nom des champs si la table a eu des operations avec SQLite Manager !
1836
-			list($desc, $echaps) = query_echappe_textes($desc);
1837
-
1838
-			// separer toutes les descriptions de champs, separes par des virgules
1839
-			# /!\ explode peut exploser aussi DECIMAL(10,2) !
1840
-			$k_precedent = null;
1841
-			foreach (explode(',', $desc) as $v) {
1842
-				preg_match('/^\s*([^\s]+)\s+(.*)/', $v, $r);
1843
-				// Les cles de champs peuvent etre entourees
1844
-				// de guillements doubles " , simples ', graves ` ou de crochets [ ],  ou rien.
1845
-				// http://www.sqlite.org/lang_keywords.html
1846
-				$k = strtolower(query_reinjecte_textes($r[1], $echaps)); // champ, "champ", [champ]...
1847
-				if ($char = strpbrk($k[0], '\'"[`')) {
1848
-					$k = trim($k, $char);
1849
-					if ($char == '[') {
1850
-						$k = rtrim($k, ']');
1851
-					}
1852
-				}
1853
-				$def = query_reinjecte_textes($r[2], $echaps); // valeur du champ
1854
-
1855
-				// rustine pour DECIMAL(10,2)
1856
-				// s'il y a une parenthèse fermante dans la clé
1857
-				// ou dans la définition sans qu'il n'y ait une ouverture avant
1858
-				if (str_contains($k, ')') or preg_match('/^[^\(]*\)/', $def)) {
1859
-					$fields[$k_precedent] .= ',' . $k . ' ' . $def;
1860
-					continue;
1861
-				}
1862
-
1863
-				// la primary key peut etre dans une des descriptions de champs
1864
-				// et non en fin de table, cas encore decouvert avec Sqlite Manager
1865
-				if (stripos($r[2], 'PRIMARY KEY') !== false) {
1866
-					$keys['PRIMARY KEY'] = $k;
1867
-				}
1868
-
1869
-				$fields[$k] = $def;
1870
-				$k_precedent = $k;
1871
-			}
1872
-			// key inclues dans la requete
1873
-			foreach (preg_split('/\)\s*(,|$)/', $namedkeys) as $v) {
1874
-				if (preg_match('/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/', $v, $r)) {
1875
-					$k = str_replace('`', '', trim($r[1]));
1876
-					$t = trim(strtolower(str_replace('`', '', $r[2])), '"');
1877
-					if ($k && !isset($keys[$k])) {
1878
-						$keys[$k] = $t;
1879
-					} else {
1880
-						$keys[] = $t;
1881
-					}
1882
-				}
1883
-			}
1884
-			// sinon ajouter les key index
1885
-			$query =
1886
-				'SELECT name,sql FROM'
1887
-				. ' (SELECT * FROM sqlite_master UNION ALL'
1888
-				. ' SELECT * FROM sqlite_temp_master)'
1889
-				. " WHERE tbl_name LIKE '$nom_table'"
1890
-				. " AND type='index' AND name NOT LIKE 'sqlite_%'"
1891
-				. 'ORDER BY substr(type,2,1), name';
1892
-			$a = spip_sqlite_query($query, $serveur, $requeter);
1893
-			while ($r = spip_sqlite_fetch($a, null, $serveur)) {
1894
-				$key = str_replace($nom_table . '_', '', $r['name']); // enlever le nom de la table ajoute a l'index
1895
-				$keytype = 'KEY';
1896
-				if (strpos($r['sql'], 'UNIQUE INDEX') !== false) {
1897
-					$keytype = 'UNIQUE KEY';
1898
-				}
1899
-				$colonnes = preg_replace(',.*\((.*)\).*,', '$1', $r['sql']);
1900
-				$keys[$keytype . ' ' . $key] = $colonnes;
1901
-			}
1902
-		}
1903
-	} // c'est une vue, on liste les champs disponibles simplement
1904
-	else {
1905
-		if ($res = sql_fetsel('*', $nom_table, '', '', '', '1', '', $serveur)) { // limit 1
1906
-			$fields = [];
1907
-			foreach ($res as $c => $v) {
1908
-				$fields[$c] = '';
1909
-			}
1910
-			$keys = [];
1911
-		} else {
1912
-			return '';
1913
-		}
1914
-	}
1915
-
1916
-	return ['field' => $fields, 'key' => $keys];
1794
+    $query =
1795
+        'SELECT sql, type FROM'
1796
+        . ' (SELECT * FROM sqlite_master UNION ALL'
1797
+        . ' SELECT * FROM sqlite_temp_master)'
1798
+        . " WHERE tbl_name LIKE '$nom_table'"
1799
+        . " AND type!='meta' AND sql NOT NULL AND name NOT LIKE 'sqlite_%'"
1800
+        . ' ORDER BY substr(type,2,1), name';
1801
+
1802
+    $a = spip_sqlite_query($query, $serveur, $requeter);
1803
+    if (!$a) {
1804
+        return '';
1805
+    }
1806
+    if (!$requeter) {
1807
+        return $a;
1808
+    }
1809
+    if (!($a = spip_sqlite_fetch($a, null, $serveur))) {
1810
+        return '';
1811
+    }
1812
+    $vue = ($a['type'] == 'view'); // table | vue
1813
+
1814
+    // c'est une table
1815
+    // il faut parser le create
1816
+    if (!$vue) {
1817
+        if (!preg_match(_SQLITE_RE_SHOW_TABLE, array_shift($a), $r)) {
1818
+            return '';
1819
+        } else {
1820
+            $desc = $r[1];
1821
+            // extraction d'une KEY éventuelle en prenant garde de ne pas
1822
+            // relever un champ dont le nom contient KEY (ex. ID_WHISKEY)
1823
+            if (preg_match('/^(.*?),([^,]*\sKEY[ (].*)$/s', $desc, $r)) {
1824
+                $namedkeys = $r[2];
1825
+                $desc = $r[1];
1826
+            } else {
1827
+                $namedkeys = '';
1828
+            }
1829
+
1830
+            $fields = [];
1831
+            $keys = [];
1832
+
1833
+            // enlever les contenus des valeurs DEFAULT 'xxx' qui pourraient perturber
1834
+            // par exemple s'il contiennent une virgule.
1835
+            // /!\ cela peut aussi echapper le nom des champs si la table a eu des operations avec SQLite Manager !
1836
+            list($desc, $echaps) = query_echappe_textes($desc);
1837
+
1838
+            // separer toutes les descriptions de champs, separes par des virgules
1839
+            # /!\ explode peut exploser aussi DECIMAL(10,2) !
1840
+            $k_precedent = null;
1841
+            foreach (explode(',', $desc) as $v) {
1842
+                preg_match('/^\s*([^\s]+)\s+(.*)/', $v, $r);
1843
+                // Les cles de champs peuvent etre entourees
1844
+                // de guillements doubles " , simples ', graves ` ou de crochets [ ],  ou rien.
1845
+                // http://www.sqlite.org/lang_keywords.html
1846
+                $k = strtolower(query_reinjecte_textes($r[1], $echaps)); // champ, "champ", [champ]...
1847
+                if ($char = strpbrk($k[0], '\'"[`')) {
1848
+                    $k = trim($k, $char);
1849
+                    if ($char == '[') {
1850
+                        $k = rtrim($k, ']');
1851
+                    }
1852
+                }
1853
+                $def = query_reinjecte_textes($r[2], $echaps); // valeur du champ
1854
+
1855
+                // rustine pour DECIMAL(10,2)
1856
+                // s'il y a une parenthèse fermante dans la clé
1857
+                // ou dans la définition sans qu'il n'y ait une ouverture avant
1858
+                if (str_contains($k, ')') or preg_match('/^[^\(]*\)/', $def)) {
1859
+                    $fields[$k_precedent] .= ',' . $k . ' ' . $def;
1860
+                    continue;
1861
+                }
1862
+
1863
+                // la primary key peut etre dans une des descriptions de champs
1864
+                // et non en fin de table, cas encore decouvert avec Sqlite Manager
1865
+                if (stripos($r[2], 'PRIMARY KEY') !== false) {
1866
+                    $keys['PRIMARY KEY'] = $k;
1867
+                }
1868
+
1869
+                $fields[$k] = $def;
1870
+                $k_precedent = $k;
1871
+            }
1872
+            // key inclues dans la requete
1873
+            foreach (preg_split('/\)\s*(,|$)/', $namedkeys) as $v) {
1874
+                if (preg_match('/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/', $v, $r)) {
1875
+                    $k = str_replace('`', '', trim($r[1]));
1876
+                    $t = trim(strtolower(str_replace('`', '', $r[2])), '"');
1877
+                    if ($k && !isset($keys[$k])) {
1878
+                        $keys[$k] = $t;
1879
+                    } else {
1880
+                        $keys[] = $t;
1881
+                    }
1882
+                }
1883
+            }
1884
+            // sinon ajouter les key index
1885
+            $query =
1886
+                'SELECT name,sql FROM'
1887
+                . ' (SELECT * FROM sqlite_master UNION ALL'
1888
+                . ' SELECT * FROM sqlite_temp_master)'
1889
+                . " WHERE tbl_name LIKE '$nom_table'"
1890
+                . " AND type='index' AND name NOT LIKE 'sqlite_%'"
1891
+                . 'ORDER BY substr(type,2,1), name';
1892
+            $a = spip_sqlite_query($query, $serveur, $requeter);
1893
+            while ($r = spip_sqlite_fetch($a, null, $serveur)) {
1894
+                $key = str_replace($nom_table . '_', '', $r['name']); // enlever le nom de la table ajoute a l'index
1895
+                $keytype = 'KEY';
1896
+                if (strpos($r['sql'], 'UNIQUE INDEX') !== false) {
1897
+                    $keytype = 'UNIQUE KEY';
1898
+                }
1899
+                $colonnes = preg_replace(',.*\((.*)\).*,', '$1', $r['sql']);
1900
+                $keys[$keytype . ' ' . $key] = $colonnes;
1901
+            }
1902
+        }
1903
+    } // c'est une vue, on liste les champs disponibles simplement
1904
+    else {
1905
+        if ($res = sql_fetsel('*', $nom_table, '', '', '', '1', '', $serveur)) { // limit 1
1906
+            $fields = [];
1907
+            foreach ($res as $c => $v) {
1908
+                $fields[$c] = '';
1909
+            }
1910
+            $keys = [];
1911
+        } else {
1912
+            return '';
1913
+        }
1914
+    }
1915
+
1916
+    return ['field' => $fields, 'key' => $keys];
1917 1917
 }
1918 1918
 
1919 1919
 
@@ -1940,24 +1940,24 @@  discard block
 block discarded – undo
1940 1940
  */
1941 1941
 function spip_sqlite_update($table, $champs, $where = '', $desc = '', $serveur = '', $requeter = true)
1942 1942
 {
1943
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1944
-	$champs = _sqlite_ajouter_champs_timestamp($table, $champs, $desc, $serveur);
1945
-
1946
-	$set = [];
1947
-	foreach ($champs as $champ => $val) {
1948
-		$set[] = $champ . "=$val";
1949
-	}
1950
-	if (!empty($set)) {
1951
-		return spip_sqlite_query(
1952
-			_sqlite_calculer_expression('UPDATE', $table, ',')
1953
-				. _sqlite_calculer_expression('SET', $set, ',')
1954
-				. _sqlite_calculer_expression('WHERE', $where),
1955
-			$serveur,
1956
-			$requeter
1957
-		);
1958
-	}
1959
-
1960
-	return false;
1943
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1944
+    $champs = _sqlite_ajouter_champs_timestamp($table, $champs, $desc, $serveur);
1945
+
1946
+    $set = [];
1947
+    foreach ($champs as $champ => $val) {
1948
+        $set[] = $champ . "=$val";
1949
+    }
1950
+    if (!empty($set)) {
1951
+        return spip_sqlite_query(
1952
+            _sqlite_calculer_expression('UPDATE', $table, ',')
1953
+                . _sqlite_calculer_expression('SET', $set, ',')
1954
+                . _sqlite_calculer_expression('WHERE', $where),
1955
+            $serveur,
1956
+            $requeter
1957
+        );
1958
+    }
1959
+
1960
+    return false;
1961 1961
 }
1962 1962
 
1963 1963
 
@@ -1988,38 +1988,38 @@  discard block
 block discarded – undo
1988 1988
 function spip_sqlite_updateq($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true)
1989 1989
 {
1990 1990
 
1991
-	if (!$champs) {
1992
-		return;
1993
-	}
1994
-	if (!$desc) {
1995
-		$desc = description_table($table, $serveur);
1996
-	}
1997
-	if (!$desc) {
1998
-		die("$table insertion sans description");
1999
-	}
2000
-	$fields = $desc['field'];
2001
-
2002
-	$set = [];
2003
-	foreach ($champs as $champ => $val) {
2004
-		$set[$champ] = $champ . '=' . _sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : '');
2005
-	}
2006
-
2007
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
2008
-	// attention ils sont deja quotes
2009
-	$maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur);
2010
-	foreach ($maj as $champ => $val) {
2011
-		if (!isset($set[$champ])) {
2012
-			$set[$champ] = $champ . '=' . $val;
2013
-		}
2014
-	}
2015
-
2016
-	return spip_sqlite_query(
2017
-		_sqlite_calculer_expression('UPDATE', $table, ',')
2018
-			. _sqlite_calculer_expression('SET', $set, ',')
2019
-			. _sqlite_calculer_expression('WHERE', $where),
2020
-		$serveur,
2021
-		$requeter
2022
-	);
1991
+    if (!$champs) {
1992
+        return;
1993
+    }
1994
+    if (!$desc) {
1995
+        $desc = description_table($table, $serveur);
1996
+    }
1997
+    if (!$desc) {
1998
+        die("$table insertion sans description");
1999
+    }
2000
+    $fields = $desc['field'];
2001
+
2002
+    $set = [];
2003
+    foreach ($champs as $champ => $val) {
2004
+        $set[$champ] = $champ . '=' . _sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : '');
2005
+    }
2006
+
2007
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
2008
+    // attention ils sont deja quotes
2009
+    $maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur);
2010
+    foreach ($maj as $champ => $val) {
2011
+        if (!isset($set[$champ])) {
2012
+            $set[$champ] = $champ . '=' . $val;
2013
+        }
2014
+    }
2015
+
2016
+    return spip_sqlite_query(
2017
+        _sqlite_calculer_expression('UPDATE', $table, ',')
2018
+            . _sqlite_calculer_expression('SET', $set, ',')
2019
+            . _sqlite_calculer_expression('WHERE', $where),
2020
+        $serveur,
2021
+        $requeter
2022
+    );
2023 2023
 }
2024 2024
 
2025 2025
 
@@ -2038,17 +2038,17 @@  discard block
 block discarded – undo
2038 2038
  */
2039 2039
 function _sqlite_init()
2040 2040
 {
2041
-	if (!defined('_DIR_DB')) {
2042
-		define('_DIR_DB', _DIR_ETC . 'bases/');
2043
-	}
2044
-	if (!defined('_SQLITE_CHMOD')) {
2045
-		define('_SQLITE_CHMOD', _SPIP_CHMOD);
2046
-	}
2047
-
2048
-	if (!is_dir($d = _DIR_DB)) {
2049
-		include_spip('inc/flock');
2050
-		sous_repertoire($d);
2051
-	}
2041
+    if (!defined('_DIR_DB')) {
2042
+        define('_DIR_DB', _DIR_ETC . 'bases/');
2043
+    }
2044
+    if (!defined('_SQLITE_CHMOD')) {
2045
+        define('_SQLITE_CHMOD', _SPIP_CHMOD);
2046
+    }
2047
+
2048
+    if (!is_dir($d = _DIR_DB)) {
2049
+        include_spip('inc/flock');
2050
+        sous_repertoire($d);
2051
+    }
2052 2052
 }
2053 2053
 
2054 2054
 
@@ -2063,20 +2063,20 @@  discard block
 block discarded – undo
2063 2063
  */
2064 2064
 function _sqlite_is_version($version = '', $link = '', $serveur = '', $requeter = true)
2065 2065
 {
2066
-	if ($link === '') {
2067
-		$link = _sqlite_link($serveur);
2068
-	}
2069
-	if (!$link) {
2070
-		return false;
2071
-	}
2066
+    if ($link === '') {
2067
+        $link = _sqlite_link($serveur);
2068
+    }
2069
+    if (!$link) {
2070
+        return false;
2071
+    }
2072 2072
 
2073
-	$v = 3;
2073
+    $v = 3;
2074 2074
 
2075
-	if (!$version) {
2076
-		return $v;
2077
-	}
2075
+    if (!$version) {
2076
+        return $v;
2077
+    }
2078 2078
 
2079
-	return ($version == $v);
2079
+    return ($version == $v);
2080 2080
 }
2081 2081
 
2082 2082
 
@@ -2088,9 +2088,9 @@  discard block
 block discarded – undo
2088 2088
  */
2089 2089
 function _sqlite_link($serveur = '')
2090 2090
 {
2091
-	$link = &$GLOBALS['connexions'][$serveur ? $serveur : 0]['link'];
2091
+    $link = &$GLOBALS['connexions'][$serveur ? $serveur : 0]['link'];
2092 2092
 
2093
-	return $link;
2093
+    return $link;
2094 2094
 }
2095 2095
 
2096 2096
 
@@ -2106,54 +2106,54 @@  discard block
 block discarded – undo
2106 2106
  */
2107 2107
 function _sqlite_calculer_cite($v, $type)
2108 2108
 {
2109
-	if ($type) {
2110
-		if (
2111
-			is_null($v)
2112
-			and stripos($type, 'NOT NULL') === false
2113
-		) {
2114
-			// null php se traduit en NULL SQL
2115
-			return 'NULL';
2116
-		}
2117
-
2118
-		if (sql_test_date($type) and preg_match('/^\w+\(/', $v)) {
2119
-			return $v;
2120
-		}
2121
-		if (sql_test_int($type)) {
2122
-			if (is_numeric($v)) {
2123
-				return $v;
2124
-			} elseif ($v === null) {
2125
-				return 0;
2126
-			} elseif (ctype_xdigit(substr($v, 2)) and strncmp($v, '0x', 2) === 0) {
2127
-				return hexdec(substr($v, 2));
2128
-			} else {
2129
-				return intval($v);
2130
-			}
2131
-		}
2132
-	} else {
2133
-		// si on ne connait pas le type on le deduit de $v autant que possible
2134
-		if (is_bool($v)) {
2135
-			return strval(intval($v));
2136
-		} elseif (is_numeric($v)) {
2137
-			return strval($v);
2138
-		}
2139
-	}
2140
-
2141
-	// trouver un link sqlite pour faire l'echappement
2142
-	foreach ($GLOBALS['connexions'] as $s) {
2143
-		if (
2144
-			$l = $s['link']
2145
-			and is_object($l)
2146
-			and $l instanceof \PDO
2147
-			and $l->getAttribute(\PDO::ATTR_DRIVER_NAME) === 'sqlite'
2148
-		) {
2149
-			return $l->quote($v ?? '');
2150
-		}
2151
-	}
2152
-
2153
-	// echapper les ' en ''
2154
-	spip_log('Pas de methode ->quote pour echapper', 'sqlite.' . _LOG_INFO_IMPORTANTE);
2155
-
2156
-	return ("'" . str_replace("'", "''", $v) . "'");
2109
+    if ($type) {
2110
+        if (
2111
+            is_null($v)
2112
+            and stripos($type, 'NOT NULL') === false
2113
+        ) {
2114
+            // null php se traduit en NULL SQL
2115
+            return 'NULL';
2116
+        }
2117
+
2118
+        if (sql_test_date($type) and preg_match('/^\w+\(/', $v)) {
2119
+            return $v;
2120
+        }
2121
+        if (sql_test_int($type)) {
2122
+            if (is_numeric($v)) {
2123
+                return $v;
2124
+            } elseif ($v === null) {
2125
+                return 0;
2126
+            } elseif (ctype_xdigit(substr($v, 2)) and strncmp($v, '0x', 2) === 0) {
2127
+                return hexdec(substr($v, 2));
2128
+            } else {
2129
+                return intval($v);
2130
+            }
2131
+        }
2132
+    } else {
2133
+        // si on ne connait pas le type on le deduit de $v autant que possible
2134
+        if (is_bool($v)) {
2135
+            return strval(intval($v));
2136
+        } elseif (is_numeric($v)) {
2137
+            return strval($v);
2138
+        }
2139
+    }
2140
+
2141
+    // trouver un link sqlite pour faire l'echappement
2142
+    foreach ($GLOBALS['connexions'] as $s) {
2143
+        if (
2144
+            $l = $s['link']
2145
+            and is_object($l)
2146
+            and $l instanceof \PDO
2147
+            and $l->getAttribute(\PDO::ATTR_DRIVER_NAME) === 'sqlite'
2148
+        ) {
2149
+            return $l->quote($v ?? '');
2150
+        }
2151
+    }
2152
+
2153
+    // echapper les ' en ''
2154
+    spip_log('Pas de methode ->quote pour echapper', 'sqlite.' . _LOG_INFO_IMPORTANTE);
2155
+
2156
+    return ("'" . str_replace("'", "''", $v) . "'");
2157 2157
 }
2158 2158
 
2159 2159
 
@@ -2170,21 +2170,21 @@  discard block
 block discarded – undo
2170 2170
  */
2171 2171
 function _sqlite_calculer_expression($expression, $v, $join = 'AND')
2172 2172
 {
2173
-	if (empty($v)) {
2174
-		return '';
2175
-	}
2176
-
2177
-	$exp = "\n$expression ";
2178
-
2179
-	if (!is_array($v)) {
2180
-		return $exp . $v;
2181
-	} else {
2182
-		if (strtoupper($join) === 'AND') {
2183
-			return $exp . join("\n\t$join ", array_map('_sqlite_calculer_where', $v));
2184
-		} else {
2185
-			return $exp . join($join, $v);
2186
-		}
2187
-	}
2173
+    if (empty($v)) {
2174
+        return '';
2175
+    }
2176
+
2177
+    $exp = "\n$expression ";
2178
+
2179
+    if (!is_array($v)) {
2180
+        return $exp . $v;
2181
+    } else {
2182
+        if (strtoupper($join) === 'AND') {
2183
+            return $exp . join("\n\t$join ", array_map('_sqlite_calculer_where', $v));
2184
+        } else {
2185
+            return $exp . join($join, $v);
2186
+        }
2187
+    }
2188 2188
 }
2189 2189
 
2190 2190
 
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
  */
2202 2202
 function _sqlite_calculer_order($orderby)
2203 2203
 {
2204
-	return (is_array($orderby)) ? join(', ', $orderby) : $orderby;
2204
+    return (is_array($orderby)) ? join(', ', $orderby) : $orderby;
2205 2205
 }
2206 2206
 
2207 2207
 
@@ -2213,26 +2213,26 @@  discard block
 block discarded – undo
2213 2213
  */
2214 2214
 function _sqlite_calculer_select_as($args)
2215 2215
 {
2216
-	$res = '';
2217
-	foreach ($args as $k => $v) {
2218
-		if (substr($k, -1) == '@') {
2219
-			// c'est une jointure qui se refere au from precedent
2220
-			// pas de virgule
2221
-			$res .= '  ' . $v;
2222
-		} else {
2223
-			if (!is_numeric($k)) {
2224
-				$p = strpos($v, ' ');
2225
-				if ($p) {
2226
-					$v = substr($v, 0, $p) . " AS '$k'" . substr($v, $p);
2227
-				} else {
2228
-					$v .= " AS '$k'";
2229
-				}
2230
-			}
2231
-			$res .= ', ' . $v;
2232
-		}
2233
-	}
2234
-
2235
-	return substr($res, 2);
2216
+    $res = '';
2217
+    foreach ($args as $k => $v) {
2218
+        if (substr($k, -1) == '@') {
2219
+            // c'est une jointure qui se refere au from precedent
2220
+            // pas de virgule
2221
+            $res .= '  ' . $v;
2222
+        } else {
2223
+            if (!is_numeric($k)) {
2224
+                $p = strpos($v, ' ');
2225
+                if ($p) {
2226
+                    $v = substr($v, 0, $p) . " AS '$k'" . substr($v, $p);
2227
+                } else {
2228
+                    $v .= " AS '$k'";
2229
+                }
2230
+            }
2231
+            $res .= ', ' . $v;
2232
+        }
2233
+    }
2234
+
2235
+    return substr($res, 2);
2236 2236
 }
2237 2237
 
2238 2238
 
@@ -2256,26 +2256,26 @@  discard block
 block discarded – undo
2256 2256
  */
2257 2257
 function _sqlite_calculer_where($v)
2258 2258
 {
2259
-	if (!is_array($v)) {
2260
-		return $v;
2261
-	}
2262
-
2263
-	$op = array_shift($v);
2264
-	if (!($n = count($v))) {
2265
-		return $op;
2266
-	} else {
2267
-		$arg = _sqlite_calculer_where(array_shift($v));
2268
-		if ($n == 1) {
2269
-			return "$op($arg)";
2270
-		} else {
2271
-			$arg2 = _sqlite_calculer_where(array_shift($v));
2272
-			if ($n == 2) {
2273
-				return "($arg $op $arg2)";
2274
-			} else {
2275
-				return "($arg $op ($arg2) : $v[0])";
2276
-			}
2277
-		}
2278
-	}
2259
+    if (!is_array($v)) {
2260
+        return $v;
2261
+    }
2262
+
2263
+    $op = array_shift($v);
2264
+    if (!($n = count($v))) {
2265
+        return $op;
2266
+    } else {
2267
+        $arg = _sqlite_calculer_where(array_shift($v));
2268
+        if ($n == 1) {
2269
+            return "$op($arg)";
2270
+        } else {
2271
+            $arg2 = _sqlite_calculer_where(array_shift($v));
2272
+            if ($n == 2) {
2273
+                return "($arg $op $arg2)";
2274
+            } else {
2275
+                return "($arg $op ($arg2) : $v[0])";
2276
+            }
2277
+        }
2278
+    }
2279 2279
 }
2280 2280
 
2281 2281
 
@@ -2291,19 +2291,19 @@  discard block
 block discarded – undo
2291 2291
  */
2292 2292
 function _sqlite_charger_version($version = '')
2293 2293
 {
2294
-	$versions = [];
2295
-
2296
-	// version 3
2297
-	if (!$version || $version == 3) {
2298
-		if (extension_loaded('pdo') && extension_loaded('pdo_sqlite')) {
2299
-			$versions[] = 3;
2300
-		}
2301
-	}
2302
-	if ($version) {
2303
-		return in_array($version, $versions);
2304
-	}
2305
-
2306
-	return $versions;
2294
+    $versions = [];
2295
+
2296
+    // version 3
2297
+    if (!$version || $version == 3) {
2298
+        if (extension_loaded('pdo') && extension_loaded('pdo_sqlite')) {
2299
+            $versions[] = 3;
2300
+        }
2301
+    }
2302
+    if ($version) {
2303
+        return in_array($version, $versions);
2304
+    }
2305
+
2306
+    return $versions;
2307 2307
 }
2308 2308
 
2309 2309
 
@@ -2342,147 +2342,147 @@  discard block
 block discarded – undo
2342 2342
 function _sqlite_modifier_table($table, $colonne, $opt = [], $serveur = '')
2343 2343
 {
2344 2344
 
2345
-	if (is_array($table)) {
2346
-		$table_destination = reset($table);
2347
-		$table_origine = key($table);
2348
-	} else {
2349
-		$table_origine = $table_destination = $table;
2350
-	}
2351
-	// ne prend actuellement qu'un changement
2352
-	// mais pourra etre adapte pour changer plus qu'une colonne a la fois
2353
-	if (is_array($colonne)) {
2354
-		$colonne_destination = reset($colonne);
2355
-		$colonne_origine = key($colonne);
2356
-	} else {
2357
-		$colonne_origine = $colonne_destination = $colonne;
2358
-	}
2359
-	if (!isset($opt['field'])) {
2360
-		$opt['field'] = [];
2361
-	}
2362
-	if (!isset($opt['key'])) {
2363
-		$opt['key'] = [];
2364
-	}
2365
-
2366
-	// si les noms de tables sont differents, pas besoin de table temporaire
2367
-	// on prendra directement le nom de la future table
2368
-	$meme_table = ($table_origine == $table_destination);
2369
-
2370
-	$def_origine = sql_showtable($table_origine, false, $serveur);
2371
-	if (!$def_origine or !isset($def_origine['field'])) {
2372
-		spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite' . _LOG_ERREUR);
2373
-
2374
-		return false;
2375
-	}
2376
-
2377
-
2378
-	$table_tmp = $table_origine . '_tmp';
2379
-
2380
-	// 1) creer une table temporaire avec les modifications
2381
-	// - DROP : suppression de la colonne
2382
-	// - CHANGE : modification de la colonne
2383
-	// (foreach pour conserver l'ordre des champs)
2384
-
2385
-	// field
2386
-	$fields = [];
2387
-	// pour le INSERT INTO plus loin
2388
-	// stocker la correspondance nouvelles->anciennes colonnes
2389
-	$fields_correspondances = [];
2390
-	foreach ($def_origine['field'] as $c => $d) {
2391
-		if ($colonne_origine && ($c == $colonne_origine)) {
2392
-			// si pas DROP
2393
-			if ($colonne_destination) {
2394
-				$fields[$colonne_destination] = $opt['field'][$colonne_destination];
2395
-				$fields_correspondances[$colonne_destination] = $c;
2396
-			}
2397
-		} else {
2398
-			$fields[$c] = $d;
2399
-			$fields_correspondances[$c] = $c;
2400
-		}
2401
-	}
2402
-	// cas de ADD sqlite2 (ajout du champ en fin de table):
2403
-	if (!$colonne_origine && $colonne_destination) {
2404
-		$fields[$colonne_destination] = $opt['field'][$colonne_destination];
2405
-	}
2406
-
2407
-	// key...
2408
-	$keys = [];
2409
-	foreach ($def_origine['key'] as $c => $d) {
2410
-		$c = str_replace($colonne_origine, $colonne_destination, $c);
2411
-		$d = str_replace($colonne_origine, $colonne_destination, $d);
2412
-		// seulement si on ne supprime pas la colonne !
2413
-		if ($d) {
2414
-			$keys[$c] = $d;
2415
-		}
2416
-	}
2417
-
2418
-	// autres keys, on merge
2419
-	$keys = array_merge($keys, $opt['key']);
2420
-	$queries = [];
2421
-
2422
-	// copier dans destination (si differente de origine), sinon tmp
2423
-	$table_copie = ($meme_table) ? $table_tmp : $table_destination;
2424
-	$autoinc = (isset($keys['PRIMARY KEY'])
2425
-		and $keys['PRIMARY KEY']
2426
-		and stripos($keys['PRIMARY KEY'], ',') === false
2427
-		and stripos($fields[$keys['PRIMARY KEY']], 'default') === false);
2428
-
2429
-	if (
2430
-		$q = _sqlite_requete_create(
2431
-			$table_copie,
2432
-			$fields,
2433
-			$keys,
2434
-			$autoinc,
2435
-			$temporary = false,
2436
-			$ifnotexists = true,
2437
-			$serveur
2438
-		)
2439
-	) {
2440
-		$queries[] = $q;
2441
-	}
2442
-
2443
-
2444
-	// 2) y copier les champs qui vont bien
2445
-	$champs_dest = join(', ', array_keys($fields_correspondances));
2446
-	$champs_ori = join(', ', $fields_correspondances);
2447
-	$queries[] = "INSERT INTO $table_copie ($champs_dest) SELECT $champs_ori FROM $table_origine";
2448
-
2449
-	// 3) supprimer la table d'origine
2450
-	$queries[] = "DROP TABLE $table_origine";
2451
-
2452
-	// 4) renommer la table temporaire
2453
-	// avec le nom de la table destination
2454
-	// si necessaire
2455
-	if ($meme_table) {
2456
-		$queries[] = "ALTER TABLE $table_copie RENAME TO $table_destination";
2457
-	}
2458
-
2459
-	// 5) remettre les index !
2460
-	foreach ($keys as $k => $v) {
2461
-		if ($k == 'PRIMARY KEY') {
2462
-		} else {
2463
-			// enlever KEY
2464
-			$k = substr($k, 4);
2465
-			$queries[] = "CREATE INDEX $table_destination" . "_$k ON $table_destination ($v)";
2466
-		}
2467
-	}
2468
-
2469
-
2470
-	if (count($queries)) {
2471
-		Sqlite::demarrer_transaction($serveur);
2472
-		// il faut les faire une par une car $query = join('; ', $queries).";"; ne fonctionne pas
2473
-		foreach ($queries as $q) {
2474
-			if (!Sqlite::executer_requete($q, $serveur)) {
2475
-				spip_log('SQLite : ALTER TABLE table :'
2476
-					. " Erreur a l'execution de la requete : $q", 'sqlite.' . _LOG_ERREUR);
2477
-				Sqlite::annuler_transaction($serveur);
2478
-
2479
-				return false;
2480
-			}
2481
-		}
2482
-		Sqlite::finir_transaction($serveur);
2483
-	}
2484
-
2485
-	return true;
2345
+    if (is_array($table)) {
2346
+        $table_destination = reset($table);
2347
+        $table_origine = key($table);
2348
+    } else {
2349
+        $table_origine = $table_destination = $table;
2350
+    }
2351
+    // ne prend actuellement qu'un changement
2352
+    // mais pourra etre adapte pour changer plus qu'une colonne a la fois
2353
+    if (is_array($colonne)) {
2354
+        $colonne_destination = reset($colonne);
2355
+        $colonne_origine = key($colonne);
2356
+    } else {
2357
+        $colonne_origine = $colonne_destination = $colonne;
2358
+    }
2359
+    if (!isset($opt['field'])) {
2360
+        $opt['field'] = [];
2361
+    }
2362
+    if (!isset($opt['key'])) {
2363
+        $opt['key'] = [];
2364
+    }
2365
+
2366
+    // si les noms de tables sont differents, pas besoin de table temporaire
2367
+    // on prendra directement le nom de la future table
2368
+    $meme_table = ($table_origine == $table_destination);
2369
+
2370
+    $def_origine = sql_showtable($table_origine, false, $serveur);
2371
+    if (!$def_origine or !isset($def_origine['field'])) {
2372
+        spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite' . _LOG_ERREUR);
2373
+
2374
+        return false;
2375
+    }
2376
+
2377
+
2378
+    $table_tmp = $table_origine . '_tmp';
2379
+
2380
+    // 1) creer une table temporaire avec les modifications
2381
+    // - DROP : suppression de la colonne
2382
+    // - CHANGE : modification de la colonne
2383
+    // (foreach pour conserver l'ordre des champs)
2384
+
2385
+    // field
2386
+    $fields = [];
2387
+    // pour le INSERT INTO plus loin
2388
+    // stocker la correspondance nouvelles->anciennes colonnes
2389
+    $fields_correspondances = [];
2390
+    foreach ($def_origine['field'] as $c => $d) {
2391
+        if ($colonne_origine && ($c == $colonne_origine)) {
2392
+            // si pas DROP
2393
+            if ($colonne_destination) {
2394
+                $fields[$colonne_destination] = $opt['field'][$colonne_destination];
2395
+                $fields_correspondances[$colonne_destination] = $c;
2396
+            }
2397
+        } else {
2398
+            $fields[$c] = $d;
2399
+            $fields_correspondances[$c] = $c;
2400
+        }
2401
+    }
2402
+    // cas de ADD sqlite2 (ajout du champ en fin de table):
2403
+    if (!$colonne_origine && $colonne_destination) {
2404
+        $fields[$colonne_destination] = $opt['field'][$colonne_destination];
2405
+    }
2406
+
2407
+    // key...
2408
+    $keys = [];
2409
+    foreach ($def_origine['key'] as $c => $d) {
2410
+        $c = str_replace($colonne_origine, $colonne_destination, $c);
2411
+        $d = str_replace($colonne_origine, $colonne_destination, $d);
2412
+        // seulement si on ne supprime pas la colonne !
2413
+        if ($d) {
2414
+            $keys[$c] = $d;
2415
+        }
2416
+    }
2417
+
2418
+    // autres keys, on merge
2419
+    $keys = array_merge($keys, $opt['key']);
2420
+    $queries = [];
2421
+
2422
+    // copier dans destination (si differente de origine), sinon tmp
2423
+    $table_copie = ($meme_table) ? $table_tmp : $table_destination;
2424
+    $autoinc = (isset($keys['PRIMARY KEY'])
2425
+        and $keys['PRIMARY KEY']
2426
+        and stripos($keys['PRIMARY KEY'], ',') === false
2427
+        and stripos($fields[$keys['PRIMARY KEY']], 'default') === false);
2428
+
2429
+    if (
2430
+        $q = _sqlite_requete_create(
2431
+            $table_copie,
2432
+            $fields,
2433
+            $keys,
2434
+            $autoinc,
2435
+            $temporary = false,
2436
+            $ifnotexists = true,
2437
+            $serveur
2438
+        )
2439
+    ) {
2440
+        $queries[] = $q;
2441
+    }
2442
+
2443
+
2444
+    // 2) y copier les champs qui vont bien
2445
+    $champs_dest = join(', ', array_keys($fields_correspondances));
2446
+    $champs_ori = join(', ', $fields_correspondances);
2447
+    $queries[] = "INSERT INTO $table_copie ($champs_dest) SELECT $champs_ori FROM $table_origine";
2448
+
2449
+    // 3) supprimer la table d'origine
2450
+    $queries[] = "DROP TABLE $table_origine";
2451
+
2452
+    // 4) renommer la table temporaire
2453
+    // avec le nom de la table destination
2454
+    // si necessaire
2455
+    if ($meme_table) {
2456
+        $queries[] = "ALTER TABLE $table_copie RENAME TO $table_destination";
2457
+    }
2458
+
2459
+    // 5) remettre les index !
2460
+    foreach ($keys as $k => $v) {
2461
+        if ($k == 'PRIMARY KEY') {
2462
+        } else {
2463
+            // enlever KEY
2464
+            $k = substr($k, 4);
2465
+            $queries[] = "CREATE INDEX $table_destination" . "_$k ON $table_destination ($v)";
2466
+        }
2467
+    }
2468
+
2469
+
2470
+    if (count($queries)) {
2471
+        Sqlite::demarrer_transaction($serveur);
2472
+        // il faut les faire une par une car $query = join('; ', $queries).";"; ne fonctionne pas
2473
+        foreach ($queries as $q) {
2474
+            if (!Sqlite::executer_requete($q, $serveur)) {
2475
+                spip_log('SQLite : ALTER TABLE table :'
2476
+                    . " Erreur a l'execution de la requete : $q", 'sqlite.' . _LOG_ERREUR);
2477
+                Sqlite::annuler_transaction($serveur);
2478
+
2479
+                return false;
2480
+            }
2481
+        }
2482
+        Sqlite::finir_transaction($serveur);
2483
+    }
2484
+
2485
+    return true;
2486 2486
 }
2487 2487
 
2488 2488
 
@@ -2493,61 +2493,61 @@  discard block
 block discarded – undo
2493 2493
  */
2494 2494
 function _sqlite_ref_fonctions()
2495 2495
 {
2496
-	$fonctions = [
2497
-		'alter' => 'spip_sqlite_alter',
2498
-		'count' => 'spip_sqlite_count',
2499
-		'countsel' => 'spip_sqlite_countsel',
2500
-		'create' => 'spip_sqlite_create',
2501
-		'create_base' => 'spip_sqlite_create_base',
2502
-		'create_view' => 'spip_sqlite_create_view',
2503
-		'date_proche' => 'spip_sqlite_date_proche',
2504
-		'delete' => 'spip_sqlite_delete',
2505
-		'drop_table' => 'spip_sqlite_drop_table',
2506
-		'drop_view' => 'spip_sqlite_drop_view',
2507
-		'errno' => 'spip_sqlite_errno',
2508
-		'error' => 'spip_sqlite_error',
2509
-		'explain' => 'spip_sqlite_explain',
2510
-		'fetch' => 'spip_sqlite_fetch',
2511
-		'seek' => 'spip_sqlite_seek',
2512
-		'free' => 'spip_sqlite_free',
2513
-		'hex' => 'spip_sqlite_hex',
2514
-		'in' => 'spip_sqlite_in',
2515
-		'insert' => 'spip_sqlite_insert',
2516
-		'insertq' => 'spip_sqlite_insertq',
2517
-		'insertq_multi' => 'spip_sqlite_insertq_multi',
2518
-		'listdbs' => 'spip_sqlite_listdbs',
2519
-		'multi' => 'spip_sqlite_multi',
2520
-		'optimize' => 'spip_sqlite_optimize',
2521
-		'query' => 'spip_sqlite_query',
2522
-		'quote' => 'spip_sqlite_quote',
2523
-		'repair' => 'spip_sqlite_repair',
2524
-		'replace' => 'spip_sqlite_replace',
2525
-		'replace_multi' => 'spip_sqlite_replace_multi',
2526
-		'select' => 'spip_sqlite_select',
2527
-		'selectdb' => 'spip_sqlite_selectdb',
2528
-		'set_charset' => 'spip_sqlite_set_charset',
2529
-		'get_charset' => 'spip_sqlite_get_charset',
2530
-		'showbase' => 'spip_sqlite_showbase',
2531
-		'showtable' => 'spip_sqlite_showtable',
2532
-		'table_exists' => 'spip_sqlite_table_exists',
2533
-		'update' => 'spip_sqlite_update',
2534
-		'updateq' => 'spip_sqlite_updateq',
2535
-		'preferer_transaction' => 'spip_sqlite_preferer_transaction',
2536
-		'demarrer_transaction' => 'spip_sqlite_demarrer_transaction',
2537
-		'terminer_transaction' => 'spip_sqlite_terminer_transaction',
2538
-	];
2539
-
2540
-	// association de chaque nom http d'un charset aux couples sqlite
2541
-	// SQLite supporte utf-8 et utf-16 uniquement.
2542
-	$charsets = [
2543
-		'utf-8' => ['charset' => 'utf8', 'collation' => 'utf8_general_ci'],
2544
-		//'utf-16be'=>array('charset'=>'utf16be','collation'=>'UTF-16BE'),// aucune idee de quoi il faut remplir dans es champs la
2545
-		//'utf-16le'=>array('charset'=>'utf16le','collation'=>'UTF-16LE')
2546
-	];
2547
-
2548
-	$fonctions['charsets'] = $charsets;
2549
-
2550
-	return $fonctions;
2496
+    $fonctions = [
2497
+        'alter' => 'spip_sqlite_alter',
2498
+        'count' => 'spip_sqlite_count',
2499
+        'countsel' => 'spip_sqlite_countsel',
2500
+        'create' => 'spip_sqlite_create',
2501
+        'create_base' => 'spip_sqlite_create_base',
2502
+        'create_view' => 'spip_sqlite_create_view',
2503
+        'date_proche' => 'spip_sqlite_date_proche',
2504
+        'delete' => 'spip_sqlite_delete',
2505
+        'drop_table' => 'spip_sqlite_drop_table',
2506
+        'drop_view' => 'spip_sqlite_drop_view',
2507
+        'errno' => 'spip_sqlite_errno',
2508
+        'error' => 'spip_sqlite_error',
2509
+        'explain' => 'spip_sqlite_explain',
2510
+        'fetch' => 'spip_sqlite_fetch',
2511
+        'seek' => 'spip_sqlite_seek',
2512
+        'free' => 'spip_sqlite_free',
2513
+        'hex' => 'spip_sqlite_hex',
2514
+        'in' => 'spip_sqlite_in',
2515
+        'insert' => 'spip_sqlite_insert',
2516
+        'insertq' => 'spip_sqlite_insertq',
2517
+        'insertq_multi' => 'spip_sqlite_insertq_multi',
2518
+        'listdbs' => 'spip_sqlite_listdbs',
2519
+        'multi' => 'spip_sqlite_multi',
2520
+        'optimize' => 'spip_sqlite_optimize',
2521
+        'query' => 'spip_sqlite_query',
2522
+        'quote' => 'spip_sqlite_quote',
2523
+        'repair' => 'spip_sqlite_repair',
2524
+        'replace' => 'spip_sqlite_replace',
2525
+        'replace_multi' => 'spip_sqlite_replace_multi',
2526
+        'select' => 'spip_sqlite_select',
2527
+        'selectdb' => 'spip_sqlite_selectdb',
2528
+        'set_charset' => 'spip_sqlite_set_charset',
2529
+        'get_charset' => 'spip_sqlite_get_charset',
2530
+        'showbase' => 'spip_sqlite_showbase',
2531
+        'showtable' => 'spip_sqlite_showtable',
2532
+        'table_exists' => 'spip_sqlite_table_exists',
2533
+        'update' => 'spip_sqlite_update',
2534
+        'updateq' => 'spip_sqlite_updateq',
2535
+        'preferer_transaction' => 'spip_sqlite_preferer_transaction',
2536
+        'demarrer_transaction' => 'spip_sqlite_demarrer_transaction',
2537
+        'terminer_transaction' => 'spip_sqlite_terminer_transaction',
2538
+    ];
2539
+
2540
+    // association de chaque nom http d'un charset aux couples sqlite
2541
+    // SQLite supporte utf-8 et utf-16 uniquement.
2542
+    $charsets = [
2543
+        'utf-8' => ['charset' => 'utf8', 'collation' => 'utf8_general_ci'],
2544
+        //'utf-16be'=>array('charset'=>'utf16be','collation'=>'UTF-16BE'),// aucune idee de quoi il faut remplir dans es champs la
2545
+        //'utf-16le'=>array('charset'=>'utf16le','collation'=>'UTF-16LE')
2546
+    ];
2547
+
2548
+    $fonctions['charsets'] = $charsets;
2549
+
2550
+    return $fonctions;
2551 2551
 }
2552 2552
 
2553 2553
 
@@ -2560,56 +2560,56 @@  discard block
 block discarded – undo
2560 2560
  */
2561 2561
 function _sqlite_remplacements_definitions_table($query, $autoinc = false)
2562 2562
 {
2563
-	// quelques remplacements
2564
-	$num = '(\s*\([0-9]*\))?';
2565
-	$enum = '(\s*\([^\)]*\))?';
2566
-
2567
-	$remplace = [
2568
-		'/enum' . $enum . '/is' => 'VARCHAR(255)',
2569
-		'/COLLATE \w+_bin/is' => 'COLLATE BINARY',
2570
-		'/COLLATE \w+_ci/is' => 'COLLATE NOCASE',
2571
-		'/auto_increment/is' => '',
2572
-		'/current_timestamp\(\)/is' => 'CURRENT_TIMESTAMP', // Fix export depuis mariaDB #4374
2573
-		'/(timestamp .* )ON .*$/is' => '\\1',
2574
-		'/character set \w+/is' => '',
2575
-		'/((big|small|medium|tiny)?int(eger)?)' . $num . '\s*unsigned/is' => '\\1 UNSIGNED',
2576
-		'/(text\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2577
-		'/((char|varchar)' . $num . '\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2578
-		'/(datetime\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00 00:00:00'",
2579
-		'/(date\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00'",
2580
-	];
2581
-
2582
-	// pour l'autoincrement, il faut des INTEGER NOT NULL PRIMARY KEY
2583
-	$remplace_autocinc = [
2584
-		'/(big|small|medium|tiny)?int(eger)?' . $num . '/is' => 'INTEGER'
2585
-	];
2586
-	// pour les int non autoincrement, il faut un DEFAULT
2587
-	$remplace_nonautocinc = [
2588
-		'/((big|small|medium|tiny)?int(eger)?' . $num . '\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0",
2589
-	];
2590
-
2591
-	if (is_string($query)) {
2592
-		$query = preg_replace(array_keys($remplace), $remplace, $query);
2593
-		if ($autoinc or preg_match(',AUTO_INCREMENT,is', $query)) {
2594
-			$query = preg_replace(array_keys($remplace_autocinc), $remplace_autocinc, $query);
2595
-		} else {
2596
-			$query = preg_replace(array_keys($remplace_nonautocinc), $remplace_nonautocinc, $query);
2597
-			$query = _sqlite_collate_ci($query);
2598
-		}
2599
-	} elseif (is_array($query)) {
2600
-		foreach ($query as $k => $q) {
2601
-			$ai = ($autoinc ? $k == $autoinc : preg_match(',AUTO_INCREMENT,is', $q));
2602
-			$query[$k] = preg_replace(array_keys($remplace), $remplace, $query[$k]);
2603
-			if ($ai) {
2604
-				$query[$k] = preg_replace(array_keys($remplace_autocinc), $remplace_autocinc, $query[$k]);
2605
-			} else {
2606
-				$query[$k] = preg_replace(array_keys($remplace_nonautocinc), $remplace_nonautocinc, $query[$k]);
2607
-				$query[$k] = _sqlite_collate_ci($query[$k]);
2608
-			}
2609
-		}
2610
-	}
2611
-
2612
-	return $query;
2563
+    // quelques remplacements
2564
+    $num = '(\s*\([0-9]*\))?';
2565
+    $enum = '(\s*\([^\)]*\))?';
2566
+
2567
+    $remplace = [
2568
+        '/enum' . $enum . '/is' => 'VARCHAR(255)',
2569
+        '/COLLATE \w+_bin/is' => 'COLLATE BINARY',
2570
+        '/COLLATE \w+_ci/is' => 'COLLATE NOCASE',
2571
+        '/auto_increment/is' => '',
2572
+        '/current_timestamp\(\)/is' => 'CURRENT_TIMESTAMP', // Fix export depuis mariaDB #4374
2573
+        '/(timestamp .* )ON .*$/is' => '\\1',
2574
+        '/character set \w+/is' => '',
2575
+        '/((big|small|medium|tiny)?int(eger)?)' . $num . '\s*unsigned/is' => '\\1 UNSIGNED',
2576
+        '/(text\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2577
+        '/((char|varchar)' . $num . '\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2578
+        '/(datetime\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00 00:00:00'",
2579
+        '/(date\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00'",
2580
+    ];
2581
+
2582
+    // pour l'autoincrement, il faut des INTEGER NOT NULL PRIMARY KEY
2583
+    $remplace_autocinc = [
2584
+        '/(big|small|medium|tiny)?int(eger)?' . $num . '/is' => 'INTEGER'
2585
+    ];
2586
+    // pour les int non autoincrement, il faut un DEFAULT
2587
+    $remplace_nonautocinc = [
2588
+        '/((big|small|medium|tiny)?int(eger)?' . $num . '\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0",
2589
+    ];
2590
+
2591
+    if (is_string($query)) {
2592
+        $query = preg_replace(array_keys($remplace), $remplace, $query);
2593
+        if ($autoinc or preg_match(',AUTO_INCREMENT,is', $query)) {
2594
+            $query = preg_replace(array_keys($remplace_autocinc), $remplace_autocinc, $query);
2595
+        } else {
2596
+            $query = preg_replace(array_keys($remplace_nonautocinc), $remplace_nonautocinc, $query);
2597
+            $query = _sqlite_collate_ci($query);
2598
+        }
2599
+    } elseif (is_array($query)) {
2600
+        foreach ($query as $k => $q) {
2601
+            $ai = ($autoinc ? $k == $autoinc : preg_match(',AUTO_INCREMENT,is', $q));
2602
+            $query[$k] = preg_replace(array_keys($remplace), $remplace, $query[$k]);
2603
+            if ($ai) {
2604
+                $query[$k] = preg_replace(array_keys($remplace_autocinc), $remplace_autocinc, $query[$k]);
2605
+            } else {
2606
+                $query[$k] = preg_replace(array_keys($remplace_nonautocinc), $remplace_nonautocinc, $query[$k]);
2607
+                $query[$k] = _sqlite_collate_ci($query[$k]);
2608
+            }
2609
+        }
2610
+    }
2611
+
2612
+    return $query;
2613 2613
 }
2614 2614
 
2615 2615
 /**
@@ -2621,17 +2621,17 @@  discard block
 block discarded – undo
2621 2621
  */
2622 2622
 function _sqlite_collate_ci($champ)
2623 2623
 {
2624
-	if (stripos($champ, 'COLLATE') !== false) {
2625
-		return $champ;
2626
-	}
2627
-	if (stripos($champ, 'BINARY') !== false) {
2628
-		return str_ireplace('BINARY', 'COLLATE BINARY', $champ);
2629
-	}
2630
-	if (preg_match(',^(char|varchar|(long|small|medium|tiny)?text),i', $champ)) {
2631
-		return $champ . ' COLLATE NOCASE';
2632
-	}
2633
-
2634
-	return $champ;
2624
+    if (stripos($champ, 'COLLATE') !== false) {
2625
+        return $champ;
2626
+    }
2627
+    if (stripos($champ, 'BINARY') !== false) {
2628
+        return str_ireplace('BINARY', 'COLLATE BINARY', $champ);
2629
+    }
2630
+    if (preg_match(',^(char|varchar|(long|small|medium|tiny)?text),i', $champ)) {
2631
+        return $champ . ' COLLATE NOCASE';
2632
+    }
2633
+
2634
+    return $champ;
2635 2635
 }
2636 2636
 
2637 2637
 
@@ -2650,84 +2650,84 @@  discard block
 block discarded – undo
2650 2650
  * @return bool|string
2651 2651
  */
2652 2652
 function _sqlite_requete_create(
2653
-	$nom,
2654
-	$champs,
2655
-	$cles,
2656
-	$autoinc = false,
2657
-	$temporary = false,
2658
-	$_ifnotexists = true,
2659
-	$serveur = '',
2660
-	$requeter = true
2653
+    $nom,
2654
+    $champs,
2655
+    $cles,
2656
+    $autoinc = false,
2657
+    $temporary = false,
2658
+    $_ifnotexists = true,
2659
+    $serveur = '',
2660
+    $requeter = true
2661 2661
 ) {
2662
-	$query = $keys = $s = $p = '';
2663
-
2664
-	// certains plugins declarent les tables  (permet leur inclusion dans le dump)
2665
-	// sans les renseigner (laisse le compilo recuperer la description)
2666
-	if (!is_array($champs) || !is_array($cles)) {
2667
-		return;
2668
-	}
2669
-
2670
-	// sqlite ne gere pas KEY tout court dans une requete CREATE TABLE
2671
-	// il faut passer par des create index
2672
-	// Il gere par contre primary key !
2673
-	// Soit la PK est definie dans les cles, soit dans un champs
2674
-	// soit faussement dans les 2 (et dans ce cas, il faut l’enlever à un des 2 endroits !)
2675
-	$pk = 'PRIMARY KEY';
2676
-	// le champ de cle primaire
2677
-	$champ_pk = !empty($cles[$pk]) ? $cles[$pk] : '';
2678
-
2679
-	foreach ($champs as $k => $v) {
2680
-		if (false !== stripos($v, $pk)) {
2681
-			$champ_pk = $k;
2682
-			// on n'en a plus besoin dans field, vu que defini dans key
2683
-			$champs[$k] = preg_replace("/$pk/is", '', $champs[$k]);
2684
-			break;
2685
-		}
2686
-	}
2687
-
2688
-	if ($champ_pk) {
2689
-		$keys = "\n\t\t$pk ($champ_pk)";
2690
-	}
2691
-	// Pas de DEFAULT 0 sur les cles primaires en auto-increment
2692
-	if (
2693
-		isset($champs[$champ_pk])
2694
-		and stripos($champs[$champ_pk], 'default 0') !== false
2695
-	) {
2696
-		$champs[$champ_pk] = trim(str_ireplace('default 0', '', $champs[$champ_pk]));
2697
-	}
2698
-
2699
-	$champs = _sqlite_remplacements_definitions_table($champs, $autoinc ? $champ_pk : false);
2700
-	foreach ($champs as $k => $v) {
2701
-		$query .= "$s\n\t\t$k $v";
2702
-		$s = ',';
2703
-	}
2704
-
2705
-	$ifnotexists = '';
2706
-	if ($_ifnotexists) {
2707
-		$version = spip_sqlite_fetch(
2708
-			spip_sqlite_query('select sqlite_version() AS sqlite_version', $serveur),
2709
-			'',
2710
-			$serveur
2711
-		);
2712
-		if (!function_exists('spip_version_compare')) {
2713
-			include_spip('plugins/installer');
2714
-		}
2715
-
2716
-		if ($version and spip_version_compare($version['sqlite_version'], '3.3.0', '>=')) {
2717
-			$ifnotexists = ' IF NOT EXISTS';
2718
-		} else {
2719
-			/* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
2720
-			$a = spip_sqlite_showtable($nom, $serveur);
2721
-			if (isset($a['key']['KEY ' . $nom])) {
2722
-				return true;
2723
-			}
2724
-		}
2725
-	}
2726
-
2727
-	$temporary = $temporary ? ' TEMPORARY' : '';
2728
-	$q = "CREATE$temporary TABLE$ifnotexists $nom ($query" . ($keys ? ",$keys" : '') . ")\n";
2729
-
2730
-	return $q;
2662
+    $query = $keys = $s = $p = '';
2663
+
2664
+    // certains plugins declarent les tables  (permet leur inclusion dans le dump)
2665
+    // sans les renseigner (laisse le compilo recuperer la description)
2666
+    if (!is_array($champs) || !is_array($cles)) {
2667
+        return;
2668
+    }
2669
+
2670
+    // sqlite ne gere pas KEY tout court dans une requete CREATE TABLE
2671
+    // il faut passer par des create index
2672
+    // Il gere par contre primary key !
2673
+    // Soit la PK est definie dans les cles, soit dans un champs
2674
+    // soit faussement dans les 2 (et dans ce cas, il faut l’enlever à un des 2 endroits !)
2675
+    $pk = 'PRIMARY KEY';
2676
+    // le champ de cle primaire
2677
+    $champ_pk = !empty($cles[$pk]) ? $cles[$pk] : '';
2678
+
2679
+    foreach ($champs as $k => $v) {
2680
+        if (false !== stripos($v, $pk)) {
2681
+            $champ_pk = $k;
2682
+            // on n'en a plus besoin dans field, vu que defini dans key
2683
+            $champs[$k] = preg_replace("/$pk/is", '', $champs[$k]);
2684
+            break;
2685
+        }
2686
+    }
2687
+
2688
+    if ($champ_pk) {
2689
+        $keys = "\n\t\t$pk ($champ_pk)";
2690
+    }
2691
+    // Pas de DEFAULT 0 sur les cles primaires en auto-increment
2692
+    if (
2693
+        isset($champs[$champ_pk])
2694
+        and stripos($champs[$champ_pk], 'default 0') !== false
2695
+    ) {
2696
+        $champs[$champ_pk] = trim(str_ireplace('default 0', '', $champs[$champ_pk]));
2697
+    }
2698
+
2699
+    $champs = _sqlite_remplacements_definitions_table($champs, $autoinc ? $champ_pk : false);
2700
+    foreach ($champs as $k => $v) {
2701
+        $query .= "$s\n\t\t$k $v";
2702
+        $s = ',';
2703
+    }
2704
+
2705
+    $ifnotexists = '';
2706
+    if ($_ifnotexists) {
2707
+        $version = spip_sqlite_fetch(
2708
+            spip_sqlite_query('select sqlite_version() AS sqlite_version', $serveur),
2709
+            '',
2710
+            $serveur
2711
+        );
2712
+        if (!function_exists('spip_version_compare')) {
2713
+            include_spip('plugins/installer');
2714
+        }
2715
+
2716
+        if ($version and spip_version_compare($version['sqlite_version'], '3.3.0', '>=')) {
2717
+            $ifnotexists = ' IF NOT EXISTS';
2718
+        } else {
2719
+            /* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
2720
+            $a = spip_sqlite_showtable($nom, $serveur);
2721
+            if (isset($a['key']['KEY ' . $nom])) {
2722
+                return true;
2723
+            }
2724
+        }
2725
+    }
2726
+
2727
+    $temporary = $temporary ? ' TEMPORARY' : '';
2728
+    $q = "CREATE$temporary TABLE$ifnotexists $nom ($query" . ($keys ? ",$keys" : '') . ")\n";
2729
+
2730
+    return $q;
2731 2731
 }
2732 2732
 
2733 2733
 
@@ -2747,40 +2747,40 @@  discard block
 block discarded – undo
2747 2747
  */
2748 2748
 function _sqlite_ajouter_champs_timestamp($table, $couples, $desc = '', $serveur = '')
2749 2749
 {
2750
-	static $tables = [];
2751
-
2752
-	if (!isset($tables[$table])) {
2753
-		if (!$desc) {
2754
-			$trouver_table = charger_fonction('trouver_table', 'base');
2755
-			$desc = $trouver_table($table, $serveur);
2756
-			// si pas de description, on ne fait rien, ou on die() ?
2757
-			if (!$desc) {
2758
-				return $couples;
2759
-			}
2760
-		}
2761
-
2762
-		// recherche des champs avec simplement 'TIMESTAMP'
2763
-		// cependant, il faudra peut etre etendre
2764
-		// avec la gestion de DEFAULT et ON UPDATE
2765
-		// mais ceux-ci ne sont pas utilises dans le core
2766
-		$tables[$table] = ['valeur' => [], 'cite' => [], 'desc' => []];
2767
-
2768
-		$now = _sqlite_func_now(true);
2769
-		foreach ($desc['field'] as $k => $v) {
2770
-			if (strpos(strtolower(ltrim($v)), 'timestamp') === 0) {
2771
-				$tables[$table]['desc'][$k] = $v;
2772
-				$tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
2773
-			}
2774
-		}
2775
-	} else {
2776
-		$now = _sqlite_func_now(true);
2777
-		foreach (array_keys($tables[$table]['desc']) as $k) {
2778
-			$tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
2779
-		}
2780
-	}
2781
-
2782
-	// ajout des champs type 'timestamp' absents
2783
-	return array_merge($tables[$table]['valeur'], $couples);
2750
+    static $tables = [];
2751
+
2752
+    if (!isset($tables[$table])) {
2753
+        if (!$desc) {
2754
+            $trouver_table = charger_fonction('trouver_table', 'base');
2755
+            $desc = $trouver_table($table, $serveur);
2756
+            // si pas de description, on ne fait rien, ou on die() ?
2757
+            if (!$desc) {
2758
+                return $couples;
2759
+            }
2760
+        }
2761
+
2762
+        // recherche des champs avec simplement 'TIMESTAMP'
2763
+        // cependant, il faudra peut etre etendre
2764
+        // avec la gestion de DEFAULT et ON UPDATE
2765
+        // mais ceux-ci ne sont pas utilises dans le core
2766
+        $tables[$table] = ['valeur' => [], 'cite' => [], 'desc' => []];
2767
+
2768
+        $now = _sqlite_func_now(true);
2769
+        foreach ($desc['field'] as $k => $v) {
2770
+            if (strpos(strtolower(ltrim($v)), 'timestamp') === 0) {
2771
+                $tables[$table]['desc'][$k] = $v;
2772
+                $tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
2773
+            }
2774
+        }
2775
+    } else {
2776
+        $now = _sqlite_func_now(true);
2777
+        foreach (array_keys($tables[$table]['desc']) as $k) {
2778
+            $tables[$table]['valeur'][$k] = _sqlite_calculer_cite($now, $tables[$table]['desc'][$k]);
2779
+        }
2780
+    }
2781
+
2782
+    // ajout des champs type 'timestamp' absents
2783
+    return array_merge($tables[$table]['valeur'], $couples);
2784 2784
 }
2785 2785
 
2786 2786
 
@@ -2792,5 +2792,5 @@  discard block
 block discarded – undo
2792 2792
  */
2793 2793
 function spip_versions_sqlite()
2794 2794
 {
2795
-	return _sqlite_charger_version();
2795
+    return _sqlite_charger_version();
2796 2796
 }
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Indentation   +884 added lines, -884 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 if (!defined('_MYSQL_NOPLANES')) {
27
-	define('_MYSQL_NOPLANES', true);
27
+    define('_MYSQL_NOPLANES', true);
28 28
 }
29 29
 
30 30
 /**
@@ -41,112 +41,112 @@  discard block
 block discarded – undo
41 41
  *     - tableau décrivant la connexion sinon
42 42
  */
43 43
 function req_mysql_dist($host, $port, $login, $pass, $db = '', $prefixe = '') {
44
-	if (!extension_loaded(\mysqli::class)) {
45
-		return false;
46
-	}
47
-
48
-	// si port est fourni mais pas host, c'est un socket -> compat avec vieille syntaxe de mysql_connect() et anciens fichiers connect.php
49
-	try {
50
-		if (
51
-			$port and !is_numeric($socket = $port)
52
-			and (!$host or $host === 'localhost')
53
-		) {
54
-			$link = @mysqli_connect($host, $login, $pass, '', null, $socket);
55
-		} elseif ($port) {
56
-			$link = @mysqli_connect($host, $login, $pass, '', $port);
57
-		} else {
58
-			$link = @mysqli_connect($host, $login, $pass);
59
-		}
60
-	} catch (\mysqli_sql_exception $e) {
61
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
62
-		$link = false;
63
-	}
64
-
65
-	if (!$link) {
66
-		spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS);
67
-
68
-		return false;
69
-	}
70
-	$last = '';
71
-	if (!$db) {
72
-		$ok = $link;
73
-		$db = 'spip';
74
-	} else {
75
-		$ok = mysqli_select_db($link, $db);
76
-		if (
77
-			defined('_MYSQL_SET_SQL_MODE')
78
-			or defined('_MYSQL_SQL_MODE_TEXT_NOT_NULL') // compatibilite
79
-		) {
80
-			mysqli_query($link, $last = "set sql_mode=''");
81
-		}
82
-	}
83
-
84
-	spip_log(
85
-		"Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'),
86
-		_LOG_DEBUG
87
-	);
88
-
89
-	return !$ok ? false : [
90
-		'db' => $db,
91
-		'last' => $last,
92
-		'prefixe' => $prefixe ?: $db,
93
-		'link' => $link,
94
-		'total_requetes' => 0,
95
-	];
44
+    if (!extension_loaded(\mysqli::class)) {
45
+        return false;
46
+    }
47
+
48
+    // si port est fourni mais pas host, c'est un socket -> compat avec vieille syntaxe de mysql_connect() et anciens fichiers connect.php
49
+    try {
50
+        if (
51
+            $port and !is_numeric($socket = $port)
52
+            and (!$host or $host === 'localhost')
53
+        ) {
54
+            $link = @mysqli_connect($host, $login, $pass, '', null, $socket);
55
+        } elseif ($port) {
56
+            $link = @mysqli_connect($host, $login, $pass, '', $port);
57
+        } else {
58
+            $link = @mysqli_connect($host, $login, $pass);
59
+        }
60
+    } catch (\mysqli_sql_exception $e) {
61
+        spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
62
+        $link = false;
63
+    }
64
+
65
+    if (!$link) {
66
+        spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS);
67
+
68
+        return false;
69
+    }
70
+    $last = '';
71
+    if (!$db) {
72
+        $ok = $link;
73
+        $db = 'spip';
74
+    } else {
75
+        $ok = mysqli_select_db($link, $db);
76
+        if (
77
+            defined('_MYSQL_SET_SQL_MODE')
78
+            or defined('_MYSQL_SQL_MODE_TEXT_NOT_NULL') // compatibilite
79
+        ) {
80
+            mysqli_query($link, $last = "set sql_mode=''");
81
+        }
82
+    }
83
+
84
+    spip_log(
85
+        "Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'),
86
+        _LOG_DEBUG
87
+    );
88
+
89
+    return !$ok ? false : [
90
+        'db' => $db,
91
+        'last' => $last,
92
+        'prefixe' => $prefixe ?: $db,
93
+        'link' => $link,
94
+        'total_requetes' => 0,
95
+    ];
96 96
 }
97 97
 
98 98
 
99 99
 $GLOBALS['spip_mysql_functions_1'] = [
100
-	'alter' => 'spip_mysql_alter',
101
-	'count' => 'spip_mysql_count',
102
-	'countsel' => 'spip_mysql_countsel',
103
-	'create' => 'spip_mysql_create',
104
-	'create_base' => 'spip_mysql_create_base',
105
-	'create_view' => 'spip_mysql_create_view',
106
-	'date_proche' => 'spip_mysql_date_proche',
107
-	'delete' => 'spip_mysql_delete',
108
-	'drop_table' => 'spip_mysql_drop_table',
109
-	'drop_view' => 'spip_mysql_drop_view',
110
-	'errno' => 'spip_mysql_errno',
111
-	'error' => 'spip_mysql_error',
112
-	'explain' => 'spip_mysql_explain',
113
-	'fetch' => 'spip_mysql_fetch',
114
-	'seek' => 'spip_mysql_seek',
115
-	'free' => 'spip_mysql_free',
116
-	'hex' => 'spip_mysql_hex',
117
-	'in' => 'spip_mysql_in',
118
-	'insert' => 'spip_mysql_insert',
119
-	'insertq' => 'spip_mysql_insertq',
120
-	'insertq_multi' => 'spip_mysql_insertq_multi',
121
-	'listdbs' => 'spip_mysql_listdbs',
122
-	'multi' => 'spip_mysql_multi',
123
-	'optimize' => 'spip_mysql_optimize',
124
-	'query' => 'spip_mysql_query',
125
-	'quote' => 'spip_mysql_quote',
126
-	'replace' => 'spip_mysql_replace',
127
-	'replace_multi' => 'spip_mysql_replace_multi',
128
-	'repair' => 'spip_mysql_repair',
129
-	'select' => 'spip_mysql_select',
130
-	'selectdb' => 'spip_mysql_selectdb',
131
-	'set_charset' => 'spip_mysql_set_charset',
132
-	'get_charset' => 'spip_mysql_get_charset',
133
-	'showbase' => 'spip_mysql_showbase',
134
-	'showtable' => 'spip_mysql_showtable',
135
-	'table_exists' => 'spip_mysql_table_exists',
136
-	'update' => 'spip_mysql_update',
137
-	'updateq' => 'spip_mysql_updateq',
138
-
139
-	// association de chaque nom http d'un charset aux couples MySQL
140
-	'charsets' => [
141
-		'cp1250' => ['charset' => 'cp1250', 'collation' => 'cp1250_general_ci'],
142
-		'cp1251' => ['charset' => 'cp1251', 'collation' => 'cp1251_general_ci'],
143
-		'cp1256' => ['charset' => 'cp1256', 'collation' => 'cp1256_general_ci'],
144
-		'iso-8859-1' => ['charset' => 'latin1', 'collation' => 'latin1_swedish_ci'],
100
+    'alter' => 'spip_mysql_alter',
101
+    'count' => 'spip_mysql_count',
102
+    'countsel' => 'spip_mysql_countsel',
103
+    'create' => 'spip_mysql_create',
104
+    'create_base' => 'spip_mysql_create_base',
105
+    'create_view' => 'spip_mysql_create_view',
106
+    'date_proche' => 'spip_mysql_date_proche',
107
+    'delete' => 'spip_mysql_delete',
108
+    'drop_table' => 'spip_mysql_drop_table',
109
+    'drop_view' => 'spip_mysql_drop_view',
110
+    'errno' => 'spip_mysql_errno',
111
+    'error' => 'spip_mysql_error',
112
+    'explain' => 'spip_mysql_explain',
113
+    'fetch' => 'spip_mysql_fetch',
114
+    'seek' => 'spip_mysql_seek',
115
+    'free' => 'spip_mysql_free',
116
+    'hex' => 'spip_mysql_hex',
117
+    'in' => 'spip_mysql_in',
118
+    'insert' => 'spip_mysql_insert',
119
+    'insertq' => 'spip_mysql_insertq',
120
+    'insertq_multi' => 'spip_mysql_insertq_multi',
121
+    'listdbs' => 'spip_mysql_listdbs',
122
+    'multi' => 'spip_mysql_multi',
123
+    'optimize' => 'spip_mysql_optimize',
124
+    'query' => 'spip_mysql_query',
125
+    'quote' => 'spip_mysql_quote',
126
+    'replace' => 'spip_mysql_replace',
127
+    'replace_multi' => 'spip_mysql_replace_multi',
128
+    'repair' => 'spip_mysql_repair',
129
+    'select' => 'spip_mysql_select',
130
+    'selectdb' => 'spip_mysql_selectdb',
131
+    'set_charset' => 'spip_mysql_set_charset',
132
+    'get_charset' => 'spip_mysql_get_charset',
133
+    'showbase' => 'spip_mysql_showbase',
134
+    'showtable' => 'spip_mysql_showtable',
135
+    'table_exists' => 'spip_mysql_table_exists',
136
+    'update' => 'spip_mysql_update',
137
+    'updateq' => 'spip_mysql_updateq',
138
+
139
+    // association de chaque nom http d'un charset aux couples MySQL
140
+    'charsets' => [
141
+        'cp1250' => ['charset' => 'cp1250', 'collation' => 'cp1250_general_ci'],
142
+        'cp1251' => ['charset' => 'cp1251', 'collation' => 'cp1251_general_ci'],
143
+        'cp1256' => ['charset' => 'cp1256', 'collation' => 'cp1256_general_ci'],
144
+        'iso-8859-1' => ['charset' => 'latin1', 'collation' => 'latin1_swedish_ci'],
145 145
 //'iso-8859-6'=>array('charset'=>'latin1','collation'=>'latin1_swedish_ci'),
146
-		'iso-8859-9' => ['charset' => 'latin5', 'collation' => 'latin5_turkish_ci'],
146
+        'iso-8859-9' => ['charset' => 'latin5', 'collation' => 'latin5_turkish_ci'],
147 147
 //'iso-8859-15'=>array('charset'=>'latin1','collation'=>'latin1_swedish_ci'),
148
-		'utf-8' => ['charset' => 'utf8', 'collation' => 'utf8_general_ci']
149
-	]
148
+        'utf-8' => ['charset' => 'utf8', 'collation' => 'utf8_general_ci']
149
+    ]
150 150
 ];
151 151
 
152 152
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
  * @return Object Information de connexion pour mysqli
158 158
  */
159 159
 function _mysql_link($serveur = '') {
160
-	$link = &$GLOBALS['connexions'][$serveur ?: 0]['link'];
160
+    $link = &$GLOBALS['connexions'][$serveur ?: 0]['link'];
161 161
 
162
-	return $link;
162
+    return $link;
163 163
 }
164 164
 
165 165
 
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
  * @return mysqli_result|bool Jeu de résultats pour fetch()
173 173
  */
174 174
 function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) {
175
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
176
-	spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG);
175
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
176
+    spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG);
177 177
 
178
-	return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset));
178
+    return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset));
179 179
 }
180 180
 
181 181
 
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
  * @return array Description du charset (son nom est dans 'charset')
189 189
  */
190 190
 function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) {
191
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
192
-	$connexion['last'] = $c = 'SHOW CHARACTER SET'
193
-		. (!$charset ? '' : (' LIKE ' . _q($charset['charset'])));
191
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
192
+    $connexion['last'] = $c = 'SHOW CHARACTER SET'
193
+        . (!$charset ? '' : (' LIKE ' . _q($charset['charset'])));
194 194
 
195
-	return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur);
195
+    return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur);
196 196
 }
197 197
 
198 198
 /**
@@ -208,80 +208,80 @@  discard block
 block discarded – undo
208 208
  */
209 209
 function spip_mysql_query($query, $serveur = '', $requeter = true) {
210 210
 
211
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
212
-	$prefixe = $connexion['prefixe'];
213
-	$link = $connexion['link'];
214
-	$db = $connexion['db'];
215
-
216
-	$query = _mysql_traite_query($query, $db, $prefixe);
217
-
218
-	// renvoyer la requete inerte si demandee
219
-	if (!$requeter) {
220
-		return $query;
221
-	}
222
-
223
-	if (isset($_GET['var_profile']) or (defined('_DEBUG_TRACE_QUERIES') and _DEBUG_TRACE_QUERIES)) {
224
-		include_spip('public/tracer');
225
-		$t = trace_query_start();
226
-	} else {
227
-		$t = 0;
228
-	}
229
-
230
-	$connexion['last'] = $query;
231
-	$connexion['total_requetes']++;
232
-
233
-	// ajouter un debug utile dans log/mysql-slow.log ?
234
-	$debug = '';
235
-	if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) {
236
-		if (isset($GLOBALS['debug']['aucasou'])) {
237
-			[, $id, , $infos] = $GLOBALS['debug']['aucasou'];
238
-			$debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | ';
239
-		}
240
-		if (isset($_SERVER['REQUEST_URI'])) {
241
-			$debug .= $_SERVER['REQUEST_URI'];
242
-		}
243
-		if (!empty($GLOBALS['ip'])) {
244
-			$debug .= ' + ' . $GLOBALS['ip'];
245
-		}
246
-		$debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */';
247
-	}
248
-	try {
249
-		$r = mysqli_query($link, $query . $debug);
250
-	} catch (\mysqli_sql_exception $e) {
251
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
252
-		$r = false;
253
-		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
254
-		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
255
-	}
256
-
257
-	//Eviter de propager le GoneAway sur les autres requetes d'un même processus PHP
258
-	if ($e = spip_mysql_errno($serveur)) {  // Log d'un Gone Away
259
-		if ($e == 2006) { //Si Gone Away on relance une connexion vierge
260
-			//Fermer la connexion defaillante
261
-			mysqli_close($connexion['link']);
262
-			unset($GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]);
263
-			//Relancer une connexion vierge
264
-			spip_connect($serveur);
265
-			$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
266
-			$link = $connexion['link'];
267
-			//On retente au cas où
268
-			try {
269
-				$r = mysqli_query($link, $query . $debug);
270
-			} catch (\mysqli_sql_exception $e) {
271
-				spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
272
-				$r = false;
273
-				// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
274
-				// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
275
-			}
276
-		}
277
-	}
278
-
279
-	// Log de l'erreur eventuelle
280
-	if ($e = spip_mysql_errno($serveur)) {
281
-		// et du fautif
282
-		$e .= spip_mysql_error($query, $serveur);
283
-	}
284
-	return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
211
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
212
+    $prefixe = $connexion['prefixe'];
213
+    $link = $connexion['link'];
214
+    $db = $connexion['db'];
215
+
216
+    $query = _mysql_traite_query($query, $db, $prefixe);
217
+
218
+    // renvoyer la requete inerte si demandee
219
+    if (!$requeter) {
220
+        return $query;
221
+    }
222
+
223
+    if (isset($_GET['var_profile']) or (defined('_DEBUG_TRACE_QUERIES') and _DEBUG_TRACE_QUERIES)) {
224
+        include_spip('public/tracer');
225
+        $t = trace_query_start();
226
+    } else {
227
+        $t = 0;
228
+    }
229
+
230
+    $connexion['last'] = $query;
231
+    $connexion['total_requetes']++;
232
+
233
+    // ajouter un debug utile dans log/mysql-slow.log ?
234
+    $debug = '';
235
+    if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) {
236
+        if (isset($GLOBALS['debug']['aucasou'])) {
237
+            [, $id, , $infos] = $GLOBALS['debug']['aucasou'];
238
+            $debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | ';
239
+        }
240
+        if (isset($_SERVER['REQUEST_URI'])) {
241
+            $debug .= $_SERVER['REQUEST_URI'];
242
+        }
243
+        if (!empty($GLOBALS['ip'])) {
244
+            $debug .= ' + ' . $GLOBALS['ip'];
245
+        }
246
+        $debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */';
247
+    }
248
+    try {
249
+        $r = mysqli_query($link, $query . $debug);
250
+    } catch (\mysqli_sql_exception $e) {
251
+        spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
252
+        $r = false;
253
+        // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
254
+        // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
255
+    }
256
+
257
+    //Eviter de propager le GoneAway sur les autres requetes d'un même processus PHP
258
+    if ($e = spip_mysql_errno($serveur)) {  // Log d'un Gone Away
259
+        if ($e == 2006) { //Si Gone Away on relance une connexion vierge
260
+            //Fermer la connexion defaillante
261
+            mysqli_close($connexion['link']);
262
+            unset($GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]);
263
+            //Relancer une connexion vierge
264
+            spip_connect($serveur);
265
+            $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
266
+            $link = $connexion['link'];
267
+            //On retente au cas où
268
+            try {
269
+                $r = mysqli_query($link, $query . $debug);
270
+            } catch (\mysqli_sql_exception $e) {
271
+                spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
272
+                $r = false;
273
+                // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
274
+                // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
275
+            }
276
+        }
277
+    }
278
+
279
+    // Log de l'erreur eventuelle
280
+    if ($e = spip_mysql_errno($serveur)) {
281
+        // et du fautif
282
+        $e .= spip_mysql_error($query, $serveur);
283
+    }
284
+    return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
285 285
 }
286 286
 
287 287
 /**
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
  *     - array  : Tableau décrivant requête et temps d'exécution si var_profile actif pour tracer.
297 297
  */
298 298
 function spip_mysql_alter($query, $serveur = '', $requeter = true) {
299
-	// ici on supprime les ` entourant le nom de table pour permettre
300
-	// la transposition du prefixe, compte tenu que les plugins ont la mauvaise habitude
301
-	// d'utiliser ceux-ci, copie-colle de phpmyadmin
302
-	$query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query);
299
+    // ici on supprime les ` entourant le nom de table pour permettre
300
+    // la transposition du prefixe, compte tenu que les plugins ont la mauvaise habitude
301
+    // d'utiliser ceux-ci, copie-colle de phpmyadmin
302
+    $query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query);
303 303
 
304
-	return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille
304
+    return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille
305 305
 }
306 306
 
307 307
 
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
  * @return bool            Toujours true
315 315
  */
316 316
 function spip_mysql_optimize($table, $serveur = '', $requeter = true) {
317
-	spip_mysql_query('OPTIMIZE TABLE ' . $table);
317
+    spip_mysql_query('OPTIMIZE TABLE ' . $table);
318 318
 
319
-	return true;
319
+    return true;
320 320
 }
321 321
 
322 322
 
@@ -329,18 +329,18 @@  discard block
 block discarded – undo
329 329
  * @return array           Tableau de l'explication
330 330
  */
331 331
 function spip_mysql_explain($query, $serveur = '', $requeter = true) {
332
-	if (strpos(ltrim($query), 'SELECT') !== 0) {
333
-		return [];
334
-	}
335
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
336
-	$prefixe = $connexion['prefixe'];
337
-	$link = $connexion['link'];
338
-	$db = $connexion['db'];
339
-
340
-	$query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe);
341
-	$r = mysqli_query($link, $query);
342
-
343
-	return spip_mysql_fetch($r, null, $serveur);
332
+    if (strpos(ltrim($query), 'SELECT') !== 0) {
333
+        return [];
334
+    }
335
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
336
+    $prefixe = $connexion['prefixe'];
337
+    $link = $connexion['link'];
338
+    $db = $connexion['db'];
339
+
340
+    $query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe);
341
+    $r = mysqli_query($link, $query);
342
+
343
+    return spip_mysql_fetch($r, null, $serveur);
344 344
 }
345 345
 
346 346
 
@@ -369,35 +369,35 @@  discard block
 block discarded – undo
369 369
  *     - array  : Tableau décrivant requête et temps d'exécution si var_profile actif pour tracer.
370 370
  */
371 371
 function spip_mysql_select(
372
-	$select,
373
-	$from,
374
-	$where = '',
375
-	$groupby = '',
376
-	$orderby = '',
377
-	$limit = '',
378
-	$having = '',
379
-	$serveur = '',
380
-	$requeter = true
372
+    $select,
373
+    $from,
374
+    $where = '',
375
+    $groupby = '',
376
+    $orderby = '',
377
+    $limit = '',
378
+    $having = '',
379
+    $serveur = '',
380
+    $requeter = true
381 381
 ) {
382 382
 
383 383
 
384
-	$from = (!is_array($from) ? $from : spip_mysql_select_as($from));
385
-	$query =
386
-		calculer_mysql_expression('SELECT', $select, ', ')
387
-		. calculer_mysql_expression('FROM', $from, ', ')
388
-		. calculer_mysql_expression('WHERE', $where)
389
-		. calculer_mysql_expression('GROUP BY', $groupby, ',')
390
-		. calculer_mysql_expression('HAVING', $having)
391
-		. ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '')
392
-		. ($limit ? "\nLIMIT $limit" : '');
384
+    $from = (!is_array($from) ? $from : spip_mysql_select_as($from));
385
+    $query =
386
+        calculer_mysql_expression('SELECT', $select, ', ')
387
+        . calculer_mysql_expression('FROM', $from, ', ')
388
+        . calculer_mysql_expression('WHERE', $where)
389
+        . calculer_mysql_expression('GROUP BY', $groupby, ',')
390
+        . calculer_mysql_expression('HAVING', $having)
391
+        . ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '')
392
+        . ($limit ? "\nLIMIT $limit" : '');
393 393
 
394
-	// renvoyer la requete inerte si demandee
395
-	if ($requeter === false) {
396
-		return $query;
397
-	}
398
-	$r = spip_mysql_query($query, $serveur, $requeter);
394
+    // renvoyer la requete inerte si demandee
395
+    if ($requeter === false) {
396
+        return $query;
397
+    }
398
+    $r = spip_mysql_query($query, $serveur, $requeter);
399 399
 
400
-	return $r ?: $query;
400
+    return $r ?: $query;
401 401
 }
402 402
 
403 403
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
  * @return string texte du orderby préparé
415 415
  */
416 416
 function spip_mysql_order($orderby) {
417
-	return (is_array($orderby)) ? join(', ', $orderby) : $orderby;
417
+    return (is_array($orderby)) ? join(', ', $orderby) : $orderby;
418 418
 }
419 419
 
420 420
 
@@ -437,26 +437,26 @@  discard block
 block discarded – undo
437 437
  *     Contrainte pour clause WHERE
438 438
  */
439 439
 function calculer_mysql_where($v) {
440
-	if (!is_array($v)) {
441
-		return $v;
442
-	}
443
-
444
-	$op = array_shift($v);
445
-	if (!($n = count($v))) {
446
-		return $op;
447
-	} else {
448
-		$arg = calculer_mysql_where(array_shift($v));
449
-		if ($n == 1) {
450
-			return "$op($arg)";
451
-		} else {
452
-			$arg2 = calculer_mysql_where(array_shift($v));
453
-			if ($n == 2) {
454
-				return "($arg $op $arg2)";
455
-			} else {
456
-				return "($arg $op ($arg2) : $v[0])";
457
-			}
458
-		}
459
-	}
440
+    if (!is_array($v)) {
441
+        return $v;
442
+    }
443
+
444
+    $op = array_shift($v);
445
+    if (!($n = count($v))) {
446
+        return $op;
447
+    } else {
448
+        $arg = calculer_mysql_where(array_shift($v));
449
+        if ($n == 1) {
450
+            return "$op($arg)";
451
+        } else {
452
+            $arg2 = calculer_mysql_where(array_shift($v));
453
+            if ($n == 2) {
454
+                return "($arg $op $arg2)";
455
+            } else {
456
+                return "($arg $op ($arg2) : $v[0])";
457
+            }
458
+        }
459
+    }
460 460
 }
461 461
 
462 462
 /**
@@ -471,21 +471,21 @@  discard block
 block discarded – undo
471 471
  * @return string            texte de l'expression, une partie donc, du texte la requête.
472 472
  */
473 473
 function calculer_mysql_expression($expression, $v, $join = 'AND') {
474
-	if (empty($v)) {
475
-		return '';
476
-	}
477
-
478
-	$exp = "\n$expression ";
479
-
480
-	if (!is_array($v)) {
481
-		return $exp . $v;
482
-	} else {
483
-		if (strtoupper($join) === 'AND') {
484
-			return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v));
485
-		} else {
486
-			return $exp . join($join, $v);
487
-		}
488
-	}
474
+    if (empty($v)) {
475
+        return '';
476
+    }
477
+
478
+    $exp = "\n$expression ";
479
+
480
+    if (!is_array($v)) {
481
+        return $exp . $v;
482
+    } else {
483
+        if (strtoupper($join) === 'AND') {
484
+            return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v));
485
+        } else {
486
+            return $exp . join($join, $v);
487
+        }
488
+    }
489 489
 }
490 490
 
491 491
 
@@ -496,26 +496,26 @@  discard block
 block discarded – undo
496 496
  * @return string Sélection de colonnes pour une clause SELECT
497 497
  */
498 498
 function spip_mysql_select_as($args) {
499
-	$res = '';
500
-	foreach ($args as $k => $v) {
501
-		if (substr($k, -1) == '@') {
502
-			// c'est une jointure qui se refere au from precedent
503
-			// pas de virgule
504
-			$res .= '  ' . $v;
505
-		} else {
506
-			if (!is_numeric($k)) {
507
-				$p = strpos($v, ' ');
508
-				if ($p) {
509
-					$v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p);
510
-				} else {
511
-					$v .= " AS `$k`";
512
-				}
513
-			}
514
-			$res .= ', ' . $v;
515
-		}
516
-	}
517
-
518
-	return substr($res, 2);
499
+    $res = '';
500
+    foreach ($args as $k => $v) {
501
+        if (substr($k, -1) == '@') {
502
+            // c'est une jointure qui se refere au from precedent
503
+            // pas de virgule
504
+            $res .= '  ' . $v;
505
+        } else {
506
+            if (!is_numeric($k)) {
507
+                $p = strpos($v, ' ');
508
+                if ($p) {
509
+                    $v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p);
510
+                } else {
511
+                    $v .= " AS `$k`";
512
+                }
513
+            }
514
+            $res .= ', ' . $v;
515
+        }
516
+    }
517
+
518
+    return substr($res, 2);
519 519
 }
520 520
 
521 521
 
@@ -540,58 +540,58 @@  discard block
 block discarded – undo
540 540
  */
541 541
 function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) {
542 542
 
543
-	if ($GLOBALS['mysql_rappel_nom_base'] and $db) {
544
-		$pref = '`' . $db . '`.';
545
-	} else {
546
-		$pref = '';
547
-	}
548
-
549
-	if ($prefixe) {
550
-		$pref .= $prefixe . '_';
551
-	}
552
-
553
-	if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
554
-		$suite = '';
555
-	} else {
556
-		$suite = strstr($query, (string) $regs[0]);
557
-		$query = substr($query, 0, -strlen($suite));
558
-		// propager le prefixe en cas de requete imbriquee
559
-		// il faut alors echapper les chaine avant de le faire, pour ne pas risquer de
560
-		// modifier une requete qui est en fait juste du texte dans un champ
561
-		if (stripos($suite, 'SELECT') !== false) {
562
-			if ($echappe_textes) {
563
-				[$suite_echap, $textes] = query_echappe_textes($suite);
564
-			}
565
-			else {
566
-				$suite_echap = $suite;
567
-			}
568
-			if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) {
569
-				$suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false);
570
-				if ($echappe_textes) {
571
-					$suite = query_reinjecte_textes($suite_echap, $textes);
572
-				}
573
-				else {
574
-					$suite = $suite_echap;
575
-				}
576
-			}
577
-		}
578
-	}
579
-	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite;
580
-
581
-	// en option, remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
582
-	// remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
583
-	if (
584
-		defined('_MYSQL_NOPLANES')
585
-		and _MYSQL_NOPLANES
586
-		and !empty($GLOBALS['meta']['charset_sql_connexion'])
587
-		and $GLOBALS['meta']['charset_sql_connexion'] == 'utf8'
588
-	) {
589
-		include_spip('inc/charsets');
590
-		$r = utf8_noplanes($r);
591
-	}
592
-
593
-	#spip_log("_mysql_traite_query: " . substr($r,0, 50) . ".... $db, $prefixe", _LOG_DEBUG);
594
-	return $r;
543
+    if ($GLOBALS['mysql_rappel_nom_base'] and $db) {
544
+        $pref = '`' . $db . '`.';
545
+    } else {
546
+        $pref = '';
547
+    }
548
+
549
+    if ($prefixe) {
550
+        $pref .= $prefixe . '_';
551
+    }
552
+
553
+    if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
554
+        $suite = '';
555
+    } else {
556
+        $suite = strstr($query, (string) $regs[0]);
557
+        $query = substr($query, 0, -strlen($suite));
558
+        // propager le prefixe en cas de requete imbriquee
559
+        // il faut alors echapper les chaine avant de le faire, pour ne pas risquer de
560
+        // modifier une requete qui est en fait juste du texte dans un champ
561
+        if (stripos($suite, 'SELECT') !== false) {
562
+            if ($echappe_textes) {
563
+                [$suite_echap, $textes] = query_echappe_textes($suite);
564
+            }
565
+            else {
566
+                $suite_echap = $suite;
567
+            }
568
+            if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) {
569
+                $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false);
570
+                if ($echappe_textes) {
571
+                    $suite = query_reinjecte_textes($suite_echap, $textes);
572
+                }
573
+                else {
574
+                    $suite = $suite_echap;
575
+                }
576
+            }
577
+        }
578
+    }
579
+    $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite;
580
+
581
+    // en option, remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
582
+    // remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
583
+    if (
584
+        defined('_MYSQL_NOPLANES')
585
+        and _MYSQL_NOPLANES
586
+        and !empty($GLOBALS['meta']['charset_sql_connexion'])
587
+        and $GLOBALS['meta']['charset_sql_connexion'] == 'utf8'
588
+    ) {
589
+        include_spip('inc/charsets');
590
+        $r = utf8_noplanes($r);
591
+    }
592
+
593
+    #spip_log("_mysql_traite_query: " . substr($r,0, 50) . ".... $db, $prefixe", _LOG_DEBUG);
594
+    return $r;
595 595
 }
596 596
 
597 597
 /**
@@ -609,17 +609,17 @@  discard block
 block discarded – undo
609 609
  *     - False en cas d'erreur.
610 610
  **/
611 611
 function spip_mysql_selectdb($db, $serveur = '', $requeter = true) {
612
-	$link = _mysql_link($serveur);
613
-	try {
614
-		$ok = mysqli_select_db($link, $db);
615
-	} catch (\mysqli_sql_exception $e) {
616
-		$ok = false;
617
-	}
618
-	if (!$ok) {
619
-		spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE);
620
-	}
621
-
622
-	return $ok;
612
+    $link = _mysql_link($serveur);
613
+    try {
614
+        $ok = mysqli_select_db($link, $db);
615
+    } catch (\mysqli_sql_exception $e) {
616
+        $ok = false;
617
+    }
618
+    if (!$ok) {
619
+        spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE);
620
+    }
621
+
622
+    return $ok;
623 623
 }
624 624
 
625 625
 
@@ -640,14 +640,14 @@  discard block
 block discarded – undo
640 640
  *     Liste de noms de bases de données
641 641
  **/
642 642
 function spip_mysql_listdbs($serveur = '', $requeter = true) {
643
-	$dbs = [];
644
-	if ($res = spip_mysql_query('SHOW DATABASES', $serveur)) {
645
-		while ($row = mysqli_fetch_assoc($res)) {
646
-			$dbs[] = $row['Database'];
647
-		}
648
-	}
649
-
650
-	return $dbs;
643
+    $dbs = [];
644
+    if ($res = spip_mysql_query('SHOW DATABASES', $serveur)) {
645
+        while ($row = mysqli_fetch_assoc($res)) {
646
+            $dbs[] = $row['Database'];
647
+        }
648
+    }
649
+
650
+    return $dbs;
651 651
 }
652 652
 
653 653
 
@@ -670,73 +670,73 @@  discard block
 block discarded – undo
670 670
  *     - true si la requête réussie, false sinon.
671 671
  */
672 672
 function spip_mysql_create(
673
-	$nom,
674
-	$champs,
675
-	$cles,
676
-	$autoinc = false,
677
-	$temporary = false,
678
-	$serveur = '',
679
-	$requeter = true
673
+    $nom,
674
+    $champs,
675
+    $cles,
676
+    $autoinc = false,
677
+    $temporary = false,
678
+    $serveur = '',
679
+    $requeter = true
680 680
 ) {
681 681
 
682
-	$query = '';
683
-	$keys = '';
684
-	$s = '';
685
-	$p = '';
686
-
687
-	// certains plugins declarent les tables  (permet leur inclusion dans le dump)
688
-	// sans les renseigner (laisse le compilo recuperer la description)
689
-	if (!is_array($champs) || !is_array($cles)) {
690
-		return;
691
-	}
692
-
693
-	$res = spip_mysql_query('SELECT version() as v', $serveur);
694
-	if (($row = mysqli_fetch_array($res)) && (version_compare($row['v'], '5.0', '>='))) {
695
-		spip_mysql_query("SET sql_mode=''", $serveur);
696
-	}
697
-
698
-	foreach ($cles as $k => $v) {
699
-		$keys .= "$s\n\t\t$k ($v)";
700
-		if ($k == 'PRIMARY KEY') {
701
-			$p = $v;
702
-		}
703
-		$s = ',';
704
-	}
705
-	$s = '';
706
-
707
-	$character_set = '';
708
-	if (@$GLOBALS['meta']['charset_sql_base']) {
709
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
710
-	}
711
-	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
712
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
713
-	}
714
-
715
-	foreach ($champs as $k => $v) {
716
-		$v = _mysql_remplacements_definitions_table($v);
717
-		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
718
-			if (
719
-				preg_match(',(char|text),i', $defs[1])
720
-				and !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
721
-			) {
722
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
723
-			}
724
-		}
725
-
726
-		$query .= "$s\n\t\t$k $v"
727
-			. (($autoinc && ($p == $k) && preg_match(',\b(big|small|medium)?int\b,i', $v))
728
-				? ' auto_increment'
729
-				: ''
730
-			);
731
-		$s = ',';
732
-	}
733
-	$temporary = $temporary ? 'TEMPORARY' : '';
734
-	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')'
735
-		. (defined('_MYSQL_ENGINE') ? ' ENGINE=' . _MYSQL_ENGINE : '')
736
-		. ($character_set ? " DEFAULT $character_set" : '')
737
-		. "\n";
738
-
739
-	return spip_mysql_query($q, $serveur);
682
+    $query = '';
683
+    $keys = '';
684
+    $s = '';
685
+    $p = '';
686
+
687
+    // certains plugins declarent les tables  (permet leur inclusion dans le dump)
688
+    // sans les renseigner (laisse le compilo recuperer la description)
689
+    if (!is_array($champs) || !is_array($cles)) {
690
+        return;
691
+    }
692
+
693
+    $res = spip_mysql_query('SELECT version() as v', $serveur);
694
+    if (($row = mysqli_fetch_array($res)) && (version_compare($row['v'], '5.0', '>='))) {
695
+        spip_mysql_query("SET sql_mode=''", $serveur);
696
+    }
697
+
698
+    foreach ($cles as $k => $v) {
699
+        $keys .= "$s\n\t\t$k ($v)";
700
+        if ($k == 'PRIMARY KEY') {
701
+            $p = $v;
702
+        }
703
+        $s = ',';
704
+    }
705
+    $s = '';
706
+
707
+    $character_set = '';
708
+    if (@$GLOBALS['meta']['charset_sql_base']) {
709
+        $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
710
+    }
711
+    if (@$GLOBALS['meta']['charset_collation_sql_base']) {
712
+        $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
713
+    }
714
+
715
+    foreach ($champs as $k => $v) {
716
+        $v = _mysql_remplacements_definitions_table($v);
717
+        if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
718
+            if (
719
+                preg_match(',(char|text),i', $defs[1])
720
+                and !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
721
+            ) {
722
+                $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
723
+            }
724
+        }
725
+
726
+        $query .= "$s\n\t\t$k $v"
727
+            . (($autoinc && ($p == $k) && preg_match(',\b(big|small|medium)?int\b,i', $v))
728
+                ? ' auto_increment'
729
+                : ''
730
+            );
731
+        $s = ',';
732
+    }
733
+    $temporary = $temporary ? 'TEMPORARY' : '';
734
+    $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')'
735
+        . (defined('_MYSQL_ENGINE') ? ' ENGINE=' . _MYSQL_ENGINE : '')
736
+        . ($character_set ? " DEFAULT $character_set" : '')
737
+        . "\n";
738
+
739
+    return spip_mysql_query($q, $serveur);
740 740
 }
741 741
 
742 742
 
@@ -749,25 +749,25 @@  discard block
 block discarded – undo
749 749
  *     Définition SQL adaptée pour MySQL d'un champ de table
750 750
  */
751 751
 function _mysql_remplacements_definitions_table($query) {
752
-	// quelques remplacements
753
-	$num = '(\s*\([0-9]*\))?';
754
-	$enum = '(\s*\([^\)]*\))?';
755
-
756
-	$remplace = [
757
-		'/VARCHAR(\s*[^\s\(])/is' => 'VARCHAR(255)\\1',
758
-		'/^TIMESTAMP($| NULL DEFAULT NULL)/is' => 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
759
-	];
760
-
761
-	if (is_string($query)) {
762
-		$query = preg_replace(array_keys($remplace), $remplace, $query);
763
-	} elseif (is_array($query)) {
764
-		$keys = array_keys($remplace);
765
-		foreach ($query as $k => $q) {
766
-			$query[$k] = preg_replace($keys, $remplace, $q);
767
-		}
768
-	}
769
-
770
-	return $query;
752
+    // quelques remplacements
753
+    $num = '(\s*\([0-9]*\))?';
754
+    $enum = '(\s*\([^\)]*\))?';
755
+
756
+    $remplace = [
757
+        '/VARCHAR(\s*[^\s\(])/is' => 'VARCHAR(255)\\1',
758
+        '/^TIMESTAMP($| NULL DEFAULT NULL)/is' => 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
759
+    ];
760
+
761
+    if (is_string($query)) {
762
+        $query = preg_replace(array_keys($remplace), $remplace, $query);
763
+    } elseif (is_array($query)) {
764
+        $keys = array_keys($remplace);
765
+        foreach ($query as $k => $q) {
766
+            $query[$k] = preg_replace($keys, $remplace, $q);
767
+        }
768
+    }
769
+
770
+    return $query;
771 771
 }
772 772
 
773 773
 
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
  * @return bool true si la base est créee.
781 781
  **/
782 782
 function spip_mysql_create_base($nom, $serveur = '', $requeter = true) {
783
-	return spip_mysql_query("CREATE DATABASE `$nom`", $serveur, $requeter);
783
+    return spip_mysql_query("CREATE DATABASE `$nom`", $serveur, $requeter);
784 784
 }
785 785
 
786 786
 
@@ -801,19 +801,19 @@  discard block
 block discarded – undo
801 801
  *     - string texte de la requête si $requeter vaut false
802 802
  */
803 803
 function spip_mysql_create_view($nom, $query_select, $serveur = '', $requeter = true) {
804
-	if (!$query_select) {
805
-		return false;
806
-	}
807
-	// vue deja presente
808
-	if (sql_showtable($nom, false, $serveur)) {
809
-		spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", _LOG_ERREUR);
804
+    if (!$query_select) {
805
+        return false;
806
+    }
807
+    // vue deja presente
808
+    if (sql_showtable($nom, false, $serveur)) {
809
+        spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", _LOG_ERREUR);
810 810
 
811
-		return false;
812
-	}
811
+        return false;
812
+    }
813 813
 
814
-	$query = "CREATE VIEW $nom AS " . $query_select;
814
+    $query = "CREATE VIEW $nom AS " . $query_select;
815 815
 
816
-	return spip_mysql_query($query, $serveur, $requeter);
816
+    return spip_mysql_query($query, $serveur, $requeter);
817 817
 }
818 818
 
819 819
 
@@ -829,11 +829,11 @@  discard block
 block discarded – undo
829 829
  *     - true si la requête a réussie, false sinon
830 830
  */
831 831
 function spip_mysql_drop_table($table, $exist = '', $serveur = '', $requeter = true) {
832
-	if ($exist) {
833
-		$exist = ' IF EXISTS';
834
-	}
832
+    if ($exist) {
833
+        $exist = ' IF EXISTS';
834
+    }
835 835
 
836
-	return spip_mysql_query("DROP TABLE$exist $table", $serveur, $requeter);
836
+    return spip_mysql_query("DROP TABLE$exist $table", $serveur, $requeter);
837 837
 }
838 838
 
839 839
 /**
@@ -848,11 +848,11 @@  discard block
 block discarded – undo
848 848
  *     - true si la requête a réussie, false sinon
849 849
  */
850 850
 function spip_mysql_drop_view($view, $exist = '', $serveur = '', $requeter = true) {
851
-	if ($exist) {
852
-		$exist = ' IF EXISTS';
853
-	}
851
+    if ($exist) {
852
+        $exist = ' IF EXISTS';
853
+    }
854 854
 
855
-	return spip_mysql_query("DROP VIEW$exist $view", $serveur, $requeter);
855
+    return spip_mysql_query("DROP VIEW$exist $view", $serveur, $requeter);
856 856
 }
857 857
 
858 858
 /**
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
  *     Ressource à utiliser avec sql_fetch()
870 870
  **/
871 871
 function spip_mysql_showbase($match, $serveur = '', $requeter = true) {
872
-	return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter);
872
+    return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter);
873 873
 }
874 874
 
875 875
 /**
@@ -885,18 +885,18 @@  discard block
 block discarded – undo
885 885
  *     - true si la requête a réussie, false sinon
886 886
  */
887 887
 function spip_mysql_repair($table, $serveur = '', $requeter = true) {
888
-	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true));
889
-	$engine = $table_status['Engine'];
890
-	if ($engine == 'InnoDB') {
891
-		if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) {
892
-			return [' OK '];
893
-		}
894
-	} elseif ($engine == 'MyISAM') {
895
-		return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter);
896
-	} else {
897
-		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG);
898
-	}
899
-	return false;
888
+    $table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true));
889
+    $engine = $table_status['Engine'];
890
+    if ($engine == 'InnoDB') {
891
+        if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) {
892
+            return [' OK '];
893
+        }
894
+    } elseif ($engine == 'MyISAM') {
895
+        return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter);
896
+    } else {
897
+        spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG);
898
+    }
899
+    return false;
900 900
 }
901 901
 
902 902
 /**
@@ -914,12 +914,12 @@  discard block
 block discarded – undo
914 914
  *     - string : requete sql, si $requeter = true
915 915
  **/
916 916
 function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) {
917
-	$r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter);
918
-	if (!$requeter) {
919
-		return $r;
920
-	}
921
-	$res = spip_mysql_fetch($r);
922
-	return (bool) $res;
917
+    $r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter);
918
+    if (!$requeter) {
919
+        return $r;
920
+    }
921
+    $res = spip_mysql_fetch($r);
922
+    return (bool) $res;
923 923
 }
924 924
 
925 925
 define('_MYSQL_RE_SHOW_TABLE', '/^[^(),]*\(((?:[^()]*\((?:[^()]*\([^()]*\))?[^()]*\)[^()]*)*[^()]*)\)[^()]*$/');
@@ -942,86 +942,86 @@  discard block
 block discarded – undo
942 942
  *     - array description de la table sinon
943 943
  */
944 944
 function spip_mysql_showtable($nom_table, $serveur = '', $requeter = true) {
945
-	$s = spip_mysql_query("SHOW CREATE TABLE `$nom_table`", $serveur, $requeter);
946
-	if (!$s) {
947
-		return '';
948
-	}
949
-	if (!$requeter) {
950
-		return $s;
951
-	}
952
-
953
-	[, $a] = mysqli_fetch_array($s, MYSQLI_NUM);
954
-	if (preg_match(_MYSQL_RE_SHOW_TABLE, $a, $r)) {
955
-		$desc = $r[1];
956
-		// extraction d'une KEY éventuelle en prenant garde de ne pas
957
-		// relever un champ dont le nom contient KEY (ex. ID_WHISKEY)
958
-		if (preg_match('/^(.*?),([^,]*\sKEY[ (].*)$/s', $desc, $r)) {
959
-			$namedkeys = $r[2];
960
-			$desc = $r[1];
961
-		} else {
962
-			$namedkeys = '';
963
-		}
964
-
965
-		$fields = [];
966
-		foreach (preg_split('/,\s*`/', $desc) as $v) {
967
-			preg_match('/^\s*`?([^`]*)`\s*(.*)/', $v, $r);
968
-			$fields[strtolower($r[1])] = $r[2];
969
-		}
970
-		$keys = [];
971
-
972
-		foreach (preg_split('/\)\s*(,|$)/', $namedkeys) as $v) {
973
-			if (preg_match('/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/', $v, $r)) {
974
-				$k = str_replace('`', '', trim($r[1]));
975
-				$t = strtolower(str_replace('`', '', $r[2]));
976
-				if ($k && !isset($keys[$k])) {
977
-					$keys[$k] = $t;
978
-				} else {
979
-					$keys[] = $t;
980
-				}
981
-			}
982
-		}
983
-		spip_mysql_free($s);
984
-
985
-		return ['field' => $fields, 'key' => $keys];
986
-	}
987
-
988
-	$res = spip_mysql_query("SHOW COLUMNS FROM `$nom_table`", $serveur);
989
-	if ($res) {
990
-		$nfields = [];
991
-		$nkeys = [];
992
-		while ($val = spip_mysql_fetch($res)) {
993
-			$nfields[$val['Field']] = $val['Type'];
994
-			if ($val['Null'] == 'NO') {
995
-				$nfields[$val['Field']] .= ' NOT NULL';
996
-			}
997
-			if ($val['Default'] === '0' || $val['Default']) {
998
-				if (preg_match('/[A-Z_]/', $val['Default'])) {
999
-					$nfields[$val['Field']] .= ' DEFAULT ' . $val['Default'];
1000
-				} else {
1001
-					$nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'";
1002
-				}
1003
-			}
1004
-			if ($val['Extra']) {
1005
-				$nfields[$val['Field']] .= ' ' . $val['Extra'];
1006
-			}
1007
-			if ($val['Key'] == 'PRI') {
1008
-				$nkeys['PRIMARY KEY'] = $val['Field'];
1009
-			} else {
1010
-				if ($val['Key'] == 'MUL') {
1011
-					$nkeys['KEY ' . $val['Field']] = $val['Field'];
1012
-				} else {
1013
-					if ($val['Key'] == 'UNI') {
1014
-						$nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field'];
1015
-					}
1016
-				}
1017
-			}
1018
-		}
1019
-		spip_mysql_free($res);
1020
-
1021
-		return ['field' => $nfields, 'key' => $nkeys];
1022
-	}
1023
-
1024
-	return '';
945
+    $s = spip_mysql_query("SHOW CREATE TABLE `$nom_table`", $serveur, $requeter);
946
+    if (!$s) {
947
+        return '';
948
+    }
949
+    if (!$requeter) {
950
+        return $s;
951
+    }
952
+
953
+    [, $a] = mysqli_fetch_array($s, MYSQLI_NUM);
954
+    if (preg_match(_MYSQL_RE_SHOW_TABLE, $a, $r)) {
955
+        $desc = $r[1];
956
+        // extraction d'une KEY éventuelle en prenant garde de ne pas
957
+        // relever un champ dont le nom contient KEY (ex. ID_WHISKEY)
958
+        if (preg_match('/^(.*?),([^,]*\sKEY[ (].*)$/s', $desc, $r)) {
959
+            $namedkeys = $r[2];
960
+            $desc = $r[1];
961
+        } else {
962
+            $namedkeys = '';
963
+        }
964
+
965
+        $fields = [];
966
+        foreach (preg_split('/,\s*`/', $desc) as $v) {
967
+            preg_match('/^\s*`?([^`]*)`\s*(.*)/', $v, $r);
968
+            $fields[strtolower($r[1])] = $r[2];
969
+        }
970
+        $keys = [];
971
+
972
+        foreach (preg_split('/\)\s*(,|$)/', $namedkeys) as $v) {
973
+            if (preg_match('/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/', $v, $r)) {
974
+                $k = str_replace('`', '', trim($r[1]));
975
+                $t = strtolower(str_replace('`', '', $r[2]));
976
+                if ($k && !isset($keys[$k])) {
977
+                    $keys[$k] = $t;
978
+                } else {
979
+                    $keys[] = $t;
980
+                }
981
+            }
982
+        }
983
+        spip_mysql_free($s);
984
+
985
+        return ['field' => $fields, 'key' => $keys];
986
+    }
987
+
988
+    $res = spip_mysql_query("SHOW COLUMNS FROM `$nom_table`", $serveur);
989
+    if ($res) {
990
+        $nfields = [];
991
+        $nkeys = [];
992
+        while ($val = spip_mysql_fetch($res)) {
993
+            $nfields[$val['Field']] = $val['Type'];
994
+            if ($val['Null'] == 'NO') {
995
+                $nfields[$val['Field']] .= ' NOT NULL';
996
+            }
997
+            if ($val['Default'] === '0' || $val['Default']) {
998
+                if (preg_match('/[A-Z_]/', $val['Default'])) {
999
+                    $nfields[$val['Field']] .= ' DEFAULT ' . $val['Default'];
1000
+                } else {
1001
+                    $nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'";
1002
+                }
1003
+            }
1004
+            if ($val['Extra']) {
1005
+                $nfields[$val['Field']] .= ' ' . $val['Extra'];
1006
+            }
1007
+            if ($val['Key'] == 'PRI') {
1008
+                $nkeys['PRIMARY KEY'] = $val['Field'];
1009
+            } else {
1010
+                if ($val['Key'] == 'MUL') {
1011
+                    $nkeys['KEY ' . $val['Field']] = $val['Field'];
1012
+                } else {
1013
+                    if ($val['Key'] == 'UNI') {
1014
+                        $nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field'];
1015
+                    }
1016
+                }
1017
+            }
1018
+        }
1019
+        spip_mysql_free($res);
1020
+
1021
+        return ['field' => $nfields, 'key' => $nkeys];
1022
+    }
1023
+
1024
+    return '';
1025 1025
 }
1026 1026
 
1027 1027
 
@@ -1040,13 +1040,13 @@  discard block
 block discarded – undo
1040 1040
  *     - false Erreur
1041 1041
  */
1042 1042
 function spip_mysql_fetch($r, $t = '', $serveur = '', $requeter = true) {
1043
-	if (!$t) {
1044
-		$t = \MYSQLI_ASSOC;
1045
-	}
1046
-	if ($r) {
1047
-		return mysqli_fetch_array($r, $t);
1048
-	}
1049
-	return false;
1043
+    if (!$t) {
1044
+        $t = \MYSQLI_ASSOC;
1045
+    }
1046
+    if ($r) {
1047
+        return mysqli_fetch_array($r, $t);
1048
+    }
1049
+    return false;
1050 1050
 }
1051 1051
 
1052 1052
 /**
@@ -1059,10 +1059,10 @@  discard block
 block discarded – undo
1059 1059
  * @return bool True si déplacement réussi, false sinon.
1060 1060
  **/
1061 1061
 function spip_mysql_seek($r, $row_number, $serveur = '', $requeter = true) {
1062
-	if ($r and mysqli_num_rows($r)) {
1063
-		return mysqli_data_seek($r, $row_number);
1064
-	}
1065
-	return false;
1062
+    if ($r and mysqli_num_rows($r)) {
1063
+        return mysqli_data_seek($r, $row_number);
1064
+    }
1065
+    return false;
1066 1066
 }
1067 1067
 
1068 1068
 
@@ -1080,26 +1080,26 @@  discard block
 block discarded – undo
1080 1080
  *     - int Nombre de lignes (0 si la requête n'a pas réussie)
1081 1081
  **/
1082 1082
 function spip_mysql_countsel(
1083
-	$from = [],
1084
-	$where = [],
1085
-	$groupby = '',
1086
-	$having = [],
1087
-	$serveur = '',
1088
-	$requeter = true
1083
+    $from = [],
1084
+    $where = [],
1085
+    $groupby = '',
1086
+    $having = [],
1087
+    $serveur = '',
1088
+    $requeter = true
1089 1089
 ) {
1090
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1091
-
1092
-	$r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1093
-	if (!$requeter) {
1094
-		return $r;
1095
-	}
1096
-	if (!$r instanceof mysqli_result) {
1097
-		return 0;
1098
-	}
1099
-	[$c] = mysqli_fetch_array($r, MYSQLI_NUM);
1100
-	mysqli_free_result($r);
1101
-
1102
-	return intval($c);
1090
+    $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1091
+
1092
+    $r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1093
+    if (!$requeter) {
1094
+        return $r;
1095
+    }
1096
+    if (!$r instanceof mysqli_result) {
1097
+        return 0;
1098
+    }
1099
+    [$c] = mysqli_fetch_array($r, MYSQLI_NUM);
1100
+    mysqli_free_result($r);
1101
+
1102
+    return intval($c);
1103 1103
 }
1104 1104
 
1105 1105
 
@@ -1122,16 +1122,16 @@  discard block
 block discarded – undo
1122 1122
  *     Erreur eventuelle
1123 1123
  **/
1124 1124
 function spip_mysql_error($query = '', $serveur = '', $requeter = true) {
1125
-	$link = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]['link'];
1126
-	$s = mysqli_error($link);
1127
-	if ($s) {
1128
-		$trace = debug_backtrace();
1129
-		if ($trace[0]['function'] != 'spip_mysql_error') {
1130
-			spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1131
-		}
1132
-	}
1133
-
1134
-	return $s;
1125
+    $link = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]['link'];
1126
+    $s = mysqli_error($link);
1127
+    if ($s) {
1128
+        $trace = debug_backtrace();
1129
+        if ($trace[0]['function'] != 'spip_mysql_error') {
1130
+            spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1131
+        }
1132
+    }
1133
+
1134
+    return $s;
1135 1135
 }
1136 1136
 
1137 1137
 
@@ -1146,18 +1146,18 @@  discard block
 block discarded – undo
1146 1146
  *     0, pas d'erreur. Autre, numéro de l'erreur.
1147 1147
  **/
1148 1148
 function spip_mysql_errno($serveur = '', $requeter = true) {
1149
-	$link = $GLOBALS['connexions'][$serveur ?: 0]['link'];
1150
-	$s = mysqli_errno($link);
1151
-	// 2006 MySQL server has gone away
1152
-	// 2013 Lost connection to MySQL server during query
1153
-	if (in_array($s, [2006, 2013])) {
1154
-		define('spip_interdire_cache', true);
1155
-	}
1156
-	if ($s) {
1157
-		spip_log("Erreur mysql $s", _LOG_ERREUR);
1158
-	}
1159
-
1160
-	return $s;
1149
+    $link = $GLOBALS['connexions'][$serveur ?: 0]['link'];
1150
+    $s = mysqli_errno($link);
1151
+    // 2006 MySQL server has gone away
1152
+    // 2013 Lost connection to MySQL server during query
1153
+    if (in_array($s, [2006, 2013])) {
1154
+        define('spip_interdire_cache', true);
1155
+    }
1156
+    if ($s) {
1157
+        spip_log("Erreur mysql $s", _LOG_ERREUR);
1158
+    }
1159
+
1160
+    return $s;
1161 1161
 }
1162 1162
 
1163 1163
 
@@ -1171,9 +1171,9 @@  discard block
 block discarded – undo
1171 1171
  * @return int               Nombre de lignes
1172 1172
  */
1173 1173
 function spip_mysql_count($r, $serveur = '', $requeter = true) {
1174
-	if ($r) {
1175
-		return mysqli_num_rows($r);
1176
-	}
1174
+    if ($r) {
1175
+        return mysqli_num_rows($r);
1176
+    }
1177 1177
 }
1178 1178
 
1179 1179
 
@@ -1189,11 +1189,11 @@  discard block
 block discarded – undo
1189 1189
  * @return bool              True si réussi
1190 1190
  */
1191 1191
 function spip_mysql_free($r, $serveur = '', $requeter = true) {
1192
-	if ($r instanceof mysqli_result) {
1193
-		mysqli_free_result($r);
1194
-		return true;
1195
-	}
1196
-	return false;
1192
+    if ($r instanceof mysqli_result) {
1193
+        mysqli_free_result($r);
1194
+        return true;
1195
+    }
1196
+    return false;
1197 1197
 }
1198 1198
 
1199 1199
 
@@ -1221,59 +1221,59 @@  discard block
 block discarded – undo
1221 1221
  **/
1222 1222
 function spip_mysql_insert($table, $champs, $valeurs, $desc = [], $serveur = '', $requeter = true) {
1223 1223
 
1224
-	$e = null;
1225
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1226
-	$link = $connexion['link'];
1227
-	$table = prefixer_table_spip($table, $connexion['prefixe']);
1228
-
1229
-	// remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
1230
-	if (
1231
-		defined('_MYSQL_NOPLANES')
1232
-		and _MYSQL_NOPLANES
1233
-		and !empty($GLOBALS['meta']['charset_sql_connexion'])
1234
-		and $GLOBALS['meta']['charset_sql_connexion'] == 'utf8'
1235
-	) {
1236
-		include_spip('inc/charsets');
1237
-		$valeurs = utf8_noplanes($valeurs);
1238
-	}
1239
-
1240
-	$query = "INSERT INTO $table $champs VALUES $valeurs";
1241
-	if (!$requeter) {
1242
-		return $query;
1243
-	}
1244
-
1245
-	if (isset($_GET['var_profile'])) {
1246
-		include_spip('public/tracer');
1247
-		$t = trace_query_start();
1248
-		$e = '';
1249
-	} else {
1250
-		$t = 0;
1251
-	}
1252
-
1253
-	$connexion['last'] = $query;
1254
-	#spip_log($query, 'mysql.'._LOG_DEBUG);
1255
-	$r = false;
1256
-	$insert = false;
1257
-	try {
1258
-		$insert = mysqli_query($link, $query);
1259
-	} catch (\mysqli_sql_exception $e) {
1260
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
1261
-		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
1262
-		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
1263
-	}
1264
-	if ($insert) {
1265
-		$r = mysqli_insert_id($link);
1266
-	} else {
1267
-		// Log de l'erreur eventuelle
1268
-		if ($e = spip_mysql_errno($serveur)) {
1269
-			// et du fautif
1270
-			$e .= spip_mysql_error($query, $serveur);
1271
-		}
1272
-	}
1273
-
1274
-	return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
1275
-
1276
-	// return $r ? $r : (($r===0) ? -1 : 0); pb avec le multi-base.
1224
+    $e = null;
1225
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1226
+    $link = $connexion['link'];
1227
+    $table = prefixer_table_spip($table, $connexion['prefixe']);
1228
+
1229
+    // remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
1230
+    if (
1231
+        defined('_MYSQL_NOPLANES')
1232
+        and _MYSQL_NOPLANES
1233
+        and !empty($GLOBALS['meta']['charset_sql_connexion'])
1234
+        and $GLOBALS['meta']['charset_sql_connexion'] == 'utf8'
1235
+    ) {
1236
+        include_spip('inc/charsets');
1237
+        $valeurs = utf8_noplanes($valeurs);
1238
+    }
1239
+
1240
+    $query = "INSERT INTO $table $champs VALUES $valeurs";
1241
+    if (!$requeter) {
1242
+        return $query;
1243
+    }
1244
+
1245
+    if (isset($_GET['var_profile'])) {
1246
+        include_spip('public/tracer');
1247
+        $t = trace_query_start();
1248
+        $e = '';
1249
+    } else {
1250
+        $t = 0;
1251
+    }
1252
+
1253
+    $connexion['last'] = $query;
1254
+    #spip_log($query, 'mysql.'._LOG_DEBUG);
1255
+    $r = false;
1256
+    $insert = false;
1257
+    try {
1258
+        $insert = mysqli_query($link, $query);
1259
+    } catch (\mysqli_sql_exception $e) {
1260
+        spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
1261
+        // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
1262
+        // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
1263
+    }
1264
+    if ($insert) {
1265
+        $r = mysqli_insert_id($link);
1266
+    } else {
1267
+        // Log de l'erreur eventuelle
1268
+        if ($e = spip_mysql_errno($serveur)) {
1269
+            // et du fautif
1270
+            $e .= spip_mysql_error($query, $serveur);
1271
+        }
1272
+    }
1273
+
1274
+    return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
1275
+
1276
+    // return $r ? $r : (($r===0) ? -1 : 0); pb avec le multi-base.
1277 1277
 }
1278 1278
 
1279 1279
 /**
@@ -1298,26 +1298,26 @@  discard block
 block discarded – undo
1298 1298
  **/
1299 1299
 function spip_mysql_insertq($table, $couples = [], $desc = [], $serveur = '', $requeter = true) {
1300 1300
 
1301
-	if (!$desc) {
1302
-		$desc = description_table($table, $serveur);
1303
-	}
1304
-	if (!$desc) {
1305
-		$couples = [];
1306
-	}
1307
-	$fields = $desc['field'] ?? [];
1308
-
1309
-	foreach ($couples as $champ => $val) {
1310
-		$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1311
-	}
1312
-
1313
-	return spip_mysql_insert(
1314
-		$table,
1315
-		'(' . join(',', array_keys($couples)) . ')',
1316
-		'(' . join(',', $couples) . ')',
1317
-		$desc,
1318
-		$serveur,
1319
-		$requeter
1320
-	);
1301
+    if (!$desc) {
1302
+        $desc = description_table($table, $serveur);
1303
+    }
1304
+    if (!$desc) {
1305
+        $couples = [];
1306
+    }
1307
+    $fields = $desc['field'] ?? [];
1308
+
1309
+    foreach ($couples as $champ => $val) {
1310
+        $couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1311
+    }
1312
+
1313
+    return spip_mysql_insert(
1314
+        $table,
1315
+        '(' . join(',', array_keys($couples)) . ')',
1316
+        '(' . join(',', $couples) . ')',
1317
+        $desc,
1318
+        $serveur,
1319
+        $requeter
1320
+    );
1321 1321
 }
1322 1322
 
1323 1323
 
@@ -1342,34 +1342,34 @@  discard block
 block discarded – undo
1342 1342
  **/
1343 1343
 function spip_mysql_insertq_multi($table, $tab_couples = [], $desc = [], $serveur = '', $requeter = true) {
1344 1344
 
1345
-	if (!$desc) {
1346
-		$desc = description_table($table, $serveur);
1347
-	}
1348
-	if (!$desc) {
1349
-		$tab_couples = [];
1350
-	}
1351
-	$fields = $desc['field'] ?? [];
1352
-
1353
-	$cles = '(' . join(',', array_keys(reset($tab_couples))) . ')';
1354
-	$valeurs = [];
1355
-	$r = false;
1356
-
1357
-	// Quoter et Inserer par groupes de 100 max pour eviter un debordement de pile
1358
-	foreach ($tab_couples as $couples) {
1359
-		foreach ($couples as $champ => $val) {
1360
-			$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1361
-		}
1362
-		$valeurs[] = '(' . join(',', $couples) . ')';
1363
-		if (count($valeurs) >= 100) {
1364
-			$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1365
-			$valeurs = [];
1366
-		}
1367
-	}
1368
-	if (count($valeurs)) {
1369
-		$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1370
-	}
1371
-
1372
-	return $r; // dans le cas d'une table auto_increment, le dernier insert_id
1345
+    if (!$desc) {
1346
+        $desc = description_table($table, $serveur);
1347
+    }
1348
+    if (!$desc) {
1349
+        $tab_couples = [];
1350
+    }
1351
+    $fields = $desc['field'] ?? [];
1352
+
1353
+    $cles = '(' . join(',', array_keys(reset($tab_couples))) . ')';
1354
+    $valeurs = [];
1355
+    $r = false;
1356
+
1357
+    // Quoter et Inserer par groupes de 100 max pour eviter un debordement de pile
1358
+    foreach ($tab_couples as $couples) {
1359
+        foreach ($couples as $champ => $val) {
1360
+            $couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1361
+        }
1362
+        $valeurs[] = '(' . join(',', $couples) . ')';
1363
+        if (count($valeurs) >= 100) {
1364
+            $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1365
+            $valeurs = [];
1366
+        }
1367
+    }
1368
+    if (count($valeurs)) {
1369
+        $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1370
+    }
1371
+
1372
+    return $r; // dans le cas d'une table auto_increment, le dernier insert_id
1373 1373
 }
1374 1374
 
1375 1375
 /**
@@ -1394,20 +1394,20 @@  discard block
 block discarded – undo
1394 1394
  *     - array Tableau décrivant la requête et son temps d'exécution si var_profile est actif
1395 1395
  */
1396 1396
 function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) {
1397
-	$set = [];
1398
-	foreach ($champs as $champ => $val) {
1399
-		$set[] = $champ . "=$val";
1400
-	}
1401
-	if (!empty($set)) {
1402
-		return spip_mysql_query(
1403
-			calculer_mysql_expression('UPDATE', $table, ',')
1404
-			. calculer_mysql_expression('SET', $set, ',')
1405
-			. calculer_mysql_expression('WHERE', $where),
1406
-			$serveur,
1407
-			$requeter
1408
-		);
1409
-	}
1410
-	return false;
1397
+    $set = [];
1398
+    foreach ($champs as $champ => $val) {
1399
+        $set[] = $champ . "=$val";
1400
+    }
1401
+    if (!empty($set)) {
1402
+        return spip_mysql_query(
1403
+            calculer_mysql_expression('UPDATE', $table, ',')
1404
+            . calculer_mysql_expression('SET', $set, ',')
1405
+            . calculer_mysql_expression('WHERE', $where),
1406
+            $serveur,
1407
+            $requeter
1408
+        );
1409
+    }
1410
+    return false;
1411 1411
 }
1412 1412
 
1413 1413
 /**
@@ -1440,29 +1440,29 @@  discard block
 block discarded – undo
1440 1440
  */
1441 1441
 function spip_mysql_updateq($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) {
1442 1442
 
1443
-	if (!$champs) {
1444
-		return;
1445
-	}
1446
-	if (!$desc) {
1447
-		$desc = description_table($table, $serveur);
1448
-	}
1449
-	if (!$desc) {
1450
-		$champs = [];
1451
-	} else {
1452
-		$fields = $desc['field'];
1453
-	}
1454
-	$set = [];
1455
-	foreach ($champs as $champ => $val) {
1456
-		$set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1457
-	}
1458
-
1459
-	return spip_mysql_query(
1460
-		calculer_mysql_expression('UPDATE', $table, ',')
1461
-		. calculer_mysql_expression('SET', $set, ',')
1462
-		. calculer_mysql_expression('WHERE', $where),
1463
-		$serveur,
1464
-		$requeter
1465
-	);
1443
+    if (!$champs) {
1444
+        return;
1445
+    }
1446
+    if (!$desc) {
1447
+        $desc = description_table($table, $serveur);
1448
+    }
1449
+    if (!$desc) {
1450
+        $champs = [];
1451
+    } else {
1452
+        $fields = $desc['field'];
1453
+    }
1454
+    $set = [];
1455
+    foreach ($champs as $champ => $val) {
1456
+        $set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1457
+    }
1458
+
1459
+    return spip_mysql_query(
1460
+        calculer_mysql_expression('UPDATE', $table, ',')
1461
+        . calculer_mysql_expression('SET', $set, ',')
1462
+        . calculer_mysql_expression('WHERE', $where),
1463
+        $serveur,
1464
+        $requeter
1465
+    );
1466 1466
 }
1467 1467
 
1468 1468
 /**
@@ -1478,22 +1478,22 @@  discard block
 block discarded – undo
1478 1478
  *     - false en cas d'erreur.
1479 1479
  **/
1480 1480
 function spip_mysql_delete($table, $where = '', $serveur = '', $requeter = true) {
1481
-	$res = spip_mysql_query(
1482
-		calculer_mysql_expression('DELETE FROM', $table, ',')
1483
-		. calculer_mysql_expression('WHERE', $where),
1484
-		$serveur,
1485
-		$requeter
1486
-	);
1487
-	if (!$requeter) {
1488
-		return $res;
1489
-	}
1490
-	if ($res) {
1491
-		$link = _mysql_link($serveur);
1492
-
1493
-		return mysqli_affected_rows($link);
1494
-	} else {
1495
-		return false;
1496
-	}
1481
+    $res = spip_mysql_query(
1482
+        calculer_mysql_expression('DELETE FROM', $table, ',')
1483
+        . calculer_mysql_expression('WHERE', $where),
1484
+        $serveur,
1485
+        $requeter
1486
+    );
1487
+    if (!$requeter) {
1488
+        return $res;
1489
+    }
1490
+    if ($res) {
1491
+        $link = _mysql_link($serveur);
1492
+
1493
+        return mysqli_affected_rows($link);
1494
+    } else {
1495
+        return false;
1496
+    }
1497 1497
 }
1498 1498
 
1499 1499
 
@@ -1522,10 +1522,10 @@  discard block
 block discarded – undo
1522 1522
  *     - false en cas d'erreur.
1523 1523
  **/
1524 1524
 function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) {
1525
-	return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1526
-		',',
1527
-		array_map('_q', $couples)
1528
-	) . ')', $serveur, $requeter);
1525
+    return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1526
+        ',',
1527
+        array_map('_q', $couples)
1528
+    ) . ')', $serveur, $requeter);
1529 1529
 }
1530 1530
 
1531 1531
 
@@ -1554,14 +1554,14 @@  discard block
 block discarded – undo
1554 1554
  *     - false en cas d'erreur.
1555 1555
  **/
1556 1556
 function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) {
1557
-	$cles = '(' . join(',', array_keys($tab_couples[0])) . ')';
1558
-	$valeurs = [];
1559
-	foreach ($tab_couples as $couples) {
1560
-		$valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1561
-	}
1562
-	$valeurs = implode(', ', $valeurs);
1563
-
1564
-	return spip_mysql_query("REPLACE $table $cles VALUES $valeurs", $serveur, $requeter);
1557
+    $cles = '(' . join(',', array_keys($tab_couples[0])) . ')';
1558
+    $valeurs = [];
1559
+    foreach ($tab_couples as $couples) {
1560
+        $valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1561
+    }
1562
+    $valeurs = implode(', ', $valeurs);
1563
+
1564
+    return spip_mysql_query("REPLACE $table $cles VALUES $valeurs", $serveur, $requeter);
1565 1565
 }
1566 1566
 
1567 1567
 
@@ -1576,32 +1576,32 @@  discard block
 block discarded – undo
1576 1576
  * @return string       texte de sélection pour la requête
1577 1577
  */
1578 1578
 function spip_mysql_multi($objet, $lang) {
1579
-	$lengthlang = strlen("[$lang]");
1580
-	$posmulti = 'INSTR(' . $objet . ", '<multi>')";
1581
-	$posfinmulti = 'INSTR(' . $objet . ", '</multi>')";
1582
-	$debutchaine = 'LEFT(' . $objet . ", $posmulti-1)";
1583
-	$finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))";
1584
-	$chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1585
-	$poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1586
-	$poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1587
-	$chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1588
-	$posfinlang = 'INSTR(' . $chainelang . ", '[')";
1589
-	$chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1590
-	//$chainelang = "LEFT($chainelang,$posfinlang-1)";
1591
-	$retour = "(TRIM(IF($posmulti = 0 , " .
1592
-		'     TRIM(' . $objet . '), ' .
1593
-		'     CONCAT( ' .
1594
-		"          $debutchaine, " .
1595
-		'          IF( ' .
1596
-		"               $poslang = 0, " .
1597
-		"                     $chainemulti, " .
1598
-		"               $chainelang" .
1599
-		'          ), ' .
1600
-		"          $finchaine" .
1601
-		'     ) ' .
1602
-		'))) AS multi';
1603
-
1604
-	return $retour;
1579
+    $lengthlang = strlen("[$lang]");
1580
+    $posmulti = 'INSTR(' . $objet . ", '<multi>')";
1581
+    $posfinmulti = 'INSTR(' . $objet . ", '</multi>')";
1582
+    $debutchaine = 'LEFT(' . $objet . ", $posmulti-1)";
1583
+    $finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))";
1584
+    $chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1585
+    $poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1586
+    $poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1587
+    $chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1588
+    $posfinlang = 'INSTR(' . $chainelang . ", '[')";
1589
+    $chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1590
+    //$chainelang = "LEFT($chainelang,$posfinlang-1)";
1591
+    $retour = "(TRIM(IF($posmulti = 0 , " .
1592
+        '     TRIM(' . $objet . '), ' .
1593
+        '     CONCAT( ' .
1594
+        "          $debutchaine, " .
1595
+        '          IF( ' .
1596
+        "               $poslang = 0, " .
1597
+        "                     $chainemulti, " .
1598
+        "               $chainelang" .
1599
+        '          ), ' .
1600
+        "          $finchaine" .
1601
+        '     ) ' .
1602
+        '))) AS multi';
1603
+
1604
+    return $retour;
1605 1605
 }
1606 1606
 
1607 1607
 /**
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
  *     Valeur hexadécimale pour MySQL
1616 1616
  **/
1617 1617
 function spip_mysql_hex($v) {
1618
-	return '0x' . $v;
1618
+    return '0x' . $v;
1619 1619
 }
1620 1620
 
1621 1621
 /**
@@ -1631,15 +1631,15 @@  discard block
 block discarded – undo
1631 1631
  *    Donnée prête à être utilisée par le gestionnaire SQL
1632 1632
  */
1633 1633
 function spip_mysql_quote($v, $type = '') {
1634
-	if (!is_array($v)) {
1635
-		return spip_mysql_cite($v, $type);
1636
-	}
1637
-
1638
-	// si c'est un tableau, le parcourir en propageant le type
1639
-	foreach ($v as $k => $r) {
1640
-		$v[$k] = spip_mysql_quote($r, $type);
1641
-	}
1642
-	return implode(',', $v);
1634
+    if (!is_array($v)) {
1635
+        return spip_mysql_cite($v, $type);
1636
+    }
1637
+
1638
+    // si c'est un tableau, le parcourir en propageant le type
1639
+    foreach ($v as $k => $r) {
1640
+        $v[$k] = spip_mysql_quote($r, $type);
1641
+    }
1642
+    return implode(',', $v);
1643 1643
 }
1644 1644
 
1645 1645
 /**
@@ -1655,18 +1655,18 @@  discard block
 block discarded – undo
1655 1655
  *     Expression SQL
1656 1656
  **/
1657 1657
 function spip_mysql_date_proche($champ, $interval, $unite) {
1658
-	$use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false );
1659
-	return '('
1660
-	. $champ
1661
-	. (($interval <= 0) ? '>' : '<')
1662
-	. (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
1663
-	. '('
1664
-	. ($use_now ? 'NOW()' : sql_quote(date('Y-m-d H:i:s')))
1665
-	. ', INTERVAL '
1666
-	. (($interval > 0) ? $interval : (0 - $interval))
1667
-	. ' '
1668
-	. $unite
1669
-	. '))';
1658
+    $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false );
1659
+    return '('
1660
+    . $champ
1661
+    . (($interval <= 0) ? '>' : '<')
1662
+    . (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
1663
+    . '('
1664
+    . ($use_now ? 'NOW()' : sql_quote(date('Y-m-d H:i:s')))
1665
+    . ', INTERVAL '
1666
+    . (($interval > 0) ? $interval : (0 - $interval))
1667
+    . ' '
1668
+    . $unite
1669
+    . '))';
1670 1670
 }
1671 1671
 
1672 1672
 
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
  *     Expression de requête SQL
1691 1691
  **/
1692 1692
 function spip_mysql_in($val, $valeurs, $not = '', $serveur = '', $requeter = true) {
1693
-	return "($val $not IN ($valeurs))";
1693
+    return "($val $not IN ($valeurs))";
1694 1694
 }
1695 1695
 
1696 1696
 
@@ -1702,39 +1702,39 @@  discard block
 block discarded – undo
1702 1702
  * @return string|number     texte ou nombre échappé
1703 1703
  */
1704 1704
 function spip_mysql_cite($v, $type) {
1705
-	if (!$type) {
1706
-		if (is_bool($v)) {
1707
-			return strval(intval($v));
1708
-		} elseif (is_numeric($v)) {
1709
-			return strval($v);
1710
-		} elseif ($v === null) {
1711
-			return "''";
1712
-		}
1713
-		return "'" . addslashes($v) . "'";
1714
-	}
1715
-
1716
-	if ($v === null) {
1717
-		if (stripos($type, 'NOT NULL') === false) {
1718
-			// null php se traduit en NULL SQL
1719
-			return 'NULL';
1720
-		} else {
1721
-			return "''";
1722
-		}
1723
-	} elseif (sql_test_date($type) and preg_match('/^\w+\(/', $v)) {
1724
-		return $v;
1725
-	} elseif (sql_test_int($type)) {
1726
-		if (
1727
-			is_numeric($v)
1728
-			or ($v and ctype_xdigit(substr($v, 2)) and $v[0] === '0' and $v[1] === 'x')
1729
-		) {
1730
-			return $v;
1731
-		} else {
1732
-			// si pas numerique, forcer le intval
1733
-			return intval($v);
1734
-		}
1735
-	}
1736
-
1737
-	return ("'" . addslashes($v) . "'");
1705
+    if (!$type) {
1706
+        if (is_bool($v)) {
1707
+            return strval(intval($v));
1708
+        } elseif (is_numeric($v)) {
1709
+            return strval($v);
1710
+        } elseif ($v === null) {
1711
+            return "''";
1712
+        }
1713
+        return "'" . addslashes($v) . "'";
1714
+    }
1715
+
1716
+    if ($v === null) {
1717
+        if (stripos($type, 'NOT NULL') === false) {
1718
+            // null php se traduit en NULL SQL
1719
+            return 'NULL';
1720
+        } else {
1721
+            return "''";
1722
+        }
1723
+    } elseif (sql_test_date($type) and preg_match('/^\w+\(/', $v)) {
1724
+        return $v;
1725
+    } elseif (sql_test_int($type)) {
1726
+        if (
1727
+            is_numeric($v)
1728
+            or ($v and ctype_xdigit(substr($v, 2)) and $v[0] === '0' and $v[1] === 'x')
1729
+        ) {
1730
+            return $v;
1731
+        } else {
1732
+            // si pas numerique, forcer le intval
1733
+            return intval($v);
1734
+        }
1735
+    }
1736
+
1737
+    return ("'" . addslashes($v) . "'");
1738 1738
 }
1739 1739
 
1740 1740
 /**
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
  *     True si on a les fonctions, false sinon
1745 1745
  */
1746 1746
 function spip_versions_mysql() {
1747
-	return function_exists('mysqli_query');
1747
+    return function_exists('mysqli_query');
1748 1748
 }
1749 1749
 
1750 1750
 
@@ -1757,20 +1757,20 @@  discard block
 block discarded – undo
1757 1757
  *     - chaîne : code compilé pour le faire désactiver par SPIP sinon
1758 1758
  */
1759 1759
 function test_rappel_nom_base_mysql($server_db) {
1760
-	$GLOBALS['mysql_rappel_nom_base'] = true;
1761
-	sql_delete('spip_meta', "nom='mysql_rappel_nom_base'", $server_db);
1762
-	$ok = spip_query("INSERT INTO spip_meta (nom,valeur) VALUES ('mysql_rappel_nom_base', 'test')", $server_db);
1760
+    $GLOBALS['mysql_rappel_nom_base'] = true;
1761
+    sql_delete('spip_meta', "nom='mysql_rappel_nom_base'", $server_db);
1762
+    $ok = spip_query("INSERT INTO spip_meta (nom,valeur) VALUES ('mysql_rappel_nom_base', 'test')", $server_db);
1763 1763
 
1764
-	if ($ok) {
1765
-		sql_delete('spip_meta', "nom='mysql_rappel_nom_base'", $server_db);
1764
+    if ($ok) {
1765
+        sql_delete('spip_meta', "nom='mysql_rappel_nom_base'", $server_db);
1766 1766
 
1767
-		return '';
1768
-	} else {
1769
-		$GLOBALS['mysql_rappel_nom_base'] = false;
1767
+        return '';
1768
+    } else {
1769
+        $GLOBALS['mysql_rappel_nom_base'] = false;
1770 1770
 
1771
-		return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1772
-		"/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1773
-	}
1771
+        return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1772
+        "/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1773
+    }
1774 1774
 }
1775 1775
 
1776 1776
 /**
@@ -1784,13 +1784,13 @@  discard block
 block discarded – undo
1784 1784
  *     - chaîne : code compilé pour l'indiquer le résultat du test à SPIP
1785 1785
  */
1786 1786
 function test_sql_mode_mysql($server_db) {
1787
-	$res = sql_select('version() as v', '', '', '', '', '', '', $server_db);
1788
-	$row = sql_fetch($res, $server_db);
1789
-	if (version_compare($row['v'], '5.0.0', '>=')) {
1790
-		defined('_MYSQL_SET_SQL_MODE') || define('_MYSQL_SET_SQL_MODE', true);
1787
+    $res = sql_select('version() as v', '', '', '', '', '', '', $server_db);
1788
+    $row = sql_fetch($res, $server_db);
1789
+    if (version_compare($row['v'], '5.0.0', '>=')) {
1790
+        defined('_MYSQL_SET_SQL_MODE') || define('_MYSQL_SET_SQL_MODE', true);
1791 1791
 
1792
-		return "defined('_MYSQL_SET_SQL_MODE') || define('_MYSQL_SET_SQL_MODE',true);\n";
1793
-	}
1792
+        return "defined('_MYSQL_SET_SQL_MODE') || define('_MYSQL_SET_SQL_MODE',true);\n";
1793
+    }
1794 1794
 
1795
-	return '';
1795
+    return '';
1796 1796
 }
Please login to merge, or discard this patch.
ecrire/req/pg.exp.php 1 patch
Indentation   +1177 added lines, -1177 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 define('_DEFAULT_DB', 'spip');
@@ -31,159 +31,159 @@  discard block
 block discarded – undo
31 31
 // si ca ne marche toujours pas, echec.
32 32
 
33 33
 function req_pg_dist($addr, $port, $login, $pass, $db = '', $prefixe = '') {
34
-	static $last_connect = [];
35
-	if (!extension_loaded('pgsql')) {
36
-		return false;
37
-	}
38
-
39
-	// si provient de selectdb
40
-	if (empty($addr) && empty($port) && empty($login) && empty($pass)) {
41
-		foreach (['addr', 'port', 'login', 'pass', 'prefixe'] as $a) {
42
-			${$a} = $last_connect[$a];
43
-		}
44
-	}
45
-	[$host, $p] = array_pad(explode(';', $addr), 2, null);
46
-	if ($p > 0) {
47
-		$port = " port=$p";
48
-	} else {
49
-		$port = '';
50
-	}
51
-	$erreurs = [];
52
-	if ($db) {
53
-		@$link = pg_connect("host=$host$port dbname=$db user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW);
54
-	} elseif (!@$link = pg_connect("host=$host$port user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW)) {
55
-		$erreurs[] = pg_last_error();
56
-		if (@$link = pg_connect("host=$host$port dbname=$login user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW)) {
57
-			$db = $login;
58
-		} else {
59
-			$erreurs[] = pg_last_error();
60
-			$db = _DEFAULT_DB;
61
-			$link = pg_connect("host=$host$port dbname=$db user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW);
62
-		}
63
-	}
64
-	if (!$link) {
65
-		$erreurs[] = pg_last_error();
66
-		foreach ($erreurs as $e) {
67
-			spip_log('Echec pg_connect. Erreur : ' . $e, 'pg.' . _LOG_HS);
68
-		}
69
-
70
-		return false;
71
-	}
72
-
73
-	if ($link) {
74
-		$last_connect = [
75
-			'addr' => $addr,
76
-			'port' => $port,
77
-			'login' => $login,
78
-			'pass' => $pass,
79
-			'db' => $db,
80
-			'prefixe' => $prefixe,
81
-		];
82
-	}
83
-
84
-	spip_log(
85
-		"Connexion vers $host, base $db, prefixe $prefixe " . ($link ? 'operationnelle' : 'impossible'),
86
-		'pg.' . _LOG_DEBUG
87
-	);
88
-
89
-	return !$link ? false : [
90
-		'db' => $db,
91
-		'prefixe' => $prefixe ?: $db,
92
-		'link' => $link,
93
-	];
34
+    static $last_connect = [];
35
+    if (!extension_loaded('pgsql')) {
36
+        return false;
37
+    }
38
+
39
+    // si provient de selectdb
40
+    if (empty($addr) && empty($port) && empty($login) && empty($pass)) {
41
+        foreach (['addr', 'port', 'login', 'pass', 'prefixe'] as $a) {
42
+            ${$a} = $last_connect[$a];
43
+        }
44
+    }
45
+    [$host, $p] = array_pad(explode(';', $addr), 2, null);
46
+    if ($p > 0) {
47
+        $port = " port=$p";
48
+    } else {
49
+        $port = '';
50
+    }
51
+    $erreurs = [];
52
+    if ($db) {
53
+        @$link = pg_connect("host=$host$port dbname=$db user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW);
54
+    } elseif (!@$link = pg_connect("host=$host$port user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW)) {
55
+        $erreurs[] = pg_last_error();
56
+        if (@$link = pg_connect("host=$host$port dbname=$login user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW)) {
57
+            $db = $login;
58
+        } else {
59
+            $erreurs[] = pg_last_error();
60
+            $db = _DEFAULT_DB;
61
+            $link = pg_connect("host=$host$port dbname=$db user=$login password='$pass'", PGSQL_CONNECT_FORCE_NEW);
62
+        }
63
+    }
64
+    if (!$link) {
65
+        $erreurs[] = pg_last_error();
66
+        foreach ($erreurs as $e) {
67
+            spip_log('Echec pg_connect. Erreur : ' . $e, 'pg.' . _LOG_HS);
68
+        }
69
+
70
+        return false;
71
+    }
72
+
73
+    if ($link) {
74
+        $last_connect = [
75
+            'addr' => $addr,
76
+            'port' => $port,
77
+            'login' => $login,
78
+            'pass' => $pass,
79
+            'db' => $db,
80
+            'prefixe' => $prefixe,
81
+        ];
82
+    }
83
+
84
+    spip_log(
85
+        "Connexion vers $host, base $db, prefixe $prefixe " . ($link ? 'operationnelle' : 'impossible'),
86
+        'pg.' . _LOG_DEBUG
87
+    );
88
+
89
+    return !$link ? false : [
90
+        'db' => $db,
91
+        'prefixe' => $prefixe ?: $db,
92
+        'link' => $link,
93
+    ];
94 94
 }
95 95
 
96 96
 $GLOBALS['spip_pg_functions_1'] = [
97
-	'alter' => 'spip_pg_alter',
98
-	'count' => 'spip_pg_count',
99
-	'countsel' => 'spip_pg_countsel',
100
-	'create' => 'spip_pg_create',
101
-	'create_base' => 'spip_pg_create_base',
102
-	'create_view' => 'spip_pg_create_view',
103
-	'date_proche' => 'spip_pg_date_proche',
104
-	'delete' => 'spip_pg_delete',
105
-	'drop_table' => 'spip_pg_drop_table',
106
-	'drop_view' => 'spip_pg_drop_view',
107
-	'errno' => 'spip_pg_errno',
108
-	'error' => 'spip_pg_error',
109
-	'explain' => 'spip_pg_explain',
110
-	'fetch' => 'spip_pg_fetch',
111
-	'seek' => 'spip_pg_seek',
112
-	'free' => 'spip_pg_free',
113
-	'hex' => 'spip_pg_hex',
114
-	'in' => 'spip_pg_in',
115
-	'insert' => 'spip_pg_insert',
116
-	'insertq' => 'spip_pg_insertq',
117
-	'insertq_multi' => 'spip_pg_insertq_multi',
118
-	'listdbs' => 'spip_pg_listdbs',
119
-	'multi' => 'spip_pg_multi',
120
-	'optimize' => 'spip_pg_optimize',
121
-	'query' => 'spip_pg_query',
122
-	'quote' => 'spip_pg_quote',
123
-	'replace' => 'spip_pg_replace',
124
-	'replace_multi' => 'spip_pg_replace_multi',
125
-	'select' => 'spip_pg_select',
126
-	'selectdb' => 'spip_pg_selectdb',
127
-	'set_connect_charset' => 'spip_pg_set_connect_charset',
128
-	'showbase' => 'spip_pg_showbase',
129
-	'showtable' => 'spip_pg_showtable',
130
-	'update' => 'spip_pg_update',
131
-	'updateq' => 'spip_pg_updateq',
97
+    'alter' => 'spip_pg_alter',
98
+    'count' => 'spip_pg_count',
99
+    'countsel' => 'spip_pg_countsel',
100
+    'create' => 'spip_pg_create',
101
+    'create_base' => 'spip_pg_create_base',
102
+    'create_view' => 'spip_pg_create_view',
103
+    'date_proche' => 'spip_pg_date_proche',
104
+    'delete' => 'spip_pg_delete',
105
+    'drop_table' => 'spip_pg_drop_table',
106
+    'drop_view' => 'spip_pg_drop_view',
107
+    'errno' => 'spip_pg_errno',
108
+    'error' => 'spip_pg_error',
109
+    'explain' => 'spip_pg_explain',
110
+    'fetch' => 'spip_pg_fetch',
111
+    'seek' => 'spip_pg_seek',
112
+    'free' => 'spip_pg_free',
113
+    'hex' => 'spip_pg_hex',
114
+    'in' => 'spip_pg_in',
115
+    'insert' => 'spip_pg_insert',
116
+    'insertq' => 'spip_pg_insertq',
117
+    'insertq_multi' => 'spip_pg_insertq_multi',
118
+    'listdbs' => 'spip_pg_listdbs',
119
+    'multi' => 'spip_pg_multi',
120
+    'optimize' => 'spip_pg_optimize',
121
+    'query' => 'spip_pg_query',
122
+    'quote' => 'spip_pg_quote',
123
+    'replace' => 'spip_pg_replace',
124
+    'replace_multi' => 'spip_pg_replace_multi',
125
+    'select' => 'spip_pg_select',
126
+    'selectdb' => 'spip_pg_selectdb',
127
+    'set_connect_charset' => 'spip_pg_set_connect_charset',
128
+    'showbase' => 'spip_pg_showbase',
129
+    'showtable' => 'spip_pg_showtable',
130
+    'update' => 'spip_pg_update',
131
+    'updateq' => 'spip_pg_updateq',
132 132
 ];
133 133
 
134 134
 // Par ou ca passe une fois les traductions faites
135 135
 function spip_pg_trace_query($query, $serveur = '') {
136
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
137
-	$prefixe = $connexion['prefixe'];
138
-	$link = $connexion['link'];
139
-	$db = $connexion['db'];
140
-
141
-	if (isset($_GET['var_profile'])) {
142
-		include_spip('public/tracer');
143
-		$t = trace_query_start();
144
-		$e = '';
145
-	} else {
146
-		$t = 0;
147
-	}
148
-
149
-	$connexion['last'] = $query;
150
-	$r = spip_pg_query_simple($link, $query);
151
-
152
-	// Log de l'erreur eventuelle
153
-	if ($e = spip_pg_errno($serveur)) {
154
-		$e .= spip_pg_error($query, $serveur);
155
-	} // et du fautif
156
-	return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
136
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
137
+    $prefixe = $connexion['prefixe'];
138
+    $link = $connexion['link'];
139
+    $db = $connexion['db'];
140
+
141
+    if (isset($_GET['var_profile'])) {
142
+        include_spip('public/tracer');
143
+        $t = trace_query_start();
144
+        $e = '';
145
+    } else {
146
+        $t = 0;
147
+    }
148
+
149
+    $connexion['last'] = $query;
150
+    $r = spip_pg_query_simple($link, $query);
151
+
152
+    // Log de l'erreur eventuelle
153
+    if ($e = spip_pg_errno($serveur)) {
154
+        $e .= spip_pg_error($query, $serveur);
155
+    } // et du fautif
156
+    return $t ? trace_query_end($query, $t, $r, $e, $serveur) : $r;
157 157
 }
158 158
 
159 159
 // Fonction de requete generale quand on est sur que c'est SQL standard.
160 160
 // Elle change juste le noms des tables ($table_prefix) dans le FROM etc
161 161
 
162 162
 function spip_pg_query($query, $serveur = '', $requeter = true) {
163
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
164
-	$prefixe = $connexion['prefixe'];
165
-	$link = $connexion['link'];
166
-	$db = $connexion['db'];
167
-
168
-	if (preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
169
-		$suite = strstr($query, (string) $regs[0]);
170
-		$query = substr($query, 0, -strlen($suite));
171
-	} else {
172
-		$suite = '';
173
-	}
174
-	$query = preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
175
-
176
-	// renvoyer la requete inerte si demandee
177
-	if (!$requeter) {
178
-		return $query;
179
-	}
180
-
181
-	return spip_pg_trace_query($query, $serveur);
163
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
164
+    $prefixe = $connexion['prefixe'];
165
+    $link = $connexion['link'];
166
+    $db = $connexion['db'];
167
+
168
+    if (preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
169
+        $suite = strstr($query, (string) $regs[0]);
170
+        $query = substr($query, 0, -strlen($suite));
171
+    } else {
172
+        $suite = '';
173
+    }
174
+    $query = preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
175
+
176
+    // renvoyer la requete inerte si demandee
177
+    if (!$requeter) {
178
+        return $query;
179
+    }
180
+
181
+    return spip_pg_trace_query($query, $serveur);
182 182
 }
183 183
 
184 184
 function spip_pg_query_simple($link, $query) {
185
-	#spip_log(var_export($query,true), 'pg.'._LOG_DEBUG);
186
-	return pg_query($link, $query);
185
+    #spip_log(var_export($query,true), 'pg.'._LOG_DEBUG);
186
+    return pg_query($link, $query);
187 187
 }
188 188
 
189 189
 /*
@@ -195,196 +195,196 @@  discard block
 block discarded – undo
195 195
  * de requetes showtable intempestives
196 196
  */
197 197
 function spip_pg_ajouter_champs_timestamp($table, $couples, $desc = '', $serveur = '') {
198
-	static $tables = [];
199
-
200
-	if (!isset($tables[$table])) {
201
-		if (!$desc) {
202
-			$trouver_table = charger_fonction('trouver_table', 'base');
203
-			$desc = $trouver_table($table, $serveur);
204
-			// si pas de description, on ne fait rien, ou on die() ?
205
-			if (!$desc) {
206
-				return $couples;
207
-			}
208
-		}
209
-
210
-		// recherche des champs avec simplement 'TIMESTAMP'
211
-		// cependant, il faudra peut etre etendre
212
-		// avec la gestion de DEFAULT et ON UPDATE
213
-		// mais ceux-ci ne sont pas utilises dans le core
214
-		$tables[$table] = [];
215
-		foreach ($desc['field'] as $k => $v) {
216
-			$v = strtolower(ltrim($v));
217
-			// ne pas ajouter de timestamp now() si un default est specifie
218
-			if (strpos($v, 'timestamp') === 0 and !str_contains($v, 'default')) {
219
-				$tables[$table][] = $k;
220
-			}
221
-		}
222
-	}
223
-
224
-	// ajout des champs type 'timestamp' absents
225
-	foreach ($tables[$table] as $maj) {
226
-		if (!array_key_exists($maj, $couples)) {
227
-			$couples[$maj] = 'NOW()';
228
-		}
229
-	}
230
-
231
-	return $couples;
198
+    static $tables = [];
199
+
200
+    if (!isset($tables[$table])) {
201
+        if (!$desc) {
202
+            $trouver_table = charger_fonction('trouver_table', 'base');
203
+            $desc = $trouver_table($table, $serveur);
204
+            // si pas de description, on ne fait rien, ou on die() ?
205
+            if (!$desc) {
206
+                return $couples;
207
+            }
208
+        }
209
+
210
+        // recherche des champs avec simplement 'TIMESTAMP'
211
+        // cependant, il faudra peut etre etendre
212
+        // avec la gestion de DEFAULT et ON UPDATE
213
+        // mais ceux-ci ne sont pas utilises dans le core
214
+        $tables[$table] = [];
215
+        foreach ($desc['field'] as $k => $v) {
216
+            $v = strtolower(ltrim($v));
217
+            // ne pas ajouter de timestamp now() si un default est specifie
218
+            if (strpos($v, 'timestamp') === 0 and !str_contains($v, 'default')) {
219
+                $tables[$table][] = $k;
220
+            }
221
+        }
222
+    }
223
+
224
+    // ajout des champs type 'timestamp' absents
225
+    foreach ($tables[$table] as $maj) {
226
+        if (!array_key_exists($maj, $couples)) {
227
+            $couples[$maj] = 'NOW()';
228
+        }
229
+    }
230
+
231
+    return $couples;
232 232
 }
233 233
 
234 234
 
235 235
 // Alter en PG ne traite pas les index
236 236
 function spip_pg_alter($query, $serveur = '', $requeter = true) {
237
-	// il faudrait une regexp pour eviter de spliter ADD PRIMARY KEY (colA, colB)
238
-	// tout en cassant en deux alter distincts "ADD PRIMARY KEY (colA, colB), ADD INDEX (chose)"...
239
-	// ou revoir l'api de sql_alter en creant un
240
-	// sql_alter_table($table,array($actions));
241
-	if (!preg_match('/\s*((\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
242
-		spip_log("$query mal comprise", 'pg.' . _LOG_ERREUR);
243
-
244
-		return false;
245
-	}
246
-	$debut = $regs[1];
247
-	$table = $regs[3];
248
-	$suite = $regs[4];
249
-	$todo = explode(',', $suite);
250
-	// on remet les morceaux dechires ensembles... que c'est laid !
251
-	$todo2 = [];
252
-	$i = 0;
253
-	$ouverte = false;
254
-	while ($do = array_shift($todo)) {
255
-		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
256
-		$o = (str_contains($do, '('));
257
-		$f = (str_contains($do, ')'));
258
-		if ($o and !$f) {
259
-			$ouverte = true;
260
-		} elseif ($f) {
261
-			$ouverte = false;
262
-		}
263
-		if (!$ouverte) {
264
-			$i++;
265
-		}
266
-	}
267
-	$todo = $todo2;
268
-	$query = $debut . ' ' . array_shift($todo);
269
-
270
-	if (!preg_match('/^\s*(IGNORE\s*)?TABLE\s+(\w+)\s+(ADD|DROP|CHANGE|MODIFY|RENAME)\s*(.*)$/is', $query, $r)) {
271
-		spip_log("$query incompris", 'pg.' . _LOG_ERREUR);
272
-	} else {
273
-		if ($r[1]) {
274
-			spip_log("j'ignore IGNORE dans $query", 'pg.' . _LOG_AVERTISSEMENT);
275
-		}
276
-		$f = 'spip_pg_alter_' . strtolower($r[3]);
277
-		if (function_exists($f)) {
278
-			$f($r[2], $r[4], $serveur, $requeter);
279
-		} else {
280
-			spip_log("$query non prevu", 'pg.' . _LOG_ERREUR);
281
-		}
282
-	}
283
-	// Alter a plusieurs args. Faudrait optimiser.
284
-	if ($todo) {
285
-		spip_pg_alter("TABLE $table " . join(',', $todo));
286
-	}
237
+    // il faudrait une regexp pour eviter de spliter ADD PRIMARY KEY (colA, colB)
238
+    // tout en cassant en deux alter distincts "ADD PRIMARY KEY (colA, colB), ADD INDEX (chose)"...
239
+    // ou revoir l'api de sql_alter en creant un
240
+    // sql_alter_table($table,array($actions));
241
+    if (!preg_match('/\s*((\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
242
+        spip_log("$query mal comprise", 'pg.' . _LOG_ERREUR);
243
+
244
+        return false;
245
+    }
246
+    $debut = $regs[1];
247
+    $table = $regs[3];
248
+    $suite = $regs[4];
249
+    $todo = explode(',', $suite);
250
+    // on remet les morceaux dechires ensembles... que c'est laid !
251
+    $todo2 = [];
252
+    $i = 0;
253
+    $ouverte = false;
254
+    while ($do = array_shift($todo)) {
255
+        $todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
256
+        $o = (str_contains($do, '('));
257
+        $f = (str_contains($do, ')'));
258
+        if ($o and !$f) {
259
+            $ouverte = true;
260
+        } elseif ($f) {
261
+            $ouverte = false;
262
+        }
263
+        if (!$ouverte) {
264
+            $i++;
265
+        }
266
+    }
267
+    $todo = $todo2;
268
+    $query = $debut . ' ' . array_shift($todo);
269
+
270
+    if (!preg_match('/^\s*(IGNORE\s*)?TABLE\s+(\w+)\s+(ADD|DROP|CHANGE|MODIFY|RENAME)\s*(.*)$/is', $query, $r)) {
271
+        spip_log("$query incompris", 'pg.' . _LOG_ERREUR);
272
+    } else {
273
+        if ($r[1]) {
274
+            spip_log("j'ignore IGNORE dans $query", 'pg.' . _LOG_AVERTISSEMENT);
275
+        }
276
+        $f = 'spip_pg_alter_' . strtolower($r[3]);
277
+        if (function_exists($f)) {
278
+            $f($r[2], $r[4], $serveur, $requeter);
279
+        } else {
280
+            spip_log("$query non prevu", 'pg.' . _LOG_ERREUR);
281
+        }
282
+    }
283
+    // Alter a plusieurs args. Faudrait optimiser.
284
+    if ($todo) {
285
+        spip_pg_alter("TABLE $table " . join(',', $todo));
286
+    }
287 287
 }
288 288
 
289 289
 function spip_pg_alter_change($table, $arg, $serveur = '', $requeter = true) {
290
-	if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) {
291
-		spip_log("alter change: $arg  incompris", 'pg.' . _LOG_ERREUR);
292
-	} else {
293
-		[, $old, $new, $type, $default, $null, $def2] = $r;
294
-		$actions = ["ALTER $old TYPE " . mysql2pg_type($type)];
295
-		if ($null) {
296
-			$actions[] = "ALTER $old SET NOT NULL";
297
-		} else {
298
-			$actions[] = "ALTER $old DROP NOT NULL";
299
-		}
300
-
301
-		if ($d = ($default ?: $def2)) {
302
-			$actions[] = "ALTER $old SET $d";
303
-		} else {
304
-			$actions[] = "ALTER $old DROP DEFAULT";
305
-		}
306
-
307
-		spip_pg_query("ALTER TABLE $table " . join(', ', $actions));
308
-
309
-		if ($old != $new) {
310
-			spip_pg_query("ALTER TABLE $table RENAME $old TO $new", $serveur);
311
-		}
312
-	}
290
+    if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) {
291
+        spip_log("alter change: $arg  incompris", 'pg.' . _LOG_ERREUR);
292
+    } else {
293
+        [, $old, $new, $type, $default, $null, $def2] = $r;
294
+        $actions = ["ALTER $old TYPE " . mysql2pg_type($type)];
295
+        if ($null) {
296
+            $actions[] = "ALTER $old SET NOT NULL";
297
+        } else {
298
+            $actions[] = "ALTER $old DROP NOT NULL";
299
+        }
300
+
301
+        if ($d = ($default ?: $def2)) {
302
+            $actions[] = "ALTER $old SET $d";
303
+        } else {
304
+            $actions[] = "ALTER $old DROP DEFAULT";
305
+        }
306
+
307
+        spip_pg_query("ALTER TABLE $table " . join(', ', $actions));
308
+
309
+        if ($old != $new) {
310
+            spip_pg_query("ALTER TABLE $table RENAME $old TO $new", $serveur);
311
+        }
312
+    }
313 313
 }
314 314
 
315 315
 function spip_pg_alter_add($table, $arg, $serveur = '', $requeter = true) {
316
-	$nom_index = null;
317
-	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*(.*)$/', $arg, $r)) {
318
-		spip_log("alter add $arg  incompris", 'pg.' . _LOG_ERREUR);
319
-
320
-		return null;
321
-	}
322
-	if (!$r[1] or $r[1] == 'COLUMN') {
323
-		preg_match('/`?(\w+)`?(.*)/', $r[2], $m);
324
-		if (preg_match('/^(.*)(BEFORE|AFTER|FIRST)(.*)$/is', $m[2], $n)) {
325
-			$m[2] = $n[1];
326
-		}
327
-
328
-		return spip_pg_query("ALTER TABLE $table ADD " . $m[1] . ' ' . mysql2pg_type($m[2]), $serveur, $requeter);
329
-	} elseif ($r[1][0] == 'P') {
330
-		// la primary peut etre sur plusieurs champs
331
-		$r[2] = trim(str_replace('`', '', $r[2]));
332
-		$m = ($r[2][0] == '(') ? substr($r[2], 1, -1) : $r[2];
333
-
334
-		return spip_pg_query(
335
-			"ALTER TABLE $table ADD CONSTRAINT $table" . '_pkey PRIMARY KEY (' . $m . ')',
336
-			$serveur,
337
-			$requeter
338
-		);
339
-	} else {
340
-		preg_match('/([^\s,]*)\s*(.*)?/', $r[2], $m);
341
-		// peut etre "(colonne)" ou "nom_index (colonnes)"
342
-		// bug potentiel si qqn met "(colonne, colonne)"
343
-		//
344
-		// nom_index (colonnes)
345
-		if ($m[2]) {
346
-			$colonnes = substr($m[2], 1, -1);
347
-			$nom_index = $m[1];
348
-		} else {
349
-			// (colonne)
350
-			if ($m[1][0] == '(') {
351
-				$colonnes = substr($m[1], 1, -1);
352
-				if (str_contains(',', $colonnes)) {
353
-					spip_log('PG : Erreur, impossible de creer un index sur plusieurs colonnes'
354
-						. " sans qu'il ait de nom ($table, ($colonnes))", 'pg.' . _LOG_ERREUR);
355
-				} else {
356
-					$nom_index = $colonnes;
357
-				}
358
-			} // nom_index
359
-			else {
360
-				$nom_index = $colonnes = $m[1];
361
-			}
362
-		}
363
-
364
-		return spip_pg_create_index($nom_index, $table, $colonnes, $serveur, $requeter);
365
-	}
316
+    $nom_index = null;
317
+    if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*(.*)$/', $arg, $r)) {
318
+        spip_log("alter add $arg  incompris", 'pg.' . _LOG_ERREUR);
319
+
320
+        return null;
321
+    }
322
+    if (!$r[1] or $r[1] == 'COLUMN') {
323
+        preg_match('/`?(\w+)`?(.*)/', $r[2], $m);
324
+        if (preg_match('/^(.*)(BEFORE|AFTER|FIRST)(.*)$/is', $m[2], $n)) {
325
+            $m[2] = $n[1];
326
+        }
327
+
328
+        return spip_pg_query("ALTER TABLE $table ADD " . $m[1] . ' ' . mysql2pg_type($m[2]), $serveur, $requeter);
329
+    } elseif ($r[1][0] == 'P') {
330
+        // la primary peut etre sur plusieurs champs
331
+        $r[2] = trim(str_replace('`', '', $r[2]));
332
+        $m = ($r[2][0] == '(') ? substr($r[2], 1, -1) : $r[2];
333
+
334
+        return spip_pg_query(
335
+            "ALTER TABLE $table ADD CONSTRAINT $table" . '_pkey PRIMARY KEY (' . $m . ')',
336
+            $serveur,
337
+            $requeter
338
+        );
339
+    } else {
340
+        preg_match('/([^\s,]*)\s*(.*)?/', $r[2], $m);
341
+        // peut etre "(colonne)" ou "nom_index (colonnes)"
342
+        // bug potentiel si qqn met "(colonne, colonne)"
343
+        //
344
+        // nom_index (colonnes)
345
+        if ($m[2]) {
346
+            $colonnes = substr($m[2], 1, -1);
347
+            $nom_index = $m[1];
348
+        } else {
349
+            // (colonne)
350
+            if ($m[1][0] == '(') {
351
+                $colonnes = substr($m[1], 1, -1);
352
+                if (str_contains(',', $colonnes)) {
353
+                    spip_log('PG : Erreur, impossible de creer un index sur plusieurs colonnes'
354
+                        . " sans qu'il ait de nom ($table, ($colonnes))", 'pg.' . _LOG_ERREUR);
355
+                } else {
356
+                    $nom_index = $colonnes;
357
+                }
358
+            } // nom_index
359
+            else {
360
+                $nom_index = $colonnes = $m[1];
361
+            }
362
+        }
363
+
364
+        return spip_pg_create_index($nom_index, $table, $colonnes, $serveur, $requeter);
365
+    }
366 366
 }
367 367
 
368 368
 function spip_pg_alter_drop($table, $arg, $serveur = '', $requeter = true) {
369
-	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*`?(\w*)`?/', $arg, $r)) {
370
-		spip_log("alter drop: $arg  incompris", 'pg.' . _LOG_ERREUR);
371
-	} else {
372
-		if (!$r[1] or $r[1] == 'COLUMN') {
373
-			return spip_pg_query("ALTER TABLE $table DROP " . $r[2], $serveur);
374
-		} elseif ($r[1][0] == 'P') {
375
-			return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table" . '_pkey', $serveur);
376
-		} else {
377
-			return spip_pg_query('DROP INDEX ' . $table . '_' . $r[2], $serveur);
378
-		}
379
-	}
369
+    if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*`?(\w*)`?/', $arg, $r)) {
370
+        spip_log("alter drop: $arg  incompris", 'pg.' . _LOG_ERREUR);
371
+    } else {
372
+        if (!$r[1] or $r[1] == 'COLUMN') {
373
+            return spip_pg_query("ALTER TABLE $table DROP " . $r[2], $serveur);
374
+        } elseif ($r[1][0] == 'P') {
375
+            return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table" . '_pkey', $serveur);
376
+        } else {
377
+            return spip_pg_query('DROP INDEX ' . $table . '_' . $r[2], $serveur);
378
+        }
379
+    }
380 380
 }
381 381
 
382 382
 function spip_pg_alter_modify($table, $arg, $serveur = '', $requeter = true) {
383
-	if (!preg_match('/^`?(\w+)`?\s+(.*)$/', $arg, $r)) {
384
-		spip_log("alter modify: $arg  incompris", 'pg.' . _LOG_ERREUR);
385
-	} else {
386
-		return spip_pg_alter_change($table, $r[1] . ' ' . $arg, $serveur = '', $requeter = true);
387
-	}
383
+    if (!preg_match('/^`?(\w+)`?\s+(.*)$/', $arg, $r)) {
384
+        spip_log("alter modify: $arg  incompris", 'pg.' . _LOG_ERREUR);
385
+    } else {
386
+        return spip_pg_alter_change($table, $r[1] . ' ' . $arg, $serveur = '', $requeter = true);
387
+    }
388 388
 }
389 389
 
390 390
 // attention (en pg) :
@@ -392,17 +392,17 @@  discard block
 block discarded – undo
392 392
 // - alter table A rename X to Y = changer le nom de la colonne X en Y
393 393
 // pour l'instant, traiter simplement RENAME TO X
394 394
 function spip_pg_alter_rename($table, $arg, $serveur = '', $requeter = true) {
395
-	$rename = '';
396
-	// si TO, mais pas au debut
397
-	if (!stripos($arg, 'TO ')) {
398
-		$rename = $arg;
399
-	} elseif (preg_match('/^(TO)\s*`?(\w*)`?/', $arg, $r)) {
400
-		$rename = $r[2];
401
-	} else {
402
-		spip_log("alter rename: $arg  incompris", 'pg.' . _LOG_ERREUR);
403
-	}
404
-
405
-	return $rename ? spip_pg_query("ALTER TABLE $table RENAME TO $rename") : false;
395
+    $rename = '';
396
+    // si TO, mais pas au debut
397
+    if (!stripos($arg, 'TO ')) {
398
+        $rename = $arg;
399
+    } elseif (preg_match('/^(TO)\s*`?(\w*)`?/', $arg, $r)) {
400
+        $rename = $r[2];
401
+    } else {
402
+        spip_log("alter rename: $arg  incompris", 'pg.' . _LOG_ERREUR);
403
+    }
404
+
405
+    return $rename ? spip_pg_query("ALTER TABLE $table RENAME TO $rename") : false;
406 406
 }
407 407
 
408 408
 
@@ -418,59 +418,59 @@  discard block
 block discarded – undo
418 418
  * @return bool ou requete
419 419
  */
420 420
 function spip_pg_create_index($nom, $table, $champs, $serveur = '', $requeter = true) {
421
-	if (!($nom or $table or $champs)) {
422
-		spip_log(
423
-			"Champ manquant pour creer un index pg ($nom, $table, (" . @join(',', $champs) . '))',
424
-			'pg.' . _LOG_ERREUR
425
-		);
426
-
427
-		return false;
428
-	}
429
-
430
-	$nom = str_replace('`', '', $nom);
431
-	$champs = str_replace('`', '', $champs);
432
-
433
-	// PG ne differentie pas noms des index en fonction des tables
434
-	// il faut donc creer des noms uniques d'index pour une base pg
435
-	$nom = $table . '_' . $nom;
436
-	// enlever d'eventuelles parentheses deja presentes sur champs
437
-	if (!is_array($champs)) {
438
-		if ($champs[0] == '(') {
439
-			$champs = substr($champs, 1, -1);
440
-		}
441
-		$champs = [$champs];
442
-	}
443
-	$query = "CREATE INDEX $nom ON $table (" . join(',', $champs) . ')';
444
-	if (!$requeter) {
445
-		return $query;
446
-	}
447
-	$res = spip_pg_query($query, $serveur, $requeter);
448
-
449
-	return $res;
421
+    if (!($nom or $table or $champs)) {
422
+        spip_log(
423
+            "Champ manquant pour creer un index pg ($nom, $table, (" . @join(',', $champs) . '))',
424
+            'pg.' . _LOG_ERREUR
425
+        );
426
+
427
+        return false;
428
+    }
429
+
430
+    $nom = str_replace('`', '', $nom);
431
+    $champs = str_replace('`', '', $champs);
432
+
433
+    // PG ne differentie pas noms des index en fonction des tables
434
+    // il faut donc creer des noms uniques d'index pour une base pg
435
+    $nom = $table . '_' . $nom;
436
+    // enlever d'eventuelles parentheses deja presentes sur champs
437
+    if (!is_array($champs)) {
438
+        if ($champs[0] == '(') {
439
+            $champs = substr($champs, 1, -1);
440
+        }
441
+        $champs = [$champs];
442
+    }
443
+    $query = "CREATE INDEX $nom ON $table (" . join(',', $champs) . ')';
444
+    if (!$requeter) {
445
+        return $query;
446
+    }
447
+    $res = spip_pg_query($query, $serveur, $requeter);
448
+
449
+    return $res;
450 450
 }
451 451
 
452 452
 
453 453
 function spip_pg_explain($query, $serveur = '', $requeter = true) {
454
-	if (strpos(ltrim($query), 'SELECT') !== 0) {
455
-		return [];
456
-	}
457
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
458
-	$prefixe = $connexion['prefixe'];
459
-	$link = $connexion['link'];
460
-	if (preg_match('/\s(SET|VALUES|WHERE)\s/i', $query, $regs)) {
461
-		$suite = strstr($query, (string) $regs[0]);
462
-		$query = substr($query, 0, -strlen($suite));
463
-	} else {
464
-		$suite = '';
465
-	}
466
-	$query = 'EXPLAIN ' . preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
467
-
468
-	if (!$requeter) {
469
-		return $query;
470
-	}
471
-	$r = spip_pg_query_simple($link, $query);
472
-
473
-	return spip_pg_fetch($r, null, $serveur);
454
+    if (strpos(ltrim($query), 'SELECT') !== 0) {
455
+        return [];
456
+    }
457
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
458
+    $prefixe = $connexion['prefixe'];
459
+    $link = $connexion['link'];
460
+    if (preg_match('/\s(SET|VALUES|WHERE)\s/i', $query, $regs)) {
461
+        $suite = strstr($query, (string) $regs[0]);
462
+        $query = substr($query, 0, -strlen($suite));
463
+    } else {
464
+        $suite = '';
465
+    }
466
+    $query = 'EXPLAIN ' . preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
467
+
468
+    if (!$requeter) {
469
+        return $query;
470
+    }
471
+    $r = spip_pg_query_simple($link, $query);
472
+
473
+    return spip_pg_fetch($r, null, $serveur);
474 474
 }
475 475
 
476 476
 
@@ -489,92 +489,92 @@  discard block
 block discarded – undo
489 489
  *     - False en cas d'erreur.
490 490
  **/
491 491
 function spip_pg_selectdb($db, $serveur = '', $requeter = true) {
492
-	// se connecter a la base indiquee
493
-	// avec les identifiants connus
494
-	$index = $serveur ? strtolower($serveur) : 0;
492
+    // se connecter a la base indiquee
493
+    // avec les identifiants connus
494
+    $index = $serveur ? strtolower($serveur) : 0;
495 495
 
496
-	if ($link = spip_connect_db('', '', '', '', $db, 'pg', '', '')) {
497
-		if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) {
498
-			return $db;
499
-		}
500
-	}
496
+    if ($link = spip_connect_db('', '', '', '', $db, 'pg', '', '')) {
497
+        if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) {
498
+            return $db;
499
+        }
500
+    }
501 501
 
502
-	return false;
502
+    return false;
503 503
 }
504 504
 
505 505
 // Qu'une seule base pour le moment
506 506
 
507 507
 function spip_pg_listdbs($serveur) {
508
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
509
-	$link = $connexion['link'];
510
-	$dbs = [];
511
-	$res = spip_pg_query_simple($link, 'select * From pg_database');
512
-	while ($row = pg_fetch_array($res, null, PGSQL_NUM)) {
513
-		$dbs[] = reset($row);
514
-	}
515
-
516
-	return $dbs;
508
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
509
+    $link = $connexion['link'];
510
+    $dbs = [];
511
+    $res = spip_pg_query_simple($link, 'select * From pg_database');
512
+    while ($row = pg_fetch_array($res, null, PGSQL_NUM)) {
513
+        $dbs[] = reset($row);
514
+    }
515
+
516
+    return $dbs;
517 517
 }
518 518
 
519 519
 function spip_pg_select(
520
-	$select,
521
-	$from,
522
-	$where = '',
523
-	$groupby = [],
524
-	$orderby = '',
525
-	$limit = '',
526
-	$having = '',
527
-	$serveur = '',
528
-	$requeter = true
520
+    $select,
521
+    $from,
522
+    $where = '',
523
+    $groupby = [],
524
+    $orderby = '',
525
+    $limit = '',
526
+    $having = '',
527
+    $serveur = '',
528
+    $requeter = true
529 529
 ) {
530 530
 
531
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
532
-	$prefixe = $connexion['prefixe'];
533
-	$link = $connexion['link'];
534
-	$db = $connexion['db'];
535
-
536
-	$limit = preg_match('/^\s*(([0-9]+),)?\s*([0-9]+)\s*$/', $limit, $limatch);
537
-	if ($limit) {
538
-		$offset = $limatch[2];
539
-		$count = $limatch[3];
540
-	}
541
-
542
-	$select = spip_pg_frommysql($select);
543
-
544
-	// si pas de tri explicitement demande, le GROUP BY ne
545
-	// contient que la clef primaire.
546
-	// lui ajouter alors le champ de tri par defaut
547
-	if (preg_match('/FIELD\(([a-z]+\.[a-z]+),/i', $orderby[0], $groupbyplus)) {
548
-		$groupby[] = $groupbyplus[1];
549
-	}
550
-
551
-	$orderby = spip_pg_orderby($orderby, $select);
552
-
553
-	if ($having) {
554
-		if (is_array($having)) {
555
-			$having = join("\n\tAND ", array_map('calculer_pg_where', $having));
556
-		}
557
-	}
558
-	$from = spip_pg_from($from, $prefixe);
559
-	$query = 'SELECT ' . $select
560
-		. (!$from ? '' : "\nFROM $from")
561
-		. (!$where ? '' : ("\nWHERE " . (!is_array($where) ? calculer_pg_where($where) : (join(
562
-			"\n\tAND ",
563
-			array_map('calculer_pg_where', $where)
564
-		)))))
565
-		. spip_pg_groupby($groupby, $from, $select)
566
-		. (!$having ? '' : "\nHAVING $having")
567
-		. ($orderby ? ("\nORDER BY $orderby") : '')
568
-		. (!$limit ? '' : (" LIMIT $count" . (!$offset ? '' : " OFFSET $offset")));
569
-
570
-	// renvoyer la requete inerte si demandee
571
-	if ($requeter === false) {
572
-		return $query;
573
-	}
574
-
575
-	$r = spip_pg_trace_query($query, $serveur);
576
-
577
-	return $r ?: $query;
531
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
532
+    $prefixe = $connexion['prefixe'];
533
+    $link = $connexion['link'];
534
+    $db = $connexion['db'];
535
+
536
+    $limit = preg_match('/^\s*(([0-9]+),)?\s*([0-9]+)\s*$/', $limit, $limatch);
537
+    if ($limit) {
538
+        $offset = $limatch[2];
539
+        $count = $limatch[3];
540
+    }
541
+
542
+    $select = spip_pg_frommysql($select);
543
+
544
+    // si pas de tri explicitement demande, le GROUP BY ne
545
+    // contient que la clef primaire.
546
+    // lui ajouter alors le champ de tri par defaut
547
+    if (preg_match('/FIELD\(([a-z]+\.[a-z]+),/i', $orderby[0], $groupbyplus)) {
548
+        $groupby[] = $groupbyplus[1];
549
+    }
550
+
551
+    $orderby = spip_pg_orderby($orderby, $select);
552
+
553
+    if ($having) {
554
+        if (is_array($having)) {
555
+            $having = join("\n\tAND ", array_map('calculer_pg_where', $having));
556
+        }
557
+    }
558
+    $from = spip_pg_from($from, $prefixe);
559
+    $query = 'SELECT ' . $select
560
+        . (!$from ? '' : "\nFROM $from")
561
+        . (!$where ? '' : ("\nWHERE " . (!is_array($where) ? calculer_pg_where($where) : (join(
562
+            "\n\tAND ",
563
+            array_map('calculer_pg_where', $where)
564
+        )))))
565
+        . spip_pg_groupby($groupby, $from, $select)
566
+        . (!$having ? '' : "\nHAVING $having")
567
+        . ($orderby ? ("\nORDER BY $orderby") : '')
568
+        . (!$limit ? '' : (" LIMIT $count" . (!$offset ? '' : " OFFSET $offset")));
569
+
570
+    // renvoyer la requete inerte si demandee
571
+    if ($requeter === false) {
572
+        return $query;
573
+    }
574
+
575
+    $r = spip_pg_trace_query($query, $serveur);
576
+
577
+    return $r ?: $query;
578 578
 ;
579 579
 }
580 580
 
@@ -582,26 +582,26 @@  discard block
 block discarded – undo
582 582
 // car le reste de la requete utilise les alias (AS) systematiquement
583 583
 
584 584
 function spip_pg_from($from, $prefixe) {
585
-	if (is_array($from)) {
586
-		$from = spip_pg_select_as($from);
587
-	}
585
+    if (is_array($from)) {
586
+        $from = spip_pg_select_as($from);
587
+    }
588 588
 
589
-	return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1' . $prefixe . '_', $from);
589
+    return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1' . $prefixe . '_', $from);
590 590
 }
591 591
 
592 592
 function spip_pg_orderby($order, $select) {
593
-	$res = [];
594
-	$arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order));
595
-
596
-	foreach ($arg as $v) {
597
-		if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+' . $v . '/', $select, $m)) {
598
-			$res[] = $m[1];
599
-		} else {
600
-			$res[] = $v;
601
-		}
602
-	}
603
-
604
-	return spip_pg_frommysql(join(',', $res));
593
+    $res = [];
594
+    $arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order));
595
+
596
+    foreach ($arg as $v) {
597
+        if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+' . $v . '/', $select, $m)) {
598
+            $res[] = $m[1];
599
+        } else {
600
+            $res[] = $v;
601
+        }
602
+    }
603
+
604
+    return spip_pg_frommysql(join(',', $res));
605 605
 }
606 606
 
607 607
 // Conversion a l'arrach' des jointures MySQL en jointures PG
@@ -609,56 +609,56 @@  discard block
 block discarded – undo
609 609
 // et pour enlever les repetitions (sans incidence de perf, mais ca fait sale)
610 610
 
611 611
 function spip_pg_groupby($groupby, $from, $select) {
612
-	$join = strpos($from, ',');
613
-	// ismplifier avant de decouper
614
-	if (is_string($select)) { // fct SQL sur colonne et constante apostrophee ==> la colonne
615
-	$select = preg_replace('/\w+\(\s*([^(),\']*),\s*\'[^\']*\'[^)]*\)/', '\\1', $select);
616
-	}
617
-
618
-	if ($join or $groupby) {
619
-		$join = is_array($select) ? $select : explode(', ', $select);
620
-	}
621
-	if ($join) {
622
-		// enlever les 0 as points, '', ...
623
-		foreach ($join as $k => $v) {
624
-			$v = str_replace('DISTINCT ', '', $v);
625
-			// fct SQL sur colonne et constante apostrophee ==> la colonne
626
-			$v = preg_replace('/\w+\(\s*([^(),\']*),\s*\'[^\']*\'[^)]*\)/', '\\1', $v);
627
-			$v = preg_replace('/CAST\(\s*([^(),\' ]*\s+)as\s*\w+\)/', '\\1', $v);
628
-			// resultat d'agregat ne sont pas a mettre dans le groupby
629
-			$v = preg_replace('/(SUM|COUNT|MAX|MIN|UPPER)\([^)]+\)(\s*AS\s+\w+)\s*,?/i', '', $v);
630
-			// idem sans AS (fetch numerique)
631
-			$v = preg_replace('/(SUM|COUNT|MAX|MIN|UPPER)\([^)]+\)\s*,?/i', '', $v);
632
-			// des AS simples : on garde le cote droit du AS
633
-			$v = preg_replace('/^.*\sAS\s+(\w+)\s*$/i', '\\1', $v);
634
-			// ne reste plus que les vrais colonnes, ou des constantes a virer
635
-			if (preg_match(',^[\'"],', $v) or is_numeric($v)) {
636
-				unset($join[$k]);
637
-			} else {
638
-				$join[$k] = trim($v);
639
-			}
640
-		}
641
-		$join = array_diff($join, ['']);
642
-		$join = implode(',', $join);
643
-	}
644
-	if (is_array($groupby)) {
645
-		$groupby = join(',', $groupby);
646
-	}
647
-	if ($join) {
648
-		$groupby = $groupby ? "$groupby, $join" : $join;
649
-	}
650
-	if (!$groupby) {
651
-		return '';
652
-	}
653
-
654
-	$groupby = spip_pg_frommysql($groupby);
655
-	// Ne pas mettre dans le Group-By des valeurs numeriques
656
-	// issue de prepare_recherche
657
-	$groupby = preg_replace('/^\s*\d+\s+AS\s+\w+\s*,?\s*/i', '', $groupby);
658
-	$groupby = preg_replace('/,\s*\d+\s+AS\s+\w+\s*/i', '', $groupby);
659
-	$groupby = preg_replace('/\s+AS\s+\w+\s*/i', '', $groupby);
660
-
661
-	return "\nGROUP BY $groupby";
612
+    $join = strpos($from, ',');
613
+    // ismplifier avant de decouper
614
+    if (is_string($select)) { // fct SQL sur colonne et constante apostrophee ==> la colonne
615
+    $select = preg_replace('/\w+\(\s*([^(),\']*),\s*\'[^\']*\'[^)]*\)/', '\\1', $select);
616
+    }
617
+
618
+    if ($join or $groupby) {
619
+        $join = is_array($select) ? $select : explode(', ', $select);
620
+    }
621
+    if ($join) {
622
+        // enlever les 0 as points, '', ...
623
+        foreach ($join as $k => $v) {
624
+            $v = str_replace('DISTINCT ', '', $v);
625
+            // fct SQL sur colonne et constante apostrophee ==> la colonne
626
+            $v = preg_replace('/\w+\(\s*([^(),\']*),\s*\'[^\']*\'[^)]*\)/', '\\1', $v);
627
+            $v = preg_replace('/CAST\(\s*([^(),\' ]*\s+)as\s*\w+\)/', '\\1', $v);
628
+            // resultat d'agregat ne sont pas a mettre dans le groupby
629
+            $v = preg_replace('/(SUM|COUNT|MAX|MIN|UPPER)\([^)]+\)(\s*AS\s+\w+)\s*,?/i', '', $v);
630
+            // idem sans AS (fetch numerique)
631
+            $v = preg_replace('/(SUM|COUNT|MAX|MIN|UPPER)\([^)]+\)\s*,?/i', '', $v);
632
+            // des AS simples : on garde le cote droit du AS
633
+            $v = preg_replace('/^.*\sAS\s+(\w+)\s*$/i', '\\1', $v);
634
+            // ne reste plus que les vrais colonnes, ou des constantes a virer
635
+            if (preg_match(',^[\'"],', $v) or is_numeric($v)) {
636
+                unset($join[$k]);
637
+            } else {
638
+                $join[$k] = trim($v);
639
+            }
640
+        }
641
+        $join = array_diff($join, ['']);
642
+        $join = implode(',', $join);
643
+    }
644
+    if (is_array($groupby)) {
645
+        $groupby = join(',', $groupby);
646
+    }
647
+    if ($join) {
648
+        $groupby = $groupby ? "$groupby, $join" : $join;
649
+    }
650
+    if (!$groupby) {
651
+        return '';
652
+    }
653
+
654
+    $groupby = spip_pg_frommysql($groupby);
655
+    // Ne pas mettre dans le Group-By des valeurs numeriques
656
+    // issue de prepare_recherche
657
+    $groupby = preg_replace('/^\s*\d+\s+AS\s+\w+\s*,?\s*/i', '', $groupby);
658
+    $groupby = preg_replace('/,\s*\d+\s+AS\s+\w+\s*/i', '', $groupby);
659
+    $groupby = preg_replace('/\s+AS\s+\w+\s*/i', '', $groupby);
660
+
661
+    return "\nGROUP BY $groupby";
662 662
 }
663 663
 
664 664
 // Conversion des operateurs MySQL en PG
@@ -669,492 +669,492 @@  discard block
 block discarded – undo
669 669
 // A ameliorer.
670 670
 
671 671
 function spip_pg_frommysql($arg) {
672
-	if (is_array($arg)) {
673
-		$arg = join(', ', $arg);
674
-	}
675
-
676
-	$res = spip_pg_fromfield($arg);
677
-
678
-	$res = preg_replace('/\brand[(][)]/i', 'random()', $res);
679
-
680
-	$res = preg_replace(
681
-		'/\b0\.0[+]([a-zA-Z0-9_.]+)\s*/',
682
-		'CAST(substring(\1, \'^ *[0-9.]+\') as float)',
683
-		$res
684
-	);
685
-	$res = preg_replace(
686
-		'/\b0[+]([a-zA-Z0-9_.]+)\s*/',
687
-		'CAST(substring(\1, \'^ *[0-9]+\') as int)',
688
-		$res
689
-	);
690
-	$res = preg_replace(
691
-		'/\bconv[(]([^,]*)[^)]*[)]/i',
692
-		'CAST(substring(\1, \'^ *[0-9]+\') as int)',
693
-		$res
694
-	);
695
-
696
-	$res = preg_replace(
697
-		'/UNIX_TIMESTAMP\s*[(]\s*[)]/',
698
-		' EXTRACT(epoch FROM NOW())',
699
-		$res
700
-	);
701
-
702
-	// la fonction md5(integer) n'est pas connu en pg
703
-	// il faut donc forcer les types en text (cas de md5(id_article))
704
-	$res = preg_replace(
705
-		'/md5\s*[(]([^)]*)[)]/i',
706
-		'MD5(CAST(\1 AS text))',
707
-		$res
708
-	);
709
-
710
-	$res = preg_replace(
711
-		'/UNIX_TIMESTAMP\s*[(]([^)]*)[)]/',
712
-		' EXTRACT(epoch FROM \1)',
713
-		$res
714
-	);
715
-
716
-	$res = preg_replace(
717
-		'/\bDAYOFMONTH\s*[(]([^()]*([(][^()]*[)][^()]*)*[^)]*)[)]/',
718
-		' EXTRACT(day FROM \1)',
719
-		$res
720
-	);
721
-
722
-	$res = preg_replace(
723
-		'/\bMONTH\s*[(]([^()]*([(][^)]*[)][^()]*)*[^)]*)[)]/',
724
-		' EXTRACT(month FROM \1)',
725
-		$res
726
-	);
727
-
728
-	$res = preg_replace(
729
-		'/\bYEAR\s*[(]([^()]*([(][^)]*[)][^()]*)*[^)]*)[)]/',
730
-		' EXTRACT(year FROM \1)',
731
-		$res
732
-	);
733
-
734
-	$res = preg_replace(
735
-		'/TO_DAYS\s*[(]([^()]*([(][^)]*[)][()]*)*)[)]/',
736
-		' EXTRACT(day FROM \1 - \'0001-01-01\')',
737
-		$res
738
-	);
739
-
740
-	$res = preg_replace('/(EXTRACT[(][^ ]* FROM *)"([^"]*)"/', '\1\'\2\'', $res);
741
-
742
-	$res = preg_replace('/DATE_FORMAT\s*[(]([^,]*),\s*\'%Y%m%d\'[)]/', 'to_char(\1, \'YYYYMMDD\')', $res);
743
-
744
-	$res = preg_replace('/DATE_FORMAT\s*[(]([^,]*),\s*\'%Y%m\'[)]/', 'to_char(\1, \'YYYYMM\')', $res);
745
-
746
-	$res = preg_replace('/DATE_SUB\s*[(]([^,]*),/', '(\1 -', $res);
747
-	$res = preg_replace('/DATE_ADD\s*[(]([^,]*),/', '(\1 +', $res);
748
-	$res = preg_replace('/INTERVAL\s+(\d+\s+\w+)/', 'INTERVAL \'\1\'', $res);
749
-	$res = preg_replace('/([+<>-]=?)\s*(\'\d+-\d+-\d+\s+\d+:\d+(:\d+)\')/', '\1 timestamp \2', $res);
750
-	$res = preg_replace('/(\'\d+-\d+-\d+\s+\d+:\d+:\d+\')\s*([+<>-]=?)/', 'timestamp \1 \2', $res);
751
-
752
-	$res = preg_replace('/([+<>-]=?)\s*(\'\d+-\d+-\d+\')/', '\1 timestamp \2', $res);
753
-	$res = preg_replace('/(\'\d+-\d+-\d+\')\s*([+<>-]=?)/', 'timestamp \1 \2', $res);
754
-
755
-	$res = preg_replace('/(timestamp .\d+)-00-/', '\1-01-', $res);
756
-	$res = preg_replace('/(timestamp .\d+-\d+)-00/', '\1-01', $res);
672
+    if (is_array($arg)) {
673
+        $arg = join(', ', $arg);
674
+    }
675
+
676
+    $res = spip_pg_fromfield($arg);
677
+
678
+    $res = preg_replace('/\brand[(][)]/i', 'random()', $res);
679
+
680
+    $res = preg_replace(
681
+        '/\b0\.0[+]([a-zA-Z0-9_.]+)\s*/',
682
+        'CAST(substring(\1, \'^ *[0-9.]+\') as float)',
683
+        $res
684
+    );
685
+    $res = preg_replace(
686
+        '/\b0[+]([a-zA-Z0-9_.]+)\s*/',
687
+        'CAST(substring(\1, \'^ *[0-9]+\') as int)',
688
+        $res
689
+    );
690
+    $res = preg_replace(
691
+        '/\bconv[(]([^,]*)[^)]*[)]/i',
692
+        'CAST(substring(\1, \'^ *[0-9]+\') as int)',
693
+        $res
694
+    );
695
+
696
+    $res = preg_replace(
697
+        '/UNIX_TIMESTAMP\s*[(]\s*[)]/',
698
+        ' EXTRACT(epoch FROM NOW())',
699
+        $res
700
+    );
701
+
702
+    // la fonction md5(integer) n'est pas connu en pg
703
+    // il faut donc forcer les types en text (cas de md5(id_article))
704
+    $res = preg_replace(
705
+        '/md5\s*[(]([^)]*)[)]/i',
706
+        'MD5(CAST(\1 AS text))',
707
+        $res
708
+    );
709
+
710
+    $res = preg_replace(
711
+        '/UNIX_TIMESTAMP\s*[(]([^)]*)[)]/',
712
+        ' EXTRACT(epoch FROM \1)',
713
+        $res
714
+    );
715
+
716
+    $res = preg_replace(
717
+        '/\bDAYOFMONTH\s*[(]([^()]*([(][^()]*[)][^()]*)*[^)]*)[)]/',
718
+        ' EXTRACT(day FROM \1)',
719
+        $res
720
+    );
721
+
722
+    $res = preg_replace(
723
+        '/\bMONTH\s*[(]([^()]*([(][^)]*[)][^()]*)*[^)]*)[)]/',
724
+        ' EXTRACT(month FROM \1)',
725
+        $res
726
+    );
727
+
728
+    $res = preg_replace(
729
+        '/\bYEAR\s*[(]([^()]*([(][^)]*[)][^()]*)*[^)]*)[)]/',
730
+        ' EXTRACT(year FROM \1)',
731
+        $res
732
+    );
733
+
734
+    $res = preg_replace(
735
+        '/TO_DAYS\s*[(]([^()]*([(][^)]*[)][()]*)*)[)]/',
736
+        ' EXTRACT(day FROM \1 - \'0001-01-01\')',
737
+        $res
738
+    );
739
+
740
+    $res = preg_replace('/(EXTRACT[(][^ ]* FROM *)"([^"]*)"/', '\1\'\2\'', $res);
741
+
742
+    $res = preg_replace('/DATE_FORMAT\s*[(]([^,]*),\s*\'%Y%m%d\'[)]/', 'to_char(\1, \'YYYYMMDD\')', $res);
743
+
744
+    $res = preg_replace('/DATE_FORMAT\s*[(]([^,]*),\s*\'%Y%m\'[)]/', 'to_char(\1, \'YYYYMM\')', $res);
745
+
746
+    $res = preg_replace('/DATE_SUB\s*[(]([^,]*),/', '(\1 -', $res);
747
+    $res = preg_replace('/DATE_ADD\s*[(]([^,]*),/', '(\1 +', $res);
748
+    $res = preg_replace('/INTERVAL\s+(\d+\s+\w+)/', 'INTERVAL \'\1\'', $res);
749
+    $res = preg_replace('/([+<>-]=?)\s*(\'\d+-\d+-\d+\s+\d+:\d+(:\d+)\')/', '\1 timestamp \2', $res);
750
+    $res = preg_replace('/(\'\d+-\d+-\d+\s+\d+:\d+:\d+\')\s*([+<>-]=?)/', 'timestamp \1 \2', $res);
751
+
752
+    $res = preg_replace('/([+<>-]=?)\s*(\'\d+-\d+-\d+\')/', '\1 timestamp \2', $res);
753
+    $res = preg_replace('/(\'\d+-\d+-\d+\')\s*([+<>-]=?)/', 'timestamp \1 \2', $res);
754
+
755
+    $res = preg_replace('/(timestamp .\d+)-00-/', '\1-01-', $res);
756
+    $res = preg_replace('/(timestamp .\d+-\d+)-00/', '\1-01', $res);
757 757
 # correct en theorie mais produit des debordements arithmetiques
758 758
 #	$res = preg_replace("/(EXTRACT[(][^ ]* FROM *)(timestamp *'[^']*' *[+-] *timestamp *'[^']*') *[)]/", '\2', $res);
759
-	$res = preg_replace("/(EXTRACT[(][^ ]* FROM *)('[^']*')/", '\1 timestamp \2', $res);
760
-	$res = preg_replace('/\sLIKE\s+/', ' ILIKE ', $res);
759
+    $res = preg_replace("/(EXTRACT[(][^ ]* FROM *)('[^']*')/", '\1 timestamp \2', $res);
760
+    $res = preg_replace('/\sLIKE\s+/', ' ILIKE ', $res);
761 761
 
762
-	return str_replace('REGEXP', '~', $res);
762
+    return str_replace('REGEXP', '~', $res);
763 763
 }
764 764
 
765 765
 function spip_pg_fromfield($arg) {
766
-	while (preg_match('/^(.*?)FIELD\s*\(([^,]*)((,[^,)]*)*)\)/', $arg, $m)) {
767
-		preg_match_all('/,([^,]*)/', $m[3], $r, PREG_PATTERN_ORDER);
768
-		$res = '';
769
-		$n = 0;
770
-		$index = $m[2];
771
-		foreach ($r[1] as $v) {
772
-			$n++;
773
-			$res .= "\nwhen $index=$v then $n";
774
-		}
775
-		$arg = $m[1] . "case $res else 0 end "
776
-			. substr($arg, strlen($m[0]));
777
-	}
778
-
779
-	return $arg;
766
+    while (preg_match('/^(.*?)FIELD\s*\(([^,]*)((,[^,)]*)*)\)/', $arg, $m)) {
767
+        preg_match_all('/,([^,]*)/', $m[3], $r, PREG_PATTERN_ORDER);
768
+        $res = '';
769
+        $n = 0;
770
+        $index = $m[2];
771
+        foreach ($r[1] as $v) {
772
+            $n++;
773
+            $res .= "\nwhen $index=$v then $n";
774
+        }
775
+        $arg = $m[1] . "case $res else 0 end "
776
+            . substr($arg, strlen($m[0]));
777
+    }
778
+
779
+    return $arg;
780 780
 }
781 781
 
782 782
 function calculer_pg_where($v) {
783
-	if (!is_array($v)) {
784
-		return spip_pg_frommysql($v);
785
-	}
786
-
787
-	$op = str_replace('REGEXP', '~', array_shift($v));
788
-	if (!($n = count($v))) {
789
-		return $op;
790
-	} else {
791
-		$arg = calculer_pg_where(array_shift($v));
792
-		if ($n == 1) {
793
-			return "$op($arg)";
794
-		} else {
795
-			$arg2 = calculer_pg_where(array_shift($v));
796
-			if ($n == 2) {
797
-				return "($arg $op $arg2)";
798
-			} else {
799
-				return "($arg $op ($arg2) : $v[0])";
800
-			}
801
-		}
802
-	}
783
+    if (!is_array($v)) {
784
+        return spip_pg_frommysql($v);
785
+    }
786
+
787
+    $op = str_replace('REGEXP', '~', array_shift($v));
788
+    if (!($n = count($v))) {
789
+        return $op;
790
+    } else {
791
+        $arg = calculer_pg_where(array_shift($v));
792
+        if ($n == 1) {
793
+            return "$op($arg)";
794
+        } else {
795
+            $arg2 = calculer_pg_where(array_shift($v));
796
+            if ($n == 2) {
797
+                return "($arg $op $arg2)";
798
+            } else {
799
+                return "($arg $op ($arg2) : $v[0])";
800
+            }
801
+        }
802
+    }
803 803
 }
804 804
 
805 805
 
806 806
 function calculer_pg_expression($expression, $v, $join = 'AND') {
807
-	if (empty($v)) {
808
-		return '';
809
-	}
807
+    if (empty($v)) {
808
+        return '';
809
+    }
810 810
 
811
-	$exp = "\n$expression ";
811
+    $exp = "\n$expression ";
812 812
 
813
-	if (!is_array($v)) {
814
-		$v = [$v];
815
-	}
813
+    if (!is_array($v)) {
814
+        $v = [$v];
815
+    }
816 816
 
817
-	if (strtoupper($join) === 'AND') {
818
-		return $exp . join("\n\t$join ", array_map('calculer_pg_where', $v));
819
-	} else {
820
-		return $exp . join($join, $v);
821
-	}
817
+    if (strtoupper($join) === 'AND') {
818
+        return $exp . join("\n\t$join ", array_map('calculer_pg_where', $v));
819
+    } else {
820
+        return $exp . join($join, $v);
821
+    }
822 822
 }
823 823
 
824 824
 function spip_pg_select_as($args) {
825
-	$argsas = '';
826
-	foreach ($args as $k => $v) {
827
-		if (substr($k, -1) == '@') {
828
-			// c'est une jointure qui se refere au from precedent
829
-			// pas de virgule
830
-			$argsas .= '  ' . $v;
831
-		} else {
832
-			$as = '';
833
-			//  spip_log("$k : $v", _LOG_DEBUG);
834
-			if (!is_numeric($k)) {
835
-				if (preg_match('/\.(.*)$/', $k, $r)) {
836
-					$v = $k;
837
-				} elseif ($v != $k) {
838
-					$p = strpos($v, ' ');
839
-					if ($p) {
840
-						$v = substr($v, 0, $p) . " AS $k" . substr($v, $p);
841
-					} else {
842
-						$as = " AS $k";
843
-					}
844
-				}
845
-			}
846
-			// spip_log("subs $k : $v avec $as", _LOG_DEBUG);
847
-			// if (strpos($v, 'JOIN') === false)  $argsas .= ', ';
848
-			$argsas .= ', ' . $v . $as;
849
-		}
850
-	}
851
-
852
-	return substr($argsas, 2);
825
+    $argsas = '';
826
+    foreach ($args as $k => $v) {
827
+        if (substr($k, -1) == '@') {
828
+            // c'est une jointure qui se refere au from precedent
829
+            // pas de virgule
830
+            $argsas .= '  ' . $v;
831
+        } else {
832
+            $as = '';
833
+            //  spip_log("$k : $v", _LOG_DEBUG);
834
+            if (!is_numeric($k)) {
835
+                if (preg_match('/\.(.*)$/', $k, $r)) {
836
+                    $v = $k;
837
+                } elseif ($v != $k) {
838
+                    $p = strpos($v, ' ');
839
+                    if ($p) {
840
+                        $v = substr($v, 0, $p) . " AS $k" . substr($v, $p);
841
+                    } else {
842
+                        $as = " AS $k";
843
+                    }
844
+                }
845
+            }
846
+            // spip_log("subs $k : $v avec $as", _LOG_DEBUG);
847
+            // if (strpos($v, 'JOIN') === false)  $argsas .= ', ';
848
+            $argsas .= ', ' . $v . $as;
849
+        }
850
+    }
851
+
852
+    return substr($argsas, 2);
853 853
 }
854 854
 
855 855
 function spip_pg_fetch($res, $t = '', $serveur = '', $requeter = true) {
856 856
 
857
-	if ($res) {
858
-		$res = pg_fetch_array($res, null, PGSQL_ASSOC);
859
-	}
857
+    if ($res) {
858
+        $res = pg_fetch_array($res, null, PGSQL_ASSOC);
859
+    }
860 860
 
861
-	return $res;
861
+    return $res;
862 862
 }
863 863
 
864 864
 function spip_pg_seek($r, $row_number, $serveur = '', $requeter = true) {
865
-	if ($r) {
866
-		return pg_result_seek($r, $row_number);
867
-	}
865
+    if ($r) {
866
+        return pg_result_seek($r, $row_number);
867
+    }
868 868
 }
869 869
 
870 870
 
871 871
 function spip_pg_countsel(
872
-	$from = [],
873
-	$where = [],
874
-	$groupby = [],
875
-	$having = [],
876
-	$serveur = '',
877
-	$requeter = true
872
+    $from = [],
873
+    $where = [],
874
+    $groupby = [],
875
+    $having = [],
876
+    $serveur = '',
877
+    $requeter = true
878 878
 ) {
879
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
880
-	$r = spip_pg_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
881
-	if (!$requeter) {
882
-		return $r;
883
-	}
884
-	if (!is_resource($r)) {
885
-		return 0;
886
-	}
887
-	[$c] = pg_fetch_array($r, null, PGSQL_NUM);
888
-
889
-	return $c;
879
+    $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
880
+    $r = spip_pg_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
881
+    if (!$requeter) {
882
+        return $r;
883
+    }
884
+    if (!is_resource($r)) {
885
+        return 0;
886
+    }
887
+    [$c] = pg_fetch_array($r, null, PGSQL_NUM);
888
+
889
+    return $c;
890 890
 }
891 891
 
892 892
 function spip_pg_count($res, $serveur = '', $requeter = true) {
893
-	return !$res ? 0 : pg_numrows($res);
893
+    return !$res ? 0 : pg_numrows($res);
894 894
 }
895 895
 
896 896
 function spip_pg_free($res, $serveur = '', $requeter = true) {
897
-	// rien a faire en postgres
897
+    // rien a faire en postgres
898 898
 }
899 899
 
900 900
 function spip_pg_delete($table, $where = '', $serveur = '', $requeter = true) {
901 901
 
902
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
903
-	$table = prefixer_table_spip($table, $connexion['prefixe']);
902
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
903
+    $table = prefixer_table_spip($table, $connexion['prefixe']);
904 904
 
905
-	$query = calculer_pg_expression('DELETE FROM', $table, ',')
906
-		. calculer_pg_expression('WHERE', $where, 'AND');
905
+    $query = calculer_pg_expression('DELETE FROM', $table, ',')
906
+        . calculer_pg_expression('WHERE', $where, 'AND');
907 907
 
908
-	// renvoyer la requete inerte si demandee
909
-	if (!$requeter) {
910
-		return $query;
911
-	}
908
+    // renvoyer la requete inerte si demandee
909
+    if (!$requeter) {
910
+        return $query;
911
+    }
912 912
 
913
-	$res = spip_pg_trace_query($query, $serveur);
914
-	if ($res) {
915
-		return pg_affected_rows($res);
916
-	} else {
917
-		return false;
918
-	}
913
+    $res = spip_pg_trace_query($query, $serveur);
914
+    if ($res) {
915
+        return pg_affected_rows($res);
916
+    } else {
917
+        return false;
918
+    }
919 919
 }
920 920
 
921 921
 function spip_pg_insert($table, $champs, $valeurs, $desc = [], $serveur = '', $requeter = true) {
922
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
923
-	$prefixe = $connexion['prefixe'];
924
-	$link = $connexion['link'];
925
-
926
-	if (!$desc) {
927
-		$desc = description_table($table, $serveur);
928
-	}
929
-	$seq = spip_pg_sequence($table, true);
930
-	// si pas de cle primaire dans l'insertion, renvoyer curval
931
-	if (!preg_match(",\b$seq\b,", $champs)) {
932
-		$seq = spip_pg_sequence($table);
933
-		$seq = prefixer_table_spip($seq, $prefixe);
934
-		$seq = "currval('$seq')";
935
-	}
936
-
937
-	$table = prefixer_table_spip($table, $prefixe);
938
-	$ret = !$seq ? '' : (" RETURNING $seq");
939
-	$ins = (strlen($champs) < 3)
940
-		? ' DEFAULT VALUES'
941
-		: "$champs VALUES $valeurs";
942
-	$q = "INSERT INTO $table $ins $ret";
943
-	if (!$requeter) {
944
-		return $q;
945
-	}
946
-	$connexion['last'] = $q;
947
-	$r = spip_pg_query_simple($link, $q);
922
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
923
+    $prefixe = $connexion['prefixe'];
924
+    $link = $connexion['link'];
925
+
926
+    if (!$desc) {
927
+        $desc = description_table($table, $serveur);
928
+    }
929
+    $seq = spip_pg_sequence($table, true);
930
+    // si pas de cle primaire dans l'insertion, renvoyer curval
931
+    if (!preg_match(",\b$seq\b,", $champs)) {
932
+        $seq = spip_pg_sequence($table);
933
+        $seq = prefixer_table_spip($seq, $prefixe);
934
+        $seq = "currval('$seq')";
935
+    }
936
+
937
+    $table = prefixer_table_spip($table, $prefixe);
938
+    $ret = !$seq ? '' : (" RETURNING $seq");
939
+    $ins = (strlen($champs) < 3)
940
+        ? ' DEFAULT VALUES'
941
+        : "$champs VALUES $valeurs";
942
+    $q = "INSERT INTO $table $ins $ret";
943
+    if (!$requeter) {
944
+        return $q;
945
+    }
946
+    $connexion['last'] = $q;
947
+    $r = spip_pg_query_simple($link, $q);
948 948
 #	spip_log($q,'pg.'._LOG_DEBUG);
949
-	if ($r) {
950
-		if (!$ret) {
951
-			return 0;
952
-		}
953
-		if ($r2 = pg_fetch_array($r, null, PGSQL_NUM)) {
954
-			return $r2[0];
955
-		}
956
-	}
957
-
958
-	return false;
949
+    if ($r) {
950
+        if (!$ret) {
951
+            return 0;
952
+        }
953
+        if ($r2 = pg_fetch_array($r, null, PGSQL_NUM)) {
954
+            return $r2[0];
955
+        }
956
+    }
957
+
958
+    return false;
959 959
 }
960 960
 
961 961
 function spip_pg_insertq($table, $couples = [], $desc = [], $serveur = '', $requeter = true) {
962 962
 
963
-	if (!$desc) {
964
-		$desc = description_table($table, $serveur);
965
-	}
966
-	if (!$desc) {
967
-		die("$table insertion sans description");
968
-	}
969
-	$fields = $desc['field'];
970
-
971
-	foreach ($couples as $champ => $val) {
972
-		$couples[$champ] = spip_pg_cite($val, $fields[$champ]);
973
-	}
974
-
975
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
976
-	$couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
977
-
978
-	return spip_pg_insert(
979
-		$table,
980
-		'(' . join(',', array_keys($couples)) . ')',
981
-		'(' . join(',', $couples) . ')',
982
-		$desc,
983
-		$serveur,
984
-		$requeter
985
-	);
963
+    if (!$desc) {
964
+        $desc = description_table($table, $serveur);
965
+    }
966
+    if (!$desc) {
967
+        die("$table insertion sans description");
968
+    }
969
+    $fields = $desc['field'];
970
+
971
+    foreach ($couples as $champ => $val) {
972
+        $couples[$champ] = spip_pg_cite($val, $fields[$champ]);
973
+    }
974
+
975
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
976
+    $couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
977
+
978
+    return spip_pg_insert(
979
+        $table,
980
+        '(' . join(',', array_keys($couples)) . ')',
981
+        '(' . join(',', $couples) . ')',
982
+        $desc,
983
+        $serveur,
984
+        $requeter
985
+    );
986 986
 }
987 987
 
988 988
 
989 989
 function spip_pg_insertq_multi($table, $tab_couples = [], $desc = [], $serveur = '', $requeter = true) {
990 990
 
991
-	if (!$desc) {
992
-		$desc = description_table($table, $serveur);
993
-	}
994
-	if (!$desc) {
995
-		die("$table insertion sans description");
996
-	}
997
-	$fields = $desc['field'] ?? [];
998
-
999
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1000
-	// une premiere fois pour ajouter maj dans les cles
1001
-	$c = $tab_couples[0] ?? [];
1002
-	$les_cles = spip_pg_ajouter_champs_timestamp($table, $c, $desc, $serveur);
1003
-
1004
-	$cles = '(' . join(',', array_keys($les_cles)) . ')';
1005
-	$valeurs = [];
1006
-	foreach ($tab_couples as $couples) {
1007
-		foreach ($couples as $champ => $val) {
1008
-			$couples[$champ] = spip_pg_cite($val, $fields[$champ]);
1009
-		}
1010
-		// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1011
-		$couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1012
-
1013
-		$valeurs[] = '(' . join(',', $couples) . ')';
1014
-	}
1015
-	$valeurs = implode(', ', $valeurs);
1016
-
1017
-	return spip_pg_insert($table, $cles, $valeurs, $desc, $serveur, $requeter);
991
+    if (!$desc) {
992
+        $desc = description_table($table, $serveur);
993
+    }
994
+    if (!$desc) {
995
+        die("$table insertion sans description");
996
+    }
997
+    $fields = $desc['field'] ?? [];
998
+
999
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1000
+    // une premiere fois pour ajouter maj dans les cles
1001
+    $c = $tab_couples[0] ?? [];
1002
+    $les_cles = spip_pg_ajouter_champs_timestamp($table, $c, $desc, $serveur);
1003
+
1004
+    $cles = '(' . join(',', array_keys($les_cles)) . ')';
1005
+    $valeurs = [];
1006
+    foreach ($tab_couples as $couples) {
1007
+        foreach ($couples as $champ => $val) {
1008
+            $couples[$champ] = spip_pg_cite($val, $fields[$champ]);
1009
+        }
1010
+        // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1011
+        $couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1012
+
1013
+        $valeurs[] = '(' . join(',', $couples) . ')';
1014
+    }
1015
+    $valeurs = implode(', ', $valeurs);
1016
+
1017
+    return spip_pg_insert($table, $cles, $valeurs, $desc, $serveur, $requeter);
1018 1018
 }
1019 1019
 
1020 1020
 
1021 1021
 function spip_pg_update($table, $couples, $where = '', $desc = '', $serveur = '', $requeter = true) {
1022 1022
 
1023
-	if (!$couples) {
1024
-		return;
1025
-	}
1026
-	$connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1027
-	$table = prefixer_table_spip($table, $connexion['prefixe']);
1023
+    if (!$couples) {
1024
+        return;
1025
+    }
1026
+    $connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1027
+    $table = prefixer_table_spip($table, $connexion['prefixe']);
1028 1028
 
1029
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1030
-	$couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1029
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1030
+    $couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1031 1031
 
1032
-	$set = [];
1033
-	foreach ($couples as $champ => $val) {
1034
-		$set[] = $champ . '=' . $val;
1035
-	}
1032
+    $set = [];
1033
+    foreach ($couples as $champ => $val) {
1034
+        $set[] = $champ . '=' . $val;
1035
+    }
1036 1036
 
1037
-	$query = calculer_pg_expression('UPDATE', $table, ',')
1038
-		. calculer_pg_expression('SET', $set, ',')
1039
-		. calculer_pg_expression('WHERE', $where, 'AND');
1037
+    $query = calculer_pg_expression('UPDATE', $table, ',')
1038
+        . calculer_pg_expression('SET', $set, ',')
1039
+        . calculer_pg_expression('WHERE', $where, 'AND');
1040 1040
 
1041
-	// renvoyer la requete inerte si demandee
1042
-	if (!$requeter) {
1043
-		return $query;
1044
-	}
1041
+    // renvoyer la requete inerte si demandee
1042
+    if (!$requeter) {
1043
+        return $query;
1044
+    }
1045 1045
 
1046
-	return spip_pg_trace_query($query, $serveur);
1046
+    return spip_pg_trace_query($query, $serveur);
1047 1047
 }
1048 1048
 
1049 1049
 // idem, mais les valeurs sont des constantes a mettre entre apostrophes
1050 1050
 // sauf les expressions de date lorsqu'il s'agit de fonctions SQL (NOW etc)
1051 1051
 function spip_pg_updateq($table, $couples, $where = '', $desc = [], $serveur = '', $requeter = true) {
1052
-	if (!$couples) {
1053
-		return;
1054
-	}
1055
-	if (!$desc) {
1056
-		$desc = description_table($table, $serveur);
1057
-	}
1058
-	$fields = $desc['field'];
1059
-	foreach ($couples as $k => $val) {
1060
-		$couples[$k] = spip_pg_cite($val, $fields[$k]);
1061
-	}
1062
-
1063
-	return spip_pg_update($table, $couples, $where, $desc, $serveur, $requeter);
1052
+    if (!$couples) {
1053
+        return;
1054
+    }
1055
+    if (!$desc) {
1056
+        $desc = description_table($table, $serveur);
1057
+    }
1058
+    $fields = $desc['field'];
1059
+    foreach ($couples as $k => $val) {
1060
+        $couples[$k] = spip_pg_cite($val, $fields[$k]);
1061
+    }
1062
+
1063
+    return spip_pg_update($table, $couples, $where, $desc, $serveur, $requeter);
1064 1064
 }
1065 1065
 
1066 1066
 
1067 1067
 function spip_pg_replace($table, $values, $desc, $serveur = '', $requeter = true) {
1068
-	if (!$values) {
1069
-		spip_log("replace vide $table", 'pg.' . _LOG_AVERTISSEMENT);
1070
-
1071
-		return 0;
1072
-	}
1073
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1074
-	$prefixe = $connexion['prefixe'];
1075
-	$link = $connexion['link'];
1076
-
1077
-	if (!$desc) {
1078
-		$desc = description_table($table, $serveur);
1079
-	}
1080
-	if (!$desc) {
1081
-		die("$table insertion sans description");
1082
-	}
1083
-	$prim = $desc['key']['PRIMARY KEY'];
1084
-	$ids = preg_split('/,\s*/', $prim);
1085
-	$noprims = $prims = [];
1086
-	foreach ($values as $k => $v) {
1087
-		$values[$k] = $v = spip_pg_cite($v, $desc['field'][$k]);
1088
-
1089
-		if (!in_array($k, $ids)) {
1090
-			$noprims[$k] = "$k=$v";
1091
-		} else {
1092
-			$prims[$k] = "$k=$v";
1093
-		}
1094
-	}
1095
-
1096
-	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1097
-	$values = spip_pg_ajouter_champs_timestamp($table, $values, $desc, $serveur);
1098
-
1099
-	$where = join(' AND ', $prims);
1100
-	if (!$where) {
1101
-		return spip_pg_insert(
1102
-			$table,
1103
-			'(' . join(',', array_keys($values)) . ')',
1104
-			'(' . join(',', $values) . ')',
1105
-			$desc,
1106
-			$serveur
1107
-		);
1108
-	}
1109
-	$couples = join(',', $noprims);
1110
-
1111
-	$seq = spip_pg_sequence($table);
1112
-	$table = prefixer_table_spip($table, $prefixe);
1113
-	$seq = prefixer_table_spip($seq, $prefixe);
1114
-
1115
-	$connexion['last'] = $q = "UPDATE $table SET $couples WHERE $where";
1116
-	if ($couples) {
1117
-		$couples = spip_pg_query_simple($link, $q);
1068
+    if (!$values) {
1069
+        spip_log("replace vide $table", 'pg.' . _LOG_AVERTISSEMENT);
1070
+
1071
+        return 0;
1072
+    }
1073
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1074
+    $prefixe = $connexion['prefixe'];
1075
+    $link = $connexion['link'];
1076
+
1077
+    if (!$desc) {
1078
+        $desc = description_table($table, $serveur);
1079
+    }
1080
+    if (!$desc) {
1081
+        die("$table insertion sans description");
1082
+    }
1083
+    $prim = $desc['key']['PRIMARY KEY'];
1084
+    $ids = preg_split('/,\s*/', $prim);
1085
+    $noprims = $prims = [];
1086
+    foreach ($values as $k => $v) {
1087
+        $values[$k] = $v = spip_pg_cite($v, $desc['field'][$k]);
1088
+
1089
+        if (!in_array($k, $ids)) {
1090
+            $noprims[$k] = "$k=$v";
1091
+        } else {
1092
+            $prims[$k] = "$k=$v";
1093
+        }
1094
+    }
1095
+
1096
+    // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1097
+    $values = spip_pg_ajouter_champs_timestamp($table, $values, $desc, $serveur);
1098
+
1099
+    $where = join(' AND ', $prims);
1100
+    if (!$where) {
1101
+        return spip_pg_insert(
1102
+            $table,
1103
+            '(' . join(',', array_keys($values)) . ')',
1104
+            '(' . join(',', $values) . ')',
1105
+            $desc,
1106
+            $serveur
1107
+        );
1108
+    }
1109
+    $couples = join(',', $noprims);
1110
+
1111
+    $seq = spip_pg_sequence($table);
1112
+    $table = prefixer_table_spip($table, $prefixe);
1113
+    $seq = prefixer_table_spip($seq, $prefixe);
1114
+
1115
+    $connexion['last'] = $q = "UPDATE $table SET $couples WHERE $where";
1116
+    if ($couples) {
1117
+        $couples = spip_pg_query_simple($link, $q);
1118 1118
 #	  spip_log($q,'pg.'._LOG_DEBUG);
1119
-		if (!$couples) {
1120
-			return false;
1121
-		}
1122
-		$couples = pg_affected_rows($couples);
1123
-	}
1124
-	if (!$couples) {
1125
-		$ret = !$seq ? '' :
1126
-			(" RETURNING nextval('$seq') < $prim");
1127
-		$connexion['last'] = $q = "INSERT INTO $table (" . join(',', array_keys($values)) . ') VALUES (' . join(
1128
-			',',
1129
-			$values
1130
-		) . ")$ret";
1131
-		$couples = spip_pg_query_simple($link, $q);
1132
-		if (!$couples) {
1133
-			return false;
1134
-		} elseif ($ret) {
1135
-			$r = pg_fetch_array($couples, null, PGSQL_NUM);
1136
-			if ($r[0]) {
1137
-				$connexion['last'] = $q = "SELECT setval('$seq', $prim) from $table";
1138
-				// Le code de SPIP met parfois la sequence a 0 (dans l'import)
1139
-				// MySQL n'en dit rien, on fait pareil pour PG
1140
-				$r = @pg_query($link, $q);
1141
-			}
1142
-		}
1143
-	}
1144
-
1145
-	return $couples;
1119
+        if (!$couples) {
1120
+            return false;
1121
+        }
1122
+        $couples = pg_affected_rows($couples);
1123
+    }
1124
+    if (!$couples) {
1125
+        $ret = !$seq ? '' :
1126
+            (" RETURNING nextval('$seq') < $prim");
1127
+        $connexion['last'] = $q = "INSERT INTO $table (" . join(',', array_keys($values)) . ') VALUES (' . join(
1128
+            ',',
1129
+            $values
1130
+        ) . ")$ret";
1131
+        $couples = spip_pg_query_simple($link, $q);
1132
+        if (!$couples) {
1133
+            return false;
1134
+        } elseif ($ret) {
1135
+            $r = pg_fetch_array($couples, null, PGSQL_NUM);
1136
+            if ($r[0]) {
1137
+                $connexion['last'] = $q = "SELECT setval('$seq', $prim) from $table";
1138
+                // Le code de SPIP met parfois la sequence a 0 (dans l'import)
1139
+                // MySQL n'en dit rien, on fait pareil pour PG
1140
+                $r = @pg_query($link, $q);
1141
+            }
1142
+        }
1143
+    }
1144
+
1145
+    return $couples;
1146 1146
 }
1147 1147
 
1148 1148
 
1149 1149
 function spip_pg_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) {
1150
-	$retour = null;
1151
-	// boucler pour traiter chaque requete independemment
1152
-	foreach ($tab_couples as $couples) {
1153
-		$retour = spip_pg_replace($table, $couples, $desc, $serveur, $requeter);
1154
-	}
1155
-
1156
-	// renvoie le dernier id
1157
-	return $retour;
1150
+    $retour = null;
1151
+    // boucler pour traiter chaque requete independemment
1152
+    foreach ($tab_couples as $couples) {
1153
+        $retour = spip_pg_replace($table, $couples, $desc, $serveur, $requeter);
1154
+    }
1155
+
1156
+    // renvoie le dernier id
1157
+    return $retour;
1158 1158
 }
1159 1159
 
1160 1160
 
@@ -1163,149 +1163,149 @@  discard block
 block discarded – undo
1163 1163
 
1164 1164
 function spip_pg_sequence($table, $raw = false) {
1165 1165
 
1166
-	include_spip('base/serial');
1167
-	if (!isset($GLOBALS['tables_principales'][$table])) {
1168
-		return false;
1169
-	}
1170
-	$desc = $GLOBALS['tables_principales'][$table];
1171
-	$prim = @$desc['key']['PRIMARY KEY'];
1172
-	if (
1173
-		!preg_match('/^\w+$/', $prim)
1174
-		or !str_contains($desc['field'][$prim], 'int')
1175
-	) {
1176
-		return '';
1177
-	} else {
1178
-		return $raw ? $prim : $table . '_' . $prim . '_seq';
1179
-	}
1166
+    include_spip('base/serial');
1167
+    if (!isset($GLOBALS['tables_principales'][$table])) {
1168
+        return false;
1169
+    }
1170
+    $desc = $GLOBALS['tables_principales'][$table];
1171
+    $prim = @$desc['key']['PRIMARY KEY'];
1172
+    if (
1173
+        !preg_match('/^\w+$/', $prim)
1174
+        or !str_contains($desc['field'][$prim], 'int')
1175
+    ) {
1176
+        return '';
1177
+    } else {
1178
+        return $raw ? $prim : $table . '_' . $prim . '_seq';
1179
+    }
1180 1180
 }
1181 1181
 
1182 1182
 // Explicite les conversions de Mysql d'une valeur $v de type $t
1183 1183
 // Dans le cas d'un champ date, pas d'apostrophe, c'est une syntaxe ad hoc
1184 1184
 
1185 1185
 function spip_pg_cite($v, $t) {
1186
-	if (is_null($v)) {
1187
-		return 'NULL';
1188
-	} // null php se traduit en NULL SQL
1189
-
1190
-	if (sql_test_date($t)) {
1191
-		if ($v and (strpos('0123456789', (string) $v[0]) === false)) {
1192
-			return spip_pg_frommysql($v);
1193
-		} else {
1194
-			if (strncmp($v, '0000', 4) == 0) {
1195
-				$v = '0001' . substr($v, 4);
1196
-			}
1197
-			if (strpos($v, '-00-00') === 4) {
1198
-				$v = substr($v, 0, 4) . '-01-01' . substr($v, 10);
1199
-			}
1200
-
1201
-			return "timestamp '$v'";
1202
-		}
1203
-	} elseif (!sql_test_int($t)) {
1204
-		return ("'" . pg_escape_string($v) . "'");
1205
-	} elseif (is_numeric($v) or (strpos($v, 'CAST(') === 0)) {
1206
-		return $v;
1207
-	} elseif ($v[0] == '0' and $v[1] !== 'x' and ctype_xdigit(substr($v, 1))) {
1208
-		return substr($v, 1);
1209
-	} else {
1210
-		spip_log("Warning: '$v'  n'est pas de type $t", 'pg.' . _LOG_AVERTISSEMENT);
1211
-
1212
-		return intval($v);
1213
-	}
1186
+    if (is_null($v)) {
1187
+        return 'NULL';
1188
+    } // null php se traduit en NULL SQL
1189
+
1190
+    if (sql_test_date($t)) {
1191
+        if ($v and (strpos('0123456789', (string) $v[0]) === false)) {
1192
+            return spip_pg_frommysql($v);
1193
+        } else {
1194
+            if (strncmp($v, '0000', 4) == 0) {
1195
+                $v = '0001' . substr($v, 4);
1196
+            }
1197
+            if (strpos($v, '-00-00') === 4) {
1198
+                $v = substr($v, 0, 4) . '-01-01' . substr($v, 10);
1199
+            }
1200
+
1201
+            return "timestamp '$v'";
1202
+        }
1203
+    } elseif (!sql_test_int($t)) {
1204
+        return ("'" . pg_escape_string($v) . "'");
1205
+    } elseif (is_numeric($v) or (strpos($v, 'CAST(') === 0)) {
1206
+        return $v;
1207
+    } elseif ($v[0] == '0' and $v[1] !== 'x' and ctype_xdigit(substr($v, 1))) {
1208
+        return substr($v, 1);
1209
+    } else {
1210
+        spip_log("Warning: '$v'  n'est pas de type $t", 'pg.' . _LOG_AVERTISSEMENT);
1211
+
1212
+        return intval($v);
1213
+    }
1214 1214
 }
1215 1215
 
1216 1216
 function spip_pg_hex($v) {
1217
-	return "CAST(x'" . $v . "' as bigint)";
1217
+    return "CAST(x'" . $v . "' as bigint)";
1218 1218
 }
1219 1219
 
1220 1220
 function spip_pg_quote($v, $type = '') {
1221
-	if (!is_array($v)) {
1222
-		return spip_pg_cite($v, $type);
1223
-	}
1224
-	// si c'est un tableau, le parcourir en propageant le type
1225
-	foreach ($v as $k => $r) {
1226
-		$v[$k] = spip_pg_quote($r, $type);
1227
-	}
1228
-
1229
-	return join(',', $v);
1221
+    if (!is_array($v)) {
1222
+        return spip_pg_cite($v, $type);
1223
+    }
1224
+    // si c'est un tableau, le parcourir en propageant le type
1225
+    foreach ($v as $k => $r) {
1226
+        $v[$k] = spip_pg_quote($r, $type);
1227
+    }
1228
+
1229
+    return join(',', $v);
1230 1230
 }
1231 1231
 
1232 1232
 function spip_pg_date_proche($champ, $interval, $unite) {
1233
-	return '('
1234
-	. $champ
1235
-	. (($interval <= 0) ? '>' : '<')
1236
-	. (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
1237
-	. '('
1238
-	. sql_quote(date('Y-m-d H:i:s'))
1239
-	. ', INTERVAL '
1240
-	. (($interval > 0) ? $interval : (0 - $interval))
1241
-	. ' '
1242
-	. $unite
1243
-	. '))';
1233
+    return '('
1234
+    . $champ
1235
+    . (($interval <= 0) ? '>' : '<')
1236
+    . (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
1237
+    . '('
1238
+    . sql_quote(date('Y-m-d H:i:s'))
1239
+    . ', INTERVAL '
1240
+    . (($interval > 0) ? $interval : (0 - $interval))
1241
+    . ' '
1242
+    . $unite
1243
+    . '))';
1244 1244
 }
1245 1245
 
1246 1246
 function spip_pg_in($val, $valeurs, $not = '', $serveur = '') {
1247 1247
 //
1248 1248
 // IN (...) souvent limite a 255  elements, d'ou cette fonction assistante
1249 1249
 //
1250
-	// s'il n'y a pas de valeur, eviter de produire un IN vide: PG rale.
1251
-	if (!$valeurs) {
1252
-		return $not ? '0=0' : '0=1';
1253
-	}
1254
-	if (strpos($valeurs, "CAST(x'") !== false) {
1255
-		return "($val=" . join("OR $val=", explode(',', $valeurs)) . ')';
1256
-	}
1257
-	$n = $i = 0;
1258
-	$in_sql = '';
1259
-	while ($n = strpos($valeurs, ',', $n + 1)) {
1260
-		if ((++$i) >= 255) {
1261
-			$in_sql .= "($val $not IN (" .
1262
-				substr($valeurs, 0, $n) .
1263
-				"))\n" .
1264
-				($not ? "AND\t" : "OR\t");
1265
-			$valeurs = substr($valeurs, $n + 1);
1266
-			$i = $n = 0;
1267
-		}
1268
-	}
1269
-	$in_sql .= "($val $not IN ($valeurs))";
1270
-
1271
-	return "($in_sql)";
1250
+    // s'il n'y a pas de valeur, eviter de produire un IN vide: PG rale.
1251
+    if (!$valeurs) {
1252
+        return $not ? '0=0' : '0=1';
1253
+    }
1254
+    if (strpos($valeurs, "CAST(x'") !== false) {
1255
+        return "($val=" . join("OR $val=", explode(',', $valeurs)) . ')';
1256
+    }
1257
+    $n = $i = 0;
1258
+    $in_sql = '';
1259
+    while ($n = strpos($valeurs, ',', $n + 1)) {
1260
+        if ((++$i) >= 255) {
1261
+            $in_sql .= "($val $not IN (" .
1262
+                substr($valeurs, 0, $n) .
1263
+                "))\n" .
1264
+                ($not ? "AND\t" : "OR\t");
1265
+            $valeurs = substr($valeurs, $n + 1);
1266
+            $i = $n = 0;
1267
+        }
1268
+    }
1269
+    $in_sql .= "($val $not IN ($valeurs))";
1270
+
1271
+    return "($in_sql)";
1272 1272
 }
1273 1273
 
1274 1274
 function spip_pg_error($query = '', $serveur = '', $requeter = true) {
1275
-	$link = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]['link'];
1276
-	$s = $link ? pg_last_error($link) : pg_last_error();
1277
-	if ($s) {
1278
-		$s = str_replace('ERROR', 'errcode: 1000 ', $s);
1279
-		spip_log("$s - $query", 'pg.' . _LOG_ERREUR);
1280
-	}
1281
-
1282
-	return $s;
1275
+    $link = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]['link'];
1276
+    $s = $link ? pg_last_error($link) : pg_last_error();
1277
+    if ($s) {
1278
+        $s = str_replace('ERROR', 'errcode: 1000 ', $s);
1279
+        spip_log("$s - $query", 'pg.' . _LOG_ERREUR);
1280
+    }
1281
+
1282
+    return $s;
1283 1283
 }
1284 1284
 
1285 1285
 function spip_pg_errno($serveur = '') {
1286
-	// il faudrait avoir la derniere ressource retournee et utiliser
1287
-	// http://fr2.php.net/manual/fr/function.pg-result-error.php
1288
-	return 0;
1286
+    // il faudrait avoir la derniere ressource retournee et utiliser
1287
+    // http://fr2.php.net/manual/fr/function.pg-result-error.php
1288
+    return 0;
1289 1289
 }
1290 1290
 
1291 1291
 function spip_pg_drop_table($table, $exist = '', $serveur = '', $requeter = true) {
1292
-	if ($exist) {
1293
-		$exist = ' IF EXISTS';
1294
-	}
1295
-	if (spip_pg_query("DROP TABLE$exist $table", $serveur, $requeter)) {
1296
-		return true;
1297
-	} else {
1298
-		return false;
1299
-	}
1292
+    if ($exist) {
1293
+        $exist = ' IF EXISTS';
1294
+    }
1295
+    if (spip_pg_query("DROP TABLE$exist $table", $serveur, $requeter)) {
1296
+        return true;
1297
+    } else {
1298
+        return false;
1299
+    }
1300 1300
 }
1301 1301
 
1302 1302
 // supprime une vue
1303 1303
 function spip_pg_drop_view($view, $exist = '', $serveur = '', $requeter = true) {
1304
-	if ($exist) {
1305
-		$exist = ' IF EXISTS';
1306
-	}
1304
+    if ($exist) {
1305
+        $exist = ' IF EXISTS';
1306
+    }
1307 1307
 
1308
-	return spip_pg_query("DROP VIEW$exist $view", $serveur, $requeter);
1308
+    return spip_pg_query("DROP VIEW$exist $view", $serveur, $requeter);
1309 1309
 }
1310 1310
 
1311 1311
 /**
@@ -1322,40 +1322,40 @@  discard block
 block discarded – undo
1322 1322
  *     Ressource à utiliser avec sql_fetch()
1323 1323
  **/
1324 1324
 function spip_pg_showbase($match, $serveur = '', $requeter = true) {
1325
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1326
-	$link = $connexion['link'];
1327
-	$connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE ' . _q($match);
1325
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1326
+    $link = $connexion['link'];
1327
+    $connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE ' . _q($match);
1328 1328
 
1329
-	return spip_pg_query_simple($link, $q);
1329
+    return spip_pg_query_simple($link, $q);
1330 1330
 }
1331 1331
 
1332 1332
 function spip_pg_showtable($nom_table, $serveur = '', $requeter = true) {
1333
-	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1334
-	$link = $connexion['link'];
1335
-	$connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE ' . _q($nom_table);
1336
-
1337
-	$res = spip_pg_query_simple($link, $q);
1338
-	if (!$res) {
1339
-		return false;
1340
-	}
1341
-
1342
-	// etrangement, $res peut ne rien contenir, mais arriver ici...
1343
-	// il faut en tenir compte dans le return
1344
-	$fields = [];
1345
-	while ($field = pg_fetch_array($res, null, PGSQL_NUM)) {
1346
-		$fields[$field[0]] = $field[2] . (!$field[1] ? '' : (' DEFAULT ' . $field[1]));
1347
-	}
1348
-	$connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE ' . _q($nom_table);
1349
-	$res = spip_pg_query_simple($link, $q);
1350
-	$keys = [];
1351
-	while ($index = pg_fetch_array($res, null, PGSQL_NUM)) {
1352
-		if (preg_match('/CREATE\s+(UNIQUE\s+)?INDEX\s([^\s]+).*\((.*)\)$/', $index[0], $r)) {
1353
-			$nom = str_replace($nom_table . '_', '', $r[2]);
1354
-			$keys[($r[1] ? 'PRIMARY KEY' : ('KEY ' . $nom))] = $r[3];
1355
-		}
1356
-	}
1357
-
1358
-	return count($fields) ? ['field' => $fields, 'key' => $keys] : false;
1333
+    $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1334
+    $link = $connexion['link'];
1335
+    $connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE ' . _q($nom_table);
1336
+
1337
+    $res = spip_pg_query_simple($link, $q);
1338
+    if (!$res) {
1339
+        return false;
1340
+    }
1341
+
1342
+    // etrangement, $res peut ne rien contenir, mais arriver ici...
1343
+    // il faut en tenir compte dans le return
1344
+    $fields = [];
1345
+    while ($field = pg_fetch_array($res, null, PGSQL_NUM)) {
1346
+        $fields[$field[0]] = $field[2] . (!$field[1] ? '' : (' DEFAULT ' . $field[1]));
1347
+    }
1348
+    $connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE ' . _q($nom_table);
1349
+    $res = spip_pg_query_simple($link, $q);
1350
+    $keys = [];
1351
+    while ($index = pg_fetch_array($res, null, PGSQL_NUM)) {
1352
+        if (preg_match('/CREATE\s+(UNIQUE\s+)?INDEX\s([^\s]+).*\((.*)\)$/', $index[0], $r)) {
1353
+            $nom = str_replace($nom_table . '_', '', $r[2]);
1354
+            $keys[($r[1] ? 'PRIMARY KEY' : ('KEY ' . $nom))] = $r[3];
1355
+        }
1356
+    }
1357
+
1358
+    return count($fields) ? ['field' => $fields, 'key' => $keys] : false;
1359 1359
 }
1360 1360
 
1361 1361
 // Fonction de creation d'une table SQL nommee $nom
@@ -1366,116 +1366,116 @@  discard block
 block discarded – undo
1366 1366
 // Le nom des index est prefixe par celui de la table pour eviter les conflits
1367 1367
 function spip_pg_create($nom, $champs, $cles, $autoinc = false, $temporary = false, $serveur = '', $requeter = true) {
1368 1368
 
1369
-	$connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1370
-	$link = $connexion['link'];
1371
-	$nom = prefixer_table_spip($nom, $connexion['prefixe']);
1372
-
1373
-	$query = $prim = $prim_name = $v = $s = $p = '';
1374
-	$keys = [];
1375
-
1376
-	// certains plugins declarent les tables  (permet leur inclusion dans le dump)
1377
-	// sans les renseigner (laisse le compilo recuperer la description)
1378
-	if (!is_array($champs) || !is_array($cles)) {
1379
-		return;
1380
-	}
1381
-
1382
-	foreach ($cles as $k => $v) {
1383
-		if (strpos($k, 'KEY ') === 0) {
1384
-			$n = str_replace('`', '', $k);
1385
-			$v = str_replace('`', '"', $v);
1386
-			$i = $nom . preg_replace('/KEY +/', '_', $n);
1387
-			if ($k != $n) {
1388
-				$i = "\"$i\"";
1389
-			}
1390
-			$keys[] = "CREATE INDEX $i ON $nom ($v);";
1391
-		} elseif (strpos($k, 'UNIQUE ') === 0) {
1392
-			$k = preg_replace('/^UNIQUE +/', '', $k);
1393
-			$prim .= "$s\n\t\tCONSTRAINT " . str_replace('`', '"', $k) . " UNIQUE ($v)";
1394
-		} else {
1395
-			$prim .= "$s\n\t\t" . str_replace('`', '"', $k) . " ($v)";
1396
-		}
1397
-		if ($k == 'PRIMARY KEY') {
1398
-			$prim_name = $v;
1399
-		}
1400
-		$s = ',';
1401
-	}
1402
-	$s = '';
1403
-
1404
-	$character_set = '';
1405
-	if (@$GLOBALS['meta']['charset_sql_base']) {
1406
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
1407
-	}
1408
-	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
1409
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
1410
-	}
1411
-
1412
-	foreach ($champs as $k => $v) {
1413
-		$k = str_replace('`', '"', $k);
1414
-		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
1415
-			if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) {
1416
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
1417
-			}
1418
-		}
1419
-
1420
-		$query .= "$s\n\t\t$k "
1421
-			. (($autoinc && ($prim_name == $k) && preg_match(',\b(big|small|medium|tiny)?int\b,i', $v))
1422
-				? ' bigserial'
1423
-				: mysql2pg_type($v)
1424
-			);
1425
-		$s = ',';
1426
-	}
1427
-	$temporary = $temporary ? 'TEMPORARY' : '';
1428
-
1429
-	// En l'absence de "if not exists" en PG, on neutralise les erreurs
1430
-
1431
-	$q = "CREATE $temporary TABLE $nom ($query" . ($prim ? ",$prim" : '') . ')' .
1432
-		($character_set ? " DEFAULT $character_set" : '')
1433
-		. "\n";
1434
-
1435
-	if (!$requeter) {
1436
-		return $q;
1437
-	}
1438
-	$connexion['last'] = $q;
1439
-	$r = @pg_query($link, $q);
1440
-
1441
-	if (!$r) {
1442
-		spip_log("Impossible de creer cette table: $q", 'pg.' . _LOG_ERREUR);
1443
-	} else {
1444
-		foreach ($keys as $index) {
1445
-			pg_query($link, $index);
1446
-		}
1447
-	}
1448
-
1449
-	return $r;
1369
+    $connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1370
+    $link = $connexion['link'];
1371
+    $nom = prefixer_table_spip($nom, $connexion['prefixe']);
1372
+
1373
+    $query = $prim = $prim_name = $v = $s = $p = '';
1374
+    $keys = [];
1375
+
1376
+    // certains plugins declarent les tables  (permet leur inclusion dans le dump)
1377
+    // sans les renseigner (laisse le compilo recuperer la description)
1378
+    if (!is_array($champs) || !is_array($cles)) {
1379
+        return;
1380
+    }
1381
+
1382
+    foreach ($cles as $k => $v) {
1383
+        if (strpos($k, 'KEY ') === 0) {
1384
+            $n = str_replace('`', '', $k);
1385
+            $v = str_replace('`', '"', $v);
1386
+            $i = $nom . preg_replace('/KEY +/', '_', $n);
1387
+            if ($k != $n) {
1388
+                $i = "\"$i\"";
1389
+            }
1390
+            $keys[] = "CREATE INDEX $i ON $nom ($v);";
1391
+        } elseif (strpos($k, 'UNIQUE ') === 0) {
1392
+            $k = preg_replace('/^UNIQUE +/', '', $k);
1393
+            $prim .= "$s\n\t\tCONSTRAINT " . str_replace('`', '"', $k) . " UNIQUE ($v)";
1394
+        } else {
1395
+            $prim .= "$s\n\t\t" . str_replace('`', '"', $k) . " ($v)";
1396
+        }
1397
+        if ($k == 'PRIMARY KEY') {
1398
+            $prim_name = $v;
1399
+        }
1400
+        $s = ',';
1401
+    }
1402
+    $s = '';
1403
+
1404
+    $character_set = '';
1405
+    if (@$GLOBALS['meta']['charset_sql_base']) {
1406
+        $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
1407
+    }
1408
+    if (@$GLOBALS['meta']['charset_collation_sql_base']) {
1409
+        $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
1410
+    }
1411
+
1412
+    foreach ($champs as $k => $v) {
1413
+        $k = str_replace('`', '"', $k);
1414
+        if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
1415
+            if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) {
1416
+                $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
1417
+            }
1418
+        }
1419
+
1420
+        $query .= "$s\n\t\t$k "
1421
+            . (($autoinc && ($prim_name == $k) && preg_match(',\b(big|small|medium|tiny)?int\b,i', $v))
1422
+                ? ' bigserial'
1423
+                : mysql2pg_type($v)
1424
+            );
1425
+        $s = ',';
1426
+    }
1427
+    $temporary = $temporary ? 'TEMPORARY' : '';
1428
+
1429
+    // En l'absence de "if not exists" en PG, on neutralise les erreurs
1430
+
1431
+    $q = "CREATE $temporary TABLE $nom ($query" . ($prim ? ",$prim" : '') . ')' .
1432
+        ($character_set ? " DEFAULT $character_set" : '')
1433
+        . "\n";
1434
+
1435
+    if (!$requeter) {
1436
+        return $q;
1437
+    }
1438
+    $connexion['last'] = $q;
1439
+    $r = @pg_query($link, $q);
1440
+
1441
+    if (!$r) {
1442
+        spip_log("Impossible de creer cette table: $q", 'pg.' . _LOG_ERREUR);
1443
+    } else {
1444
+        foreach ($keys as $index) {
1445
+            pg_query($link, $index);
1446
+        }
1447
+    }
1448
+
1449
+    return $r;
1450 1450
 }
1451 1451
 
1452 1452
 
1453 1453
 function spip_pg_create_base($nom, $serveur = '', $requeter = true) {
1454
-	return spip_pg_query("CREATE DATABASE $nom", $serveur, $requeter);
1454
+    return spip_pg_query("CREATE DATABASE $nom", $serveur, $requeter);
1455 1455
 }
1456 1456
 
1457 1457
 // Fonction de creation d'une vue SQL nommee $nom
1458 1458
 function spip_pg_create_view($nom, $query_select, $serveur = '', $requeter = true) {
1459
-	if (!$query_select) {
1460
-		return false;
1461
-	}
1462
-	// vue deja presente
1463
-	if (sql_showtable($nom, false, $serveur)) {
1464
-		if ($requeter) {
1465
-			spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.' . _LOG_ERREUR);
1466
-		}
1459
+    if (!$query_select) {
1460
+        return false;
1461
+    }
1462
+    // vue deja presente
1463
+    if (sql_showtable($nom, false, $serveur)) {
1464
+        if ($requeter) {
1465
+            spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.' . _LOG_ERREUR);
1466
+        }
1467 1467
 
1468
-		return false;
1469
-	}
1468
+        return false;
1469
+    }
1470 1470
 
1471
-	$query = "CREATE VIEW $nom AS " . $query_select;
1471
+    $query = "CREATE VIEW $nom AS " . $query_select;
1472 1472
 
1473
-	return spip_pg_query($query, $serveur, $requeter);
1473
+    return spip_pg_query($query, $serveur, $requeter);
1474 1474
 }
1475 1475
 
1476 1476
 
1477 1477
 function spip_pg_set_connect_charset($charset, $serveur = '', $requeter = true) {
1478
-	spip_log('changement de charset sql a ecrire en PG', 'pg.' . _LOG_ERREUR);
1478
+    spip_log('changement de charset sql a ecrire en PG', 'pg.' . _LOG_ERREUR);
1479 1479
 }
1480 1480
 
1481 1481
 
@@ -1488,50 +1488,50 @@  discard block
 block discarded – undo
1488 1488
  * @return bool|string true / false / requete
1489 1489
  **/
1490 1490
 function spip_pg_optimize($table, $serveur = '', $requeter = true) {
1491
-	return spip_pg_query('VACUUM ' . $table, $serveur, $requeter);
1491
+    return spip_pg_query('VACUUM ' . $table, $serveur, $requeter);
1492 1492
 }
1493 1493
 
1494 1494
 // Selectionner la sous-chaine dans $objet
1495 1495
 // correspondant a $lang. Cf balise Multi de Spip
1496 1496
 
1497 1497
 function spip_pg_multi($objet, $lang) {
1498
-	$r = 'regexp_replace('
1499
-		. $objet
1500
-		. ",'<multi>.*[[]"
1501
-		. $lang
1502
-		. "[]]([^[]*).*</multi>', E'\\\\1') AS multi";
1498
+    $r = 'regexp_replace('
1499
+        . $objet
1500
+        . ",'<multi>.*[[]"
1501
+        . $lang
1502
+        . "[]]([^[]*).*</multi>', E'\\\\1') AS multi";
1503 1503
 
1504
-	return $r;
1504
+    return $r;
1505 1505
 }
1506 1506
 
1507 1507
 // Palanquee d'idiosyncrasies MySQL dans les creations de table
1508 1508
 // A completer par les autres, mais essayer de reduire en amont.
1509 1509
 
1510 1510
 function mysql2pg_type($v) {
1511
-	$remplace = [
1512
-		'/auto_increment/i' => '', // non reconnu
1513
-		'/bigint/i' => 'bigint',
1514
-		'/mediumint/i' => 'mediumint',
1515
-		'/smallint/i' => 'smallint',
1516
-		'/tinyint/i' => 'int',
1517
-		'/int\s*[(]\s*\d+\s*[)]/i' => 'int',
1518
-		'/longtext/i' => 'text',
1519
-		'/mediumtext/i' => 'text',
1520
-		'/tinytext/i' => 'text',
1521
-		'/longblob/i' => 'text',
1522
-		'/0000-00-00/' => '0001-01-01',
1523
-		'/datetime/i' => 'timestamp',
1524
-		'/unsigned/i' => '',
1525
-		'/double/i' => 'double precision',
1526
-		'/VARCHAR\((\d+)\)\s+BINARY/i' => 'varchar(\1)',
1527
-		'/ENUM *[(][^)]*[)]/i' => 'varchar(255)',
1528
-		'/(timestamp .* )ON .*$/is' => '\\1',
1529
-	];
1530
-
1531
-	return preg_replace(array_keys($remplace), array_values($remplace), $v);
1511
+    $remplace = [
1512
+        '/auto_increment/i' => '', // non reconnu
1513
+        '/bigint/i' => 'bigint',
1514
+        '/mediumint/i' => 'mediumint',
1515
+        '/smallint/i' => 'smallint',
1516
+        '/tinyint/i' => 'int',
1517
+        '/int\s*[(]\s*\d+\s*[)]/i' => 'int',
1518
+        '/longtext/i' => 'text',
1519
+        '/mediumtext/i' => 'text',
1520
+        '/tinytext/i' => 'text',
1521
+        '/longblob/i' => 'text',
1522
+        '/0000-00-00/' => '0001-01-01',
1523
+        '/datetime/i' => 'timestamp',
1524
+        '/unsigned/i' => '',
1525
+        '/double/i' => 'double precision',
1526
+        '/VARCHAR\((\d+)\)\s+BINARY/i' => 'varchar(\1)',
1527
+        '/ENUM *[(][^)]*[)]/i' => 'varchar(255)',
1528
+        '/(timestamp .* )ON .*$/is' => '\\1',
1529
+    ];
1530
+
1531
+    return preg_replace(array_keys($remplace), array_values($remplace), $v);
1532 1532
 }
1533 1533
 
1534 1534
 // Renvoie false si on n'a pas les fonctions pg (pour l'install)
1535 1535
 function spip_versions_pg() {
1536
-	return function_exists('pg_connect');
1536
+    return function_exists('pg_connect');
1537 1537
 }
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Indentation   +621 added lines, -621 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 
@@ -55,65 +55,65 @@  discard block
 block discarded – undo
55 55
  * @return void
56 56
  **/
57 57
 function calculer_rubriques_if($id_rubrique, $modifs, $infos = [], $postdate = false) {
58
-	$statuts_publies = null;
59
-	$neuf = false;
60
-
61
-	// Compat avec l'ancienne signature
62
-	if (is_string($infos)) {
63
-		$infos = ['statut_ancien' => $infos];
64
-	}
65
-	if (!isset($infos['statut_ancien'])) {
66
-		$infos['statut_ancien'] = '';
67
-	}
68
-
69
-	// On recherche quels statuts tester
70
-	if (
71
-		isset($infos['objet'])
72
-		and include_spip('inc/filtres')
73
-		and $declaration_statut = objet_info($infos['objet'], 'statut')
74
-		and is_array($declaration_statut)
75
-	) {
76
-		foreach ($declaration_statut as $champ_statut) {
77
-			if ($champ_statut['champ'] == 'statut') {
78
-				$statuts_publies = array_map('trim', explode(',', $champ_statut['publie']));
79
-				break; // stop on a trouvé le bon champ
80
-			}
81
-		}
82
-	} else {
83
-		$statuts_publies = ['publie'];
84
-	}
85
-
86
-	if (in_array($infos['statut_ancien'], $statuts_publies)) {
87
-		if (
88
-			isset($modifs['statut'])
89
-			or isset($modifs['id_rubrique'])
90
-			or ($postdate and strtotime($postdate) > time())
91
-		) {
92
-			$neuf |= depublier_branche_rubrique_if($id_rubrique);
93
-		}
94
-		// ne publier que si c'est pas un postdate, ou si la date n'est pas dans le futur
95
-		if ($postdate) {
96
-			calculer_prochain_postdate(true);
97
-			$neuf |= (strtotime($postdate) <= time()); // par securite
98
-		} elseif (isset($modifs['id_rubrique'])) {
99
-			$neuf |= publier_branche_rubrique($modifs['id_rubrique']);
100
-		}
101
-	} elseif (isset($modifs['statut']) and in_array($modifs['statut'], $statuts_publies)) {
102
-		if ($postdate) {
103
-			calculer_prochain_postdate(true);
104
-			$neuf |= (strtotime($postdate) <= time()); // par securite
105
-		} else {
106
-			$neuf |= publier_branche_rubrique($id_rubrique);
107
-		}
108
-	}
109
-
110
-	if ($neuf) {
111
-		// Sauver la date de la derniere mise a jour (pour menu_rubriques)
112
-		ecrire_meta('date_calcul_rubriques', date('U'));
113
-	}
114
-
115
-	$langues = calculer_langues_utilisees();
116
-	ecrire_meta('langues_utilisees', $langues);
58
+    $statuts_publies = null;
59
+    $neuf = false;
60
+
61
+    // Compat avec l'ancienne signature
62
+    if (is_string($infos)) {
63
+        $infos = ['statut_ancien' => $infos];
64
+    }
65
+    if (!isset($infos['statut_ancien'])) {
66
+        $infos['statut_ancien'] = '';
67
+    }
68
+
69
+    // On recherche quels statuts tester
70
+    if (
71
+        isset($infos['objet'])
72
+        and include_spip('inc/filtres')
73
+        and $declaration_statut = objet_info($infos['objet'], 'statut')
74
+        and is_array($declaration_statut)
75
+    ) {
76
+        foreach ($declaration_statut as $champ_statut) {
77
+            if ($champ_statut['champ'] == 'statut') {
78
+                $statuts_publies = array_map('trim', explode(',', $champ_statut['publie']));
79
+                break; // stop on a trouvé le bon champ
80
+            }
81
+        }
82
+    } else {
83
+        $statuts_publies = ['publie'];
84
+    }
85
+
86
+    if (in_array($infos['statut_ancien'], $statuts_publies)) {
87
+        if (
88
+            isset($modifs['statut'])
89
+            or isset($modifs['id_rubrique'])
90
+            or ($postdate and strtotime($postdate) > time())
91
+        ) {
92
+            $neuf |= depublier_branche_rubrique_if($id_rubrique);
93
+        }
94
+        // ne publier que si c'est pas un postdate, ou si la date n'est pas dans le futur
95
+        if ($postdate) {
96
+            calculer_prochain_postdate(true);
97
+            $neuf |= (strtotime($postdate) <= time()); // par securite
98
+        } elseif (isset($modifs['id_rubrique'])) {
99
+            $neuf |= publier_branche_rubrique($modifs['id_rubrique']);
100
+        }
101
+    } elseif (isset($modifs['statut']) and in_array($modifs['statut'], $statuts_publies)) {
102
+        if ($postdate) {
103
+            calculer_prochain_postdate(true);
104
+            $neuf |= (strtotime($postdate) <= time()); // par securite
105
+        } else {
106
+            $neuf |= publier_branche_rubrique($id_rubrique);
107
+        }
108
+    }
109
+
110
+    if ($neuf) {
111
+        // Sauver la date de la derniere mise a jour (pour menu_rubriques)
112
+        ecrire_meta('date_calcul_rubriques', date('U'));
113
+    }
114
+
115
+    $langues = calculer_langues_utilisees();
116
+    ecrire_meta('langues_utilisees', $langues);
117 117
 }
118 118
 
119 119
 
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
  *     true si le statut change effectivement
132 132
  */
133 133
 function publier_branche_rubrique($id_rubrique) {
134
-	$id_pred = $id_rubrique;
135
-	while (true) {
136
-		sql_updateq(
137
-			'spip_rubriques',
138
-			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
139
-			'id_rubrique=' . intval($id_rubrique)
140
-		);
141
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
142
-		if (!$id_parent) {
143
-			break;
144
-		}
145
-		$id_rubrique = $id_parent;
146
-	}
134
+    $id_pred = $id_rubrique;
135
+    while (true) {
136
+        sql_updateq(
137
+            'spip_rubriques',
138
+            ['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
139
+            'id_rubrique=' . intval($id_rubrique)
140
+        );
141
+        $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
142
+        if (!$id_parent) {
143
+            break;
144
+        }
145
+        $id_rubrique = $id_parent;
146
+    }
147 147
 
148 148
 #	spip_log(" publier_branche_rubrique($id_rubrique $id_pred");
149
-	return $id_pred != $id_rubrique;
149
+    return $id_pred != $id_rubrique;
150 150
 }
151 151
 
152 152
 /**
@@ -164,20 +164,20 @@  discard block
 block discarded – undo
164 164
  *     true si le statut change effectivement
165 165
  */
166 166
 function depublier_branche_rubrique_if($id_rubrique) {
167
-	$date = date('Y-m-d H:i:s'); // figer la date
168
-
169
-	#	spip_log("depublier_branche_rubrique($id_rubrique ?");
170
-	$id_pred = $id_rubrique;
171
-	while ($id_pred) {
172
-		if (!depublier_rubrique_if($id_pred, $date)) {
173
-			return $id_pred != $id_rubrique;
174
-		}
175
-		// passer au parent si on a depublie
176
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
177
-		$id_pred = $r['id_parent'];
178
-	}
179
-
180
-	return $id_pred != $id_rubrique;
167
+    $date = date('Y-m-d H:i:s'); // figer la date
168
+
169
+    #	spip_log("depublier_branche_rubrique($id_rubrique ?");
170
+    $id_pred = $id_rubrique;
171
+    while ($id_pred) {
172
+        if (!depublier_rubrique_if($id_pred, $date)) {
173
+            return $id_pred != $id_rubrique;
174
+        }
175
+        // passer au parent si on a depublie
176
+        $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
177
+        $id_pred = $r['id_parent'];
178
+    }
179
+
180
+    return $id_pred != $id_rubrique;
181 181
 }
182 182
 
183 183
 /**
@@ -194,61 +194,61 @@  discard block
 block discarded – undo
194 194
  *    true si la rubrique a été dépubliée
195 195
  */
196 196
 function depublier_rubrique_if($id_rubrique, $date = null) {
197
-	if (is_null($date)) {
198
-		$date = date('Y-m-d H:i:s');
199
-	}
200
-	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
201
-		' AND date <= ' . sql_quote($date) : '';
202
-
203
-	if (!$id_rubrique = intval($id_rubrique)) {
204
-		return false;
205
-	}
206
-
207
-	// verifier qu'elle existe et est bien publiee
208
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
209
-	if (!$r or $r['statut'] !== 'publie') {
210
-		return false;
211
-	}
212
-
213
-	// On met le nombre de chaque type d'enfants dans un tableau
214
-	// Le type de l'objet est au pluriel
215
-	$compte = [
216
-		'articles' => sql_countsel(
217
-			'spip_articles',
218
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
219
-		),
220
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
221
-		'documents' => sql_countsel(
222
-			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
223
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
224
-		)
225
-	];
226
-
227
-	// On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
228
-	$compte = pipeline(
229
-		'objet_compte_enfants',
230
-		[
231
-			'args' => [
232
-				'objet' => 'rubrique',
233
-				'id_objet' => $id_rubrique,
234
-				'statut' => 'publie',
235
-				'date' => $date
236
-			],
237
-			'data' => $compte
238
-		]
239
-	);
240
-
241
-	// S'il y a au moins un enfant de n'importe quoi, on ne dépublie pas
242
-	foreach ($compte as $objet => $n) {
243
-		if ($n) {
244
-			return false;
245
-		}
246
-	}
247
-
248
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
197
+    if (is_null($date)) {
198
+        $date = date('Y-m-d H:i:s');
199
+    }
200
+    $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
201
+        ' AND date <= ' . sql_quote($date) : '';
202
+
203
+    if (!$id_rubrique = intval($id_rubrique)) {
204
+        return false;
205
+    }
206
+
207
+    // verifier qu'elle existe et est bien publiee
208
+    $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
209
+    if (!$r or $r['statut'] !== 'publie') {
210
+        return false;
211
+    }
212
+
213
+    // On met le nombre de chaque type d'enfants dans un tableau
214
+    // Le type de l'objet est au pluriel
215
+    $compte = [
216
+        'articles' => sql_countsel(
217
+            'spip_articles',
218
+            'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
219
+        ),
220
+        'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
221
+        'documents' => sql_countsel(
222
+            'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
223
+            'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
224
+        )
225
+    ];
226
+
227
+    // On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
228
+    $compte = pipeline(
229
+        'objet_compte_enfants',
230
+        [
231
+            'args' => [
232
+                'objet' => 'rubrique',
233
+                'id_objet' => $id_rubrique,
234
+                'statut' => 'publie',
235
+                'date' => $date
236
+            ],
237
+            'data' => $compte
238
+        ]
239
+    );
240
+
241
+    // S'il y a au moins un enfant de n'importe quoi, on ne dépublie pas
242
+    foreach ($compte as $objet => $n) {
243
+        if ($n) {
244
+            return false;
245
+        }
246
+    }
247
+
248
+    sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
249 249
 
250 250
 #		spip_log("depublier_rubrique $id_pred");
251
-	return true;
251
+    return true;
252 252
 }
253 253
 
254 254
 
@@ -271,18 +271,18 @@  discard block
 block discarded – undo
271 271
  **/
272 272
 function calculer_rubriques() {
273 273
 
274
-	calculer_rubriques_publiees();
274
+    calculer_rubriques_publiees();
275 275
 
276
-	// Apres chaque (de)publication
277
-	// recalculer les langues utilisees sur le site
278
-	$langues = calculer_langues_utilisees();
279
-	ecrire_meta('langues_utilisees', $langues);
276
+    // Apres chaque (de)publication
277
+    // recalculer les langues utilisees sur le site
278
+    $langues = calculer_langues_utilisees();
279
+    ecrire_meta('langues_utilisees', $langues);
280 280
 
281
-	// Sauver la date de la derniere mise a jour (pour menu_rubriques)
282
-	ecrire_meta('date_calcul_rubriques', date('U'));
281
+    // Sauver la date de la derniere mise a jour (pour menu_rubriques)
282
+    ecrire_meta('date_calcul_rubriques', date('U'));
283 283
 
284
-	// on calcule la date du prochain article post-date
285
-	calculer_prochain_postdate();
284
+    // on calcule la date du prochain article post-date
285
+    calculer_prochain_postdate();
286 286
 }
287 287
 
288 288
 
@@ -299,61 +299,61 @@  discard block
 block discarded – undo
299 299
  **/
300 300
 function calculer_rubriques_publiees() {
301 301
 
302
-	// Mettre les compteurs a zero
303
-	sql_updateq('spip_rubriques', ['date_tmp' => '0000-00-00 00:00:00', 'statut_tmp' => 'prepa']);
304
-
305
-	//
306
-	// Publier et dater les rubriques qui ont un article publie
307
-	//
308
-
309
-	// Afficher les articles post-dates ?
310
-	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
311
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
312
-
313
-	$r = sql_select(
314
-		'R.id_rubrique AS id, max(A.date) AS date_h',
315
-		'spip_rubriques AS R JOIN spip_articles AS A ON R.id_rubrique = A.id_rubrique',
316
-		"A.date>R.date_tmp AND A.statut='publie' $postdates ",
317
-		'R.id_rubrique'
318
-	);
319
-	while ($row = sql_fetch($r)) {
320
-		sql_updateq(
321
-			'spip_rubriques',
322
-			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
323
-			'id_rubrique=' . intval($row['id'])
324
-		);
325
-	}
326
-
327
-	// point d'entree pour permettre a des plugins de gerer le statut
328
-	// autrement (par ex: toute rubrique est publiee des sa creation)
329
-	// Ce pipeline fait ce qu'il veut, mais s'il touche aux statuts/dates
330
-	// c'est statut_tmp/date_tmp qu'il doit modifier
331
-	// [C'est un trigger... a renommer en trig_calculer_rubriques ?]
332
-	pipeline('calculer_rubriques', null);
333
-
334
-
335
-	// Les rubriques qui ont une rubrique fille plus recente
336
-	// on tourne tant que les donnees remontent vers la racine.
337
-	do {
338
-		$continuer = false;
339
-		$r = sql_select(
340
-			'R.id_rubrique AS id, max(SR.date_tmp) AS date_h',
341
-			'spip_rubriques AS R JOIN spip_rubriques AS SR ON R.id_rubrique = SR.id_parent',
342
-			"(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ",
343
-			'R.id_rubrique'
344
-		);
345
-		while ($row = sql_fetch($r)) {
346
-			sql_updateq(
347
-				'spip_rubriques',
348
-				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
349
-				'id_rubrique=' . intval($row['id'])
350
-			);
351
-			$continuer = true;
352
-		}
353
-	} while ($continuer);
354
-
355
-	// Enregistrement des modifs
356
-	sql_update('spip_rubriques', ['date' => 'date_tmp', 'statut' => 'statut_tmp']);
302
+    // Mettre les compteurs a zero
303
+    sql_updateq('spip_rubriques', ['date_tmp' => '0000-00-00 00:00:00', 'statut_tmp' => 'prepa']);
304
+
305
+    //
306
+    // Publier et dater les rubriques qui ont un article publie
307
+    //
308
+
309
+    // Afficher les articles post-dates ?
310
+    $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
311
+        'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
312
+
313
+    $r = sql_select(
314
+        'R.id_rubrique AS id, max(A.date) AS date_h',
315
+        'spip_rubriques AS R JOIN spip_articles AS A ON R.id_rubrique = A.id_rubrique',
316
+        "A.date>R.date_tmp AND A.statut='publie' $postdates ",
317
+        'R.id_rubrique'
318
+    );
319
+    while ($row = sql_fetch($r)) {
320
+        sql_updateq(
321
+            'spip_rubriques',
322
+            ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
323
+            'id_rubrique=' . intval($row['id'])
324
+        );
325
+    }
326
+
327
+    // point d'entree pour permettre a des plugins de gerer le statut
328
+    // autrement (par ex: toute rubrique est publiee des sa creation)
329
+    // Ce pipeline fait ce qu'il veut, mais s'il touche aux statuts/dates
330
+    // c'est statut_tmp/date_tmp qu'il doit modifier
331
+    // [C'est un trigger... a renommer en trig_calculer_rubriques ?]
332
+    pipeline('calculer_rubriques', null);
333
+
334
+
335
+    // Les rubriques qui ont une rubrique fille plus recente
336
+    // on tourne tant que les donnees remontent vers la racine.
337
+    do {
338
+        $continuer = false;
339
+        $r = sql_select(
340
+            'R.id_rubrique AS id, max(SR.date_tmp) AS date_h',
341
+            'spip_rubriques AS R JOIN spip_rubriques AS SR ON R.id_rubrique = SR.id_parent',
342
+            "(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ",
343
+            'R.id_rubrique'
344
+        );
345
+        while ($row = sql_fetch($r)) {
346
+            sql_updateq(
347
+                'spip_rubriques',
348
+                ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
349
+                'id_rubrique=' . intval($row['id'])
350
+            );
351
+            $continuer = true;
352
+        }
353
+    } while ($continuer);
354
+
355
+    // Enregistrement des modifs
356
+    sql_update('spip_rubriques', ['date' => 'date_tmp', 'statut' => 'statut_tmp']);
357 357
 }
358 358
 
359 359
 /**
@@ -368,123 +368,123 @@  discard block
 block discarded – undo
368 368
  * @return void
369 369
  **/
370 370
 function propager_les_secteurs() {
371
-	// Profondeur 0
372
-	// Toutes les rubriques racines sont de profondeur 0
373
-	// et fixer les id_secteur des rubriques racines
374
-	sql_update('spip_rubriques', ['id_secteur' => 'id_rubrique', 'profondeur' => 0], 'id_parent=0');
375
-	// Toute rubrique non racine est de profondeur >0
376
-	sql_updateq('spip_rubriques', ['profondeur' => 1], 'id_parent<>0 AND profondeur=0');
377
-
378
-	// securite : pas plus d'iteration que de rubriques dans la base
379
-	$maxiter = sql_countsel('spip_rubriques');
380
-
381
-	// reparer les rubriques qui n'ont pas l'id_secteur de leur parent
382
-	// on fait profondeur par profondeur
383
-
384
-	$prof = 0;
385
-	do {
386
-		$continuer = false;
387
-
388
-		// Par recursivite : si toutes les rubriques de profondeur $prof sont bonnes
389
-		// on fixe le profondeur $prof+1
390
-
391
-		// Toutes les rubriques dont le parent est de profondeur $prof ont une profondeur $prof+1
392
-		// on teste A.profondeur > $prof+1 car :
393
-		// - toutes les rubriques de profondeur 0 à $prof sont bonnes
394
-		// - si A.profondeur = $prof+1 c'est bon
395
-		// - cela nous protege de la boucle infinie en cas de reference circulaire dans les rubriques
396
-		$maxiter2 = $maxiter;
397
-		while (
398
-			$maxiter2--
399
-			and $rows = sql_allfetsel(
400
-				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
401
-				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
402
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
403
-				'',
404
-				'R.id_secteur',
405
-				'0,100'
406
-			)
407
-		) {
408
-			$id_secteur = null;
409
-			$ids = [];
410
-			while ($row = array_shift($rows)) {
411
-				if ($row['id_secteur'] !== $id_secteur) {
412
-					if (count($ids)) {
413
-						sql_updateq(
414
-							'spip_rubriques',
415
-							['id_secteur' => $id_secteur, 'profondeur' => $prof + 1],
416
-							sql_in('id_rubrique', $ids)
417
-						);
418
-					}
419
-					$id_secteur = $row['id_secteur'];
420
-					$ids = [];
421
-				}
422
-				$ids[] = $row['id'];
423
-			}
424
-			if (count($ids)) {
425
-				sql_updateq(
426
-					'spip_rubriques',
427
-					['id_secteur' => $id_secteur, 'profondeur' => $prof + 1],
428
-					sql_in('id_rubrique', $ids)
429
-				);
430
-			}
431
-		}
432
-
433
-
434
-		// Toutes les rubriques de profondeur $prof+1 qui n'ont pas un parent de profondeur $prof sont decalees
435
-		$maxiter2 = $maxiter;
436
-		while (
437
-			$maxiter2--
438
-			and $rows = sql_allfetsel(
439
-				'id_rubrique as id',
440
-				'spip_rubriques',
441
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
442
-					'zzz.id_rubrique',
443
-					'spip_rubriques AS zzz',
444
-					'zzz.profondeur=' . intval($prof)
445
-				) . ')',
446
-				'',
447
-				'',
448
-				'0,100'
449
-			)
450
-		) {
451
-			$rows = array_column($rows, 'id');
452
-			sql_updateq('spip_rubriques', ['profondeur' => $prof + 2], sql_in('id_rubrique', $rows));
453
-		}
454
-
455
-		// ici on a fini de valider $prof+1, toutes les rubriques de prondeur 0 a $prof+1 sont OK
456
-		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
457
-		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
458
-		// on arrete les frais
459
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
460
-			$prof++;
461
-			$continuer = true;
462
-		}
463
-	} while ($continuer and $maxiter--);
464
-
465
-	// loger si la table des rubriques semble foireuse
466
-	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
467
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
468
-		spip_log(
469
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
470
-			_LOG_CRITIQUE
471
-		);
472
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
473
-	}
474
-
475
-	// reparer les articles
476
-	$r = sql_select(
477
-		'A.id_article AS id, R.id_secteur AS secteur',
478
-		'spip_articles AS A, spip_rubriques AS R',
479
-		'A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur'
480
-	);
481
-
482
-	while ($row = sql_fetch($r)) {
483
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
484
-	}
485
-
486
-	// avertir les plugins qui peuvent faire leur mises a jour egalement
487
-	pipeline('trig_propager_les_secteurs', '');
371
+    // Profondeur 0
372
+    // Toutes les rubriques racines sont de profondeur 0
373
+    // et fixer les id_secteur des rubriques racines
374
+    sql_update('spip_rubriques', ['id_secteur' => 'id_rubrique', 'profondeur' => 0], 'id_parent=0');
375
+    // Toute rubrique non racine est de profondeur >0
376
+    sql_updateq('spip_rubriques', ['profondeur' => 1], 'id_parent<>0 AND profondeur=0');
377
+
378
+    // securite : pas plus d'iteration que de rubriques dans la base
379
+    $maxiter = sql_countsel('spip_rubriques');
380
+
381
+    // reparer les rubriques qui n'ont pas l'id_secteur de leur parent
382
+    // on fait profondeur par profondeur
383
+
384
+    $prof = 0;
385
+    do {
386
+        $continuer = false;
387
+
388
+        // Par recursivite : si toutes les rubriques de profondeur $prof sont bonnes
389
+        // on fixe le profondeur $prof+1
390
+
391
+        // Toutes les rubriques dont le parent est de profondeur $prof ont une profondeur $prof+1
392
+        // on teste A.profondeur > $prof+1 car :
393
+        // - toutes les rubriques de profondeur 0 à $prof sont bonnes
394
+        // - si A.profondeur = $prof+1 c'est bon
395
+        // - cela nous protege de la boucle infinie en cas de reference circulaire dans les rubriques
396
+        $maxiter2 = $maxiter;
397
+        while (
398
+            $maxiter2--
399
+            and $rows = sql_allfetsel(
400
+                'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
401
+                'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
402
+                'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
403
+                '',
404
+                'R.id_secteur',
405
+                '0,100'
406
+            )
407
+        ) {
408
+            $id_secteur = null;
409
+            $ids = [];
410
+            while ($row = array_shift($rows)) {
411
+                if ($row['id_secteur'] !== $id_secteur) {
412
+                    if (count($ids)) {
413
+                        sql_updateq(
414
+                            'spip_rubriques',
415
+                            ['id_secteur' => $id_secteur, 'profondeur' => $prof + 1],
416
+                            sql_in('id_rubrique', $ids)
417
+                        );
418
+                    }
419
+                    $id_secteur = $row['id_secteur'];
420
+                    $ids = [];
421
+                }
422
+                $ids[] = $row['id'];
423
+            }
424
+            if (count($ids)) {
425
+                sql_updateq(
426
+                    'spip_rubriques',
427
+                    ['id_secteur' => $id_secteur, 'profondeur' => $prof + 1],
428
+                    sql_in('id_rubrique', $ids)
429
+                );
430
+            }
431
+        }
432
+
433
+
434
+        // Toutes les rubriques de profondeur $prof+1 qui n'ont pas un parent de profondeur $prof sont decalees
435
+        $maxiter2 = $maxiter;
436
+        while (
437
+            $maxiter2--
438
+            and $rows = sql_allfetsel(
439
+                'id_rubrique as id',
440
+                'spip_rubriques',
441
+                'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
442
+                    'zzz.id_rubrique',
443
+                    'spip_rubriques AS zzz',
444
+                    'zzz.profondeur=' . intval($prof)
445
+                ) . ')',
446
+                '',
447
+                '',
448
+                '0,100'
449
+            )
450
+        ) {
451
+            $rows = array_column($rows, 'id');
452
+            sql_updateq('spip_rubriques', ['profondeur' => $prof + 2], sql_in('id_rubrique', $rows));
453
+        }
454
+
455
+        // ici on a fini de valider $prof+1, toutes les rubriques de prondeur 0 a $prof+1 sont OK
456
+        // si pas de rubrique a profondeur $prof+1 pas la peine de continuer
457
+        // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
458
+        // on arrete les frais
459
+        if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
460
+            $prof++;
461
+            $continuer = true;
462
+        }
463
+    } while ($continuer and $maxiter--);
464
+
465
+    // loger si la table des rubriques semble foireuse
466
+    // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
467
+    if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
468
+        spip_log(
469
+            'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
470
+            _LOG_CRITIQUE
471
+        );
472
+        sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
473
+    }
474
+
475
+    // reparer les articles
476
+    $r = sql_select(
477
+        'A.id_article AS id, R.id_secteur AS secteur',
478
+        'spip_articles AS A, spip_rubriques AS R',
479
+        'A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur'
480
+    );
481
+
482
+    while ($row = sql_fetch($r)) {
483
+        sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
484
+    }
485
+
486
+    // avertir les plugins qui peuvent faire leur mises a jour egalement
487
+    pipeline('trig_propager_les_secteurs', '');
488 488
 }
489 489
 
490 490
 
@@ -499,23 +499,23 @@  discard block
 block discarded – undo
499 499
  *     true si un changement a eu lieu
500 500
  **/
501 501
 function calculer_langues_rubriques_etape() {
502
-	$s = sql_select(
503
-		'A.id_rubrique AS id_rubrique, R.lang AS lang',
504
-		'spip_rubriques AS A, spip_rubriques AS R',
505
-		"A.id_parent = R.id_rubrique AND A.langue_choisie != 'oui' AND R.lang<>'' AND R.lang<>A.lang"
506
-	);
507
-
508
-	$t = false;
509
-	while ($row = sql_fetch($s)) {
510
-		$id_rubrique = $row['id_rubrique'];
511
-		$t = sql_updateq(
512
-			'spip_rubriques',
513
-			['lang' => $row['lang'], 'langue_choisie' => 'non'],
514
-			'id_rubrique=' . intval($id_rubrique)
515
-		);
516
-	}
517
-
518
-	return $t;
502
+    $s = sql_select(
503
+        'A.id_rubrique AS id_rubrique, R.lang AS lang',
504
+        'spip_rubriques AS A, spip_rubriques AS R',
505
+        "A.id_parent = R.id_rubrique AND A.langue_choisie != 'oui' AND R.lang<>'' AND R.lang<>A.lang"
506
+    );
507
+
508
+    $t = false;
509
+    while ($row = sql_fetch($s)) {
510
+        $id_rubrique = $row['id_rubrique'];
511
+        $t = sql_updateq(
512
+            'spip_rubriques',
513
+            ['lang' => $row['lang'], 'langue_choisie' => 'non'],
514
+            'id_rubrique=' . intval($id_rubrique)
515
+        );
516
+    }
517
+
518
+    return $t;
519 519
 }
520 520
 
521 521
 /**
@@ -535,38 +535,38 @@  discard block
 block discarded – undo
535 535
  **/
536 536
 function calculer_langues_rubriques() {
537 537
 
538
-	// rubriques (recursivite)
539
-	sql_updateq(
540
-		'spip_rubriques',
541
-		['lang' => $GLOBALS['meta']['langue_site'], 'langue_choisie' => 'non'],
542
-		"id_parent=0 AND langue_choisie != 'oui'"
543
-	);
544
-	while (calculer_langues_rubriques_etape()) {
545
-		;
546
-	}
547
-
548
-	// articles
549
-	$s = sql_select(
550
-		'A.id_article AS id_article, R.lang AS lang',
551
-		'spip_articles AS A, spip_rubriques AS R',
552
-		"A.id_rubrique = R.id_rubrique AND A.langue_choisie != 'oui' AND (length(A.lang)=0 OR length(R.lang)>0) AND R.lang<>A.lang"
553
-	);
554
-	while ($row = sql_fetch($s)) {
555
-		$id_article = $row['id_article'];
556
-		sql_updateq(
557
-			'spip_articles',
558
-			['lang' => $row['lang'], 'langue_choisie' => 'non'],
559
-			'id_article=' . intval($id_article)
560
-		);
561
-	}
562
-
563
-	if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
564
-		$langues = calculer_langues_utilisees();
565
-		ecrire_meta('langues_utilisees', $langues);
566
-	}
567
-
568
-	// avertir les plugins qui peuvent faire leur mises a jour egalement
569
-	pipeline('trig_calculer_langues_rubriques', '');
538
+    // rubriques (recursivite)
539
+    sql_updateq(
540
+        'spip_rubriques',
541
+        ['lang' => $GLOBALS['meta']['langue_site'], 'langue_choisie' => 'non'],
542
+        "id_parent=0 AND langue_choisie != 'oui'"
543
+    );
544
+    while (calculer_langues_rubriques_etape()) {
545
+        ;
546
+    }
547
+
548
+    // articles
549
+    $s = sql_select(
550
+        'A.id_article AS id_article, R.lang AS lang',
551
+        'spip_articles AS A, spip_rubriques AS R',
552
+        "A.id_rubrique = R.id_rubrique AND A.langue_choisie != 'oui' AND (length(A.lang)=0 OR length(R.lang)>0) AND R.lang<>A.lang"
553
+    );
554
+    while ($row = sql_fetch($s)) {
555
+        $id_article = $row['id_article'];
556
+        sql_updateq(
557
+            'spip_articles',
558
+            ['lang' => $row['lang'], 'langue_choisie' => 'non'],
559
+            'id_article=' . intval($id_article)
560
+        );
561
+    }
562
+
563
+    if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
564
+        $langues = calculer_langues_utilisees();
565
+        ecrire_meta('langues_utilisees', $langues);
566
+    }
567
+
568
+    // avertir les plugins qui peuvent faire leur mises a jour egalement
569
+    pipeline('trig_calculer_langues_rubriques', '');
570 570
 }
571 571
 
572 572
 
@@ -583,80 +583,80 @@  discard block
 block discarded – undo
583 583
  *    Liste des langues utilisées séparées par des virgules
584 584
  **/
585 585
 function calculer_langues_utilisees($serveur = '') {
586
-	include_spip('public/interfaces');
587
-	include_spip('public/compiler');
588
-	include_spip('public/composer');
589
-	include_spip('public/phraser_html');
590
-	$langues = [];
591
-
592
-	$langues[$GLOBALS['meta']['langue_site']] = 1;
593
-
594
-	include_spip('base/objets');
595
-	$tables = lister_tables_objets_sql();
596
-	$trouver_table = charger_fonction('trouver_table', 'base');
597
-
598
-	foreach (array_keys($tables) as $t) {
599
-		$desc = $trouver_table($t, $serveur);
600
-		// c'est une table avec des langues
601
-		if (
602
-			$desc['exist']
603
-			and isset($desc['field']['lang'])
604
-			and isset($desc['field']['langue_choisie'])
605
-		) {
606
-			$boucle = new Boucle();
607
-			$boucle->show = $desc;
608
-			$boucle->nom = 'calculer_langues_utilisees';
609
-			$boucle->id_boucle = $desc['table_objet'];
610
-			$boucle->id_table = $desc['table_objet'];
611
-			$boucle->primary = $desc['key']['PRIMARY KEY'] ?? '';
612
-			$boucle->sql_serveur = $serveur;
613
-			$boucle->select[] = 'DISTINCT lang';
614
-			$boucle->from[$desc['table_objet']] = $t;
615
-			$boucle->separateur[] = ',';
616
-			$boucle->return = '$Pile[$SP][\'lang\']';
617
-			$boucle->iterateur = 'sql';
618
-
619
-			$boucle->descr['nom'] = 'calculer_langues_utilisees'; // eviter notice php
620
-			$boucle->descr['sourcefile'] = 'internal';
621
-			$boucle->descr['gram'] = 'html';
622
-
623
-			$boucle = pipeline('pre_boucle', $boucle);
624
-
625
-			if (
626
-				isset($desc['statut'])
627
-				and $desc['statut']
628
-			) {
629
-				$boucles = [
630
-					'calculer_langues_utilisees' => $boucle,
631
-				];
632
-				// generer un nom de fonction "anonyme" unique
633
-				do {
634
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
635
-				} while (function_exists($functionname));
636
-				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
637
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
638
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
639
-				$res = '';
640
-				eval($code);
641
-				$res = explode(',', $res);
642
-				foreach ($res as $lang) {
643
-					$langues[$lang] = 1;
644
-				}
645
-			} else {
646
-				$res = sql_select(implode(',', $boucle->select), $boucle->from);
647
-				while ($row = sql_fetch($res)) {
648
-					$langues[$row['lang']] = 1;
649
-				}
650
-			}
651
-		}
652
-	}
653
-
654
-	$langues = array_filter(array_keys($langues));
655
-	sort($langues);
656
-	$langues = join(',', $langues);
657
-	spip_log("langues utilisees: $langues");
658
-
659
-	return $langues;
586
+    include_spip('public/interfaces');
587
+    include_spip('public/compiler');
588
+    include_spip('public/composer');
589
+    include_spip('public/phraser_html');
590
+    $langues = [];
591
+
592
+    $langues[$GLOBALS['meta']['langue_site']] = 1;
593
+
594
+    include_spip('base/objets');
595
+    $tables = lister_tables_objets_sql();
596
+    $trouver_table = charger_fonction('trouver_table', 'base');
597
+
598
+    foreach (array_keys($tables) as $t) {
599
+        $desc = $trouver_table($t, $serveur);
600
+        // c'est une table avec des langues
601
+        if (
602
+            $desc['exist']
603
+            and isset($desc['field']['lang'])
604
+            and isset($desc['field']['langue_choisie'])
605
+        ) {
606
+            $boucle = new Boucle();
607
+            $boucle->show = $desc;
608
+            $boucle->nom = 'calculer_langues_utilisees';
609
+            $boucle->id_boucle = $desc['table_objet'];
610
+            $boucle->id_table = $desc['table_objet'];
611
+            $boucle->primary = $desc['key']['PRIMARY KEY'] ?? '';
612
+            $boucle->sql_serveur = $serveur;
613
+            $boucle->select[] = 'DISTINCT lang';
614
+            $boucle->from[$desc['table_objet']] = $t;
615
+            $boucle->separateur[] = ',';
616
+            $boucle->return = '$Pile[$SP][\'lang\']';
617
+            $boucle->iterateur = 'sql';
618
+
619
+            $boucle->descr['nom'] = 'calculer_langues_utilisees'; // eviter notice php
620
+            $boucle->descr['sourcefile'] = 'internal';
621
+            $boucle->descr['gram'] = 'html';
622
+
623
+            $boucle = pipeline('pre_boucle', $boucle);
624
+
625
+            if (
626
+                isset($desc['statut'])
627
+                and $desc['statut']
628
+            ) {
629
+                $boucles = [
630
+                    'calculer_langues_utilisees' => $boucle,
631
+                ];
632
+                // generer un nom de fonction "anonyme" unique
633
+                do {
634
+                    $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
635
+                } while (function_exists($functionname));
636
+                $code = calculer_boucle('calculer_langues_utilisees', $boucles);
637
+                $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
638
+                $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
639
+                $res = '';
640
+                eval($code);
641
+                $res = explode(',', $res);
642
+                foreach ($res as $lang) {
643
+                    $langues[$lang] = 1;
644
+                }
645
+            } else {
646
+                $res = sql_select(implode(',', $boucle->select), $boucle->from);
647
+                while ($row = sql_fetch($res)) {
648
+                    $langues[$row['lang']] = 1;
649
+                }
650
+            }
651
+        }
652
+    }
653
+
654
+    $langues = array_filter(array_keys($langues));
655
+    sort($langues);
656
+    $langues = join(',', $langues);
657
+    spip_log("langues utilisees: $langues");
658
+
659
+    return $langues;
660 660
 }
661 661
 
662 662
 /**
@@ -673,9 +673,9 @@  discard block
 block discarded – undo
673 673
  *     incluant les rubriques noeuds et toutes leurs descendances
674 674
  */
675 675
 function calcul_branche_in($id) {
676
-	$calcul_branche_in = charger_fonction('calcul_branche_in', 'inc');
676
+    $calcul_branche_in = charger_fonction('calcul_branche_in', 'inc');
677 677
 
678
-	return $calcul_branche_in($id);
678
+    return $calcul_branche_in($id);
679 679
 }
680 680
 
681 681
 /**
@@ -693,9 +693,9 @@  discard block
 block discarded – undo
693 693
  *     incluant les rubriques transmises et toutes leurs parentées
694 694
  */
695 695
 function calcul_hierarchie_in($id, $tout = true) {
696
-	$calcul_hierarchie_in = charger_fonction('calcul_hierarchie_in', 'inc');
696
+    $calcul_hierarchie_in = charger_fonction('calcul_hierarchie_in', 'inc');
697 697
 
698
-	return $calcul_hierarchie_in($id, $tout);
698
+    return $calcul_hierarchie_in($id, $tout);
699 699
 }
700 700
 
701 701
 
@@ -716,40 +716,40 @@  discard block
 block discarded – undo
716 716
  *     incluant les rubriques noeuds et toutes leurs descendances
717 717
  */
718 718
 function inc_calcul_branche_in_dist($id) {
719
-	static $b = [];
720
-
721
-	// normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
722
-	if (!is_array($id)) {
723
-		$id = explode(',', $id);
724
-	}
725
-	$id = join(',', array_map('intval', $id));
726
-	if (isset($b[$id])) {
727
-		return $b[$id];
728
-	}
729
-
730
-	// Notre branche commence par la rubrique de depart
731
-	$branche = $r = $id;
732
-
733
-	// On ajoute une generation (les filles de la generation precedente)
734
-	// jusqu'a epuisement, en se protegeant des references circulaires
735
-	$maxiter = 10000;
736
-	while (
737
-		$maxiter-- and $filles = sql_allfetsel(
738
-			'id_rubrique',
739
-			'spip_rubriques',
740
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
741
-		)
742
-	) {
743
-		$r = join(',', array_column($filles, 'id_rubrique'));
744
-		$branche .= ',' . $r;
745
-	}
746
-
747
-	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
748
-	if (strlen($branche) < 10000) {
749
-		$b[$id] = $branche;
750
-	}
751
-
752
-	return $branche;
719
+    static $b = [];
720
+
721
+    // normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
722
+    if (!is_array($id)) {
723
+        $id = explode(',', $id);
724
+    }
725
+    $id = join(',', array_map('intval', $id));
726
+    if (isset($b[$id])) {
727
+        return $b[$id];
728
+    }
729
+
730
+    // Notre branche commence par la rubrique de depart
731
+    $branche = $r = $id;
732
+
733
+    // On ajoute une generation (les filles de la generation precedente)
734
+    // jusqu'a epuisement, en se protegeant des references circulaires
735
+    $maxiter = 10000;
736
+    while (
737
+        $maxiter-- and $filles = sql_allfetsel(
738
+            'id_rubrique',
739
+            'spip_rubriques',
740
+            sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
741
+        )
742
+    ) {
743
+        $r = join(',', array_column($filles, 'id_rubrique'));
744
+        $branche .= ',' . $r;
745
+    }
746
+
747
+    # securite pour ne pas plomber la conso memoire sur les sites prolifiques
748
+    if (strlen($branche) < 10000) {
749
+        $b[$id] = $branche;
750
+    }
751
+
752
+    return $branche;
753 753
 }
754 754
 
755 755
 
@@ -771,45 +771,45 @@  discard block
 block discarded – undo
771 771
  *     incluant les rubriques transmises et toutes leurs parentées
772 772
  */
773 773
 function inc_calcul_hierarchie_in_dist($id, $tout = true) {
774
-	static $b = [];
775
-
776
-	// normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
777
-	if (!is_array($id)) {
778
-		$id = explode(',', $id);
779
-	}
780
-	$id = join(',', array_map('intval', $id));
781
-
782
-	if (isset($b[$id])) {
783
-		// Notre branche commence par la rubrique de depart si $tout=true
784
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
785
-	}
786
-
787
-	$hier = '';
788
-
789
-	// On ajoute une generation (les filles de la generation precedente)
790
-	// jusqu'a epuisement, en se protegeant des references circulaires
791
-	$ids_nouveaux_parents = $id;
792
-	$maxiter = 10000;
793
-	while (
794
-		$maxiter-- and $parents = sql_allfetsel(
795
-			'id_parent',
796
-			'spip_rubriques',
797
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
798
-		)
799
-	) {
800
-		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
801
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
802
-	}
803
-
804
-	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
805
-	if (strlen($hier) < 10000) {
806
-		$b[$id] = $hier;
807
-	}
808
-
809
-	// Notre branche commence par la rubrique de depart si $tout=true
810
-	$hier = $tout ? (strlen($hier) ? "$hier,$id" : $id) : $hier;
811
-
812
-	return $hier;
774
+    static $b = [];
775
+
776
+    // normaliser $id qui a pu arriver comme un array, comme un entier, ou comme une chaine NN,NN,NN
777
+    if (!is_array($id)) {
778
+        $id = explode(',', $id);
779
+    }
780
+    $id = join(',', array_map('intval', $id));
781
+
782
+    if (isset($b[$id])) {
783
+        // Notre branche commence par la rubrique de depart si $tout=true
784
+        return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
785
+    }
786
+
787
+    $hier = '';
788
+
789
+    // On ajoute une generation (les filles de la generation precedente)
790
+    // jusqu'a epuisement, en se protegeant des references circulaires
791
+    $ids_nouveaux_parents = $id;
792
+    $maxiter = 10000;
793
+    while (
794
+        $maxiter-- and $parents = sql_allfetsel(
795
+            'id_parent',
796
+            'spip_rubriques',
797
+            sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
798
+        )
799
+    ) {
800
+        $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
801
+        $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
802
+    }
803
+
804
+    # securite pour ne pas plomber la conso memoire sur les sites prolifiques
805
+    if (strlen($hier) < 10000) {
806
+        $b[$id] = $hier;
807
+    }
808
+
809
+    // Notre branche commence par la rubrique de depart si $tout=true
810
+    $hier = $tout ? (strlen($hier) ? "$hier,$id" : $id) : $hier;
811
+
812
+    return $hier;
813 813
 }
814 814
 
815 815
 
@@ -827,47 +827,47 @@  discard block
 block discarded – undo
827 827
  * @return void
828 828
  **/
829 829
 function calculer_prochain_postdate($check = false) {
830
-	include_spip('base/abstract_sql');
831
-	if ($check) {
832
-		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
833
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
834
-
835
-		$r = sql_select(
836
-			'DISTINCT A.id_rubrique AS id',
837
-			'spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique',
838
-			"R.statut != 'publie' AND A.statut='publie'$postdates"
839
-		);
840
-		while ($row = sql_fetch($r)) {
841
-			publier_branche_rubrique($row['id']);
842
-		}
843
-
844
-		pipeline('trig_calculer_prochain_postdate', '');
845
-	}
846
-
847
-	$t = sql_fetsel(
848
-		'date',
849
-		'spip_articles',
850
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
851
-		'',
852
-		'date',
853
-		'1'
854
-	);
855
-
856
-	if ($t) {
857
-		$t = $t['date'];
858
-		if (
859
-			!isset($GLOBALS['meta']['date_prochain_postdate'])
860
-			or $t <> $GLOBALS['meta']['date_prochain_postdate']
861
-		) {
862
-			ecrire_meta('date_prochain_postdate', strtotime($t));
863
-			ecrire_meta('derniere_modif', time());
864
-		}
865
-	} else {
866
-		effacer_meta('date_prochain_postdate');
867
-		ecrire_meta('derniere_modif', time());
868
-	}
869
-
870
-	spip_log("prochain postdate: $t");
830
+    include_spip('base/abstract_sql');
831
+    if ($check) {
832
+        $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
833
+            'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
834
+
835
+        $r = sql_select(
836
+            'DISTINCT A.id_rubrique AS id',
837
+            'spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique',
838
+            "R.statut != 'publie' AND A.statut='publie'$postdates"
839
+        );
840
+        while ($row = sql_fetch($r)) {
841
+            publier_branche_rubrique($row['id']);
842
+        }
843
+
844
+        pipeline('trig_calculer_prochain_postdate', '');
845
+    }
846
+
847
+    $t = sql_fetsel(
848
+        'date',
849
+        'spip_articles',
850
+        "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
851
+        '',
852
+        'date',
853
+        '1'
854
+    );
855
+
856
+    if ($t) {
857
+        $t = $t['date'];
858
+        if (
859
+            !isset($GLOBALS['meta']['date_prochain_postdate'])
860
+            or $t <> $GLOBALS['meta']['date_prochain_postdate']
861
+        ) {
862
+            ecrire_meta('date_prochain_postdate', strtotime($t));
863
+            ecrire_meta('derniere_modif', time());
864
+        }
865
+    } else {
866
+        effacer_meta('date_prochain_postdate');
867
+        ecrire_meta('derniere_modif', time());
868
+    }
869
+
870
+    spip_log("prochain postdate: $t");
871 871
 }
872 872
 
873 873
 /**
@@ -892,62 +892,62 @@  discard block
 block discarded – undo
892 892
  */
893 893
 function creer_rubrique_nommee($titre, $id_parent = 0, $serveur = '') {
894 894
 
895
-	// eclater l'arborescence demandee
896
-	// echapper les </multi> et autres balises fermantes html
897
-	$titre = preg_replace(',</([a-z][^>]*)>,ims', "<@\\1>", $titre);
898
-	$arbo = explode('/', preg_replace(',^/,', '', $titre));
899
-	include_spip('base/abstract_sql');
900
-	foreach ($arbo as $titre) {
901
-		// retablir les </multi> et autres balises fermantes html
902
-		$titre = preg_replace(',<@([a-z][^>]*)>,ims', "</\\1>", $titre);
903
-		$r = sql_getfetsel(
904
-			'id_rubrique',
905
-			'spip_rubriques',
906
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
907
-			$groupby = [],
908
-			$orderby = [],
909
-			$limit = '',
910
-			$having = [],
911
-			$serveur
912
-		);
913
-		if ($r !== null) {
914
-			$id_parent = $r;
915
-		} else {
916
-			$id_rubrique = sql_insertq('spip_rubriques', [
917
-					'titre' => $titre,
918
-					'id_parent' => $id_parent,
919
-					'statut' => 'prepa'
920
-				], $desc = [], $serveur);
921
-			if ($id_parent > 0) {
922
-				$data = sql_fetsel(
923
-					'id_secteur,lang',
924
-					'spip_rubriques',
925
-					"id_rubrique=$id_parent",
926
-					$groupby = [],
927
-					$orderby = [],
928
-					$limit = '',
929
-					$having = [],
930
-					$serveur
931
-				);
932
-				$id_secteur = $data['id_secteur'];
933
-				$lang = $data['lang'];
934
-			} else {
935
-				$id_secteur = $id_rubrique;
936
-				$lang = $GLOBALS['meta']['langue_site'];
937
-			}
938
-
939
-			sql_updateq(
940
-				'spip_rubriques',
941
-				['id_secteur' => $id_secteur, 'lang' => $lang],
942
-				'id_rubrique=' . intval($id_rubrique),
943
-				[],
944
-				$serveur
945
-			);
946
-
947
-			// pour la recursion
948
-			$id_parent = $id_rubrique;
949
-		}
950
-	}
951
-
952
-	return intval($id_parent);
895
+    // eclater l'arborescence demandee
896
+    // echapper les </multi> et autres balises fermantes html
897
+    $titre = preg_replace(',</([a-z][^>]*)>,ims', "<@\\1>", $titre);
898
+    $arbo = explode('/', preg_replace(',^/,', '', $titre));
899
+    include_spip('base/abstract_sql');
900
+    foreach ($arbo as $titre) {
901
+        // retablir les </multi> et autres balises fermantes html
902
+        $titre = preg_replace(',<@([a-z][^>]*)>,ims', "</\\1>", $titre);
903
+        $r = sql_getfetsel(
904
+            'id_rubrique',
905
+            'spip_rubriques',
906
+            'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
907
+            $groupby = [],
908
+            $orderby = [],
909
+            $limit = '',
910
+            $having = [],
911
+            $serveur
912
+        );
913
+        if ($r !== null) {
914
+            $id_parent = $r;
915
+        } else {
916
+            $id_rubrique = sql_insertq('spip_rubriques', [
917
+                    'titre' => $titre,
918
+                    'id_parent' => $id_parent,
919
+                    'statut' => 'prepa'
920
+                ], $desc = [], $serveur);
921
+            if ($id_parent > 0) {
922
+                $data = sql_fetsel(
923
+                    'id_secteur,lang',
924
+                    'spip_rubriques',
925
+                    "id_rubrique=$id_parent",
926
+                    $groupby = [],
927
+                    $orderby = [],
928
+                    $limit = '',
929
+                    $having = [],
930
+                    $serveur
931
+                );
932
+                $id_secteur = $data['id_secteur'];
933
+                $lang = $data['lang'];
934
+            } else {
935
+                $id_secteur = $id_rubrique;
936
+                $lang = $GLOBALS['meta']['langue_site'];
937
+            }
938
+
939
+            sql_updateq(
940
+                'spip_rubriques',
941
+                ['id_secteur' => $id_secteur, 'lang' => $lang],
942
+                'id_rubrique=' . intval($id_rubrique),
943
+                [],
944
+                $serveur
945
+            );
946
+
947
+            // pour la recursion
948
+            $id_parent = $id_rubrique;
949
+        }
950
+    }
951
+
952
+    return intval($id_parent);
953 953
 }
Please login to merge, or discard this patch.
ecrire/inc/distant.php 1 patch
Indentation   +1086 added lines, -1086 removed lines patch added patch discarded remove patch
@@ -18,32 +18,32 @@  discard block
 block discarded – undo
18 18
  * @package SPIP\Core\Distant
19 19
  **/
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 if (!defined('_INC_DISTANT_VERSION_HTTP')) {
25
-	define('_INC_DISTANT_VERSION_HTTP', 'HTTP/1.0');
25
+    define('_INC_DISTANT_VERSION_HTTP', 'HTTP/1.0');
26 26
 }
27 27
 if (!defined('_INC_DISTANT_CONTENT_ENCODING')) {
28
-	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
28
+    define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
29 29
 }
30 30
 if (!defined('_INC_DISTANT_USER_AGENT')) {
31
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
31
+    define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
32 32
 }
33 33
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
34
-	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
34
+    define('_INC_DISTANT_MAX_SIZE', 2_097_152);
35 35
 }
36 36
 if (!defined('_INC_DISTANT_CONNECT_TIMEOUT')) {
37
-	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
37
+    define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
38 38
 }
39 39
 
40 40
 define('_REGEXP_COPIE_LOCALE', ',' 	.
41
-	preg_replace(
42
-		'@^https?:@',
43
-		'https?:',
44
-		($GLOBALS['meta']['adresse_site'] ?? '')
45
-	)
46
-	. '/?spip.php[?]action=acceder_document.*file=(.*)$,');
41
+    preg_replace(
42
+        '@^https?:@',
43
+        'https?:',
44
+        ($GLOBALS['meta']['adresse_site'] ?? '')
45
+    )
46
+    . '/?spip.php[?]action=acceder_document.*file=(.*)$,');
47 47
 
48 48
 //@define('_COPIE_LOCALE_MAX_SIZE',2097152); // poids (inc/utils l'a fait)
49 49
 
@@ -72,107 +72,107 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function copie_locale($source, $mode = 'auto', $local = null, $taille_max = null, $callback_valider_url = null) {
74 74
 
75
-	// si c'est la protection de soi-meme, retourner le path
76
-	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
77
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
78
-
79
-		return @file_exists($source) ? $source : false;
80
-	}
81
-
82
-	if (is_null($local)) {
83
-		$local = fichier_copie_locale($source);
84
-	} else {
85
-		if (_DIR_RACINE and strncmp(_DIR_RACINE, $local, strlen(_DIR_RACINE)) == 0) {
86
-			$local = substr($local, strlen(_DIR_RACINE));
87
-		}
88
-	}
89
-
90
-	// si $local = '' c'est un fichier refuse par fichier_copie_locale(),
91
-	// par exemple un fichier qui ne figure pas dans nos documents ;
92
-	// dans ce cas on n'essaie pas de le telecharger pour ensuite echouer
93
-	if (!$local) {
94
-		return false;
95
-	}
96
-
97
-	$localrac = _DIR_RACINE . $local;
98
-	$t = ($mode === 'force') ? false : @file_exists($localrac);
99
-
100
-	// test d'existence du fichier
101
-	if ($mode === 'test') {
102
-		return $t ? $local : '';
103
-	}
104
-
105
-	// sinon voir si on doit/peut le telecharger
106
-	if ($local === $source or !tester_url_absolue($source)) {
107
-		return $t ? $local : '';
108
-	}
109
-
110
-	if ($mode === 'modif' or !$t) {
111
-		// passer par un fichier temporaire unique pour gerer les echecs en cours de recuperation
112
-		// et des eventuelles recuperations concurantes
113
-		include_spip('inc/acces');
114
-		if (!$taille_max) {
115
-			$taille_max = _COPIE_LOCALE_MAX_SIZE;
116
-		}
117
-		$localrac_tmp = $localrac . '.tmp';
118
-		$res = recuperer_url(
119
-			$source,
120
-			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
121
-		);
122
-
123
-		if (!$res or (!$res['length'] and $res['status'] != 304)) {
124
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
125
-			@unlink($localrac_tmp);
126
-		}
127
-		else {
128
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
129
-		}
130
-		if (!$res or !$res['length']) {
131
-			// si $t c'est sans doute juste un not-modified-since
132
-			return $t ? $local : false;
133
-		}
134
-
135
-		// si option valider url, verifions que l'URL finale est acceptable
136
-		if (
137
-			$callback_valider_url
138
-			and is_callable($callback_valider_url)
139
-			and !$callback_valider_url($res['url'])
140
-		) {
141
-			spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
142
-			@unlink($localrac_tmp);
143
-			return $t ? $local : false;
144
-		}
145
-
146
-		// on peut renommer le fichier tmp
147
-		@rename($localrac_tmp, $localrac);
148
-
149
-		// si on retrouve l'extension
150
-		if (
151
-			!empty($res['headers'])
152
-			and $extension = distant_trouver_extension_selon_headers($source, $res['headers'])
153
-		) {
154
-			if ($sanitizer = charger_fonction($extension, 'sanitizer', true)) {
155
-				$sanitizer($localrac);
156
-			}
157
-		}
158
-
159
-		// pour une eventuelle indexation
160
-		pipeline(
161
-			'post_edition',
162
-			[
163
-				'args' => [
164
-					'operation' => 'copie_locale',
165
-					'source' => $source,
166
-					'fichier' => $local,
167
-					'http_res' => $res['length'],
168
-					'url' => $res['url'],
169
-				],
170
-				'data' => null
171
-			]
172
-		);
173
-	}
174
-
175
-	return $local;
75
+    // si c'est la protection de soi-meme, retourner le path
76
+    if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
77
+        $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
78
+
79
+        return @file_exists($source) ? $source : false;
80
+    }
81
+
82
+    if (is_null($local)) {
83
+        $local = fichier_copie_locale($source);
84
+    } else {
85
+        if (_DIR_RACINE and strncmp(_DIR_RACINE, $local, strlen(_DIR_RACINE)) == 0) {
86
+            $local = substr($local, strlen(_DIR_RACINE));
87
+        }
88
+    }
89
+
90
+    // si $local = '' c'est un fichier refuse par fichier_copie_locale(),
91
+    // par exemple un fichier qui ne figure pas dans nos documents ;
92
+    // dans ce cas on n'essaie pas de le telecharger pour ensuite echouer
93
+    if (!$local) {
94
+        return false;
95
+    }
96
+
97
+    $localrac = _DIR_RACINE . $local;
98
+    $t = ($mode === 'force') ? false : @file_exists($localrac);
99
+
100
+    // test d'existence du fichier
101
+    if ($mode === 'test') {
102
+        return $t ? $local : '';
103
+    }
104
+
105
+    // sinon voir si on doit/peut le telecharger
106
+    if ($local === $source or !tester_url_absolue($source)) {
107
+        return $t ? $local : '';
108
+    }
109
+
110
+    if ($mode === 'modif' or !$t) {
111
+        // passer par un fichier temporaire unique pour gerer les echecs en cours de recuperation
112
+        // et des eventuelles recuperations concurantes
113
+        include_spip('inc/acces');
114
+        if (!$taille_max) {
115
+            $taille_max = _COPIE_LOCALE_MAX_SIZE;
116
+        }
117
+        $localrac_tmp = $localrac . '.tmp';
118
+        $res = recuperer_url(
119
+            $source,
120
+            ['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
121
+        );
122
+
123
+        if (!$res or (!$res['length'] and $res['status'] != 304)) {
124
+            spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
125
+            @unlink($localrac_tmp);
126
+        }
127
+        else {
128
+            spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
129
+        }
130
+        if (!$res or !$res['length']) {
131
+            // si $t c'est sans doute juste un not-modified-since
132
+            return $t ? $local : false;
133
+        }
134
+
135
+        // si option valider url, verifions que l'URL finale est acceptable
136
+        if (
137
+            $callback_valider_url
138
+            and is_callable($callback_valider_url)
139
+            and !$callback_valider_url($res['url'])
140
+        ) {
141
+            spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
142
+            @unlink($localrac_tmp);
143
+            return $t ? $local : false;
144
+        }
145
+
146
+        // on peut renommer le fichier tmp
147
+        @rename($localrac_tmp, $localrac);
148
+
149
+        // si on retrouve l'extension
150
+        if (
151
+            !empty($res['headers'])
152
+            and $extension = distant_trouver_extension_selon_headers($source, $res['headers'])
153
+        ) {
154
+            if ($sanitizer = charger_fonction($extension, 'sanitizer', true)) {
155
+                $sanitizer($localrac);
156
+            }
157
+        }
158
+
159
+        // pour une eventuelle indexation
160
+        pipeline(
161
+            'post_edition',
162
+            [
163
+                'args' => [
164
+                    'operation' => 'copie_locale',
165
+                    'source' => $source,
166
+                    'fichier' => $local,
167
+                    'http_res' => $res['length'],
168
+                    'url' => $res['url'],
169
+                ],
170
+                'data' => null
171
+            ]
172
+        );
173
+    }
174
+
175
+    return $local;
176 176
 }
177 177
 
178 178
 /**
@@ -187,99 +187,99 @@  discard block
 block discarded – undo
187 187
  *   url ou false en cas d'echec
188 188
  */
189 189
 function valider_url_distante($url, $known_hosts = []) {
190
-	if (!function_exists('protocole_verifier')) {
191
-		include_spip('inc/filtres_mini');
192
-	}
193
-
194
-	if (!protocole_verifier($url, ['http', 'https'])) {
195
-		return false;
196
-	}
197
-
198
-	$parsed_url = parse_url($url);
199
-	if (!$parsed_url or empty($parsed_url['host'])) {
200
-		return false;
201
-	}
202
-
203
-	if (isset($parsed_url['user']) or isset($parsed_url['pass'])) {
204
-		return false;
205
-	}
206
-
207
-	if (false !== strpbrk($parsed_url['host'], ':#?[]')) {
208
-		return false;
209
-	}
210
-
211
-	if (!is_array($known_hosts)) {
212
-		$known_hosts = [$known_hosts];
213
-	}
214
-	$known_hosts[] = $GLOBALS['meta']['adresse_site'];
215
-	$known_hosts[] = url_de_base();
216
-	$known_hosts = pipeline('declarer_hosts_distants', $known_hosts);
217
-
218
-	$is_known_host = false;
219
-	foreach ($known_hosts as $known_host) {
220
-		$parse_known = parse_url($known_host);
221
-		if (
222
-			$parse_known
223
-			and strtolower($parse_known['host']) === strtolower($parsed_url['host'])
224
-		) {
225
-			$is_known_host = true;
226
-			break;
227
-		}
228
-	}
229
-
230
-	if (!$is_known_host) {
231
-		$host = trim($parsed_url['host'], '.');
232
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
233
-			$ip = gethostbyname($host);
234
-			if ($ip === $host) {
235
-				// Error condition for gethostbyname()
236
-				$ip = false;
237
-			}
238
-			if ($records = dns_get_record($host)) {
239
-				foreach ($records as $record) {
240
-					// il faut que le TTL soit suffisant afin d'etre certain que le copie_locale eventuel qui suit
241
-					// se fasse sur la meme IP
242
-					if ($record['ttl'] < 10) {
243
-						$ip = false;
244
-						break;
245
-					}
246
-				}
247
-			}
248
-			else {
249
-				$ip = false;
250
-			}
251
-		}
252
-		if ($ip) {
253
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
254
-				return false;
255
-			}
256
-		}
257
-	}
258
-
259
-	if (empty($parsed_url['port'])) {
260
-		return $url;
261
-	}
262
-
263
-	$port = $parsed_url['port'];
264
-	if ($port === 80  or $port === 443  or $port === 8080) {
265
-		return $url;
266
-	}
267
-
268
-	if ($is_known_host) {
269
-		foreach ($known_hosts as $known_host) {
270
-			$parse_known = parse_url($known_host);
271
-			if (
272
-				$parse_known
273
-				and !empty($parse_known['port'])
274
-				and strtolower($parse_known['host']) === strtolower($parsed_url['host'])
275
-				and $parse_known['port'] == $port
276
-			) {
277
-				return $url;
278
-			}
279
-		}
280
-	}
281
-
282
-	return false;
190
+    if (!function_exists('protocole_verifier')) {
191
+        include_spip('inc/filtres_mini');
192
+    }
193
+
194
+    if (!protocole_verifier($url, ['http', 'https'])) {
195
+        return false;
196
+    }
197
+
198
+    $parsed_url = parse_url($url);
199
+    if (!$parsed_url or empty($parsed_url['host'])) {
200
+        return false;
201
+    }
202
+
203
+    if (isset($parsed_url['user']) or isset($parsed_url['pass'])) {
204
+        return false;
205
+    }
206
+
207
+    if (false !== strpbrk($parsed_url['host'], ':#?[]')) {
208
+        return false;
209
+    }
210
+
211
+    if (!is_array($known_hosts)) {
212
+        $known_hosts = [$known_hosts];
213
+    }
214
+    $known_hosts[] = $GLOBALS['meta']['adresse_site'];
215
+    $known_hosts[] = url_de_base();
216
+    $known_hosts = pipeline('declarer_hosts_distants', $known_hosts);
217
+
218
+    $is_known_host = false;
219
+    foreach ($known_hosts as $known_host) {
220
+        $parse_known = parse_url($known_host);
221
+        if (
222
+            $parse_known
223
+            and strtolower($parse_known['host']) === strtolower($parsed_url['host'])
224
+        ) {
225
+            $is_known_host = true;
226
+            break;
227
+        }
228
+    }
229
+
230
+    if (!$is_known_host) {
231
+        $host = trim($parsed_url['host'], '.');
232
+        if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
233
+            $ip = gethostbyname($host);
234
+            if ($ip === $host) {
235
+                // Error condition for gethostbyname()
236
+                $ip = false;
237
+            }
238
+            if ($records = dns_get_record($host)) {
239
+                foreach ($records as $record) {
240
+                    // il faut que le TTL soit suffisant afin d'etre certain que le copie_locale eventuel qui suit
241
+                    // se fasse sur la meme IP
242
+                    if ($record['ttl'] < 10) {
243
+                        $ip = false;
244
+                        break;
245
+                    }
246
+                }
247
+            }
248
+            else {
249
+                $ip = false;
250
+            }
251
+        }
252
+        if ($ip) {
253
+            if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
254
+                return false;
255
+            }
256
+        }
257
+    }
258
+
259
+    if (empty($parsed_url['port'])) {
260
+        return $url;
261
+    }
262
+
263
+    $port = $parsed_url['port'];
264
+    if ($port === 80  or $port === 443  or $port === 8080) {
265
+        return $url;
266
+    }
267
+
268
+    if ($is_known_host) {
269
+        foreach ($known_hosts as $known_host) {
270
+            $parse_known = parse_url($known_host);
271
+            if (
272
+                $parse_known
273
+                and !empty($parse_known['port'])
274
+                and strtolower($parse_known['host']) === strtolower($parsed_url['host'])
275
+                and $parse_known['port'] == $port
276
+            ) {
277
+                return $url;
278
+            }
279
+        }
280
+    }
281
+
282
+    return false;
283 283
 }
284 284
 
285 285
 /**
@@ -299,86 +299,86 @@  discard block
 block discarded – undo
299 299
  */
300 300
 function prepare_donnees_post($donnees, $boundary = '') {
301 301
 
302
-	// permettre a la fonction qui a demande le post de formater elle meme ses donnees
303
-	// pour un appel soap par exemple
304
-	// l'entete est separe des donnees par un double retour a la ligne
305
-	// on s'occupe ici de passer tous les retours lignes (\r\n, \r ou \n) en \r\n
306
-	if (is_string($donnees) && strlen($donnees)) {
307
-		$entete = '';
308
-		// on repasse tous les \r\n et \r en simples \n
309
-		$donnees = str_replace("\r\n", "\n", $donnees);
310
-		$donnees = str_replace("\r", "\n", $donnees);
311
-		// un double retour a la ligne signifie la fin de l'entete et le debut des donnees
312
-		$p = strpos($donnees, "\n\n");
313
-		if ($p !== false) {
314
-			$entete = str_replace("\n", "\r\n", substr($donnees, 0, $p + 1));
315
-			$donnees = substr($donnees, $p + 2);
316
-		}
317
-		$chaine = str_replace("\n", "\r\n", $donnees);
318
-	} else {
319
-		/* boundary automatique */
320
-		// Si on a plus de 500 octects de donnees, on "boundarise"
321
-		if ($boundary === '') {
322
-			$taille = 0;
323
-			foreach ($donnees as $cle => $valeur) {
324
-				if (is_array($valeur)) {
325
-					foreach ($valeur as $val2) {
326
-						$taille += strlen($val2);
327
-					}
328
-				} else {
329
-					// faut-il utiliser spip_strlen() dans inc/charsets ?
330
-					$taille += strlen($valeur);
331
-				}
332
-			}
333
-			if ($taille > 500) {
334
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
335
-			}
336
-		}
337
-
338
-		if (is_string($boundary) and strlen($boundary)) {
339
-			// fabrique une chaine HTTP pour un POST avec boundary
340
-			$entete = "Content-Type: multipart/form-data; boundary=$boundary\r\n";
341
-			$chaine = '';
342
-			if (is_array($donnees)) {
343
-				foreach ($donnees as $cle => $valeur) {
344
-					if (is_array($valeur)) {
345
-						foreach ($valeur as $val2) {
346
-							$chaine .= "\r\n--$boundary\r\n";
347
-							$chaine .= "Content-Disposition: form-data; name=\"{$cle}[]\"\r\n";
348
-							$chaine .= "\r\n";
349
-							$chaine .= $val2;
350
-						}
351
-					} else {
352
-						$chaine .= "\r\n--$boundary\r\n";
353
-						$chaine .= "Content-Disposition: form-data; name=\"$cle\"\r\n";
354
-						$chaine .= "\r\n";
355
-						$chaine .= $valeur;
356
-					}
357
-				}
358
-				$chaine .= "\r\n--$boundary\r\n";
359
-			}
360
-		} else {
361
-			// fabrique une chaine HTTP simple pour un POST
362
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
363
-			$chaine = [];
364
-			if (is_array($donnees)) {
365
-				foreach ($donnees as $cle => $valeur) {
366
-					if (is_array($valeur)) {
367
-						foreach ($valeur as $val2) {
368
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
369
-						}
370
-					} else {
371
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
372
-					}
373
-				}
374
-				$chaine = implode('&', $chaine);
375
-			} else {
376
-				$chaine = $donnees;
377
-			}
378
-		}
379
-	}
380
-
381
-	return [$entete, $chaine];
302
+    // permettre a la fonction qui a demande le post de formater elle meme ses donnees
303
+    // pour un appel soap par exemple
304
+    // l'entete est separe des donnees par un double retour a la ligne
305
+    // on s'occupe ici de passer tous les retours lignes (\r\n, \r ou \n) en \r\n
306
+    if (is_string($donnees) && strlen($donnees)) {
307
+        $entete = '';
308
+        // on repasse tous les \r\n et \r en simples \n
309
+        $donnees = str_replace("\r\n", "\n", $donnees);
310
+        $donnees = str_replace("\r", "\n", $donnees);
311
+        // un double retour a la ligne signifie la fin de l'entete et le debut des donnees
312
+        $p = strpos($donnees, "\n\n");
313
+        if ($p !== false) {
314
+            $entete = str_replace("\n", "\r\n", substr($donnees, 0, $p + 1));
315
+            $donnees = substr($donnees, $p + 2);
316
+        }
317
+        $chaine = str_replace("\n", "\r\n", $donnees);
318
+    } else {
319
+        /* boundary automatique */
320
+        // Si on a plus de 500 octects de donnees, on "boundarise"
321
+        if ($boundary === '') {
322
+            $taille = 0;
323
+            foreach ($donnees as $cle => $valeur) {
324
+                if (is_array($valeur)) {
325
+                    foreach ($valeur as $val2) {
326
+                        $taille += strlen($val2);
327
+                    }
328
+                } else {
329
+                    // faut-il utiliser spip_strlen() dans inc/charsets ?
330
+                    $taille += strlen($valeur);
331
+                }
332
+            }
333
+            if ($taille > 500) {
334
+                $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
335
+            }
336
+        }
337
+
338
+        if (is_string($boundary) and strlen($boundary)) {
339
+            // fabrique une chaine HTTP pour un POST avec boundary
340
+            $entete = "Content-Type: multipart/form-data; boundary=$boundary\r\n";
341
+            $chaine = '';
342
+            if (is_array($donnees)) {
343
+                foreach ($donnees as $cle => $valeur) {
344
+                    if (is_array($valeur)) {
345
+                        foreach ($valeur as $val2) {
346
+                            $chaine .= "\r\n--$boundary\r\n";
347
+                            $chaine .= "Content-Disposition: form-data; name=\"{$cle}[]\"\r\n";
348
+                            $chaine .= "\r\n";
349
+                            $chaine .= $val2;
350
+                        }
351
+                    } else {
352
+                        $chaine .= "\r\n--$boundary\r\n";
353
+                        $chaine .= "Content-Disposition: form-data; name=\"$cle\"\r\n";
354
+                        $chaine .= "\r\n";
355
+                        $chaine .= $valeur;
356
+                    }
357
+                }
358
+                $chaine .= "\r\n--$boundary\r\n";
359
+            }
360
+        } else {
361
+            // fabrique une chaine HTTP simple pour un POST
362
+            $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
363
+            $chaine = [];
364
+            if (is_array($donnees)) {
365
+                foreach ($donnees as $cle => $valeur) {
366
+                    if (is_array($valeur)) {
367
+                        foreach ($valeur as $val2) {
368
+                            $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
369
+                        }
370
+                    } else {
371
+                        $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
372
+                    }
373
+                }
374
+                $chaine = implode('&', $chaine);
375
+            } else {
376
+                $chaine = $donnees;
377
+            }
378
+        }
379
+    }
380
+
381
+    return [$entete, $chaine];
382 382
 }
383 383
 
384 384
 /**
@@ -389,19 +389,19 @@  discard block
 block discarded – undo
389 389
  */
390 390
 function url_to_ascii($url_idn) {
391 391
 
392
-	if ($parts = parse_url($url_idn)) {
393
-		$host = $parts['host'];
394
-		if (!preg_match(',^[a-z0-9_\.\-]+$,i', $host)) {
395
-			$converter = new ToIdn();
396
-			$host_ascii = $converter->convert($host);
397
-			$url_idn = explode($host, $url_idn, 2);
398
-			$url_idn = implode($host_ascii, $url_idn);
399
-		}
400
-		// et on urlencode les char utf si besoin dans le path
401
-		$url_idn = preg_replace_callback('/[^\x20-\x7f]/', fn($match) => urlencode($match[0]), $url_idn);
402
-	}
403
-
404
-	return $url_idn;
392
+    if ($parts = parse_url($url_idn)) {
393
+        $host = $parts['host'];
394
+        if (!preg_match(',^[a-z0-9_\.\-]+$,i', $host)) {
395
+            $converter = new ToIdn();
396
+            $host_ascii = $converter->convert($host);
397
+            $url_idn = explode($host, $url_idn, 2);
398
+            $url_idn = implode($host_ascii, $url_idn);
399
+        }
400
+        // et on urlencode les char utf si besoin dans le path
401
+        $url_idn = preg_replace_callback('/[^\x20-\x7f]/', fn($match) => urlencode($match[0]), $url_idn);
402
+    }
403
+
404
+    return $url_idn;
405 405
 }
406 406
 
407 407
 /**
@@ -442,209 +442,209 @@  discard block
 block discarded – undo
442 442
  *     string file : nom du fichier si enregistre dans un fichier
443 443
  */
444 444
 function recuperer_url($url, $options = []) {
445
-	// Conserve la mémoire de la méthode fournit éventuellement
446
-	$methode_demandee = $options['methode'] ?? '';
447
-	$default = [
448
-		'transcoder' => false,
449
-		'methode' => 'GET',
450
-		'taille_max' => null,
451
-		'headers' => [],
452
-		'datas' => '',
453
-		'boundary' => '',
454
-		'refuser_gz' => false,
455
-		'if_modified_since' => '',
456
-		'uri_referer' => '',
457
-		'file' => '',
458
-		'follow_location' => 10,
459
-		'version_http' => _INC_DISTANT_VERSION_HTTP,
460
-	];
461
-	$options = array_merge($default, $options);
462
-	// copier directement dans un fichier ?
463
-	$copy = $options['file'];
464
-
465
-	if ($options['methode'] == 'HEAD') {
466
-		$options['taille_max'] = 0;
467
-	}
468
-	if (is_null($options['taille_max'])) {
469
-		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470
-	}
471
-
472
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
473
-
474
-	// Ajout des en-têtes spécifiques si besoin
475
-	$formatted_data = '';
476
-	if (!empty($options['headers'])) {
477
-		foreach ($options['headers'] as $champ => $valeur) {
478
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
479
-		}
480
-	}
481
-
482
-	if (!empty($options['datas'])) {
483
-		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484
-		$head .= $formatted_data;
485
-		if (stripos($head, 'Content-Length:') === false) {
486
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
487
-		}
488
-		$formatted_data = $head . "\r\n" . $postdata;
489
-		if (
490
-			strlen($postdata)
491
-			and !$methode_demandee
492
-		) {
493
-			$options['methode'] = 'POST';
494
-		}
495
-	} elseif ($formatted_data) {
496
-		$formatted_data .= "\r\n";
497
-	}
498
-
499
-	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500
-	$url = preg_replace(',^feed://,i', 'http://', $url);
501
-	if (!tester_url_absolue($url)) {
502
-		$url = 'http://' . $url;
503
-	} elseif (strncmp($url, '//', 2) == 0) {
504
-		$url = 'http:' . $url;
505
-	}
506
-
507
-	$url = url_to_ascii($url);
508
-
509
-	$result = [
510
-		'status' => 0,
511
-		'headers' => '',
512
-		'page' => '',
513
-		'length' => 0,
514
-		'last_modified' => '',
515
-		'location' => '',
516
-		'url' => $url
517
-	];
518
-
519
-	// si on ecrit directement dans un fichier, pour ne pas manipuler en memoire refuser gz
520
-	$refuser_gz = (($options['refuser_gz'] or $copy) ? true : false);
521
-
522
-	// ouvrir la connexion et envoyer la requete et ses en-tetes
523
-	[$handle, $fopen] = init_http(
524
-		$options['methode'],
525
-		$url,
526
-		$refuser_gz,
527
-		$options['uri_referer'],
528
-		$formatted_data,
529
-		$options['version_http'],
530
-		$options['if_modified_since']
531
-	);
532
-	if (!$handle) {
533
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
534
-
535
-		return false;
536
-	}
537
-
538
-	// Sauf en fopen, envoyer le flux d'entree
539
-	// et recuperer les en-tetes de reponses
540
-	if (!$fopen) {
541
-		$res = recuperer_entetes_complets($handle, $options['if_modified_since']);
542
-		if (!$res) {
543
-			fclose($handle);
544
-			$t = @parse_url($url);
545
-			$host = $t['host'];
546
-			// Chinoisierie inexplicable pour contrer
547
-			// les actions liberticides de l'empire du milieu
548
-			if (
549
-				!need_proxy($host)
550
-				and $res = @file_get_contents($url)
551
-			) {
552
-				$result['length'] = strlen($res);
553
-				if ($copy) {
554
-					ecrire_fichier($copy, $res);
555
-					$result['file'] = $copy;
556
-				} else {
557
-					$result['page'] = $res;
558
-				}
559
-				$res = [
560
-					'status' => 200,
561
-				];
562
-			} else {
563
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
564
-				return false;
565
-			}
566
-		} elseif ($res['location'] and $options['follow_location']) {
567
-			$options['follow_location']--;
568
-			fclose($handle);
569
-			include_spip('inc/filtres');
570
-			$url = suivre_lien($url, $res['location']);
571
-
572
-			// une redirection doit se faire en GET, sauf status explicite 307 ou 308 qui indique de garder la meme methode
573
-			if ($options['methode'] !== 'GET') {
574
-				if (empty($res['status']) or !in_array($res['status'], [307, 308])) {
575
-					$options['methode'] = 'GET';
576
-					$options['datas'] = '';
577
-				}
578
-			}
579
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
580
-
581
-			return recuperer_url($url, $options);
582
-		} elseif ($res['status'] !== 200) {
583
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
584
-		}
585
-		$result['status'] = $res['status'];
586
-		if (isset($res['headers'])) {
587
-			$result['headers'] = $res['headers'];
588
-		}
589
-		if (isset($res['last_modified'])) {
590
-			$result['last_modified'] = $res['last_modified'];
591
-		}
592
-		if (isset($res['location'])) {
593
-			$result['location'] = $res['location'];
594
-		}
595
-	}
596
-
597
-	// on ne veut que les entetes
598
-	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
600
-		return $result;
601
-	}
602
-
603
-
604
-	// s'il faut deballer, le faire via un fichier temporaire
605
-	// sinon la memoire explose pour les gros flux
606
-
607
-	$gz = false;
608
-	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
610
-	}
611
-
612
-	// si on a pas deja recuperer le contenu par une methode detournee
613
-	if (!$result['length']) {
614
-		$res = recuperer_body($handle, $options['taille_max'], $gz ?: $copy);
615
-		fclose($handle);
616
-		if ($copy) {
617
-			$result['length'] = $res;
618
-			$result['file'] = $copy;
619
-		} elseif ($res) {
620
-			$result['page'] = &$res;
621
-			$result['length'] = strlen($result['page']);
622
-		}
623
-		if (!$result['status']) {
624
-			$result['status'] = 200; // on a reussi, donc !
625
-		}
626
-	}
627
-	if (!$result['page']) {
628
-		return $result;
629
-	}
630
-
631
-	// Decompresser au besoin
632
-	if ($gz) {
633
-		$result['page'] = implode('', gzfile($gz));
634
-		supprimer_fichier($gz);
635
-	}
636
-
637
-	// Faut-il l'importer dans notre charset local ?
638
-	if ($options['transcoder']) {
639
-		include_spip('inc/charsets');
640
-		$result['page'] = transcoder_page($result['page'], $result['headers']);
641
-	}
642
-
643
-	$trace = json_decode(json_encode($result), true);
644
-	$trace['page'] = '...';
645
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
646
-
647
-	return $result;
445
+    // Conserve la mémoire de la méthode fournit éventuellement
446
+    $methode_demandee = $options['methode'] ?? '';
447
+    $default = [
448
+        'transcoder' => false,
449
+        'methode' => 'GET',
450
+        'taille_max' => null,
451
+        'headers' => [],
452
+        'datas' => '',
453
+        'boundary' => '',
454
+        'refuser_gz' => false,
455
+        'if_modified_since' => '',
456
+        'uri_referer' => '',
457
+        'file' => '',
458
+        'follow_location' => 10,
459
+        'version_http' => _INC_DISTANT_VERSION_HTTP,
460
+    ];
461
+    $options = array_merge($default, $options);
462
+    // copier directement dans un fichier ?
463
+    $copy = $options['file'];
464
+
465
+    if ($options['methode'] == 'HEAD') {
466
+        $options['taille_max'] = 0;
467
+    }
468
+    if (is_null($options['taille_max'])) {
469
+        $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470
+    }
471
+
472
+    spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
473
+
474
+    // Ajout des en-têtes spécifiques si besoin
475
+    $formatted_data = '';
476
+    if (!empty($options['headers'])) {
477
+        foreach ($options['headers'] as $champ => $valeur) {
478
+            $formatted_data .= $champ . ': ' . $valeur . "\r\n";
479
+        }
480
+    }
481
+
482
+    if (!empty($options['datas'])) {
483
+        [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484
+        $head .= $formatted_data;
485
+        if (stripos($head, 'Content-Length:') === false) {
486
+            $head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
487
+        }
488
+        $formatted_data = $head . "\r\n" . $postdata;
489
+        if (
490
+            strlen($postdata)
491
+            and !$methode_demandee
492
+        ) {
493
+            $options['methode'] = 'POST';
494
+        }
495
+    } elseif ($formatted_data) {
496
+        $formatted_data .= "\r\n";
497
+    }
498
+
499
+    // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500
+    $url = preg_replace(',^feed://,i', 'http://', $url);
501
+    if (!tester_url_absolue($url)) {
502
+        $url = 'http://' . $url;
503
+    } elseif (strncmp($url, '//', 2) == 0) {
504
+        $url = 'http:' . $url;
505
+    }
506
+
507
+    $url = url_to_ascii($url);
508
+
509
+    $result = [
510
+        'status' => 0,
511
+        'headers' => '',
512
+        'page' => '',
513
+        'length' => 0,
514
+        'last_modified' => '',
515
+        'location' => '',
516
+        'url' => $url
517
+    ];
518
+
519
+    // si on ecrit directement dans un fichier, pour ne pas manipuler en memoire refuser gz
520
+    $refuser_gz = (($options['refuser_gz'] or $copy) ? true : false);
521
+
522
+    // ouvrir la connexion et envoyer la requete et ses en-tetes
523
+    [$handle, $fopen] = init_http(
524
+        $options['methode'],
525
+        $url,
526
+        $refuser_gz,
527
+        $options['uri_referer'],
528
+        $formatted_data,
529
+        $options['version_http'],
530
+        $options['if_modified_since']
531
+    );
532
+    if (!$handle) {
533
+        spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
534
+
535
+        return false;
536
+    }
537
+
538
+    // Sauf en fopen, envoyer le flux d'entree
539
+    // et recuperer les en-tetes de reponses
540
+    if (!$fopen) {
541
+        $res = recuperer_entetes_complets($handle, $options['if_modified_since']);
542
+        if (!$res) {
543
+            fclose($handle);
544
+            $t = @parse_url($url);
545
+            $host = $t['host'];
546
+            // Chinoisierie inexplicable pour contrer
547
+            // les actions liberticides de l'empire du milieu
548
+            if (
549
+                !need_proxy($host)
550
+                and $res = @file_get_contents($url)
551
+            ) {
552
+                $result['length'] = strlen($res);
553
+                if ($copy) {
554
+                    ecrire_fichier($copy, $res);
555
+                    $result['file'] = $copy;
556
+                } else {
557
+                    $result['page'] = $res;
558
+                }
559
+                $res = [
560
+                    'status' => 200,
561
+                ];
562
+            } else {
563
+                spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
564
+                return false;
565
+            }
566
+        } elseif ($res['location'] and $options['follow_location']) {
567
+            $options['follow_location']--;
568
+            fclose($handle);
569
+            include_spip('inc/filtres');
570
+            $url = suivre_lien($url, $res['location']);
571
+
572
+            // une redirection doit se faire en GET, sauf status explicite 307 ou 308 qui indique de garder la meme methode
573
+            if ($options['methode'] !== 'GET') {
574
+                if (empty($res['status']) or !in_array($res['status'], [307, 308])) {
575
+                    $options['methode'] = 'GET';
576
+                    $options['datas'] = '';
577
+                }
578
+            }
579
+            spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
580
+
581
+            return recuperer_url($url, $options);
582
+        } elseif ($res['status'] !== 200) {
583
+            spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
584
+        }
585
+        $result['status'] = $res['status'];
586
+        if (isset($res['headers'])) {
587
+            $result['headers'] = $res['headers'];
588
+        }
589
+        if (isset($res['last_modified'])) {
590
+            $result['last_modified'] = $res['last_modified'];
591
+        }
592
+        if (isset($res['location'])) {
593
+            $result['location'] = $res['location'];
594
+        }
595
+    }
596
+
597
+    // on ne veut que les entetes
598
+    if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
+        spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
600
+        return $result;
601
+    }
602
+
603
+
604
+    // s'il faut deballer, le faire via un fichier temporaire
605
+    // sinon la memoire explose pour les gros flux
606
+
607
+    $gz = false;
608
+    if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
+        $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
610
+    }
611
+
612
+    // si on a pas deja recuperer le contenu par une methode detournee
613
+    if (!$result['length']) {
614
+        $res = recuperer_body($handle, $options['taille_max'], $gz ?: $copy);
615
+        fclose($handle);
616
+        if ($copy) {
617
+            $result['length'] = $res;
618
+            $result['file'] = $copy;
619
+        } elseif ($res) {
620
+            $result['page'] = &$res;
621
+            $result['length'] = strlen($result['page']);
622
+        }
623
+        if (!$result['status']) {
624
+            $result['status'] = 200; // on a reussi, donc !
625
+        }
626
+    }
627
+    if (!$result['page']) {
628
+        return $result;
629
+    }
630
+
631
+    // Decompresser au besoin
632
+    if ($gz) {
633
+        $result['page'] = implode('', gzfile($gz));
634
+        supprimer_fichier($gz);
635
+    }
636
+
637
+    // Faut-il l'importer dans notre charset local ?
638
+    if ($options['transcoder']) {
639
+        include_spip('inc/charsets');
640
+        $result['page'] = transcoder_page($result['page'], $result['headers']);
641
+    }
642
+
643
+    $trace = json_decode(json_encode($result), true);
644
+    $trace['page'] = '...';
645
+    spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
646
+
647
+    return $result;
648 648
 }
649 649
 
650 650
 /**
@@ -660,73 +660,73 @@  discard block
 block discarded – undo
660 660
  * @return array|bool|mixed
661 661
  */
662 662
 function recuperer_url_cache($url, $options = []) {
663
-	if (!defined('_DELAI_RECUPERER_URL_CACHE')) {
664
-		define('_DELAI_RECUPERER_URL_CACHE', 3600);
665
-	}
666
-	$default = [
667
-		'transcoder' => false,
668
-		'methode' => 'GET',
669
-		'taille_max' => null,
670
-		'datas' => '',
671
-		'boundary' => '',
672
-		'refuser_gz' => false,
673
-		'if_modified_since' => '',
674
-		'uri_referer' => '',
675
-		'file' => '',
676
-		'follow_location' => 10,
677
-		'version_http' => _INC_DISTANT_VERSION_HTTP,
678
-		'delai_cache' => in_array(_VAR_MODE, ['preview', 'recalcul']) ? 0 : _DELAI_RECUPERER_URL_CACHE,
679
-	];
680
-	$options = array_merge($default, $options);
681
-
682
-	// cas ou il n'est pas possible de cacher
683
-	if (!empty($options['data']) or $options['methode'] == 'POST') {
684
-		return recuperer_url($url, $options);
685
-	}
686
-
687
-	// ne pas tenter plusieurs fois la meme url en erreur (non cachee donc)
688
-	static $errors = [];
689
-	if (isset($errors[$url])) {
690
-		return $errors[$url];
691
-	}
692
-
693
-	$sig = $options;
694
-	unset($sig['if_modified_since']);
695
-	unset($sig['delai_cache']);
696
-	$sig['url'] = $url;
697
-
698
-	$dir = sous_repertoire(_DIR_CACHE, 'curl');
699
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
700
-	$sub = sous_repertoire($dir, substr($cache, 0, 2));
701
-	$cache = "$sub$cache";
702
-
703
-	$res = false;
704
-	$is_cached = file_exists($cache);
705
-	if (
706
-		$is_cached
707
-		and (filemtime($cache) > $_SERVER['REQUEST_TIME'] - $options['delai_cache'])
708
-	) {
709
-		lire_fichier($cache, $res);
710
-		if ($res = unserialize($res)) {
711
-			// mettre le last_modified et le status=304 ?
712
-		}
713
-	}
714
-	if (!$res) {
715
-		$res = recuperer_url($url, $options);
716
-		// ne pas recharger cette url non cachee dans le meme hit puisque non disponible
717
-		if (!$res) {
718
-			if ($is_cached) {
719
-				// on a pas reussi a recuperer mais on avait un cache : l'utiliser
720
-				lire_fichier($cache, $res);
721
-				$res = unserialize($res);
722
-			}
723
-
724
-			return $errors[$url] = $res;
725
-		}
726
-		ecrire_fichier($cache, serialize($res));
727
-	}
728
-
729
-	return $res;
663
+    if (!defined('_DELAI_RECUPERER_URL_CACHE')) {
664
+        define('_DELAI_RECUPERER_URL_CACHE', 3600);
665
+    }
666
+    $default = [
667
+        'transcoder' => false,
668
+        'methode' => 'GET',
669
+        'taille_max' => null,
670
+        'datas' => '',
671
+        'boundary' => '',
672
+        'refuser_gz' => false,
673
+        'if_modified_since' => '',
674
+        'uri_referer' => '',
675
+        'file' => '',
676
+        'follow_location' => 10,
677
+        'version_http' => _INC_DISTANT_VERSION_HTTP,
678
+        'delai_cache' => in_array(_VAR_MODE, ['preview', 'recalcul']) ? 0 : _DELAI_RECUPERER_URL_CACHE,
679
+    ];
680
+    $options = array_merge($default, $options);
681
+
682
+    // cas ou il n'est pas possible de cacher
683
+    if (!empty($options['data']) or $options['methode'] == 'POST') {
684
+        return recuperer_url($url, $options);
685
+    }
686
+
687
+    // ne pas tenter plusieurs fois la meme url en erreur (non cachee donc)
688
+    static $errors = [];
689
+    if (isset($errors[$url])) {
690
+        return $errors[$url];
691
+    }
692
+
693
+    $sig = $options;
694
+    unset($sig['if_modified_since']);
695
+    unset($sig['delai_cache']);
696
+    $sig['url'] = $url;
697
+
698
+    $dir = sous_repertoire(_DIR_CACHE, 'curl');
699
+    $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
700
+    $sub = sous_repertoire($dir, substr($cache, 0, 2));
701
+    $cache = "$sub$cache";
702
+
703
+    $res = false;
704
+    $is_cached = file_exists($cache);
705
+    if (
706
+        $is_cached
707
+        and (filemtime($cache) > $_SERVER['REQUEST_TIME'] - $options['delai_cache'])
708
+    ) {
709
+        lire_fichier($cache, $res);
710
+        if ($res = unserialize($res)) {
711
+            // mettre le last_modified et le status=304 ?
712
+        }
713
+    }
714
+    if (!$res) {
715
+        $res = recuperer_url($url, $options);
716
+        // ne pas recharger cette url non cachee dans le meme hit puisque non disponible
717
+        if (!$res) {
718
+            if ($is_cached) {
719
+                // on a pas reussi a recuperer mais on avait un cache : l'utiliser
720
+                lire_fichier($cache, $res);
721
+                $res = unserialize($res);
722
+            }
723
+
724
+            return $errors[$url] = $res;
725
+        }
726
+        ecrire_fichier($cache, serialize($res));
727
+    }
728
+
729
+    return $res;
730 730
 }
731 731
 
732 732
 /**
@@ -744,42 +744,42 @@  discard block
 block discarded – undo
744 744
  *   string contenu de la resource
745 745
  */
746 746
 function recuperer_body($handle, $taille_max = _INC_DISTANT_MAX_SIZE, $fichier = '') {
747
-	$tmpfile = null;
748
-	$taille = 0;
749
-	$result = '';
750
-	$fp = false;
751
-	if ($fichier) {
752
-		include_spip('inc/acces');
753
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
754
-		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755
-		if (!$fp and file_exists($fichier)) {
756
-			return filesize($fichier);
757
-		}
758
-		if (!$fp) {
759
-			return false;
760
-		}
761
-		$result = 0; // on renvoie la taille du fichier
762
-	}
763
-	while (!feof($handle) and $taille < $taille_max) {
764
-		$res = fread($handle, 16384);
765
-		$taille += strlen($res);
766
-		if ($fp) {
767
-			fwrite($fp, $res);
768
-			$result = $taille;
769
-		} else {
770
-			$result .= $res;
771
-		}
772
-	}
773
-	if ($fp) {
774
-		spip_fclose_unlock($fp);
775
-		spip_unlink($fichier);
776
-		@rename($tmpfile, $fichier);
777
-		if (!file_exists($fichier)) {
778
-			return false;
779
-		}
780
-	}
781
-
782
-	return $result;
747
+    $tmpfile = null;
748
+    $taille = 0;
749
+    $result = '';
750
+    $fp = false;
751
+    if ($fichier) {
752
+        include_spip('inc/acces');
753
+        $tmpfile = "$fichier." . creer_uniqid() . '.tmp';
754
+        $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755
+        if (!$fp and file_exists($fichier)) {
756
+            return filesize($fichier);
757
+        }
758
+        if (!$fp) {
759
+            return false;
760
+        }
761
+        $result = 0; // on renvoie la taille du fichier
762
+    }
763
+    while (!feof($handle) and $taille < $taille_max) {
764
+        $res = fread($handle, 16384);
765
+        $taille += strlen($res);
766
+        if ($fp) {
767
+            fwrite($fp, $res);
768
+            $result = $taille;
769
+        } else {
770
+            $result .= $res;
771
+        }
772
+    }
773
+    if ($fp) {
774
+        spip_fclose_unlock($fp);
775
+        spip_unlink($fichier);
776
+        @rename($tmpfile, $fichier);
777
+        if (!file_exists($fichier)) {
778
+            return false;
779
+        }
780
+    }
781
+
782
+    return $result;
783 783
 }
784 784
 
785 785
 /**
@@ -801,35 +801,35 @@  discard block
 block discarded – undo
801 801
  *   string location
802 802
  */
803 803
 function recuperer_entetes_complets($handle, $if_modified_since = false) {
804
-	$result = ['status' => 0, 'headers' => [], 'last_modified' => 0, 'location' => ''];
805
-
806
-	$s = @trim(fgets($handle, 16384));
807
-	if (!preg_match(',^HTTP/[0-9]+\.[0-9]+ ([0-9]+),', $s, $r)) {
808
-		return false;
809
-	}
810
-	$result['status'] = intval($r[1]);
811
-	while ($s = trim(fgets($handle, 16384))) {
812
-		$result['headers'][] = $s . "\n";
813
-		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814
-		[, $d, $v] = $r;
815
-		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
816
-			$result['location'] = $v;
817
-		} elseif ($d == 'Last-Modified') {
818
-			$result['last_modified'] = strtotime($v);
819
-		}
820
-	}
821
-	if (
822
-		$if_modified_since
823
-		and $result['last_modified']
824
-		and $if_modified_since > $result['last_modified']
825
-		and $result['status'] == 200
826
-	) {
827
-		$result['status'] = 304;
828
-	}
829
-
830
-	$result['headers'] = implode('', $result['headers']);
831
-
832
-	return $result;
804
+    $result = ['status' => 0, 'headers' => [], 'last_modified' => 0, 'location' => ''];
805
+
806
+    $s = @trim(fgets($handle, 16384));
807
+    if (!preg_match(',^HTTP/[0-9]+\.[0-9]+ ([0-9]+),', $s, $r)) {
808
+        return false;
809
+    }
810
+    $result['status'] = intval($r[1]);
811
+    while ($s = trim(fgets($handle, 16384))) {
812
+        $result['headers'][] = $s . "\n";
813
+        preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814
+        [, $d, $v] = $r;
815
+        if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
816
+            $result['location'] = $v;
817
+        } elseif ($d == 'Last-Modified') {
818
+            $result['last_modified'] = strtotime($v);
819
+        }
820
+    }
821
+    if (
822
+        $if_modified_since
823
+        and $result['last_modified']
824
+        and $if_modified_since > $result['last_modified']
825
+        and $result['status'] == 200
826
+    ) {
827
+        $result['status'] = 304;
828
+    }
829
+
830
+    $result['headers'] = implode('', $result['headers']);
831
+
832
+    return $result;
833 833
 }
834 834
 
835 835
 /**
@@ -851,22 +851,22 @@  discard block
 block discarded – undo
851 851
  *     Nom du fichier pour copie locale
852 852
  **/
853 853
 function nom_fichier_copie_locale($source, $extension) {
854
-	include_spip('inc/documents');
854
+    include_spip('inc/documents');
855 855
 
856
-	$d = creer_repertoire_documents('distant'); # IMG/distant/
857
-	$d = sous_repertoire($d, $extension); # IMG/distant/pdf/
856
+    $d = creer_repertoire_documents('distant'); # IMG/distant/
857
+    $d = sous_repertoire($d, $extension); # IMG/distant/pdf/
858 858
 
859
-	// on se place tout le temps comme si on etait a la racine
860
-	if (_DIR_RACINE) {
861
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
862
-	}
859
+    // on se place tout le temps comme si on etait a la racine
860
+    if (_DIR_RACINE) {
861
+        $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
862
+    }
863 863
 
864
-	$m = md5($source);
864
+    $m = md5($source);
865 865
 
866
-	return $d
867
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
868
-	. substr($m, 0, 4)
869
-	. ".$extension";
866
+    return $d
867
+    . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
868
+    . substr($m, 0, 4)
869
+    . ".$extension";
870 870
 }
871 871
 
872 872
 /**
@@ -885,72 +885,72 @@  discard block
 block discarded – undo
885 885
  *      - null: Copie locale impossible
886 886
  **/
887 887
 function fichier_copie_locale($source) {
888
-	// Si c'est deja local pas de souci
889
-	if (!tester_url_absolue($source)) {
890
-		if (_DIR_RACINE) {
891
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
892
-		}
893
-
894
-		return $source;
895
-	}
896
-
897
-	// optimisation : on regarde si on peut deviner l'extension dans l'url et si le fichier
898
-	// a deja ete copie en local avec cette extension
899
-	// dans ce cas elle est fiable, pas la peine de requeter en base
900
-	$path_parts = pathinfo($source);
901
-	if (!isset($path_parts['extension'])) {
902
-		$path_parts['extension'] = '';
903
-	}
904
-	$ext = $path_parts ? $path_parts['extension'] : '';
905
-	if (
906
-		$ext
907
-		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
908
-		and $f = nom_fichier_copie_locale($source, $ext)
909
-		and file_exists(_DIR_RACINE . $f)
910
-	) {
911
-		return $f;
912
-	}
913
-
914
-
915
-	// Si c'est deja dans la table des documents,
916
-	// ramener le nom de sa copie potentielle
917
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
918
-
919
-	if ($ext) {
920
-		return nom_fichier_copie_locale($source, $ext);
921
-	}
922
-
923
-	// voir si l'extension indiquee dans le nom du fichier est ok
924
-	// et si il n'aurait pas deja ete rapatrie
925
-
926
-	$ext = $path_parts ? $path_parts['extension'] : '';
927
-
928
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
929
-		$f = nom_fichier_copie_locale($source, $ext);
930
-		if (file_exists(_DIR_RACINE . $f)) {
931
-			return $f;
932
-		}
933
-	}
934
-
935
-	// Ping  pour voir si son extension est connue et autorisee
936
-	// avec mise en cache du resultat du ping
937
-
938
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
939
-	if (
940
-		!@file_exists($cache)
941
-		or !$path_parts = @unserialize(spip_file_get_contents($cache))
942
-		or _request('var_mode') === 'recalcul'
943
-	) {
944
-		$path_parts = recuperer_infos_distantes($source, ['charger_si_petite_image' => false]);
945
-		ecrire_fichier($cache, serialize($path_parts));
946
-	}
947
-	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
948
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
949
-		return nom_fichier_copie_locale($source, $ext);
950
-	}
951
-
952
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
953
-	return null;
888
+    // Si c'est deja local pas de souci
889
+    if (!tester_url_absolue($source)) {
890
+        if (_DIR_RACINE) {
891
+            $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
892
+        }
893
+
894
+        return $source;
895
+    }
896
+
897
+    // optimisation : on regarde si on peut deviner l'extension dans l'url et si le fichier
898
+    // a deja ete copie en local avec cette extension
899
+    // dans ce cas elle est fiable, pas la peine de requeter en base
900
+    $path_parts = pathinfo($source);
901
+    if (!isset($path_parts['extension'])) {
902
+        $path_parts['extension'] = '';
903
+    }
904
+    $ext = $path_parts ? $path_parts['extension'] : '';
905
+    if (
906
+        $ext
907
+        and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
908
+        and $f = nom_fichier_copie_locale($source, $ext)
909
+        and file_exists(_DIR_RACINE . $f)
910
+    ) {
911
+        return $f;
912
+    }
913
+
914
+
915
+    // Si c'est deja dans la table des documents,
916
+    // ramener le nom de sa copie potentielle
917
+    $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
918
+
919
+    if ($ext) {
920
+        return nom_fichier_copie_locale($source, $ext);
921
+    }
922
+
923
+    // voir si l'extension indiquee dans le nom du fichier est ok
924
+    // et si il n'aurait pas deja ete rapatrie
925
+
926
+    $ext = $path_parts ? $path_parts['extension'] : '';
927
+
928
+    if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
929
+        $f = nom_fichier_copie_locale($source, $ext);
930
+        if (file_exists(_DIR_RACINE . $f)) {
931
+            return $f;
932
+        }
933
+    }
934
+
935
+    // Ping  pour voir si son extension est connue et autorisee
936
+    // avec mise en cache du resultat du ping
937
+
938
+    $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
939
+    if (
940
+        !@file_exists($cache)
941
+        or !$path_parts = @unserialize(spip_file_get_contents($cache))
942
+        or _request('var_mode') === 'recalcul'
943
+    ) {
944
+        $path_parts = recuperer_infos_distantes($source, ['charger_si_petite_image' => false]);
945
+        ecrire_fichier($cache, serialize($path_parts));
946
+    }
947
+    $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
948
+    if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
949
+        return nom_fichier_copie_locale($source, $ext);
950
+    }
951
+
952
+    spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
953
+    return null;
954 954
 }
955 955
 
956 956
 
@@ -979,110 +979,110 @@  discard block
 block discarded – undo
979 979
  **/
980 980
 function recuperer_infos_distantes($source, $options = []) {
981 981
 
982
-	// pas la peine de perdre son temps
983
-	if (!tester_url_absolue($source)) {
984
-		return false;
985
-	}
986
-
987
-	$taille_max = $options['taille_max'] ?? 0;
988
-	$charger_si_petite_image = !!($options['charger_si_petite_image'] ?? true);
989
-	$callback_valider_url = $options['callback_valider_url'] ?? null;
990
-
991
-	# charger les alias des types mime
992
-	include_spip('base/typedoc');
993
-
994
-	$a = [];
995
-	$mime_type = '';
996
-	// On va directement charger le debut des images et des fichiers html,
997
-	// de maniere a attrapper le maximum d'infos (titre, taille, etc). Si
998
-	// ca echoue l'utilisateur devra les entrer...
999
-	$reponse = recuperer_url($source, ['taille_max' => $taille_max, 'refuser_gz' => true]);
1000
-	if (
1001
-		$callback_valider_url
1002
-		and is_callable($callback_valider_url)
1003
-		and !$callback_valider_url($reponse['url'])
1004
-	) {
1005
-		return false;
1006
-	}
1007
-	$headers = $reponse['headers'] ?? '';
1008
-	$a['body'] = $reponse['page'] ?? '';
1009
-	if ($headers) {
1010
-		if (!$extension = distant_trouver_extension_selon_headers($source, $headers)) {
1011
-			return false;
1012
-		}
1013
-
1014
-		$a['extension'] = $extension;
1015
-
1016
-		if (preg_match(",\nContent-Length: *([^[:space:]]*),i", "\n$headers", $regs)) {
1017
-			$a['taille'] = intval($regs[1]);
1018
-		}
1019
-	}
1020
-
1021
-	// Echec avec HEAD, on tente avec GET
1022
-	if (!$a and !$taille_max) {
1023
-		spip_log("tenter GET $source", 'distant');
1024
-		$options['taille_max'] = _INC_DISTANT_MAX_SIZE;
1025
-		$a = recuperer_infos_distantes($source, $options);
1026
-	}
1027
-
1028
-	// si on a rien trouve pas la peine d'insister
1029
-	if (!$a) {
1030
-		return false;
1031
-	}
1032
-
1033
-	// S'il s'agit d'une image pas trop grosse ou d'un fichier html, on va aller
1034
-	// recharger le document en GET et recuperer des donnees supplementaires...
1035
-	include_spip('inc/filtres_images_lib_mini');
1036
-	if (
1037
-		strpos($mime_type, 'image/') === 0
1038
-		and $extension = _image_trouver_extension_depuis_mime($mime_type)
1039
-	) {
1040
-		if (
1041
-			$taille_max == 0
1042
-			and (empty($a['taille']) or $a['taille'] < _INC_DISTANT_MAX_SIZE)
1043
-			and in_array($extension, formats_image_acceptables())
1044
-			and $charger_si_petite_image
1045
-		) {
1046
-			$options['taille_max'] = _INC_DISTANT_MAX_SIZE;
1047
-			$a = recuperer_infos_distantes($source, $options);
1048
-		} else {
1049
-			if ($a['body']) {
1050
-				$a['extension'] = $extension;
1051
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1052
-				ecrire_fichier($a['fichier'], $a['body']);
1053
-				$size_image = @spip_getimagesize($a['fichier']);
1054
-				$a['largeur'] = intval($size_image[0]);
1055
-				$a['hauteur'] = intval($size_image[1]);
1056
-				$a['type_image'] = true;
1057
-			}
1058
-		}
1059
-	}
1060
-
1061
-	// Fichier swf, si on n'a pas la taille, on va mettre 425x350 par defaut
1062
-	// ce sera mieux que 0x0
1063
-	// Flash is dead!
1064
-	if (
1065
-		$a and isset($a['extension']) and $a['extension'] == 'swf'
1066
-		and empty($a['largeur'])
1067
-	) {
1068
-		$a['largeur'] = 425;
1069
-		$a['hauteur'] = 350;
1070
-	}
1071
-
1072
-	if ($mime_type == 'text/html') {
1073
-		include_spip('inc/filtres');
1074
-		$page = recuperer_url($source, ['transcoder' => true, 'taille_max' => _INC_DISTANT_MAX_SIZE]);
1075
-		$page = $page['page'] ?? '';
1076
-		if (preg_match(',<title>(.*?)</title>,ims', $page, $regs)) {
1077
-			$a['titre'] = corriger_caracteres(trim($regs[1]));
1078
-		}
1079
-		if (!isset($a['taille']) or !$a['taille']) {
1080
-			$a['taille'] = strlen($page); # a peu pres
1081
-		}
1082
-	}
1083
-	$a['mime_type'] = $mime_type;
1084
-
1085
-	return $a;
982
+    // pas la peine de perdre son temps
983
+    if (!tester_url_absolue($source)) {
984
+        return false;
985
+    }
986
+
987
+    $taille_max = $options['taille_max'] ?? 0;
988
+    $charger_si_petite_image = !!($options['charger_si_petite_image'] ?? true);
989
+    $callback_valider_url = $options['callback_valider_url'] ?? null;
990
+
991
+    # charger les alias des types mime
992
+    include_spip('base/typedoc');
993
+
994
+    $a = [];
995
+    $mime_type = '';
996
+    // On va directement charger le debut des images et des fichiers html,
997
+    // de maniere a attrapper le maximum d'infos (titre, taille, etc). Si
998
+    // ca echoue l'utilisateur devra les entrer...
999
+    $reponse = recuperer_url($source, ['taille_max' => $taille_max, 'refuser_gz' => true]);
1000
+    if (
1001
+        $callback_valider_url
1002
+        and is_callable($callback_valider_url)
1003
+        and !$callback_valider_url($reponse['url'])
1004
+    ) {
1005
+        return false;
1006
+    }
1007
+    $headers = $reponse['headers'] ?? '';
1008
+    $a['body'] = $reponse['page'] ?? '';
1009
+    if ($headers) {
1010
+        if (!$extension = distant_trouver_extension_selon_headers($source, $headers)) {
1011
+            return false;
1012
+        }
1013
+
1014
+        $a['extension'] = $extension;
1015
+
1016
+        if (preg_match(",\nContent-Length: *([^[:space:]]*),i", "\n$headers", $regs)) {
1017
+            $a['taille'] = intval($regs[1]);
1018
+        }
1019
+    }
1020
+
1021
+    // Echec avec HEAD, on tente avec GET
1022
+    if (!$a and !$taille_max) {
1023
+        spip_log("tenter GET $source", 'distant');
1024
+        $options['taille_max'] = _INC_DISTANT_MAX_SIZE;
1025
+        $a = recuperer_infos_distantes($source, $options);
1026
+    }
1027
+
1028
+    // si on a rien trouve pas la peine d'insister
1029
+    if (!$a) {
1030
+        return false;
1031
+    }
1032
+
1033
+    // S'il s'agit d'une image pas trop grosse ou d'un fichier html, on va aller
1034
+    // recharger le document en GET et recuperer des donnees supplementaires...
1035
+    include_spip('inc/filtres_images_lib_mini');
1036
+    if (
1037
+        strpos($mime_type, 'image/') === 0
1038
+        and $extension = _image_trouver_extension_depuis_mime($mime_type)
1039
+    ) {
1040
+        if (
1041
+            $taille_max == 0
1042
+            and (empty($a['taille']) or $a['taille'] < _INC_DISTANT_MAX_SIZE)
1043
+            and in_array($extension, formats_image_acceptables())
1044
+            and $charger_si_petite_image
1045
+        ) {
1046
+            $options['taille_max'] = _INC_DISTANT_MAX_SIZE;
1047
+            $a = recuperer_infos_distantes($source, $options);
1048
+        } else {
1049
+            if ($a['body']) {
1050
+                $a['extension'] = $extension;
1051
+                $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1052
+                ecrire_fichier($a['fichier'], $a['body']);
1053
+                $size_image = @spip_getimagesize($a['fichier']);
1054
+                $a['largeur'] = intval($size_image[0]);
1055
+                $a['hauteur'] = intval($size_image[1]);
1056
+                $a['type_image'] = true;
1057
+            }
1058
+        }
1059
+    }
1060
+
1061
+    // Fichier swf, si on n'a pas la taille, on va mettre 425x350 par defaut
1062
+    // ce sera mieux que 0x0
1063
+    // Flash is dead!
1064
+    if (
1065
+        $a and isset($a['extension']) and $a['extension'] == 'swf'
1066
+        and empty($a['largeur'])
1067
+    ) {
1068
+        $a['largeur'] = 425;
1069
+        $a['hauteur'] = 350;
1070
+    }
1071
+
1072
+    if ($mime_type == 'text/html') {
1073
+        include_spip('inc/filtres');
1074
+        $page = recuperer_url($source, ['transcoder' => true, 'taille_max' => _INC_DISTANT_MAX_SIZE]);
1075
+        $page = $page['page'] ?? '';
1076
+        if (preg_match(',<title>(.*?)</title>,ims', $page, $regs)) {
1077
+            $a['titre'] = corriger_caracteres(trim($regs[1]));
1078
+        }
1079
+        if (!isset($a['taille']) or !$a['taille']) {
1080
+            $a['taille'] = strlen($page); # a peu pres
1081
+        }
1082
+    }
1083
+    $a['mime_type'] = $mime_type;
1084
+
1085
+    return $a;
1086 1086
 }
1087 1087
 
1088 1088
 /**
@@ -1091,70 +1091,70 @@  discard block
 block discarded – undo
1091 1091
  * @return false|mixed
1092 1092
  */
1093 1093
 function distant_trouver_extension_selon_headers($source, $headers) {
1094
-	if (preg_match(",\nContent-Type: *([^[:space:];]*),i", "\n$headers", $regs)) {
1095
-		$mime_type = (trim($regs[1]));
1096
-	} else {
1097
-		$mime_type = '';
1098
-	} // inconnu
1099
-
1100
-	// Appliquer les alias
1101
-	while (isset($GLOBALS['mime_alias'][$mime_type])) {
1102
-		$mime_type = $GLOBALS['mime_alias'][$mime_type];
1103
-	}
1104
-
1105
-	// pour corriger_extension()
1106
-	include_spip('inc/documents');
1107
-
1108
-	// Si on a un mime-type insignifiant
1109
-	// text/plain,application/octet-stream ou vide
1110
-	// c'est peut-etre que le serveur ne sait pas
1111
-	// ce qu'il sert ; on va tenter de detecter via l'extension de l'url
1112
-	// ou le Content-Disposition: attachment; filename=...
1113
-	$t = null;
1114
-	if (in_array($mime_type, ['text/plain', '', 'application/octet-stream'])) {
1115
-		if (
1116
-			!$t
1117
-			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1118
-		) {
1119
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1120
-		}
1121
-		if (
1122
-			!$t
1123
-			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1124
-			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1125
-		) {
1126
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1127
-		}
1128
-	}
1129
-
1130
-	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1131
-	if (!$t) {
1132
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1133
-	}
1134
-
1135
-	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
1136
-	// On essaie de nouveau avec l'extension
1137
-	if (
1138
-		!$t
1139
-		and $mime_type != 'text/plain'
1140
-		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1141
-	) {
1142
-		# eviter xxx.3 => 3gp (> SPIP 3)
1143
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1144
-	}
1145
-
1146
-	if ($t) {
1147
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1148
-		return $t['extension'];
1149
-	} else {
1150
-		# par defaut on retombe sur '.bin' si c'est autorise
1151
-		spip_log("mime-type $mime_type inconnu", 'distant');
1152
-		$t = sql_fetsel('extension', 'spip_types_documents', "extension='bin'");
1153
-		if (!$t) {
1154
-			return false;
1155
-		}
1156
-		return $t['extension'];
1157
-	}
1094
+    if (preg_match(",\nContent-Type: *([^[:space:];]*),i", "\n$headers", $regs)) {
1095
+        $mime_type = (trim($regs[1]));
1096
+    } else {
1097
+        $mime_type = '';
1098
+    } // inconnu
1099
+
1100
+    // Appliquer les alias
1101
+    while (isset($GLOBALS['mime_alias'][$mime_type])) {
1102
+        $mime_type = $GLOBALS['mime_alias'][$mime_type];
1103
+    }
1104
+
1105
+    // pour corriger_extension()
1106
+    include_spip('inc/documents');
1107
+
1108
+    // Si on a un mime-type insignifiant
1109
+    // text/plain,application/octet-stream ou vide
1110
+    // c'est peut-etre que le serveur ne sait pas
1111
+    // ce qu'il sert ; on va tenter de detecter via l'extension de l'url
1112
+    // ou le Content-Disposition: attachment; filename=...
1113
+    $t = null;
1114
+    if (in_array($mime_type, ['text/plain', '', 'application/octet-stream'])) {
1115
+        if (
1116
+            !$t
1117
+            and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1118
+        ) {
1119
+            $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1120
+        }
1121
+        if (
1122
+            !$t
1123
+            and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1124
+            and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1125
+        ) {
1126
+            $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1127
+        }
1128
+    }
1129
+
1130
+    // Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1131
+    if (!$t) {
1132
+        $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1133
+    }
1134
+
1135
+    // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
1136
+    // On essaie de nouveau avec l'extension
1137
+    if (
1138
+        !$t
1139
+        and $mime_type != 'text/plain'
1140
+        and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1141
+    ) {
1142
+        # eviter xxx.3 => 3gp (> SPIP 3)
1143
+        $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1144
+    }
1145
+
1146
+    if ($t) {
1147
+        spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1148
+        return $t['extension'];
1149
+    } else {
1150
+        # par defaut on retombe sur '.bin' si c'est autorise
1151
+        spip_log("mime-type $mime_type inconnu", 'distant');
1152
+        $t = sql_fetsel('extension', 'spip_types_documents', "extension='bin'");
1153
+        if (!$t) {
1154
+            return false;
1155
+        }
1156
+        return $t['extension'];
1157
+    }
1158 1158
 }
1159 1159
 
1160 1160
 /**
@@ -1170,45 +1170,45 @@  discard block
 block discarded – undo
1170 1170
  */
1171 1171
 function need_proxy($host, $http_proxy = null, $http_noproxy = null) {
1172 1172
 
1173
-	$http_proxy ??= $GLOBALS['meta']['http_proxy'] ?? null;
1174
-
1175
-	// rien a faire si pas de proxy :)
1176
-	if (is_null($http_proxy) or !$http_proxy = trim($http_proxy)) {
1177
-		return '';
1178
-	}
1179
-
1180
-	if (is_null($http_noproxy)) {
1181
-		$http_noproxy = $GLOBALS['meta']['http_noproxy'] ?? null;
1182
-	}
1183
-	// si pas d'exception, on retourne le proxy
1184
-	if (is_null($http_noproxy) or !$http_noproxy = trim($http_noproxy)) {
1185
-		return $http_proxy;
1186
-	}
1187
-
1188
-	// si le host ou l'un des domaines parents est dans $http_noproxy on fait exception
1189
-	// $http_noproxy peut contenir plusieurs domaines separes par des espaces ou retour ligne
1190
-	$http_noproxy = str_replace("\n", ' ', $http_noproxy);
1191
-	$http_noproxy = str_replace("\r", ' ', $http_noproxy);
1192
-	$http_noproxy = " $http_noproxy ";
1193
-	$domain = $host;
1194
-	// si le domaine exact www.example.org est dans les exceptions
1195
-	if (strpos($http_noproxy, (string) " $domain ") !== false) {
1196
-		return '';
1197
-	}
1198
-
1199
-	while (strpos($domain, '.') !== false) {
1200
-		$domain = explode('.', $domain);
1201
-		array_shift($domain);
1202
-		$domain = implode('.', $domain);
1203
-
1204
-		// ou si un domaine parent commencant par un . est dans les exceptions (indiquant qu'il couvre tous les sous-domaines)
1205
-		if (strpos($http_noproxy, (string) " .$domain ") !== false) {
1206
-			return '';
1207
-		}
1208
-	}
1209
-
1210
-	// ok c'est pas une exception
1211
-	return $http_proxy;
1173
+    $http_proxy ??= $GLOBALS['meta']['http_proxy'] ?? null;
1174
+
1175
+    // rien a faire si pas de proxy :)
1176
+    if (is_null($http_proxy) or !$http_proxy = trim($http_proxy)) {
1177
+        return '';
1178
+    }
1179
+
1180
+    if (is_null($http_noproxy)) {
1181
+        $http_noproxy = $GLOBALS['meta']['http_noproxy'] ?? null;
1182
+    }
1183
+    // si pas d'exception, on retourne le proxy
1184
+    if (is_null($http_noproxy) or !$http_noproxy = trim($http_noproxy)) {
1185
+        return $http_proxy;
1186
+    }
1187
+
1188
+    // si le host ou l'un des domaines parents est dans $http_noproxy on fait exception
1189
+    // $http_noproxy peut contenir plusieurs domaines separes par des espaces ou retour ligne
1190
+    $http_noproxy = str_replace("\n", ' ', $http_noproxy);
1191
+    $http_noproxy = str_replace("\r", ' ', $http_noproxy);
1192
+    $http_noproxy = " $http_noproxy ";
1193
+    $domain = $host;
1194
+    // si le domaine exact www.example.org est dans les exceptions
1195
+    if (strpos($http_noproxy, (string) " $domain ") !== false) {
1196
+        return '';
1197
+    }
1198
+
1199
+    while (strpos($domain, '.') !== false) {
1200
+        $domain = explode('.', $domain);
1201
+        array_shift($domain);
1202
+        $domain = implode('.', $domain);
1203
+
1204
+        // ou si un domaine parent commencant par un . est dans les exceptions (indiquant qu'il couvre tous les sous-domaines)
1205
+        if (strpos($http_noproxy, (string) " .$domain ") !== false) {
1206
+            return '';
1207
+        }
1208
+    }
1209
+
1210
+    // ok c'est pas une exception
1211
+    return $http_proxy;
1212 1212
 }
1213 1213
 
1214 1214
 
@@ -1231,59 +1231,59 @@  discard block
 block discarded – undo
1231 1231
  * @return array
1232 1232
  */
1233 1233
 function init_http($method, $url, $refuse_gz = false, $referer = '', $datas = '', $vers = 'HTTP/1.0', $date = '') {
1234
-	$user = $via_proxy = $proxy_user = '';
1235
-	$fopen = false;
1236
-
1237
-	$t = @parse_url($url);
1238
-	$host = $t['host'];
1239
-	if ($t['scheme'] == 'http') {
1240
-		$scheme = 'http';
1241
-		$noproxy = '';
1242
-	} elseif ($t['scheme'] == 'https') {
1243
-		$scheme = 'ssl';
1244
-		$noproxy = 'ssl://';
1245
-		if (!isset($t['port']) || !($port = $t['port'])) {
1246
-			$t['port'] = 443;
1247
-		}
1248
-	} else {
1249
-		$scheme = $t['scheme'];
1250
-		$noproxy = $scheme . '://';
1251
-	}
1252
-	if (isset($t['user'])) {
1253
-		$user = [$t['user'], $t['pass']];
1254
-	}
1255
-
1256
-	if (!isset($t['port']) || !($port = $t['port'])) {
1257
-		$port = 80;
1258
-	}
1259
-	if (!isset($t['path']) || !($path = $t['path'])) {
1260
-		$path = '/';
1261
-	}
1262
-
1263
-	if (!empty($t['query'])) {
1264
-		$path .= '?' . $t['query'];
1265
-	}
1266
-
1267
-	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
1268
-	if (!$f or !is_resource($f)) {
1269
-		// fallback : fopen si on a pas fait timeout dans lance_requete
1270
-		// ce qui correspond a $f===110
1271
-		if (
1272
-			$f !== 110
1273
-			and !need_proxy($host)
1274
-			and !_request('tester_proxy')
1275
-			and (!isset($GLOBALS['inc_distant_allow_fopen']) or $GLOBALS['inc_distant_allow_fopen'])
1276
-		) {
1277
-			$f = @fopen($url, 'rb');
1278
-			spip_log("connexion vers $url par simple fopen", 'distant');
1279
-			$fopen = true;
1280
-		} else {
1281
-			// echec total
1282
-			$f = false;
1283
-		}
1284
-	}
1285
-
1286
-	return [$f, $fopen];
1234
+    $user = $via_proxy = $proxy_user = '';
1235
+    $fopen = false;
1236
+
1237
+    $t = @parse_url($url);
1238
+    $host = $t['host'];
1239
+    if ($t['scheme'] == 'http') {
1240
+        $scheme = 'http';
1241
+        $noproxy = '';
1242
+    } elseif ($t['scheme'] == 'https') {
1243
+        $scheme = 'ssl';
1244
+        $noproxy = 'ssl://';
1245
+        if (!isset($t['port']) || !($port = $t['port'])) {
1246
+            $t['port'] = 443;
1247
+        }
1248
+    } else {
1249
+        $scheme = $t['scheme'];
1250
+        $noproxy = $scheme . '://';
1251
+    }
1252
+    if (isset($t['user'])) {
1253
+        $user = [$t['user'], $t['pass']];
1254
+    }
1255
+
1256
+    if (!isset($t['port']) || !($port = $t['port'])) {
1257
+        $port = 80;
1258
+    }
1259
+    if (!isset($t['path']) || !($path = $t['path'])) {
1260
+        $path = '/';
1261
+    }
1262
+
1263
+    if (!empty($t['query'])) {
1264
+        $path .= '?' . $t['query'];
1265
+    }
1266
+
1267
+    $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
1268
+    if (!$f or !is_resource($f)) {
1269
+        // fallback : fopen si on a pas fait timeout dans lance_requete
1270
+        // ce qui correspond a $f===110
1271
+        if (
1272
+            $f !== 110
1273
+            and !need_proxy($host)
1274
+            and !_request('tester_proxy')
1275
+            and (!isset($GLOBALS['inc_distant_allow_fopen']) or $GLOBALS['inc_distant_allow_fopen'])
1276
+        ) {
1277
+            $f = @fopen($url, 'rb');
1278
+            spip_log("connexion vers $url par simple fopen", 'distant');
1279
+            $fopen = true;
1280
+        } else {
1281
+            // echec total
1282
+            $f = false;
1283
+        }
1284
+    }
1285
+
1286
+    return [$f, $fopen];
1287 1287
 }
1288 1288
 
1289 1289
 /**
@@ -1318,123 +1318,123 @@  discard block
 block discarded – undo
1318 1318
  *   resource socket vers l'url demandee
1319 1319
  */
1320 1320
 function lance_requete(
1321
-	$method,
1322
-	$scheme,
1323
-	$user,
1324
-	$host,
1325
-	$path,
1326
-	$port,
1327
-	$noproxy,
1328
-	$refuse_gz = false,
1329
-	$referer = '',
1330
-	$datas = '',
1331
-	$vers = 'HTTP/1.0',
1332
-	$date = ''
1321
+    $method,
1322
+    $scheme,
1323
+    $user,
1324
+    $host,
1325
+    $path,
1326
+    $port,
1327
+    $noproxy,
1328
+    $refuse_gz = false,
1329
+    $referer = '',
1330
+    $datas = '',
1331
+    $vers = 'HTTP/1.0',
1332
+    $date = ''
1333 1333
 ) {
1334 1334
 
1335
-	$proxy_user = '';
1336
-	$http_proxy = need_proxy($host);
1337
-	if ($user) {
1338
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1339
-	}
1340
-
1341
-	$connect = '';
1342
-	if ($http_proxy) {
1343
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1344
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1345
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1346
-				. "Host: $path_host\r\n"
1347
-				. "Proxy-Connection: Keep-Alive\r\n";
1348
-		} else {
1349
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1350
-				. (!$user ? '' : "$user@")
1351
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1352
-		}
1353
-		$t2 = @parse_url($http_proxy);
1354
-		$first_host = $t2['host'];
1355
-		$port = ($t2['port'] ?? null) ?: 80;
1356
-		if ($t2['user'] ?? null) {
1357
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1358
-		}
1359
-	} else {
1360
-		$first_host = $noproxy . $host;
1361
-	}
1362
-
1363
-	if ($connect) {
1364
-		$streamContext = stream_context_create([
1365
-			'ssl' => [
1366
-				'verify_peer' => false,
1367
-				'allow_self_signed' => true,
1368
-				'SNI_enabled' => true,
1369
-				'peer_name' => $host,
1370
-			]
1371
-		]);
1372
-		$f = @stream_socket_client(
1373
-			"tcp://$first_host:$port",
1374
-			$errno,
1375
-			$errstr,
1376
-			_INC_DISTANT_CONNECT_TIMEOUT,
1377
-			STREAM_CLIENT_CONNECT,
1378
-			$streamContext
1379
-		);
1380
-		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1381
-		if (!$f) {
1382
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1383
-			return $errno;
1384
-		}
1385
-		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
1386
-
1387
-		fputs($f, $connect);
1388
-		fputs($f, "\r\n");
1389
-		$res = fread($f, 1024);
1390
-		if (
1391
-			!$res
1392
-			or !count($res = explode(' ', $res))
1393
-			or $res[1] !== '200'
1394
-		) {
1395
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1396
-			fclose($f);
1397
-
1398
-			return false;
1399
-		}
1400
-		// important, car sinon on lit trop vite et les donnees ne sont pas encore dispo
1401
-		stream_set_blocking($f, true);
1402
-		// envoyer le handshake
1403
-		stream_socket_enable_crypto($f, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
1404
-		spip_log("OK CONNECT sur $first_host:$port", 'connect');
1405
-	} else {
1406
-		$ntry = 3;
1407
-		do {
1408
-			$f = @fsockopen($first_host, $port, $errno, $errstr, _INC_DISTANT_CONNECT_TIMEOUT);
1409
-		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1410
-		spip_log("Recuperer $path sur $first_host:$port par $f");
1411
-		if (!$f) {
1412
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1413
-
1414
-			return $errno;
1415
-		}
1416
-		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
1417
-	}
1418
-
1419
-	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1420
-
1421
-	$host_port = $host;
1422
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1423
-		$host_port .= ":$port";
1424
-	}
1425
-	$req = "$method $path $vers\r\n"
1426
-		. "Host: $host_port\r\n"
1427
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1428
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1429
-		. (!$site ? '' : "Referer: $site/$referer\r\n")
1430
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1431
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1432
-		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1433
-		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1335
+    $proxy_user = '';
1336
+    $http_proxy = need_proxy($host);
1337
+    if ($user) {
1338
+        $user = urlencode($user[0]) . ':' . urlencode($user[1]);
1339
+    }
1340
+
1341
+    $connect = '';
1342
+    if ($http_proxy) {
1343
+        if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1344
+            $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1345
+            $connect = 'CONNECT ' . $path_host . " $vers\r\n"
1346
+                . "Host: $path_host\r\n"
1347
+                . "Proxy-Connection: Keep-Alive\r\n";
1348
+        } else {
1349
+            $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1350
+                . (!$user ? '' : "$user@")
1351
+                . "$host" . (($port != 80) ? ":$port" : '') . $path;
1352
+        }
1353
+        $t2 = @parse_url($http_proxy);
1354
+        $first_host = $t2['host'];
1355
+        $port = ($t2['port'] ?? null) ?: 80;
1356
+        if ($t2['user'] ?? null) {
1357
+            $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1358
+        }
1359
+    } else {
1360
+        $first_host = $noproxy . $host;
1361
+    }
1362
+
1363
+    if ($connect) {
1364
+        $streamContext = stream_context_create([
1365
+            'ssl' => [
1366
+                'verify_peer' => false,
1367
+                'allow_self_signed' => true,
1368
+                'SNI_enabled' => true,
1369
+                'peer_name' => $host,
1370
+            ]
1371
+        ]);
1372
+        $f = @stream_socket_client(
1373
+            "tcp://$first_host:$port",
1374
+            $errno,
1375
+            $errstr,
1376
+            _INC_DISTANT_CONNECT_TIMEOUT,
1377
+            STREAM_CLIENT_CONNECT,
1378
+            $streamContext
1379
+        );
1380
+        spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1381
+        if (!$f) {
1382
+            spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1383
+            return $errno;
1384
+        }
1385
+        stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
1386
+
1387
+        fputs($f, $connect);
1388
+        fputs($f, "\r\n");
1389
+        $res = fread($f, 1024);
1390
+        if (
1391
+            !$res
1392
+            or !count($res = explode(' ', $res))
1393
+            or $res[1] !== '200'
1394
+        ) {
1395
+            spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1396
+            fclose($f);
1397
+
1398
+            return false;
1399
+        }
1400
+        // important, car sinon on lit trop vite et les donnees ne sont pas encore dispo
1401
+        stream_set_blocking($f, true);
1402
+        // envoyer le handshake
1403
+        stream_socket_enable_crypto($f, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
1404
+        spip_log("OK CONNECT sur $first_host:$port", 'connect');
1405
+    } else {
1406
+        $ntry = 3;
1407
+        do {
1408
+            $f = @fsockopen($first_host, $port, $errno, $errstr, _INC_DISTANT_CONNECT_TIMEOUT);
1409
+        } while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1410
+        spip_log("Recuperer $path sur $first_host:$port par $f");
1411
+        if (!$f) {
1412
+            spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1413
+
1414
+            return $errno;
1415
+        }
1416
+        stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
1417
+    }
1418
+
1419
+    $site = $GLOBALS['meta']['adresse_site'] ?? '';
1420
+
1421
+    $host_port = $host;
1422
+    if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1423
+        $host_port .= ":$port";
1424
+    }
1425
+    $req = "$method $path $vers\r\n"
1426
+        . "Host: $host_port\r\n"
1427
+        . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1428
+        . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1429
+        . (!$site ? '' : "Referer: $site/$referer\r\n")
1430
+        . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1431
+        . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1432
+        . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1433
+        . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1434 1434
 
1435 1435
 #	spip_log("Requete\n$req", 'distant');
1436
-	fputs($f, $req);
1437
-	fputs($f, $datas ?: "\r\n");
1436
+    fputs($f, $req);
1437
+    fputs($f, $datas ?: "\r\n");
1438 1438
 
1439
-	return $f;
1439
+    return $f;
1440 1440
 }
Please login to merge, or discard this patch.
ecrire/lang/ecrire_pt_br.php 1 patch
Indentation   +839 added lines, -839 removed lines patch added patch discarded remove patch
@@ -4,879 +4,879 @@
 block discarded – undo
4 4
 // ** ne pas modifier le fichier **
5 5
 
6 6
 if (!defined('_ECRIRE_INC_VERSION')) {
7
-	return;
7
+    return;
8 8
 }
9 9
 
10 10
 $GLOBALS[$GLOBALS['idx_lang']] = array(
11 11
 
12
-	// A
13
-	'activer_plugin' => 'Ativar o plugin',
14
-	'affichage' => 'Exibição',
15
-	'aide_non_disponible' => 'Esta parte da ajuda online ainda não está disponível neste idioma.',
16
-	'annuler_recherche' => 'Cancelar a busca',
17
-	'auteur' => 'Autor:',
18
-	'avis_acces_interdit' => 'Acesso negado.',
19
-	'avis_acces_interdit_prive' => 'Você não está autorizado a acessar a página <b>@exec@</b>.',
20
-	'avis_article_modifie' => 'Atenção, @nom_auteur_modif@ editou esta matéria há @date_diff@ minutos',
21
-	'avis_aucun_resultat' => 'Nenhum resultado.',
22
-	'avis_base_inaccessible' => 'Não foi possível conectar com a base de dados @base@.',
23
-	'avis_chemin_invalide_1' => 'O caminho que você escolheu',
24
-	'avis_chemin_invalide_2' => 'não parece válido. Por favor, volte à página anterior e verifique as informações fornecidas.',
25
-	'avis_connexion_echec_1' => 'A conexão com a base de dados falhou.',
26
-	'avis_connexion_echec_2' => 'Volte à página anterior e verifique as informações que você forneceu.',
27
-	'avis_connexion_echec_3' => '<b>N.B.</b> Em diversos servidores, você precisa <b>solicitar</b> a ativação do seu acesso à base de dados antes de poder utilizá-la. Se você não consegue se conectar, verifique se você efetuou esse pedido.',
28
-	'avis_connexion_erreur_creer_base' => 'Não foi possível criar a base de dados.',
29
-	'avis_connexion_erreur_fichier_cle_manquant_1' => 'A instalação deve ser realizada por um webmaster com um backup das chaves e sua senha.',
30
-	'avis_connexion_erreur_fichier_cle_manquant_2' => 'A instalação deve ser feita por um webmaster com um backup das chaves',
31
-	'avis_connexion_erreur_nom_base' => 'O nome da base só pode conter letras, números e traços',
32
-	'avis_connexion_ldap_echec_1' => 'A conexão ao servidor LDAP falhou.',
33
-	'avis_connexion_ldap_echec_2' => 'Volte à página anterior e verifique as informações que você forneceu.',
34
-	'avis_connexion_ldap_echec_3' => 'Opcionalmente, não use o suporte LDAP para importar os usuários.',
35
-	'avis_deplacement_rubrique' => 'Atenção! Esta seção contém @contient_breves@ nota@scb@: se você a transferir, por favor, marque este quadrado.',
36
-	'avis_erreur_connexion_mysql' => 'Erro de conexão SQL',
37
-	'avis_erreur_creation_compte' => 'Erro durante a inicialização da conta',
38
-	'avis_espace_interdit' => '<b>Área interdita</b> <div>O SPIP já está instalado.</div>',
39
-	'avis_lecture_noms_bases_1' => 'O programa de instalação não pôde ler os nomes das bases de dados instaladas.',
40
-	'avis_lecture_noms_bases_2' => 'Ou nenhuma base de dados esta disponível, ou a função que permite listar as bases foi desativada por razões de segurança (o que é o caso de diversos provedores de hospedagem).',
41
-	'avis_lecture_noms_bases_3' => 'No segundo caso, é provável que uma base de dados com o nome do seu login possa ser utilizada:',
42
-	'avis_non_acces_page' => 'Você não tem acesso a esta página.',
43
-	'avis_operation_echec' => 'A operação falhou.',
44
-	'avis_operation_impossible' => 'Operação impossível',
45
-	'avis_suppression_base' => 'ATENÇÃO, a supressão dos dados é irreversível',
12
+    // A
13
+    'activer_plugin' => 'Ativar o plugin',
14
+    'affichage' => 'Exibição',
15
+    'aide_non_disponible' => 'Esta parte da ajuda online ainda não está disponível neste idioma.',
16
+    'annuler_recherche' => 'Cancelar a busca',
17
+    'auteur' => 'Autor:',
18
+    'avis_acces_interdit' => 'Acesso negado.',
19
+    'avis_acces_interdit_prive' => 'Você não está autorizado a acessar a página <b>@exec@</b>.',
20
+    'avis_article_modifie' => 'Atenção, @nom_auteur_modif@ editou esta matéria há @date_diff@ minutos',
21
+    'avis_aucun_resultat' => 'Nenhum resultado.',
22
+    'avis_base_inaccessible' => 'Não foi possível conectar com a base de dados @base@.',
23
+    'avis_chemin_invalide_1' => 'O caminho que você escolheu',
24
+    'avis_chemin_invalide_2' => 'não parece válido. Por favor, volte à página anterior e verifique as informações fornecidas.',
25
+    'avis_connexion_echec_1' => 'A conexão com a base de dados falhou.',
26
+    'avis_connexion_echec_2' => 'Volte à página anterior e verifique as informações que você forneceu.',
27
+    'avis_connexion_echec_3' => '<b>N.B.</b> Em diversos servidores, você precisa <b>solicitar</b> a ativação do seu acesso à base de dados antes de poder utilizá-la. Se você não consegue se conectar, verifique se você efetuou esse pedido.',
28
+    'avis_connexion_erreur_creer_base' => 'Não foi possível criar a base de dados.',
29
+    'avis_connexion_erreur_fichier_cle_manquant_1' => 'A instalação deve ser realizada por um webmaster com um backup das chaves e sua senha.',
30
+    'avis_connexion_erreur_fichier_cle_manquant_2' => 'A instalação deve ser feita por um webmaster com um backup das chaves',
31
+    'avis_connexion_erreur_nom_base' => 'O nome da base só pode conter letras, números e traços',
32
+    'avis_connexion_ldap_echec_1' => 'A conexão ao servidor LDAP falhou.',
33
+    'avis_connexion_ldap_echec_2' => 'Volte à página anterior e verifique as informações que você forneceu.',
34
+    'avis_connexion_ldap_echec_3' => 'Opcionalmente, não use o suporte LDAP para importar os usuários.',
35
+    'avis_deplacement_rubrique' => 'Atenção! Esta seção contém @contient_breves@ nota@scb@: se você a transferir, por favor, marque este quadrado.',
36
+    'avis_erreur_connexion_mysql' => 'Erro de conexão SQL',
37
+    'avis_erreur_creation_compte' => 'Erro durante a inicialização da conta',
38
+    'avis_espace_interdit' => '<b>Área interdita</b> <div>O SPIP já está instalado.</div>',
39
+    'avis_lecture_noms_bases_1' => 'O programa de instalação não pôde ler os nomes das bases de dados instaladas.',
40
+    'avis_lecture_noms_bases_2' => 'Ou nenhuma base de dados esta disponível, ou a função que permite listar as bases foi desativada por razões de segurança (o que é o caso de diversos provedores de hospedagem).',
41
+    'avis_lecture_noms_bases_3' => 'No segundo caso, é provável que uma base de dados com o nome do seu login possa ser utilizada:',
42
+    'avis_non_acces_page' => 'Você não tem acesso a esta página.',
43
+    'avis_operation_echec' => 'A operação falhou.',
44
+    'avis_operation_impossible' => 'Operação impossível',
45
+    'avis_suppression_base' => 'ATENÇÃO, a supressão dos dados é irreversível',
46 46
 
47
-	// B
48
-	'bouton_acces_ldap' => 'Incluir o acesso ao LDAP',
49
-	'bouton_ajouter' => 'Incluir',
50
-	'bouton_annuler' => 'Anular',
51
-	'bouton_cache_activer' => 'Reativar o cache',
52
-	'bouton_cache_desactiver' => 'Desativar temporariamente o cache',
53
-	'bouton_demande_publication' => 'Solicitar a publicação desta matéria',
54
-	'bouton_desactive_tout' => 'Desativar tudo',
55
-	'bouton_desinstaller' => 'Desinstalar',
56
-	'bouton_effacer_tout' => 'Apagar TUDO',
57
-	'bouton_envoyer_message' => 'Mensagem definitiva: enviar',
58
-	'bouton_fermer' => 'Fechar',
59
-	'bouton_mettre_a_jour_base' => 'Atualizar a base de dados',
60
-	'bouton_modifier' => 'Alterar',
61
-	'bouton_radio_afficher' => 'Exibir',
62
-	'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Exibir nas listas de redatores conectados',
63
-	'bouton_radio_envoi_annonces_adresse' => 'Enviar os avisos para o endereço:',
64
-	'bouton_radio_envoi_liste_nouveautes' => 'Enviar a lista de novidades',
65
-	'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Não exibir na lista de redatores',
66
-	'bouton_radio_non_envoi_annonces_editoriales' => 'Não enviar os avisos editoriais',
67
-	'bouton_redirection' => 'REDIRECIONAMENTO',
68
-	'bouton_reinitialiser_aux_valeurs_par_defaut' => 'Reiniciar aos valores padrão',
69
-	'bouton_relancer_inscription' => 'Reiniciar o registro',
70
-	'bouton_relancer_inscriptions' => 'Reiniciar os registros',
71
-	'bouton_relancer_installation' => 'Reiniciar a instalação',
72
-	'bouton_reset_password' => 'Criar uma nova senha e enviá-la por e-mail',
73
-	'bouton_suivant' => 'Avançar',
74
-	'bouton_tenter_recuperation' => 'Tentar uma reparação',
75
-	'bouton_test_proxy' => 'Testar o proxy',
76
-	'bouton_vider_cache' => 'Limpar o cache',
47
+    // B
48
+    'bouton_acces_ldap' => 'Incluir o acesso ao LDAP',
49
+    'bouton_ajouter' => 'Incluir',
50
+    'bouton_annuler' => 'Anular',
51
+    'bouton_cache_activer' => 'Reativar o cache',
52
+    'bouton_cache_desactiver' => 'Desativar temporariamente o cache',
53
+    'bouton_demande_publication' => 'Solicitar a publicação desta matéria',
54
+    'bouton_desactive_tout' => 'Desativar tudo',
55
+    'bouton_desinstaller' => 'Desinstalar',
56
+    'bouton_effacer_tout' => 'Apagar TUDO',
57
+    'bouton_envoyer_message' => 'Mensagem definitiva: enviar',
58
+    'bouton_fermer' => 'Fechar',
59
+    'bouton_mettre_a_jour_base' => 'Atualizar a base de dados',
60
+    'bouton_modifier' => 'Alterar',
61
+    'bouton_radio_afficher' => 'Exibir',
62
+    'bouton_radio_apparaitre_liste_redacteurs_connectes' => 'Exibir nas listas de redatores conectados',
63
+    'bouton_radio_envoi_annonces_adresse' => 'Enviar os avisos para o endereço:',
64
+    'bouton_radio_envoi_liste_nouveautes' => 'Enviar a lista de novidades',
65
+    'bouton_radio_non_apparaitre_liste_redacteurs_connectes' => 'Não exibir na lista de redatores',
66
+    'bouton_radio_non_envoi_annonces_editoriales' => 'Não enviar os avisos editoriais',
67
+    'bouton_redirection' => 'REDIRECIONAMENTO',
68
+    'bouton_reinitialiser_aux_valeurs_par_defaut' => 'Reiniciar aos valores padrão',
69
+    'bouton_relancer_inscription' => 'Reiniciar o registro',
70
+    'bouton_relancer_inscriptions' => 'Reiniciar os registros',
71
+    'bouton_relancer_installation' => 'Reiniciar a instalação',
72
+    'bouton_reset_password' => 'Criar uma nova senha e enviá-la por e-mail',
73
+    'bouton_suivant' => 'Avançar',
74
+    'bouton_tenter_recuperation' => 'Tentar uma reparação',
75
+    'bouton_test_proxy' => 'Testar o proxy',
76
+    'bouton_vider_cache' => 'Limpar o cache',
77 77
 
78
-	// C
79
-	'cache_modifiable_webmestre' => 'Este parâmetro é modificável pelo webmaster do site.',
80
-	'calendrier_synchro' => 'Se você usa um programa de agenda compatível com <b>iCal</b>, você pode sincronizá-lo com as informações deste site.',
81
-	'config_activer_champs' => 'Ativar os campos a seguir',
82
-	'config_choix_base_sup' => 'indicar uma base neste servidor',
83
-	'config_erreur_base_sup' => 'O SPIP não tem acesso à lista de bases acessíveis',
84
-	'config_info_base_sup' => 'Se você tiver outras bases de dados para serem consultadas via SPIP, em seu servidor SQL ou em outro, o formulário abaixo permite configurá-las. Se você deixar determinados campos em branco, os dados de conexão da base principal serão utilizados.',
85
-	'config_info_base_sup_disponibles' => 'Bases suplementares já consultáveis:',
86
-	'config_info_enregistree' => 'A nova configuração foi gravada',
87
-	'config_info_logos' => 'Cada elemento do site pode ter um ícone, bem como um ícone de «mouseOver»',
88
-	'config_info_logos_utiliser' => 'Usar os ícones',
89
-	'config_info_logos_utiliser_non' => 'Não usar o ícones',
90
-	'config_info_logos_utiliser_survol' => 'Usar os ícones de mouseOver',
91
-	'config_info_logos_utiliser_survol_non' => 'Não usar os ícones de mouseOver',
92
-	'config_info_redirection' => 'Ao ativar esta opção, você poderá criar matérias virtuais, meras referências a matérias publicadas em outros sites ou fora do SPIP.',
93
-	'config_redirection' => 'Matérias virtuais',
94
-	'config_titre_base_sup' => 'Configuração de uma base suplementar',
95
-	'config_titre_base_sup_choix' => 'Escolha uma base suplementar',
96
-	'connexion_ldap' => 'Conexão:',
97
-	'creer_et_associer_un_auteur' => 'Criar e vincular um autor',
78
+    // C
79
+    'cache_modifiable_webmestre' => 'Este parâmetro é modificável pelo webmaster do site.',
80
+    'calendrier_synchro' => 'Se você usa um programa de agenda compatível com <b>iCal</b>, você pode sincronizá-lo com as informações deste site.',
81
+    'config_activer_champs' => 'Ativar os campos a seguir',
82
+    'config_choix_base_sup' => 'indicar uma base neste servidor',
83
+    'config_erreur_base_sup' => 'O SPIP não tem acesso à lista de bases acessíveis',
84
+    'config_info_base_sup' => 'Se você tiver outras bases de dados para serem consultadas via SPIP, em seu servidor SQL ou em outro, o formulário abaixo permite configurá-las. Se você deixar determinados campos em branco, os dados de conexão da base principal serão utilizados.',
85
+    'config_info_base_sup_disponibles' => 'Bases suplementares já consultáveis:',
86
+    'config_info_enregistree' => 'A nova configuração foi gravada',
87
+    'config_info_logos' => 'Cada elemento do site pode ter um ícone, bem como um ícone de «mouseOver»',
88
+    'config_info_logos_utiliser' => 'Usar os ícones',
89
+    'config_info_logos_utiliser_non' => 'Não usar o ícones',
90
+    'config_info_logos_utiliser_survol' => 'Usar os ícones de mouseOver',
91
+    'config_info_logos_utiliser_survol_non' => 'Não usar os ícones de mouseOver',
92
+    'config_info_redirection' => 'Ao ativar esta opção, você poderá criar matérias virtuais, meras referências a matérias publicadas em outros sites ou fora do SPIP.',
93
+    'config_redirection' => 'Matérias virtuais',
94
+    'config_titre_base_sup' => 'Configuração de uma base suplementar',
95
+    'config_titre_base_sup_choix' => 'Escolha uma base suplementar',
96
+    'connexion_ldap' => 'Conexão:',
97
+    'creer_et_associer_un_auteur' => 'Criar e vincular um autor',
98 98
 
99
-	// D
100
-	'date_mot_heures' => 'horas',
99
+    // D
100
+    'date_mot_heures' => 'horas',
101 101
 
102
-	// E
103
-	'ecran_connexion_couleur_principale' => 'Cor principal',
104
-	'ecran_connexion_image_fond' => 'Imagem de fundo',
105
-	'ecran_connexion_image_fond_explication' => 'Usar uma imagem (formato JPEG, 1920x1080 pixels)',
106
-	'ecran_connexion_image_revenir_couleur_defaut' => 'Reverter para a cor padrão',
107
-	'ecran_connexion_titre' => 'Tela de conexão',
108
-	'ecran_securite' => ' + tela de segurança @version@',
109
-	'email' => 'e-mail',
110
-	'email_2' => 'e-mail:',
111
-	'en_savoir_plus' => 'Saiba mais',
112
-	'entree_adresse_annuaire' => 'Endereço do catálogo',
113
-	'entree_adresse_email' => 'Seu endereço de e-mail',
114
-	'entree_adresse_email_2' => 'Endereço de e-mail',
115
-	'entree_base_donnee_1' => 'Endereço da base de dados',
116
-	'entree_base_donnee_2' => '(Frequentemente este endereço corresponde ao do seu site, às vezes ele corresponde ao nome «localhost», algumas vezes ele pode ser deixado completamente em branco.)',
117
-	'entree_biographie' => 'Biografia curta em poucas palavras.',
118
-	'entree_chemin_acces' => '<b>Informe</b> o caminho de acesso:',
119
-	'entree_cle_pgp' => 'Sua chave PGP',
120
-	'entree_cle_pgp_2' => 'Chave PGP',
121
-	'entree_contenu_rubrique' => '(Conteúdo da seção em poucas palavras.)',
122
-	'entree_identifiants_connexion' => 'Seus dados de conexão...',
123
-	'entree_identifiants_connexion_2' => 'Dados de conexão',
124
-	'entree_informations_connexion_ldap' => 'Informe neste formulário os dados de conexão ao seu catálogo LDAP.
102
+    // E
103
+    'ecran_connexion_couleur_principale' => 'Cor principal',
104
+    'ecran_connexion_image_fond' => 'Imagem de fundo',
105
+    'ecran_connexion_image_fond_explication' => 'Usar uma imagem (formato JPEG, 1920x1080 pixels)',
106
+    'ecran_connexion_image_revenir_couleur_defaut' => 'Reverter para a cor padrão',
107
+    'ecran_connexion_titre' => 'Tela de conexão',
108
+    'ecran_securite' => ' + tela de segurança @version@',
109
+    'email' => 'e-mail',
110
+    'email_2' => 'e-mail:',
111
+    'en_savoir_plus' => 'Saiba mais',
112
+    'entree_adresse_annuaire' => 'Endereço do catálogo',
113
+    'entree_adresse_email' => 'Seu endereço de e-mail',
114
+    'entree_adresse_email_2' => 'Endereço de e-mail',
115
+    'entree_base_donnee_1' => 'Endereço da base de dados',
116
+    'entree_base_donnee_2' => '(Frequentemente este endereço corresponde ao do seu site, às vezes ele corresponde ao nome «localhost», algumas vezes ele pode ser deixado completamente em branco.)',
117
+    'entree_biographie' => 'Biografia curta em poucas palavras.',
118
+    'entree_chemin_acces' => '<b>Informe</b> o caminho de acesso:',
119
+    'entree_cle_pgp' => 'Sua chave PGP',
120
+    'entree_cle_pgp_2' => 'Chave PGP',
121
+    'entree_contenu_rubrique' => '(Conteúdo da seção em poucas palavras.)',
122
+    'entree_identifiants_connexion' => 'Seus dados de conexão...',
123
+    'entree_identifiants_connexion_2' => 'Dados de conexão',
124
+    'entree_informations_connexion_ldap' => 'Informe neste formulário os dados de conexão ao seu catálogo LDAP.
125 125
 Estas informações deverão ser fornecidas pelo administrador do sistema ou da rede.',
126
-	'entree_infos_perso' => 'Quem é você?',
127
-	'entree_infos_perso_2' => 'Quem é o autor?',
128
-	'entree_interieur_rubrique' => 'No interior da seção:',
129
-	'entree_liens_sites' => '<b>Link hipertexto</b> (referência, site a visitar...)',
130
-	'entree_login' => 'Seu login',
131
-	'entree_login_connexion_1' => 'O login de conexão',
132
-	'entree_login_connexion_2' => '(Frequentemente corresponde ao seu login para acesso por FTP; às vezes pode ser deixado em branco)',
133
-	'entree_mot_passe' => 'Sua senha',
134
-	'entree_mot_passe_1' => 'A senha de conexão',
135
-	'entree_mot_passe_2' => '(Frequentemente corresponde à sua senha para acesso por FTP; às vezes pode ser deixado em branco)',
136
-	'entree_nom_fichier' => 'Por favor, informe o nome do arquivo @texte_compresse@:',
137
-	'entree_nom_pseudo' => 'Seu nome ou apelido',
138
-	'entree_nom_pseudo_1' => '(Seu nome ou apelido)',
139
-	'entree_nom_pseudo_2' => 'Nome ou apelido',
140
-	'entree_nom_site' => 'O nome do seu site',
141
-	'entree_nom_site_2' => 'Nome do site do autor',
142
-	'entree_nouveau_passe' => 'Nova senha',
143
-	'entree_passe_ldap' => 'Senha',
144
-	'entree_port_annuaire' => 'O número da porta do catálogo',
145
-	'entree_signature' => 'Assinatura',
146
-	'entree_titre_obligatoire' => '<b>Título</b> [Obrigatório]<br />',
147
-	'entree_url' => 'O endereço (URL) do seu site',
148
-	'entree_url_2' => 'Endereço (URL) do site',
149
-	'erreur_connect_deja_existant' => 'Já existe um servidor com esse nome',
150
-	'erreur_contenu_suspect' => 'Texto escapado',
151
-	'erreur_email_deja_existant' => 'Esse endereço de email já está em uso.',
152
-	'erreur_nom_connect_incorrect' => 'Este nome de servidor não é autorizado',
153
-	'erreur_plugin_attribut_balise_manquant' => 'Atributo @attribut@ faltando no tag @balise@.',
154
-	'erreur_plugin_desinstalation_echouee' => 'A desinstalação do plugin falhou. No entanto, você pode desativá-lo.',
155
-	'erreur_plugin_fichier_absent' => 'Arquivo ausente',
156
-	'erreur_plugin_fichier_def_absent' => 'Arquivo de definição ausente',
157
-	'erreur_plugin_nom_fonction_interdit' => 'Nome de função não permitido',
158
-	'erreur_plugin_nom_manquant' => 'Nome do plugin ausente',
159
-	'erreur_plugin_prefix_manquant' => 'Área de nomeação do plugin não definida',
160
-	'erreur_plugin_tag_plugin_absent' => '&lt;plugin&gt; ausente no arquivo de definição',
161
-	'erreur_plugin_version_manquant' => 'Versão do plugin ausente',
162
-	'erreur_type_fichier' => 'Tipo de arquivo incorreto',
126
+    'entree_infos_perso' => 'Quem é você?',
127
+    'entree_infos_perso_2' => 'Quem é o autor?',
128
+    'entree_interieur_rubrique' => 'No interior da seção:',
129
+    'entree_liens_sites' => '<b>Link hipertexto</b> (referência, site a visitar...)',
130
+    'entree_login' => 'Seu login',
131
+    'entree_login_connexion_1' => 'O login de conexão',
132
+    'entree_login_connexion_2' => '(Frequentemente corresponde ao seu login para acesso por FTP; às vezes pode ser deixado em branco)',
133
+    'entree_mot_passe' => 'Sua senha',
134
+    'entree_mot_passe_1' => 'A senha de conexão',
135
+    'entree_mot_passe_2' => '(Frequentemente corresponde à sua senha para acesso por FTP; às vezes pode ser deixado em branco)',
136
+    'entree_nom_fichier' => 'Por favor, informe o nome do arquivo @texte_compresse@:',
137
+    'entree_nom_pseudo' => 'Seu nome ou apelido',
138
+    'entree_nom_pseudo_1' => '(Seu nome ou apelido)',
139
+    'entree_nom_pseudo_2' => 'Nome ou apelido',
140
+    'entree_nom_site' => 'O nome do seu site',
141
+    'entree_nom_site_2' => 'Nome do site do autor',
142
+    'entree_nouveau_passe' => 'Nova senha',
143
+    'entree_passe_ldap' => 'Senha',
144
+    'entree_port_annuaire' => 'O número da porta do catálogo',
145
+    'entree_signature' => 'Assinatura',
146
+    'entree_titre_obligatoire' => '<b>Título</b> [Obrigatório]<br />',
147
+    'entree_url' => 'O endereço (URL) do seu site',
148
+    'entree_url_2' => 'Endereço (URL) do site',
149
+    'erreur_connect_deja_existant' => 'Já existe um servidor com esse nome',
150
+    'erreur_contenu_suspect' => 'Texto escapado',
151
+    'erreur_email_deja_existant' => 'Esse endereço de email já está em uso.',
152
+    'erreur_nom_connect_incorrect' => 'Este nome de servidor não é autorizado',
153
+    'erreur_plugin_attribut_balise_manquant' => 'Atributo @attribut@ faltando no tag @balise@.',
154
+    'erreur_plugin_desinstalation_echouee' => 'A desinstalação do plugin falhou. No entanto, você pode desativá-lo.',
155
+    'erreur_plugin_fichier_absent' => 'Arquivo ausente',
156
+    'erreur_plugin_fichier_def_absent' => 'Arquivo de definição ausente',
157
+    'erreur_plugin_nom_fonction_interdit' => 'Nome de função não permitido',
158
+    'erreur_plugin_nom_manquant' => 'Nome do plugin ausente',
159
+    'erreur_plugin_prefix_manquant' => 'Área de nomeação do plugin não definida',
160
+    'erreur_plugin_tag_plugin_absent' => '&lt;plugin&gt; ausente no arquivo de definição',
161
+    'erreur_plugin_version_manquant' => 'Versão do plugin ausente',
162
+    'erreur_type_fichier' => 'Tipo de arquivo incorreto',
163 163
 
164
-	// H
165
-	'htaccess_a_simuler' => 'Aviso: a configuração do seu servidor HTTP não leva em conta os arquivos @htaccess@. Para poder garantir um bom nível de segurança, é preciso que você altere esta configuração, ou que as constantes @constantes@ (definíveis no arquivo mes_options.php) tenham como valor os diretórios abaixo de @document_root@.',
166
-	'htaccess_inoperant' => 'htaccess inoperante',
164
+    // H
165
+    'htaccess_a_simuler' => 'Aviso: a configuração do seu servidor HTTP não leva em conta os arquivos @htaccess@. Para poder garantir um bom nível de segurança, é preciso que você altere esta configuração, ou que as constantes @constantes@ (definíveis no arquivo mes_options.php) tenham como valor os diretórios abaixo de @document_root@.',
166
+    'htaccess_inoperant' => 'htaccess inoperante',
167 167
 
168
-	// I
169
-	'ical_info1' => 'Esta página apresenta diversos métodos para se manter a par da atividade deste site.',
170
-	'ical_info2' => 'Para mais informações sobre todas estas técnicas, não deixe de consultar <a href="@spipnet@">a documentação do SPIP</a>.',
171
-	'ical_info_calendrier' => 'Dois calendários estão à sua disposição. O primeiro é um mapa do site anunciando todas as matérias publicadas. O segundo contém os avisos editoriais bem como suas últimas mensagens privadas: ele lhe é reservado graças a uma chave pessoal, que você pode alterar a qualquer momento ao renovar a sua senha.',
172
-	'ical_methode_http' => 'Transferência',
173
-	'ical_methode_webcal' => 'Sincronização (webcal://)',
174
-	'ical_texte_prive' => 'Este calendário, de uso estritamente pessoal, o informa sobre a atividade editorial privada deste site (tarefas e encontros pessoais, matérias e notas propostas...).',
175
-	'ical_texte_public' => 'Este calendário permite-lhe acompanhar a atividade pública deste site (matérias e notas publicadas).',
176
-	'ical_texte_rss' => 'Você pode sindicar as novidades deste site em qualquer leitor de arquivos em formato XML/RSS (Rich Site Summary). É também o formato que permite ao SPIP ler as novidades publicadas em outros sites que utilizem um formato de troca de informações compatível (sites sindicados).',
177
-	'ical_titre_js' => 'Javascript',
178
-	'ical_titre_mailing' => 'Mailing-list',
179
-	'ical_titre_rss' => 'Arquivos de sindicação',
180
-	'icone_accueil' => 'Página Inicial',
181
-	'icone_activer_cookie' => 'Ativar o coockie de correspondência',
182
-	'icone_activite' => 'Atividade',
183
-	'icone_admin_plugin' => 'Gerenciamento dos plugins',
184
-	'icone_administration' => 'Manutenção',
185
-	'icone_afficher_auteurs' => 'Exibir os autores',
186
-	'icone_afficher_visiteurs' => 'Exibir os visitantes',
187
-	'icone_arret_discussion' => 'Não participar mais desta discussão',
188
-	'icone_calendrier' => 'Calendário',
189
-	'icone_configuration' => 'Configuração',
190
-	'icone_creer_auteur' => 'Criar um novo autor e vinculá-lo a esta matéria',
191
-	'icone_creer_mot_cle' => 'Criar uma nova palavra-chave e vinculá-la a esta matéria',
192
-	'icone_creer_rubrique_2' => 'Criar uma nova seção',
193
-	'icone_developpement' => 'Desenvolvimento',
194
-	'icone_edition' => 'Edição',
195
-	'icone_ma_langue' => 'Meu idioma',
196
-	'icone_mes_infos' => 'Minhas informações',
197
-	'icone_mes_preferences' => 'Minhas preferências',
198
-	'icone_modifier_article' => 'Editar esta matéria',
199
-	'icone_modifier_rubrique' => 'Editar esta seção',
200
-	'icone_publication' => 'Publicação',
201
-	'icone_relancer_signataire' => 'Reconfirmar o assinante',
202
-	'icone_retour' => 'Voltar',
203
-	'icone_retour_article' => 'Voltar para a matéria',
204
-	'icone_squelette' => 'Templates',
205
-	'icone_suivi_publication' => 'Acompanhamento da publicação',
206
-	'icone_supprimer_cookie' => 'Excluir o cookie de correspondência',
207
-	'icone_supprimer_rubrique' => 'Excluir esta seção',
208
-	'icone_supprimer_signature' => 'Excluir esta assinatura',
209
-	'icone_valider_signature' => 'Validar esta assinatura',
210
-	'image_administrer_rubrique' => 'Você pode administrar esta seção',
211
-	'impossible_modifier_login_auteur' => 'Não foi possível alterar o login.',
212
-	'impossible_modifier_pass_auteur' => 'Não foi possível alterar a senha.',
213
-	'info_1_article' => '1 matéria',
214
-	'info_1_auteur' => '1 autor',
215
-	'info_1_message' => '1 mensagem',
216
-	'info_1_mot_cle' => '1 palavra-chave',
217
-	'info_1_rubrique' => '1 seção',
218
-	'info_1_visiteur' => '1 visitante',
219
-	'info_activer_cookie' => 'Você pode ativar um <b>cookie de correspondência</b>, que lhe permitirá passar facilmente do site público para o site privado.',
220
-	'info_activer_menu_developpement' => 'Exibir o menu Desenvolvimento',
221
-	'info_admin_etre_webmestre' => 'Me conceder direitos de webmaster',
222
-	'info_admin_je_suis_webmestre' => 'Eu sou <b>webmaster</b>',
223
-	'info_admin_statuer_webmestre' => 'Dar a este administrador os direitos de webmaster',
224
-	'info_admin_webmestre' => 'Este administrador é <b>webmaster</b>',
225
-	'info_administrateur' => 'Administrador',
226
-	'info_administrateur_1' => 'Administrador',
227
-	'info_administrateur_2' => 'do site (<i>use com cuidado</i>)',
228
-	'info_administrateur_site_01' => 'Se você é administrador do site, por favor,',
229
-	'info_administrateur_site_02' => 'clique neste link',
230
-	'info_administrateurs' => 'Administradores',
231
-	'info_administrer_rubrique' => 'Você pode administrar esta seção',
232
-	'info_adresse' => 'no endereço:',
233
-	'info_adresse_desinscription' => 'Endereço da desinscrição:',
234
-	'info_adresse_url' => 'Endereço (URL) do site público',
235
-	'info_afficher_par_nb' => 'Exibir por',
236
-	'info_aide_en_ligne' => 'Ajuda online SPIP',
237
-	'info_ajout_image' => 'Assim que você incluir imagens e documentos anexados a uma matéria, o SPIP pode criar para você, automaticamente, ícones (miniaturas) das imagens inseridas. Isto permite, por exemplo, criar automaticamente uma galeria ou um portfólio.',
238
-	'info_ajouter_rubrique' => 'Incluir outra seção para administrar:',
239
-	'info_annonce_nouveautes' => 'Aviso das novidades',
240
-	'info_article' => 'matéria',
241
-	'info_article_2' => 'matérias',
242
-	'info_article_a_paraitre' => 'As matérias pós-datadas para exibição',
243
-	'info_articles_02' => 'matérias',
244
-	'info_articles_2' => 'Matérias',
245
-	'info_articles_auteur' => 'As matérias deste autor',
246
-	'info_articles_miens' => 'Minhas matérias',
247
-	'info_articles_tous' => 'Todas as matérias',
248
-	'info_articles_trouves' => 'Matérias encontradas',
249
-	'info_attente_validation' => 'Suas matérias aguardando validação',
250
-	'info_aucun_article' => 'Nenhuma matéria',
251
-	'info_aucun_auteur' => 'Nenhum autor',
252
-	'info_aucun_message' => 'Nenhuma mensagem',
253
-	'info_aucun_rubrique' => 'Nenhuma seção',
254
-	'info_aujourdhui' => 'Hoje:',
255
-	'info_auteur_gere_rubriques' => 'Este autor gerencia as seções a seguir:',
256
-	'info_auteur_gere_toutes_rubriques' => 'Este autor gerencia <b>todas as seções</b>',
257
-	'info_auteur_gere_toutes_rubriques_2' => 'Eu gerencio <b>todas as seções</b>',
258
-	'info_auteurs' => 'Os autores',
259
-	'info_auteurs_par_tri' => 'Autores@partri@',
260
-	'info_auteurs_trouves' => 'Autores encontrados',
261
-	'info_authentification_externe' => 'Autenticação externa',
262
-	'info_avertissement' => 'Aviso',
263
-	'info_barre_outils' => 'com sua barra de ferramentas?',
264
-	'info_base_installee' => 'A estrutura da sua base de dados foi instalada.',
265
-	'info_bio' => 'Biografia',
266
-	'info_cache_desactive' => 'O cache está temporariamente desativado.',
267
-	'info_chapeau' => 'Introdução',
268
-	'info_chapeau_2' => 'Introdução:',
269
-	'info_chemin_acces_1' => 'Opções: <b>Caminho de acesso no diretório</b>',
270
-	'info_chemin_acces_2' => 'A partir daqui, você deverá configurar o caminho de acesso às informações do diretório. Esta informação é indispensávelpara ler os perfis dos usuários no diretório.',
271
-	'info_chemin_acces_annuaire' => 'Opções: <b>Caminho de acesso no diretório</b>',
272
-	'info_choix_base' => 'Terceiro passo:',
273
-	'info_classement_1' => '<sup><u>o</u></sup> em @liste@',
274
-	'info_classement_2' => '<sup><u>a</u></sup> em @liste@',
275
-	'info_code_acces' => 'Não se esqueça dos seus dados de conexão!',
276
-	'info_config_suivi' => 'Se este endereço corresponde a uma mailing-list, você pode informar abaixo o endereço onde os participantes do site podem se inscrever. Este endereço pode ser um URL (por exemplo a página de inscrição na lista pela Web), ou um endereço de e-mail dotado de um assunto específico (par exemple: <tt>@adresse_suivi@?subject=subscribe</tt>):',
277
-	'info_config_suivi_explication' => 'Voce pode assinar a  mailing-list deste site. Você irá receber por e-mail, os avisos de matérias e notas propostos para publicação.',
278
-	'info_confirmer_passe' => 'Confirmar a nova senha:',
279
-	'info_conflit_edition_avis_non_sauvegarde' => 'Atenção os campos a seguir foram alterados por terceiros. As suas modificações nestes campos não foram, por isso, gravadas.',
280
-	'info_conflit_edition_differences' => 'Diferenças:',
281
-	'info_conflit_edition_version_enregistree' => 'A versão gravada:',
282
-	'info_conflit_edition_votre_version' => 'A sua versão:',
283
-	'info_connexion_base' => 'Teste de conexão com a base',
284
-	'info_connexion_base_donnee' => 'Conexão à sua base de dados',
285
-	'info_connexion_ldap_ok' => '<b>A conexão LDAP foi efetuada.</b><p>Você pode passar para o próximo passo.</p>',
286
-	'info_connexion_mysql' => 'Sua conexão SQL',
287
-	'info_connexion_ok' => 'A conexão foi obtida.',
288
-	'info_contact' => 'Contato',
289
-	'info_contenu_articles' => 'Conteúdo das matérias',
290
-	'info_contributions' => 'Contribuições',
291
-	'info_creation_paragraphe' => 'Para criar parágrafos, basta deixar linhas em branco.',
292
-	'info_creation_rubrique' => 'Antes de poder escrever matérias, você deve criar, pelo menos, uma seção.<br />',
293
-	'info_creation_tables' => 'Criação das tabelas da base',
294
-	'info_creer_base' => '<b>Criar</b> uma nova base de dados:',
295
-	'info_dans_rubrique' => 'Na seção:',
296
-	'info_date_publication_anterieure' => 'Data de redação anterior:',
297
-	'info_date_referencement' => 'DATA DE REFERENCIAMENTO DESTE SITE:',
298
-	'info_derniere_etape' => 'Terminou!',
299
-	'info_descriptif' => 'Descrição:',
300
-	'info_desinstaller_plugin' => 'exclui os dados e desativa o plugin',
301
-	'info_discussion_cours' => 'Discussões em andamento',
302
-	'info_ecrire_article' => 'Antes de poder escrever matérias, você precisa criar pelo menos uma seção.',
303
-	'info_email_envoi' => 'Endereço de e-mail de envio (opcional)',
304
-	'info_email_envoi_txt' => 'Informe aqui o endereço a ser utilizado para enviar os e-mails (por padrão, o endereço de destino será usado como endereço de envio):',
305
-	'info_email_webmestre' => 'Endereço de e-mail do webmaster',
306
-	'info_envoi_email_automatique' => 'Envio automático de e-mails',
307
-	'info_envoyer_maintenant' => 'Enviar agora',
308
-	'info_etape_suivante' => 'Avançar para a próxima etapa',
309
-	'info_etape_suivante_1' => 'Você pode passar para a próxima etapa.',
310
-	'info_etape_suivante_2' => 'Você pode passar para a próxima etapa.',
311
-	'info_exceptions_proxy' => 'Exceções para o proxy',
312
-	'info_exportation_base' => 'exportação da base para @archive@',
313
-	'info_facilite_suivi_activite' => 'Para facilitar o acompanhamento da atividade editorial do site, o SPIP pode avisar por e-mail, por exemplo para uma mailing-list de redatores, os avisos dos pedidos de publicação e das validações das matérias. Informe um ou mais endereços, separados por vírgula.',
314
-	'info_fichiers_authent' => 'Arquivos de autenticação «.htpasswd»',
315
-	'info_forums_abo_invites' => 'O seu site comporta fóruns por assinatura; os visitantes são convidados a se registrar no site público.',
316
-	'info_gauche_admin_tech' => '<b>Esta página é acessível apenas aos responsáveis pelo site.</b><p>Ela dá acesso às diferentes funções de manutenção técnica. Algumas dessas funções possuem um processo específico de autenticação que exige acesso FTP ao website.</p>',
317
-	'info_gauche_admin_vider' => '<b>Esta página é acessível apenas aos responsáveis pelo site.</b><p> Ela dá acesso às diferentes funções de manutenção técnica. Algumas dessas funções possuem um processo específico de autenticação que exige acesso FTP ao website.</p>',
318
-	'info_gauche_auteurs' => 'Aqui, você encontra todos os autores do site.
168
+    // I
169
+    'ical_info1' => 'Esta página apresenta diversos métodos para se manter a par da atividade deste site.',
170
+    'ical_info2' => 'Para mais informações sobre todas estas técnicas, não deixe de consultar <a href="@spipnet@">a documentação do SPIP</a>.',
171
+    'ical_info_calendrier' => 'Dois calendários estão à sua disposição. O primeiro é um mapa do site anunciando todas as matérias publicadas. O segundo contém os avisos editoriais bem como suas últimas mensagens privadas: ele lhe é reservado graças a uma chave pessoal, que você pode alterar a qualquer momento ao renovar a sua senha.',
172
+    'ical_methode_http' => 'Transferência',
173
+    'ical_methode_webcal' => 'Sincronização (webcal://)',
174
+    'ical_texte_prive' => 'Este calendário, de uso estritamente pessoal, o informa sobre a atividade editorial privada deste site (tarefas e encontros pessoais, matérias e notas propostas...).',
175
+    'ical_texte_public' => 'Este calendário permite-lhe acompanhar a atividade pública deste site (matérias e notas publicadas).',
176
+    'ical_texte_rss' => 'Você pode sindicar as novidades deste site em qualquer leitor de arquivos em formato XML/RSS (Rich Site Summary). É também o formato que permite ao SPIP ler as novidades publicadas em outros sites que utilizem um formato de troca de informações compatível (sites sindicados).',
177
+    'ical_titre_js' => 'Javascript',
178
+    'ical_titre_mailing' => 'Mailing-list',
179
+    'ical_titre_rss' => 'Arquivos de sindicação',
180
+    'icone_accueil' => 'Página Inicial',
181
+    'icone_activer_cookie' => 'Ativar o coockie de correspondência',
182
+    'icone_activite' => 'Atividade',
183
+    'icone_admin_plugin' => 'Gerenciamento dos plugins',
184
+    'icone_administration' => 'Manutenção',
185
+    'icone_afficher_auteurs' => 'Exibir os autores',
186
+    'icone_afficher_visiteurs' => 'Exibir os visitantes',
187
+    'icone_arret_discussion' => 'Não participar mais desta discussão',
188
+    'icone_calendrier' => 'Calendário',
189
+    'icone_configuration' => 'Configuração',
190
+    'icone_creer_auteur' => 'Criar um novo autor e vinculá-lo a esta matéria',
191
+    'icone_creer_mot_cle' => 'Criar uma nova palavra-chave e vinculá-la a esta matéria',
192
+    'icone_creer_rubrique_2' => 'Criar uma nova seção',
193
+    'icone_developpement' => 'Desenvolvimento',
194
+    'icone_edition' => 'Edição',
195
+    'icone_ma_langue' => 'Meu idioma',
196
+    'icone_mes_infos' => 'Minhas informações',
197
+    'icone_mes_preferences' => 'Minhas preferências',
198
+    'icone_modifier_article' => 'Editar esta matéria',
199
+    'icone_modifier_rubrique' => 'Editar esta seção',
200
+    'icone_publication' => 'Publicação',
201
+    'icone_relancer_signataire' => 'Reconfirmar o assinante',
202
+    'icone_retour' => 'Voltar',
203
+    'icone_retour_article' => 'Voltar para a matéria',
204
+    'icone_squelette' => 'Templates',
205
+    'icone_suivi_publication' => 'Acompanhamento da publicação',
206
+    'icone_supprimer_cookie' => 'Excluir o cookie de correspondência',
207
+    'icone_supprimer_rubrique' => 'Excluir esta seção',
208
+    'icone_supprimer_signature' => 'Excluir esta assinatura',
209
+    'icone_valider_signature' => 'Validar esta assinatura',
210
+    'image_administrer_rubrique' => 'Você pode administrar esta seção',
211
+    'impossible_modifier_login_auteur' => 'Não foi possível alterar o login.',
212
+    'impossible_modifier_pass_auteur' => 'Não foi possível alterar a senha.',
213
+    'info_1_article' => '1 matéria',
214
+    'info_1_auteur' => '1 autor',
215
+    'info_1_message' => '1 mensagem',
216
+    'info_1_mot_cle' => '1 palavra-chave',
217
+    'info_1_rubrique' => '1 seção',
218
+    'info_1_visiteur' => '1 visitante',
219
+    'info_activer_cookie' => 'Você pode ativar um <b>cookie de correspondência</b>, que lhe permitirá passar facilmente do site público para o site privado.',
220
+    'info_activer_menu_developpement' => 'Exibir o menu Desenvolvimento',
221
+    'info_admin_etre_webmestre' => 'Me conceder direitos de webmaster',
222
+    'info_admin_je_suis_webmestre' => 'Eu sou <b>webmaster</b>',
223
+    'info_admin_statuer_webmestre' => 'Dar a este administrador os direitos de webmaster',
224
+    'info_admin_webmestre' => 'Este administrador é <b>webmaster</b>',
225
+    'info_administrateur' => 'Administrador',
226
+    'info_administrateur_1' => 'Administrador',
227
+    'info_administrateur_2' => 'do site (<i>use com cuidado</i>)',
228
+    'info_administrateur_site_01' => 'Se você é administrador do site, por favor,',
229
+    'info_administrateur_site_02' => 'clique neste link',
230
+    'info_administrateurs' => 'Administradores',
231
+    'info_administrer_rubrique' => 'Você pode administrar esta seção',
232
+    'info_adresse' => 'no endereço:',
233
+    'info_adresse_desinscription' => 'Endereço da desinscrição:',
234
+    'info_adresse_url' => 'Endereço (URL) do site público',
235
+    'info_afficher_par_nb' => 'Exibir por',
236
+    'info_aide_en_ligne' => 'Ajuda online SPIP',
237
+    'info_ajout_image' => 'Assim que você incluir imagens e documentos anexados a uma matéria, o SPIP pode criar para você, automaticamente, ícones (miniaturas) das imagens inseridas. Isto permite, por exemplo, criar automaticamente uma galeria ou um portfólio.',
238
+    'info_ajouter_rubrique' => 'Incluir outra seção para administrar:',
239
+    'info_annonce_nouveautes' => 'Aviso das novidades',
240
+    'info_article' => 'matéria',
241
+    'info_article_2' => 'matérias',
242
+    'info_article_a_paraitre' => 'As matérias pós-datadas para exibição',
243
+    'info_articles_02' => 'matérias',
244
+    'info_articles_2' => 'Matérias',
245
+    'info_articles_auteur' => 'As matérias deste autor',
246
+    'info_articles_miens' => 'Minhas matérias',
247
+    'info_articles_tous' => 'Todas as matérias',
248
+    'info_articles_trouves' => 'Matérias encontradas',
249
+    'info_attente_validation' => 'Suas matérias aguardando validação',
250
+    'info_aucun_article' => 'Nenhuma matéria',
251
+    'info_aucun_auteur' => 'Nenhum autor',
252
+    'info_aucun_message' => 'Nenhuma mensagem',
253
+    'info_aucun_rubrique' => 'Nenhuma seção',
254
+    'info_aujourdhui' => 'Hoje:',
255
+    'info_auteur_gere_rubriques' => 'Este autor gerencia as seções a seguir:',
256
+    'info_auteur_gere_toutes_rubriques' => 'Este autor gerencia <b>todas as seções</b>',
257
+    'info_auteur_gere_toutes_rubriques_2' => 'Eu gerencio <b>todas as seções</b>',
258
+    'info_auteurs' => 'Os autores',
259
+    'info_auteurs_par_tri' => 'Autores@partri@',
260
+    'info_auteurs_trouves' => 'Autores encontrados',
261
+    'info_authentification_externe' => 'Autenticação externa',
262
+    'info_avertissement' => 'Aviso',
263
+    'info_barre_outils' => 'com sua barra de ferramentas?',
264
+    'info_base_installee' => 'A estrutura da sua base de dados foi instalada.',
265
+    'info_bio' => 'Biografia',
266
+    'info_cache_desactive' => 'O cache está temporariamente desativado.',
267
+    'info_chapeau' => 'Introdução',
268
+    'info_chapeau_2' => 'Introdução:',
269
+    'info_chemin_acces_1' => 'Opções: <b>Caminho de acesso no diretório</b>',
270
+    'info_chemin_acces_2' => 'A partir daqui, você deverá configurar o caminho de acesso às informações do diretório. Esta informação é indispensávelpara ler os perfis dos usuários no diretório.',
271
+    'info_chemin_acces_annuaire' => 'Opções: <b>Caminho de acesso no diretório</b>',
272
+    'info_choix_base' => 'Terceiro passo:',
273
+    'info_classement_1' => '<sup><u>o</u></sup> em @liste@',
274
+    'info_classement_2' => '<sup><u>a</u></sup> em @liste@',
275
+    'info_code_acces' => 'Não se esqueça dos seus dados de conexão!',
276
+    'info_config_suivi' => 'Se este endereço corresponde a uma mailing-list, você pode informar abaixo o endereço onde os participantes do site podem se inscrever. Este endereço pode ser um URL (por exemplo a página de inscrição na lista pela Web), ou um endereço de e-mail dotado de um assunto específico (par exemple: <tt>@adresse_suivi@?subject=subscribe</tt>):',
277
+    'info_config_suivi_explication' => 'Voce pode assinar a  mailing-list deste site. Você irá receber por e-mail, os avisos de matérias e notas propostos para publicação.',
278
+    'info_confirmer_passe' => 'Confirmar a nova senha:',
279
+    'info_conflit_edition_avis_non_sauvegarde' => 'Atenção os campos a seguir foram alterados por terceiros. As suas modificações nestes campos não foram, por isso, gravadas.',
280
+    'info_conflit_edition_differences' => 'Diferenças:',
281
+    'info_conflit_edition_version_enregistree' => 'A versão gravada:',
282
+    'info_conflit_edition_votre_version' => 'A sua versão:',
283
+    'info_connexion_base' => 'Teste de conexão com a base',
284
+    'info_connexion_base_donnee' => 'Conexão à sua base de dados',
285
+    'info_connexion_ldap_ok' => '<b>A conexão LDAP foi efetuada.</b><p>Você pode passar para o próximo passo.</p>',
286
+    'info_connexion_mysql' => 'Sua conexão SQL',
287
+    'info_connexion_ok' => 'A conexão foi obtida.',
288
+    'info_contact' => 'Contato',
289
+    'info_contenu_articles' => 'Conteúdo das matérias',
290
+    'info_contributions' => 'Contribuições',
291
+    'info_creation_paragraphe' => 'Para criar parágrafos, basta deixar linhas em branco.',
292
+    'info_creation_rubrique' => 'Antes de poder escrever matérias, você deve criar, pelo menos, uma seção.<br />',
293
+    'info_creation_tables' => 'Criação das tabelas da base',
294
+    'info_creer_base' => '<b>Criar</b> uma nova base de dados:',
295
+    'info_dans_rubrique' => 'Na seção:',
296
+    'info_date_publication_anterieure' => 'Data de redação anterior:',
297
+    'info_date_referencement' => 'DATA DE REFERENCIAMENTO DESTE SITE:',
298
+    'info_derniere_etape' => 'Terminou!',
299
+    'info_descriptif' => 'Descrição:',
300
+    'info_desinstaller_plugin' => 'exclui os dados e desativa o plugin',
301
+    'info_discussion_cours' => 'Discussões em andamento',
302
+    'info_ecrire_article' => 'Antes de poder escrever matérias, você precisa criar pelo menos uma seção.',
303
+    'info_email_envoi' => 'Endereço de e-mail de envio (opcional)',
304
+    'info_email_envoi_txt' => 'Informe aqui o endereço a ser utilizado para enviar os e-mails (por padrão, o endereço de destino será usado como endereço de envio):',
305
+    'info_email_webmestre' => 'Endereço de e-mail do webmaster',
306
+    'info_envoi_email_automatique' => 'Envio automático de e-mails',
307
+    'info_envoyer_maintenant' => 'Enviar agora',
308
+    'info_etape_suivante' => 'Avançar para a próxima etapa',
309
+    'info_etape_suivante_1' => 'Você pode passar para a próxima etapa.',
310
+    'info_etape_suivante_2' => 'Você pode passar para a próxima etapa.',
311
+    'info_exceptions_proxy' => 'Exceções para o proxy',
312
+    'info_exportation_base' => 'exportação da base para @archive@',
313
+    'info_facilite_suivi_activite' => 'Para facilitar o acompanhamento da atividade editorial do site, o SPIP pode avisar por e-mail, por exemplo para uma mailing-list de redatores, os avisos dos pedidos de publicação e das validações das matérias. Informe um ou mais endereços, separados por vírgula.',
314
+    'info_fichiers_authent' => 'Arquivos de autenticação «.htpasswd»',
315
+    'info_forums_abo_invites' => 'O seu site comporta fóruns por assinatura; os visitantes são convidados a se registrar no site público.',
316
+    'info_gauche_admin_tech' => '<b>Esta página é acessível apenas aos responsáveis pelo site.</b><p>Ela dá acesso às diferentes funções de manutenção técnica. Algumas dessas funções possuem um processo específico de autenticação que exige acesso FTP ao website.</p>',
317
+    'info_gauche_admin_vider' => '<b>Esta página é acessível apenas aos responsáveis pelo site.</b><p> Ela dá acesso às diferentes funções de manutenção técnica. Algumas dessas funções possuem um processo específico de autenticação que exige acesso FTP ao website.</p>',
318
+    'info_gauche_auteurs' => 'Aqui, você encontra todos os autores do site.
319 319
 Os status dos autores é indicado pela côr dos ícones (administrador = verde; redator = amarelo).',
320
-	'info_gauche_auteurs_exterieurs' => 'Os autores externos, sem acesso ao site, são indicados por um ícone azul;
320
+    'info_gauche_auteurs_exterieurs' => 'Os autores externos, sem acesso ao site, são indicados por um ícone azul;
321 321
 os autores excluídos por um ícone cinza.',
322
-	'info_gauche_messagerie' => 'O sistema interno de mensagens permite a troca de mensagens entre redatores, a criação de lembretes (para seu uso pessoal) ou exibir anúncios na página de entrada da área privada (se você for administrador).',
323
-	'info_gauche_statistiques_referers' => 'Esta página apresenta a lista dos  <i>referers</i>, ou seja, dos sites que contêm links para o seu site, unicamente para ontem e hoje; esta lista é zerada a cada 24 horas.',
324
-	'info_gauche_visiteurs_enregistres' => 'Você encontrará aqui os visitantes registrados na área pública do site (fóruns por assinatura).',
325
-	'info_generation_miniatures_images' => 'Geração de miniaturas das imagens',
326
-	'info_gerer_trad_objets' => '@objets@ : gerenciar os links de tradução',
327
-	'info_hebergeur_desactiver_envoi_email' => 'Alguns serviços de hospedagem desativam o envio automático de e-mails a partir dos seus servidores. Neste caso, as funcionalidades a seguir não funcionarão.',
328
-	'info_hier' => 'ontem:',
329
-	'info_identification_publique' => 'Sua identificação pública...',
330
-	'info_image_process' => 'Por favor, selecione o melhor método de criação dos ícones, clicando na imagem correspondente.',
331
-	'info_image_process2' => 'Se nenhuma imagem está sendo exibida, o servidor que hospeda o seu site não foi configurado para utilizar essas ferramentas. Se você deseja usar essas funções, contate o responsável técnico e solicite as extensões «GD» ou «Imagick».',
332
-	'info_images_auto' => 'Imagens calculadas automaticamente',
333
-	'info_informations_personnelles' => 'Informações pessoais',
334
-	'info_inscription' => 'Inscrição online',
335
-	'info_inscription_automatique' => 'Inscrição automática de novos redatores',
336
-	'info_jeu_caractere' => 'Conjunto de caracteres do site',
337
-	'info_jours' => 'dias',
338
-	'info_laisser_champs_vides' => 'deixar estes campos vazios)',
339
-	'info_langues' => 'Idiomas do site',
340
-	'info_ldap_ok' => 'A autenticação LDAP está instalada.',
341
-	'info_lien_hypertexte' => 'Link hipertexto:',
342
-	'info_liste_nouveautes_envoyee' => 'A lista de novidades foi enviada',
343
-	'info_liste_redacteurs_connectes' => 'Lista de redatores conectados',
344
-	'info_login_existant' => 'Este login já está cadastrado.',
345
-	'info_login_trop_court' => 'Login muito curto.',
346
-	'info_login_trop_court_car_pluriel' => 'O login deve conter pelo menos @nb@ caracteres.',
347
-	'info_logos' => 'Os ícones',
348
-	'info_maximum' => 'máximo:',
349
-	'info_meme_rubrique' => 'Na mesma seção',
350
-	'info_message_en_redaction' => 'Suas mensagens em fase de redação',
351
-	'info_message_technique' => 'Mensagem técnica:',
352
-	'info_messagerie_interne' => 'Mensageria interna',
353
-	'info_mise_a_niveau_base' => 'atualização da sua base SQL',
354
-	'info_mise_a_niveau_base_2' => '{{Atenção!}} Você instalou uma versão de arquivos SPIP {anterior} à que estava instalada no site: a sua base de dados corre o risco de se corromper e o seu site não funcionar mais.<br />{{Reinstale os arquivos SPIP.}}',
355
-	'info_modification_enregistree' => 'Sua alteração foi gravada',
356
-	'info_modifier_auteur' => 'Editar o autor:',
357
-	'info_modifier_rubrique' => 'Editar a seção:',
358
-	'info_modifier_titre' => 'Editar: @titre@',
359
-	'info_mon_site_spip' => 'Meu site SPIP',
360
-	'info_moyenne' => 'média:',
361
-	'info_multi_cet_article' => 'Idioma desta matéria:',
362
-	'info_multi_langues_choisies' => 'Por favor, selecione a seguir os idiomas à disposição dos redatores do seu site.
322
+    'info_gauche_messagerie' => 'O sistema interno de mensagens permite a troca de mensagens entre redatores, a criação de lembretes (para seu uso pessoal) ou exibir anúncios na página de entrada da área privada (se você for administrador).',
323
+    'info_gauche_statistiques_referers' => 'Esta página apresenta a lista dos  <i>referers</i>, ou seja, dos sites que contêm links para o seu site, unicamente para ontem e hoje; esta lista é zerada a cada 24 horas.',
324
+    'info_gauche_visiteurs_enregistres' => 'Você encontrará aqui os visitantes registrados na área pública do site (fóruns por assinatura).',
325
+    'info_generation_miniatures_images' => 'Geração de miniaturas das imagens',
326
+    'info_gerer_trad_objets' => '@objets@ : gerenciar os links de tradução',
327
+    'info_hebergeur_desactiver_envoi_email' => 'Alguns serviços de hospedagem desativam o envio automático de e-mails a partir dos seus servidores. Neste caso, as funcionalidades a seguir não funcionarão.',
328
+    'info_hier' => 'ontem:',
329
+    'info_identification_publique' => 'Sua identificação pública...',
330
+    'info_image_process' => 'Por favor, selecione o melhor método de criação dos ícones, clicando na imagem correspondente.',
331
+    'info_image_process2' => 'Se nenhuma imagem está sendo exibida, o servidor que hospeda o seu site não foi configurado para utilizar essas ferramentas. Se você deseja usar essas funções, contate o responsável técnico e solicite as extensões «GD» ou «Imagick».',
332
+    'info_images_auto' => 'Imagens calculadas automaticamente',
333
+    'info_informations_personnelles' => 'Informações pessoais',
334
+    'info_inscription' => 'Inscrição online',
335
+    'info_inscription_automatique' => 'Inscrição automática de novos redatores',
336
+    'info_jeu_caractere' => 'Conjunto de caracteres do site',
337
+    'info_jours' => 'dias',
338
+    'info_laisser_champs_vides' => 'deixar estes campos vazios)',
339
+    'info_langues' => 'Idiomas do site',
340
+    'info_ldap_ok' => 'A autenticação LDAP está instalada.',
341
+    'info_lien_hypertexte' => 'Link hipertexto:',
342
+    'info_liste_nouveautes_envoyee' => 'A lista de novidades foi enviada',
343
+    'info_liste_redacteurs_connectes' => 'Lista de redatores conectados',
344
+    'info_login_existant' => 'Este login já está cadastrado.',
345
+    'info_login_trop_court' => 'Login muito curto.',
346
+    'info_login_trop_court_car_pluriel' => 'O login deve conter pelo menos @nb@ caracteres.',
347
+    'info_logos' => 'Os ícones',
348
+    'info_maximum' => 'máximo:',
349
+    'info_meme_rubrique' => 'Na mesma seção',
350
+    'info_message_en_redaction' => 'Suas mensagens em fase de redação',
351
+    'info_message_technique' => 'Mensagem técnica:',
352
+    'info_messagerie_interne' => 'Mensageria interna',
353
+    'info_mise_a_niveau_base' => 'atualização da sua base SQL',
354
+    'info_mise_a_niveau_base_2' => '{{Atenção!}} Você instalou uma versão de arquivos SPIP {anterior} à que estava instalada no site: a sua base de dados corre o risco de se corromper e o seu site não funcionar mais.<br />{{Reinstale os arquivos SPIP.}}',
355
+    'info_modification_enregistree' => 'Sua alteração foi gravada',
356
+    'info_modifier_auteur' => 'Editar o autor:',
357
+    'info_modifier_rubrique' => 'Editar a seção:',
358
+    'info_modifier_titre' => 'Editar: @titre@',
359
+    'info_mon_site_spip' => 'Meu site SPIP',
360
+    'info_moyenne' => 'média:',
361
+    'info_multi_cet_article' => 'Idioma desta matéria:',
362
+    'info_multi_langues_choisies' => 'Por favor, selecione a seguir os idiomas à disposição dos redatores do seu site.
363 363
 Os idiomas já utilizados no site (no topo da lista) não podem ser desativados.',
364
-	'info_multi_objets' => '@objets@ : ativar o menu de idioma',
365
-	'info_multi_secteurs' => '... apenas para as seções situadas na raiz?',
366
-	'info_nb_articles' => '@nb@ matérias',
367
-	'info_nb_auteurs' => '@nb@ autores',
368
-	'info_nb_messages' => '@nb@ mensagens',
369
-	'info_nb_mots_cles' => '@nb@ palavras-chave',
370
-	'info_nb_rubriques' => '@nb@ seções',
371
-	'info_nb_visiteurs' => '@nb@ visitantes',
372
-	'info_nom' => 'Nome',
373
-	'info_nom_destinataire' => 'Nome do destinatário',
374
-	'info_nom_pas_conforme' => 'tags HTML não são permitidas',
375
-	'info_nom_site' => 'Nome do seu site',
376
-	'info_nombre_articles' => '@nb_articles@ matérias,',
377
-	'info_nombre_rubriques' => '@nb_rubriques@ seções,',
378
-	'info_nombre_sites' => '@nb_sites@ sites,',
379
-	'info_non_deplacer' => 'Não mover...',
380
-	'info_non_envoi_annonce_dernieres_nouveautes' => 'O SPIP pode enviar regularmente o anúncio das últimas novidades do site (matérias e notas publicadas recentemente).',
381
-	'info_non_envoi_liste_nouveautes' => 'Não enviar a lista de novidades',
382
-	'info_non_modifiable' => 'não pode ser modificado',
383
-	'info_non_suppression_mot_cle' => 'Eu não quero excluir esta palavra-chave.',
384
-	'info_notes' => 'Observações',
385
-	'info_nouvel_article' => 'Nova matéria',
386
-	'info_nouvelle_traduction' => 'Nova tradução:',
387
-	'info_numero_article' => 'MATÉRIA NÚMERO:',
388
-	'info_obligatoire_02' => '(obrigatório)',
389
-	'info_option_accepter_visiteurs' => 'Aceitar a inscrição de visitantes do site público',
390
-	'info_option_ne_pas_accepter_visiteurs' => 'Recusar a inscrição dos visitantes',
391
-	'info_options_avancees' => 'OPÇÕES AVANÇADAS',
392
-	'info_ou' => 'ou...',
393
-	'info_page_interdite' => 'Página não autorizada',
394
-	'info_par_nom' => 'por nome',
395
-	'info_par_nombre_article' => 'por número de matérias',
396
-	'info_par_statut' => 'por status',
397
-	'info_par_tri' => '’(por @tri@)’',
398
-	'info_passe_trop_court' => 'Senha muito curta.',
399
-	'info_passe_trop_court_car_pluriel' => 'A senha deve conter pelo menos @nb@ caracteres.',
400
-	'info_passes_identiques' => 'As duas senhas não são idênticas.',
401
-	'info_plus_cinq_car' => 'mais de 5 caracteres',
402
-	'info_plus_cinq_car_2' => '(Mais de 5 caracteres)',
403
-	'info_plus_trois_car' => '(Mais de 3 caracteres)',
404
-	'info_popularite' => 'popularidade: @popularite@; visitas: @visites@',
405
-	'info_post_scriptum' => 'Rodapé',
406
-	'info_post_scriptum_2' => 'Rodapé:',
407
-	'info_pour' => 'para',
408
-	'info_preview_texte' => 'É possível visualizar os diferentes elementos editoriais do site que tenham  pelo menos o status de «proposto», bem como os elementos em fase de redação de que se é autor. Esta funcionalidade deve estar disponível para os administradores, para os redatores, ou para ninguém?',
409
-	'info_procedez_par_etape' => 'proceder passo-a-passo',
410
-	'info_procedure_maj_version' => 'o procedimento de atualização deve ser rodado para adaptar a base de dados à nova versão do SPIP.',
411
-	'info_proxy_ok' => 'Teste do proxy bem sucedido',
412
-	'info_ps' => 'P.S.',
413
-	'info_publier' => 'publicar',
414
-	'info_publies' => 'Suas matérias publicadas online',
415
-	'info_question_accepter_visiteurs' => 'Se os templates do seu site prevêem o cadastramento de visitantes sem acesso à área privada, por favor, ative a opção abaixo:',
416
-	'info_question_inscription_nouveaux_redacteurs' => 'Você quer aceitar inscrições de novos redatores a partir do site público? Se você aceitar, os visitantes poderão se cadastrar através de um formulário automatizado, tendo acesso à área privada para propôr as suas próprias matérias. <div class="notice">Durante a fase de inscrição, os usuários recebem um e-mail automático, fornecendo-lhes os seus códigos de acesso à área privada. Alguns serviços de hospedagem desativam o envio de e-mails a partir dos seus servidores: nesse caso, a inscrição automática é impossível.</div>',
417
-	'info_qui_edite' => '@nom_auteur_modif@ trabalhou neste conteúdo há @date_diff@ minutos',
418
-	'info_racine_site' => 'Raiz do site',
419
-	'info_recharger_page' => 'Por favor, atualize esta página em alguns instantes.',
420
-	'info_recherche_auteur_zero' => 'Nenhum resultado para «@cherche_auteur@».',
421
-	'info_recommencer' => 'Por favor, recomece.',
422
-	'info_redacteur_1' => 'Redator',
423
-	'info_redacteur_2' => 'com acesso à área privada (<i>recomendado</i>)',
424
-	'info_redacteurs' => 'Redatores',
425
-	'info_redaction_en_cours' => 'EM FASE DE REDAÇÃO',
426
-	'info_redirection' => 'Redirecionamento',
427
-	'info_redirection_activee' => 'O redirecionamento foi ativado.',
428
-	'info_redirection_boucle' => 'Você tentou redirecionar a matéria para ela mesma.',
429
-	'info_redirection_desactivee' => 'O redirecionamento foi excluído.',
430
-	'info_refuses' => 'Suas matérias recusadas',
431
-	'info_reglage_ldap' => 'Opções: <b>Configuração da importação LDAP</b>',
432
-	'info_renvoi_article' => '<b>Redirecionamento.</b> Esta matéria redireciona para a página:',
433
-	'info_reserve_admin' => 'Apenas os administradores podem alterar este endereço.',
434
-	'info_restreindre_rubrique' => 'Restringir o gerenciamento à seção:',
435
-	'info_resultat_recherche' => 'Resultados da busca:',
436
-	'info_rubriques' => 'Seções',
437
-	'info_rubriques_02' => 'seções',
438
-	'info_rubriques_trouvees' => 'Seções encontradas',
439
-	'info_sans_titre' => 'Sem título',
440
-	'info_selection_chemin_acces' => '<b>Selecione</b> a seguir o caminho para acessar o diretório:',
441
-	'info_signatures' => 'assinaturas',
442
-	'info_site' => 'Site',
443
-	'info_site_2' => 'site:',
444
-	'info_site_min' => 'site',
445
-	'info_site_reference_2' => 'Site referenciado',
446
-	'info_site_web' => 'Website:',
447
-	'info_sites' => 'sites',
448
-	'info_sites_lies_mot' => 'Os sites referenciados vinculados a esta palavra-chave',
449
-	'info_sites_proxy' => 'Utilizar um proxy',
450
-	'info_sites_trouves' => 'Sites encontrados',
451
-	'info_sous_titre' => 'Subtítulo:',
452
-	'info_statut_administrateur' => 'Administrador',
453
-	'info_statut_auteur' => 'Status deste autor:',
454
-	'info_statut_auteur_2' => 'Eu sou',
455
-	'info_statut_auteur_a_confirmer' => 'Inscrição a confirmar',
456
-	'info_statut_auteur_autre' => 'Outro status:',
457
-	'info_statut_redacteur' => 'Redator',
458
-	'info_statut_utilisateurs_1' => 'Status padrão dos usuários importados',
459
-	'info_statut_utilisateurs_2' => 'Escolha o status atribuído às pessoas que constam do diretório LDAP, quando elas se conectarem pela primeira vêz. Você poderá, em seguida, alterar caso a caso este valor para cada autor.',
460
-	'info_suivi_activite' => 'Acompanhamento da atividade editorial',
461
-	'info_surtitre' => 'Sobretítulo:',
462
-	'info_syndication_integrale_1' => 'O seu site propõe arquivos de sindicação (ver «<a href="@url@">@titre@</a>»).',
463
-	'info_syndication_integrale_2' => 'Você deseja transmitir as matérias integralmente, ou difundir apenas um resumo de algumas centenas de caracteres?',
464
-	'info_table_prefix' => 'Você pode alterar o prefixo do nome das tabelas de dados (indispensável no caso de pretender instalar diversos sites na mesma base de dados). Este prefixo deve estar em minúsculas, não acentuadas, e sem espaços.',
465
-	'info_taille_maximale_images' => 'SPIP irá testar o tamanho máximo das imagens que o sistema pode tratar (em milhões de pixels).<br />As imagens muito grandes não serão reduzidas.',
466
-	'info_taille_maximale_vignette' => 'Tamanho máximo dos ícones gerados pelo sistema:',
467
-	'info_terminer_installation' => 'Você pode agora terminar o procedimento de instalação padrão.',
468
-	'info_texte' => 'Texto',
469
-	'info_texte_explicatif' => 'Texto explicativo',
470
-	'info_texte_long' => '(o texto é longo: ele aparecerá em diversas partes que serão recombinadas após validação.)',
471
-	'info_texte_message' => 'Texto da sua mensagem',
472
-	'info_texte_message_02' => 'Texto da mensagem',
473
-	'info_titre' => 'Título:',
474
-	'info_total' => 'total:',
475
-	'info_tous_articles_en_redaction' => 'Todas as matérias em fase de redação',
476
-	'info_tous_articles_presents' => 'Todas as matérias publicadas nesta seção',
477
-	'info_tous_articles_refuses' => 'Todas as matérias recusadas',
478
-	'info_tous_les' => 'todos os:',
479
-	'info_tout_site' => 'Todo o site',
480
-	'info_tout_site2' => 'A matéria não foi traduzida para este idioma.',
481
-	'info_tout_site3' => 'A matéria foi traduzida para este idioma, mas foram feitas alterações na matéria de referência. A tradução procisa ser atualizada.',
482
-	'info_tout_site4' => 'A matéria foi traduzida para este idioma e a tradução está em dia.',
483
-	'info_tout_site5' => 'Matéria original.',
484
-	'info_tout_site6' => '<b>Atenção:</b> apenas as matérias originais estão exibidas.
364
+    'info_multi_objets' => '@objets@ : ativar o menu de idioma',
365
+    'info_multi_secteurs' => '... apenas para as seções situadas na raiz?',
366
+    'info_nb_articles' => '@nb@ matérias',
367
+    'info_nb_auteurs' => '@nb@ autores',
368
+    'info_nb_messages' => '@nb@ mensagens',
369
+    'info_nb_mots_cles' => '@nb@ palavras-chave',
370
+    'info_nb_rubriques' => '@nb@ seções',
371
+    'info_nb_visiteurs' => '@nb@ visitantes',
372
+    'info_nom' => 'Nome',
373
+    'info_nom_destinataire' => 'Nome do destinatário',
374
+    'info_nom_pas_conforme' => 'tags HTML não são permitidas',
375
+    'info_nom_site' => 'Nome do seu site',
376
+    'info_nombre_articles' => '@nb_articles@ matérias,',
377
+    'info_nombre_rubriques' => '@nb_rubriques@ seções,',
378
+    'info_nombre_sites' => '@nb_sites@ sites,',
379
+    'info_non_deplacer' => 'Não mover...',
380
+    'info_non_envoi_annonce_dernieres_nouveautes' => 'O SPIP pode enviar regularmente o anúncio das últimas novidades do site (matérias e notas publicadas recentemente).',
381
+    'info_non_envoi_liste_nouveautes' => 'Não enviar a lista de novidades',
382
+    'info_non_modifiable' => 'não pode ser modificado',
383
+    'info_non_suppression_mot_cle' => 'Eu não quero excluir esta palavra-chave.',
384
+    'info_notes' => 'Observações',
385
+    'info_nouvel_article' => 'Nova matéria',
386
+    'info_nouvelle_traduction' => 'Nova tradução:',
387
+    'info_numero_article' => 'MATÉRIA NÚMERO:',
388
+    'info_obligatoire_02' => '(obrigatório)',
389
+    'info_option_accepter_visiteurs' => 'Aceitar a inscrição de visitantes do site público',
390
+    'info_option_ne_pas_accepter_visiteurs' => 'Recusar a inscrição dos visitantes',
391
+    'info_options_avancees' => 'OPÇÕES AVANÇADAS',
392
+    'info_ou' => 'ou...',
393
+    'info_page_interdite' => 'Página não autorizada',
394
+    'info_par_nom' => 'por nome',
395
+    'info_par_nombre_article' => 'por número de matérias',
396
+    'info_par_statut' => 'por status',
397
+    'info_par_tri' => '’(por @tri@)’',
398
+    'info_passe_trop_court' => 'Senha muito curta.',
399
+    'info_passe_trop_court_car_pluriel' => 'A senha deve conter pelo menos @nb@ caracteres.',
400
+    'info_passes_identiques' => 'As duas senhas não são idênticas.',
401
+    'info_plus_cinq_car' => 'mais de 5 caracteres',
402
+    'info_plus_cinq_car_2' => '(Mais de 5 caracteres)',
403
+    'info_plus_trois_car' => '(Mais de 3 caracteres)',
404
+    'info_popularite' => 'popularidade: @popularite@; visitas: @visites@',
405
+    'info_post_scriptum' => 'Rodapé',
406
+    'info_post_scriptum_2' => 'Rodapé:',
407
+    'info_pour' => 'para',
408
+    'info_preview_texte' => 'É possível visualizar os diferentes elementos editoriais do site que tenham  pelo menos o status de «proposto», bem como os elementos em fase de redação de que se é autor. Esta funcionalidade deve estar disponível para os administradores, para os redatores, ou para ninguém?',
409
+    'info_procedez_par_etape' => 'proceder passo-a-passo',
410
+    'info_procedure_maj_version' => 'o procedimento de atualização deve ser rodado para adaptar a base de dados à nova versão do SPIP.',
411
+    'info_proxy_ok' => 'Teste do proxy bem sucedido',
412
+    'info_ps' => 'P.S.',
413
+    'info_publier' => 'publicar',
414
+    'info_publies' => 'Suas matérias publicadas online',
415
+    'info_question_accepter_visiteurs' => 'Se os templates do seu site prevêem o cadastramento de visitantes sem acesso à área privada, por favor, ative a opção abaixo:',
416
+    'info_question_inscription_nouveaux_redacteurs' => 'Você quer aceitar inscrições de novos redatores a partir do site público? Se você aceitar, os visitantes poderão se cadastrar através de um formulário automatizado, tendo acesso à área privada para propôr as suas próprias matérias. <div class="notice">Durante a fase de inscrição, os usuários recebem um e-mail automático, fornecendo-lhes os seus códigos de acesso à área privada. Alguns serviços de hospedagem desativam o envio de e-mails a partir dos seus servidores: nesse caso, a inscrição automática é impossível.</div>',
417
+    'info_qui_edite' => '@nom_auteur_modif@ trabalhou neste conteúdo há @date_diff@ minutos',
418
+    'info_racine_site' => 'Raiz do site',
419
+    'info_recharger_page' => 'Por favor, atualize esta página em alguns instantes.',
420
+    'info_recherche_auteur_zero' => 'Nenhum resultado para «@cherche_auteur@».',
421
+    'info_recommencer' => 'Por favor, recomece.',
422
+    'info_redacteur_1' => 'Redator',
423
+    'info_redacteur_2' => 'com acesso à área privada (<i>recomendado</i>)',
424
+    'info_redacteurs' => 'Redatores',
425
+    'info_redaction_en_cours' => 'EM FASE DE REDAÇÃO',
426
+    'info_redirection' => 'Redirecionamento',
427
+    'info_redirection_activee' => 'O redirecionamento foi ativado.',
428
+    'info_redirection_boucle' => 'Você tentou redirecionar a matéria para ela mesma.',
429
+    'info_redirection_desactivee' => 'O redirecionamento foi excluído.',
430
+    'info_refuses' => 'Suas matérias recusadas',
431
+    'info_reglage_ldap' => 'Opções: <b>Configuração da importação LDAP</b>',
432
+    'info_renvoi_article' => '<b>Redirecionamento.</b> Esta matéria redireciona para a página:',
433
+    'info_reserve_admin' => 'Apenas os administradores podem alterar este endereço.',
434
+    'info_restreindre_rubrique' => 'Restringir o gerenciamento à seção:',
435
+    'info_resultat_recherche' => 'Resultados da busca:',
436
+    'info_rubriques' => 'Seções',
437
+    'info_rubriques_02' => 'seções',
438
+    'info_rubriques_trouvees' => 'Seções encontradas',
439
+    'info_sans_titre' => 'Sem título',
440
+    'info_selection_chemin_acces' => '<b>Selecione</b> a seguir o caminho para acessar o diretório:',
441
+    'info_signatures' => 'assinaturas',
442
+    'info_site' => 'Site',
443
+    'info_site_2' => 'site:',
444
+    'info_site_min' => 'site',
445
+    'info_site_reference_2' => 'Site referenciado',
446
+    'info_site_web' => 'Website:',
447
+    'info_sites' => 'sites',
448
+    'info_sites_lies_mot' => 'Os sites referenciados vinculados a esta palavra-chave',
449
+    'info_sites_proxy' => 'Utilizar um proxy',
450
+    'info_sites_trouves' => 'Sites encontrados',
451
+    'info_sous_titre' => 'Subtítulo:',
452
+    'info_statut_administrateur' => 'Administrador',
453
+    'info_statut_auteur' => 'Status deste autor:',
454
+    'info_statut_auteur_2' => 'Eu sou',
455
+    'info_statut_auteur_a_confirmer' => 'Inscrição a confirmar',
456
+    'info_statut_auteur_autre' => 'Outro status:',
457
+    'info_statut_redacteur' => 'Redator',
458
+    'info_statut_utilisateurs_1' => 'Status padrão dos usuários importados',
459
+    'info_statut_utilisateurs_2' => 'Escolha o status atribuído às pessoas que constam do diretório LDAP, quando elas se conectarem pela primeira vêz. Você poderá, em seguida, alterar caso a caso este valor para cada autor.',
460
+    'info_suivi_activite' => 'Acompanhamento da atividade editorial',
461
+    'info_surtitre' => 'Sobretítulo:',
462
+    'info_syndication_integrale_1' => 'O seu site propõe arquivos de sindicação (ver «<a href="@url@">@titre@</a>»).',
463
+    'info_syndication_integrale_2' => 'Você deseja transmitir as matérias integralmente, ou difundir apenas um resumo de algumas centenas de caracteres?',
464
+    'info_table_prefix' => 'Você pode alterar o prefixo do nome das tabelas de dados (indispensável no caso de pretender instalar diversos sites na mesma base de dados). Este prefixo deve estar em minúsculas, não acentuadas, e sem espaços.',
465
+    'info_taille_maximale_images' => 'SPIP irá testar o tamanho máximo das imagens que o sistema pode tratar (em milhões de pixels).<br />As imagens muito grandes não serão reduzidas.',
466
+    'info_taille_maximale_vignette' => 'Tamanho máximo dos ícones gerados pelo sistema:',
467
+    'info_terminer_installation' => 'Você pode agora terminar o procedimento de instalação padrão.',
468
+    'info_texte' => 'Texto',
469
+    'info_texte_explicatif' => 'Texto explicativo',
470
+    'info_texte_long' => '(o texto é longo: ele aparecerá em diversas partes que serão recombinadas após validação.)',
471
+    'info_texte_message' => 'Texto da sua mensagem',
472
+    'info_texte_message_02' => 'Texto da mensagem',
473
+    'info_titre' => 'Título:',
474
+    'info_total' => 'total:',
475
+    'info_tous_articles_en_redaction' => 'Todas as matérias em fase de redação',
476
+    'info_tous_articles_presents' => 'Todas as matérias publicadas nesta seção',
477
+    'info_tous_articles_refuses' => 'Todas as matérias recusadas',
478
+    'info_tous_les' => 'todos os:',
479
+    'info_tout_site' => 'Todo o site',
480
+    'info_tout_site2' => 'A matéria não foi traduzida para este idioma.',
481
+    'info_tout_site3' => 'A matéria foi traduzida para este idioma, mas foram feitas alterações na matéria de referência. A tradução procisa ser atualizada.',
482
+    'info_tout_site4' => 'A matéria foi traduzida para este idioma e a tradução está em dia.',
483
+    'info_tout_site5' => 'Matéria original.',
484
+    'info_tout_site6' => '<b>Atenção:</b> apenas as matérias originais estão exibidas.
485 485
 As traduções estão associadas ao original, numa côr que indica o seu status:',
486
-	'info_traductions' => 'Traduções',
487
-	'info_travail_colaboratif' => 'Trabalho colaborativo nas matérias',
488
-	'info_un_article' => 'uma matéria,',
489
-	'info_un_site' => 'um site,',
490
-	'info_une_rubrique' => 'uma seção,',
491
-	'info_une_rubrique_02' => '1 seção',
492
-	'info_url' => 'URL:',
493
-	'info_url_proxy' => 'URL do proxy',
494
-	'info_url_proxy_pas_conforme' => 'O URL do proxy não é válido.',
495
-	'info_url_site_pas_conforme' => 'O URL do site não é válido.',
496
-	'info_url_test_proxy' => 'URL de teste',
497
-	'info_urlref' => 'Link hipertexto:',
498
-	'info_utilisation_spip' => 'Você pode agora começar a utilizar o sistema de publicação assistida...',
499
-	'info_visites_par_mois' => 'Exibir por mês:',
500
-	'info_visiteur_1' => 'Visitante',
501
-	'info_visiteur_2' => 'do site público',
502
-	'info_visiteurs' => 'Visitantes',
503
-	'info_visiteurs_02' => 'Visitantes do site público',
504
-	'info_webmestre_forces' => 'Os webmasters são definidos em <tt>@file_options@</tt>.',
505
-	'install_adresse_base_hebergeur' => 'Endereço da base de dados atribuído pelo serviço de hospedagem:',
506
-	'install_connect_ok' => 'A nova base de dados foi corretamente declarada sob o nome de servidor @connect@.',
507
-	'install_echec_annonce' => 'A instalação irá, provavelmente, falhar, ou levar a um site que não funciona...',
508
-	'install_extension_mbstring' => 'O SPIP não funciona com:',
509
-	'install_extension_php_obligatoire' => 'O SPIP exige a extensão php:',
510
-	'install_login_base_hebergeur' => 'Login de conexão atribuído pelo serviço de hospedagem:',
511
-	'install_nom_base_hebergeur' => 'Nome da base atribuído pelo serviço de hospedagem:',
512
-	'install_pas_table' => 'Base atualmente sem tabelas',
513
-	'install_pass_base_hebergeur' => 'Senha de conexão atribuída pelo serviço de hospedagem',
514
-	'install_php_extension' => 'As extensões a seguir estão faltando: @extensions@',
515
-	'install_php_version' => 'PHP versão @version@ é insuficiente (mínimo = @minimum@)',
516
-	'install_php_version_max' => 'A versão @version@ do PHP é muito recente (máximo = @maximum@)',
517
-	'install_select_langue' => 'Escolha um idioma e clique no botão «avançar» para iniciar o procedimento de instalação.',
518
-	'install_select_type_db' => 'Indicar o tipo de base de dados:',
519
-	'install_select_type_mysql' => 'MySQL',
520
-	'install_select_type_pg' => 'PostgreSQL',
521
-	'install_select_type_sqlite2' => 'SQLite 2',
522
-	'install_select_type_sqlite3' => 'SQLite 3',
523
-	'install_serveur_hebergeur' => 'Servidor de base de dados atribuído pelo serviço de hospedagem',
524
-	'install_table_prefix_hebergeur' => 'Prefixo de tabela atribuído pelo serviço de hospedagem:',
525
-	'install_tables_base' => 'Tabelas da base',
526
-	'install_types_db_connus' => 'SPIP pode usar <b>MySQL</b> (a mais comum), e <b>SQLite</b>.',
527
-	'install_types_db_connus_avertissement' => 'O suporte ao <b>PostgreSQL</b> é também proposto a título experimental',
528
-	'instituer_erreur_statut_a_change' => 'O status já foi alterado',
529
-	'instituer_erreur_statut_non_autorise' => 'Você não pode escolher este status',
530
-	'intem_redacteur' => 'redator',
531
-	'intitule_licence' => 'Licença',
532
-	'item_accepter_inscriptions' => 'Aceitar as inscrições',
533
-	'item_activer_messages_avertissement' => 'Ativar as mensagens de aviso',
534
-	'item_administrateur_2' => 'administrador',
535
-	'item_afficher_calendrier' => 'Exibir no calendário',
536
-	'item_autoriser_syndication_integrale' => 'Difundir a íntegra das matérias nos arquivos de sindicação',
537
-	'item_choix_administrateurs' => 'os administradores',
538
-	'item_choix_generation_miniature' => 'Gerar automaticamente as miniaturas das imagens.',
539
-	'item_choix_non_generation_miniature' => 'Não gerar as miniaturas das imagens.',
540
-	'item_choix_redacteurs' => 'os redatores',
541
-	'item_choix_visiteurs' => 'os visitantes do site público',
542
-	'item_creer_fichiers_authent' => 'Criar os arquivos .htpasswd',
543
-	'item_login' => 'Login',
544
-	'item_messagerie_agenda' => 'Ativar as mesagens internas e a agenda',
545
-	'item_mots_cles_association_articles' => 'às matérias',
546
-	'item_mots_cles_association_rubriques' => 'às seções',
547
-	'item_mots_cles_association_sites' => 'aos sites referenciados ou sindicados.',
548
-	'item_non' => 'Não',
549
-	'item_non_accepter_inscriptions' => 'Não aceitar inscrições',
550
-	'item_non_activer_messages_avertissement' => 'Sem mensagens de aviso',
551
-	'item_non_afficher_calendrier' => 'Não exibir no calendário',
552
-	'item_non_autoriser_syndication_integrale' => 'Difundir apenas um resumo',
553
-	'item_non_creer_fichiers_authent' => 'Não criar os arquivos',
554
-	'item_non_messagerie_agenda' => 'Desativar as mensagens internas e a agenda',
555
-	'item_non_publier_articles' => 'Não publicar as matérias antes da data de publicação fixada.',
556
-	'item_nouvel_auteur' => 'Novo autor',
557
-	'item_nouvelle_rubrique' => 'Nova seção',
558
-	'item_oui' => 'Sim',
559
-	'item_publier_articles' => 'Publicar as matérias seja qual for a sua data de publicação.',
560
-	'item_reponse_article' => 'Resposta à matéria',
561
-	'item_visiteur' => 'Visitante',
486
+    'info_traductions' => 'Traduções',
487
+    'info_travail_colaboratif' => 'Trabalho colaborativo nas matérias',
488
+    'info_un_article' => 'uma matéria,',
489
+    'info_un_site' => 'um site,',
490
+    'info_une_rubrique' => 'uma seção,',
491
+    'info_une_rubrique_02' => '1 seção',
492
+    'info_url' => 'URL:',
493
+    'info_url_proxy' => 'URL do proxy',
494
+    'info_url_proxy_pas_conforme' => 'O URL do proxy não é válido.',
495
+    'info_url_site_pas_conforme' => 'O URL do site não é válido.',
496
+    'info_url_test_proxy' => 'URL de teste',
497
+    'info_urlref' => 'Link hipertexto:',
498
+    'info_utilisation_spip' => 'Você pode agora começar a utilizar o sistema de publicação assistida...',
499
+    'info_visites_par_mois' => 'Exibir por mês:',
500
+    'info_visiteur_1' => 'Visitante',
501
+    'info_visiteur_2' => 'do site público',
502
+    'info_visiteurs' => 'Visitantes',
503
+    'info_visiteurs_02' => 'Visitantes do site público',
504
+    'info_webmestre_forces' => 'Os webmasters são definidos em <tt>@file_options@</tt>.',
505
+    'install_adresse_base_hebergeur' => 'Endereço da base de dados atribuído pelo serviço de hospedagem:',
506
+    'install_connect_ok' => 'A nova base de dados foi corretamente declarada sob o nome de servidor @connect@.',
507
+    'install_echec_annonce' => 'A instalação irá, provavelmente, falhar, ou levar a um site que não funciona...',
508
+    'install_extension_mbstring' => 'O SPIP não funciona com:',
509
+    'install_extension_php_obligatoire' => 'O SPIP exige a extensão php:',
510
+    'install_login_base_hebergeur' => 'Login de conexão atribuído pelo serviço de hospedagem:',
511
+    'install_nom_base_hebergeur' => 'Nome da base atribuído pelo serviço de hospedagem:',
512
+    'install_pas_table' => 'Base atualmente sem tabelas',
513
+    'install_pass_base_hebergeur' => 'Senha de conexão atribuída pelo serviço de hospedagem',
514
+    'install_php_extension' => 'As extensões a seguir estão faltando: @extensions@',
515
+    'install_php_version' => 'PHP versão @version@ é insuficiente (mínimo = @minimum@)',
516
+    'install_php_version_max' => 'A versão @version@ do PHP é muito recente (máximo = @maximum@)',
517
+    'install_select_langue' => 'Escolha um idioma e clique no botão «avançar» para iniciar o procedimento de instalação.',
518
+    'install_select_type_db' => 'Indicar o tipo de base de dados:',
519
+    'install_select_type_mysql' => 'MySQL',
520
+    'install_select_type_pg' => 'PostgreSQL',
521
+    'install_select_type_sqlite2' => 'SQLite 2',
522
+    'install_select_type_sqlite3' => 'SQLite 3',
523
+    'install_serveur_hebergeur' => 'Servidor de base de dados atribuído pelo serviço de hospedagem',
524
+    'install_table_prefix_hebergeur' => 'Prefixo de tabela atribuído pelo serviço de hospedagem:',
525
+    'install_tables_base' => 'Tabelas da base',
526
+    'install_types_db_connus' => 'SPIP pode usar <b>MySQL</b> (a mais comum), e <b>SQLite</b>.',
527
+    'install_types_db_connus_avertissement' => 'O suporte ao <b>PostgreSQL</b> é também proposto a título experimental',
528
+    'instituer_erreur_statut_a_change' => 'O status já foi alterado',
529
+    'instituer_erreur_statut_non_autorise' => 'Você não pode escolher este status',
530
+    'intem_redacteur' => 'redator',
531
+    'intitule_licence' => 'Licença',
532
+    'item_accepter_inscriptions' => 'Aceitar as inscrições',
533
+    'item_activer_messages_avertissement' => 'Ativar as mensagens de aviso',
534
+    'item_administrateur_2' => 'administrador',
535
+    'item_afficher_calendrier' => 'Exibir no calendário',
536
+    'item_autoriser_syndication_integrale' => 'Difundir a íntegra das matérias nos arquivos de sindicação',
537
+    'item_choix_administrateurs' => 'os administradores',
538
+    'item_choix_generation_miniature' => 'Gerar automaticamente as miniaturas das imagens.',
539
+    'item_choix_non_generation_miniature' => 'Não gerar as miniaturas das imagens.',
540
+    'item_choix_redacteurs' => 'os redatores',
541
+    'item_choix_visiteurs' => 'os visitantes do site público',
542
+    'item_creer_fichiers_authent' => 'Criar os arquivos .htpasswd',
543
+    'item_login' => 'Login',
544
+    'item_messagerie_agenda' => 'Ativar as mesagens internas e a agenda',
545
+    'item_mots_cles_association_articles' => 'às matérias',
546
+    'item_mots_cles_association_rubriques' => 'às seções',
547
+    'item_mots_cles_association_sites' => 'aos sites referenciados ou sindicados.',
548
+    'item_non' => 'Não',
549
+    'item_non_accepter_inscriptions' => 'Não aceitar inscrições',
550
+    'item_non_activer_messages_avertissement' => 'Sem mensagens de aviso',
551
+    'item_non_afficher_calendrier' => 'Não exibir no calendário',
552
+    'item_non_autoriser_syndication_integrale' => 'Difundir apenas um resumo',
553
+    'item_non_creer_fichiers_authent' => 'Não criar os arquivos',
554
+    'item_non_messagerie_agenda' => 'Desativar as mensagens internas e a agenda',
555
+    'item_non_publier_articles' => 'Não publicar as matérias antes da data de publicação fixada.',
556
+    'item_nouvel_auteur' => 'Novo autor',
557
+    'item_nouvelle_rubrique' => 'Nova seção',
558
+    'item_oui' => 'Sim',
559
+    'item_publier_articles' => 'Publicar as matérias seja qual for a sua data de publicação.',
560
+    'item_reponse_article' => 'Resposta à matéria',
561
+    'item_visiteur' => 'Visitante',
562 562
 
563
-	// J
564
-	'jour_non_connu_nc' => 'n.c.',
563
+    // J
564
+    'jour_non_connu_nc' => 'n.c.',
565 565
 
566
-	// L
567
-	'label_bando_outils' => 'Barra de ferramentas',
568
-	'label_bando_outils_afficher' => 'Exibir as ferramentas',
569
-	'label_bando_outils_masquer' => 'Esconder as ferramentas',
570
-	'label_choix_langue' => 'Escolha o seu idioma',
571
-	'label_langue' => 'Idioma',
572
-	'label_nom_fichier_connect' => 'Informe o nome usado por este servidor',
573
-	'label_slogan_site' => 'Slogan do site',
574
-	'label_taille_ecran' => 'Largura da tela',
575
-	'label_texte_et_icones_navigation' => 'Menu de navegação',
576
-	'label_texte_et_icones_page' => 'Exibição na página',
577
-	'ldap_correspondance' => 'herança do campo @champ@',
578
-	'ldap_correspondance_1' => 'Herança dos campos LDAP',
579
-	'ldap_correspondance_2' => 'Para cada um dos campos SPIP a seguir, indique o nome do campo LDAP correspondente. Deixe em branco para não preencher, separe por espaços ou vírgulas para tentar vários campos LDAP.',
580
-	'lien_ajouter_auteur' => 'Incluir este autor',
581
-	'lien_ajouter_une_rubrique' => 'Incluir esta seção',
582
-	'lien_email' => 'e-mail',
583
-	'lien_nom_site' => 'NOME DO SITE:',
584
-	'lien_rapide_contenu' => 'Ir para o conteúdo',
585
-	'lien_rapide_navigation' => 'Ir para a navegação',
586
-	'lien_rapide_recherche' => 'Ir para a busca',
587
-	'lien_retirer_auteur' => 'Retirar o autor',
588
-	'lien_retirer_rubrique' => 'Excluir a seção',
589
-	'lien_retirer_tous_auteurs' => 'Retirar todos os autores',
590
-	'lien_retirer_toutes_rubriques' => 'Retirar todas as seções',
591
-	'lien_site' => 'site',
592
-	'lien_tout_decocher' => 'Desmarcar tudo',
593
-	'lien_tout_deplier' => 'Expandir tudo',
594
-	'lien_tout_replier' => 'Retrair tudo',
595
-	'lien_tout_supprimer' => 'Excluir tudo',
596
-	'lien_trier_nom' => 'Ordenar pelo nome',
597
-	'lien_trier_nombre_articles' => 'Ordenar por número de matérias',
598
-	'lien_trier_statut' => 'Ordenar pelo status',
599
-	'lien_voir_en_ligne' => 'VER ONLINE:',
600
-	'logo_article' => 'Ícone da matéria',
601
-	'logo_auteur' => 'Ícone do autor',
602
-	'logo_rubrique' => 'Ícone da seção',
603
-	'logo_site' => 'Ícone deste site',
604
-	'logo_standard_rubrique' => 'Ícone padrão das seções',
605
-	'logo_survol' => 'Ícone para mouseOver',
566
+    // L
567
+    'label_bando_outils' => 'Barra de ferramentas',
568
+    'label_bando_outils_afficher' => 'Exibir as ferramentas',
569
+    'label_bando_outils_masquer' => 'Esconder as ferramentas',
570
+    'label_choix_langue' => 'Escolha o seu idioma',
571
+    'label_langue' => 'Idioma',
572
+    'label_nom_fichier_connect' => 'Informe o nome usado por este servidor',
573
+    'label_slogan_site' => 'Slogan do site',
574
+    'label_taille_ecran' => 'Largura da tela',
575
+    'label_texte_et_icones_navigation' => 'Menu de navegação',
576
+    'label_texte_et_icones_page' => 'Exibição na página',
577
+    'ldap_correspondance' => 'herança do campo @champ@',
578
+    'ldap_correspondance_1' => 'Herança dos campos LDAP',
579
+    'ldap_correspondance_2' => 'Para cada um dos campos SPIP a seguir, indique o nome do campo LDAP correspondente. Deixe em branco para não preencher, separe por espaços ou vírgulas para tentar vários campos LDAP.',
580
+    'lien_ajouter_auteur' => 'Incluir este autor',
581
+    'lien_ajouter_une_rubrique' => 'Incluir esta seção',
582
+    'lien_email' => 'e-mail',
583
+    'lien_nom_site' => 'NOME DO SITE:',
584
+    'lien_rapide_contenu' => 'Ir para o conteúdo',
585
+    'lien_rapide_navigation' => 'Ir para a navegação',
586
+    'lien_rapide_recherche' => 'Ir para a busca',
587
+    'lien_retirer_auteur' => 'Retirar o autor',
588
+    'lien_retirer_rubrique' => 'Excluir a seção',
589
+    'lien_retirer_tous_auteurs' => 'Retirar todos os autores',
590
+    'lien_retirer_toutes_rubriques' => 'Retirar todas as seções',
591
+    'lien_site' => 'site',
592
+    'lien_tout_decocher' => 'Desmarcar tudo',
593
+    'lien_tout_deplier' => 'Expandir tudo',
594
+    'lien_tout_replier' => 'Retrair tudo',
595
+    'lien_tout_supprimer' => 'Excluir tudo',
596
+    'lien_trier_nom' => 'Ordenar pelo nome',
597
+    'lien_trier_nombre_articles' => 'Ordenar por número de matérias',
598
+    'lien_trier_statut' => 'Ordenar pelo status',
599
+    'lien_voir_en_ligne' => 'VER ONLINE:',
600
+    'logo_article' => 'Ícone da matéria',
601
+    'logo_auteur' => 'Ícone do autor',
602
+    'logo_rubrique' => 'Ícone da seção',
603
+    'logo_site' => 'Ícone deste site',
604
+    'logo_standard_rubrique' => 'Ícone padrão das seções',
605
+    'logo_survol' => 'Ícone para mouseOver',
606 606
 
607
-	// M
608
-	'menu_aide_installation_choix_base' => 'Seleção da sua base',
609
-	'module_fichier_langue' => 'Arquivo de idioma',
610
-	'module_raccourci' => 'Atalho',
611
-	'module_texte_affiche' => 'Texto exibido',
612
-	'module_texte_explicatif' => 'Você pode inserir os atalhos a seguir nos templates do seu site público. Eles serão traduzidos automaticamente para os idiomas para os quais exista um arquivo de idioma.',
613
-	'module_texte_traduction' => 'O arquivo de idioma «@module@» está disponível em:',
614
-	'mois_non_connu' => 'desconhecido',
607
+    // M
608
+    'menu_aide_installation_choix_base' => 'Seleção da sua base',
609
+    'module_fichier_langue' => 'Arquivo de idioma',
610
+    'module_raccourci' => 'Atalho',
611
+    'module_texte_affiche' => 'Texto exibido',
612
+    'module_texte_explicatif' => 'Você pode inserir os atalhos a seguir nos templates do seu site público. Eles serão traduzidos automaticamente para os idiomas para os quais exista um arquivo de idioma.',
613
+    'module_texte_traduction' => 'O arquivo de idioma «@module@» está disponível em:',
614
+    'mois_non_connu' => 'desconhecido',
615 615
 
616
-	// N
617
-	'nouvelle_version_spip' => 'A versão @version@ do SPIP está disponível',
618
-	'nouvelle_version_spip_majeure' => 'Uma nova versão SPIP @version@ está disponível',
616
+    // N
617
+    'nouvelle_version_spip' => 'A versão @version@ do SPIP está disponível',
618
+    'nouvelle_version_spip_majeure' => 'Uma nova versão SPIP @version@ está disponível',
619 619
 
620
-	// O
621
-	'onglet_contenu' => 'Conteúdo',
622
-	'onglet_declarer_une_autre_base' => 'Configurar outra base',
623
-	'onglet_discuter' => 'Discutir',
624
-	'onglet_interactivite' => 'Interatividade',
625
-	'onglet_proprietes' => 'Propriedades',
626
-	'onglet_repartition_actuelle' => 'atualmente',
627
-	'onglet_sous_rubriques' => 'Subseções',
620
+    // O
621
+    'onglet_contenu' => 'Conteúdo',
622
+    'onglet_declarer_une_autre_base' => 'Configurar outra base',
623
+    'onglet_discuter' => 'Discutir',
624
+    'onglet_interactivite' => 'Interatividade',
625
+    'onglet_proprietes' => 'Propriedades',
626
+    'onglet_repartition_actuelle' => 'atualmente',
627
+    'onglet_sous_rubriques' => 'Subseções',
628 628
 
629
-	// P
630
-	'page_pas_proxy' => 'Esta página não deve passar pelo proxy',
631
-	'pas_de_proxy_pour' => 'Se necessário, indique as máquinas ou domínios para os quais este proxy não se aplica (por exemplo: @exemple@)',
632
-	'phpinfo' => 'Configuração PHP',
633
-	'plugin_charge_paquet' => 'Carregamento do pacote @name@',
634
-	'plugin_charger' => 'Transferir',
635
-	'plugin_erreur_charger' => 'erro: não foi possível carregar @zip@',
636
-	'plugin_erreur_droit1' => 'O diretório <code>@dest@</code> não está acessível para escrita.',
637
-	'plugin_erreur_droit2' => 'Por favor, verifique os direitos deste diretório (e criá-lo, caso não exista), ou instalar os arquivos por FTP.',
638
-	'plugin_erreur_zip' => 'falha pclzip: erro @status@',
639
-	'plugin_etat_developpement' => 'em desenvolvimento',
640
-	'plugin_etat_experimental' => 'experimental',
641
-	'plugin_etat_stable' => 'estável',
642
-	'plugin_etat_test' => 'em teste',
643
-	'plugin_impossible_activer' => 'Não foi possível ativar o plugin @plugin@',
644
-	'plugin_info_automatique1' => 'Se você deseja autorizar a instalaçào automática dos plugins, por favor:',
645
-	'plugin_info_automatique1_lib' => 'Se você deseja autorizar a instalação automática desta biblioteca, por favor:',
646
-	'plugin_info_automatique2' => 'crie um diretório <code>@rep@</code> ;',
647
-	'plugin_info_automatique3' => 'verifique se o servidor está autorizado a escrever neste diretório',
648
-	'plugin_info_automatique_creer' => 'a ser criado na raiz do site.',
649
-	'plugin_info_automatique_exemples' => 'exemplos:',
650
-	'plugin_info_automatique_ftp' => 'Você pode instalar os plugins, por FTP, no diretório <tt>@rep@</tt>',
651
-	'plugin_info_automatique_lib' => 'Alguns plugins precisam também poder transferir arquivos para o diretório <code>lib/</code>, a ser criado, caso não exista, na raiz do site.',
652
-	'plugin_info_automatique_liste' => 'Suas listas de plugins:',
653
-	'plugin_info_automatique_liste_officielle' => 'os plugins oficiais',
654
-	'plugin_info_automatique_liste_update' => 'Atualizar as listas',
655
-	'plugin_info_automatique_ou' => 'ou...',
656
-	'plugin_info_automatique_select' => 'Selecione abaixo um plugin: O SPIP o transferirá e o instalará no diretório <code>@rep@</code>; se o plugin já existir, será atualizado.',
657
-	'plugin_info_credit' => 'Créditos',
658
-	'plugin_info_erreur_xml' => 'A declaração deste plugin está incorreta',
659
-	'plugin_info_install_ok' => 'Instalação bem sucedida',
660
-	'plugin_info_necessite' => 'Requer:',
661
-	'plugin_info_non_compatible_spip' => 'Este plugin não é compatível com esta versão do SPIP',
662
-	'plugin_info_plugins_dist_1' => 'Os plugins abaixo são carregados e ativados no diretório @plugins_dist@.',
663
-	'plugin_info_plugins_dist_2' => 'Eles não são desativáveis.',
664
-	'plugin_info_telecharger' => 'transferir de @url@ e instalar em @rep@',
665
-	'plugin_info_upgrade_ok' => 'Atualização bem sucedida',
666
-	'plugin_librairies_installees' => 'Bibliotecas instaladas',
667
-	'plugin_necessite_extension_php' => 'Requer a extensão PHP @plugin@ na versão @version@.',
668
-	'plugin_necessite_extension_php_sans_version' => 'Requer a extensão PHP @plugin@',
669
-	'plugin_necessite_lib' => 'Este plugin precisa da biblioteca @lib@',
670
-	'plugin_necessite_php' => 'Requer @plugin@ na versão @version@.',
671
-	'plugin_necessite_plugin' => 'Precisa do plugin @plugin@, na versão @version@.',
672
-	'plugin_necessite_plugin_sans_version' => 'Precisa do plugin @plugin@',
673
-	'plugin_necessite_spip' => 'É necessário o SPIP na versão @version@, pelo menos.',
674
-	'plugin_source' => 'fonte: ',
675
-	'plugin_titre_automatique' => 'Instalação automática',
676
-	'plugin_titre_automatique_ajouter' => 'Incluir plugins',
677
-	'plugin_titre_installation' => 'Instalação do plugin @plugin@',
678
-	'plugin_titre_modifier' => 'Meus plugins',
679
-	'plugin_utilise_extension_php' => 'A extensão PHP @plugin@ deve estar na versão @version@.',
680
-	'plugin_utilise_php' => '@plugin@ deve estar na versão @version@.',
681
-	'plugin_utilise_plugin' => 'O plugin @plugin@ deve estar na versão @version@.',
682
-	'plugin_zip_active' => 'Continue para o ativar',
683
-	'plugin_zip_adresse' => 'Indique abaixo o endereço de um arquivo zip de plugin a ser transferido, ou ainda o endereço de uma lista de plugins.',
684
-	'plugin_zip_adresse_champ' => 'Endereço do plugin ou da lista',
685
-	'plugin_zip_content' => 'Ele contém os arquivos a seguir (@taille@),<br />prontos para serem instalados no diretório <code>@rep@</code>',
686
-	'plugin_zip_installe_finie' => 'O arquivo @zip@ foi descompactado e instalado.',
687
-	'plugin_zip_installe_rep_finie' => 'O arquivo @zip@ foi descompactado e instalado no diretório @rep@',
688
-	'plugin_zip_installer' => 'Você pode, agora, instalá-lo.',
689
-	'plugin_zip_telecharge' => 'O arquivo @zip@ foi transferido',
690
-	'plugins_actif_aucun' => 'Nenhum plugin ativado.',
691
-	'plugins_actif_un' => 'Um plugin ativado.',
692
-	'plugins_actifs' => '@count@ plugins ativados.',
693
-	'plugins_actifs_liste' => 'Ativos',
694
-	'plugins_compte' => '@count@ plugins',
695
-	'plugins_disponible_un' => 'Um plugin disponível.',
696
-	'plugins_disponibles' => '@count@ plugins disponiveis.',
697
-	'plugins_erreur' => 'Erro nos plugins: @plugins@',
698
-	'plugins_liste' => 'Lista dos plugins',
699
-	'plugins_liste_dist' => 'Plugins bloqueados',
700
-	'plugins_recents' => 'Plugins recentes.',
701
-	'plugins_tous_liste' => 'Todos',
702
-	'plugins_vue_hierarchie' => 'Hierarquia',
703
-	'plugins_vue_liste' => 'Lista',
704
-	'protocole_ldap' => 'Versão do protocolo:',
629
+    // P
630
+    'page_pas_proxy' => 'Esta página não deve passar pelo proxy',
631
+    'pas_de_proxy_pour' => 'Se necessário, indique as máquinas ou domínios para os quais este proxy não se aplica (por exemplo: @exemple@)',
632
+    'phpinfo' => 'Configuração PHP',
633
+    'plugin_charge_paquet' => 'Carregamento do pacote @name@',
634
+    'plugin_charger' => 'Transferir',
635
+    'plugin_erreur_charger' => 'erro: não foi possível carregar @zip@',
636
+    'plugin_erreur_droit1' => 'O diretório <code>@dest@</code> não está acessível para escrita.',
637
+    'plugin_erreur_droit2' => 'Por favor, verifique os direitos deste diretório (e criá-lo, caso não exista), ou instalar os arquivos por FTP.',
638
+    'plugin_erreur_zip' => 'falha pclzip: erro @status@',
639
+    'plugin_etat_developpement' => 'em desenvolvimento',
640
+    'plugin_etat_experimental' => 'experimental',
641
+    'plugin_etat_stable' => 'estável',
642
+    'plugin_etat_test' => 'em teste',
643
+    'plugin_impossible_activer' => 'Não foi possível ativar o plugin @plugin@',
644
+    'plugin_info_automatique1' => 'Se você deseja autorizar a instalaçào automática dos plugins, por favor:',
645
+    'plugin_info_automatique1_lib' => 'Se você deseja autorizar a instalação automática desta biblioteca, por favor:',
646
+    'plugin_info_automatique2' => 'crie um diretório <code>@rep@</code> ;',
647
+    'plugin_info_automatique3' => 'verifique se o servidor está autorizado a escrever neste diretório',
648
+    'plugin_info_automatique_creer' => 'a ser criado na raiz do site.',
649
+    'plugin_info_automatique_exemples' => 'exemplos:',
650
+    'plugin_info_automatique_ftp' => 'Você pode instalar os plugins, por FTP, no diretório <tt>@rep@</tt>',
651
+    'plugin_info_automatique_lib' => 'Alguns plugins precisam também poder transferir arquivos para o diretório <code>lib/</code>, a ser criado, caso não exista, na raiz do site.',
652
+    'plugin_info_automatique_liste' => 'Suas listas de plugins:',
653
+    'plugin_info_automatique_liste_officielle' => 'os plugins oficiais',
654
+    'plugin_info_automatique_liste_update' => 'Atualizar as listas',
655
+    'plugin_info_automatique_ou' => 'ou...',
656
+    'plugin_info_automatique_select' => 'Selecione abaixo um plugin: O SPIP o transferirá e o instalará no diretório <code>@rep@</code>; se o plugin já existir, será atualizado.',
657
+    'plugin_info_credit' => 'Créditos',
658
+    'plugin_info_erreur_xml' => 'A declaração deste plugin está incorreta',
659
+    'plugin_info_install_ok' => 'Instalação bem sucedida',
660
+    'plugin_info_necessite' => 'Requer:',
661
+    'plugin_info_non_compatible_spip' => 'Este plugin não é compatível com esta versão do SPIP',
662
+    'plugin_info_plugins_dist_1' => 'Os plugins abaixo são carregados e ativados no diretório @plugins_dist@.',
663
+    'plugin_info_plugins_dist_2' => 'Eles não são desativáveis.',
664
+    'plugin_info_telecharger' => 'transferir de @url@ e instalar em @rep@',
665
+    'plugin_info_upgrade_ok' => 'Atualização bem sucedida',
666
+    'plugin_librairies_installees' => 'Bibliotecas instaladas',
667
+    'plugin_necessite_extension_php' => 'Requer a extensão PHP @plugin@ na versão @version@.',
668
+    'plugin_necessite_extension_php_sans_version' => 'Requer a extensão PHP @plugin@',
669
+    'plugin_necessite_lib' => 'Este plugin precisa da biblioteca @lib@',
670
+    'plugin_necessite_php' => 'Requer @plugin@ na versão @version@.',
671
+    'plugin_necessite_plugin' => 'Precisa do plugin @plugin@, na versão @version@.',
672
+    'plugin_necessite_plugin_sans_version' => 'Precisa do plugin @plugin@',
673
+    'plugin_necessite_spip' => 'É necessário o SPIP na versão @version@, pelo menos.',
674
+    'plugin_source' => 'fonte: ',
675
+    'plugin_titre_automatique' => 'Instalação automática',
676
+    'plugin_titre_automatique_ajouter' => 'Incluir plugins',
677
+    'plugin_titre_installation' => 'Instalação do plugin @plugin@',
678
+    'plugin_titre_modifier' => 'Meus plugins',
679
+    'plugin_utilise_extension_php' => 'A extensão PHP @plugin@ deve estar na versão @version@.',
680
+    'plugin_utilise_php' => '@plugin@ deve estar na versão @version@.',
681
+    'plugin_utilise_plugin' => 'O plugin @plugin@ deve estar na versão @version@.',
682
+    'plugin_zip_active' => 'Continue para o ativar',
683
+    'plugin_zip_adresse' => 'Indique abaixo o endereço de um arquivo zip de plugin a ser transferido, ou ainda o endereço de uma lista de plugins.',
684
+    'plugin_zip_adresse_champ' => 'Endereço do plugin ou da lista',
685
+    'plugin_zip_content' => 'Ele contém os arquivos a seguir (@taille@),<br />prontos para serem instalados no diretório <code>@rep@</code>',
686
+    'plugin_zip_installe_finie' => 'O arquivo @zip@ foi descompactado e instalado.',
687
+    'plugin_zip_installe_rep_finie' => 'O arquivo @zip@ foi descompactado e instalado no diretório @rep@',
688
+    'plugin_zip_installer' => 'Você pode, agora, instalá-lo.',
689
+    'plugin_zip_telecharge' => 'O arquivo @zip@ foi transferido',
690
+    'plugins_actif_aucun' => 'Nenhum plugin ativado.',
691
+    'plugins_actif_un' => 'Um plugin ativado.',
692
+    'plugins_actifs' => '@count@ plugins ativados.',
693
+    'plugins_actifs_liste' => 'Ativos',
694
+    'plugins_compte' => '@count@ plugins',
695
+    'plugins_disponible_un' => 'Um plugin disponível.',
696
+    'plugins_disponibles' => '@count@ plugins disponiveis.',
697
+    'plugins_erreur' => 'Erro nos plugins: @plugins@',
698
+    'plugins_liste' => 'Lista dos plugins',
699
+    'plugins_liste_dist' => 'Plugins bloqueados',
700
+    'plugins_recents' => 'Plugins recentes.',
701
+    'plugins_tous_liste' => 'Todos',
702
+    'plugins_vue_hierarchie' => 'Hierarquia',
703
+    'plugins_vue_liste' => 'Lista',
704
+    'protocole_ldap' => 'Versão do protocolo:',
705 705
 
706
-	// Q
707
-	'queue_executer_maintenant' => 'Executar agora',
708
-	'queue_info_purger' => 'Você pode excluir todas as tarefas de fundo em espera e reinicializar a lista com as tarefas periódicas',
709
-	'queue_nb_jobs_in_queue' => '@nb@ tarefas em espera',
710
-	'queue_next_job_in_nb_sec' => 'Próxima tarefa em @nb@ s',
711
-	'queue_no_job_in_queue' => 'Nenhum tarefa em espera',
712
-	'queue_one_job_in_queue' => '1 tarefa em espera',
713
-	'queue_priorite_tache' => 'prioridade',
714
-	'queue_purger_queue' => 'Reiniciar a lista de tarefas',
715
-	'queue_titre' => 'Tarefas de fundo',
706
+    // Q
707
+    'queue_executer_maintenant' => 'Executar agora',
708
+    'queue_info_purger' => 'Você pode excluir todas as tarefas de fundo em espera e reinicializar a lista com as tarefas periódicas',
709
+    'queue_nb_jobs_in_queue' => '@nb@ tarefas em espera',
710
+    'queue_next_job_in_nb_sec' => 'Próxima tarefa em @nb@ s',
711
+    'queue_no_job_in_queue' => 'Nenhum tarefa em espera',
712
+    'queue_one_job_in_queue' => '1 tarefa em espera',
713
+    'queue_priorite_tache' => 'prioridade',
714
+    'queue_purger_queue' => 'Reiniciar a lista de tarefas',
715
+    'queue_titre' => 'Tarefas de fundo',
716 716
 
717
-	// R
718
-	'repertoire_plugins' => 'Diretório:',
719
-	'required' => '(obrigatório)',
717
+    // R
718
+    'repertoire_plugins' => 'Diretório:',
719
+    'required' => '(obrigatório)',
720 720
 
721
-	// S
722
-	'sans_heure' => 'sem hora',
723
-	'statut_admin_restreint' => '(admin limitado)',
724
-	'statut_webmestre' => 'webmaster',
721
+    // S
722
+    'sans_heure' => 'sem hora',
723
+    'statut_admin_restreint' => '(admin limitado)',
724
+    'statut_webmestre' => 'webmaster',
725 725
 
726
-	// T
727
-	'tache_cron_asap' => 'Tarefa CRON @function@ (ASAP)',
728
-	'tache_cron_secondes' => 'Tarefa CRON @function@ (a cada @nb@ s)',
729
-	'taille_cache_image' => 'As imagens calculadas automaticamente pelo SPIP (ícones de documentos, títulos apresentados sob a forma gráfica, funções matemáticas em formato TeX...) ocupam, no diretório @dir@, um total de @taille@.',
730
-	'taille_cache_moins_de' => 'O tamanho do cache é menor do que @octets@.',
731
-	'taille_cache_octets' => 'O tamanho atual do cache é de cerca de @octets@.',
732
-	'taille_cache_vide' => 'O cache está vazio.',
733
-	'taille_repertoire_cache' => 'Tamanho do diretório cache',
734
-	'text_article_propose_publication' => 'Matéria proposta para publicação.',
735
-	'texte_acces_ldap_anonyme_1' => 'Alguns servidores LDAP não aceitam nenhum acesso anônimo. Neste caso, é necessário especificar um identificador de acesso inicial de modo a poder, em seguida, pesquisar as informações no diretório. Na maior parte dos casos, entretanto, os campos a seguir poderão ser deixados em branco.',
736
-	'texte_admin_effacer_01' => 'Este comando apaga <i>todo</i> o conteúdo da base de dados,incluindo <i>todos</i> os acessos dos redatores e administradores. Após executá-lo, você deverá reinstalar o SPIP para recriar uma nova base de dados bem como um acesso inicial de administrador.',
737
-	'texte_adresse_annuaire_1' => '(Se o seu diretório está instalado na mesma máquina que este website, trata-se provavelmente de «localhost».)',
738
-	'texte_ajout_auteur' => 'O autor a seguir foi incluído na matéria:',
739
-	'texte_annuaire_ldap_1' => 'Se você tem acesso a um diretório LDAP, você poderá utilizá-lo para importar automaticamente os usuários para o SPIP.',
740
-	'texte_article_statut' => 'Esta matéria está:',
741
-	'texte_article_virtuel' => 'Matéria virtual',
742
-	'texte_article_virtuel_reference' => '<b>Matéria virtual:</b> matéria referenciada no seu site SPIP, mas redirecionada para um outro URL. Para cancelar o redirecionamento, apague o URL abaixo.',
743
-	'texte_aucun_resultat_auteur' => 'Nenhum resultado para "@cherche_auteur@"',
744
-	'texte_auteur_messagerie' => 'Este site pode monitorar permanentemente a lista de editores conectados, permitindo-lhe trocar mensagens em tempo real. Você pode decidir não aparecer nessa lista (ficando "invisível" para os outros usuários).',
745
-	'texte_auteurs' => 'OS AUTORES',
746
-	'texte_choix_base_1' => 'Escolha a sua base:',
747
-	'texte_choix_base_2' => 'O servidor SQL contém várias bases de dados.',
748
-	'texte_choix_base_3' => '<b>Escolha</b> abaixo a que lhe foi atribuída pelo seu serviço de hospedagem:',
749
-	'texte_choix_table_prefix' => 'Prefixo das tabelas:',
750
-	'texte_compte_element' => '@count@ elemento',
751
-	'texte_compte_elements' => '@count@ elementos',
752
-	'texte_conflit_edition_correction' => 'Por favor, controle abaixo as diferenças entre as duas versões do texto; você pode também copiar as suas modificações e depois recomeçar.',
753
-	'texte_connexion_mysql' => 'Consulte as informações fornecidas pelo seu serviço de hospedagem: nelas, você deverá encontrar o servidor de base de dados fornecido e os seus dados de conexão ao servidor SQL.',
754
-	'texte_contenu_article' => '(Conteúdo da matéria em poucas palavras.)',
755
-	'texte_contenu_articles' => 'De acordo com o layout adotado pelo seu site, você poderá decidir se certos elementos das matérias serão utilizados. Use a listagem abaixo para indicar quais elementos estão disponíveis.',
756
-	'texte_crash_base' => 'Se a sua base de dados se corrompeu, você poderá tentar uma reparação automática.',
757
-	'texte_creer_rubrique' => 'Antes de poder escrever matérias, você precisa criar uma seção.',
758
-	'texte_date_creation_article' => 'DATA DE CRIAÇÃO DA MATÉRIA:',
759
-	'texte_date_creation_objet' => 'Data de criação:', # on ajoute le &quot;:&quot;
760
-	'texte_date_publication_anterieure' => 'Data de redação anterior:',
761
-	'texte_date_publication_anterieure_nonaffichee' => 'Não exibir a data de redação anterior.',
762
-	'texte_date_publication_article' => 'DATA DE PUBLICAÇÃO ONLINE:',
763
-	'texte_date_publication_objet' => 'Data de publicação online:',
764
-	'texte_definir_comme_traduction_rubrique' => 'Esta seção é uma tradução da seção número:',
765
-	'texte_descriptif_rapide' => 'Descrição rápida',
766
-	'texte_effacer_base' => 'Apagar a base de dados do SPIP',
767
-	'texte_effacer_statistiques' => 'Apagar as estatísticas',
768
-	'texte_en_cours_validation' => 'Os conteúdos abaixo estão propostos para publicação.',
769
-	'texte_enrichir_mise_a_jour' => 'Você pode enriquecer a diagramação do seu texto usando «atalhos tipográficos».',
770
-	'texte_fichier_authent' => '<b>O SPIP pode criar os arquivos especiais  <tt>.htpasswd</tt> e <tt>.htpasswd-admin</tt> no diretório @dossier@?</b><p>
726
+    // T
727
+    'tache_cron_asap' => 'Tarefa CRON @function@ (ASAP)',
728
+    'tache_cron_secondes' => 'Tarefa CRON @function@ (a cada @nb@ s)',
729
+    'taille_cache_image' => 'As imagens calculadas automaticamente pelo SPIP (ícones de documentos, títulos apresentados sob a forma gráfica, funções matemáticas em formato TeX...) ocupam, no diretório @dir@, um total de @taille@.',
730
+    'taille_cache_moins_de' => 'O tamanho do cache é menor do que @octets@.',
731
+    'taille_cache_octets' => 'O tamanho atual do cache é de cerca de @octets@.',
732
+    'taille_cache_vide' => 'O cache está vazio.',
733
+    'taille_repertoire_cache' => 'Tamanho do diretório cache',
734
+    'text_article_propose_publication' => 'Matéria proposta para publicação.',
735
+    'texte_acces_ldap_anonyme_1' => 'Alguns servidores LDAP não aceitam nenhum acesso anônimo. Neste caso, é necessário especificar um identificador de acesso inicial de modo a poder, em seguida, pesquisar as informações no diretório. Na maior parte dos casos, entretanto, os campos a seguir poderão ser deixados em branco.',
736
+    'texte_admin_effacer_01' => 'Este comando apaga <i>todo</i> o conteúdo da base de dados,incluindo <i>todos</i> os acessos dos redatores e administradores. Após executá-lo, você deverá reinstalar o SPIP para recriar uma nova base de dados bem como um acesso inicial de administrador.',
737
+    'texte_adresse_annuaire_1' => '(Se o seu diretório está instalado na mesma máquina que este website, trata-se provavelmente de «localhost».)',
738
+    'texte_ajout_auteur' => 'O autor a seguir foi incluído na matéria:',
739
+    'texte_annuaire_ldap_1' => 'Se você tem acesso a um diretório LDAP, você poderá utilizá-lo para importar automaticamente os usuários para o SPIP.',
740
+    'texte_article_statut' => 'Esta matéria está:',
741
+    'texte_article_virtuel' => 'Matéria virtual',
742
+    'texte_article_virtuel_reference' => '<b>Matéria virtual:</b> matéria referenciada no seu site SPIP, mas redirecionada para um outro URL. Para cancelar o redirecionamento, apague o URL abaixo.',
743
+    'texte_aucun_resultat_auteur' => 'Nenhum resultado para "@cherche_auteur@"',
744
+    'texte_auteur_messagerie' => 'Este site pode monitorar permanentemente a lista de editores conectados, permitindo-lhe trocar mensagens em tempo real. Você pode decidir não aparecer nessa lista (ficando "invisível" para os outros usuários).',
745
+    'texte_auteurs' => 'OS AUTORES',
746
+    'texte_choix_base_1' => 'Escolha a sua base:',
747
+    'texte_choix_base_2' => 'O servidor SQL contém várias bases de dados.',
748
+    'texte_choix_base_3' => '<b>Escolha</b> abaixo a que lhe foi atribuída pelo seu serviço de hospedagem:',
749
+    'texte_choix_table_prefix' => 'Prefixo das tabelas:',
750
+    'texte_compte_element' => '@count@ elemento',
751
+    'texte_compte_elements' => '@count@ elementos',
752
+    'texte_conflit_edition_correction' => 'Por favor, controle abaixo as diferenças entre as duas versões do texto; você pode também copiar as suas modificações e depois recomeçar.',
753
+    'texte_connexion_mysql' => 'Consulte as informações fornecidas pelo seu serviço de hospedagem: nelas, você deverá encontrar o servidor de base de dados fornecido e os seus dados de conexão ao servidor SQL.',
754
+    'texte_contenu_article' => '(Conteúdo da matéria em poucas palavras.)',
755
+    'texte_contenu_articles' => 'De acordo com o layout adotado pelo seu site, você poderá decidir se certos elementos das matérias serão utilizados. Use a listagem abaixo para indicar quais elementos estão disponíveis.',
756
+    'texte_crash_base' => 'Se a sua base de dados se corrompeu, você poderá tentar uma reparação automática.',
757
+    'texte_creer_rubrique' => 'Antes de poder escrever matérias, você precisa criar uma seção.',
758
+    'texte_date_creation_article' => 'DATA DE CRIAÇÃO DA MATÉRIA:',
759
+    'texte_date_creation_objet' => 'Data de criação:', # on ajoute le &quot;:&quot;
760
+    'texte_date_publication_anterieure' => 'Data de redação anterior:',
761
+    'texte_date_publication_anterieure_nonaffichee' => 'Não exibir a data de redação anterior.',
762
+    'texte_date_publication_article' => 'DATA DE PUBLICAÇÃO ONLINE:',
763
+    'texte_date_publication_objet' => 'Data de publicação online:',
764
+    'texte_definir_comme_traduction_rubrique' => 'Esta seção é uma tradução da seção número:',
765
+    'texte_descriptif_rapide' => 'Descrição rápida',
766
+    'texte_effacer_base' => 'Apagar a base de dados do SPIP',
767
+    'texte_effacer_statistiques' => 'Apagar as estatísticas',
768
+    'texte_en_cours_validation' => 'Os conteúdos abaixo estão propostos para publicação.',
769
+    'texte_enrichir_mise_a_jour' => 'Você pode enriquecer a diagramação do seu texto usando «atalhos tipográficos».',
770
+    'texte_fichier_authent' => '<b>O SPIP pode criar os arquivos especiais  <tt>.htpasswd</tt> e <tt>.htpasswd-admin</tt> no diretório @dossier@?</b><p>
771 771
 Estes arquivos podem servir para restringir o acesso aos autores e administradores em outras áreas do seu site (programas externos de estatísticas, por exemplo).</p><p>
772 772
 Se eles não forem úteis, você poderá deixar esta opção com o seu valor padrão (sem criar os arquivos).</p>',
773
-	'texte_informations_personnelles_1' => 'O sistema vai criar agora um acesso personalizado ao site.',
774
-	'texte_informations_personnelles_2' => '(Nota: trata-se de uma reinstalação, se o seu acesso funciona corretamente, você pode',
775
-	'texte_introductif_article' => '(Texto introdutório da matéria.)',
776
-	'texte_jeu_caractere' => 'É aconselhável usar no seu site o alfabeto universal (<tt>utf-8</tt>): ele permite a exibição de textos em todos os idiomas, e não tem problemas de compatibilidade com os navegadores modernos.',
777
-	'texte_jeu_caractere_3' => 'O seu site está configurado atualmente com o conjunto de caracteres:',
778
-	'texte_jeu_caractere_4' => 'Se isso não corresponde à realidade dos seus dados (por ex., em seguimento a um restauro da base de dados), ou se <em>você lançou este site</em> e deseja utilizar um outro conjunto de caracteres, por favor, indique-o aqui:',
779
-	'texte_login_ldap_1' => '(Deixe em branco para acesso anônimo, ou informe o caminho completo, por exemplo «<tt>uid=dupont, ou=users, dc=mon-domaine, dc=com</tt>».)',
780
-	'texte_login_precaution' => 'Atenção! Este é o login com o qual você está conectado agora. Use este formulário com cautela...',
781
-	'texte_messagerie_agenda' => 'As mensagens internas permitem que os redatores se comuniquem entre si, diretamente da área privada do site. Elas estão associadas a uma agenda.',
782
-	'texte_mise_a_niveau_base_1' => 'Você acabou de atualizar os arquivos do SPIP.
773
+    'texte_informations_personnelles_1' => 'O sistema vai criar agora um acesso personalizado ao site.',
774
+    'texte_informations_personnelles_2' => '(Nota: trata-se de uma reinstalação, se o seu acesso funciona corretamente, você pode',
775
+    'texte_introductif_article' => '(Texto introdutório da matéria.)',
776
+    'texte_jeu_caractere' => 'É aconselhável usar no seu site o alfabeto universal (<tt>utf-8</tt>): ele permite a exibição de textos em todos os idiomas, e não tem problemas de compatibilidade com os navegadores modernos.',
777
+    'texte_jeu_caractere_3' => 'O seu site está configurado atualmente com o conjunto de caracteres:',
778
+    'texte_jeu_caractere_4' => 'Se isso não corresponde à realidade dos seus dados (por ex., em seguimento a um restauro da base de dados), ou se <em>você lançou este site</em> e deseja utilizar um outro conjunto de caracteres, por favor, indique-o aqui:',
779
+    'texte_login_ldap_1' => '(Deixe em branco para acesso anônimo, ou informe o caminho completo, por exemplo «<tt>uid=dupont, ou=users, dc=mon-domaine, dc=com</tt>».)',
780
+    'texte_login_precaution' => 'Atenção! Este é o login com o qual você está conectado agora. Use este formulário com cautela...',
781
+    'texte_messagerie_agenda' => 'As mensagens internas permitem que os redatores se comuniquem entre si, diretamente da área privada do site. Elas estão associadas a uma agenda.',
782
+    'texte_mise_a_niveau_base_1' => 'Você acabou de atualizar os arquivos do SPIP.
783 783
 Agora é necessário atualizar a base de dados do site.',
784
-	'texte_modifier_article' => 'Editar a matéria:',
785
-	'texte_multilinguisme' => 'Se você deseja gerar objetos em diversos idiomas, com uma navegação complexa, você pode incluir um menu de seleção de idioma nesses objetos, de acordo com a estrutura do seu site.',
786
-	'texte_multilinguisme_trad' => 'Você pode, igualmente, ativar um sistema de gerenciamento de links entre as diferentes traduções em certos objetos.',
787
-	'texte_non_compresse' => '<i>não compactado</i> (seu servidor não suporta esta funcionalidade)',
788
-	'texte_nouvelle_version_spip_1' => 'Você instalou uma nova versão do SPIP.',
789
-	'texte_nouvelle_version_spip_2' => 'Esta nova versão precisa de uma atualização mais completa do que o normal. Se você é o webmaster do site, por favor, apague o arquivo @connect@ e retome a instalação de forma a incluir os seus parâmetros de conexão à base de dados.<p> (NB.: se você não se lembra dos seus parâmetros de conexão, consulte o arquivo @connect@ antes de apagá-lo...)</p>',
790
-	'texte_operation_echec' => 'Volte à página anterior, escolha uma outra base de dados ou crie uma nova. Verifique as informações fornecidas pelo seu serviço de hospedagem.',
791
-	'texte_plus_trois_car' => 'mais de 3 caracteres',
792
-	'texte_plusieurs_articles' => 'Demasiados autores encontrados para "@cherche_auteur@":',
793
-	'texte_port_annuaire' => '(O valor padrão indicado é geralmente conveniente.)',
794
-	'texte_presente_plugin' => 'Esta página lista os plugins disponíveis para o site. Você pode ativar os plugins necessários marcando a opção correspondente.',
795
-	'texte_proposer_publication' => 'Assim que a sua matéria estiver pronta, você pode propor a sua publicação.',
796
-	'texte_proxy' => 'Em alguns casos (intranet, redes protegidas...), os sites remotos (documentação do SPIP, sites sindicados etc.) só estarão acessíveis através de um <i>proxy HTTP</i>. Nesse caso, informe abaixo o endereço, no formato @[email protected], você pode deixar este campo vazio.',
797
-	'texte_publication_articles_post_dates' => 'Que comportamento o SPIP deve adotar face às matérias em que a data de publicação está pré-datada?',
798
-	'texte_rappel_selection_champs' => '[Não se esqueça de selecionar corretamente este campo.]',
799
-	'texte_recalcul_page' => 'Se você quiser recalcular uma única página, passe para a área pública e clique no botão «atualizar».',
800
-	'texte_recuperer_base' => 'Reparar a base de dados',
801
-	'texte_reference_mais_redirige' => 'matéria referenciada no seu site em  SPIP, mas redirecionada para outro URL.',
802
-	'texte_requetes_echouent' => '<b>Já que certas solicitações SQL falharam sistematicamente e sem razão aparente, é possível que a causa esteja na base de dados em si.</b><p>
784
+    'texte_modifier_article' => 'Editar a matéria:',
785
+    'texte_multilinguisme' => 'Se você deseja gerar objetos em diversos idiomas, com uma navegação complexa, você pode incluir um menu de seleção de idioma nesses objetos, de acordo com a estrutura do seu site.',
786
+    'texte_multilinguisme_trad' => 'Você pode, igualmente, ativar um sistema de gerenciamento de links entre as diferentes traduções em certos objetos.',
787
+    'texte_non_compresse' => '<i>não compactado</i> (seu servidor não suporta esta funcionalidade)',
788
+    'texte_nouvelle_version_spip_1' => 'Você instalou uma nova versão do SPIP.',
789
+    'texte_nouvelle_version_spip_2' => 'Esta nova versão precisa de uma atualização mais completa do que o normal. Se você é o webmaster do site, por favor, apague o arquivo @connect@ e retome a instalação de forma a incluir os seus parâmetros de conexão à base de dados.<p> (NB.: se você não se lembra dos seus parâmetros de conexão, consulte o arquivo @connect@ antes de apagá-lo...)</p>',
790
+    'texte_operation_echec' => 'Volte à página anterior, escolha uma outra base de dados ou crie uma nova. Verifique as informações fornecidas pelo seu serviço de hospedagem.',
791
+    'texte_plus_trois_car' => 'mais de 3 caracteres',
792
+    'texte_plusieurs_articles' => 'Demasiados autores encontrados para "@cherche_auteur@":',
793
+    'texte_port_annuaire' => '(O valor padrão indicado é geralmente conveniente.)',
794
+    'texte_presente_plugin' => 'Esta página lista os plugins disponíveis para o site. Você pode ativar os plugins necessários marcando a opção correspondente.',
795
+    'texte_proposer_publication' => 'Assim que a sua matéria estiver pronta, você pode propor a sua publicação.',
796
+    'texte_proxy' => 'Em alguns casos (intranet, redes protegidas...), os sites remotos (documentação do SPIP, sites sindicados etc.) só estarão acessíveis através de um <i>proxy HTTP</i>. Nesse caso, informe abaixo o endereço, no formato @[email protected], você pode deixar este campo vazio.',
797
+    'texte_publication_articles_post_dates' => 'Que comportamento o SPIP deve adotar face às matérias em que a data de publicação está pré-datada?',
798
+    'texte_rappel_selection_champs' => '[Não se esqueça de selecionar corretamente este campo.]',
799
+    'texte_recalcul_page' => 'Se você quiser recalcular uma única página, passe para a área pública e clique no botão «atualizar».',
800
+    'texte_recuperer_base' => 'Reparar a base de dados',
801
+    'texte_reference_mais_redirige' => 'matéria referenciada no seu site em  SPIP, mas redirecionada para outro URL.',
802
+    'texte_requetes_echouent' => '<b>Já que certas solicitações SQL falharam sistematicamente e sem razão aparente, é possível que a causa esteja na base de dados em si.</b><p>
803 803
 O seu servidor SQL dispõe de uma funcionalidade de reparação das suas tabelas quando elas são danificadas por acidente. Você poderá tentar esta reparação; em caso de falha, conserve uma cópia da mensagem de erro, que poderá conter indícios do que não está funcionando...</p><p>
804 804
 Se o problema persistir, contate o seu serviço de hospedagem.</p>',
805
-	'texte_selection_langue_principale' => 'Você pode escolher abaixo o «idioma principal» do site. esta escolha não o obriga - felizmente! - a escrever as suas matérias no idioma selecionado, mas permite determinar:
805
+    'texte_selection_langue_principale' => 'Você pode escolher abaixo o «idioma principal» do site. esta escolha não o obriga - felizmente! - a escrever as suas matérias no idioma selecionado, mas permite determinar:
806 806
  <ul><li>o formato padrão das datas no site público;</li>
807 807
  <li>a natureza do motor tipográfico que o SPIP deverá usar para a composição dos textos;</li>
808 808
  <li>o idioma usado nos formulários do site público;</li>
809 809
  <li>o idioma padrão exibido na área privada.</li></ul>',
810
-	'texte_sous_titre' => 'Subtítulo',
811
-	'texte_statistiques_visites' => '(barras escuras:  domingo / curva escura: evolução da média)',
812
-	'texte_statut_attente_validation' => 'aguardando validação',
813
-	'texte_statut_publies' => 'publicadas online',
814
-	'texte_statut_refuses' => 'recusadas',
815
-	'texte_suppression_fichiers' => 'Use este comando para excluir todos os arquivos que constam do cache do SPIP. Isto permite, por exemplo, forçar a reconstrução de todas as páginas, caso você tenha feito alterações importantes no layout ou na estrutura do site.',
816
-	'texte_sur_titre' => 'Sobretítulo',
817
-	'texte_table_ok' => ': esta tabela está OK.',
818
-	'texte_tentative_recuperation' => 'Tentativa de reparação',
819
-	'texte_tenter_reparation' => 'Tentar uma reparação da base de dados',
820
-	'texte_test_proxy' => 'Para testar este proxy, informe aqui o endereço de um website que você deseje testar.',
821
-	'texte_titre_02' => 'Título:',
822
-	'texte_titre_obligatoire' => '<b>Título</b> [obrigatório]',
823
-	'texte_travail_article' => '@nom_auteur_modif@ trabalhou nesta matéria há @date_diff@ minutos',
824
-	'texte_travail_collaboratif' => 'Se é frequente acontecer de mais de um redator trabalhar em uma mesma matéria, o sistema pode exibir as matérias recentemente "abertas", de modo a evitar modificações concorrentes. Esta opção está desativada por padrão, para evitar a exibição de mensagens de aviso desnecessárias.',
825
-	'texte_vide' => 'vazia',
826
-	'texte_vider_cache' => 'Esvaziar o cache',
827
-	'titre_admin_tech' => 'Manutenção técnica',
828
-	'titre_admin_vider' => 'Manutenção técnica',
829
-	'titre_ajouter_un_auteur' => 'Incluir um autor',
830
-	'titre_ajouter_un_mot' => 'Incluir uma palavra-chave',
831
-	'titre_cadre_afficher_article' => 'Exibir as matérias',
832
-	'titre_cadre_afficher_traductions' => 'Exibir o status das traduções para os idiomas a seguir:',
833
-	'titre_cadre_ajouter_auteur' => 'INCLUIR UM AUTOR:',
834
-	'titre_cadre_interieur_rubrique' => 'Na seção',
835
-	'titre_cadre_numero_auteur' => 'AUTOR NÚMERO',
836
-	'titre_cadre_numero_objet' => '@objet@ NÚMERO:',
837
-	'titre_cadre_signature_obligatoire' => '<b>Assinatura</b> [obrigatório]<br />',
838
-	'titre_config_contenu_notifications' => 'Notificações',
839
-	'titre_config_contenu_prive' => 'Na área privada',
840
-	'titre_config_contenu_public' => 'No site público',
841
-	'titre_config_fonctions' => 'Configuração do site',
842
-	'titre_config_langage' => 'Configurar o idioma',
843
-	'titre_configuration' => 'Configuração do site',
844
-	'titre_configurer_preferences' => 'Configurar as suas preferências',
845
-	'titre_configurer_preferences_menus' => 'Configurar as suas preferências de menus',
846
-	'titre_conflit_edition' => 'Conflito durante a edição',
847
-	'titre_connexion_ldap' => 'Opções: <b>Sua conexão LDAP</b>',
848
-	'titre_groupe_mots' => 'GRUPO DE PALAVRAS-CHAVE:',
849
-	'titre_identite_site' => 'Identidade do site',
850
-	'titre_langue_article' => 'Idioma da matéria',
851
-	'titre_langue_rubrique' => 'Idioma da seção',
852
-	'titre_langue_trad_article' => 'IDIOMA E TRADUÇÕES DA MATÉRIA',
853
-	'titre_les_articles' => 'AS MATÉRIAS',
854
-	'titre_messagerie_agenda' => 'Mensagens internas e agenda',
855
-	'titre_naviguer_dans_le_site' => 'Navegar no site...',
856
-	'titre_nouvelle_rubrique' => 'Nova seção',
857
-	'titre_numero_rubrique' => 'SEÇÃO NÚMERO:',
858
-	'titre_page_articles_edit' => 'Editar: @titre@',
859
-	'titre_page_articles_page' => 'As matérias',
860
-	'titre_page_articles_tous' => 'Todo o site',
861
-	'titre_page_calendrier' => 'Calendário @nom_mois@ @annee@',
862
-	'titre_page_config_contenu' => 'Configuração do site',
863
-	'titre_page_delete_all' => 'supressão total e irreversível',
864
-	'titre_page_recherche' => 'Resultados da busca por @recherche@',
865
-	'titre_page_statistiques_referers' => 'Estatísticas (links de entrada)',
866
-	'titre_page_upgrade' => 'Atualização do SPIP',
867
-	'titre_preference_menus_favoris' => 'Menus favoritos',
868
-	'titre_publication_articles_post_dates' => 'Publicação de matérias pós-datadas',
869
-	'titre_reparation' => 'Reparação',
870
-	'titre_suivi_petition' => 'Acompanhamento das petições',
871
-	'tls_ldap' => 'Transport Layer Security:',
872
-	'trad_article_traduction' => 'Todas as versões desta matéria:',
873
-	'trad_delier' => 'Desvincular destas traduções',
874
-	'trad_lier' => 'Esta matéria é uma tradução da matéria número:',
875
-	'trad_new' => 'Escrever uma nova tradução',
810
+    'texte_sous_titre' => 'Subtítulo',
811
+    'texte_statistiques_visites' => '(barras escuras:  domingo / curva escura: evolução da média)',
812
+    'texte_statut_attente_validation' => 'aguardando validação',
813
+    'texte_statut_publies' => 'publicadas online',
814
+    'texte_statut_refuses' => 'recusadas',
815
+    'texte_suppression_fichiers' => 'Use este comando para excluir todos os arquivos que constam do cache do SPIP. Isto permite, por exemplo, forçar a reconstrução de todas as páginas, caso você tenha feito alterações importantes no layout ou na estrutura do site.',
816
+    'texte_sur_titre' => 'Sobretítulo',
817
+    'texte_table_ok' => ': esta tabela está OK.',
818
+    'texte_tentative_recuperation' => 'Tentativa de reparação',
819
+    'texte_tenter_reparation' => 'Tentar uma reparação da base de dados',
820
+    'texte_test_proxy' => 'Para testar este proxy, informe aqui o endereço de um website que você deseje testar.',
821
+    'texte_titre_02' => 'Título:',
822
+    'texte_titre_obligatoire' => '<b>Título</b> [obrigatório]',
823
+    'texte_travail_article' => '@nom_auteur_modif@ trabalhou nesta matéria há @date_diff@ minutos',
824
+    'texte_travail_collaboratif' => 'Se é frequente acontecer de mais de um redator trabalhar em uma mesma matéria, o sistema pode exibir as matérias recentemente "abertas", de modo a evitar modificações concorrentes. Esta opção está desativada por padrão, para evitar a exibição de mensagens de aviso desnecessárias.',
825
+    'texte_vide' => 'vazia',
826
+    'texte_vider_cache' => 'Esvaziar o cache',
827
+    'titre_admin_tech' => 'Manutenção técnica',
828
+    'titre_admin_vider' => 'Manutenção técnica',
829
+    'titre_ajouter_un_auteur' => 'Incluir um autor',
830
+    'titre_ajouter_un_mot' => 'Incluir uma palavra-chave',
831
+    'titre_cadre_afficher_article' => 'Exibir as matérias',
832
+    'titre_cadre_afficher_traductions' => 'Exibir o status das traduções para os idiomas a seguir:',
833
+    'titre_cadre_ajouter_auteur' => 'INCLUIR UM AUTOR:',
834
+    'titre_cadre_interieur_rubrique' => 'Na seção',
835
+    'titre_cadre_numero_auteur' => 'AUTOR NÚMERO',
836
+    'titre_cadre_numero_objet' => '@objet@ NÚMERO:',
837
+    'titre_cadre_signature_obligatoire' => '<b>Assinatura</b> [obrigatório]<br />',
838
+    'titre_config_contenu_notifications' => 'Notificações',
839
+    'titre_config_contenu_prive' => 'Na área privada',
840
+    'titre_config_contenu_public' => 'No site público',
841
+    'titre_config_fonctions' => 'Configuração do site',
842
+    'titre_config_langage' => 'Configurar o idioma',
843
+    'titre_configuration' => 'Configuração do site',
844
+    'titre_configurer_preferences' => 'Configurar as suas preferências',
845
+    'titre_configurer_preferences_menus' => 'Configurar as suas preferências de menus',
846
+    'titre_conflit_edition' => 'Conflito durante a edição',
847
+    'titre_connexion_ldap' => 'Opções: <b>Sua conexão LDAP</b>',
848
+    'titre_groupe_mots' => 'GRUPO DE PALAVRAS-CHAVE:',
849
+    'titre_identite_site' => 'Identidade do site',
850
+    'titre_langue_article' => 'Idioma da matéria',
851
+    'titre_langue_rubrique' => 'Idioma da seção',
852
+    'titre_langue_trad_article' => 'IDIOMA E TRADUÇÕES DA MATÉRIA',
853
+    'titre_les_articles' => 'AS MATÉRIAS',
854
+    'titre_messagerie_agenda' => 'Mensagens internas e agenda',
855
+    'titre_naviguer_dans_le_site' => 'Navegar no site...',
856
+    'titre_nouvelle_rubrique' => 'Nova seção',
857
+    'titre_numero_rubrique' => 'SEÇÃO NÚMERO:',
858
+    'titre_page_articles_edit' => 'Editar: @titre@',
859
+    'titre_page_articles_page' => 'As matérias',
860
+    'titre_page_articles_tous' => 'Todo o site',
861
+    'titre_page_calendrier' => 'Calendário @nom_mois@ @annee@',
862
+    'titre_page_config_contenu' => 'Configuração do site',
863
+    'titre_page_delete_all' => 'supressão total e irreversível',
864
+    'titre_page_recherche' => 'Resultados da busca por @recherche@',
865
+    'titre_page_statistiques_referers' => 'Estatísticas (links de entrada)',
866
+    'titre_page_upgrade' => 'Atualização do SPIP',
867
+    'titre_preference_menus_favoris' => 'Menus favoritos',
868
+    'titre_publication_articles_post_dates' => 'Publicação de matérias pós-datadas',
869
+    'titre_reparation' => 'Reparação',
870
+    'titre_suivi_petition' => 'Acompanhamento das petições',
871
+    'tls_ldap' => 'Transport Layer Security:',
872
+    'trad_article_traduction' => 'Todas as versões desta matéria:',
873
+    'trad_delier' => 'Desvincular destas traduções',
874
+    'trad_lier' => 'Esta matéria é uma tradução da matéria número:',
875
+    'trad_new' => 'Escrever uma nova tradução',
876 876
 
877
-	// U
878
-	'utf8_convert_erreur_orig' => 'Erro: o conjunto de caracteres @charset@ não é suportado.',
877
+    // U
878
+    'utf8_convert_erreur_orig' => 'Erro: o conjunto de caracteres @charset@ não é suportado.',
879 879
 
880
-	// V
881
-	'version' => 'Versão:'
880
+    // V
881
+    'version' => 'Versão:'
882 882
 );
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Indentation   +585 added lines, -585 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Filtres
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
  *    Date au format SQL tel que `2008-04-01` sinon ''
38 38
  **/
39 39
 function extraire_date($texte): string {
40
-	// format = 2001-08
41
-	if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) {
42
-		return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01';
43
-	}
44
-	return '';
40
+    // format = 2001-08
41
+    if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) {
42
+        return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01';
43
+    }
44
+    return '';
45 45
 }
46 46
 
47 47
 
@@ -63,29 +63,29 @@  discard block
 block discarded – undo
63 63
  *     - une chaîne vide si la date est considérée nulle
64 64
  **/
65 65
 function normaliser_date($date, $forcer_jour = false): string {
66
-	$date = vider_date($date);
67
-	if ($date) {
68
-		if (preg_match('/^[0-9]{8,10}$/', $date)) {
69
-			$date = date('Y-m-d H:i:s', $date);
70
-		}
71
-		if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
72
-			$regs = array_pad($regs, 4, null); // eviter notice php
73
-			$date = $regs[1] . '-00-00' . $regs[3];
74
-		} else {
75
-			if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
76
-				$regs = array_pad($regs, 4, null); // eviter notice php
77
-				$date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3];
78
-			} else {
79
-				$date = date('Y-m-d H:i:s', strtotime($date));
80
-			}
81
-		}
82
-
83
-		if ($forcer_jour) {
84
-			$date = str_replace('-00', '-01', $date);
85
-		}
86
-	}
87
-
88
-	return $date;
66
+    $date = vider_date($date);
67
+    if ($date) {
68
+        if (preg_match('/^[0-9]{8,10}$/', $date)) {
69
+            $date = date('Y-m-d H:i:s', $date);
70
+        }
71
+        if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
72
+            $regs = array_pad($regs, 4, null); // eviter notice php
73
+            $date = $regs[1] . '-00-00' . $regs[3];
74
+        } else {
75
+            if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
76
+                $regs = array_pad($regs, 4, null); // eviter notice php
77
+                $date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3];
78
+            } else {
79
+                $date = date('Y-m-d H:i:s', strtotime($date));
80
+            }
81
+        }
82
+
83
+        if ($forcer_jour) {
84
+            $date = str_replace('-00', '-01', $date);
85
+        }
86
+    }
87
+
88
+    return $date;
89 89
 }
90 90
 
91 91
 /**
@@ -98,23 +98,23 @@  discard block
 block discarded – undo
98 98
  *     - Une chaine vide
99 99
  **/
100 100
 function vider_date($letexte, $verif_format_date = false): string {
101
-	$letexte ??= '';
102
-	if (
103
-		!$verif_format_date
104
-		or (in_array(strlen($letexte), [10,19]) and
105
-			  preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte))
106
-	) {
107
-		if (strncmp('0000-00-00', $letexte, 10) == 0) {
108
-			return '';
109
-		}
110
-		if (strncmp('0001-01-01', $letexte, 10) == 0) {
111
-			return '';
112
-		}
113
-		if (strncmp('1970-01-01', $letexte, 10) == 0) {
114
-			return '';
115
-		}  // eviter le bug GMT-1
116
-	}
117
-	return $letexte;
101
+    $letexte ??= '';
102
+    if (
103
+        !$verif_format_date
104
+        or (in_array(strlen($letexte), [10,19]) and
105
+              preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte))
106
+    ) {
107
+        if (strncmp('0000-00-00', $letexte, 10) == 0) {
108
+            return '';
109
+        }
110
+        if (strncmp('0001-01-01', $letexte, 10) == 0) {
111
+            return '';
112
+        }
113
+        if (strncmp('1970-01-01', $letexte, 10) == 0) {
114
+            return '';
115
+        }  // eviter le bug GMT-1
116
+    }
117
+    return $letexte;
118 118
 }
119 119
 
120 120
 /**
@@ -130,17 +130,17 @@  discard block
 block discarded – undo
130 130
  **/
131 131
 function recup_heure($date): array {
132 132
 
133
-	if (preg_match('#([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2}))?#', $date, $elements)) {
134
-		array_shift($elements);
135
-		if (!isset($elements[2])) {
136
-			$elements[2] = 0;
137
-		}
138
-		$heure = $elements;
139
-	} else {
140
-		$heure = [0, 0, 0];
141
-	}
142
-
143
-	return $heure;
133
+    if (preg_match('#([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2}))?#', $date, $elements)) {
134
+        array_shift($elements);
135
+        if (!isset($elements[2])) {
136
+            $elements[2] = 0;
137
+        }
138
+        $heure = $elements;
139
+    } else {
140
+        $heure = [0, 0, 0];
141
+    }
142
+
143
+    return $heure;
144 144
 }
145 145
 
146 146
 /**
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
  * @return string heures, sinon 0
155 155
  **/
156 156
 function heures($numdate): string {
157
-	$heures = null;
158
-	$date_array = recup_heure($numdate);
159
-	if ($date_array) {
160
-		[$heures, $minutes, $secondes] = $date_array;
161
-	}
157
+    $heures = null;
158
+    $date_array = recup_heure($numdate);
159
+    if ($date_array) {
160
+        [$heures, $minutes, $secondes] = $date_array;
161
+    }
162 162
 
163
-	return $heures;
163
+    return $heures;
164 164
 }
165 165
 
166 166
 /**
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
  * @return string minutes, sinon 0
175 175
  **/
176 176
 function minutes($numdate): string {
177
-	$minutes = null;
178
-	$date_array = recup_heure($numdate);
179
-	if ($date_array) {
180
-		[$heures, $minutes, $secondes] = $date_array;
181
-	}
177
+    $minutes = null;
178
+    $date_array = recup_heure($numdate);
179
+    if ($date_array) {
180
+        [$heures, $minutes, $secondes] = $date_array;
181
+    }
182 182
 
183
-	return $minutes;
183
+    return $minutes;
184 184
 }
185 185
 
186 186
 /**
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
  * @return string secondes, sinon 0
195 195
  **/
196 196
 function secondes($numdate): string {
197
-	$secondes = null;
198
-	$date_array = recup_heure($numdate);
199
-	if ($date_array) {
200
-		[$heures, $minutes, $secondes] = $date_array;
201
-	}
197
+    $secondes = null;
198
+    $date_array = recup_heure($numdate);
199
+    if ($date_array) {
200
+        [$heures, $minutes, $secondes] = $date_array;
201
+    }
202 202
 
203
-	return $secondes;
203
+    return $secondes;
204 204
 }
205 205
 
206 206
 /**
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
  * @return string L'heure formatée dans la langue en cours.
220 220
  **/
221 221
 function heures_minutes($numdate, $forme = ''): string {
222
-	if ($forme !== 'abbr') {
223
-		return _T('date_fmt_heures_minutes', ['h' => heures($numdate), 'm' => minutes($numdate)]);
224
-	} else {
225
-		return _T('date_fmt_heures_minutes_court', ['h' => heures($numdate), 'm' => minutes($numdate)]);
226
-	}
222
+    if ($forme !== 'abbr') {
223
+        return _T('date_fmt_heures_minutes', ['h' => heures($numdate), 'm' => minutes($numdate)]);
224
+    } else {
225
+        return _T('date_fmt_heures_minutes_court', ['h' => heures($numdate), 'm' => minutes($numdate)]);
226
+    }
227 227
 }
228 228
 
229 229
 /**
@@ -248,57 +248,57 @@  discard block
 block discarded – undo
248 248
  * @return array [année, mois, jour, heures, minutes, secondes] ou []
249 249
  **/
250 250
 function recup_date($numdate, $forcer_jour = true): array {
251
-	if (!$numdate) {
252
-		return [];
253
-	}
254
-	$heures = $minutes = $secondes = 0;
255
-	if (preg_match('#([0-9]{1,2})/([0-9]{1,2})/([0-9]{4}|[0-9]{1,2})#', $numdate, $regs)) {
256
-		$jour = $regs[1];
257
-		$mois = $regs[2];
258
-		$annee = $regs[3];
259
-		if ($annee < 90) {
260
-			$annee = 2000 + $annee;
261
-		} elseif ($annee < 100) {
262
-			$annee = 1900 + $annee;
263
-		}
264
-		[$heures, $minutes, $secondes] = recup_heure($numdate);
265
-	} elseif (preg_match('#([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})#', $numdate, $regs)) {
266
-		$annee = $regs[1];
267
-		$mois = $regs[2];
268
-		$jour = $regs[3];
269
-		[$heures, $minutes, $secondes] = recup_heure($numdate);
270
-	} elseif (preg_match('#([0-9]{4})-([0-9]{2})#', $numdate, $regs)) {
271
-		$annee = $regs[1];
272
-		$mois = $regs[2];
273
-		$jour = '';
274
-		[$heures, $minutes, $secondes] = recup_heure($numdate);
275
-	} elseif (preg_match('#^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#', $numdate, $regs)) {
276
-		$annee = $regs[1];
277
-		$mois = $regs[2];
278
-		$jour = $regs[3];
279
-		$heures = $regs[4];
280
-		$minutes = $regs[5];
281
-		$secondes = $regs[6];
282
-	} else {
283
-		$annee = $mois = $jour = '';
284
-	}
285
-	if ($annee > 4000) {
286
-		$annee -= 9000;
287
-	}
288
-	if (strlen($jour) and substr($jour, 0, 1) == '0') {
289
-		$jour = substr($jour, 1);
290
-	}
291
-
292
-	if ($forcer_jour and $jour == '0') {
293
-		$jour = '1';
294
-	}
295
-	if ($forcer_jour and $mois == '0') {
296
-		$mois = '1';
297
-	}
298
-	if ($annee or $mois or $jour or $heures or $minutes or $secondes) {
299
-		return [$annee, $mois, $jour, $heures, $minutes, $secondes];
300
-	}
301
-	return [];
251
+    if (!$numdate) {
252
+        return [];
253
+    }
254
+    $heures = $minutes = $secondes = 0;
255
+    if (preg_match('#([0-9]{1,2})/([0-9]{1,2})/([0-9]{4}|[0-9]{1,2})#', $numdate, $regs)) {
256
+        $jour = $regs[1];
257
+        $mois = $regs[2];
258
+        $annee = $regs[3];
259
+        if ($annee < 90) {
260
+            $annee = 2000 + $annee;
261
+        } elseif ($annee < 100) {
262
+            $annee = 1900 + $annee;
263
+        }
264
+        [$heures, $minutes, $secondes] = recup_heure($numdate);
265
+    } elseif (preg_match('#([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})#', $numdate, $regs)) {
266
+        $annee = $regs[1];
267
+        $mois = $regs[2];
268
+        $jour = $regs[3];
269
+        [$heures, $minutes, $secondes] = recup_heure($numdate);
270
+    } elseif (preg_match('#([0-9]{4})-([0-9]{2})#', $numdate, $regs)) {
271
+        $annee = $regs[1];
272
+        $mois = $regs[2];
273
+        $jour = '';
274
+        [$heures, $minutes, $secondes] = recup_heure($numdate);
275
+    } elseif (preg_match('#^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#', $numdate, $regs)) {
276
+        $annee = $regs[1];
277
+        $mois = $regs[2];
278
+        $jour = $regs[3];
279
+        $heures = $regs[4];
280
+        $minutes = $regs[5];
281
+        $secondes = $regs[6];
282
+    } else {
283
+        $annee = $mois = $jour = '';
284
+    }
285
+    if ($annee > 4000) {
286
+        $annee -= 9000;
287
+    }
288
+    if (strlen($jour) and substr($jour, 0, 1) == '0') {
289
+        $jour = substr($jour, 1);
290
+    }
291
+
292
+    if ($forcer_jour and $jour == '0') {
293
+        $jour = '1';
294
+    }
295
+    if ($forcer_jour and $mois == '0') {
296
+        $mois = '1';
297
+    }
298
+    if ($annee or $mois or $jour or $heures or $minutes or $secondes) {
299
+        return [$annee, $mois, $jour, $heures, $minutes, $secondes];
300
+    }
301
+    return [];
302 302
 }
303 303
 
304 304
 /**
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
  *     La date relative ou complète
326 326
  **/
327 327
 function date_interface($date, $decalage_maxi = 43200 /* 12*3600 */): string {
328
-	return sinon(
329
-		date_relative($date, $decalage_maxi),
330
-		affdate_heure($date)
331
-	);
328
+    return sinon(
329
+        date_relative($date, $decalage_maxi),
330
+        affdate_heure($date)
331
+    );
332 332
 }
333 333
 
334 334
 /**
@@ -361,86 +361,86 @@  discard block
 block discarded – undo
361 361
  **/
362 362
 function date_relative($date, $decalage_maxi = 0, $ref_date = null): string {
363 363
 
364
-	if (!$date) {
365
-		return '';
366
-	}
367
-
368
-	if (is_null($ref_date)) {
369
-		$ref_time = time();
370
-	} else {
371
-		$ref_time = strtotime($ref_date);
372
-	}
373
-
374
-	$decal = date('U', $ref_time) - date('U', strtotime($date));
375
-
376
-	if ($decalage_maxi and ($decal > $decalage_maxi or $decal < 0)) {
377
-		return '';
378
-	}
379
-
380
-	if ($decal < 0) {
381
-		$il_y_a = 'date_dans';
382
-		$decal = -1 * $decal;
383
-	} else {
384
-		$il_y_a = 'date_il_y_a';
385
-	}
386
-
387
-	if ($decal > 3600 * 24 * 30 * 6) {
388
-		return affdate_court($date);
389
-	}
390
-
391
-	if ($decal > 3600 * 24 * 30) {
392
-		$mois = floor($decal / (3600 * 24 * 30));
393
-		if ($mois < 2) {
394
-			$delai = "$mois " . _T('date_un_mois');
395
-		} else {
396
-			$delai = "$mois " . _T('date_mois');
397
-		}
398
-	} else {
399
-		if ($decal > 3600 * 24 * 7) {
400
-			$semaines = floor($decal / (3600 * 24 * 7));
401
-			if ($semaines < 2) {
402
-				$delai = "$semaines " . _T('date_une_semaine');
403
-			} else {
404
-				$delai = "$semaines " . _T('date_semaines');
405
-			}
406
-		} else {
407
-			if ($decal > 3600 * 24) {
408
-				$jours = floor($decal / (3600 * 24));
409
-				if ($jours < 2) {
410
-					return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier');
411
-				} else {
412
-					$delai = "$jours " . _T('date_jours');
413
-				}
414
-			} else {
415
-				if ($decal >= 3600) {
416
-					$heures = floor($decal / 3600);
417
-					if ($heures < 2) {
418
-						$delai = "$heures " . _T('date_une_heure');
419
-					} else {
420
-						$delai = "$heures " . _T('date_heures');
421
-					}
422
-				} else {
423
-					if ($decal >= 60) {
424
-						$minutes = floor($decal / 60);
425
-						if ($minutes < 2) {
426
-							$delai = "$minutes " . _T('date_une_minute');
427
-						} else {
428
-							$delai = "$minutes " . _T('date_minutes');
429
-						}
430
-					} else {
431
-						$secondes = ceil($decal);
432
-						if ($secondes < 2) {
433
-							$delai = "$secondes " . _T('date_une_seconde');
434
-						} else {
435
-							$delai = "$secondes " . _T('date_secondes');
436
-						}
437
-					}
438
-				}
439
-			}
440
-		}
441
-	}
442
-
443
-	return _T($il_y_a, ['delai' => $delai]);
364
+    if (!$date) {
365
+        return '';
366
+    }
367
+
368
+    if (is_null($ref_date)) {
369
+        $ref_time = time();
370
+    } else {
371
+        $ref_time = strtotime($ref_date);
372
+    }
373
+
374
+    $decal = date('U', $ref_time) - date('U', strtotime($date));
375
+
376
+    if ($decalage_maxi and ($decal > $decalage_maxi or $decal < 0)) {
377
+        return '';
378
+    }
379
+
380
+    if ($decal < 0) {
381
+        $il_y_a = 'date_dans';
382
+        $decal = -1 * $decal;
383
+    } else {
384
+        $il_y_a = 'date_il_y_a';
385
+    }
386
+
387
+    if ($decal > 3600 * 24 * 30 * 6) {
388
+        return affdate_court($date);
389
+    }
390
+
391
+    if ($decal > 3600 * 24 * 30) {
392
+        $mois = floor($decal / (3600 * 24 * 30));
393
+        if ($mois < 2) {
394
+            $delai = "$mois " . _T('date_un_mois');
395
+        } else {
396
+            $delai = "$mois " . _T('date_mois');
397
+        }
398
+    } else {
399
+        if ($decal > 3600 * 24 * 7) {
400
+            $semaines = floor($decal / (3600 * 24 * 7));
401
+            if ($semaines < 2) {
402
+                $delai = "$semaines " . _T('date_une_semaine');
403
+            } else {
404
+                $delai = "$semaines " . _T('date_semaines');
405
+            }
406
+        } else {
407
+            if ($decal > 3600 * 24) {
408
+                $jours = floor($decal / (3600 * 24));
409
+                if ($jours < 2) {
410
+                    return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier');
411
+                } else {
412
+                    $delai = "$jours " . _T('date_jours');
413
+                }
414
+            } else {
415
+                if ($decal >= 3600) {
416
+                    $heures = floor($decal / 3600);
417
+                    if ($heures < 2) {
418
+                        $delai = "$heures " . _T('date_une_heure');
419
+                    } else {
420
+                        $delai = "$heures " . _T('date_heures');
421
+                    }
422
+                } else {
423
+                    if ($decal >= 60) {
424
+                        $minutes = floor($decal / 60);
425
+                        if ($minutes < 2) {
426
+                            $delai = "$minutes " . _T('date_une_minute');
427
+                        } else {
428
+                            $delai = "$minutes " . _T('date_minutes');
429
+                        }
430
+                    } else {
431
+                        $secondes = ceil($decal);
432
+                        if ($secondes < 2) {
433
+                            $delai = "$secondes " . _T('date_une_seconde');
434
+                        } else {
435
+                            $delai = "$secondes " . _T('date_secondes');
436
+                        }
437
+                    }
438
+                }
439
+            }
440
+        }
441
+    }
442
+
443
+    return _T($il_y_a, ['delai' => $delai]);
444 444
 }
445 445
 
446 446
 
@@ -466,32 +466,32 @@  discard block
 block discarded – undo
466 466
  **/
467 467
 function date_relativecourt($date, $decalage_maxi = 0): string {
468 468
 
469
-	if (!$date) {
470
-		return '';
471
-	}
472
-	$decal = date('U', strtotime(date('Y-m-d')) - strtotime(date('Y-m-d', strtotime($date))));
473
-
474
-	if ($decalage_maxi and ($decal > $decalage_maxi or $decal < 0)) {
475
-		return '';
476
-	}
477
-
478
-	if ($decal < -24 * 3600) {
479
-		$retour = date_relative($date, $decalage_maxi);
480
-	} elseif ($decal < 0) {
481
-		$retour = _T('date_demain');
482
-	} else {
483
-		if ($decal < (3600 * 24)) {
484
-			$retour = _T('date_aujourdhui');
485
-		} else {
486
-			if ($decal < (3600 * 24 * 2)) {
487
-				$retour = _T('date_hier');
488
-			} else {
489
-				$retour = date_relative($date, $decalage_maxi);
490
-			}
491
-		}
492
-	}
493
-
494
-	return $retour;
469
+    if (!$date) {
470
+        return '';
471
+    }
472
+    $decal = date('U', strtotime(date('Y-m-d')) - strtotime(date('Y-m-d', strtotime($date))));
473
+
474
+    if ($decalage_maxi and ($decal > $decalage_maxi or $decal < 0)) {
475
+        return '';
476
+    }
477
+
478
+    if ($decal < -24 * 3600) {
479
+        $retour = date_relative($date, $decalage_maxi);
480
+    } elseif ($decal < 0) {
481
+        $retour = _T('date_demain');
482
+    } else {
483
+        if ($decal < (3600 * 24)) {
484
+            $retour = _T('date_aujourdhui');
485
+        } else {
486
+            if ($decal < (3600 * 24 * 2)) {
487
+                $retour = _T('date_hier');
488
+            } else {
489
+                $retour = date_relative($date, $decalage_maxi);
490
+            }
491
+        }
492
+    }
493
+
494
+    return $retour;
495 495
 }
496 496
 
497 497
 /**
@@ -508,174 +508,174 @@  discard block
 block discarded – undo
508 508
  * @return string
509 509
  */
510 510
 function affdate_base($numdate, $vue, $options = []): string {
511
-	if (is_string($options)) {
512
-		$options = ['param' => $options];
513
-	}
514
-	$date_array = recup_date($numdate, false);
515
-	if (!$date_array) {
516
-		return '';
517
-	}
518
-	[$annee, $mois, $jour, $heures, $minutes, $secondes] = $date_array;
519
-
520
-	// 1er, 21st, etc.
521
-	$journum = $jour;
522
-
523
-	if ($jour == 0) {
524
-		$jour = '';
525
-		$njour = 0;
526
-	} else {
527
-		$njour = intval($jour);
528
-		if ($jourth = _T('date_jnum' . $jour)) {
529
-			$jour = $jourth;
530
-		}
531
-	}
532
-
533
-	$mois = intval($mois);
534
-	if ($mois > 0 and $mois < 13) {
535
-		/* Traiter le cas "abbr" pour les noms de mois */
536
-		$param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : '');
537
-		$nommois = _T('date_mois_' . $mois . $param);
538
-		if ($jour) {
539
-			$jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]);
540
-		} else {
541
-			$jourmois = $nommois;
542
-		}
543
-	} else {
544
-		$nommois = '';
545
-		$jourmois = '';
546
-	}
547
-
548
-	if ($annee < 0) {
549
-		$annee = -$annee . ' ' . _T('date_avant_jc');
550
-		$avjc = true;
551
-	} else {
552
-		$avjc = false;
553
-	}
554
-
555
-	switch ($vue) {
556
-		case 'saison':
557
-		case 'saison_annee':
558
-			$saison = '';
559
-			if ($mois > 0) {
560
-				$saison = ($options['param'] == 'sud') ? 3 : 1;
561
-				if (($mois == 3 and $jour >= 21) or $mois > 3) {
562
-					$saison = ($options['param'] == 'sud') ? 4 : 2;
563
-				}
564
-				if (($mois == 6 and $jour >= 21) or $mois > 6) {
565
-					$saison = ($options['param'] == 'sud') ? 1 : 3;
566
-				}
567
-				if (($mois == 9 and $jour >= 21) or $mois > 9) {
568
-					$saison = ($options['param'] == 'sud') ? 2 : 4;
569
-				}
570
-				if (($mois == 12 and $jour >= 21) or $mois > 12) {
571
-					$saison = ($options['param'] == 'sud') ? 3 : 1;
572
-				}
573
-			}
574
-			if ($vue == 'saison') {
575
-				return $saison ? _T('date_saison_' . $saison) : '';
576
-			} else {
577
-				return $saison ? trim(_T(
578
-					'date_fmt_saison_annee',
579
-					['saison' => _T('date_saison_' . $saison), 'annee' => $annee]
580
-				)) : '';
581
-			}
582
-
583
-		case 'court':
584
-			if ($avjc) {
585
-				return $annee;
586
-			}
587
-			$a = ((isset($options['annee_courante']) and $options['annee_courante']) ? $options['annee_courante'] : date('Y'));
588
-			if ($annee < ($a - 100) or $annee > ($a + 100)) {
589
-				return $annee;
590
-			}
591
-			if ($annee != $a) {
592
-				return _T(
593
-					'date_fmt_mois_annee',
594
-					['mois' => $mois, 'nommois' => spip_ucfirst($nommois), 'annee' => $annee]
595
-				);
596
-			}
597
-
598
-			return _T(
599
-				'date_fmt_jour_mois',
600
-				['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
601
-			);
602
-
603
-		case 'jourcourt':
604
-			if ($avjc) {
605
-				return $annee;
606
-			}
607
-			$a = ((isset($options['annee_courante']) and $options['annee_courante']) ? $options['annee_courante'] : date('Y'));
608
-			if ($annee < ($a - 100) or $annee > ($a + 100)) {
609
-				return $annee;
610
-			}
611
-			if ($annee != $a) {
612
-				return _T(
613
-					'date_fmt_jour_mois_annee',
614
-					['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
615
-				);
616
-			}
617
-
618
-			return _T(
619
-				'date_fmt_jour_mois',
620
-				['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
621
-			);
622
-
623
-		case 'entier':
624
-			if ($avjc) {
625
-				return $annee;
626
-			}
627
-			if ($jour) {
628
-				return _T(
629
-					'date_fmt_jour_mois_annee',
630
-					['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
631
-				);
632
-			} elseif ($mois) {
633
-				return trim(_T('date_fmt_mois_annee', ['mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]));
634
-			} else {
635
-				return $annee;
636
-			}
637
-
638
-		case 'nom_mois':
639
-			return $nommois;
640
-
641
-		case 'mois':
642
-			return sprintf('%02s', $mois);
643
-
644
-		case 'jour':
645
-			return $jour;
646
-
647
-		case 'journum':
648
-			return $journum;
649
-
650
-		case 'nom_jour':
651
-			if (!$mois or !$njour) {
652
-				return '';
653
-			}
654
-			$nom = mktime(1, 1, 1, $mois, $njour, $annee);
655
-			$nom = 1 + (int) date('w', $nom);
656
-			$param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
657
-
658
-			return _T('date_jour_' . $nom . $param);
659
-
660
-		case 'mois_annee':
661
-			if ($avjc) {
662
-				return $annee;
663
-			}
664
-
665
-			return trim(_T('date_fmt_mois_annee', ['mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]));
666
-
667
-		case 'annee':
668
-			return $annee;
669
-
670
-		// Cas d'une vue non definie : retomber sur le format
671
-		// de date propose par http://www.php.net/date
672
-		default:
673
-			[$annee, $mois, $jour, $heures, $minutes, $secondes] = $date_array;
674
-			if (!$time = mktime($heures, $minutes, $secondes, $mois, (int) $jour, $annee)) {
675
-				$time = strtotime($numdate);
676
-			}
677
-			return date($vue, $time);
678
-	}
511
+    if (is_string($options)) {
512
+        $options = ['param' => $options];
513
+    }
514
+    $date_array = recup_date($numdate, false);
515
+    if (!$date_array) {
516
+        return '';
517
+    }
518
+    [$annee, $mois, $jour, $heures, $minutes, $secondes] = $date_array;
519
+
520
+    // 1er, 21st, etc.
521
+    $journum = $jour;
522
+
523
+    if ($jour == 0) {
524
+        $jour = '';
525
+        $njour = 0;
526
+    } else {
527
+        $njour = intval($jour);
528
+        if ($jourth = _T('date_jnum' . $jour)) {
529
+            $jour = $jourth;
530
+        }
531
+    }
532
+
533
+    $mois = intval($mois);
534
+    if ($mois > 0 and $mois < 13) {
535
+        /* Traiter le cas "abbr" pour les noms de mois */
536
+        $param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : '');
537
+        $nommois = _T('date_mois_' . $mois . $param);
538
+        if ($jour) {
539
+            $jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]);
540
+        } else {
541
+            $jourmois = $nommois;
542
+        }
543
+    } else {
544
+        $nommois = '';
545
+        $jourmois = '';
546
+    }
547
+
548
+    if ($annee < 0) {
549
+        $annee = -$annee . ' ' . _T('date_avant_jc');
550
+        $avjc = true;
551
+    } else {
552
+        $avjc = false;
553
+    }
554
+
555
+    switch ($vue) {
556
+        case 'saison':
557
+        case 'saison_annee':
558
+            $saison = '';
559
+            if ($mois > 0) {
560
+                $saison = ($options['param'] == 'sud') ? 3 : 1;
561
+                if (($mois == 3 and $jour >= 21) or $mois > 3) {
562
+                    $saison = ($options['param'] == 'sud') ? 4 : 2;
563
+                }
564
+                if (($mois == 6 and $jour >= 21) or $mois > 6) {
565
+                    $saison = ($options['param'] == 'sud') ? 1 : 3;
566
+                }
567
+                if (($mois == 9 and $jour >= 21) or $mois > 9) {
568
+                    $saison = ($options['param'] == 'sud') ? 2 : 4;
569
+                }
570
+                if (($mois == 12 and $jour >= 21) or $mois > 12) {
571
+                    $saison = ($options['param'] == 'sud') ? 3 : 1;
572
+                }
573
+            }
574
+            if ($vue == 'saison') {
575
+                return $saison ? _T('date_saison_' . $saison) : '';
576
+            } else {
577
+                return $saison ? trim(_T(
578
+                    'date_fmt_saison_annee',
579
+                    ['saison' => _T('date_saison_' . $saison), 'annee' => $annee]
580
+                )) : '';
581
+            }
582
+
583
+        case 'court':
584
+            if ($avjc) {
585
+                return $annee;
586
+            }
587
+            $a = ((isset($options['annee_courante']) and $options['annee_courante']) ? $options['annee_courante'] : date('Y'));
588
+            if ($annee < ($a - 100) or $annee > ($a + 100)) {
589
+                return $annee;
590
+            }
591
+            if ($annee != $a) {
592
+                return _T(
593
+                    'date_fmt_mois_annee',
594
+                    ['mois' => $mois, 'nommois' => spip_ucfirst($nommois), 'annee' => $annee]
595
+                );
596
+            }
597
+
598
+            return _T(
599
+                'date_fmt_jour_mois',
600
+                ['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
601
+            );
602
+
603
+        case 'jourcourt':
604
+            if ($avjc) {
605
+                return $annee;
606
+            }
607
+            $a = ((isset($options['annee_courante']) and $options['annee_courante']) ? $options['annee_courante'] : date('Y'));
608
+            if ($annee < ($a - 100) or $annee > ($a + 100)) {
609
+                return $annee;
610
+            }
611
+            if ($annee != $a) {
612
+                return _T(
613
+                    'date_fmt_jour_mois_annee',
614
+                    ['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
615
+                );
616
+            }
617
+
618
+            return _T(
619
+                'date_fmt_jour_mois',
620
+                ['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
621
+            );
622
+
623
+        case 'entier':
624
+            if ($avjc) {
625
+                return $annee;
626
+            }
627
+            if ($jour) {
628
+                return _T(
629
+                    'date_fmt_jour_mois_annee',
630
+                    ['jourmois' => $jourmois, 'jour' => $jour, 'mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]
631
+                );
632
+            } elseif ($mois) {
633
+                return trim(_T('date_fmt_mois_annee', ['mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]));
634
+            } else {
635
+                return $annee;
636
+            }
637
+
638
+        case 'nom_mois':
639
+            return $nommois;
640
+
641
+        case 'mois':
642
+            return sprintf('%02s', $mois);
643
+
644
+        case 'jour':
645
+            return $jour;
646
+
647
+        case 'journum':
648
+            return $journum;
649
+
650
+        case 'nom_jour':
651
+            if (!$mois or !$njour) {
652
+                return '';
653
+            }
654
+            $nom = mktime(1, 1, 1, $mois, $njour, $annee);
655
+            $nom = 1 + (int) date('w', $nom);
656
+            $param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
657
+
658
+            return _T('date_jour_' . $nom . $param);
659
+
660
+        case 'mois_annee':
661
+            if ($avjc) {
662
+                return $annee;
663
+            }
664
+
665
+            return trim(_T('date_fmt_mois_annee', ['mois' => $mois, 'nommois' => $nommois, 'annee' => $annee]));
666
+
667
+        case 'annee':
668
+            return $annee;
669
+
670
+        // Cas d'une vue non definie : retomber sur le format
671
+        // de date propose par http://www.php.net/date
672
+        default:
673
+            [$annee, $mois, $jour, $heures, $minutes, $secondes] = $date_array;
674
+            if (!$time = mktime($heures, $minutes, $secondes, $mois, (int) $jour, $annee)) {
675
+                $time = strtotime($numdate);
676
+            }
677
+            return date($vue, $time);
678
+    }
679 679
 }
680 680
 
681 681
 
@@ -702,11 +702,11 @@  discard block
 block discarded – undo
702 702
  *     Nom du jour
703 703
  **/
704 704
 function nom_jour($numdate, $forme = ''): string {
705
-	if (!($forme === 'abbr' or $forme === 'initiale')) {
706
-		$forme = '';
707
-	}
705
+    if (!($forme === 'abbr' or $forme === 'initiale')) {
706
+        $forme = '';
707
+    }
708 708
 
709
-	return affdate_base($numdate, 'nom_jour', ['param' => $forme]);
709
+    return affdate_base($numdate, 'nom_jour', ['param' => $forme]);
710 710
 }
711 711
 
712 712
 /**
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
  *     Numéro du jour
729 729
  **/
730 730
 function jour($numdate): string {
731
-	return affdate_base($numdate, 'jour');
731
+    return affdate_base($numdate, 'jour');
732 732
 }
733 733
 
734 734
 /**
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
  *     Numéro du jour
747 747
  **/
748 748
 function journum($numdate): string {
749
-	return affdate_base($numdate, 'journum');
749
+    return affdate_base($numdate, 'journum');
750 750
 }
751 751
 
752 752
 /**
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
  *     Numéro du mois (sur 2 chiffres)
765 765
  **/
766 766
 function mois($numdate): string {
767
-	return  affdate_base($numdate, 'mois');
767
+    return  affdate_base($numdate, 'mois');
768 768
 }
769 769
 
770 770
 /**
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
  *     Nom du mois
789 789
  **/
790 790
 function nom_mois($numdate, $forme = ''): string {
791
-	if (!($forme === 'abbr')) {
792
-		$forme = '';
793
-	}
791
+    if (!($forme === 'abbr')) {
792
+        $forme = '';
793
+    }
794 794
 
795
-	return affdate_base($numdate, 'nom_mois', ['param' => $forme]);
795
+    return affdate_base($numdate, 'nom_mois', ['param' => $forme]);
796 796
 }
797 797
 
798 798
 /**
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
  *     Année (sur 4 chiffres)
811 811
  **/
812 812
 function annee($numdate): string {
813
-	return affdate_base($numdate, 'annee');
813
+    return affdate_base($numdate, 'annee');
814 814
 }
815 815
 
816 816
 
@@ -840,11 +840,11 @@  discard block
 block discarded – undo
840 840
  *     La date formatée
841 841
  **/
842 842
 function saison($numdate, $hemisphere = 'nord'): string {
843
-	if ($hemisphere !== 'sud') {
844
-		$hemisphere = 'nord';
845
-	}
843
+    if ($hemisphere !== 'sud') {
844
+        $hemisphere = 'nord';
845
+    }
846 846
 
847
-	return affdate_base($numdate, 'saison', ['param' => $hemisphere]);
847
+    return affdate_base($numdate, 'saison', ['param' => $hemisphere]);
848 848
 }
849 849
 
850 850
 
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
  *     La date formatée
874 874
  **/
875 875
 function saison_annee($numdate, $hemisphere = 'nord'): string {
876
-	if ($hemisphere !== 'sud') {
877
-		$hemisphere = 'nord';
878
-	}
876
+    if ($hemisphere !== 'sud') {
877
+        $hemisphere = 'nord';
878
+    }
879 879
 
880
-	return affdate_base($numdate, 'saison_annee', ['param' => $hemisphere]);
880
+    return affdate_base($numdate, 'saison_annee', ['param' => $hemisphere]);
881 881
 }
882 882
 
883 883
 /**
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
  *     La date formatée
906 906
  **/
907 907
 function affdate($numdate, $format = 'entier'): string {
908
-	return affdate_base($numdate, $format);
908
+    return affdate_base($numdate, $format);
909 909
 }
910 910
 
911 911
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
  *     La date formatée
933 933
  **/
934 934
 function affdate_court($numdate, $annee_courante = null): string {
935
-	return affdate_base($numdate, 'court', ['annee_courante' => $annee_courante]);
935
+    return affdate_base($numdate, 'court', ['annee_courante' => $annee_courante]);
936 936
 }
937 937
 
938 938
 
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
  *     La date formatée
960 960
  **/
961 961
 function affdate_jourcourt($numdate, $annee_courante = null): string {
962
-	return affdate_base($numdate, 'jourcourt', ['annee_courante' => $annee_courante]);
962
+    return affdate_base($numdate, 'jourcourt', ['annee_courante' => $annee_courante]);
963 963
 }
964 964
 
965 965
 /**
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
  *     La date formatée
978 978
  **/
979 979
 function affdate_mois_annee($numdate): string {
980
-	return affdate_base($numdate, 'mois_annee');
980
+    return affdate_base($numdate, 'mois_annee');
981 981
 }
982 982
 
983 983
 /**
@@ -995,16 +995,16 @@  discard block
 block discarded – undo
995 995
  *     La date formatée, sinon ''
996 996
  **/
997 997
 function affdate_heure($numdate): string {
998
-	$date_array = recup_date($numdate);
999
-	if (!$date_array) {
1000
-		return '';
1001
-	}
1002
-	[$annee, $mois, $jour, $heures, $minutes, $sec] = $date_array;
1003
-
1004
-	return _T('date_fmt_jour_heure', [
1005
-		'jour' => affdate($numdate),
1006
-		'heure' => _T('date_fmt_heures_minutes', ['h' => $heures, 'm' => $minutes])
1007
-	]);
998
+    $date_array = recup_date($numdate);
999
+    if (!$date_array) {
1000
+        return '';
1001
+    }
1002
+    [$annee, $mois, $jour, $heures, $minutes, $sec] = $date_array;
1003
+
1004
+    return _T('date_fmt_jour_heure', [
1005
+        'jour' => affdate($numdate),
1006
+        'heure' => _T('date_fmt_heures_minutes', ['h' => $heures, 'm' => $minutes])
1007
+    ]);
1008 1008
 }
1009 1009
 
1010 1010
 /**
@@ -1036,117 +1036,117 @@  discard block
 block discarded – undo
1036 1036
  *     texte de la date
1037 1037
  */
1038 1038
 function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = ''): string {
1039
-	$abbr = $jour = '';
1040
-	$affdate = 'affdate_jourcourt';
1041
-	if (strpos($forme, 'abbr') !== false) {
1042
-		$abbr = 'abbr';
1043
-	}
1044
-	if (strpos($forme, 'annee') !== false) {
1045
-		$affdate = 'affdate';
1046
-	}
1047
-	if (strpos($forme, 'jour') !== false) {
1048
-		$jour = 'jour';
1049
-	}
1050
-
1051
-	$dtstart = $dtend = $dtabbr = '';
1052
-	if (strpos($forme, 'hcal') !== false) {
1053
-		$dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1054
-		$dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1055
-		$dtabbr = '</abbr>';
1056
-	}
1057
-
1058
-	$date_debut = strtotime($date_debut);
1059
-	$date_fin = strtotime($date_fin);
1060
-	$d = date('Y-m-d', $date_debut);
1061
-	$f = date('Y-m-d', $date_fin);
1062
-	$h = ($horaire === 'oui' or $horaire === true);
1063
-	$hd = _T('date_fmt_heures_minutes_court', ['h' => date('H', $date_debut), 'm' => date('i', $date_debut)]);
1064
-	$hf = _T('date_fmt_heures_minutes_court', ['h' => date('H', $date_fin), 'm' => date('i', $date_fin)]);
1065
-
1066
-	if ($d == $f) { // meme jour
1067
-		$nomjour = nom_jour($d, $abbr);
1068
-		$s = $affdate($d);
1069
-		$s = _T('date_fmt_jour', ['nomjour' => $nomjour, 'jour' => $s]);
1070
-		if ($h) {
1071
-			if ($hd == $hf) {
1072
-				// Lundi 20 fevrier a 18h25
1073
-				$s = spip_ucfirst(_T('date_fmt_jour_heure', ['jour' => $s, 'heure' => $hd]));
1074
-				$s = "$dtstart$s$dtabbr";
1075
-			} else {
1076
-				// Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr>
1077
-				if ($dtabbr && $dtstart && $dtend) {
1078
-					$s = _T(
1079
-						'date_fmt_jour_heure_debut_fin_abbr',
1080
-						[
1081
-						'jour' => spip_ucfirst($s),
1082
-						'heure_debut' => $hd,
1083
-						'heure_fin' => $hf,
1084
-						'dtstart' => $dtstart,
1085
-						'dtend' => $dtend,
1086
-						'dtabbr' => $dtabbr
1087
-						],
1088
-						[
1089
-							'sanitize' => false
1090
-						]
1091
-					);
1092
-				} // Le lundi 20 fevrier de 18h00 a 20h00
1093
-				else {
1094
-					$s = spip_ucfirst(_T(
1095
-						'date_fmt_jour_heure_debut_fin',
1096
-						['jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf]
1097
-					));
1098
-				}
1099
-			}
1100
-		} else {
1101
-			if ($dtabbr && $dtstart) {
1102
-				$s = $dtstart . spip_ucfirst($s) . $dtabbr;
1103
-			} else {
1104
-				$s = spip_ucfirst($s);
1105
-			}
1106
-		}
1107
-	} else {
1108
-		if ((date('Y-m', $date_debut)) == date('Y-m', $date_fin)) { // meme annee et mois, jours differents
1109
-			if (!$h) {
1110
-				$date_debut = jour($d);
1111
-			} else {
1112
-				$date_debut = affdate_jourcourt($d, date('Y', $date_fin));
1113
-			}
1114
-			$date_fin = $affdate($f);
1115
-			if ($jour) {
1116
-				$nomjour_debut = nom_jour($d, $abbr);
1117
-				$date_debut = _T('date_fmt_jour', ['nomjour' => $nomjour_debut, 'jour' => $date_debut]);
1118
-				$nomjour_fin = nom_jour($f, $abbr);
1119
-				$date_fin = _T('date_fmt_jour', ['nomjour' => $nomjour_fin, 'jour' => $date_fin]);
1120
-			}
1121
-			if ($h) {
1122
-				$date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1123
-				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1124
-			}
1125
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1126
-			$date_fin = $dtend . $date_fin . $dtabbr;
1127
-
1128
-			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1129
-		} else {
1130
-			$date_debut = affdate_jourcourt($d, date('Y', $date_fin));
1131
-			$date_fin = $affdate($f);
1132
-			if ($jour) {
1133
-				$nomjour_debut = nom_jour($d, $abbr);
1134
-				$date_debut = _T('date_fmt_jour', ['nomjour' => $nomjour_debut, 'jour' => $date_debut]);
1135
-				$nomjour_fin = nom_jour($f, $abbr);
1136
-				$date_fin = _T('date_fmt_jour', ['nomjour' => $nomjour_fin, 'jour' => $date_fin]);
1137
-			}
1138
-			if ($h) {
1139
-				$date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1140
-				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1141
-			}
1142
-
1143
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1144
-			$date_fin = $dtend . $date_fin . $dtabbr;
1145
-			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1146
-		}
1147
-	}
1148
-
1149
-	return $s;
1039
+    $abbr = $jour = '';
1040
+    $affdate = 'affdate_jourcourt';
1041
+    if (strpos($forme, 'abbr') !== false) {
1042
+        $abbr = 'abbr';
1043
+    }
1044
+    if (strpos($forme, 'annee') !== false) {
1045
+        $affdate = 'affdate';
1046
+    }
1047
+    if (strpos($forme, 'jour') !== false) {
1048
+        $jour = 'jour';
1049
+    }
1050
+
1051
+    $dtstart = $dtend = $dtabbr = '';
1052
+    if (strpos($forme, 'hcal') !== false) {
1053
+        $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1054
+        $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1055
+        $dtabbr = '</abbr>';
1056
+    }
1057
+
1058
+    $date_debut = strtotime($date_debut);
1059
+    $date_fin = strtotime($date_fin);
1060
+    $d = date('Y-m-d', $date_debut);
1061
+    $f = date('Y-m-d', $date_fin);
1062
+    $h = ($horaire === 'oui' or $horaire === true);
1063
+    $hd = _T('date_fmt_heures_minutes_court', ['h' => date('H', $date_debut), 'm' => date('i', $date_debut)]);
1064
+    $hf = _T('date_fmt_heures_minutes_court', ['h' => date('H', $date_fin), 'm' => date('i', $date_fin)]);
1065
+
1066
+    if ($d == $f) { // meme jour
1067
+        $nomjour = nom_jour($d, $abbr);
1068
+        $s = $affdate($d);
1069
+        $s = _T('date_fmt_jour', ['nomjour' => $nomjour, 'jour' => $s]);
1070
+        if ($h) {
1071
+            if ($hd == $hf) {
1072
+                // Lundi 20 fevrier a 18h25
1073
+                $s = spip_ucfirst(_T('date_fmt_jour_heure', ['jour' => $s, 'heure' => $hd]));
1074
+                $s = "$dtstart$s$dtabbr";
1075
+            } else {
1076
+                // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr>
1077
+                if ($dtabbr && $dtstart && $dtend) {
1078
+                    $s = _T(
1079
+                        'date_fmt_jour_heure_debut_fin_abbr',
1080
+                        [
1081
+                        'jour' => spip_ucfirst($s),
1082
+                        'heure_debut' => $hd,
1083
+                        'heure_fin' => $hf,
1084
+                        'dtstart' => $dtstart,
1085
+                        'dtend' => $dtend,
1086
+                        'dtabbr' => $dtabbr
1087
+                        ],
1088
+                        [
1089
+                            'sanitize' => false
1090
+                        ]
1091
+                    );
1092
+                } // Le lundi 20 fevrier de 18h00 a 20h00
1093
+                else {
1094
+                    $s = spip_ucfirst(_T(
1095
+                        'date_fmt_jour_heure_debut_fin',
1096
+                        ['jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf]
1097
+                    ));
1098
+                }
1099
+            }
1100
+        } else {
1101
+            if ($dtabbr && $dtstart) {
1102
+                $s = $dtstart . spip_ucfirst($s) . $dtabbr;
1103
+            } else {
1104
+                $s = spip_ucfirst($s);
1105
+            }
1106
+        }
1107
+    } else {
1108
+        if ((date('Y-m', $date_debut)) == date('Y-m', $date_fin)) { // meme annee et mois, jours differents
1109
+            if (!$h) {
1110
+                $date_debut = jour($d);
1111
+            } else {
1112
+                $date_debut = affdate_jourcourt($d, date('Y', $date_fin));
1113
+            }
1114
+            $date_fin = $affdate($f);
1115
+            if ($jour) {
1116
+                $nomjour_debut = nom_jour($d, $abbr);
1117
+                $date_debut = _T('date_fmt_jour', ['nomjour' => $nomjour_debut, 'jour' => $date_debut]);
1118
+                $nomjour_fin = nom_jour($f, $abbr);
1119
+                $date_fin = _T('date_fmt_jour', ['nomjour' => $nomjour_fin, 'jour' => $date_fin]);
1120
+            }
1121
+            if ($h) {
1122
+                $date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1123
+                $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1124
+            }
1125
+            $date_debut = $dtstart . $date_debut . $dtabbr;
1126
+            $date_fin = $dtend . $date_fin . $dtabbr;
1127
+
1128
+            $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1129
+        } else {
1130
+            $date_debut = affdate_jourcourt($d, date('Y', $date_fin));
1131
+            $date_fin = $affdate($f);
1132
+            if ($jour) {
1133
+                $nomjour_debut = nom_jour($d, $abbr);
1134
+                $date_debut = _T('date_fmt_jour', ['nomjour' => $nomjour_debut, 'jour' => $date_debut]);
1135
+                $nomjour_fin = nom_jour($f, $abbr);
1136
+                $date_fin = _T('date_fmt_jour', ['nomjour' => $nomjour_fin, 'jour' => $date_fin]);
1137
+            }
1138
+            if ($h) {
1139
+                $date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1140
+                $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1141
+            }
1142
+
1143
+            $date_debut = $dtstart . $date_debut . $dtabbr;
1144
+            $date_fin = $dtend . $date_fin . $dtabbr;
1145
+            $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1146
+        }
1147
+    }
1148
+
1149
+    return $s;
1150 1150
 }
1151 1151
 
1152 1152
 /**
@@ -1167,10 +1167,10 @@  discard block
 block discarded – undo
1167 1167
  *     Date au format ical
1168 1168
  **/
1169 1169
 function date_ical($date, $addminutes = 0): string {
1170
-	[$heures, $minutes, $secondes] = recup_heure($date);
1171
-	[$annee, $mois, $jour] = recup_date($date);
1170
+    [$heures, $minutes, $secondes] = recup_heure($date);
1171
+    [$annee, $mois, $jour] = recup_date($date);
1172 1172
 
1173
-	return gmdate('Ymd\THis\Z', mktime($heures, $minutes + $addminutes, $secondes, $mois, $jour, $annee));
1173
+    return gmdate('Ymd\THis\Z', mktime($heures, $minutes + $addminutes, $secondes, $mois, $jour, $annee));
1174 1174
 }
1175 1175
 
1176 1176
 
@@ -1194,11 +1194,11 @@  discard block
 block discarded – undo
1194 1194
  *     La date formatée
1195 1195
  **/
1196 1196
 function date_iso($date_heure): string {
1197
-	[$annee, $mois, $jour] = recup_date($date_heure);
1198
-	[$heures, $minutes, $secondes] = recup_heure($date_heure);
1199
-	$time = @mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
1197
+    [$annee, $mois, $jour] = recup_date($date_heure);
1198
+    [$heures, $minutes, $secondes] = recup_heure($date_heure);
1199
+    $time = @mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
1200 1200
 
1201
-	return gmdate('Y-m-d\TH:i:s\Z', $time);
1201
+    return gmdate('Y-m-d\TH:i:s\Z', $time);
1202 1202
 }
1203 1203
 
1204 1204
 /**
@@ -1221,11 +1221,11 @@  discard block
 block discarded – undo
1221 1221
  *     La date formatée
1222 1222
  **/
1223 1223
 function date_822($date_heure): string {
1224
-	[$annee, $mois, $jour] = recup_date($date_heure);
1225
-	[$heures, $minutes, $secondes] = recup_heure($date_heure);
1226
-	$time = mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
1224
+    [$annee, $mois, $jour] = recup_date($date_heure);
1225
+    [$heures, $minutes, $secondes] = recup_heure($date_heure);
1226
+    $time = mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
1227 1227
 
1228
-	return date('r', $time);
1228
+    return date('r', $time);
1229 1229
 }
1230 1230
 
1231 1231
 /**
@@ -1241,11 +1241,11 @@  discard block
 block discarded – undo
1241 1241
  *     Date au format `Ymd`
1242 1242
  **/
1243 1243
 function date_anneemoisjour($d): string {
1244
-	if (!$d) {
1245
-		$d = date('Y-m-d');
1246
-	}
1244
+    if (!$d) {
1245
+        $d = date('Y-m-d');
1246
+    }
1247 1247
 
1248
-	return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1248
+    return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1249 1249
 }
1250 1250
 
1251 1251
 /**
@@ -1261,11 +1261,11 @@  discard block
 block discarded – undo
1261 1261
  *     Date au format `Ym`
1262 1262
  **/
1263 1263
 function date_anneemois($d): string {
1264
-	if (!$d) {
1265
-		$d = date('Y-m-d');
1266
-	}
1264
+    if (!$d) {
1265
+        $d = date('Y-m-d');
1266
+    }
1267 1267
 
1268
-	return substr($d, 0, 4) . substr($d, 5, 2);
1268
+    return substr($d, 0, 4) . substr($d, 5, 2);
1269 1269
 }
1270 1270
 
1271 1271
 /**
@@ -1281,13 +1281,13 @@  discard block
 block discarded – undo
1281 1281
  *     Date au lundi de la même semaine au format `Ymd`
1282 1282
  **/
1283 1283
 function date_debut_semaine($annee, $mois, $jour): string {
1284
-	$w_day = date('w', mktime(0, 0, 0, $mois, $jour, $annee));
1285
-	if ($w_day == 0) {
1286
-		$w_day = 7;
1287
-	} // Gaffe: le dimanche est zero
1288
-	$debut = $jour - $w_day + 1;
1284
+    $w_day = date('w', mktime(0, 0, 0, $mois, $jour, $annee));
1285
+    if ($w_day == 0) {
1286
+        $w_day = 7;
1287
+    } // Gaffe: le dimanche est zero
1288
+    $debut = $jour - $w_day + 1;
1289 1289
 
1290
-	return date('Ymd', mktime(0, 0, 0, $mois, $debut, $annee));
1290
+    return date('Ymd', mktime(0, 0, 0, $mois, $debut, $annee));
1291 1291
 }
1292 1292
 
1293 1293
 /**
@@ -1303,11 +1303,11 @@  discard block
 block discarded – undo
1303 1303
  *     Date au dimanche de la même semaine au format `Ymd`
1304 1304
  **/
1305 1305
 function date_fin_semaine($annee, $mois, $jour): string {
1306
-	$w_day = date('w', mktime(0, 0, 0, $mois, $jour, $annee));
1307
-	if ($w_day == 0) {
1308
-		$w_day = 7;
1309
-	} // Gaffe: le dimanche est zero
1310
-	$debut = $jour - $w_day + 1;
1306
+    $w_day = date('w', mktime(0, 0, 0, $mois, $jour, $annee));
1307
+    if ($w_day == 0) {
1308
+        $w_day = 7;
1309
+    } // Gaffe: le dimanche est zero
1310
+    $debut = $jour - $w_day + 1;
1311 1311
 
1312
-	return date('Ymd', mktime(0, 0, 0, $mois, $debut + 6, $annee));
1312
+    return date('Ymd', mktime(0, 0, 0, $mois, $debut + 6, $annee));
1313 1313
 }
Please login to merge, or discard this patch.
ecrire/lang/spip_eo.php 1 patch
Indentation   +657 added lines, -657 removed lines patch added patch discarded remove patch
@@ -4,584 +4,584 @@  discard block
 block discarded – undo
4 4
 // ** ne pas modifier le fichier **
5 5
 
6 6
 if (!defined('_ECRIRE_INC_VERSION')) {
7
-	return;
7
+    return;
8 8
 }
9 9
 
10 10
 $GLOBALS[$GLOBALS['idx_lang']] = array(
11 11
 
12
-	// A
13
-	'access_interface_graphique' => 'Reen al kompleta grafika interfaco',
14
-	'access_mode_texte' => 'Afiŝi la simpligitan tekstan interfacon',
15
-	'admin_debug' => 'erarserĉilo',
16
-	'admin_modifier_article' => 'Modifu tiun ĉi artikolon',
17
-	'admin_modifier_auteur' => 'Modifu tiun ĉi aŭtoron',
18
-	'admin_modifier_breve' => 'Modifu tiun ĉi fulm-informon',
19
-	'admin_modifier_mot' => 'Modifu tiun ĉi ŝlosilvorton',
20
-	'admin_modifier_rubrique' => 'Modifu tiun ĉi rubrikon',
21
-	'admin_recalculer' => 'Rekalkulu tiun ĉi paĝon',
22
-	'afficher_calendrier' => 'Montri la kalendaro',
23
-	'afficher_trad' => 'afiŝi la tradukojn',
24
-	'alerte_maj_impossible' => '<b>Alarmo !</b> La ĝisdatigo de la SQL-datenbazo al versio @version@ ne eblas pro datenbazo-modif-rajtaj kialoj. Bonvolu kontakti vian retgastiganton.',
25
-	'alerte_modif_info_concourante' => 'ATENTU : Tiu ĉi informo estis modifita de alia homo. La nuna stato estas :',
26
-	'analyse_xml' => 'XML analizo',
27
-	'annuler' => 'Nuligi',
28
-	'antispam_champ_vide' => 'Bonvolu forlasi tiun tajpujon malplena :',
29
-	'articles_recents' => 'La plej freŝaj artikoloj',
30
-	'avis_1_erreur_saisie' => 'Estas 1 eraro en via tajpado, bonvolu kontroli ĝin.',
31
-	'avis_archive_incorrect' => 'Tiu arkivo ne estas SPIP-dosiero',
32
-	'avis_archive_invalide' => 'Tiu arkiva dosiero ne validas',
33
-	'avis_attention' => 'ATENTU !',
34
-	'avis_champ_incorrect_type_objet' => 'Erara tajpuja nomo @name@ por la objekto de tipo @type@',
35
-	'avis_colonne_inexistante' => 'La kolumno @col@ ne ekzistas',
36
-	'avis_erreur' => 'Eraro : vidu ĉi-sube',
37
-	'avis_erreur_connexion' => 'Konekt-eraro',
38
-	'avis_erreur_cookie' => 'kuketo-problemo',
39
-	'avis_erreur_fonction_contexte' => 'Program-eraro. Tiu funkcio ne alvokeblas en tiu ĉi kunteksto.',
40
-	'avis_erreur_mysql' => 'SQL-eraro',
41
-	'avis_erreur_sauvegarde' => 'Konservo-eraro (@type@ @id_objet@) ! ',
42
-	'avis_erreur_visiteur' => 'Alir-problemo al la privata spaco',
43
-	'avis_nb_erreurs_saisie' => 'Estas @nb@ eraroj en via tajpado, bonvolu kontroli ilin.',
12
+    // A
13
+    'access_interface_graphique' => 'Reen al kompleta grafika interfaco',
14
+    'access_mode_texte' => 'Afiŝi la simpligitan tekstan interfacon',
15
+    'admin_debug' => 'erarserĉilo',
16
+    'admin_modifier_article' => 'Modifu tiun ĉi artikolon',
17
+    'admin_modifier_auteur' => 'Modifu tiun ĉi aŭtoron',
18
+    'admin_modifier_breve' => 'Modifu tiun ĉi fulm-informon',
19
+    'admin_modifier_mot' => 'Modifu tiun ĉi ŝlosilvorton',
20
+    'admin_modifier_rubrique' => 'Modifu tiun ĉi rubrikon',
21
+    'admin_recalculer' => 'Rekalkulu tiun ĉi paĝon',
22
+    'afficher_calendrier' => 'Montri la kalendaro',
23
+    'afficher_trad' => 'afiŝi la tradukojn',
24
+    'alerte_maj_impossible' => '<b>Alarmo !</b> La ĝisdatigo de la SQL-datenbazo al versio @version@ ne eblas pro datenbazo-modif-rajtaj kialoj. Bonvolu kontakti vian retgastiganton.',
25
+    'alerte_modif_info_concourante' => 'ATENTU : Tiu ĉi informo estis modifita de alia homo. La nuna stato estas :',
26
+    'analyse_xml' => 'XML analizo',
27
+    'annuler' => 'Nuligi',
28
+    'antispam_champ_vide' => 'Bonvolu forlasi tiun tajpujon malplena :',
29
+    'articles_recents' => 'La plej freŝaj artikoloj',
30
+    'avis_1_erreur_saisie' => 'Estas 1 eraro en via tajpado, bonvolu kontroli ĝin.',
31
+    'avis_archive_incorrect' => 'Tiu arkivo ne estas SPIP-dosiero',
32
+    'avis_archive_invalide' => 'Tiu arkiva dosiero ne validas',
33
+    'avis_attention' => 'ATENTU !',
34
+    'avis_champ_incorrect_type_objet' => 'Erara tajpuja nomo @name@ por la objekto de tipo @type@',
35
+    'avis_colonne_inexistante' => 'La kolumno @col@ ne ekzistas',
36
+    'avis_erreur' => 'Eraro : vidu ĉi-sube',
37
+    'avis_erreur_connexion' => 'Konekt-eraro',
38
+    'avis_erreur_cookie' => 'kuketo-problemo',
39
+    'avis_erreur_fonction_contexte' => 'Program-eraro. Tiu funkcio ne alvokeblas en tiu ĉi kunteksto.',
40
+    'avis_erreur_mysql' => 'SQL-eraro',
41
+    'avis_erreur_sauvegarde' => 'Konservo-eraro (@type@ @id_objet@) ! ',
42
+    'avis_erreur_visiteur' => 'Alir-problemo al la privata spaco',
43
+    'avis_nb_erreurs_saisie' => 'Estas @nb@ eraroj en via tajpado, bonvolu kontroli ilin.',
44 44
 
45
-	// B
46
-	'barre_a_accent_grave' => 'Entajpi malakut-akcentan ĉefliteran A',
47
-	'barre_aide' => 'Uzu la tipografiajn rapidligilojn por pliriĉigi vian enpaĝigon',
48
-	'barre_e_accent_aigu' => 'Entajpi malakut-akcentan ĉefliteran E',
49
-	'barre_eo' => 'Entajpi E en ĉefliteran O',
50
-	'barre_eo_maj' => 'Entajpi E en la ĉeflitero O',
51
-	'barre_euro' => 'Entajpi la simbolon €',
52
-	'barre_gras' => '{{Grasigi}}',
53
-	'barre_guillemets' => 'Flanki per « citiloj »',
54
-	'barre_guillemets_simples' => 'Flanki per “simplaj citiloj”',
55
-	'barre_intertitre' => '{{{Intertitoligi}}}',
56
-	'barre_italic' => '{Kursivigi}',
57
-	'barre_lien' => 'Transformi al [hiperligo->http://...]',
58
-	'barre_lien_input' => 'Bonvolu indiki la retadreson de via ligilo (vi povas indiki ret-adreson tian, kia http://www.monsite.com aŭ simple indiki la numeron de artikolo de tiu retejo.',
59
-	'barre_note' => 'Transformi al [[sub-paĝan noton]]',
60
-	'barre_paragraphe' => 'Krei paragrafon',
61
-	'barre_quote' => '<quote>Citi mesaĝon</quote>',
62
-	'bouton_changer' => 'Ŝanĝi',
63
-	'bouton_chercher' => 'Serĉi',
64
-	'bouton_choisir' => 'Elekti',
65
-	'bouton_deplacer' => 'Movi',
66
-	'bouton_download' => 'Elŝuti',
67
-	'bouton_enregistrer' => 'Registri',
68
-	'bouton_radio_desactiver_messagerie_interne' => 'Malŝalti la internan mesaĝilon',
69
-	'bouton_radio_envoi_annonces' => 'Sendi la ĉefartikolajn anoncojn',
70
-	'bouton_radio_non_envoi_annonces' => 'Ne sendi anoncojn',
71
-	'bouton_radio_non_envoi_liste_nouveautes' => 'Ne sendi liston de novaĵoj',
72
-	'bouton_recharger_page' => 'freŝigi tiun paĝon',
73
-	'bouton_telecharger' => 'Alŝuti',
74
-	'bouton_upload' => 'Alŝuti',
75
-	'bouton_valider' => 'Validigi',
45
+    // B
46
+    'barre_a_accent_grave' => 'Entajpi malakut-akcentan ĉefliteran A',
47
+    'barre_aide' => 'Uzu la tipografiajn rapidligilojn por pliriĉigi vian enpaĝigon',
48
+    'barre_e_accent_aigu' => 'Entajpi malakut-akcentan ĉefliteran E',
49
+    'barre_eo' => 'Entajpi E en ĉefliteran O',
50
+    'barre_eo_maj' => 'Entajpi E en la ĉeflitero O',
51
+    'barre_euro' => 'Entajpi la simbolon €',
52
+    'barre_gras' => '{{Grasigi}}',
53
+    'barre_guillemets' => 'Flanki per « citiloj »',
54
+    'barre_guillemets_simples' => 'Flanki per “simplaj citiloj”',
55
+    'barre_intertitre' => '{{{Intertitoligi}}}',
56
+    'barre_italic' => '{Kursivigi}',
57
+    'barre_lien' => 'Transformi al [hiperligo->http://...]',
58
+    'barre_lien_input' => 'Bonvolu indiki la retadreson de via ligilo (vi povas indiki ret-adreson tian, kia http://www.monsite.com aŭ simple indiki la numeron de artikolo de tiu retejo.',
59
+    'barre_note' => 'Transformi al [[sub-paĝan noton]]',
60
+    'barre_paragraphe' => 'Krei paragrafon',
61
+    'barre_quote' => '<quote>Citi mesaĝon</quote>',
62
+    'bouton_changer' => 'Ŝanĝi',
63
+    'bouton_chercher' => 'Serĉi',
64
+    'bouton_choisir' => 'Elekti',
65
+    'bouton_deplacer' => 'Movi',
66
+    'bouton_download' => 'Elŝuti',
67
+    'bouton_enregistrer' => 'Registri',
68
+    'bouton_radio_desactiver_messagerie_interne' => 'Malŝalti la internan mesaĝilon',
69
+    'bouton_radio_envoi_annonces' => 'Sendi la ĉefartikolajn anoncojn',
70
+    'bouton_radio_non_envoi_annonces' => 'Ne sendi anoncojn',
71
+    'bouton_radio_non_envoi_liste_nouveautes' => 'Ne sendi liston de novaĵoj',
72
+    'bouton_recharger_page' => 'freŝigi tiun paĝon',
73
+    'bouton_telecharger' => 'Alŝuti',
74
+    'bouton_upload' => 'Alŝuti',
75
+    'bouton_valider' => 'Validigi',
76 76
 
77
-	// C
78
-	'cal_apresmidi' => 'posttagmezo',
79
-	'cal_jour_entier' => 'tuta tago',
80
-	'cal_matin' => 'mateno',
81
-	'cal_par_jour' => 'tag-kalendaro',
82
-	'cal_par_mois' => 'monat-kalendaro',
83
-	'cal_par_semaine' => 'semajn-kalendaro',
84
-	'choix_couleur_interface' => 'koloro',
85
-	'choix_interface' => 'elekto de interfaco',
86
-	'colonne' => 'Kolumno',
87
-	'confirm_changer_statut' => 'Atentu, vi petis por ŝanĝi la statuton de tiu elemento. Ĉu vi deziras daŭrigi ?',
88
-	'correcte' => 'korekta',
77
+    // C
78
+    'cal_apresmidi' => 'posttagmezo',
79
+    'cal_jour_entier' => 'tuta tago',
80
+    'cal_matin' => 'mateno',
81
+    'cal_par_jour' => 'tag-kalendaro',
82
+    'cal_par_mois' => 'monat-kalendaro',
83
+    'cal_par_semaine' => 'semajn-kalendaro',
84
+    'choix_couleur_interface' => 'koloro',
85
+    'choix_interface' => 'elekto de interfaco',
86
+    'colonne' => 'Kolumno',
87
+    'confirm_changer_statut' => 'Atentu, vi petis por ŝanĝi la statuton de tiu elemento. Ĉu vi deziras daŭrigi ?',
88
+    'correcte' => 'korekta',
89 89
 
90
-	// D
91
-	'date_aujourdhui' => 'hodiaŭ',
92
-	'date_avant_jc' => 'a.K.',
93
-	'date_dans' => 'post @delai@',
94
-	'date_de_mois_1' => '@j@ @nommois@',
95
-	'date_de_mois_10' => '@j@ @nommois@',
96
-	'date_de_mois_11' => '@j@ @nommois@',
97
-	'date_de_mois_12' => '@j@ @nommois@',
98
-	'date_de_mois_2' => '@j@ @nommois@',
99
-	'date_de_mois_3' => '@j@ @nommois@',
100
-	'date_de_mois_4' => '@j@ @nommois@',
101
-	'date_de_mois_5' => '@j@ @nommois@',
102
-	'date_de_mois_6' => '@j@ @nommois@',
103
-	'date_de_mois_7' => '@j@ @nommois@',
104
-	'date_de_mois_8' => '@j@ @nommois@',
105
-	'date_de_mois_9' => '@j@ @nommois@',
106
-	'date_demain' => 'morgaŭ',
107
-	'date_fmt_heures_minutes' => '@h@h@m@min',
108
-	'date_fmt_heures_minutes_court' => '@h@h@m@',
109
-	'date_fmt_jour' => '@nomjour@ la @jour@a',
110
-	'date_fmt_jour_heure' => '@jour@ je la @heure@',
111
-	'date_fmt_jour_heure_debut_fin' => 'la @jour@ de @heure_debut@ ĝis @heure_fin@',
112
-	'date_fmt_jour_heure_debut_fin_abbr' => 'la @dtstart@@jour@a de @heure_debut@@dtabbr@ ĝis @dtend@@heure_fin@@dtend@',
113
-	'date_fmt_jour_mois' => '@jour@a @nommois@',
114
-	'date_fmt_jour_mois_annee' => '@jour@a @nommois@ @annee@',
115
-	'date_fmt_mois_annee' => '@nommois@ @annee@',
116
-	'date_fmt_nomjour' => '@nomjour@ @date@',
117
-	'date_fmt_nomjour_date' => 'la @nomjour@ @date@',
118
-	'date_fmt_periode' => 'De @date_debut@ ĝis @date_fin@',
119
-	'date_fmt_periode_abbr' => 'De @dtart@@date_debut@@dtabbr@ ĝis @dtend@@date_fin@@dtabbr@',
120
-	'date_fmt_periode_from' => 'De',
121
-	'date_fmt_periode_to' => 'ĝis',
122
-	'date_fmt_saison_annee' => '@saison@ @annee@',
123
-	'date_heures' => 'horoj',
124
-	'date_hier' => 'hieraŭ',
125
-	'date_il_y_a' => 'antaŭ @delai@',
126
-	'date_jnum1' => '1',
127
-	'date_jnum10' => '10',
128
-	'date_jnum11' => '11',
129
-	'date_jnum12' => '12',
130
-	'date_jnum13' => '13',
131
-	'date_jnum14' => '14',
132
-	'date_jnum15' => '15',
133
-	'date_jnum16' => '16',
134
-	'date_jnum17' => '17',
135
-	'date_jnum18' => '18',
136
-	'date_jnum19' => '19',
137
-	'date_jnum2' => '2',
138
-	'date_jnum20' => '20',
139
-	'date_jnum21' => '21',
140
-	'date_jnum22' => '22',
141
-	'date_jnum23' => '23',
142
-	'date_jnum24' => '24',
143
-	'date_jnum25' => '25',
144
-	'date_jnum26' => '26',
145
-	'date_jnum27' => '27',
146
-	'date_jnum28' => '28',
147
-	'date_jnum29' => '29',
148
-	'date_jnum3' => '3',
149
-	'date_jnum30' => '30',
150
-	'date_jnum31' => '31',
151
-	'date_jnum4' => '4',
152
-	'date_jnum5' => '5',
153
-	'date_jnum6' => '6',
154
-	'date_jnum7' => '7',
155
-	'date_jnum8' => '8',
156
-	'date_jnum9' => '9',
157
-	'date_jour_1' => 'dimanĉo',
158
-	'date_jour_1_abbr' => 'dim.',
159
-	'date_jour_1_initiale' => 'd.',
160
-	'date_jour_2' => 'lundo',
161
-	'date_jour_2_abbr' => 'lun.',
162
-	'date_jour_2_initiale' => 'l.',
163
-	'date_jour_3' => 'mardo',
164
-	'date_jour_3_abbr' => 'mar.',
165
-	'date_jour_3_initiale' => 'm.',
166
-	'date_jour_4' => 'merkredo',
167
-	'date_jour_4_abbr' => 'mer.',
168
-	'date_jour_4_initiale' => 'm.',
169
-	'date_jour_5' => 'ĵaŭdo',
170
-	'date_jour_5_abbr' => 'jaŭ.',
171
-	'date_jour_5_initiale' => 'j.',
172
-	'date_jour_6' => 'vendredo',
173
-	'date_jour_6_abbr' => 'ven.',
174
-	'date_jour_6_initiale' => 'v.',
175
-	'date_jour_7' => 'sabato',
176
-	'date_jour_7_abbr' => 'sab.',
177
-	'date_jour_7_initiale' => 's.',
178
-	'date_jours' => 'tagoj',
179
-	'date_minutes' => 'minutoj',
180
-	'date_mois' => 'monatoj',
181
-	'date_mois_1' => 'januaro',
182
-	'date_mois_10' => 'oktobro',
183
-	'date_mois_10_abbr' => 'oct.',
184
-	'date_mois_11' => 'novembro',
185
-	'date_mois_11_abbr' => 'nov.',
186
-	'date_mois_12' => 'decembro',
187
-	'date_mois_12_abbr' => 'dec.',
188
-	'date_mois_1_abbr' => 'jan.',
189
-	'date_mois_2' => 'februaro',
190
-	'date_mois_2_abbr' => 'feb.',
191
-	'date_mois_3' => 'marto',
192
-	'date_mois_3_abbr' => 'mar.',
193
-	'date_mois_4' => 'aprilo',
194
-	'date_mois_4_abbr' => 'apr.',
195
-	'date_mois_5' => 'majo',
196
-	'date_mois_5_abbr' => 'majo',
197
-	'date_mois_6' => 'junio',
198
-	'date_mois_6_abbr' => 'jun.',
199
-	'date_mois_7' => 'julio',
200
-	'date_mois_7_abbr' => 'jul.',
201
-	'date_mois_8' => 'aŭgusto',
202
-	'date_mois_8_abbr' => 'aŭg.',
203
-	'date_mois_9' => 'septembro',
204
-	'date_mois_9_abbr' => 'sep.',
205
-	'date_saison_1' => 'vintro',
206
-	'date_saison_2' => 'printempo',
207
-	'date_saison_3' => 'somero',
208
-	'date_saison_4' => 'aŭtuno',
209
-	'date_secondes' => 'sekundoj',
210
-	'date_semaines' => 'semajnoj',
211
-	'date_un_mois' => 'monato',
212
-	'date_une_heure' => 'horo',
213
-	'date_une_minute' => 'minuto',
214
-	'date_une_seconde' => 'sekundo',
215
-	'date_une_semaine' => 'semajno',
216
-	'dirs_commencer' => ' por vere komenci la instalprocezon',
217
-	'dirs_preliminaire' => 'Antaŭfaro : <b>Difinu la alir-rajtojn</b>',
218
-	'dirs_probleme_droits' => 'Alir-rajta problemo',
219
-	'dirs_repertoires_absents' => '<b>La jenaj dosierujoj ne estas trovitaj : <ul>@bad_dirs@.</ul> </b>
90
+    // D
91
+    'date_aujourdhui' => 'hodiaŭ',
92
+    'date_avant_jc' => 'a.K.',
93
+    'date_dans' => 'post @delai@',
94
+    'date_de_mois_1' => '@j@ @nommois@',
95
+    'date_de_mois_10' => '@j@ @nommois@',
96
+    'date_de_mois_11' => '@j@ @nommois@',
97
+    'date_de_mois_12' => '@j@ @nommois@',
98
+    'date_de_mois_2' => '@j@ @nommois@',
99
+    'date_de_mois_3' => '@j@ @nommois@',
100
+    'date_de_mois_4' => '@j@ @nommois@',
101
+    'date_de_mois_5' => '@j@ @nommois@',
102
+    'date_de_mois_6' => '@j@ @nommois@',
103
+    'date_de_mois_7' => '@j@ @nommois@',
104
+    'date_de_mois_8' => '@j@ @nommois@',
105
+    'date_de_mois_9' => '@j@ @nommois@',
106
+    'date_demain' => 'morgaŭ',
107
+    'date_fmt_heures_minutes' => '@h@h@m@min',
108
+    'date_fmt_heures_minutes_court' => '@h@h@m@',
109
+    'date_fmt_jour' => '@nomjour@ la @jour@a',
110
+    'date_fmt_jour_heure' => '@jour@ je la @heure@',
111
+    'date_fmt_jour_heure_debut_fin' => 'la @jour@ de @heure_debut@ ĝis @heure_fin@',
112
+    'date_fmt_jour_heure_debut_fin_abbr' => 'la @dtstart@@jour@a de @heure_debut@@dtabbr@ ĝis @dtend@@heure_fin@@dtend@',
113
+    'date_fmt_jour_mois' => '@jour@a @nommois@',
114
+    'date_fmt_jour_mois_annee' => '@jour@a @nommois@ @annee@',
115
+    'date_fmt_mois_annee' => '@nommois@ @annee@',
116
+    'date_fmt_nomjour' => '@nomjour@ @date@',
117
+    'date_fmt_nomjour_date' => 'la @nomjour@ @date@',
118
+    'date_fmt_periode' => 'De @date_debut@ ĝis @date_fin@',
119
+    'date_fmt_periode_abbr' => 'De @dtart@@date_debut@@dtabbr@ ĝis @dtend@@date_fin@@dtabbr@',
120
+    'date_fmt_periode_from' => 'De',
121
+    'date_fmt_periode_to' => 'ĝis',
122
+    'date_fmt_saison_annee' => '@saison@ @annee@',
123
+    'date_heures' => 'horoj',
124
+    'date_hier' => 'hieraŭ',
125
+    'date_il_y_a' => 'antaŭ @delai@',
126
+    'date_jnum1' => '1',
127
+    'date_jnum10' => '10',
128
+    'date_jnum11' => '11',
129
+    'date_jnum12' => '12',
130
+    'date_jnum13' => '13',
131
+    'date_jnum14' => '14',
132
+    'date_jnum15' => '15',
133
+    'date_jnum16' => '16',
134
+    'date_jnum17' => '17',
135
+    'date_jnum18' => '18',
136
+    'date_jnum19' => '19',
137
+    'date_jnum2' => '2',
138
+    'date_jnum20' => '20',
139
+    'date_jnum21' => '21',
140
+    'date_jnum22' => '22',
141
+    'date_jnum23' => '23',
142
+    'date_jnum24' => '24',
143
+    'date_jnum25' => '25',
144
+    'date_jnum26' => '26',
145
+    'date_jnum27' => '27',
146
+    'date_jnum28' => '28',
147
+    'date_jnum29' => '29',
148
+    'date_jnum3' => '3',
149
+    'date_jnum30' => '30',
150
+    'date_jnum31' => '31',
151
+    'date_jnum4' => '4',
152
+    'date_jnum5' => '5',
153
+    'date_jnum6' => '6',
154
+    'date_jnum7' => '7',
155
+    'date_jnum8' => '8',
156
+    'date_jnum9' => '9',
157
+    'date_jour_1' => 'dimanĉo',
158
+    'date_jour_1_abbr' => 'dim.',
159
+    'date_jour_1_initiale' => 'd.',
160
+    'date_jour_2' => 'lundo',
161
+    'date_jour_2_abbr' => 'lun.',
162
+    'date_jour_2_initiale' => 'l.',
163
+    'date_jour_3' => 'mardo',
164
+    'date_jour_3_abbr' => 'mar.',
165
+    'date_jour_3_initiale' => 'm.',
166
+    'date_jour_4' => 'merkredo',
167
+    'date_jour_4_abbr' => 'mer.',
168
+    'date_jour_4_initiale' => 'm.',
169
+    'date_jour_5' => 'ĵaŭdo',
170
+    'date_jour_5_abbr' => 'jaŭ.',
171
+    'date_jour_5_initiale' => 'j.',
172
+    'date_jour_6' => 'vendredo',
173
+    'date_jour_6_abbr' => 'ven.',
174
+    'date_jour_6_initiale' => 'v.',
175
+    'date_jour_7' => 'sabato',
176
+    'date_jour_7_abbr' => 'sab.',
177
+    'date_jour_7_initiale' => 's.',
178
+    'date_jours' => 'tagoj',
179
+    'date_minutes' => 'minutoj',
180
+    'date_mois' => 'monatoj',
181
+    'date_mois_1' => 'januaro',
182
+    'date_mois_10' => 'oktobro',
183
+    'date_mois_10_abbr' => 'oct.',
184
+    'date_mois_11' => 'novembro',
185
+    'date_mois_11_abbr' => 'nov.',
186
+    'date_mois_12' => 'decembro',
187
+    'date_mois_12_abbr' => 'dec.',
188
+    'date_mois_1_abbr' => 'jan.',
189
+    'date_mois_2' => 'februaro',
190
+    'date_mois_2_abbr' => 'feb.',
191
+    'date_mois_3' => 'marto',
192
+    'date_mois_3_abbr' => 'mar.',
193
+    'date_mois_4' => 'aprilo',
194
+    'date_mois_4_abbr' => 'apr.',
195
+    'date_mois_5' => 'majo',
196
+    'date_mois_5_abbr' => 'majo',
197
+    'date_mois_6' => 'junio',
198
+    'date_mois_6_abbr' => 'jun.',
199
+    'date_mois_7' => 'julio',
200
+    'date_mois_7_abbr' => 'jul.',
201
+    'date_mois_8' => 'aŭgusto',
202
+    'date_mois_8_abbr' => 'aŭg.',
203
+    'date_mois_9' => 'septembro',
204
+    'date_mois_9_abbr' => 'sep.',
205
+    'date_saison_1' => 'vintro',
206
+    'date_saison_2' => 'printempo',
207
+    'date_saison_3' => 'somero',
208
+    'date_saison_4' => 'aŭtuno',
209
+    'date_secondes' => 'sekundoj',
210
+    'date_semaines' => 'semajnoj',
211
+    'date_un_mois' => 'monato',
212
+    'date_une_heure' => 'horo',
213
+    'date_une_minute' => 'minuto',
214
+    'date_une_seconde' => 'sekundo',
215
+    'date_une_semaine' => 'semajno',
216
+    'dirs_commencer' => ' por vere komenci la instalprocezon',
217
+    'dirs_preliminaire' => 'Antaŭfaro : <b>Difinu la alir-rajtojn</b>',
218
+    'dirs_probleme_droits' => 'Alir-rajta problemo',
219
+    'dirs_repertoires_absents' => '<b>La jenaj dosierujoj ne estas trovitaj : <ul>@bad_dirs@.</ul> </b>
220 220
   <p>La problemo verŝajne rilatas al majuskligo de literoj.
221 221
   Kontrolu ke la majuskloj ja kongruas kun tio kio estas afiŝita ĉi-supre ;
222 222
   se ili ne kongruas, bonvolu renomi la dosierujon per via FTP-programo por korekti la eraron.
223 223
 </p><p>Post tio, vi povos</p>',
224
-	'dirs_repertoires_suivants' => '<b>La jenaj dosierujoj ne estas skribe modifeblaj : 
224
+    'dirs_repertoires_suivants' => '<b>La jenaj dosierujoj ne estas skribe modifeblaj : 
225 225
 <ul>@bad_dirs@.</ul></b>
226 226
 <p>Por solvi tion, uzu vian FTP-klienton por reguligi la alir-rajtojn de ĉiu
227 227
  el tiuj dosierujoj. La proceduron oni detale klarigas en la instalgvidlibro.
228 228
 </p><p>Post tio, vi povos </p>',
229
-	'double_occurrence' => 'Duobla trafo de @balise@',
229
+    'double_occurrence' => 'Duobla trafo de @balise@',
230 230
 
231
-	// E
232
-	'en_cours' => 'okazanta',
233
-	'envoi_via_le_site' => 'Sendo tra la retejo',
234
-	'erreur' => 'Eraro',
235
-	'erreur_balise_non_fermee' => 'lasta ne fermita marko :',
236
-	'erreur_technique_ajaxform' => 'Aj. Neatendita eraro ne ebligis la sendon de la formularo. Vi povas reprovi denove.',
237
-	'erreur_technique_enregistrement_champs' => 'Teknika eraro neebligis la ĝustan registradon de la kampo @champs@.',
238
-	'erreur_technique_enregistrement_impossible' => 'Teknika eraro neebligis la registradon.',
239
-	'erreur_texte' => 'eraro(j)',
240
-	'etape' => 'Etapo',
231
+    // E
232
+    'en_cours' => 'okazanta',
233
+    'envoi_via_le_site' => 'Sendo tra la retejo',
234
+    'erreur' => 'Eraro',
235
+    'erreur_balise_non_fermee' => 'lasta ne fermita marko :',
236
+    'erreur_technique_ajaxform' => 'Aj. Neatendita eraro ne ebligis la sendon de la formularo. Vi povas reprovi denove.',
237
+    'erreur_technique_enregistrement_champs' => 'Teknika eraro neebligis la ĝustan registradon de la kampo @champs@.',
238
+    'erreur_technique_enregistrement_impossible' => 'Teknika eraro neebligis la registradon.',
239
+    'erreur_texte' => 'eraro(j)',
240
+    'etape' => 'Etapo',
241 241
 
242
-	// F
243
-	'fichier_introuvable' => 'Netrovebla dosiero @fichier@ ', # MODIF
244
-	'form_auteur_confirmation' => 'Konfirmu vian retpoŝtadreso',
245
-	'form_auteur_email_modifie' => 'Via retpoŝtadreso estis modifita.',
246
-	'form_auteur_envoi_mail_confirmation' => 'Konfirmretmesaĝo estis sendita al @email@. Vi devu viziti la menciita retadreso en la retmesaĝo por validigi vian retpoŝtadreson.',
247
-	'form_auteur_mail_confirmation' => 'Saluton,
242
+    // F
243
+    'fichier_introuvable' => 'Netrovebla dosiero @fichier@ ', # MODIF
244
+    'form_auteur_confirmation' => 'Konfirmu vian retpoŝtadreso',
245
+    'form_auteur_email_modifie' => 'Via retpoŝtadreso estis modifita.',
246
+    'form_auteur_envoi_mail_confirmation' => 'Konfirmretmesaĝo estis sendita al @email@. Vi devu viziti la menciita retadreso en la retmesaĝo por validigi vian retpoŝtadreson.',
247
+    'form_auteur_mail_confirmation' => 'Saluton,
248 248
 
249 249
 Vi petis ŝanĝi vian retpoŝtadreson.
250 250
 Por konfirmi vian novan retadreson, simple ensaluti al
251 251
 la retadreso ĉi-sube (alie, via peto estos ignoritaj) :
252 252
 
253 253
     @url@',
254
-	'form_deja_inscrit' => 'Vi estas jam registrita.',
255
-	'form_email_non_valide' => 'Via retpoŝtadreso ne validas.',
256
-	'form_forum_access_refuse' => 'Vi ne plu havas alir-rajton al tiu retejo.',
257
-	'form_forum_bonjour' => 'Saluton @nom@,',
258
-	'form_forum_confirmer_email' => 'Por konfirmi vian retpoŝtadreson, iru al tiu retadreso : @url_confirm@',
259
-	'form_forum_email_deja_enregistre' => 'Tiu ĉi retpoŝtadreso estas jam registrita, vi povas do uzi vian kutiman pasvorton.',
260
-	'form_forum_identifiant_mail' => 'Via nova ensalutilo estis ĵus al vi sendita per retletero.',
261
-	'form_forum_identifiants' => 'Personaj ensalutiloj',
262
-	'form_forum_indiquer_nom_email' => 'Indiku ĉi tie vian nomon kaj retpoŝtadreson. Via persona ensalutilo rapide alvenos al vi retletere.',
263
-	'form_forum_login' => 'salutnomo :',
264
-	'form_forum_message_auto' => '(tio estas aŭtomata mesaĝo)',
265
-	'form_forum_pass' => 'pasvorto :',
266
-	'form_forum_probleme_mail' => 'Retpoŝta problemo : la ensalutilo ne sendeblas.',
267
-	'form_forum_voici1' => 'Jen viaj ensalutiloj por partopreni la vivon de la retejo "@nom_site_spip@" (@adresse_site@) :',
268
-	'form_forum_voici2' => 'Jen estas viaj ensalutiloj por proponi artikolojn ĉe la retejo "@nom_site_spip@" (@adresse_login@) :',
269
-	'form_indiquer_email' => 'Bonvolu indiki vian retpoŝtadreson.',
270
-	'form_indiquer_nom' => 'Bonvolu indiki vian nomon.',
271
-	'form_indiquer_nom_site' => 'Bonvolu indiki la nomon de via retejo.',
272
-	'form_pet_deja_enregistre' => 'Tiu retejo estas jam registrita',
273
-	'form_pet_signature_pasprise' => 'Via subskribo ne estas registrita.',
274
-	'form_prop_confirmer_envoi' => 'Konfirmi la sendon',
275
-	'form_prop_description' => 'Priskribo/komento',
276
-	'form_prop_enregistre' => 'Via kontribuo estas registrita, ĝi aperos ĉerete post validigo de la respondeculoj de la retejo.',
277
-	'form_prop_envoyer' => 'Sendi mesaĝon',
278
-	'form_prop_indiquer_email' => 'Bonvolu indiki validan retpoŝtadreson',
279
-	'form_prop_indiquer_nom_site' => 'Bonvolu indiki la nomon de la retejo.',
280
-	'form_prop_indiquer_sujet' => 'Bonvolu indiki temon',
281
-	'form_prop_message_envoye' => 'Mesaĝo sendita',
282
-	'form_prop_non_enregistre' => 'Via propono ne estis registrita.',
283
-	'form_prop_sujet' => 'Temo',
284
-	'form_prop_url_site' => 'URL-adreso de la retejo',
285
-	'format_date_incorrecte' => 'La dato aŭ ĝia formo ne validas',
286
-	'format_heure_incorrecte' => 'La horo aŭ ĝia formo ne validas',
287
-	'forum_non_inscrit' => 'Vi ne estas registrita, aŭ la adreso aŭ la pasvorto ne ĝustas.',
288
-	'forum_par_auteur' => 'de @auteur@',
289
-	'forum_titre_erreur' => 'Eraro...',
254
+    'form_deja_inscrit' => 'Vi estas jam registrita.',
255
+    'form_email_non_valide' => 'Via retpoŝtadreso ne validas.',
256
+    'form_forum_access_refuse' => 'Vi ne plu havas alir-rajton al tiu retejo.',
257
+    'form_forum_bonjour' => 'Saluton @nom@,',
258
+    'form_forum_confirmer_email' => 'Por konfirmi vian retpoŝtadreson, iru al tiu retadreso : @url_confirm@',
259
+    'form_forum_email_deja_enregistre' => 'Tiu ĉi retpoŝtadreso estas jam registrita, vi povas do uzi vian kutiman pasvorton.',
260
+    'form_forum_identifiant_mail' => 'Via nova ensalutilo estis ĵus al vi sendita per retletero.',
261
+    'form_forum_identifiants' => 'Personaj ensalutiloj',
262
+    'form_forum_indiquer_nom_email' => 'Indiku ĉi tie vian nomon kaj retpoŝtadreson. Via persona ensalutilo rapide alvenos al vi retletere.',
263
+    'form_forum_login' => 'salutnomo :',
264
+    'form_forum_message_auto' => '(tio estas aŭtomata mesaĝo)',
265
+    'form_forum_pass' => 'pasvorto :',
266
+    'form_forum_probleme_mail' => 'Retpoŝta problemo : la ensalutilo ne sendeblas.',
267
+    'form_forum_voici1' => 'Jen viaj ensalutiloj por partopreni la vivon de la retejo "@nom_site_spip@" (@adresse_site@) :',
268
+    'form_forum_voici2' => 'Jen estas viaj ensalutiloj por proponi artikolojn ĉe la retejo "@nom_site_spip@" (@adresse_login@) :',
269
+    'form_indiquer_email' => 'Bonvolu indiki vian retpoŝtadreson.',
270
+    'form_indiquer_nom' => 'Bonvolu indiki vian nomon.',
271
+    'form_indiquer_nom_site' => 'Bonvolu indiki la nomon de via retejo.',
272
+    'form_pet_deja_enregistre' => 'Tiu retejo estas jam registrita',
273
+    'form_pet_signature_pasprise' => 'Via subskribo ne estas registrita.',
274
+    'form_prop_confirmer_envoi' => 'Konfirmi la sendon',
275
+    'form_prop_description' => 'Priskribo/komento',
276
+    'form_prop_enregistre' => 'Via kontribuo estas registrita, ĝi aperos ĉerete post validigo de la respondeculoj de la retejo.',
277
+    'form_prop_envoyer' => 'Sendi mesaĝon',
278
+    'form_prop_indiquer_email' => 'Bonvolu indiki validan retpoŝtadreson',
279
+    'form_prop_indiquer_nom_site' => 'Bonvolu indiki la nomon de la retejo.',
280
+    'form_prop_indiquer_sujet' => 'Bonvolu indiki temon',
281
+    'form_prop_message_envoye' => 'Mesaĝo sendita',
282
+    'form_prop_non_enregistre' => 'Via propono ne estis registrita.',
283
+    'form_prop_sujet' => 'Temo',
284
+    'form_prop_url_site' => 'URL-adreso de la retejo',
285
+    'format_date_incorrecte' => 'La dato aŭ ĝia formo ne validas',
286
+    'format_heure_incorrecte' => 'La horo aŭ ĝia formo ne validas',
287
+    'forum_non_inscrit' => 'Vi ne estas registrita, aŭ la adreso aŭ la pasvorto ne ĝustas.',
288
+    'forum_par_auteur' => 'de @auteur@',
289
+    'forum_titre_erreur' => 'Eraro...',
290 290
 
291
-	// I
292
-	'ical_texte_rss_articles' => 'La abondosiero (backend-dosiero) de la artikoloj de tiu retejo troveblas ĉe la retadreso :',
293
-	'ical_texte_rss_articles2' => 'Sube, vi povas trovi abonligojn por gvati evoluadon de artikoloj el ĉiu rubriko de la retejo :',
294
-	'ical_texte_rss_breves' => 'Krome ekzistas dosiero enhavanta ĉiujn fulm-informojn de la retejo. Precizigante la rubriko-numeron, vi ricevos nur la fulm-informojn el tiu rubriko.',
295
-	'icone_a_suivre' => 'Stabejo',
296
-	'icone_admin_site' => 'Reteja administrado',
297
-	'icone_agenda' => 'Agendo',
298
-	'icone_aide_ligne' => 'Helpilo',
299
-	'icone_articles' => 'Artikoloj',
300
-	'icone_auteurs' => 'Aŭtoroj',
301
-	'icone_brouteur' => 'Rapida retumado',
302
-	'icone_configuration_site' => 'Konfiguro',
303
-	'icone_configurer_site' => 'Konfiguri vian retejon',
304
-	'icone_creer_nouvel_auteur' => 'Krei novan aŭtoron',
305
-	'icone_creer_rubrique' => 'Krei novan rubrikon',
306
-	'icone_creer_sous_rubrique' => 'Krei sub-rubrikon',
307
-	'icone_deconnecter' => 'Elsaluti',
308
-	'icone_discussions' => 'Diskutoj',
309
-	'icone_doc_rubrique' => 'Dokumentoj de la rubrikoj',
310
-	'icone_ecrire_article' => 'Skribi novan artikolon',
311
-	'icone_edition_site' => 'Redaktejo',
312
-	'icone_gestion_langues' => 'Mastrumado de lingvoj',
313
-	'icone_informations_personnelles' => 'Personaj datenoj',
314
-	'icone_interface_complet' => 'kompleta interfaco',
315
-	'icone_interface_simple' => 'Simpla interfaco',
316
-	'icone_maintenance_site' => 'Retejo-bontenado',
317
-	'icone_messagerie_personnelle' => 'Persona mesaĝilo',
318
-	'icone_repartition_debut' => 'Afiŝi la distribuon ekde la komenco',
319
-	'icone_rubriques' => 'Rubrikoj',
320
-	'icone_sauver_site' => 'Savkopii la retejon',
321
-	'icone_site_entier' => 'La tuta retejo',
322
-	'icone_sites_references' => 'Referencigitaj retejoj',
323
-	'icone_statistiques' => 'Statistikoj de la retejo',
324
-	'icone_suivi_activite' => 'Gvati vivon de la retejo',
325
-	'icone_suivi_actualite' => 'Evoluado de la retejo',
326
-	'icone_suivi_pettions' => 'Superrigardi/mastrumi la petskribon',
327
-	'icone_suivi_revisions' => 'Modifoj de artikoloj',
328
-	'icone_supprimer_document' => 'Forigi tiun dokumenton',
329
-	'icone_supprimer_image' => 'Forigi tiun bildon',
330
-	'icone_tous_articles' => 'Ĉiuj viaj artikoloj',
331
-	'icone_tous_auteur' => 'Ĉiuj aŭtoroj',
332
-	'icone_tous_visiteur' => 'Ĉiuj vizitantoj',
333
-	'icone_visiter_site' => 'Vidi la publika spaco',
334
-	'icone_voir_en_ligne' => 'Vidi ĉeretigite',
335
-	'img_indisponible' => 'nedisponebla bildo',
336
-	'impossible' => 'ne eblas',
337
-	'info_a_suivre' => 'STABEJO »',
338
-	'info_acces_interdit' => 'Malpermesata aliro',
339
-	'info_acces_refuse' => 'Rifuzita aliro',
340
-	'info_action' => 'Ago : @action@',
341
-	'info_administrer_rubriques' => 'Vi povas mastrumi tiun rubrikon kaj ties subrubrikojn',
342
-	'info_adresse_non_indiquee' => 'Vi indikis neniun adreson por testi !',
343
-	'info_aide' => 'HELPO :',
344
-	'info_ajouter_mot' => 'Aldoni tiun vorton',
345
-	'info_annonce' => 'ANONCO',
346
-	'info_annonces_generales' => 'Ĝeneralaj anoncoj :',
347
-	'info_article_propose' => 'Proponita artikolo',
348
-	'info_article_publie' => 'Publikigita artikolo',
349
-	'info_article_redaction' => 'Redaktata artikolo',
350
-	'info_article_refuse' => 'Rifuzita artikolo',
351
-	'info_article_supprime' => 'Forviŝita artikolo',
352
-	'info_articles' => 'Artikoloj',
353
-	'info_articles_a_valider' => 'Validigendaj artikoloj',
354
-	'info_articles_nb' => '@nb@ artikoloj',
355
-	'info_articles_proposes' => 'Proponitaj artikoloj',
356
-	'info_articles_un' => '1 artikolo',
357
-	'info_auteurs_nombre' => 'aŭtoro(j) :',
358
-	'info_authentification_ftp' => 'Aŭtentigo (per FTP).',
359
-	'info_breves_2' => 'fulm-informoj',
360
-	'info_breves_nb' => '@nb@ fulm-informoj',
361
-	'info_breves_un' => '1 fulm-informo',
362
-	'info_connexion_refusee' => 'Konektiĝo rifuzata',
363
-	'info_contact_developpeur' => 'Bonvolu kontakti programiston.',
364
-	'info_contenance' => 'Tiu retejo enhavas :',
365
-	'info_contribution' => 'kontribuaĵoj',
366
-	'info_copyright' => '@spip@ estas libera programo distribuata @lien_gpl@.',
367
-	'info_copyright_doc' => 'Por pliaj informoj vidu la retpaĝon <a href="@spipnet@">@spipnet_affiche@</a>.',
368
-	'info_copyright_gpl' => 'sub licenco GPL',
369
-	'info_cours_edition' => 'Viaj redaktataj artikoloj', # MODIF
370
-	'info_creer_repertoire' => 'Bonvolu krei dosieron aŭ dosierujon kies nomo estu :',
371
-	'info_creer_repertoire_2' => 'ene de la subdosierujo <b>@repertoire@</b>, kaj :',
372
-	'info_creer_vignette' => 'aŭtomata kreo de la vinjeto',
373
-	'info_creerdansrubrique_non_autorise' => 'Vi ne havas sufiĉajn rajtojn por krei enhavo en ĉi tiu rubriko',
374
-	'info_deplier' => 'Malfaldi',
375
-	'info_descriptif_nombre' => 'priskribo(j) :',
376
-	'info_description' => 'Priskribo :',
377
-	'info_description_2' => 'Priskribo :',
378
-	'info_dimension' => 'Dimensioj :',
379
-	'info_documents_nb' => '@nb@ dokumentoj',
380
-	'info_documents_un' => '1 dokumento',
381
-	'info_ecire_message_prive' => 'Skribi privatan mesaĝon',
382
-	'info_email_invalide' => 'Nevalida retpoŝtadreso.',
383
-	'info_en_cours_validation' => 'Viaj redaktataj artikoloj',
384
-	'info_en_ligne' => 'Nun ĉerete :',
385
-	'info_envoyer_message_prive' => 'Sendi privatan mesaĝon al tiu ĉi aŭtoro',
386
-	'info_erreur_requete' => 'Eraro en la peto : ',
387
-	'info_erreur_squelette2' => 'Neniu skeleto <b>@fichier@</b> disponeblas...',
388
-	'info_erreur_systeme' => 'Sistemo-eraro (errno @errsys@)',
389
-	'info_erreur_systeme2' => 'Eble la fiksdisko plenas, aŭ la datenbazo estas difektita.<br />
291
+    // I
292
+    'ical_texte_rss_articles' => 'La abondosiero (backend-dosiero) de la artikoloj de tiu retejo troveblas ĉe la retadreso :',
293
+    'ical_texte_rss_articles2' => 'Sube, vi povas trovi abonligojn por gvati evoluadon de artikoloj el ĉiu rubriko de la retejo :',
294
+    'ical_texte_rss_breves' => 'Krome ekzistas dosiero enhavanta ĉiujn fulm-informojn de la retejo. Precizigante la rubriko-numeron, vi ricevos nur la fulm-informojn el tiu rubriko.',
295
+    'icone_a_suivre' => 'Stabejo',
296
+    'icone_admin_site' => 'Reteja administrado',
297
+    'icone_agenda' => 'Agendo',
298
+    'icone_aide_ligne' => 'Helpilo',
299
+    'icone_articles' => 'Artikoloj',
300
+    'icone_auteurs' => 'Aŭtoroj',
301
+    'icone_brouteur' => 'Rapida retumado',
302
+    'icone_configuration_site' => 'Konfiguro',
303
+    'icone_configurer_site' => 'Konfiguri vian retejon',
304
+    'icone_creer_nouvel_auteur' => 'Krei novan aŭtoron',
305
+    'icone_creer_rubrique' => 'Krei novan rubrikon',
306
+    'icone_creer_sous_rubrique' => 'Krei sub-rubrikon',
307
+    'icone_deconnecter' => 'Elsaluti',
308
+    'icone_discussions' => 'Diskutoj',
309
+    'icone_doc_rubrique' => 'Dokumentoj de la rubrikoj',
310
+    'icone_ecrire_article' => 'Skribi novan artikolon',
311
+    'icone_edition_site' => 'Redaktejo',
312
+    'icone_gestion_langues' => 'Mastrumado de lingvoj',
313
+    'icone_informations_personnelles' => 'Personaj datenoj',
314
+    'icone_interface_complet' => 'kompleta interfaco',
315
+    'icone_interface_simple' => 'Simpla interfaco',
316
+    'icone_maintenance_site' => 'Retejo-bontenado',
317
+    'icone_messagerie_personnelle' => 'Persona mesaĝilo',
318
+    'icone_repartition_debut' => 'Afiŝi la distribuon ekde la komenco',
319
+    'icone_rubriques' => 'Rubrikoj',
320
+    'icone_sauver_site' => 'Savkopii la retejon',
321
+    'icone_site_entier' => 'La tuta retejo',
322
+    'icone_sites_references' => 'Referencigitaj retejoj',
323
+    'icone_statistiques' => 'Statistikoj de la retejo',
324
+    'icone_suivi_activite' => 'Gvati vivon de la retejo',
325
+    'icone_suivi_actualite' => 'Evoluado de la retejo',
326
+    'icone_suivi_pettions' => 'Superrigardi/mastrumi la petskribon',
327
+    'icone_suivi_revisions' => 'Modifoj de artikoloj',
328
+    'icone_supprimer_document' => 'Forigi tiun dokumenton',
329
+    'icone_supprimer_image' => 'Forigi tiun bildon',
330
+    'icone_tous_articles' => 'Ĉiuj viaj artikoloj',
331
+    'icone_tous_auteur' => 'Ĉiuj aŭtoroj',
332
+    'icone_tous_visiteur' => 'Ĉiuj vizitantoj',
333
+    'icone_visiter_site' => 'Vidi la publika spaco',
334
+    'icone_voir_en_ligne' => 'Vidi ĉeretigite',
335
+    'img_indisponible' => 'nedisponebla bildo',
336
+    'impossible' => 'ne eblas',
337
+    'info_a_suivre' => 'STABEJO »',
338
+    'info_acces_interdit' => 'Malpermesata aliro',
339
+    'info_acces_refuse' => 'Rifuzita aliro',
340
+    'info_action' => 'Ago : @action@',
341
+    'info_administrer_rubriques' => 'Vi povas mastrumi tiun rubrikon kaj ties subrubrikojn',
342
+    'info_adresse_non_indiquee' => 'Vi indikis neniun adreson por testi !',
343
+    'info_aide' => 'HELPO :',
344
+    'info_ajouter_mot' => 'Aldoni tiun vorton',
345
+    'info_annonce' => 'ANONCO',
346
+    'info_annonces_generales' => 'Ĝeneralaj anoncoj :',
347
+    'info_article_propose' => 'Proponita artikolo',
348
+    'info_article_publie' => 'Publikigita artikolo',
349
+    'info_article_redaction' => 'Redaktata artikolo',
350
+    'info_article_refuse' => 'Rifuzita artikolo',
351
+    'info_article_supprime' => 'Forviŝita artikolo',
352
+    'info_articles' => 'Artikoloj',
353
+    'info_articles_a_valider' => 'Validigendaj artikoloj',
354
+    'info_articles_nb' => '@nb@ artikoloj',
355
+    'info_articles_proposes' => 'Proponitaj artikoloj',
356
+    'info_articles_un' => '1 artikolo',
357
+    'info_auteurs_nombre' => 'aŭtoro(j) :',
358
+    'info_authentification_ftp' => 'Aŭtentigo (per FTP).',
359
+    'info_breves_2' => 'fulm-informoj',
360
+    'info_breves_nb' => '@nb@ fulm-informoj',
361
+    'info_breves_un' => '1 fulm-informo',
362
+    'info_connexion_refusee' => 'Konektiĝo rifuzata',
363
+    'info_contact_developpeur' => 'Bonvolu kontakti programiston.',
364
+    'info_contenance' => 'Tiu retejo enhavas :',
365
+    'info_contribution' => 'kontribuaĵoj',
366
+    'info_copyright' => '@spip@ estas libera programo distribuata @lien_gpl@.',
367
+    'info_copyright_doc' => 'Por pliaj informoj vidu la retpaĝon <a href="@spipnet@">@spipnet_affiche@</a>.',
368
+    'info_copyright_gpl' => 'sub licenco GPL',
369
+    'info_cours_edition' => 'Viaj redaktataj artikoloj', # MODIF
370
+    'info_creer_repertoire' => 'Bonvolu krei dosieron aŭ dosierujon kies nomo estu :',
371
+    'info_creer_repertoire_2' => 'ene de la subdosierujo <b>@repertoire@</b>, kaj :',
372
+    'info_creer_vignette' => 'aŭtomata kreo de la vinjeto',
373
+    'info_creerdansrubrique_non_autorise' => 'Vi ne havas sufiĉajn rajtojn por krei enhavo en ĉi tiu rubriko',
374
+    'info_deplier' => 'Malfaldi',
375
+    'info_descriptif_nombre' => 'priskribo(j) :',
376
+    'info_description' => 'Priskribo :',
377
+    'info_description_2' => 'Priskribo :',
378
+    'info_dimension' => 'Dimensioj :',
379
+    'info_documents_nb' => '@nb@ dokumentoj',
380
+    'info_documents_un' => '1 dokumento',
381
+    'info_ecire_message_prive' => 'Skribi privatan mesaĝon',
382
+    'info_email_invalide' => 'Nevalida retpoŝtadreso.',
383
+    'info_en_cours_validation' => 'Viaj redaktataj artikoloj',
384
+    'info_en_ligne' => 'Nun ĉerete :',
385
+    'info_envoyer_message_prive' => 'Sendi privatan mesaĝon al tiu ĉi aŭtoro',
386
+    'info_erreur_requete' => 'Eraro en la peto : ',
387
+    'info_erreur_squelette2' => 'Neniu skeleto <b>@fichier@</b> disponeblas...',
388
+    'info_erreur_systeme' => 'Sistemo-eraro (errno @errsys@)',
389
+    'info_erreur_systeme2' => 'Eble la fiksdisko plenas, aŭ la datenbazo estas difektita.<br />
390 390
 <span style="color:red;">Provu<a href=\'@script@\'>ripari la datenbazon</a>,
391 391
 aŭ kontaktu vian retgastiganton.</span>',
392
-	'info_fini' => 'Finite !',
393
-	'info_format_image' => 'Bildaj formatoj uzeblaj por krei vinjetojn : @gd_formats@.',
394
-	'info_format_non_defini' => 'nedefinita formato',
395
-	'info_grand_ecran' => 'Granda ekrano',
396
-	'info_image_aide' => 'HELPILO',
397
-	'info_image_process_titre' => 'Metodo pri vinjet-farado',
398
-	'info_impossible_lire_page' => '<b>Eraro !</b> Ne eblas legi la paĝon <tt> <html>@test_proxy@</html> </tt> tra la prokura servilo <tt>',
399
-	'info_installation_systeme_publication' => 'Instalo de la publikiga sistemo...',
400
-	'info_installer_documents' => 'Vi povas aŭtomate instali ĉiujn dokumentojn troviĝantajn en la dosiero @upload@.',
401
-	'info_installer_ftp' => 'Kiel mastrumanto, vi povas instali (FTP-e) dosierojn en la dosierujon @upload@ kaj poste rekte selekti ilin ĉi tie.',
402
-	'info_installer_images' => 'Vi povas instali bildojn je la formatoj JPEG, GIF kaj PNG.',
403
-	'info_installer_images_dossier' => 'Instali bildojn en la dosierujon @upload@ por povi ilin selekti ĉi tie.',
404
-	'info_interface_complete' => 'kompleta interfaco',
405
-	'info_interface_simple' => 'Simpla interfaco',
406
-	'info_joindre_document_article' => 'Vi povas ligi kun tiu artikolo dokumentojn tiajn, kiaj',
407
-	'info_joindre_document_rubrique' => 'Vi povas ligi kun tiu rubriko dokumentojn tiajn, kiaj',
408
-	'info_joindre_documents_article' => 'Vi povas ligi kun tiu artikolo dokumentojn tiajn, kiaj :',
409
-	'info_l_article' => 'la artikolo',
410
-	'info_la_breve' => 'la fulm-informo',
411
-	'info_la_rubrique' => 'la rubriko',
412
-	'info_langue_principale' => 'Ĉefa lingvo de la retejo',
413
-	'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ bilderoj',
414
-	'info_les_auteurs_1' => 'de @les_auteurs@',
415
-	'info_logo_format_interdit' => 'Nur vinjetoj je formatoj @formats@ estas permesataj.',
416
-	'info_logo_max_poids' => 'Vinjetoj devige pezu malpli ol @maxi@ (tiu dosiero pezas @actuel@).',
417
-	'info_mail_fournisseur' => '[email protected]',
418
-	'info_message_2' => 'MESAĜO',
419
-	'info_message_supprime' => 'FORIGITA MESAĜO',
420
-	'info_messages_nb' => '@nb@ mesaĝoj',
421
-	'info_messages_un' => '1 mesaĝo',
422
-	'info_mise_en_ligne' => 'Dato de ĉeretigo : ',
423
-	'info_modification_parametres_securite' => 'modifoj de la sekuraj parametroj',
424
-	'info_mois_courant' => 'En la kuranta monato :',
425
-	'info_mot_cle_ajoute' => 'La jena ŝlosilvorto estas ligita kun',
426
-	'info_multi_herit' => 'Defaŭlta lingvo',
427
-	'info_multi_langues_soulignees' => 'Por la <u>substrekitaj lingvoj</u>, ĉiuj tekstoj de la interfaco estas tute aŭ parte tradukitaj. Kiam vi elektas tiujn lingvojn, multaj elementoj de la publika retejo (datenoj, formularoj) estos aŭtomate tradukitaj. Por la nesubstrekitaj lingvoj, tiuj elementoj afiŝiĝos en la ĉefa lingvo de la retejo.',
428
-	'info_multilinguisme' => 'Multlingvismo',
429
-	'info_nom_non_utilisateurs_connectes' => 'Via nomo ne aperas en la listo de la ensalutintaj uzantoj.',
430
-	'info_nom_utilisateurs_connectes' => 'Via nomo aperas en la listo de la ensalutintaj uzantoj.',
431
-	'info_nombre_en_ligne' => 'Nun ensalutintaj :',
432
-	'info_non_resultat' => 'Neniu rezulto por "@cherche_mot@"',
433
-	'info_non_utilisation_messagerie' => 'Vi ne uzas la internan mesaĝilon de tiu retejo.',
434
-	'info_nouveau_message' => 'VI HAVAS NOVAN MESAĜON',
435
-	'info_nouveaux_messages' => 'VI HAVAS @total_messages@ NOVA(J)N MESAĜO(J)N',
436
-	'info_numero_abbreviation' => 'N° ',
437
-	'info_obligatoire' => 'Tiu ĉi informo estas deviga',
438
-	'info_pense_bete' => 'MEMORIGILO',
439
-	'info_petit_ecran' => 'Eta ekrano',
440
-	'info_petition_close' => 'Petskribo fermita',
441
-	'info_pixels' => 'bilderoj',
442
-	'info_plusieurs_mots_trouves' => 'Pluraj ŝlosilvortoj trovitaj por "@cherche_mot@" :',
443
-	'info_portfolio_automatique' => 'Aŭtomata dokumentujo :',
444
-	'info_premier_resultat' => '[@debut_limit@ unuaj rezultoj el @total@]',
445
-	'info_premier_resultat_sur' => '[@debut_limit@ unuaj rezultoj el @total@]',
446
-	'info_propose_1' => '[@nom_site_spip@] Proponas : @titre@',
447
-	'info_propose_2' => 'Proponita artikolo
392
+    'info_fini' => 'Finite !',
393
+    'info_format_image' => 'Bildaj formatoj uzeblaj por krei vinjetojn : @gd_formats@.',
394
+    'info_format_non_defini' => 'nedefinita formato',
395
+    'info_grand_ecran' => 'Granda ekrano',
396
+    'info_image_aide' => 'HELPILO',
397
+    'info_image_process_titre' => 'Metodo pri vinjet-farado',
398
+    'info_impossible_lire_page' => '<b>Eraro !</b> Ne eblas legi la paĝon <tt> <html>@test_proxy@</html> </tt> tra la prokura servilo <tt>',
399
+    'info_installation_systeme_publication' => 'Instalo de la publikiga sistemo...',
400
+    'info_installer_documents' => 'Vi povas aŭtomate instali ĉiujn dokumentojn troviĝantajn en la dosiero @upload@.',
401
+    'info_installer_ftp' => 'Kiel mastrumanto, vi povas instali (FTP-e) dosierojn en la dosierujon @upload@ kaj poste rekte selekti ilin ĉi tie.',
402
+    'info_installer_images' => 'Vi povas instali bildojn je la formatoj JPEG, GIF kaj PNG.',
403
+    'info_installer_images_dossier' => 'Instali bildojn en la dosierujon @upload@ por povi ilin selekti ĉi tie.',
404
+    'info_interface_complete' => 'kompleta interfaco',
405
+    'info_interface_simple' => 'Simpla interfaco',
406
+    'info_joindre_document_article' => 'Vi povas ligi kun tiu artikolo dokumentojn tiajn, kiaj',
407
+    'info_joindre_document_rubrique' => 'Vi povas ligi kun tiu rubriko dokumentojn tiajn, kiaj',
408
+    'info_joindre_documents_article' => 'Vi povas ligi kun tiu artikolo dokumentojn tiajn, kiaj :',
409
+    'info_l_article' => 'la artikolo',
410
+    'info_la_breve' => 'la fulm-informo',
411
+    'info_la_rubrique' => 'la rubriko',
412
+    'info_langue_principale' => 'Ĉefa lingvo de la retejo',
413
+    'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ bilderoj',
414
+    'info_les_auteurs_1' => 'de @les_auteurs@',
415
+    'info_logo_format_interdit' => 'Nur vinjetoj je formatoj @formats@ estas permesataj.',
416
+    'info_logo_max_poids' => 'Vinjetoj devige pezu malpli ol @maxi@ (tiu dosiero pezas @actuel@).',
417
+    'info_mail_fournisseur' => '[email protected]',
418
+    'info_message_2' => 'MESAĜO',
419
+    'info_message_supprime' => 'FORIGITA MESAĜO',
420
+    'info_messages_nb' => '@nb@ mesaĝoj',
421
+    'info_messages_un' => '1 mesaĝo',
422
+    'info_mise_en_ligne' => 'Dato de ĉeretigo : ',
423
+    'info_modification_parametres_securite' => 'modifoj de la sekuraj parametroj',
424
+    'info_mois_courant' => 'En la kuranta monato :',
425
+    'info_mot_cle_ajoute' => 'La jena ŝlosilvorto estas ligita kun',
426
+    'info_multi_herit' => 'Defaŭlta lingvo',
427
+    'info_multi_langues_soulignees' => 'Por la <u>substrekitaj lingvoj</u>, ĉiuj tekstoj de la interfaco estas tute aŭ parte tradukitaj. Kiam vi elektas tiujn lingvojn, multaj elementoj de la publika retejo (datenoj, formularoj) estos aŭtomate tradukitaj. Por la nesubstrekitaj lingvoj, tiuj elementoj afiŝiĝos en la ĉefa lingvo de la retejo.',
428
+    'info_multilinguisme' => 'Multlingvismo',
429
+    'info_nom_non_utilisateurs_connectes' => 'Via nomo ne aperas en la listo de la ensalutintaj uzantoj.',
430
+    'info_nom_utilisateurs_connectes' => 'Via nomo aperas en la listo de la ensalutintaj uzantoj.',
431
+    'info_nombre_en_ligne' => 'Nun ensalutintaj :',
432
+    'info_non_resultat' => 'Neniu rezulto por "@cherche_mot@"',
433
+    'info_non_utilisation_messagerie' => 'Vi ne uzas la internan mesaĝilon de tiu retejo.',
434
+    'info_nouveau_message' => 'VI HAVAS NOVAN MESAĜON',
435
+    'info_nouveaux_messages' => 'VI HAVAS @total_messages@ NOVA(J)N MESAĜO(J)N',
436
+    'info_numero_abbreviation' => 'N° ',
437
+    'info_obligatoire' => 'Tiu ĉi informo estas deviga',
438
+    'info_pense_bete' => 'MEMORIGILO',
439
+    'info_petit_ecran' => 'Eta ekrano',
440
+    'info_petition_close' => 'Petskribo fermita',
441
+    'info_pixels' => 'bilderoj',
442
+    'info_plusieurs_mots_trouves' => 'Pluraj ŝlosilvortoj trovitaj por "@cherche_mot@" :',
443
+    'info_portfolio_automatique' => 'Aŭtomata dokumentujo :',
444
+    'info_premier_resultat' => '[@debut_limit@ unuaj rezultoj el @total@]',
445
+    'info_premier_resultat_sur' => '[@debut_limit@ unuaj rezultoj el @total@]',
446
+    'info_propose_1' => '[@nom_site_spip@] Proponas : @titre@',
447
+    'info_propose_2' => 'Proponita artikolo
448 448
 ---------------',
449
-	'info_propose_3' => 'La artikolo "@titre@" estas proponita por publikigo.',
450
-	'info_propose_4' => 'Vi estas petata konsulti ĝin kaj doni vian opinion',
451
-	'info_propose_5' => 'en la forumo ligita al ĝi. Ĝi estas disponebla el la adreso :',
452
-	'info_publie_01' => 'La artikolo "@titre@" estis validigita de @connect_nom@.',
453
-	'info_publie_1' => '[@nom_site_spip@] PUBLIKIGAS : @titre@',
454
-	'info_publie_2' => 'Artikolo publikigita
449
+    'info_propose_3' => 'La artikolo "@titre@" estas proponita por publikigo.',
450
+    'info_propose_4' => 'Vi estas petata konsulti ĝin kaj doni vian opinion',
451
+    'info_propose_5' => 'en la forumo ligita al ĝi. Ĝi estas disponebla el la adreso :',
452
+    'info_publie_01' => 'La artikolo "@titre@" estis validigita de @connect_nom@.',
453
+    'info_publie_1' => '[@nom_site_spip@] PUBLIKIGAS : @titre@',
454
+    'info_publie_2' => 'Artikolo publikigita
455 455
 --------------',
456
-	'info_rechercher' => 'Serĉi',
457
-	'info_rechercher_02' => 'Serĉi :',
458
-	'info_remplacer_vignette' => 'Anstataŭi la defaŭltan vinjeton per propra vinjeto :',
459
-	'info_rubriques_nb' => '@nb@ rubrikoj',
460
-	'info_rubriques_un' => '1 rubriko',
461
-	'info_sans_titre_2' => 'sen titolo',
462
-	'info_selectionner_fichier' => 'Vi povas selekti dosieron el la dosierujo @upload@',
463
-	'info_selectionner_fichier_2' => 'Elektu dosieron :',
464
-	'info_sites_nb' => '@nb@ retejoj',
465
-	'info_sites_un' => '1 retejo',
466
-	'info_supprimer_vignette' => 'forigi la vinjeton',
467
-	'info_symbole_bleu' => 'La <b>blua</b> simbolo indikas <b>memorigilon</b> : tio estas al vi persone adresata memoriga mesaĝo.',
468
-	'info_symbole_jaune' => 'La <b>flava</b> simbolo indikas <b>anoncon al ĉiuj redaktantoj</b> : modifebla de ĉiuj mastrumantoj, kaj videbla de ĉiuj redaktantoj.',
469
-	'info_symbole_vert' => 'La <b>verda</b> simbolo indikas la <b>mesaĝojn interŝanĝitajn kun aliaj uzantoj</b> de la retejo.',
470
-	'info_telecharger_nouveau_logo' => 'Alŝuti novan vinjeton :',
471
-	'info_telecharger_ordinateur' => 'Alŝuti ekde via komputilo :',
472
-	'info_tous_resultats_enregistres' => '[ĉiuj rezultoj estas registritaj]',
473
-	'info_tout_afficher' => 'Ĉion afiŝi',
474
-	'info_travaux_texte' => 'Tiu retejo ne jam estas konfigurita. Bonvolu reveni poste...',
475
-	'info_travaux_titre' => 'Retejo prilaborata ',
476
-	'info_trop_resultat' => 'Tro da rezultoj por "@cherche_mot@" ; bonvolu fajnigi la serĉokriteriojn.',
477
-	'info_utilisation_messagerie_interne' => 'Vi uzas la internan poŝton de tiu ĉi retejo.',
478
-	'info_valider_lien' => 'validigi tiun ĉi ligilon',
479
-	'info_verifier_image' => ', bonvolu kontroli ĉu viaj bildoj estas trafe transigitaj.',
480
-	'info_vignette_defaut' => 'Defaŭlta vinjeto',
481
-	'info_vignette_personnalisee' => 'Persona vinjeto',
482
-	'info_visite' => 'vizito :',
483
-	'info_vos_rendez_vous' => 'Viaj estontaj rendevuoj',
484
-	'infos_vos_pense_bete' => 'Viaj memorigiloj',
456
+    'info_rechercher' => 'Serĉi',
457
+    'info_rechercher_02' => 'Serĉi :',
458
+    'info_remplacer_vignette' => 'Anstataŭi la defaŭltan vinjeton per propra vinjeto :',
459
+    'info_rubriques_nb' => '@nb@ rubrikoj',
460
+    'info_rubriques_un' => '1 rubriko',
461
+    'info_sans_titre_2' => 'sen titolo',
462
+    'info_selectionner_fichier' => 'Vi povas selekti dosieron el la dosierujo @upload@',
463
+    'info_selectionner_fichier_2' => 'Elektu dosieron :',
464
+    'info_sites_nb' => '@nb@ retejoj',
465
+    'info_sites_un' => '1 retejo',
466
+    'info_supprimer_vignette' => 'forigi la vinjeton',
467
+    'info_symbole_bleu' => 'La <b>blua</b> simbolo indikas <b>memorigilon</b> : tio estas al vi persone adresata memoriga mesaĝo.',
468
+    'info_symbole_jaune' => 'La <b>flava</b> simbolo indikas <b>anoncon al ĉiuj redaktantoj</b> : modifebla de ĉiuj mastrumantoj, kaj videbla de ĉiuj redaktantoj.',
469
+    'info_symbole_vert' => 'La <b>verda</b> simbolo indikas la <b>mesaĝojn interŝanĝitajn kun aliaj uzantoj</b> de la retejo.',
470
+    'info_telecharger_nouveau_logo' => 'Alŝuti novan vinjeton :',
471
+    'info_telecharger_ordinateur' => 'Alŝuti ekde via komputilo :',
472
+    'info_tous_resultats_enregistres' => '[ĉiuj rezultoj estas registritaj]',
473
+    'info_tout_afficher' => 'Ĉion afiŝi',
474
+    'info_travaux_texte' => 'Tiu retejo ne jam estas konfigurita. Bonvolu reveni poste...',
475
+    'info_travaux_titre' => 'Retejo prilaborata ',
476
+    'info_trop_resultat' => 'Tro da rezultoj por "@cherche_mot@" ; bonvolu fajnigi la serĉokriteriojn.',
477
+    'info_utilisation_messagerie_interne' => 'Vi uzas la internan poŝton de tiu ĉi retejo.',
478
+    'info_valider_lien' => 'validigi tiun ĉi ligilon',
479
+    'info_verifier_image' => ', bonvolu kontroli ĉu viaj bildoj estas trafe transigitaj.',
480
+    'info_vignette_defaut' => 'Defaŭlta vinjeto',
481
+    'info_vignette_personnalisee' => 'Persona vinjeto',
482
+    'info_visite' => 'vizito :',
483
+    'info_vos_rendez_vous' => 'Viaj estontaj rendevuoj',
484
+    'infos_vos_pense_bete' => 'Viaj memorigiloj',
485 485
 
486
-	// L
487
-	'label_ajout_id_rapide' => 'Rapida aldono',
488
-	'label_poids_fichier' => 'Grandeco',
489
-	'lien_afficher_icones_seuls' => 'Afiŝi nur la piktogramojn',
490
-	'lien_afficher_texte_icones' => 'Afiŝi la piktogramojn kaj la tekston',
491
-	'lien_afficher_texte_seul' => 'Afiŝi nur la tekston',
492
-	'lien_liberer' => 'liberigi',
493
-	'lien_liberer_tous' => 'Liberigi ĉiujn',
494
-	'lien_nouvea_pense_bete' => 'NOVA MEMORIGILO',
495
-	'lien_nouveau_message' => 'NOVA MESAĜO',
496
-	'lien_nouvelle_annonce' => 'NOVA ANONCO',
497
-	'lien_petitions' => 'PETSKRIBO',
498
-	'lien_popularite' => 'populareco : @popularite@%',
499
-	'lien_racine_site' => 'RADIKO DE LA RETEJO',
500
-	'lien_reessayer' => 'reprovi',
501
-	'lien_repondre_message' => 'Respondi al tiu mesaĝo',
502
-	'lien_supprimer' => 'forigi',
503
-	'lien_tout_afficher' => 'Afiŝi ĉion',
504
-	'lien_visite_site' => 'viziti tiun retejon',
505
-	'lien_visites' => '@visites@ vizitoj',
506
-	'lien_voir_auteur' => 'Vidi tiun aŭtoron',
507
-	'ligne' => 'Linio',
508
-	'login' => 'Ensaluti',
509
-	'login_acces_prive' => 'aliro al la privata spaco',
510
-	'login_autre_identifiant' => 'ensaluti per alia salutnomo',
511
-	'login_cookie_accepte' => 'Bonvolu agordi vian retumilon por ke ĝi akceptu ilin (almenaŭ por tiu ĉi retejo).',
512
-	'login_cookie_oblige' => 'Por sekure ensalutiĝi en tiu retejo, vi devas akcepti la kuketojn.',
513
-	'login_deconnexion_ok' => 'Elsalutinta.',
514
-	'login_erreur_pass' => 'Pasvort-eraro.',
515
-	'login_espace_prive' => 'privata spaco',
516
-	'login_identifiant_inconnu' => 'La salutnomo « @login@ » estas nekonata.',
517
-	'login_login' => 'Salutnomo :',
518
-	'login_login2' => 'Salutnomo aŭ retpoŝtadreso :',
519
-	'login_login_pass_incorrect' => '(Salutnomo aŭ pasvorto ne valida.)',
520
-	'login_motpasseoublie' => 'ĉu pasvorto forgesita ?',
521
-	'login_non_securise' => 'Atentu, tiu formularo ne estas sekurigita ;.
486
+    // L
487
+    'label_ajout_id_rapide' => 'Rapida aldono',
488
+    'label_poids_fichier' => 'Grandeco',
489
+    'lien_afficher_icones_seuls' => 'Afiŝi nur la piktogramojn',
490
+    'lien_afficher_texte_icones' => 'Afiŝi la piktogramojn kaj la tekston',
491
+    'lien_afficher_texte_seul' => 'Afiŝi nur la tekston',
492
+    'lien_liberer' => 'liberigi',
493
+    'lien_liberer_tous' => 'Liberigi ĉiujn',
494
+    'lien_nouvea_pense_bete' => 'NOVA MEMORIGILO',
495
+    'lien_nouveau_message' => 'NOVA MESAĜO',
496
+    'lien_nouvelle_annonce' => 'NOVA ANONCO',
497
+    'lien_petitions' => 'PETSKRIBO',
498
+    'lien_popularite' => 'populareco : @popularite@%',
499
+    'lien_racine_site' => 'RADIKO DE LA RETEJO',
500
+    'lien_reessayer' => 'reprovi',
501
+    'lien_repondre_message' => 'Respondi al tiu mesaĝo',
502
+    'lien_supprimer' => 'forigi',
503
+    'lien_tout_afficher' => 'Afiŝi ĉion',
504
+    'lien_visite_site' => 'viziti tiun retejon',
505
+    'lien_visites' => '@visites@ vizitoj',
506
+    'lien_voir_auteur' => 'Vidi tiun aŭtoron',
507
+    'ligne' => 'Linio',
508
+    'login' => 'Ensaluti',
509
+    'login_acces_prive' => 'aliro al la privata spaco',
510
+    'login_autre_identifiant' => 'ensaluti per alia salutnomo',
511
+    'login_cookie_accepte' => 'Bonvolu agordi vian retumilon por ke ĝi akceptu ilin (almenaŭ por tiu ĉi retejo).',
512
+    'login_cookie_oblige' => 'Por sekure ensalutiĝi en tiu retejo, vi devas akcepti la kuketojn.',
513
+    'login_deconnexion_ok' => 'Elsalutinta.',
514
+    'login_erreur_pass' => 'Pasvort-eraro.',
515
+    'login_espace_prive' => 'privata spaco',
516
+    'login_identifiant_inconnu' => 'La salutnomo « @login@ » estas nekonata.',
517
+    'login_login' => 'Salutnomo :',
518
+    'login_login2' => 'Salutnomo aŭ retpoŝtadreso :',
519
+    'login_login_pass_incorrect' => '(Salutnomo aŭ pasvorto ne valida.)',
520
+    'login_motpasseoublie' => 'ĉu pasvorto forgesita ?',
521
+    'login_non_securise' => 'Atentu, tiu formularo ne estas sekurigita ;.
522 522
    Se vi ne volas ke via pasvorto estu fraŭde
523 523
    interkaptita ĉe la reto, bonvolu aktivigi
524 524
    Javascript-on en via retumilo',
525
-	'login_nouvelle_tentative' => 'Nova provo',
526
-	'login_par_ici' => 'Vi estas registrita... ĉi tien...',
527
-	'login_pass2' => 'Pasvorto :',
528
-	'login_preferez_refuser' => '<b>Se vi preferas rifuzi kuketojn</b>, alia konektometodo (malpli sekura) estas je via dispono :',
529
-	'login_recharger' => 'freŝigi tiun ĉi paĝon',
530
-	'login_rester_identifie' => 'Resti ensalutinta kelkajn tagojn', # MODIF
531
-	'login_retour_public' => 'Reen al la publika spaco',
532
-	'login_retour_site' => 'Reen al la publika spaco',
533
-	'login_retoursitepublic' => 'reen al la publika spaco',
534
-	'login_sans_cookie' => 'Ensaluto sen kuketo',
535
-	'login_securise' => 'Sekura salutnomo',
536
-	'login_sinscrire' => 'registriĝi', # MODIF
537
-	'login_test_navigateur' => 'testo retumilo/rekonektiĝo',
538
-	'login_verifiez_navigateur' => '(Kontrolu tamen ke via retumilo ne memoras pri via pasvorto...)',
525
+    'login_nouvelle_tentative' => 'Nova provo',
526
+    'login_par_ici' => 'Vi estas registrita... ĉi tien...',
527
+    'login_pass2' => 'Pasvorto :',
528
+    'login_preferez_refuser' => '<b>Se vi preferas rifuzi kuketojn</b>, alia konektometodo (malpli sekura) estas je via dispono :',
529
+    'login_recharger' => 'freŝigi tiun ĉi paĝon',
530
+    'login_rester_identifie' => 'Resti ensalutinta kelkajn tagojn', # MODIF
531
+    'login_retour_public' => 'Reen al la publika spaco',
532
+    'login_retour_site' => 'Reen al la publika spaco',
533
+    'login_retoursitepublic' => 'reen al la publika spaco',
534
+    'login_sans_cookie' => 'Ensaluto sen kuketo',
535
+    'login_securise' => 'Sekura salutnomo',
536
+    'login_sinscrire' => 'registriĝi', # MODIF
537
+    'login_test_navigateur' => 'testo retumilo/rekonektiĝo',
538
+    'login_verifiez_navigateur' => '(Kontrolu tamen ke via retumilo ne memoras pri via pasvorto...)',
539 539
 
540
-	// M
541
-	'masquer_colonne' => 'Kaŝi tiun ĉi kolumnon',
542
-	'masquer_trad' => 'kaŝi la tradukojn',
543
-	'message_nouveaux_identifiants_echec' => 'Ne eblas krei novajn ensalutilojn.',
544
-	'message_nouveaux_identifiants_echec_envoi' => 'Ne eblis sendi la novajn ensalutilojn.',
545
-	'message_nouveaux_identifiants_ok' => 'La novaj ensalutilojn estis senditaj al @email@.',
546
-	'module_fichiers_langues' => 'Dosieroj de lingvo',
540
+    // M
541
+    'masquer_colonne' => 'Kaŝi tiun ĉi kolumnon',
542
+    'masquer_trad' => 'kaŝi la tradukojn',
543
+    'message_nouveaux_identifiants_echec' => 'Ne eblas krei novajn ensalutilojn.',
544
+    'message_nouveaux_identifiants_echec_envoi' => 'Ne eblis sendi la novajn ensalutilojn.',
545
+    'message_nouveaux_identifiants_ok' => 'La novaj ensalutilojn estis senditaj al @email@.',
546
+    'module_fichiers_langues' => 'Dosieroj de lingvo',
547 547
 
548
-	// N
549
-	'navigateur_pas_redirige' => 'Se via retumilo ne redirektiĝas, daŭrigu musklakante ĉi tie.',
550
-	'numero' => 'Numero',
548
+    // N
549
+    'navigateur_pas_redirige' => 'Se via retumilo ne redirektiĝas, daŭrigu musklakante ĉi tie.',
550
+    'numero' => 'Numero',
551 551
 
552
-	// O
553
-	'occurence' => 'Trafo',
554
-	'onglet_affacer_base' => 'Forigi la datenbazon',
555
-	'onglet_auteur' => 'La aŭtoro',
556
-	'onglet_contenu_site' => 'Enhavo de la retejo',
557
-	'onglet_evolution_visite_mod' => 'Evoluado',
558
-	'onglet_fonctions_avances' => 'Ampleksaj funkcioj',
559
-	'onglet_informations_personnelles' => 'Personaj datenoj',
560
-	'onglet_interactivite' => 'Interagado',
561
-	'onglet_messagerie' => 'Mesaĝilo',
562
-	'onglet_repartition_rubrique' => 'Distribuo laŭ rubrikoj',
563
-	'onglet_save_restaur_base' => 'Savkopii/restaŭri la datenbazon',
564
-	'onglet_vider_cache' => 'Malplenigi la staplon',
552
+    // O
553
+    'occurence' => 'Trafo',
554
+    'onglet_affacer_base' => 'Forigi la datenbazon',
555
+    'onglet_auteur' => 'La aŭtoro',
556
+    'onglet_contenu_site' => 'Enhavo de la retejo',
557
+    'onglet_evolution_visite_mod' => 'Evoluado',
558
+    'onglet_fonctions_avances' => 'Ampleksaj funkcioj',
559
+    'onglet_informations_personnelles' => 'Personaj datenoj',
560
+    'onglet_interactivite' => 'Interagado',
561
+    'onglet_messagerie' => 'Mesaĝilo',
562
+    'onglet_repartition_rubrique' => 'Distribuo laŭ rubrikoj',
563
+    'onglet_save_restaur_base' => 'Savkopii/restaŭri la datenbazon',
564
+    'onglet_vider_cache' => 'Malplenigi la staplon',
565 565
 
566
-	// P
567
-	'pass_choix_pass' => 'Bonvolu elekti vian novan pasvorton :',
568
-	'pass_erreur' => 'Eraro',
569
-	'pass_erreur_acces_refuse' => '<b>Eraro :</b> vi ne plu havas aliron al tiu retejo.',
570
-	'pass_erreur_code_inconnu' => '<b>Eraro :</b> tiu kodo kongruas kun neniu el la vizitantoj rajtantaj aliri tiun ĉi retejon.',
571
-	'pass_erreur_non_enregistre' => '<b>Eraro :</b> la retpoŝtadreso <tt>@email_oubli@</tt> ne estas registrita ĉi tie.',
572
-	'pass_erreur_non_valide' => '<b>Eraro :</b> tiu retpoŝtadreso <tt>@email_oubli@</tt> ne validas !',
573
-	'pass_erreur_probleme_technique' => '<b>Eraro :</b> pro teknika problemo, la retmesaĝo ne povas esti sendata.',
574
-	'pass_espace_prive_bla' => 'La privata spaco de tiu ĉi retejo estas malfermita al
566
+    // P
567
+    'pass_choix_pass' => 'Bonvolu elekti vian novan pasvorton :',
568
+    'pass_erreur' => 'Eraro',
569
+    'pass_erreur_acces_refuse' => '<b>Eraro :</b> vi ne plu havas aliron al tiu retejo.',
570
+    'pass_erreur_code_inconnu' => '<b>Eraro :</b> tiu kodo kongruas kun neniu el la vizitantoj rajtantaj aliri tiun ĉi retejon.',
571
+    'pass_erreur_non_enregistre' => '<b>Eraro :</b> la retpoŝtadreso <tt>@email_oubli@</tt> ne estas registrita ĉi tie.',
572
+    'pass_erreur_non_valide' => '<b>Eraro :</b> tiu retpoŝtadreso <tt>@email_oubli@</tt> ne validas !',
573
+    'pass_erreur_probleme_technique' => '<b>Eraro :</b> pro teknika problemo, la retmesaĝo ne povas esti sendata.',
574
+    'pass_espace_prive_bla' => 'La privata spaco de tiu ĉi retejo estas malfermita al
575 575
   vizitantoj, post ties registriĝo. Tio farita, vi povos
576 576
   konsulti la redaktatajn artikolojn, proponi artikolojn
577 577
   kaj partopreni en ĉiuj forumoj.',
578
-	'pass_forum_bla' => 'Vi petis por kontribui en forumo
578
+    'pass_forum_bla' => 'Vi petis por kontribui en forumo
579 579
   rezervita al registritaj vizitantoj.',
580
-	'pass_indiquez_cidessous' => 'Indiku ĉi-sube la retpoŝtadreson laŭ kiu vi
580
+    'pass_indiquez_cidessous' => 'Indiku ĉi-sube la retpoŝtadreson laŭ kiu vi
581 581
    antaŭe registriĝis. Vi
582 582
    ricevos retmesaĝon kiu indikos al vi kion fari por
583 583
    reakiri vian alir-rajton.',
584
-	'pass_mail_passcookie' => '(tio ĉi estas aŭtomata mesaĝo)
584
+    'pass_mail_passcookie' => '(tio ĉi estas aŭtomata mesaĝo)
585 585
 Por reakiri alireblon al la retejo
586 586
 @nom_site_spip@ (@adresse_site@)
587 587
 
@@ -593,145 +593,145 @@  discard block
 block discarded – undo
593 593
 kaj ensaluti.
594 594
 
595 595
 ',
596
-	'pass_mot_oublie' => 'Pasvorto forgesita',
597
-	'pass_nouveau_enregistre' => 'Via nova pasvorto estas registrita.',
598
-	'pass_nouveau_pass' => 'Nova pasvorto',
599
-	'pass_ok' => 'JES',
600
-	'pass_oubli_mot' => 'Pasvorto-forgeso',
601
-	'pass_procedure_changer' => 'Por ŝanĝi vian pasvorton, specifu al ni la asociitan retpoŝtadreson el via konto.',
602
-	'pass_quitter_fenetre' => 'Forlasi tiun fenestron',
603
-	'pass_rappel_login' => 'Memoru : via ensalutilo (salutnomo) estas « @login@ ».',
604
-	'pass_recevoir_mail' => 'Vi ricevos retmesaĝon indikantan al vi kiel retrovi vian aliron al la retejo.', # MODIF
605
-	'pass_retour_public' => 'Reen al la publika spaco',
606
-	'pass_rien_a_faire_ici' => 'Nenion por fari ĉi tie.',
607
-	'pass_vousinscrire' => 'Registriĝi ĉe tiu retejo',
608
-	'precedent' => 'antaŭan',
609
-	'previsualisation' => 'Antaŭrigardo',
610
-	'previsualiser' => 'Antaŭrigardi',
596
+    'pass_mot_oublie' => 'Pasvorto forgesita',
597
+    'pass_nouveau_enregistre' => 'Via nova pasvorto estas registrita.',
598
+    'pass_nouveau_pass' => 'Nova pasvorto',
599
+    'pass_ok' => 'JES',
600
+    'pass_oubli_mot' => 'Pasvorto-forgeso',
601
+    'pass_procedure_changer' => 'Por ŝanĝi vian pasvorton, specifu al ni la asociitan retpoŝtadreson el via konto.',
602
+    'pass_quitter_fenetre' => 'Forlasi tiun fenestron',
603
+    'pass_rappel_login' => 'Memoru : via ensalutilo (salutnomo) estas « @login@ ».',
604
+    'pass_recevoir_mail' => 'Vi ricevos retmesaĝon indikantan al vi kiel retrovi vian aliron al la retejo.', # MODIF
605
+    'pass_retour_public' => 'Reen al la publika spaco',
606
+    'pass_rien_a_faire_ici' => 'Nenion por fari ĉi tie.',
607
+    'pass_vousinscrire' => 'Registriĝi ĉe tiu retejo',
608
+    'precedent' => 'antaŭan',
609
+    'previsualisation' => 'Antaŭrigardo',
610
+    'previsualiser' => 'Antaŭrigardi',
611 611
 
612
-	// R
613
-	'retour' => 'Reen',
612
+    // R
613
+    'retour' => 'Reen',
614 614
 
615
-	// S
616
-	'spip_conforme_dtd' => 'SPIP konsideras tiun dokumenton konforma al sia DOCTYPE :',
617
-	'squelette' => 'skeleto',
618
-	'squelette_inclus_ligne' => 'skeleto inkluzivita, linio',
619
-	'squelette_ligne' => 'skeleto, linio',
620
-	'stats_visites_et_popularite' => '@visites@ vizitoj ; populareco : @popularite@',
621
-	'suivant' => 'sekvanta',
615
+    // S
616
+    'spip_conforme_dtd' => 'SPIP konsideras tiun dokumenton konforma al sia DOCTYPE :',
617
+    'squelette' => 'skeleto',
618
+    'squelette_inclus_ligne' => 'skeleto inkluzivita, linio',
619
+    'squelette_ligne' => 'skeleto, linio',
620
+    'stats_visites_et_popularite' => '@visites@ vizitoj ; populareco : @popularite@',
621
+    'suivant' => 'sekvanta',
622 622
 
623
-	// T
624
-	'taille_go' => '@taille@ Go',
625
-	'taille_ko' => '@taille@ kb',
626
-	'taille_mo' => '@taille@ Mb',
627
-	'taille_octets' => '@taille@ bitokoj',
628
-	'taille_octets_bi' => '@taille@ bitokoj',
629
-	'texte_actualite_site_1' => 'Kiam vi estos kutimiĝinta kun la interfaco, vi povos musklaki sur « ',
630
-	'texte_actualite_site_2' => 'kompleta interfaco',
631
-	'texte_actualite_site_3' => ' » por malfermi pliajn eblecojn.',
632
-	'texte_creation_automatique_vignette' => 'La aŭtomata kreado de antaŭrigardaj vinjetoj estas aktivigita ĉe tiu ĉi retejo. Se vi instalas pere de tiu ĉi formularo bildojn je la formato(j) @gd_formats@, ili estos akompanataj de vinjeto kun maksimuma grandeco de @taille_preview@ bilderoj.',
633
-	'texte_documents_associes' => 'La sekvantaj dokumentoj estas asociitaj al la artikolo,
623
+    // T
624
+    'taille_go' => '@taille@ Go',
625
+    'taille_ko' => '@taille@ kb',
626
+    'taille_mo' => '@taille@ Mb',
627
+    'taille_octets' => '@taille@ bitokoj',
628
+    'taille_octets_bi' => '@taille@ bitokoj',
629
+    'texte_actualite_site_1' => 'Kiam vi estos kutimiĝinta kun la interfaco, vi povos musklaki sur « ',
630
+    'texte_actualite_site_2' => 'kompleta interfaco',
631
+    'texte_actualite_site_3' => ' » por malfermi pliajn eblecojn.',
632
+    'texte_creation_automatique_vignette' => 'La aŭtomata kreado de antaŭrigardaj vinjetoj estas aktivigita ĉe tiu ĉi retejo. Se vi instalas pere de tiu ĉi formularo bildojn je la formato(j) @gd_formats@, ili estos akompanataj de vinjeto kun maksimuma grandeco de @taille_preview@ bilderoj.',
633
+    'texte_documents_associes' => 'La sekvantaj dokumentoj estas asociitaj al la artikolo,
634 634
     sed ili ne estis rekte enmetitaj en ĝin.
635 635
     Laŭ la enpaĝigo de la publika spaco,
636 636
     ili povos aperi en formo de alkroĉitaj dokumentoj.',
637
-	'texte_erreur_mise_niveau_base' => 'Datenbazo-eraro dum la alniveligo.
637
+    'texte_erreur_mise_niveau_base' => 'Datenbazo-eraro dum la alniveligo.
638 638
   La bildo <b>@fichier@</b> ne transŝutiĝis (artikolo @id_article@).
639 639
   Bone notu tiun referencon, reprovu la alniveligon,
640 640
   kaj fine kontrolu ke la bildoj plu aperu
641 641
 en la artikoloj.',
642
-	'texte_erreur_visiteur' => 'Vi provis eniri la privatan spacon pere de ne alir-rajtiga salutnomo.',
643
-	'texte_inc_auth_1' => 'Vi ensalutis laŭ la
642
+    'texte_erreur_visiteur' => 'Vi provis eniri la privatan spacon pere de ne alir-rajtiga salutnomo.',
643
+    'texte_inc_auth_1' => 'Vi ensalutis laŭ la
644 644
   salutnomo <b>@auth_login@</b>, sed tiu ne/ne plu ekzistas en la datenbazo.
645 645
   Provu',
646
-	'texte_inc_auth_2' => 'rekonektiĝi',
647
-	'texte_inc_auth_3' => ', post esti eventuale ferminta kaj
646
+    'texte_inc_auth_2' => 'rekonektiĝi',
647
+    'texte_inc_auth_3' => ', post esti eventuale ferminta kaj
648 648
   restartiginta via retumilon.',
649
-	'texte_inc_config' => 'La ŝanĝoj faritaj en tiuj ĉi paĝoj influas grave la
649
+    'texte_inc_config' => 'La ŝanĝoj faritaj en tiuj ĉi paĝoj influas grave la
650 650
  funkciadon de via retejo. Ni konsilas al vi ne plu interveni antaŭ ol esti pli
651 651
  kutimiĝinta pri la funkciado de la SPIP-sistemo. <br /><br /><b>Pli
652 652
  ĝenerale, estas tre konsilinde lasi la mastrumadon de tiuj ĉi paĝoj
653 653
 sub la respondeco de la ĉefa retejestro .</b>',
654
-	'texte_inc_meta_1' => 'La sistemo detektis eraron dum skribado de la dosiero <code>@fichier@</code>. Bonvolu, kiel mastrumanto de la retejo,',
655
-	'texte_inc_meta_2' => 'kontroli la skriborajtojn',
656
-	'texte_inc_meta_3' => 'en la dosierujo <code>@repertoire@</code>.',
657
-	'texte_statut_en_cours_redaction' => 'Redaktataj',
658
-	'texte_statut_poubelle' => 'en rubujo',
659
-	'texte_statut_propose_evaluation' => 'proponita por taksado',
660
-	'texte_statut_publie' => 'rete publikigita',
661
-	'texte_statut_refuse' => 'rifuzita',
662
-	'titre_ajouter_mot_cle' => 'ALDONI ŜLOSILVORTON :',
663
-	'titre_cadre_raccourcis' => 'RAPIDAJ ALIROJ :',
664
-	'titre_changer_couleur_interface' => 'Ŝanĝi la koloron de la interfaco',
665
-	'titre_image_admin_article' => 'Vi povas mastrumi tiun ĉi artikolon',
666
-	'titre_image_administrateur' => 'Mastrumanto',
667
-	'titre_image_aide' => 'Helpo pri tiu elemento',
668
-	'titre_image_auteur_supprime' => 'Aŭtoro forigita',
669
-	'titre_image_redacteur' => 'Redaktanto sen alireblo',
670
-	'titre_image_redacteur_02' => 'Redaktanto',
671
-	'titre_image_selecteur' => 'Montri la liston',
672
-	'titre_image_visiteur' => 'Vizitanto',
673
-	'titre_joindre_document' => 'ALDONI DOKUMENTON',
674
-	'titre_mots_cles' => 'ŜLOSILVORTOJ',
675
-	'titre_probleme_technique' => 'Atentu : teknika problemo  (SQL-servilo) malhelpas la aliron al tiu parto de la retejo. Dankon pro via komprenemo.',
676
-	'titre_publier_document' => 'PUBLIKIGI DOKUMENTON EN TIU ĈI RUBRIKO',
677
-	'titre_signatures_attente' => 'Subskriboj validotaj',
678
-	'titre_signatures_confirmees' => 'Subskriboj konfirmitaj',
679
-	'titre_statistiques' => 'Statistikoj de la retejo',
680
-	'titre_titre_document' => 'Titolo de la dokumento :',
681
-	'todo' => 'venonta',
682
-	'trad_definir_reference' => 'Elekti „@titre@“ kiel referenco de la tradukoj',
683
-	'trad_reference' => '(referenco de la traduktoj)',
654
+    'texte_inc_meta_1' => 'La sistemo detektis eraron dum skribado de la dosiero <code>@fichier@</code>. Bonvolu, kiel mastrumanto de la retejo,',
655
+    'texte_inc_meta_2' => 'kontroli la skriborajtojn',
656
+    'texte_inc_meta_3' => 'en la dosierujo <code>@repertoire@</code>.',
657
+    'texte_statut_en_cours_redaction' => 'Redaktataj',
658
+    'texte_statut_poubelle' => 'en rubujo',
659
+    'texte_statut_propose_evaluation' => 'proponita por taksado',
660
+    'texte_statut_publie' => 'rete publikigita',
661
+    'texte_statut_refuse' => 'rifuzita',
662
+    'titre_ajouter_mot_cle' => 'ALDONI ŜLOSILVORTON :',
663
+    'titre_cadre_raccourcis' => 'RAPIDAJ ALIROJ :',
664
+    'titre_changer_couleur_interface' => 'Ŝanĝi la koloron de la interfaco',
665
+    'titre_image_admin_article' => 'Vi povas mastrumi tiun ĉi artikolon',
666
+    'titre_image_administrateur' => 'Mastrumanto',
667
+    'titre_image_aide' => 'Helpo pri tiu elemento',
668
+    'titre_image_auteur_supprime' => 'Aŭtoro forigita',
669
+    'titre_image_redacteur' => 'Redaktanto sen alireblo',
670
+    'titre_image_redacteur_02' => 'Redaktanto',
671
+    'titre_image_selecteur' => 'Montri la liston',
672
+    'titre_image_visiteur' => 'Vizitanto',
673
+    'titre_joindre_document' => 'ALDONI DOKUMENTON',
674
+    'titre_mots_cles' => 'ŜLOSILVORTOJ',
675
+    'titre_probleme_technique' => 'Atentu : teknika problemo  (SQL-servilo) malhelpas la aliron al tiu parto de la retejo. Dankon pro via komprenemo.',
676
+    'titre_publier_document' => 'PUBLIKIGI DOKUMENTON EN TIU ĈI RUBRIKO',
677
+    'titre_signatures_attente' => 'Subskriboj validotaj',
678
+    'titre_signatures_confirmees' => 'Subskriboj konfirmitaj',
679
+    'titre_statistiques' => 'Statistikoj de la retejo',
680
+    'titre_titre_document' => 'Titolo de la dokumento :',
681
+    'todo' => 'venonta',
682
+    'trad_definir_reference' => 'Elekti „@titre@“ kiel referenco de la tradukoj',
683
+    'trad_reference' => '(referenco de la traduktoj)',
684 684
 
685
-	// U
686
-	'upload_limit' => 'Tiu dosiero estas tro granda por la servilo : la maksimuma dosiergrando, kiam oni alŝutas, estas @max@.',
685
+    // U
686
+    'upload_limit' => 'Tiu dosiero estas tro granda por la servilo : la maksimuma dosiergrando, kiam oni alŝutas, estas @max@.',
687 687
 
688
-	// Z
689
-	'zbug_balise_b_aval' => ' : posta B marko',
690
-	'zbug_balise_inexistante' => 'Marko @balise@ malbone deklarita por @from@',
691
-	'zbug_balise_sans_argument' => 'Mankas argumento en la marko @balise@',
692
-	'zbug_boucle' => 'iteracio',
693
-	'zbug_boucle_recursive_undef' => 'Nedifinita rekursia iteracio : @nom@',
694
-	'zbug_calcul' => 'komputado',
695
-	'zbug_champ_hors_boucle' => 'Kampo @champ@ eksteras iteracion',
696
-	'zbug_champ_hors_motif' => 'Kampo @champ@ eksteras kontekston @motif@',
697
-	'zbug_code' => 'kodo',
698
-	'zbug_critere_inconnu' => 'Nekonata kriterio @critere@',
699
-	'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} pri tabelo sen atoma ĉefŝlosilo',
700
-	'zbug_distant_interdit' => 'Ago ĉe tiu ekstera datenbazo malpermesata',
701
-	'zbug_doublon_table_sans_cle_primaire' => 'Duobloj uzitaj ĉe tabelo, kiu ne havas simplan ĉefŝlosilon',
702
-	'zbug_doublon_table_sans_index' => 'Duoblaĵoj en la datentabelo sen indekso',
703
-	'zbug_erreur_boucle_double' => 'Duobla difino de la interacio @id@',
704
-	'zbug_erreur_boucle_fermant' => 'Iteracio @id@ ne fermita',
705
-	'zbug_erreur_boucle_syntaxe' => 'Sintakso de la iteracia @id@ ne valida',
706
-	'zbug_erreur_compilation' => 'Kompil-eraro',
707
-	'zbug_erreur_execution_page' => 'Eraro dum plenumo',
708
-	'zbug_erreur_filtre' => 'Filtrilo @filtre@ nedifinita',
709
-	'zbug_erreur_meme_parent' => 'La kriterio {meme_parent} nur aplikiĝas je iteracioj (FORUMS) aŭ (RUBRIQUES)',
710
-	'zbug_erreur_squelette' => 'Eraro(j) en la skeleto',
711
-	'zbug_hors_compilation' => 'Ne kompilita',
712
-	'zbug_info_erreur_squelette' => 'Eraro ĉe la retejo',
713
-	'zbug_inversion_ordre_inexistant' => 'Inversigo de ne ekzistanta ordo',
714
-	'zbug_pagination_sans_critere' => 'Marko #PAGINATION senkriteria {pagination} aŭ uzata en rekursia iteracio',
715
-	'zbug_parametres_inclus_incorrects' => 'Ne korektaj inkludaj parametroj : @param@',
716
-	'zbug_profile' => 'Kalkuldaŭro : @time@',
717
-	'zbug_resultat' => 'rezulto',
718
-	'zbug_serveur_indefini' => 'Nedifinata SQL-servilo',
719
-	'zbug_statistiques' => 'statistikoj pri SQL-informpetoj ordigitaj laŭ daŭro',
720
-	'zbug_table_inconnue' => 'nekonata SQL « @table@ » tabelo',
721
-	'zxml_connus_attributs' => 'konataj atributoj',
722
-	'zxml_de' => 'de',
723
-	'zxml_inconnu_attribut' => 'nekonataj atributoj',
724
-	'zxml_inconnu_balise' => 'ne konita marko',
725
-	'zxml_inconnu_entite' => 'ne konata ento',
726
-	'zxml_inconnu_id' => 'ne konata ID',
727
-	'zxml_mais_de' => 'sed',
728
-	'zxml_non_conforme' => 'ne kongrua kun la motivo',
729
-	'zxml_non_fils' => 'ne estas filo de',
730
-	'zxml_nonvide_balise' => 'ne malplena marko',
731
-	'zxml_obligatoire_attribut' => 'deviga atributo sed foresta en',
732
-	'zxml_succession_fils_incorrecte' => 'sinsekvo de filoj korekta',
733
-	'zxml_survoler' => 'superflugi por ekvidi korektaĵojn',
734
-	'zxml_valeur_attribut' => 'atributa valoro',
735
-	'zxml_vide_balise' => 'malplena marko',
736
-	'zxml_vu' => 'antaŭe vidita'
688
+    // Z
689
+    'zbug_balise_b_aval' => ' : posta B marko',
690
+    'zbug_balise_inexistante' => 'Marko @balise@ malbone deklarita por @from@',
691
+    'zbug_balise_sans_argument' => 'Mankas argumento en la marko @balise@',
692
+    'zbug_boucle' => 'iteracio',
693
+    'zbug_boucle_recursive_undef' => 'Nedifinita rekursia iteracio : @nom@',
694
+    'zbug_calcul' => 'komputado',
695
+    'zbug_champ_hors_boucle' => 'Kampo @champ@ eksteras iteracion',
696
+    'zbug_champ_hors_motif' => 'Kampo @champ@ eksteras kontekston @motif@',
697
+    'zbug_code' => 'kodo',
698
+    'zbug_critere_inconnu' => 'Nekonata kriterio @critere@',
699
+    'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} pri tabelo sen atoma ĉefŝlosilo',
700
+    'zbug_distant_interdit' => 'Ago ĉe tiu ekstera datenbazo malpermesata',
701
+    'zbug_doublon_table_sans_cle_primaire' => 'Duobloj uzitaj ĉe tabelo, kiu ne havas simplan ĉefŝlosilon',
702
+    'zbug_doublon_table_sans_index' => 'Duoblaĵoj en la datentabelo sen indekso',
703
+    'zbug_erreur_boucle_double' => 'Duobla difino de la interacio @id@',
704
+    'zbug_erreur_boucle_fermant' => 'Iteracio @id@ ne fermita',
705
+    'zbug_erreur_boucle_syntaxe' => 'Sintakso de la iteracia @id@ ne valida',
706
+    'zbug_erreur_compilation' => 'Kompil-eraro',
707
+    'zbug_erreur_execution_page' => 'Eraro dum plenumo',
708
+    'zbug_erreur_filtre' => 'Filtrilo @filtre@ nedifinita',
709
+    'zbug_erreur_meme_parent' => 'La kriterio {meme_parent} nur aplikiĝas je iteracioj (FORUMS) aŭ (RUBRIQUES)',
710
+    'zbug_erreur_squelette' => 'Eraro(j) en la skeleto',
711
+    'zbug_hors_compilation' => 'Ne kompilita',
712
+    'zbug_info_erreur_squelette' => 'Eraro ĉe la retejo',
713
+    'zbug_inversion_ordre_inexistant' => 'Inversigo de ne ekzistanta ordo',
714
+    'zbug_pagination_sans_critere' => 'Marko #PAGINATION senkriteria {pagination} aŭ uzata en rekursia iteracio',
715
+    'zbug_parametres_inclus_incorrects' => 'Ne korektaj inkludaj parametroj : @param@',
716
+    'zbug_profile' => 'Kalkuldaŭro : @time@',
717
+    'zbug_resultat' => 'rezulto',
718
+    'zbug_serveur_indefini' => 'Nedifinata SQL-servilo',
719
+    'zbug_statistiques' => 'statistikoj pri SQL-informpetoj ordigitaj laŭ daŭro',
720
+    'zbug_table_inconnue' => 'nekonata SQL « @table@ » tabelo',
721
+    'zxml_connus_attributs' => 'konataj atributoj',
722
+    'zxml_de' => 'de',
723
+    'zxml_inconnu_attribut' => 'nekonataj atributoj',
724
+    'zxml_inconnu_balise' => 'ne konita marko',
725
+    'zxml_inconnu_entite' => 'ne konata ento',
726
+    'zxml_inconnu_id' => 'ne konata ID',
727
+    'zxml_mais_de' => 'sed',
728
+    'zxml_non_conforme' => 'ne kongrua kun la motivo',
729
+    'zxml_non_fils' => 'ne estas filo de',
730
+    'zxml_nonvide_balise' => 'ne malplena marko',
731
+    'zxml_obligatoire_attribut' => 'deviga atributo sed foresta en',
732
+    'zxml_succession_fils_incorrecte' => 'sinsekvo de filoj korekta',
733
+    'zxml_survoler' => 'superflugi por ekvidi korektaĵojn',
734
+    'zxml_valeur_attribut' => 'atributa valoro',
735
+    'zxml_vide_balise' => 'malplena marko',
736
+    'zxml_vu' => 'antaŭe vidita'
737 737
 );
Please login to merge, or discard this patch.
ecrire/lang/spip_tr.php 1 patch
Indentation   +587 added lines, -587 removed lines patch added patch discarded remove patch
@@ -4,510 +4,510 @@  discard block
 block discarded – undo
4 4
 // ** ne pas modifier le fichier **
5 5
 
6 6
 if (!defined('_ECRIRE_INC_VERSION')) {
7
-	return;
7
+    return;
8 8
 }
9 9
 
10 10
 $GLOBALS[$GLOBALS['idx_lang']] = array(
11 11
 
12
-	// A
13
-	'access_interface_graphique' => 'Tam grafik arayüze geri dön',
14
-	'access_mode_texte' => 'Basitleştirilmiş metin arayüzünü göster',
15
-	'admin_debug' => 'hata ayıkla',
16
-	'admin_modifier_article' => 'Bu makaleyi değiştir',
17
-	'admin_modifier_auteur' => 'Bu yazarı değiştir',
18
-	'admin_modifier_breve' => 'Bu kısa haberi değiştir',
19
-	'admin_modifier_mot' => 'Bu anahtar sözcüğü değiştir',
20
-	'admin_modifier_rubrique' => 'Bu bölümü değiştir',
21
-	'admin_recalculer' => 'Bu sayfayı yeniden oluştur',
22
-	'afficher_trad' => 'çevirileri listele',
23
-	'alerte_maj_impossible' => '<b>Dikkat !</b> SQL veri tabanının @version@ sürümüne güncellenmesi imkansız. Sorun veritabanı değiştirme haklarından kaynaklanıyor olabilir, lütfen sitenizi barındıran şirkete başvurunuz.',
24
-	'alerte_modif_info_concourante' => 'DİKKAT: Bu bilgi başka bir yerde değiştirildi. Güncel değer :',
25
-	'analyse_xml' => 'XML analizi',
26
-	'annuler' => 'İptal et',
27
-	'antispam_champ_vide' => 'Lütfen bu alanı boş bırakınız :',
28
-	'articles_recents' => 'En yeni makaleler',
29
-	'avis_archive_incorrect' => 'arşiv dosyası SPIP dosyası değil',
30
-	'avis_archive_invalide' => 'bu arşiv dosyası geçerli değil',
31
-	'avis_attention' => 'DİKKAT !',
32
-	'avis_champ_incorrect_type_objet' => '@type@ tipindeki nesne için @name@ ismi geçersiz',
33
-	'avis_colonne_inexistante' => '@col@ isimli sütun yok',
34
-	'avis_erreur' => 'Hata: aşağıdaki açıklamaya bakınız',
35
-	'avis_erreur_connexion' => 'Bağlantı hatası',
36
-	'avis_erreur_cookie' => 'çerez sorunu',
37
-	'avis_erreur_fonction_contexte' => 'Yazılım hatası. Bu işlev bu biçimde kullanılmamalı.',
38
-	'avis_erreur_mysql' => 'SQL hatası',
39
-	'avis_erreur_sauvegarde' => 'Yedeklemede hata (@type@ @id_objet@) !',
40
-	'avis_erreur_visiteur' => 'Özel alana erişim sorunu',
12
+    // A
13
+    'access_interface_graphique' => 'Tam grafik arayüze geri dön',
14
+    'access_mode_texte' => 'Basitleştirilmiş metin arayüzünü göster',
15
+    'admin_debug' => 'hata ayıkla',
16
+    'admin_modifier_article' => 'Bu makaleyi değiştir',
17
+    'admin_modifier_auteur' => 'Bu yazarı değiştir',
18
+    'admin_modifier_breve' => 'Bu kısa haberi değiştir',
19
+    'admin_modifier_mot' => 'Bu anahtar sözcüğü değiştir',
20
+    'admin_modifier_rubrique' => 'Bu bölümü değiştir',
21
+    'admin_recalculer' => 'Bu sayfayı yeniden oluştur',
22
+    'afficher_trad' => 'çevirileri listele',
23
+    'alerte_maj_impossible' => '<b>Dikkat !</b> SQL veri tabanının @version@ sürümüne güncellenmesi imkansız. Sorun veritabanı değiştirme haklarından kaynaklanıyor olabilir, lütfen sitenizi barındıran şirkete başvurunuz.',
24
+    'alerte_modif_info_concourante' => 'DİKKAT: Bu bilgi başka bir yerde değiştirildi. Güncel değer :',
25
+    'analyse_xml' => 'XML analizi',
26
+    'annuler' => 'İptal et',
27
+    'antispam_champ_vide' => 'Lütfen bu alanı boş bırakınız :',
28
+    'articles_recents' => 'En yeni makaleler',
29
+    'avis_archive_incorrect' => 'arşiv dosyası SPIP dosyası değil',
30
+    'avis_archive_invalide' => 'bu arşiv dosyası geçerli değil',
31
+    'avis_attention' => 'DİKKAT !',
32
+    'avis_champ_incorrect_type_objet' => '@type@ tipindeki nesne için @name@ ismi geçersiz',
33
+    'avis_colonne_inexistante' => '@col@ isimli sütun yok',
34
+    'avis_erreur' => 'Hata: aşağıdaki açıklamaya bakınız',
35
+    'avis_erreur_connexion' => 'Bağlantı hatası',
36
+    'avis_erreur_cookie' => 'çerez sorunu',
37
+    'avis_erreur_fonction_contexte' => 'Yazılım hatası. Bu işlev bu biçimde kullanılmamalı.',
38
+    'avis_erreur_mysql' => 'SQL hatası',
39
+    'avis_erreur_sauvegarde' => 'Yedeklemede hata (@type@ @id_objet@) !',
40
+    'avis_erreur_visiteur' => 'Özel alana erişim sorunu',
41 41
 
42
-	// B
43
-	'barre_a_accent_grave' => 'A harfinin üstüne aksan ekle (Türkçede anlamsız)',
44
-	'barre_aide' => 'Sayfa düzenini zenginleştirmek için tipografik kısayolları kullanınız',
45
-	'barre_e_accent_aigu' => 'E harfinin üstüne aksan ekle (Türkçe’de anlamsız)',
46
-	'barre_eo' => 'Türkçe’de anlamsız',
47
-	'barre_eo_maj' => 'Türkçe’de anlamsız',
48
-	'barre_euro' => '€ işaretini girin',
49
-	'barre_gras' => '{{Kalın}} yaz',
50
-	'barre_guillemets' => '« Tırnak » içine al',
51
-	'barre_guillemets_simples' => '“İkinci biçimde tırnak” içine al',
52
-	'barre_intertitre' => '{{{Arabaşlık’a}}} dönüştür',
53
-	'barre_italic' => '{Yana yatık (italik)} yaz',
54
-	'barre_lien' => '[Hipermetin bağlantısına->http://...] dönüştür',
55
-	'barre_lien_input' => 'Lütfen bağlantınızın adresini girin (adresi http://www.adresim.com veya bu sitede bulunan bir metnin numarası şeklinde girebilirsiniz).',
56
-	'barre_note' => '[[Sayfa sonu notuna]] dönüştür',
57
-	'barre_paragraphe' => 'Bir paragraf oluştur',
58
-	'barre_quote' => '<quote>Bir iletiden alıntı yap</quote>',
59
-	'bouton_changer' => 'Değiştir',
60
-	'bouton_chercher' => 'Ara',
61
-	'bouton_choisir' => 'Seç',
62
-	'bouton_download' => 'İndir', # MODIF
63
-	'bouton_enregistrer' => 'Kaydet',
64
-	'bouton_radio_desactiver_messagerie_interne' => 'İç iletileri kapat',
65
-	'bouton_radio_envoi_annonces' => 'Yazar duyurularını yolla',
66
-	'bouton_radio_non_envoi_annonces' => 'Duyuruları yollama',
67
-	'bouton_radio_non_envoi_liste_nouveautes' => 'Yenilikler listesini gönderme',
68
-	'bouton_recharger_page' => 'bu sayfayı yeniden yükle',
69
-	'bouton_telecharger' => 'İndir',
70
-	'bouton_upload' => 'İndir', # MODIF
71
-	'bouton_valider' => 'Onayla',
42
+    // B
43
+    'barre_a_accent_grave' => 'A harfinin üstüne aksan ekle (Türkçede anlamsız)',
44
+    'barre_aide' => 'Sayfa düzenini zenginleştirmek için tipografik kısayolları kullanınız',
45
+    'barre_e_accent_aigu' => 'E harfinin üstüne aksan ekle (Türkçe’de anlamsız)',
46
+    'barre_eo' => 'Türkçe’de anlamsız',
47
+    'barre_eo_maj' => 'Türkçe’de anlamsız',
48
+    'barre_euro' => '€ işaretini girin',
49
+    'barre_gras' => '{{Kalın}} yaz',
50
+    'barre_guillemets' => '« Tırnak » içine al',
51
+    'barre_guillemets_simples' => '“İkinci biçimde tırnak” içine al',
52
+    'barre_intertitre' => '{{{Arabaşlık’a}}} dönüştür',
53
+    'barre_italic' => '{Yana yatık (italik)} yaz',
54
+    'barre_lien' => '[Hipermetin bağlantısına->http://...] dönüştür',
55
+    'barre_lien_input' => 'Lütfen bağlantınızın adresini girin (adresi http://www.adresim.com veya bu sitede bulunan bir metnin numarası şeklinde girebilirsiniz).',
56
+    'barre_note' => '[[Sayfa sonu notuna]] dönüştür',
57
+    'barre_paragraphe' => 'Bir paragraf oluştur',
58
+    'barre_quote' => '<quote>Bir iletiden alıntı yap</quote>',
59
+    'bouton_changer' => 'Değiştir',
60
+    'bouton_chercher' => 'Ara',
61
+    'bouton_choisir' => 'Seç',
62
+    'bouton_download' => 'İndir', # MODIF
63
+    'bouton_enregistrer' => 'Kaydet',
64
+    'bouton_radio_desactiver_messagerie_interne' => 'İç iletileri kapat',
65
+    'bouton_radio_envoi_annonces' => 'Yazar duyurularını yolla',
66
+    'bouton_radio_non_envoi_annonces' => 'Duyuruları yollama',
67
+    'bouton_radio_non_envoi_liste_nouveautes' => 'Yenilikler listesini gönderme',
68
+    'bouton_recharger_page' => 'bu sayfayı yeniden yükle',
69
+    'bouton_telecharger' => 'İndir',
70
+    'bouton_upload' => 'İndir', # MODIF
71
+    'bouton_valider' => 'Onayla',
72 72
 
73
-	// C
74
-	'cal_apresmidi' => 'öğleden sonra',
75
-	'cal_jour_entier' => 'tam gün',
76
-	'cal_matin' => 'sabah',
77
-	'cal_par_jour' => 'günlük takvim',
78
-	'cal_par_mois' => 'aylık takvim',
79
-	'cal_par_semaine' => 'haftalık takvim',
80
-	'choix_couleur_interface' => 'renk',
81
-	'choix_interface' => 'arayüz seçimi',
82
-	'colonne' => 'Sütun',
83
-	'confirm_changer_statut' => 'Dikkat, bu elemanın durumunu değiştirmek istediniz. Devam etmek istiyor musunuz ?',
84
-	'correcte' => 'doğru',
73
+    // C
74
+    'cal_apresmidi' => 'öğleden sonra',
75
+    'cal_jour_entier' => 'tam gün',
76
+    'cal_matin' => 'sabah',
77
+    'cal_par_jour' => 'günlük takvim',
78
+    'cal_par_mois' => 'aylık takvim',
79
+    'cal_par_semaine' => 'haftalık takvim',
80
+    'choix_couleur_interface' => 'renk',
81
+    'choix_interface' => 'arayüz seçimi',
82
+    'colonne' => 'Sütun',
83
+    'confirm_changer_statut' => 'Dikkat, bu elemanın durumunu değiştirmek istediniz. Devam etmek istiyor musunuz ?',
84
+    'correcte' => 'doğru',
85 85
 
86
-	// D
87
-	'date_aujourdhui' => 'bugün',
88
-	'date_avant_jc' => 'İ.Ö.',
89
-	'date_dans' => ' @delai@ içinde',
90
-	'date_de_mois_1' => '@j@ @nommois@',
91
-	'date_de_mois_10' => '@j@ @nommois@',
92
-	'date_de_mois_11' => '@j@ @nommois@',
93
-	'date_de_mois_12' => '@j@ @nommois@',
94
-	'date_de_mois_2' => '@j@ @nommois@',
95
-	'date_de_mois_3' => '@j@ @nommois@',
96
-	'date_de_mois_4' => '@j@ @nommois@',
97
-	'date_de_mois_5' => '@j@ @nommois@',
98
-	'date_de_mois_6' => '@j@ @nommois@',
99
-	'date_de_mois_7' => '@j@ @nommois@',
100
-	'date_de_mois_8' => '@j@ @nommois@',
101
-	'date_de_mois_9' => '@j@ @nommois@',
102
-	'date_demain' => 'yarın',
103
-	'date_fmt_heures_minutes' => '@h@h@m@min',
104
-	'date_fmt_jour_heure' => '@jour@ @heure@',
105
-	'date_fmt_jour_mois' => '@jour@ @nommois@',
106
-	'date_fmt_jour_mois_annee' => '@jour@ @nommois@ @annee@',
107
-	'date_fmt_mois_annee' => '@nommois@ @annee@',
108
-	'date_fmt_nomjour_date' => '@date@ @nomjour@',
109
-	'date_heures' => 'saat ',
110
-	'date_hier' => 'dün',
111
-	'date_il_y_a' => '@delai@ önce',
112
-	'date_jnum1' => '1.',
113
-	'date_jnum10' => '10',
114
-	'date_jnum11' => '11',
115
-	'date_jnum12' => '12',
116
-	'date_jnum13' => '13',
117
-	'date_jnum14' => '14',
118
-	'date_jnum15' => '15',
119
-	'date_jnum16' => '16',
120
-	'date_jnum17' => '17',
121
-	'date_jnum18' => '18',
122
-	'date_jnum19' => '19',
123
-	'date_jnum2' => '2',
124
-	'date_jnum20' => '20',
125
-	'date_jnum21' => '21',
126
-	'date_jnum22' => '22',
127
-	'date_jnum23' => '23',
128
-	'date_jnum24' => '24',
129
-	'date_jnum25' => '25',
130
-	'date_jnum26' => '26',
131
-	'date_jnum27' => '27',
132
-	'date_jnum28' => '28',
133
-	'date_jnum29' => '29',
134
-	'date_jnum3' => '3',
135
-	'date_jnum30' => '30',
136
-	'date_jnum31' => '31',
137
-	'date_jnum4' => '4',
138
-	'date_jnum5' => '5',
139
-	'date_jnum6' => '6',
140
-	'date_jnum7' => '7',
141
-	'date_jnum8' => '8',
142
-	'date_jnum9' => '9',
143
-	'date_jour_1' => 'Pazar',
144
-	'date_jour_1_abbr' => 'Pzr.',
145
-	'date_jour_1_initiale' => 'g.',
146
-	'date_jour_2' => 'Pazartesi',
147
-	'date_jour_2_abbr' => 'Ptesi.',
148
-	'date_jour_2_initiale' => 'P.',
149
-	'date_jour_3' => 'Salı',
150
-	'date_jour_3_abbr' => 'Salı',
151
-	'date_jour_3_initiale' => 'S.',
152
-	'date_jour_4' => 'Çarşamba',
153
-	'date_jour_4_abbr' => 'Çarş.',
154
-	'date_jour_4_initiale' => 'Ç.',
155
-	'date_jour_5' => 'Perşembe',
156
-	'date_jour_5_abbr' => 'Perş.',
157
-	'date_jour_5_initiale' => 'P.',
158
-	'date_jour_6' => 'Cuma',
159
-	'date_jour_6_abbr' => 'Cuma',
160
-	'date_jour_6_initiale' => 'C.',
161
-	'date_jour_7' => 'Cumartesi',
162
-	'date_jour_7_abbr' => 'Ctesi',
163
-	'date_jour_7_initiale' => 'Ct.',
164
-	'date_jours' => 'gün',
165
-	'date_minutes' => 'dakika',
166
-	'date_mois' => 'ay',
167
-	'date_mois_1' => 'Ocak',
168
-	'date_mois_10' => 'Ekim',
169
-	'date_mois_11' => 'Kasım',
170
-	'date_mois_12' => 'Aralık',
171
-	'date_mois_2' => 'Şubat',
172
-	'date_mois_3' => 'Mart',
173
-	'date_mois_4' => 'Nisan',
174
-	'date_mois_5' => 'Mayıs',
175
-	'date_mois_6' => 'Haziran',
176
-	'date_mois_7' => 'Temmuz',
177
-	'date_mois_8' => 'Ağustos',
178
-	'date_mois_9' => 'Eylül',
179
-	'date_saison_1' => 'kış',
180
-	'date_saison_2' => 'ilkbahar',
181
-	'date_saison_3' => 'yaz',
182
-	'date_saison_4' => 'sonbahar',
183
-	'date_semaines' => 'hafta',
184
-	'dirs_commencer' => ' yüklemeye gerçekten başlamak için',
185
-	'dirs_preliminaire' => 'Ön bilgi : <b>Erişim haklarını ayarlayınız</b>',
186
-	'dirs_probleme_droits' => 'Erişim hakları sorunu ',
187
-	'dirs_repertoires_absents' => '<p><b>Şu dizinler bulunamadı : </b></p><ul>@bad_dirs@</ul> </b>
86
+    // D
87
+    'date_aujourdhui' => 'bugün',
88
+    'date_avant_jc' => 'İ.Ö.',
89
+    'date_dans' => ' @delai@ içinde',
90
+    'date_de_mois_1' => '@j@ @nommois@',
91
+    'date_de_mois_10' => '@j@ @nommois@',
92
+    'date_de_mois_11' => '@j@ @nommois@',
93
+    'date_de_mois_12' => '@j@ @nommois@',
94
+    'date_de_mois_2' => '@j@ @nommois@',
95
+    'date_de_mois_3' => '@j@ @nommois@',
96
+    'date_de_mois_4' => '@j@ @nommois@',
97
+    'date_de_mois_5' => '@j@ @nommois@',
98
+    'date_de_mois_6' => '@j@ @nommois@',
99
+    'date_de_mois_7' => '@j@ @nommois@',
100
+    'date_de_mois_8' => '@j@ @nommois@',
101
+    'date_de_mois_9' => '@j@ @nommois@',
102
+    'date_demain' => 'yarın',
103
+    'date_fmt_heures_minutes' => '@h@h@m@min',
104
+    'date_fmt_jour_heure' => '@jour@ @heure@',
105
+    'date_fmt_jour_mois' => '@jour@ @nommois@',
106
+    'date_fmt_jour_mois_annee' => '@jour@ @nommois@ @annee@',
107
+    'date_fmt_mois_annee' => '@nommois@ @annee@',
108
+    'date_fmt_nomjour_date' => '@date@ @nomjour@',
109
+    'date_heures' => 'saat ',
110
+    'date_hier' => 'dün',
111
+    'date_il_y_a' => '@delai@ önce',
112
+    'date_jnum1' => '1.',
113
+    'date_jnum10' => '10',
114
+    'date_jnum11' => '11',
115
+    'date_jnum12' => '12',
116
+    'date_jnum13' => '13',
117
+    'date_jnum14' => '14',
118
+    'date_jnum15' => '15',
119
+    'date_jnum16' => '16',
120
+    'date_jnum17' => '17',
121
+    'date_jnum18' => '18',
122
+    'date_jnum19' => '19',
123
+    'date_jnum2' => '2',
124
+    'date_jnum20' => '20',
125
+    'date_jnum21' => '21',
126
+    'date_jnum22' => '22',
127
+    'date_jnum23' => '23',
128
+    'date_jnum24' => '24',
129
+    'date_jnum25' => '25',
130
+    'date_jnum26' => '26',
131
+    'date_jnum27' => '27',
132
+    'date_jnum28' => '28',
133
+    'date_jnum29' => '29',
134
+    'date_jnum3' => '3',
135
+    'date_jnum30' => '30',
136
+    'date_jnum31' => '31',
137
+    'date_jnum4' => '4',
138
+    'date_jnum5' => '5',
139
+    'date_jnum6' => '6',
140
+    'date_jnum7' => '7',
141
+    'date_jnum8' => '8',
142
+    'date_jnum9' => '9',
143
+    'date_jour_1' => 'Pazar',
144
+    'date_jour_1_abbr' => 'Pzr.',
145
+    'date_jour_1_initiale' => 'g.',
146
+    'date_jour_2' => 'Pazartesi',
147
+    'date_jour_2_abbr' => 'Ptesi.',
148
+    'date_jour_2_initiale' => 'P.',
149
+    'date_jour_3' => 'Salı',
150
+    'date_jour_3_abbr' => 'Salı',
151
+    'date_jour_3_initiale' => 'S.',
152
+    'date_jour_4' => 'Çarşamba',
153
+    'date_jour_4_abbr' => 'Çarş.',
154
+    'date_jour_4_initiale' => 'Ç.',
155
+    'date_jour_5' => 'Perşembe',
156
+    'date_jour_5_abbr' => 'Perş.',
157
+    'date_jour_5_initiale' => 'P.',
158
+    'date_jour_6' => 'Cuma',
159
+    'date_jour_6_abbr' => 'Cuma',
160
+    'date_jour_6_initiale' => 'C.',
161
+    'date_jour_7' => 'Cumartesi',
162
+    'date_jour_7_abbr' => 'Ctesi',
163
+    'date_jour_7_initiale' => 'Ct.',
164
+    'date_jours' => 'gün',
165
+    'date_minutes' => 'dakika',
166
+    'date_mois' => 'ay',
167
+    'date_mois_1' => 'Ocak',
168
+    'date_mois_10' => 'Ekim',
169
+    'date_mois_11' => 'Kasım',
170
+    'date_mois_12' => 'Aralık',
171
+    'date_mois_2' => 'Şubat',
172
+    'date_mois_3' => 'Mart',
173
+    'date_mois_4' => 'Nisan',
174
+    'date_mois_5' => 'Mayıs',
175
+    'date_mois_6' => 'Haziran',
176
+    'date_mois_7' => 'Temmuz',
177
+    'date_mois_8' => 'Ağustos',
178
+    'date_mois_9' => 'Eylül',
179
+    'date_saison_1' => 'kış',
180
+    'date_saison_2' => 'ilkbahar',
181
+    'date_saison_3' => 'yaz',
182
+    'date_saison_4' => 'sonbahar',
183
+    'date_semaines' => 'hafta',
184
+    'dirs_commencer' => ' yüklemeye gerçekten başlamak için',
185
+    'dirs_preliminaire' => 'Ön bilgi : <b>Erişim haklarını ayarlayınız</b>',
186
+    'dirs_probleme_droits' => 'Erişim hakları sorunu ',
187
+    'dirs_repertoires_absents' => '<p><b>Şu dizinler bulunamadı : </b></p><ul>@bad_dirs@</ul> </b>
188 188
   <p>Büyük küçük harf hatasına bağlı olabilir.
189 189
   Dizinlerin küçük büyük harflerle yazılışlarının yukarıda gösterilenlerle uyuştuğunu kontrol edin;  eğer uyuşmuyorsa FTP programınızla dizin isimlerini düzeltin.</p>
190 190
   <p>Bu işlemi yaptığınızda ',
191
-	'dirs_repertoires_suivants' => '<p><b>Aşağıdaki dizinlere yazma izni yoktur : </b></p><ul>@bad_dirs@.</ul> 
191
+    'dirs_repertoires_suivants' => '<p><b>Aşağıdaki dizinlere yazma izni yoktur : </b></p><ul>@bad_dirs@.</ul> 
192 192
   <p>Bu sorunu çözmek için FTP programınızla her bir dizine erişim haklarını düzenleyin. Bu yordam, kurulum kitapçığında detaylı biçimde açıklanmıştır./p> 
193 193
   <p>Bu işlemi yaptığınızda ',
194
-	'double_occurrence' => 'Çift tekrar ', # MODIF
194
+    'double_occurrence' => 'Çift tekrar ', # MODIF
195 195
 
196
-	// E
197
-	'en_cours' => 'işlenmekte',
198
-	'envoi_via_le_site' => 'Site üzerinden gönder',
199
-	'erreur' => 'Hata',
200
-	'erreur_balise_non_fermee' => 'son etiket kapatılmamış :',
201
-	'erreur_texte' => 'hata(lar)',
202
-	'etape' => 'Aşama',
196
+    // E
197
+    'en_cours' => 'işlenmekte',
198
+    'envoi_via_le_site' => 'Site üzerinden gönder',
199
+    'erreur' => 'Hata',
200
+    'erreur_balise_non_fermee' => 'son etiket kapatılmamış :',
201
+    'erreur_texte' => 'hata(lar)',
202
+    'etape' => 'Aşama',
203 203
 
204
-	// F
205
-	'fichier_introuvable' => '@fichier@ dosyası bulunamadı', # MODIF
206
-	'form_deja_inscrit' => 'Zaten kayıtlısınız.',
207
-	'form_email_non_valide' => 'E-posta adresiniz geçersiz.',
208
-	'form_forum_access_refuse' => 'Artık bu siteye erişim izniniz yok.',
209
-	'form_forum_bonjour' => 'Merhaba @nom@,',
210
-	'form_forum_email_deja_enregistre' => 'Bu e-posta adresi zaten kayıtlı, kullanmakta olduğunuz şifrenizi kullanmaya devam edebilirsiniz.',
211
-	'form_forum_identifiant_mail' => 'Yeni tanımlayıcınız e-posta yoluyla gönderildi.',
212
-	'form_forum_identifiants' => 'Kişisel tanımlayıcılar',
213
-	'form_forum_indiquer_nom_email' => 'Buraya isminizi ve e-posta adresinizi giriniz. Yeni tanımlayıcınız size bir e-posta ile hemen gönderilecektir.',
214
-	'form_forum_login' => 'kullanıcı ismi :',
215
-	'form_forum_message_auto' => '(bu otomatik bir iletidir)',
216
-	'form_forum_pass' => 'şifre :',
217
-	'form_forum_probleme_mail' => 'E-posta sorunu : tanımlayıcı gönderilemiyor.',
218
-	'form_forum_voici1' => '"@nom_site_spip@" (@adresse_site@) site yaşamına katılabilmek için tanımlayıcılarınız :',
219
-	'form_forum_voici2' => '"@nom_site_spip@" (@adresse_login@) sitesinde makale yayınlayabilmeniz için gereken kimlik bilgileriniz :',
220
-	'form_indiquer_email' => 'Lütfen e-posta adresinizi belirtiniz.',
221
-	'form_indiquer_nom' => 'Lütfen isminizi belirtiniz.',
222
-	'form_indiquer_nom_site' => 'Lütfen sitenizin ismini belirtiniz.',
223
-	'form_pet_deja_enregistre' => 'Bu site zaten kayıtlı',
224
-	'form_pet_signature_pasprise' => 'İmzanız dikkate alınmadı.',
225
-	'form_prop_confirmer_envoi' => 'Gönderiyi onayla',
226
-	'form_prop_description' => 'Tanım / Yorum',
227
-	'form_prop_enregistre' => 'Öneriniz kaydedildi, sitenin sorumluları tarafından onaylandıktan sonra çevrimiçi yayınlanacak.',
228
-	'form_prop_envoyer' => 'Bir ileti gönder',
229
-	'form_prop_indiquer_email' => 'Lütfen geçerli bir e-posta adresi belirtiniz',
230
-	'form_prop_indiquer_nom_site' => 'Sitenin ismini giriniz.',
231
-	'form_prop_indiquer_sujet' => 'Bir konu belirtiniz',
232
-	'form_prop_message_envoye' => 'İleti gönderildi',
233
-	'form_prop_non_enregistre' => 'Öneriniz kaydedilmedi.',
234
-	'form_prop_sujet' => 'Konu',
235
-	'form_prop_url_site' => 'Sitenin Url adresi', # MODIF
236
-	'forum_non_inscrit' => 'Kayıtlı değilsiniz veya adresiniz veya şifreniz hatalı.',
237
-	'forum_par_auteur' => 'yazan @auteur@ ',
238
-	'forum_titre_erreur' => 'Hata...',
204
+    // F
205
+    'fichier_introuvable' => '@fichier@ dosyası bulunamadı', # MODIF
206
+    'form_deja_inscrit' => 'Zaten kayıtlısınız.',
207
+    'form_email_non_valide' => 'E-posta adresiniz geçersiz.',
208
+    'form_forum_access_refuse' => 'Artık bu siteye erişim izniniz yok.',
209
+    'form_forum_bonjour' => 'Merhaba @nom@,',
210
+    'form_forum_email_deja_enregistre' => 'Bu e-posta adresi zaten kayıtlı, kullanmakta olduğunuz şifrenizi kullanmaya devam edebilirsiniz.',
211
+    'form_forum_identifiant_mail' => 'Yeni tanımlayıcınız e-posta yoluyla gönderildi.',
212
+    'form_forum_identifiants' => 'Kişisel tanımlayıcılar',
213
+    'form_forum_indiquer_nom_email' => 'Buraya isminizi ve e-posta adresinizi giriniz. Yeni tanımlayıcınız size bir e-posta ile hemen gönderilecektir.',
214
+    'form_forum_login' => 'kullanıcı ismi :',
215
+    'form_forum_message_auto' => '(bu otomatik bir iletidir)',
216
+    'form_forum_pass' => 'şifre :',
217
+    'form_forum_probleme_mail' => 'E-posta sorunu : tanımlayıcı gönderilemiyor.',
218
+    'form_forum_voici1' => '"@nom_site_spip@" (@adresse_site@) site yaşamına katılabilmek için tanımlayıcılarınız :',
219
+    'form_forum_voici2' => '"@nom_site_spip@" (@adresse_login@) sitesinde makale yayınlayabilmeniz için gereken kimlik bilgileriniz :',
220
+    'form_indiquer_email' => 'Lütfen e-posta adresinizi belirtiniz.',
221
+    'form_indiquer_nom' => 'Lütfen isminizi belirtiniz.',
222
+    'form_indiquer_nom_site' => 'Lütfen sitenizin ismini belirtiniz.',
223
+    'form_pet_deja_enregistre' => 'Bu site zaten kayıtlı',
224
+    'form_pet_signature_pasprise' => 'İmzanız dikkate alınmadı.',
225
+    'form_prop_confirmer_envoi' => 'Gönderiyi onayla',
226
+    'form_prop_description' => 'Tanım / Yorum',
227
+    'form_prop_enregistre' => 'Öneriniz kaydedildi, sitenin sorumluları tarafından onaylandıktan sonra çevrimiçi yayınlanacak.',
228
+    'form_prop_envoyer' => 'Bir ileti gönder',
229
+    'form_prop_indiquer_email' => 'Lütfen geçerli bir e-posta adresi belirtiniz',
230
+    'form_prop_indiquer_nom_site' => 'Sitenin ismini giriniz.',
231
+    'form_prop_indiquer_sujet' => 'Bir konu belirtiniz',
232
+    'form_prop_message_envoye' => 'İleti gönderildi',
233
+    'form_prop_non_enregistre' => 'Öneriniz kaydedilmedi.',
234
+    'form_prop_sujet' => 'Konu',
235
+    'form_prop_url_site' => 'Sitenin Url adresi', # MODIF
236
+    'forum_non_inscrit' => 'Kayıtlı değilsiniz veya adresiniz veya şifreniz hatalı.',
237
+    'forum_par_auteur' => 'yazan @auteur@ ',
238
+    'forum_titre_erreur' => 'Hata...',
239 239
 
240
-	// I
241
-	'ical_texte_rss_articles' => 'Makalelerin «backend» dosyası şu adrestedir:',
242
-	'ical_texte_rss_articles2' => 'Sitenin her bir bölümünün makaleleri için «backend» dosyaları edinebilirsiniz :',
243
-	'ical_texte_rss_breves' => 'Ayrıca site haberlerini içeren bir dosya mevcuttur. Bir bölüm numarası belirterek, sadece bu bölümün haberlerini elde edebilirsiniz.',
244
-	'icone_a_suivre' => 'İzlenecek',
245
-	'icone_admin_site' => 'Site yönetimi',
246
-	'icone_agenda' => 'Ajanda',
247
-	'icone_aide_ligne' => 'Yardım',
248
-	'icone_articles' => 'Makaleler',
249
-	'icone_auteurs' => 'Yazarlar',
250
-	'icone_brouteur' => 'Hızlı gezinti',
251
-	'icone_configuration_site' => 'Yapılandırma',
252
-	'icone_configurer_site' => 'Sitenizi yapılandırın',
253
-	'icone_creer_nouvel_auteur' => 'Yeni bir yazar oluştur',
254
-	'icone_creer_rubrique' => 'Bölüm oluştur',
255
-	'icone_creer_sous_rubrique' => 'Alt-bölüm oluştur',
256
-	'icone_deconnecter' => 'Çıkış',
257
-	'icone_discussions' => 'Tartışmalar',
258
-	'icone_doc_rubrique' => 'Bölüm belgeleri',
259
-	'icone_ecrire_article' => 'Yeni bir makale yaz',
260
-	'icone_edition_site' => 'Yayın',
261
-	'icone_gestion_langues' => 'Dillerin yönetimi',
262
-	'icone_informations_personnelles' => 'Kişisel bilgiler',
263
-	'icone_interface_complet' => 'Tüm arayüz',
264
-	'icone_interface_simple' => 'Basit arayüz',
265
-	'icone_maintenance_site' => 'Site bakımı',
266
-	'icone_messagerie_personnelle' => 'Kişisel iletiler',
267
-	'icone_repartition_debut' => 'Dağılımı en başından itibaren göster',
268
-	'icone_rubriques' => 'Bölümler',
269
-	'icone_sauver_site' => 'Siteyi yedekle',
270
-	'icone_site_entier' => 'Tüm site',
271
-	'icone_sites_references' => 'Önerilen siteler',
272
-	'icone_statistiques' => 'Site istatistikleri',
273
-	'icone_suivi_activite' => 'Site yaşamını izle',
274
-	'icone_suivi_actualite' => 'Site gelişimi',
275
-	'icone_suivi_pettions' => 'Dilekçeleri izle / Yönet',
276
-	'icone_suivi_revisions' => 'Makale değişiklikleri',
277
-	'icone_supprimer_document' => 'Bu belgeyi sil',
278
-	'icone_supprimer_image' => 'Bu resmi sil',
279
-	'icone_tous_articles' => 'Tüm makaleleriniz',
280
-	'icone_tous_auteur' => 'Tüm yazarlar',
281
-	'icone_visiter_site' => 'Ziyaret et', # MODIF
282
-	'icone_voir_en_ligne' => 'Çevrimiçi göster',
283
-	'img_indisponible' => 'resim mevcut değil',
284
-	'impossible' => 'olanaksız',
285
-	'info_a_suivre' => 'İZLENECEK »',
286
-	'info_acces_interdit' => 'Erişim yasak',
287
-	'info_acces_refuse' => 'Erişim reddedildi',
288
-	'info_action' => 'Eylem : @action@',
289
-	'info_administrer_rubriques' => 'Bu bölümü ve alt-bölümleri yönetebilirsiniz',
290
-	'info_adresse_non_indiquee' => 'Denenecek bir adres belirtmediniz !',
291
-	'info_aide' => 'YARDIM :',
292
-	'info_ajouter_mot' => 'Bu sözcüğü ekle',
293
-	'info_annonce' => 'DUYURU',
294
-	'info_annonces_generales' => 'Genel duyurular :',
295
-	'info_article_propose' => 'Önerilen makale',
296
-	'info_article_publie' => 'Yayınlanan makale',
297
-	'info_article_redaction' => 'Yazılmakta olan makale',
298
-	'info_article_refuse' => 'Reddedilen makale',
299
-	'info_article_supprime' => 'Silinen makale',
300
-	'info_articles' => 'Makaleler',
301
-	'info_articles_a_valider' => 'Onaylanacak makaleler',
302
-	'info_articles_proposes' => 'Önerilen makaleler',
303
-	'info_auteurs_nombre' => 'yazar(lar) :',
304
-	'info_authentification_ftp' => 'Onay (FTP ile)',
305
-	'info_breves_2' => 'kısa haberler',
306
-	'info_connexion_refusee' => 'Bağlantı reddedildi',
307
-	'info_contact_developpeur' => 'Lütfen bir program geliştirici ile temasa geçiniz.',
308
-	'info_contenance' => 'Site içeriği :',
309
-	'info_contribution' => 'Forum katkıları', # MODIF
310
-	'info_copyright' => '@spip@, @lien_gpl@ GPL lisansı ile dağıtılan serbest bir yazılımdır.',
311
-	'info_copyright_doc' => 'Ayrıntılı bilgi için, bkz.  <a href="@spipnet@">http://www.spip.net/fr</a>.', # MODIF
312
-	'info_copyright_gpl' => 'GPL lisansı altında',
313
-	'info_cours_edition' => 'Yazılmakta olan makaleleriniz', # MODIF
314
-	'info_creer_repertoire' => 'Şu isimde bir dosya veya dizin oluşturunuz :',
315
-	'info_creer_repertoire_2' => '<b>@repertoire@</b> alt-dizini içerisinde, daha sonra :',
316
-	'info_creer_vignette' => 'otomatik ikon oluşturma',
317
-	'info_deplier' => 'Açılıp sergilenmesi',
318
-	'info_descriptif_nombre' => 'tanımlayıcı(lar) :',
319
-	'info_description' => 'Tanımlama :',
320
-	'info_description_2' => 'Tanımlama :',
321
-	'info_dimension' => 'Boyutlar :',
322
-	'info_ecire_message_prive' => 'Özel bir ileti yaz',
323
-	'info_email_invalide' => 'Geçersiz e-posta adresi.',
324
-	'info_en_cours_validation' => 'Yazılmakta olan makaleleriniz',
325
-	'info_en_ligne' => 'Şu anda çevrimiçi :',
326
-	'info_envoyer_message_prive' => 'Bu yazara özel bir ileti gönder',
327
-	'info_erreur_requete' => 'Aramada hata :',
328
-	'info_erreur_squelette2' => 'Hiçbir @fichier@ iskeleti müsait değil...',
329
-	'info_erreur_systeme' => 'Sistem hatası (hata no @errsys@)',
330
-	'info_erreur_systeme2' => 'Sabit disk dolu olabilir veya veritabanı hasar görmüş olabilir.<br />
240
+    // I
241
+    'ical_texte_rss_articles' => 'Makalelerin «backend» dosyası şu adrestedir:',
242
+    'ical_texte_rss_articles2' => 'Sitenin her bir bölümünün makaleleri için «backend» dosyaları edinebilirsiniz :',
243
+    'ical_texte_rss_breves' => 'Ayrıca site haberlerini içeren bir dosya mevcuttur. Bir bölüm numarası belirterek, sadece bu bölümün haberlerini elde edebilirsiniz.',
244
+    'icone_a_suivre' => 'İzlenecek',
245
+    'icone_admin_site' => 'Site yönetimi',
246
+    'icone_agenda' => 'Ajanda',
247
+    'icone_aide_ligne' => 'Yardım',
248
+    'icone_articles' => 'Makaleler',
249
+    'icone_auteurs' => 'Yazarlar',
250
+    'icone_brouteur' => 'Hızlı gezinti',
251
+    'icone_configuration_site' => 'Yapılandırma',
252
+    'icone_configurer_site' => 'Sitenizi yapılandırın',
253
+    'icone_creer_nouvel_auteur' => 'Yeni bir yazar oluştur',
254
+    'icone_creer_rubrique' => 'Bölüm oluştur',
255
+    'icone_creer_sous_rubrique' => 'Alt-bölüm oluştur',
256
+    'icone_deconnecter' => 'Çıkış',
257
+    'icone_discussions' => 'Tartışmalar',
258
+    'icone_doc_rubrique' => 'Bölüm belgeleri',
259
+    'icone_ecrire_article' => 'Yeni bir makale yaz',
260
+    'icone_edition_site' => 'Yayın',
261
+    'icone_gestion_langues' => 'Dillerin yönetimi',
262
+    'icone_informations_personnelles' => 'Kişisel bilgiler',
263
+    'icone_interface_complet' => 'Tüm arayüz',
264
+    'icone_interface_simple' => 'Basit arayüz',
265
+    'icone_maintenance_site' => 'Site bakımı',
266
+    'icone_messagerie_personnelle' => 'Kişisel iletiler',
267
+    'icone_repartition_debut' => 'Dağılımı en başından itibaren göster',
268
+    'icone_rubriques' => 'Bölümler',
269
+    'icone_sauver_site' => 'Siteyi yedekle',
270
+    'icone_site_entier' => 'Tüm site',
271
+    'icone_sites_references' => 'Önerilen siteler',
272
+    'icone_statistiques' => 'Site istatistikleri',
273
+    'icone_suivi_activite' => 'Site yaşamını izle',
274
+    'icone_suivi_actualite' => 'Site gelişimi',
275
+    'icone_suivi_pettions' => 'Dilekçeleri izle / Yönet',
276
+    'icone_suivi_revisions' => 'Makale değişiklikleri',
277
+    'icone_supprimer_document' => 'Bu belgeyi sil',
278
+    'icone_supprimer_image' => 'Bu resmi sil',
279
+    'icone_tous_articles' => 'Tüm makaleleriniz',
280
+    'icone_tous_auteur' => 'Tüm yazarlar',
281
+    'icone_visiter_site' => 'Ziyaret et', # MODIF
282
+    'icone_voir_en_ligne' => 'Çevrimiçi göster',
283
+    'img_indisponible' => 'resim mevcut değil',
284
+    'impossible' => 'olanaksız',
285
+    'info_a_suivre' => 'İZLENECEK »',
286
+    'info_acces_interdit' => 'Erişim yasak',
287
+    'info_acces_refuse' => 'Erişim reddedildi',
288
+    'info_action' => 'Eylem : @action@',
289
+    'info_administrer_rubriques' => 'Bu bölümü ve alt-bölümleri yönetebilirsiniz',
290
+    'info_adresse_non_indiquee' => 'Denenecek bir adres belirtmediniz !',
291
+    'info_aide' => 'YARDIM :',
292
+    'info_ajouter_mot' => 'Bu sözcüğü ekle',
293
+    'info_annonce' => 'DUYURU',
294
+    'info_annonces_generales' => 'Genel duyurular :',
295
+    'info_article_propose' => 'Önerilen makale',
296
+    'info_article_publie' => 'Yayınlanan makale',
297
+    'info_article_redaction' => 'Yazılmakta olan makale',
298
+    'info_article_refuse' => 'Reddedilen makale',
299
+    'info_article_supprime' => 'Silinen makale',
300
+    'info_articles' => 'Makaleler',
301
+    'info_articles_a_valider' => 'Onaylanacak makaleler',
302
+    'info_articles_proposes' => 'Önerilen makaleler',
303
+    'info_auteurs_nombre' => 'yazar(lar) :',
304
+    'info_authentification_ftp' => 'Onay (FTP ile)',
305
+    'info_breves_2' => 'kısa haberler',
306
+    'info_connexion_refusee' => 'Bağlantı reddedildi',
307
+    'info_contact_developpeur' => 'Lütfen bir program geliştirici ile temasa geçiniz.',
308
+    'info_contenance' => 'Site içeriği :',
309
+    'info_contribution' => 'Forum katkıları', # MODIF
310
+    'info_copyright' => '@spip@, @lien_gpl@ GPL lisansı ile dağıtılan serbest bir yazılımdır.',
311
+    'info_copyright_doc' => 'Ayrıntılı bilgi için, bkz.  <a href="@spipnet@">http://www.spip.net/fr</a>.', # MODIF
312
+    'info_copyright_gpl' => 'GPL lisansı altında',
313
+    'info_cours_edition' => 'Yazılmakta olan makaleleriniz', # MODIF
314
+    'info_creer_repertoire' => 'Şu isimde bir dosya veya dizin oluşturunuz :',
315
+    'info_creer_repertoire_2' => '<b>@repertoire@</b> alt-dizini içerisinde, daha sonra :',
316
+    'info_creer_vignette' => 'otomatik ikon oluşturma',
317
+    'info_deplier' => 'Açılıp sergilenmesi',
318
+    'info_descriptif_nombre' => 'tanımlayıcı(lar) :',
319
+    'info_description' => 'Tanımlama :',
320
+    'info_description_2' => 'Tanımlama :',
321
+    'info_dimension' => 'Boyutlar :',
322
+    'info_ecire_message_prive' => 'Özel bir ileti yaz',
323
+    'info_email_invalide' => 'Geçersiz e-posta adresi.',
324
+    'info_en_cours_validation' => 'Yazılmakta olan makaleleriniz',
325
+    'info_en_ligne' => 'Şu anda çevrimiçi :',
326
+    'info_envoyer_message_prive' => 'Bu yazara özel bir ileti gönder',
327
+    'info_erreur_requete' => 'Aramada hata :',
328
+    'info_erreur_squelette2' => 'Hiçbir @fichier@ iskeleti müsait değil...',
329
+    'info_erreur_systeme' => 'Sistem hatası (hata no @errsys@)',
330
+    'info_erreur_systeme2' => 'Sabit disk dolu olabilir veya veritabanı hasar görmüş olabilir.<br />
331 331
 <span style="color:red;">Veritabanını <a href=\'@script@\'>onarmayı deneyiniz </a>, veya sitenizi barındıran firmayı arayınız.</span>',
332
-	'info_fini' => 'Bitti !',
333
-	'info_format_image' => 'İkon yaratmak için kullanılabilecek resim formatları : @gd_formats@.',
334
-	'info_format_non_defini' => 'tanımsız format',
335
-	'info_grand_ecran' => 'Büyük ekran',
336
-	'info_image_aide' => 'YARDIM',
337
-	'info_image_process_titre' => 'İkon oluşturma yöntemleri',
338
-	'info_impossible_lire_page' => '<b>Hata !</b> Sayfa vekil (proxy) üzerinden <tt><html>@test_proxy@</html></tt> okunamıyor  <tt>',
339
-	'info_installation_systeme_publication' => 'Yayın sistemi kurulumu...',
340
-	'info_installer_documents' => '@upload@ dizininde bulunan tüm belgeleri otomatik olarak kurabilirsiniz. ',
341
-	'info_installer_ftp' => 'Yönetici olarak (FTP ile) @upload@ dizinine dosya gönderip sonra onları buradan direkt olarak seçebilirsiniz. ',
342
-	'info_installer_images' => 'JPEG, GIF ve PNG formatında resimler yükleyebilirsiniz.',
343
-	'info_installer_images_dossier' => 'Buradan seçim yapabilmek için @upload@ dizinine resim yükleyiniz. ',
344
-	'info_interface_complete' => 'Tam arayüz',
345
-	'info_interface_simple' => 'Basit arayüz',
346
-	'info_joindre_document_article' => 'Bu makaleye ekleyebileceğiniz belgeler ',
347
-	'info_joindre_document_rubrique' => 'Bu bölüme ekleyebileceğiniz belgeler ',
348
-	'info_joindre_documents_article' => 'Makalenize ekleyebileceğiniz belgeler :',
349
-	'info_l_article' => 'makale',
350
-	'info_la_breve' => 'kısa haber',
351
-	'info_la_rubrique' => 'bölüm',
352
-	'info_langue_principale' => 'Sitenin ana dili',
353
-	'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ piksel',
354
-	'info_les_auteurs_1' => 'yazan @les_auteurs@ ',
355
-	'info_logo_format_interdit' => 'Sadece @formats@ formatındaki logolar kullanılabilir.',
356
-	'info_logo_max_poids' => 'Logolar @maxi@ dan daha küçük olmalıdır (bu dosyanın boyutu  @actuel@).',
357
-	'info_mail_fournisseur' => 'isminiz@hizmet_veren_firma.com',
358
-	'info_message_2' => 'İLETİ',
359
-	'info_message_supprime' => 'İLETİ SİLİNDİ',
360
-	'info_mise_en_ligne' => 'Çevrimiçi yayın tarihi :',
361
-	'info_modification_parametres_securite' => 'güvenlik parametreleri değişikliği',
362
-	'info_mois_courant' => 'Ay içinde :',
363
-	'info_mot_cle_ajoute' => 'Şu anahtar sözcük eklendi > ',
364
-	'info_multi_herit' => 'Varsayılan dil :',
365
-	'info_multi_langues_soulignees' => '<u>Altı çizili dillerin</u> arayüzde tüm metinlerin çevirileri bulunmaktadır. Bu dilleri seçerseniz, kamu sitesinin bir çok elemanı (tarihler, formlar) otomatik olarak çevrilecektir. Altı çizili olmayan diller için ise bu elemanlar sitenin başlıca dilinde görüntülenecektir.', # MODIF
366
-	'info_multilinguisme' => 'Çok dillilik',
367
-	'info_nom_non_utilisateurs_connectes' => 'Bağlı kullanıcılar listesinde isminiz görünmüyor.',
368
-	'info_nom_utilisateurs_connectes' => 'Bağlı kullanıcılar listesinde isminiz görünüyor.',
369
-	'info_nombre_en_ligne' => 'Şu anda çevrimiçi :',
370
-	'info_non_resultat' => '"@cherche_mot@" için hiç sonuç yok',
371
-	'info_non_utilisation_messagerie' => 'Bu sitenin iç ileti sistemini kullanmıyorsunuz.',
372
-	'info_nouveau_message' => 'YENİ BİR İLETİNİZ VAR',
373
-	'info_nouveaux_messages' => '@total_messages@ YENİ MESAJINIZ VAR',
374
-	'info_numero_abbreviation' => 'N° ',
375
-	'info_obligatoire' => 'Bu bilgi zorunludur.',
376
-	'info_pense_bete' => 'HATIRLATMA',
377
-	'info_petit_ecran' => 'Küçük ekran',
378
-	'info_petition_close' => 'Dilekçe kapandı',
379
-	'info_pixels' => 'Piksel',
380
-	'info_plusieurs_mots_trouves' => ' "@cherche_mot@" için birçok anahtar sözcük bulundu',
381
-	'info_portfolio_automatique' => 'Otomatik portföy :',
382
-	'info_premier_resultat' => '[Toplam @total@ dan @debut_limit@ ilk sonuç]',
383
-	'info_premier_resultat_sur' => '[@debut_limit@ ilk sonuç / @total@ sonuç]',
384
-	'info_propose_1' => '[@nom_site_spip@] Öneriyor : @titre@',
385
-	'info_propose_2' => 'Önerilen makale
332
+    'info_fini' => 'Bitti !',
333
+    'info_format_image' => 'İkon yaratmak için kullanılabilecek resim formatları : @gd_formats@.',
334
+    'info_format_non_defini' => 'tanımsız format',
335
+    'info_grand_ecran' => 'Büyük ekran',
336
+    'info_image_aide' => 'YARDIM',
337
+    'info_image_process_titre' => 'İkon oluşturma yöntemleri',
338
+    'info_impossible_lire_page' => '<b>Hata !</b> Sayfa vekil (proxy) üzerinden <tt><html>@test_proxy@</html></tt> okunamıyor  <tt>',
339
+    'info_installation_systeme_publication' => 'Yayın sistemi kurulumu...',
340
+    'info_installer_documents' => '@upload@ dizininde bulunan tüm belgeleri otomatik olarak kurabilirsiniz. ',
341
+    'info_installer_ftp' => 'Yönetici olarak (FTP ile) @upload@ dizinine dosya gönderip sonra onları buradan direkt olarak seçebilirsiniz. ',
342
+    'info_installer_images' => 'JPEG, GIF ve PNG formatında resimler yükleyebilirsiniz.',
343
+    'info_installer_images_dossier' => 'Buradan seçim yapabilmek için @upload@ dizinine resim yükleyiniz. ',
344
+    'info_interface_complete' => 'Tam arayüz',
345
+    'info_interface_simple' => 'Basit arayüz',
346
+    'info_joindre_document_article' => 'Bu makaleye ekleyebileceğiniz belgeler ',
347
+    'info_joindre_document_rubrique' => 'Bu bölüme ekleyebileceğiniz belgeler ',
348
+    'info_joindre_documents_article' => 'Makalenize ekleyebileceğiniz belgeler :',
349
+    'info_l_article' => 'makale',
350
+    'info_la_breve' => 'kısa haber',
351
+    'info_la_rubrique' => 'bölüm',
352
+    'info_langue_principale' => 'Sitenin ana dili',
353
+    'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ piksel',
354
+    'info_les_auteurs_1' => 'yazan @les_auteurs@ ',
355
+    'info_logo_format_interdit' => 'Sadece @formats@ formatındaki logolar kullanılabilir.',
356
+    'info_logo_max_poids' => 'Logolar @maxi@ dan daha küçük olmalıdır (bu dosyanın boyutu  @actuel@).',
357
+    'info_mail_fournisseur' => 'isminiz@hizmet_veren_firma.com',
358
+    'info_message_2' => 'İLETİ',
359
+    'info_message_supprime' => 'İLETİ SİLİNDİ',
360
+    'info_mise_en_ligne' => 'Çevrimiçi yayın tarihi :',
361
+    'info_modification_parametres_securite' => 'güvenlik parametreleri değişikliği',
362
+    'info_mois_courant' => 'Ay içinde :',
363
+    'info_mot_cle_ajoute' => 'Şu anahtar sözcük eklendi > ',
364
+    'info_multi_herit' => 'Varsayılan dil :',
365
+    'info_multi_langues_soulignees' => '<u>Altı çizili dillerin</u> arayüzde tüm metinlerin çevirileri bulunmaktadır. Bu dilleri seçerseniz, kamu sitesinin bir çok elemanı (tarihler, formlar) otomatik olarak çevrilecektir. Altı çizili olmayan diller için ise bu elemanlar sitenin başlıca dilinde görüntülenecektir.', # MODIF
366
+    'info_multilinguisme' => 'Çok dillilik',
367
+    'info_nom_non_utilisateurs_connectes' => 'Bağlı kullanıcılar listesinde isminiz görünmüyor.',
368
+    'info_nom_utilisateurs_connectes' => 'Bağlı kullanıcılar listesinde isminiz görünüyor.',
369
+    'info_nombre_en_ligne' => 'Şu anda çevrimiçi :',
370
+    'info_non_resultat' => '"@cherche_mot@" için hiç sonuç yok',
371
+    'info_non_utilisation_messagerie' => 'Bu sitenin iç ileti sistemini kullanmıyorsunuz.',
372
+    'info_nouveau_message' => 'YENİ BİR İLETİNİZ VAR',
373
+    'info_nouveaux_messages' => '@total_messages@ YENİ MESAJINIZ VAR',
374
+    'info_numero_abbreviation' => 'N° ',
375
+    'info_obligatoire' => 'Bu bilgi zorunludur.',
376
+    'info_pense_bete' => 'HATIRLATMA',
377
+    'info_petit_ecran' => 'Küçük ekran',
378
+    'info_petition_close' => 'Dilekçe kapandı',
379
+    'info_pixels' => 'Piksel',
380
+    'info_plusieurs_mots_trouves' => ' "@cherche_mot@" için birçok anahtar sözcük bulundu',
381
+    'info_portfolio_automatique' => 'Otomatik portföy :',
382
+    'info_premier_resultat' => '[Toplam @total@ dan @debut_limit@ ilk sonuç]',
383
+    'info_premier_resultat_sur' => '[@debut_limit@ ilk sonuç / @total@ sonuç]',
384
+    'info_propose_1' => '[@nom_site_spip@] Öneriyor : @titre@',
385
+    'info_propose_2' => 'Önerilen makale
386 386
 ---------------',
387
-	'info_propose_3' => '"@titre@" makalesi yayınlanmak üzere önerildi.',
388
-	'info_propose_4' => 'Lütfen inceleyiniz ve görüşünüzü belirtiniz',
389
-	'info_propose_5' => 'bağlı olan forumda. Forumun adresi:',
390
-	'info_publie_01' => '"@titre@" makalesi @connect_nom@ tarafından onaylandı.',
391
-	'info_publie_1' => '[@nom_site_spip@] YAYINLANDI : @titre@',
392
-	'info_publie_2' => 'Yayınlanan makale
387
+    'info_propose_3' => '"@titre@" makalesi yayınlanmak üzere önerildi.',
388
+    'info_propose_4' => 'Lütfen inceleyiniz ve görüşünüzü belirtiniz',
389
+    'info_propose_5' => 'bağlı olan forumda. Forumun adresi:',
390
+    'info_publie_01' => '"@titre@" makalesi @connect_nom@ tarafından onaylandı.',
391
+    'info_publie_1' => '[@nom_site_spip@] YAYINLANDI : @titre@',
392
+    'info_publie_2' => 'Yayınlanan makale
393 393
 -----------------',
394
-	'info_rechercher' => 'Ara',
395
-	'info_rechercher_02' => 'Ara :',
396
-	'info_remplacer_vignette' => 'Varsayılan etiketi kişiselleştirilmiş bir logo ile değiştir :',
397
-	'info_sans_titre_2' => 'başlıksız',
398
-	'info_selectionner_fichier' => '@upload@ dizininden bir dosya seçebilirsiniz. ',
399
-	'info_selectionner_fichier_2' => 'Bir dosya seç :',
400
-	'info_supprimer_vignette' => 'Bu etiketi sil',
401
-	'info_symbole_bleu' => '<b>Mavi</b> sembol bir <b>hatırlatmayı</b> gösterir : yani, kişisel kullanımınız için bir iletidir.',
402
-	'info_symbole_jaune' => '<b>Sarı</b> sembol <b>tüm editörlere yönelik</b> bir duyuruyu gösterir : tüm yöneticiler tarafından değiştirilebilir ve tüm editörler tarafından görülebilir. ',
403
-	'info_symbole_vert' => 'Sarı sembol sitenin başka kullanıcılarıyla yapılan ileti alışverişlerini gösterir.',
404
-	'info_telecharger_nouveau_logo' => 'Yeni bir logo yükle :',
405
-	'info_telecharger_ordinateur' => 'Bilgisayarınızdan indiriniz :',
406
-	'info_tous_resultats_enregistres' => '[tüm sonuçlar kaydedildi]',
407
-	'info_tout_afficher' => 'Tümünü görüntüle',
408
-	'info_travaux_texte' => 'Bu site henüz konfigüre edilmedi. Lütfen daha sonra uğrayınız.',
409
-	'info_travaux_titre' => 'Site yapım aşamasında.',
410
-	'info_trop_resultat' => ' "@cherche_mot@" için çok fazla sonuç çıktı; lütfen aramayı netleştirin.',
411
-	'info_utilisation_messagerie_interne' => 'Bu sitenin iç ileti sistemini kullanıyorsunuz.',
412
-	'info_valider_lien' => 'Bu bağlantıyı onayla',
413
-	'info_verifier_image' => 'Resimlerinizin doğru iletildiğinden emin olunuz.',
414
-	'info_vignette_defaut' => 'Varsayılan ikon',
415
-	'info_vignette_personnalisee' => 'Kişiselleştirilmiş etiket',
416
-	'info_visite' => 'Ziyaret :',
417
-	'info_vos_rendez_vous' => 'İlerideki randevularınız',
418
-	'infos_vos_pense_bete' => 'Hatırlatmalarınız', # MODIF
394
+    'info_rechercher' => 'Ara',
395
+    'info_rechercher_02' => 'Ara :',
396
+    'info_remplacer_vignette' => 'Varsayılan etiketi kişiselleştirilmiş bir logo ile değiştir :',
397
+    'info_sans_titre_2' => 'başlıksız',
398
+    'info_selectionner_fichier' => '@upload@ dizininden bir dosya seçebilirsiniz. ',
399
+    'info_selectionner_fichier_2' => 'Bir dosya seç :',
400
+    'info_supprimer_vignette' => 'Bu etiketi sil',
401
+    'info_symbole_bleu' => '<b>Mavi</b> sembol bir <b>hatırlatmayı</b> gösterir : yani, kişisel kullanımınız için bir iletidir.',
402
+    'info_symbole_jaune' => '<b>Sarı</b> sembol <b>tüm editörlere yönelik</b> bir duyuruyu gösterir : tüm yöneticiler tarafından değiştirilebilir ve tüm editörler tarafından görülebilir. ',
403
+    'info_symbole_vert' => 'Sarı sembol sitenin başka kullanıcılarıyla yapılan ileti alışverişlerini gösterir.',
404
+    'info_telecharger_nouveau_logo' => 'Yeni bir logo yükle :',
405
+    'info_telecharger_ordinateur' => 'Bilgisayarınızdan indiriniz :',
406
+    'info_tous_resultats_enregistres' => '[tüm sonuçlar kaydedildi]',
407
+    'info_tout_afficher' => 'Tümünü görüntüle',
408
+    'info_travaux_texte' => 'Bu site henüz konfigüre edilmedi. Lütfen daha sonra uğrayınız.',
409
+    'info_travaux_titre' => 'Site yapım aşamasında.',
410
+    'info_trop_resultat' => ' "@cherche_mot@" için çok fazla sonuç çıktı; lütfen aramayı netleştirin.',
411
+    'info_utilisation_messagerie_interne' => 'Bu sitenin iç ileti sistemini kullanıyorsunuz.',
412
+    'info_valider_lien' => 'Bu bağlantıyı onayla',
413
+    'info_verifier_image' => 'Resimlerinizin doğru iletildiğinden emin olunuz.',
414
+    'info_vignette_defaut' => 'Varsayılan ikon',
415
+    'info_vignette_personnalisee' => 'Kişiselleştirilmiş etiket',
416
+    'info_visite' => 'Ziyaret :',
417
+    'info_vos_rendez_vous' => 'İlerideki randevularınız',
418
+    'infos_vos_pense_bete' => 'Hatırlatmalarınız', # MODIF
419 419
 
420
-	// L
421
-	'lien_afficher_icones_seuls' => 'Sadece ikonları görüntüle',
422
-	'lien_afficher_texte_icones' => 'ikonları ve metni görüntüle',
423
-	'lien_afficher_texte_seul' => 'Sadece metni görüntüle',
424
-	'lien_liberer' => 'Serbest bırak',
425
-	'lien_liberer_tous' => 'Bu makaleleri serbest bırak', # MODIF
426
-	'lien_nouvea_pense_bete' => 'YENİ HATIRLATMA',
427
-	'lien_nouveau_message' => 'YENİ İLETİ',
428
-	'lien_nouvelle_annonce' => 'YENİ DUYURU',
429
-	'lien_petitions' => 'DİLEKÇE ',
430
-	'lien_popularite' => 'Popülerlik : @popularite@%',
431
-	'lien_racine_site' => 'SİTENİN KÖK DİZİNİ',
432
-	'lien_reessayer' => 'Tekrar dene',
433
-	'lien_repondre_message' => 'Bu iletiye yanıt ver',
434
-	'lien_supprimer' => 'Sil',
435
-	'lien_tout_afficher' => 'Tümünü görüntüle',
436
-	'lien_visite_site' => 'Bu siteyi ziyaret et',
437
-	'lien_visites' => '@visites@ ziyaret',
438
-	'lien_voir_auteur' => 'Bu yazarı görüntüle',
439
-	'ligne' => 'Satır',
440
-	'login' => 'Bağlantı',
441
-	'login_acces_prive' => 'Özel alana erişim',
442
-	'login_autre_identifiant' => 'Başka bir kullanıcı ismi ile bağlan',
443
-	'login_cookie_accepte' => 'Lütfen gezgininizi (en azından bu site için) bunları kabul edecek biçimde ayarlayınız.',
444
-	'login_cookie_oblige' => 'Kendinizi güvenli bir şekilde tanımlamak için çerezleri kabul etmelisiniz.',
445
-	'login_deconnexion_ok' => 'Bağlantıya son verildi.',
446
-	'login_erreur_pass' => 'Şifre hatası.',
447
-	'login_espace_prive' => 'Özel alan',
448
-	'login_identifiant_inconnu' => '"@login@" kullanıcı ismi tanınmıyor.',
449
-	'login_login' => 'Kullanıcı ismi :',
450
-	'login_login2' => 'Kullanıcı ismi :', # MODIF
451
-	'login_login_pass_incorrect' => '(Kullanıcı ismi veya şifre hatalı.)',
452
-	'login_motpasseoublie' => 'Şifreyi unuttum',
453
-	'login_non_securise' => 'Dikkat, bu form güvenli değil.
420
+    // L
421
+    'lien_afficher_icones_seuls' => 'Sadece ikonları görüntüle',
422
+    'lien_afficher_texte_icones' => 'ikonları ve metni görüntüle',
423
+    'lien_afficher_texte_seul' => 'Sadece metni görüntüle',
424
+    'lien_liberer' => 'Serbest bırak',
425
+    'lien_liberer_tous' => 'Bu makaleleri serbest bırak', # MODIF
426
+    'lien_nouvea_pense_bete' => 'YENİ HATIRLATMA',
427
+    'lien_nouveau_message' => 'YENİ İLETİ',
428
+    'lien_nouvelle_annonce' => 'YENİ DUYURU',
429
+    'lien_petitions' => 'DİLEKÇE ',
430
+    'lien_popularite' => 'Popülerlik : @popularite@%',
431
+    'lien_racine_site' => 'SİTENİN KÖK DİZİNİ',
432
+    'lien_reessayer' => 'Tekrar dene',
433
+    'lien_repondre_message' => 'Bu iletiye yanıt ver',
434
+    'lien_supprimer' => 'Sil',
435
+    'lien_tout_afficher' => 'Tümünü görüntüle',
436
+    'lien_visite_site' => 'Bu siteyi ziyaret et',
437
+    'lien_visites' => '@visites@ ziyaret',
438
+    'lien_voir_auteur' => 'Bu yazarı görüntüle',
439
+    'ligne' => 'Satır',
440
+    'login' => 'Bağlantı',
441
+    'login_acces_prive' => 'Özel alana erişim',
442
+    'login_autre_identifiant' => 'Başka bir kullanıcı ismi ile bağlan',
443
+    'login_cookie_accepte' => 'Lütfen gezgininizi (en azından bu site için) bunları kabul edecek biçimde ayarlayınız.',
444
+    'login_cookie_oblige' => 'Kendinizi güvenli bir şekilde tanımlamak için çerezleri kabul etmelisiniz.',
445
+    'login_deconnexion_ok' => 'Bağlantıya son verildi.',
446
+    'login_erreur_pass' => 'Şifre hatası.',
447
+    'login_espace_prive' => 'Özel alan',
448
+    'login_identifiant_inconnu' => '"@login@" kullanıcı ismi tanınmıyor.',
449
+    'login_login' => 'Kullanıcı ismi :',
450
+    'login_login2' => 'Kullanıcı ismi :', # MODIF
451
+    'login_login_pass_incorrect' => '(Kullanıcı ismi veya şifre hatalı.)',
452
+    'login_motpasseoublie' => 'Şifreyi unuttum',
453
+    'login_non_securise' => 'Dikkat, bu form güvenli değil.
454 454
           Eğer şifrenizin ağ üzerinde tesbit edilmesini istemiyorsanız,
455 455
           lütfen gezgininizde Javascript’i çalıştırınız ve ',
456
-	'login_nouvelle_tentative' => 'Yeni deneme',
457
-	'login_par_ici' => 'Kayıt oldunuz... buradan devam ediniz...',
458
-	'login_pass2' => 'Şifre :',
459
-	'login_preferez_refuser' => '<b>Eğer çerezleri reddetmeyi tercih ediyorsanız,</b>   başka (daha az güvenli) bir bağlantı yöntemi emrinizde :',
460
-	'login_recharger' => 'sayfayı tekrar yükle',
461
-	'login_rester_identifie' => 'Bir kaç gün tanımlanmış olarak kalayım', # MODIF
462
-	'login_retour_public' => 'Kamusal siteye dön',
463
-	'login_retour_site' => 'Kamusal siteye dön',
464
-	'login_retoursitepublic' => 'Kamusal siteye dön',
465
-	'login_sinscrire' => 'Kayıt ol', # MODIF
466
-	'login_test_navigateur' => 'Gezgini dene / Tekrar bağlan',
467
-	'login_verifiez_navigateur' => '(Ancak gezginin şifrenizi belleğe almadığından emin olunuz...)',
456
+    'login_nouvelle_tentative' => 'Yeni deneme',
457
+    'login_par_ici' => 'Kayıt oldunuz... buradan devam ediniz...',
458
+    'login_pass2' => 'Şifre :',
459
+    'login_preferez_refuser' => '<b>Eğer çerezleri reddetmeyi tercih ediyorsanız,</b>   başka (daha az güvenli) bir bağlantı yöntemi emrinizde :',
460
+    'login_recharger' => 'sayfayı tekrar yükle',
461
+    'login_rester_identifie' => 'Bir kaç gün tanımlanmış olarak kalayım', # MODIF
462
+    'login_retour_public' => 'Kamusal siteye dön',
463
+    'login_retour_site' => 'Kamusal siteye dön',
464
+    'login_retoursitepublic' => 'Kamusal siteye dön',
465
+    'login_sinscrire' => 'Kayıt ol', # MODIF
466
+    'login_test_navigateur' => 'Gezgini dene / Tekrar bağlan',
467
+    'login_verifiez_navigateur' => '(Ancak gezginin şifrenizi belleğe almadığından emin olunuz...)',
468 468
 
469
-	// M
470
-	'masquer_colonne' => 'Bu sütunu sakla',
471
-	'masquer_trad' => 'çevirileri gizle',
472
-	'module_fichiers_langues' => 'Dil dosyaları',
469
+    // M
470
+    'masquer_colonne' => 'Bu sütunu sakla',
471
+    'masquer_trad' => 'çevirileri gizle',
472
+    'module_fichiers_langues' => 'Dil dosyaları',
473 473
 
474
-	// N
475
-	'navigateur_pas_redirige' => 'Gezgininiz yeniden yönlenmiyorsa, devam etmek için buraya tıklayınız.',
476
-	'numero' => 'Numara',
474
+    // N
475
+    'navigateur_pas_redirige' => 'Gezgininiz yeniden yönlenmiyorsa, devam etmek için buraya tıklayınız.',
476
+    'numero' => 'Numara',
477 477
 
478
-	// O
479
-	'occurence' => 'Tekrarlanış',
480
-	'onglet_affacer_base' => 'Veritabanını sil',
481
-	'onglet_auteur' => 'Yazar',
482
-	'onglet_contenu_site' => 'Sitenin içeriği',
483
-	'onglet_evolution_visite_mod' => 'Ziyaretlerin gelişimi',
484
-	'onglet_fonctions_avances' => 'Gelişmiş işlevler',
485
-	'onglet_informations_personnelles' => 'Kişisel bilgi',
486
-	'onglet_interactivite' => 'Etkileşim özelliği',
487
-	'onglet_messagerie' => 'İleti sistemi',
488
-	'onglet_repartition_rubrique' => 'Bölümlere göre dağılım',
489
-	'onglet_save_restaur_base' => 'Veritabanını yedekle / Geri yükle',
490
-	'onglet_vider_cache' => 'Önbelleği boşalt',
478
+    // O
479
+    'occurence' => 'Tekrarlanış',
480
+    'onglet_affacer_base' => 'Veritabanını sil',
481
+    'onglet_auteur' => 'Yazar',
482
+    'onglet_contenu_site' => 'Sitenin içeriği',
483
+    'onglet_evolution_visite_mod' => 'Ziyaretlerin gelişimi',
484
+    'onglet_fonctions_avances' => 'Gelişmiş işlevler',
485
+    'onglet_informations_personnelles' => 'Kişisel bilgi',
486
+    'onglet_interactivite' => 'Etkileşim özelliği',
487
+    'onglet_messagerie' => 'İleti sistemi',
488
+    'onglet_repartition_rubrique' => 'Bölümlere göre dağılım',
489
+    'onglet_save_restaur_base' => 'Veritabanını yedekle / Geri yükle',
490
+    'onglet_vider_cache' => 'Önbelleği boşalt',
491 491
 
492
-	// P
493
-	'pass_choix_pass' => 'Lütfen yeni şifrenizi seçiniz :',
494
-	'pass_erreur' => 'Hata',
495
-	'pass_erreur_acces_refuse' => '<b>Hata : </b> artık bu siteye erişiminiz yoktur.',
496
-	'pass_erreur_code_inconnu' => 'Hata : bu şifre bu siteye erişimi olan hiç bir ziyaretçiye uymuyor.',
497
-	'pass_erreur_non_enregistre' => 'Hata : @email_oubli@ adresi bu siteye kayıtlı değil. ',
498
-	'pass_erreur_non_valide' => 'Hata :  @email_oubli@ e-posta adresi geçerli değil !',
499
-	'pass_erreur_probleme_technique' => 'Hata : teknik bir sorundan ötürü e-posta gönderilemiyor.',
500
-	'pass_espace_prive_bla' => 'Bu sitenin özel alanı,
492
+    // P
493
+    'pass_choix_pass' => 'Lütfen yeni şifrenizi seçiniz :',
494
+    'pass_erreur' => 'Hata',
495
+    'pass_erreur_acces_refuse' => '<b>Hata : </b> artık bu siteye erişiminiz yoktur.',
496
+    'pass_erreur_code_inconnu' => 'Hata : bu şifre bu siteye erişimi olan hiç bir ziyaretçiye uymuyor.',
497
+    'pass_erreur_non_enregistre' => 'Hata : @email_oubli@ adresi bu siteye kayıtlı değil. ',
498
+    'pass_erreur_non_valide' => 'Hata :  @email_oubli@ e-posta adresi geçerli değil !',
499
+    'pass_erreur_probleme_technique' => 'Hata : teknik bir sorundan ötürü e-posta gönderilemiyor.',
500
+    'pass_espace_prive_bla' => 'Bu sitenin özel alanı,
501 501
     kayıtlı ziyaretçilere açıktır. Kayıt olduktan sonra,
502 502
     yazılmakta olan makalelere bakabilir, makale önerebilir 
503 503
   ve tüm forumlara katılabilirsiniz. ',
504
-	'pass_forum_bla' => 'Kayıtlı ziyaretçilere ayrılmış bir foruma
504
+    'pass_forum_bla' => 'Kayıtlı ziyaretçilere ayrılmış bir foruma
505 505
      müdahale etmek istediniz. ',
506
-	'pass_indiquez_cidessous' => 'Daha önce kayıt olduğunuz e-posta adresinizi aşağıya belirtiniz.
506
+    'pass_indiquez_cidessous' => 'Daha önce kayıt olduğunuz e-posta adresinizi aşağıya belirtiniz.
507 507
   Tekrar erişebilmek için gereken işlemi 
508 508
   belirten 
509 509
   bir e-posta alacaksınız. ',
510
-	'pass_mail_passcookie' => '(Bu otomatik bir iletidir)
510
+    'pass_mail_passcookie' => '(Bu otomatik bir iletidir)
511 511
 
512 512
   @nom_site_spip@ (@adresse_site@)
513 513
 
@@ -517,125 +517,125 @@  discard block
 block discarded – undo
517 517
  @sendcookie@
518 518
  O zaman yeni bir şifre girebilecek
519 519
  ve tekrar siteye bağlanabileceksiniz.  ',
520
-	'pass_mot_oublie' => 'Şifreyi unuttum',
521
-	'pass_nouveau_enregistre' => 'Yeni şifreniz kaydedildi.',
522
-	'pass_nouveau_pass' => 'Yeni şifre',
523
-	'pass_ok' => 'OK',
524
-	'pass_oubli_mot' => 'Şifremi unuttum',
525
-	'pass_quitter_fenetre' => 'Bu pencereyi terk et',
526
-	'pass_rappel_login' => 'Hatırlatma : kullanıcı isminiz « @login@ » dır.',
527
-	'pass_recevoir_mail' => 'Siteye erişiminizi yeniden nasıl kazanabileceğinizi belirten bir e-posta alacaksınız. ', # MODIF
528
-	'pass_retour_public' => 'Kamu sitesine dönüş',
529
-	'pass_rien_a_faire_ici' => 'Burada yapılacak bir şey yok.',
530
-	'pass_vousinscrire' => 'Bu siteye kaydolmanız',
531
-	'precedent' => 'önceki',
532
-	'previsualisation' => 'Öngörüntüle',
533
-	'previsualiser' => 'Öngörüntüle',
520
+    'pass_mot_oublie' => 'Şifreyi unuttum',
521
+    'pass_nouveau_enregistre' => 'Yeni şifreniz kaydedildi.',
522
+    'pass_nouveau_pass' => 'Yeni şifre',
523
+    'pass_ok' => 'OK',
524
+    'pass_oubli_mot' => 'Şifremi unuttum',
525
+    'pass_quitter_fenetre' => 'Bu pencereyi terk et',
526
+    'pass_rappel_login' => 'Hatırlatma : kullanıcı isminiz « @login@ » dır.',
527
+    'pass_recevoir_mail' => 'Siteye erişiminizi yeniden nasıl kazanabileceğinizi belirten bir e-posta alacaksınız. ', # MODIF
528
+    'pass_retour_public' => 'Kamu sitesine dönüş',
529
+    'pass_rien_a_faire_ici' => 'Burada yapılacak bir şey yok.',
530
+    'pass_vousinscrire' => 'Bu siteye kaydolmanız',
531
+    'precedent' => 'önceki',
532
+    'previsualisation' => 'Öngörüntüle',
533
+    'previsualiser' => 'Öngörüntüle',
534 534
 
535
-	// R
536
-	'retour' => 'Geri dön',
535
+    // R
536
+    'retour' => 'Geri dön',
537 537
 
538
-	// S
539
-	'spip_conforme_dtd' => 'SPIP bu belgeyi DOCTYPE’e uygun buluyor :',
540
-	'squelette' => 'iskelet',
541
-	'squelette_inclus_ligne' => 'iskelet eklendi, satır',
542
-	'squelette_ligne' => 'iskelet, satır',
543
-	'stats_visites_et_popularite' => '@visites@ ziyaret; popülerlik : @popularite@',
544
-	'suivant' => 'sonraki',
538
+    // S
539
+    'spip_conforme_dtd' => 'SPIP bu belgeyi DOCTYPE’e uygun buluyor :',
540
+    'squelette' => 'iskelet',
541
+    'squelette_inclus_ligne' => 'iskelet eklendi, satır',
542
+    'squelette_ligne' => 'iskelet, satır',
543
+    'stats_visites_et_popularite' => '@visites@ ziyaret; popülerlik : @popularite@',
544
+    'suivant' => 'sonraki',
545 545
 
546
-	// T
547
-	'taille_ko' => '@taille@ kb',
548
-	'taille_mo' => '@taille@ Mb',
549
-	'taille_octets' => '@taille@ bayt',
550
-	'taille_octets_bi' => '@taille@ bayt',
551
-	'texte_actualite_site_1' => 'Arayüze alışınca «',
552
-	'texte_actualite_site_2' => 'Tüm arayüz',
553
-	'texte_actualite_site_3' => '»’e tıklayarak daha fazla seçeneğe ulaşabilirsiniz.',
554
-	'texte_creation_automatique_vignette' => 'Bu sitede öngörüntüleme ikonlarının otomatik olarak yaratılması işlemi etkinleştirişmiştir. Eğer bu formdan hareket ederek @gd_formats@, formatlı resimler yüklerseniz, bunlara, en fazla @taille_preview@ piksel boyutunda bir ikon eşlik edecektir.',
555
-	'texte_documents_associes' => 'Aşağıdaki belgeler makale ile bağlantılı olup,
546
+    // T
547
+    'taille_ko' => '@taille@ kb',
548
+    'taille_mo' => '@taille@ Mb',
549
+    'taille_octets' => '@taille@ bayt',
550
+    'taille_octets_bi' => '@taille@ bayt',
551
+    'texte_actualite_site_1' => 'Arayüze alışınca «',
552
+    'texte_actualite_site_2' => 'Tüm arayüz',
553
+    'texte_actualite_site_3' => '»’e tıklayarak daha fazla seçeneğe ulaşabilirsiniz.',
554
+    'texte_creation_automatique_vignette' => 'Bu sitede öngörüntüleme ikonlarının otomatik olarak yaratılması işlemi etkinleştirişmiştir. Eğer bu formdan hareket ederek @gd_formats@, formatlı resimler yüklerseniz, bunlara, en fazla @taille_preview@ piksel boyutunda bir ikon eşlik edecektir.',
555
+    'texte_documents_associes' => 'Aşağıdaki belgeler makale ile bağlantılı olup,
556 556
     doğrudan makalenin içine dahil edilmemiştir. Kamu sitesinin sayfa düzenine göre,
557 557
     sonradan belge eki olarak görülebilir.',
558
-	'texte_erreur_mise_niveau_base' => 'Güncelleme sırasında veritabanı hatası. @fichier@ resmi ulaşmadı (@id_article@ makalesi). Bu referansı kaydedip güncelemeyi tekrar deneyiniz ve resimlerin makalelerde görüldüğünden emin olunuz. ',
559
-	'texte_erreur_visiteur' => 'Özel alana, girişe izin vermeyen bir kullanıcı ismiyle erişmeyi denediniz.',
560
-	'texte_inc_auth_1' => '<b>@auth_login@</b> kullanıcı ismini girdiniz ancak veritabanında bu kullanıcı ismi yok/artık yok. Lütfen şunu deneyiniz',
561
-	'texte_inc_auth_2' => 'gezgininizi kapatıp tekrar çalıştırınız ve ',
562
-	'texte_inc_auth_3' => 'tekrar bağlanınız.',
563
-	'texte_inc_config' => 'Bu sayfalarda yapılan değişiklikler sitenizin işleyişi üzerinde büyük ölçüde etkilidir. SPIP sisteminin işleyişine aşina olmadığınız sürece müdahale etmemenizi öneririz.  <br /><br /><b>Daha genel bir ifadeyle söylemek gerekirse bu sayfalarla ilgilenme işini sitenin Ağ Yöneticisi’ne bırakmanızı özellikle öneririz.</b>',
564
-	'texte_inc_meta_1' => 'Sistem <code>@fichier@</code> dosyasının yazılması sırasında bir hata ile karşılaştı. Lütfen, site yöneticisi olarak ',
565
-	'texte_inc_meta_2' => '(<code>ecrire/data/</code> dizinindeki) ',
566
-	'texte_inc_meta_3' => '<code>@repertoire@</code> dizinindeki yazma haklarını kontrol ediniz. ',
567
-	'texte_statut_en_cours_redaction' => 'Yazılıyor',
568
-	'texte_statut_poubelle' => 'Çöpe atıldı',
569
-	'texte_statut_propose_evaluation' => 'Değerlendirmeye alındı',
570
-	'texte_statut_publie' => 'Çevrimiçi yayınlandı',
571
-	'texte_statut_refuse' => 'Reddedildi',
572
-	'titre_ajouter_mot_cle' => 'BİR ANAHTAR-SÖZCÜK EKLE :',
573
-	'titre_cadre_raccourcis' => 'KISA YOLLAR :',
574
-	'titre_changer_couleur_interface' => 'Arayüz rengini değiştir',
575
-	'titre_image_admin_article' => 'Bu makaleyi yönetebilirsiniz',
576
-	'titre_image_administrateur' => 'Yönetici',
577
-	'titre_image_aide' => 'Bu eleman hakkında yardım',
578
-	'titre_image_auteur_supprime' => 'Silinmiş yazar',
579
-	'titre_image_redacteur' => 'Erişim hakkı olmayan yazar',
580
-	'titre_image_redacteur_02' => 'Yazar',
581
-	'titre_image_visiteur' => 'Ziyaretçi',
582
-	'titre_joindre_document' => 'BİR BELGE EKLE',
583
-	'titre_mots_cles' => 'ANAHTAR SÖZCÜKLER',
584
-	'titre_probleme_technique' => 'Dikkat : teknik bir sorun (SQL hizmet birimi) sitenin bu bölümüne erişimi engelliyor. Anlayışınız için teşekkürler.',
585
-	'titre_publier_document' => 'BU BÖLÜM ALTINDA BİR BELGE YAYINLA',
586
-	'titre_signatures_attente' => 'Onay bekleyen imzalar',
587
-	'titre_signatures_confirmees' => 'Onaylanmış imzalar',
588
-	'titre_statistiques' => 'Site istatistikleri',
589
-	'titre_titre_document' => 'Belge başlığı :',
590
-	'todo' => 'gelecek',
591
-	'trad_reference' => '(referans makale)', # MODIF
558
+    'texte_erreur_mise_niveau_base' => 'Güncelleme sırasında veritabanı hatası. @fichier@ resmi ulaşmadı (@id_article@ makalesi). Bu referansı kaydedip güncelemeyi tekrar deneyiniz ve resimlerin makalelerde görüldüğünden emin olunuz. ',
559
+    'texte_erreur_visiteur' => 'Özel alana, girişe izin vermeyen bir kullanıcı ismiyle erişmeyi denediniz.',
560
+    'texte_inc_auth_1' => '<b>@auth_login@</b> kullanıcı ismini girdiniz ancak veritabanında bu kullanıcı ismi yok/artık yok. Lütfen şunu deneyiniz',
561
+    'texte_inc_auth_2' => 'gezgininizi kapatıp tekrar çalıştırınız ve ',
562
+    'texte_inc_auth_3' => 'tekrar bağlanınız.',
563
+    'texte_inc_config' => 'Bu sayfalarda yapılan değişiklikler sitenizin işleyişi üzerinde büyük ölçüde etkilidir. SPIP sisteminin işleyişine aşina olmadığınız sürece müdahale etmemenizi öneririz.  <br /><br /><b>Daha genel bir ifadeyle söylemek gerekirse bu sayfalarla ilgilenme işini sitenin Ağ Yöneticisi’ne bırakmanızı özellikle öneririz.</b>',
564
+    'texte_inc_meta_1' => 'Sistem <code>@fichier@</code> dosyasının yazılması sırasında bir hata ile karşılaştı. Lütfen, site yöneticisi olarak ',
565
+    'texte_inc_meta_2' => '(<code>ecrire/data/</code> dizinindeki) ',
566
+    'texte_inc_meta_3' => '<code>@repertoire@</code> dizinindeki yazma haklarını kontrol ediniz. ',
567
+    'texte_statut_en_cours_redaction' => 'Yazılıyor',
568
+    'texte_statut_poubelle' => 'Çöpe atıldı',
569
+    'texte_statut_propose_evaluation' => 'Değerlendirmeye alındı',
570
+    'texte_statut_publie' => 'Çevrimiçi yayınlandı',
571
+    'texte_statut_refuse' => 'Reddedildi',
572
+    'titre_ajouter_mot_cle' => 'BİR ANAHTAR-SÖZCÜK EKLE :',
573
+    'titre_cadre_raccourcis' => 'KISA YOLLAR :',
574
+    'titre_changer_couleur_interface' => 'Arayüz rengini değiştir',
575
+    'titre_image_admin_article' => 'Bu makaleyi yönetebilirsiniz',
576
+    'titre_image_administrateur' => 'Yönetici',
577
+    'titre_image_aide' => 'Bu eleman hakkında yardım',
578
+    'titre_image_auteur_supprime' => 'Silinmiş yazar',
579
+    'titre_image_redacteur' => 'Erişim hakkı olmayan yazar',
580
+    'titre_image_redacteur_02' => 'Yazar',
581
+    'titre_image_visiteur' => 'Ziyaretçi',
582
+    'titre_joindre_document' => 'BİR BELGE EKLE',
583
+    'titre_mots_cles' => 'ANAHTAR SÖZCÜKLER',
584
+    'titre_probleme_technique' => 'Dikkat : teknik bir sorun (SQL hizmet birimi) sitenin bu bölümüne erişimi engelliyor. Anlayışınız için teşekkürler.',
585
+    'titre_publier_document' => 'BU BÖLÜM ALTINDA BİR BELGE YAYINLA',
586
+    'titre_signatures_attente' => 'Onay bekleyen imzalar',
587
+    'titre_signatures_confirmees' => 'Onaylanmış imzalar',
588
+    'titre_statistiques' => 'Site istatistikleri',
589
+    'titre_titre_document' => 'Belge başlığı :',
590
+    'todo' => 'gelecek',
591
+    'trad_reference' => '(referans makale)', # MODIF
592 592
 
593
-	// Z
594
-	'zbug_balise_b_aval' => ' : B etiketinde sorun var',
595
-	'zbug_balise_inexistante' => 'hata @from@: #@balise@ komutu mevcut değil', # MODIF
596
-	'zbug_balise_sans_argument' => '@balise@ komutunda argüman eksik',
597
-	'zbug_boucle' => 'döngü',
598
-	'zbug_boucle_recursive_undef' => 'tanımsız tekrarlı döngü', # MODIF
599
-	'zbug_calcul' => 'hesaplama',
600
-	'zbug_champ_hors_boucle' => '@champ@ alanı döngü dışında',
601
-	'zbug_champ_hors_motif' => '@champ@ alanı @motif@ döngüsü dışında ', # MODIF
602
-	'zbug_code' => 'kod',
603
-	'zbug_critere_inconnu' => 'tanımsız kriter @critere@', # MODIF
604
-	'zbug_distant_interdit' => 'yasaklanmış dış veri dosyası', # MODIF
605
-	'zbug_doublon_table_sans_cle_primaire' => 'endekssiz bir tabloda tekrarlar var', # MODIF
606
-	'zbug_doublon_table_sans_index' => 'endekslenmemiş bir tabloda tekrarlanan bilgiler', # MODIF
607
-	'zbug_erreur_boucle_double' => 'DÖNGÜ@id@: çift tanımlı', # MODIF
608
-	'zbug_erreur_boucle_fermant' => 'DÖNGÜ@id@: kapatma etiketi eksik', # MODIF
609
-	'zbug_erreur_boucle_syntaxe' => 'Döngü tümcesi hatalı', # MODIF
610
-	'zbug_erreur_compilation' => 'derleme hatası',
611
-	'zbug_erreur_execution_page' => 'sayfa işletilirken hata oluştu', # MODIF
612
-	'zbug_erreur_filtre' => 'Hata : <b>« @filtre@ »</b> filtresi tanımsız', # MODIF
613
-	'zbug_erreur_meme_parent' => '{meme_parent} sadece (FORUMS) veya  (RUBRIQUES) için uygulanabilir', # MODIF
614
-	'zbug_erreur_squelette' => 'İskelette hata var',
615
-	'zbug_hors_compilation' => 'Derleme Dışı',
616
-	'zbug_info_erreur_squelette' => 'Sitede hata var',
617
-	'zbug_inversion_ordre_inexistant' => 'olmayan bir sıralama ters çevrilemez', # MODIF
618
-	'zbug_pagination_sans_critere' => 'kritersiz veya kendini çağıran döngüde kullanılan #PAGINATION {pagination} ', # MODIF
619
-	'zbug_parametres_inclus_incorrects' => 'Ekleme parametreleri hatalı', # MODIF
620
-	'zbug_profile' => 'Hesaplama süresi : @time@',
621
-	'zbug_resultat' => 'sonuç',
622
-	'zbug_serveur_indefini' => 'SQL hizmet birimi tanımsız', # MODIF
623
-	'zbug_statistiques' => 'Süreye göre sınıflanmış SQL istekleri istatistikleri',
624
-	'zbug_table_inconnue' => '« @table@ » SQL tablosu tanımsız',
625
-	'zxml_connus_attributs' => 'bilinen öznitelikler',
626
-	'zxml_de' => 'nın / nin',
627
-	'zxml_inconnu_attribut' => 'bilinmeyen öznitelik',
628
-	'zxml_inconnu_balise' => 'bilinmeyen etiket',
629
-	'zxml_inconnu_entite' => 'bilinmeyen madde',
630
-	'zxml_inconnu_id' => 'bilinmeyen ID',
631
-	'zxml_mais_de' => 'ama nın / nin',
632
-	'zxml_non_conforme' => 'amaca uygun değil',
633
-	'zxml_non_fils' => 'bir alt maddesi değil',
634
-	'zxml_nonvide_balise' => 'boş olmayan etiket',
635
-	'zxml_obligatoire_attribut' => 'zorunlu ama belirtilmemiş etiket',
636
-	'zxml_succession_fils_incorrecte' => 'alt maddelerin peşpeşe gelmesi hatalı',
637
-	'zxml_survoler' => 'doğruları görmek için üzerindne geçmek ???',
638
-	'zxml_valeur_attribut' => 'özniteliğin değeri',
639
-	'zxml_vide_balise' => 'boş etiket',
640
-	'zxml_vu' => 'önceden görülen'
593
+    // Z
594
+    'zbug_balise_b_aval' => ' : B etiketinde sorun var',
595
+    'zbug_balise_inexistante' => 'hata @from@: #@balise@ komutu mevcut değil', # MODIF
596
+    'zbug_balise_sans_argument' => '@balise@ komutunda argüman eksik',
597
+    'zbug_boucle' => 'döngü',
598
+    'zbug_boucle_recursive_undef' => 'tanımsız tekrarlı döngü', # MODIF
599
+    'zbug_calcul' => 'hesaplama',
600
+    'zbug_champ_hors_boucle' => '@champ@ alanı döngü dışında',
601
+    'zbug_champ_hors_motif' => '@champ@ alanı @motif@ döngüsü dışında ', # MODIF
602
+    'zbug_code' => 'kod',
603
+    'zbug_critere_inconnu' => 'tanımsız kriter @critere@', # MODIF
604
+    'zbug_distant_interdit' => 'yasaklanmış dış veri dosyası', # MODIF
605
+    'zbug_doublon_table_sans_cle_primaire' => 'endekssiz bir tabloda tekrarlar var', # MODIF
606
+    'zbug_doublon_table_sans_index' => 'endekslenmemiş bir tabloda tekrarlanan bilgiler', # MODIF
607
+    'zbug_erreur_boucle_double' => 'DÖNGÜ@id@: çift tanımlı', # MODIF
608
+    'zbug_erreur_boucle_fermant' => 'DÖNGÜ@id@: kapatma etiketi eksik', # MODIF
609
+    'zbug_erreur_boucle_syntaxe' => 'Döngü tümcesi hatalı', # MODIF
610
+    'zbug_erreur_compilation' => 'derleme hatası',
611
+    'zbug_erreur_execution_page' => 'sayfa işletilirken hata oluştu', # MODIF
612
+    'zbug_erreur_filtre' => 'Hata : <b>« @filtre@ »</b> filtresi tanımsız', # MODIF
613
+    'zbug_erreur_meme_parent' => '{meme_parent} sadece (FORUMS) veya  (RUBRIQUES) için uygulanabilir', # MODIF
614
+    'zbug_erreur_squelette' => 'İskelette hata var',
615
+    'zbug_hors_compilation' => 'Derleme Dışı',
616
+    'zbug_info_erreur_squelette' => 'Sitede hata var',
617
+    'zbug_inversion_ordre_inexistant' => 'olmayan bir sıralama ters çevrilemez', # MODIF
618
+    'zbug_pagination_sans_critere' => 'kritersiz veya kendini çağıran döngüde kullanılan #PAGINATION {pagination} ', # MODIF
619
+    'zbug_parametres_inclus_incorrects' => 'Ekleme parametreleri hatalı', # MODIF
620
+    'zbug_profile' => 'Hesaplama süresi : @time@',
621
+    'zbug_resultat' => 'sonuç',
622
+    'zbug_serveur_indefini' => 'SQL hizmet birimi tanımsız', # MODIF
623
+    'zbug_statistiques' => 'Süreye göre sınıflanmış SQL istekleri istatistikleri',
624
+    'zbug_table_inconnue' => '« @table@ » SQL tablosu tanımsız',
625
+    'zxml_connus_attributs' => 'bilinen öznitelikler',
626
+    'zxml_de' => 'nın / nin',
627
+    'zxml_inconnu_attribut' => 'bilinmeyen öznitelik',
628
+    'zxml_inconnu_balise' => 'bilinmeyen etiket',
629
+    'zxml_inconnu_entite' => 'bilinmeyen madde',
630
+    'zxml_inconnu_id' => 'bilinmeyen ID',
631
+    'zxml_mais_de' => 'ama nın / nin',
632
+    'zxml_non_conforme' => 'amaca uygun değil',
633
+    'zxml_non_fils' => 'bir alt maddesi değil',
634
+    'zxml_nonvide_balise' => 'boş olmayan etiket',
635
+    'zxml_obligatoire_attribut' => 'zorunlu ama belirtilmemiş etiket',
636
+    'zxml_succession_fils_incorrecte' => 'alt maddelerin peşpeşe gelmesi hatalı',
637
+    'zxml_survoler' => 'doğruları görmek için üzerindne geçmek ???',
638
+    'zxml_valeur_attribut' => 'özniteliğin değeri',
639
+    'zxml_vide_balise' => 'boş etiket',
640
+    'zxml_vu' => 'önceden görülen'
641 641
 );
Please login to merge, or discard this patch.