Completed
Push — master ( 350a8b...37aa61 )
by cam
01:39
created
ecrire/balise/url_logout.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
  *     Pile complétée du code compilé
36 36
  **/
37 37
 function balise_URL_LOGOUT($p) {
38
-	return calculer_balise_dynamique($p, 'URL_LOGOUT', []);
38
+    return calculer_balise_dynamique($p, 'URL_LOGOUT', []);
39 39
 }
40 40
 
41 41
 
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
  *   Liste (url) des arguments collectés.
52 52
  */
53 53
 function balise_URL_LOGOUT_stat($args, $context_compil) {
54
-	$url = $args[0] ?? '';
54
+    $url = $args[0] ?? '';
55 55
 
56
-	return [$url];
56
+    return [$url];
57 57
 }
58 58
 
59 59
 /**
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
  **/
69 69
 function balise_URL_LOGOUT_dyn($cible) {
70 70
 
71
-	if (empty($GLOBALS['visiteur_session']['login']) && empty($GLOBALS['visiteur_session']['statut'])) {
72
-		return '';
73
-	}
71
+    if (empty($GLOBALS['visiteur_session']['login']) && empty($GLOBALS['visiteur_session']['statut'])) {
72
+        return '';
73
+    }
74 74
 
75
-	return generer_url_action('logout', 'logout=public&url=' . rawurlencode((string) ($cible ?: self('&'))));
75
+    return generer_url_action('logout', 'logout=public&url=' . rawurlencode((string) ($cible ?: self('&'))));
76 76
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,5 +72,5 @@
 block discarded – undo
72 72
 		return '';
73 73
 	}
74 74
 
75
-	return generer_url_action('logout', 'logout=public&url=' . rawurlencode((string) ($cible ?: self('&'))));
75
+	return generer_url_action('logout', 'logout=public&url='.rawurlencode((string) ($cible ?: self('&'))));
76 76
 }
Please login to merge, or discard this patch.
ecrire/balise/menu_lang.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  *     Pile complétée du code compilé
37 37
  **/
38 38
 function balise_MENU_LANG($p) {
39
-	return calculer_balise_dynamique($p, 'MENU_LANG', ['lang']);
39
+    return calculer_balise_dynamique($p, 'MENU_LANG', ['lang']);
40 40
 }
41 41
 
42 42
 /**
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
  *   string: (vide) si pas de multilinguisme
56 56
  */
57 57
 function balise_MENU_LANG_stat($args, $context_compil) {
58
-	if (!str_contains((string) $GLOBALS['meta']['langues_multilingue'], ',')) {
59
-		return '';
60
-	}
58
+    if (!str_contains((string) $GLOBALS['meta']['langues_multilingue'], ',')) {
59
+        return '';
60
+    }
61 61
 
62
-	return $args;
62
+    return $args;
63 63
 }
64 64
 
65 65
 /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  *     Liste : Chemin du squelette, durée du cache, contexte
76 76
  **/
77 77
 function balise_MENU_LANG_dyn($opt) {
78
-	include_spip('balise/menu_lang_ecrire');
78
+    include_spip('balise/menu_lang_ecrire');
79 79
 
80
-	return menu_lang_pour_tous('var_lang', $opt);
80
+    return menu_lang_pour_tous('var_lang', $opt);
81 81
 }
Please login to merge, or discard this patch.
ecrire/balise/url_.php 2 patches
Indentation   +151 added lines, -151 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
 /**
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
  *     Code compilé
37 37
  **/
38 38
 function generer_generer_url($type, $p) {
39
-	$_id = interprete_argument_balise(1, $p);
39
+    $_id = interprete_argument_balise(1, $p);
40 40
 
41
-	if (!$_id) {
42
-		$primary = id_table_objet($type);
43
-		$_id = champ_sql($primary, $p);
44
-	}
41
+    if (!$_id) {
42
+        $primary = id_table_objet($type);
43
+        $_id = champ_sql($primary, $p);
44
+    }
45 45
 
46
-	return generer_generer_url_arg($type, $p, $_id);
46
+    return generer_generer_url_arg($type, $p, $_id);
47 47
 }
48 48
 
49 49
 /**
@@ -72,28 +72,28 @@  discard block
 block discarded – undo
72 72
  *     Code compilé
73 73
  **/
74 74
 function generer_generer_url_arg($type, $p, $_id) {
75
-	if ($s = trouver_nom_serveur_distant($p)) {
76
-		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
77
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
78
-			return $f($type, $_id, $s);
79
-		}
80
-		if (!$GLOBALS['connexions'][strtolower((string) $s)]['spip_connect_version']) {
81
-			return null;
82
-		}
83
-		$s = _q($s);
84
-		# exception des urls de documents sur un serveur distant...
85
-		if ($type == 'document') {
86
-			return
87
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
88
-				"quete_meta('dir_img', $s) . \n\t" .
89
-				"quete_fichier($_id,$s)";
90
-		}
91
-		$s = ", '', '', $s, quete_meta('type_urls', $s)";
92
-	} else {
93
-		$s = ", '', '', true";
94
-	}
95
-
96
-	return "urlencode_1738(generer_objet_url($_id, '$type'$s))";
75
+    if ($s = trouver_nom_serveur_distant($p)) {
76
+        // si une fonction de generation des url a ete definie pour ce connect l'utiliser
77
+        if (function_exists($f = 'generer_generer_url_' . $s)) {
78
+            return $f($type, $_id, $s);
79
+        }
80
+        if (!$GLOBALS['connexions'][strtolower((string) $s)]['spip_connect_version']) {
81
+            return null;
82
+        }
83
+        $s = _q($s);
84
+        # exception des urls de documents sur un serveur distant...
85
+        if ($type == 'document') {
86
+            return
87
+                "quete_meta('adresse_site', $s) . '/' .\n\t" .
88
+                "quete_meta('dir_img', $s) . \n\t" .
89
+                "quete_fichier($_id,$s)";
90
+        }
91
+        $s = ", '', '', $s, quete_meta('type_urls', $s)";
92
+    } else {
93
+        $s = ", '', '', true";
94
+    }
95
+
96
+    return "urlencode_1738(generer_objet_url($_id, '$type'$s))";
97 97
 }
98 98
 
99 99
 
@@ -118,27 +118,27 @@  discard block
 block discarded – undo
118 118
  */
119 119
 function balise_URL__dist($p) {
120 120
 
121
-	$nom = $p->nom_champ;
122
-	if ($nom === 'URL_') {
123
-		$msg = ['zbug_balise_sans_argument', ['balise' => ' URL_']];
124
-		erreur_squelette($msg, $p);
125
-		$p->interdire_scripts = false;
126
-
127
-		return $p;
128
-	} elseif ($f = charger_fonction($nom, 'balise', true)) {
129
-		return $f($p);
130
-	} else {
131
-		$nom = strtolower((string) $nom);
132
-		$code = generer_generer_url(substr($nom, 4), $p);
133
-		$code = champ_sql($nom, $p, $code);
134
-		$p->code = $code;
135
-		if (!$p->etoile) {
136
-			$p->code = "vider_url($code)";
137
-		}
138
-		$p->interdire_scripts = false;
139
-
140
-		return $p;
141
-	}
121
+    $nom = $p->nom_champ;
122
+    if ($nom === 'URL_') {
123
+        $msg = ['zbug_balise_sans_argument', ['balise' => ' URL_']];
124
+        erreur_squelette($msg, $p);
125
+        $p->interdire_scripts = false;
126
+
127
+        return $p;
128
+    } elseif ($f = charger_fonction($nom, 'balise', true)) {
129
+        return $f($p);
130
+    } else {
131
+        $nom = strtolower((string) $nom);
132
+        $code = generer_generer_url(substr($nom, 4), $p);
133
+        $code = champ_sql($nom, $p, $code);
134
+        $p->code = $code;
135
+        if (!$p->etoile) {
136
+            $p->code = "vider_url($code)";
137
+        }
138
+        $p->interdire_scripts = false;
139
+
140
+        return $p;
141
+    }
142 142
 }
143 143
 
144 144
 /**
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function balise_URL_ARTICLE_dist($p) {
164 164
 
165
-	// Cas particulier des boucles (SYNDIC_ARTICLES)
166
-	$code = $p->type_requete == 'syndic_articles' ? champ_sql('url', $p) : generer_generer_url('article', $p);
165
+    // Cas particulier des boucles (SYNDIC_ARTICLES)
166
+    $code = $p->type_requete == 'syndic_articles' ? champ_sql('url', $p) : generer_generer_url('article', $p);
167 167
 
168
-	$p->code = $code;
169
-	if (!$p->etoile) {
170
-		$p->code = "vider_url($code)";
171
-	}
172
-	$p->interdire_scripts = false;
168
+    $p->code = $code;
169
+    if (!$p->etoile) {
170
+        $p->code = "vider_url($code)";
171
+    }
172
+    $p->interdire_scripts = false;
173 173
 
174
-	return $p;
174
+    return $p;
175 175
 }
176 176
 
177 177
 /**
@@ -191,21 +191,21 @@  discard block
 block discarded – undo
191 191
  *     Pile complétée par le code à générer
192 192
  */
193 193
 function balise_URL_SITE_dist($p) {
194
-	$code = champ_sql('url_site', $p, '');
195
-	if (!$code) {
196
-		$code = generer_generer_url('site', $p);
197
-		if ($code === null) {
198
-			return null;
199
-		}
200
-	} else {
201
-		if (!$p->etoile) {
202
-			$code = "calculer_url($code,'','url', \$connect)";
203
-		}
204
-	}
205
-	$p->code = $code;
206
-	$p->interdire_scripts = false;
207
-
208
-	return $p;
194
+    $code = champ_sql('url_site', $p, '');
195
+    if (!$code) {
196
+        $code = generer_generer_url('site', $p);
197
+        if ($code === null) {
198
+            return null;
199
+        }
200
+    } else {
201
+        if (!$p->etoile) {
202
+            $code = "calculer_url($code,'','url', \$connect)";
203
+        }
204
+    }
205
+    $p->code = $code;
206
+    $p->interdire_scripts = false;
207
+
208
+    return $p;
209 209
 }
210 210
 
211 211
 // Autres balises URL_*, qui ne concernent pas une table
@@ -224,11 +224,11 @@  discard block
 block discarded – undo
224 224
  *     Pile complétée par le code à générer
225 225
  */
226 226
 function balise_URL_SITE_SPIP_dist($p) {
227
-	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
228
-	$p->code = 'spip_htmlspecialchars(' . $p->code . ')';
229
-	$p->interdire_scripts = false;
227
+    $p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
228
+    $p->code = 'spip_htmlspecialchars(' . $p->code . ')';
229
+    $p->interdire_scripts = false;
230 230
 
231
-	return $p;
231
+    return $p;
232 232
 }
233 233
 
234 234
 
@@ -257,42 +257,42 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function balise_URL_PAGE_dist($p) {
259 259
 
260
-	$code = interprete_argument_balise(1, $p);
261
-	$args = interprete_argument_balise(2, $p);
262
-	if ($args == null) {
263
-		$args = "''";
264
-	}
265
-
266
-	if ($s = trouver_nom_serveur_distant($p)) {
267
-		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
268
-		// elle devra aussi traiter le cas derogatoire type=page
269
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
270
-			if ($args && $args !== "''") {
271
-				$code .= ", $args";
272
-			}
273
-			$code = $f('page', $code, $s);
274
-			$p->code = $code;
275
-			return $p;
276
-		}
277
-		$s = 'connect=' . addslashes((string) $s);
278
-		$args = (($args && $args !== "''") ? "$args . '&$s'" : "'$s'");
279
-	}
280
-
281
-	if (!$code) {
282
-		$noentities = $p->etoile ? "'&'" : '';
283
-		$code = "url_de_base() . preg_replace(',^./,', '', self($noentities))";
284
-	} else {
285
-		if (!$args) {
286
-			$args = "''";
287
-		}
288
-		$noentities = $p->etoile ? ', true' : '';
289
-		$code = "generer_url_public($code, $args$noentities)";
290
-	}
291
-	$p->code = $code;
292
-	spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
293
-
294
-	#$p->interdire_scripts = true;
295
-	return $p;
260
+    $code = interprete_argument_balise(1, $p);
261
+    $args = interprete_argument_balise(2, $p);
262
+    if ($args == null) {
263
+        $args = "''";
264
+    }
265
+
266
+    if ($s = trouver_nom_serveur_distant($p)) {
267
+        // si une fonction de generation des url a ete definie pour ce connect l'utiliser
268
+        // elle devra aussi traiter le cas derogatoire type=page
269
+        if (function_exists($f = 'generer_generer_url_' . $s)) {
270
+            if ($args && $args !== "''") {
271
+                $code .= ", $args";
272
+            }
273
+            $code = $f('page', $code, $s);
274
+            $p->code = $code;
275
+            return $p;
276
+        }
277
+        $s = 'connect=' . addslashes((string) $s);
278
+        $args = (($args && $args !== "''") ? "$args . '&$s'" : "'$s'");
279
+    }
280
+
281
+    if (!$code) {
282
+        $noentities = $p->etoile ? "'&'" : '';
283
+        $code = "url_de_base() . preg_replace(',^./,', '', self($noentities))";
284
+    } else {
285
+        if (!$args) {
286
+            $args = "''";
287
+        }
288
+        $noentities = $p->etoile ? ', true' : '';
289
+        $code = "generer_url_public($code, $args$noentities)";
290
+    }
291
+    $p->code = $code;
292
+    spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
293
+
294
+    #$p->interdire_scripts = true;
295
+    return $p;
296 296
 }
297 297
 
298 298
 
@@ -319,24 +319,24 @@  discard block
 block discarded – undo
319 319
  */
320 320
 function balise_URL_ECRIRE_dist($p) {
321 321
 
322
-	$code = interprete_argument_balise(1, $p);
323
-	if (!$code) {
324
-		$fonc = "''";
325
-	} else {
326
-		$fonc = $code;
327
-		$args = interprete_argument_balise(2, $p);
328
-		if ($args === null) {
329
-			$args = "''";
330
-		}
331
-		$noentities = $p->etoile ? ', true' : '';
332
-		if ($args != "''" || $noentities) {
333
-			$fonc .= ",$args$noentities";
334
-		}
335
-	}
336
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
337
-	$p->interdire_scripts = false;
338
-
339
-	return $p;
322
+    $code = interprete_argument_balise(1, $p);
323
+    if (!$code) {
324
+        $fonc = "''";
325
+    } else {
326
+        $fonc = $code;
327
+        $args = interprete_argument_balise(2, $p);
328
+        if ($args === null) {
329
+            $args = "''";
330
+        }
331
+        $noentities = $p->etoile ? ', true' : '';
332
+        if ($args != "''" || $noentities) {
333
+            $fonc .= ",$args$noentities";
334
+        }
335
+    }
336
+    $p->code = 'generer_url_ecrire(' . $fonc . ')';
337
+    $p->interdire_scripts = false;
338
+
339
+    return $p;
340 340
 }
341 341
 
342 342
 
@@ -362,24 +362,24 @@  discard block
 block discarded – undo
362 362
  *     Pile complétée par le code à générer
363 363
  */
364 364
 function balise_URL_ACTION_AUTEUR_dist($p) {
365
-	$p->descr['session'] = true;
366
-
367
-	$p->code = interprete_argument_balise(1, $p);
368
-
369
-	$args = interprete_argument_balise(2, $p);
370
-	if ($args != "''" && $args !== null) {
371
-		$p->code .= ',' . $args;
372
-	}
373
-	$redirect = interprete_argument_balise(3, $p);
374
-	if ($redirect != "''" && $redirect !== null) {
375
-		if ($args == "''" || $args === null) {
376
-			$p->code .= ",''";
377
-		}
378
-		$p->code .= ',' . $redirect;
379
-	}
380
-
381
-	$p->code = 'generer_action_auteur(' . $p->code . ')';
382
-	$p->interdire_scripts = false;
383
-
384
-	return $p;
365
+    $p->descr['session'] = true;
366
+
367
+    $p->code = interprete_argument_balise(1, $p);
368
+
369
+    $args = interprete_argument_balise(2, $p);
370
+    if ($args != "''" && $args !== null) {
371
+        $p->code .= ',' . $args;
372
+    }
373
+    $redirect = interprete_argument_balise(3, $p);
374
+    if ($redirect != "''" && $redirect !== null) {
375
+        if ($args == "''" || $args === null) {
376
+            $p->code .= ",''";
377
+        }
378
+        $p->code .= ',' . $redirect;
379
+    }
380
+
381
+    $p->code = 'generer_action_auteur(' . $p->code . ')';
382
+    $p->interdire_scripts = false;
383
+
384
+    return $p;
385 385
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 function generer_generer_url_arg($type, $p, $_id) {
75 75
 	if ($s = trouver_nom_serveur_distant($p)) {
76 76
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
77
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
77
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
78 78
 			return $f($type, $_id, $s);
79 79
 		}
80 80
 		if (!$GLOBALS['connexions'][strtolower((string) $s)]['spip_connect_version']) {
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 		# exception des urls de documents sur un serveur distant...
85 85
 		if ($type == 'document') {
86 86
 			return
87
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
88
-				"quete_meta('dir_img', $s) . \n\t" .
87
+				"quete_meta('adresse_site', $s) . '/' .\n\t".
88
+				"quete_meta('dir_img', $s) . \n\t".
89 89
 				"quete_fichier($_id,$s)";
90 90
 		}
91 91
 		$s = ", '', '', $s, quete_meta('type_urls', $s)";
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  */
226 226
 function balise_URL_SITE_SPIP_dist($p) {
227 227
 	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
228
-	$p->code = 'spip_htmlspecialchars(' . $p->code . ')';
228
+	$p->code = 'spip_htmlspecialchars('.$p->code.')';
229 229
 	$p->interdire_scripts = false;
230 230
 
231 231
 	return $p;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	if ($s = trouver_nom_serveur_distant($p)) {
267 267
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
268 268
 		// elle devra aussi traiter le cas derogatoire type=page
269
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
269
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
270 270
 			if ($args && $args !== "''") {
271 271
 				$code .= ", $args";
272 272
 			}
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 			$p->code = $code;
275 275
 			return $p;
276 276
 		}
277
-		$s = 'connect=' . addslashes((string) $s);
277
+		$s = 'connect='.addslashes((string) $s);
278 278
 		$args = (($args && $args !== "''") ? "$args . '&$s'" : "'$s'");
279 279
 	}
280 280
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		$code = "generer_url_public($code, $args$noentities)";
290 290
 	}
291 291
 	$p->code = $code;
292
-	spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
292
+	spip_log("Calcul url page : connect vaut $s ca donne :".$p->code." args $args", _LOG_INFO);
293 293
 
294 294
 	#$p->interdire_scripts = true;
295 295
 	return $p;
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			$fonc .= ",$args$noentities";
334 334
 		}
335 335
 	}
336
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
336
+	$p->code = 'generer_url_ecrire('.$fonc.')';
337 337
 	$p->interdire_scripts = false;
338 338
 
339 339
 	return $p;
@@ -368,17 +368,17 @@  discard block
 block discarded – undo
368 368
 
369 369
 	$args = interprete_argument_balise(2, $p);
370 370
 	if ($args != "''" && $args !== null) {
371
-		$p->code .= ',' . $args;
371
+		$p->code .= ','.$args;
372 372
 	}
373 373
 	$redirect = interprete_argument_balise(3, $p);
374 374
 	if ($redirect != "''" && $redirect !== null) {
375 375
 		if ($args == "''" || $args === null) {
376 376
 			$p->code .= ",''";
377 377
 		}
378
-		$p->code .= ',' . $redirect;
378
+		$p->code .= ','.$redirect;
379 379
 	}
380 380
 
381
-	$p->code = 'generer_action_auteur(' . $p->code . ')';
381
+	$p->code = 'generer_action_auteur('.$p->code.')';
382 382
 	$p->interdire_scripts = false;
383 383
 
384 384
 	return $p;
Please login to merge, or discard this patch.
ecrire/balise/logo_.php 2 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 
@@ -55,88 +55,88 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function balise_LOGO__dist($p) {
57 57
 
58
-	preg_match(',^LOGO_([A-Z_]+?)(|_NORMAL|_SURVOL|_RUBRIQUE)$,i', $p->nom_champ, $regs);
59
-	$type = strtolower($regs[1]);
60
-	$suite_logo = $regs[2];
61
-
62
-	// cas de #LOGO_SITE_SPIP
63
-	if ($type == 'site_spip') {
64
-		$type = 'site';
65
-		$_id_objet = "\"'0'\"";
66
-	}
67
-
68
-	$id_objet = id_table_objet($type);
69
-	if (!isset($_id_objet)) {
70
-		$_id_objet = champ_sql($id_objet, $p);
71
-	}
72
-
73
-	$fichier = ($p->etoile === '**') ? -1 : 0;
74
-	$coord = [];
75
-	$align = $lien = '';
76
-	$mode_logo = '';
77
-
78
-	if ($p->param && !$p->param[0][0]) {
79
-		$params = $p->param[0];
80
-		array_shift($params);
81
-		foreach ($params as $a) {
82
-			if ($a[0]->type === 'texte') {
83
-				$n = $a[0]->texte;
84
-				if (is_numeric($n)) {
85
-					$coord[] = $n;
86
-				} elseif (in_array($n, ['top', 'left', 'right', 'center', 'bottom'])) {
87
-					$align = $n;
88
-				} elseif (in_array($n, ['auto', 'icone', 'apercu', 'vignette'])) {
89
-					$mode_logo = $n;
90
-				}
91
-			} else {
92
-				$lien = calculer_liste($a, $p->descr, $p->boucles, $p->id_boucle);
93
-			}
94
-		}
95
-	}
96
-
97
-	$coord_x = $coord ? (int) array_shift($coord) : 0;
98
-	$coord_y = $coord ? (int) array_shift($coord) : 0;
99
-
100
-	if ($p->etoile === '*') {
101
-		include_spip('balise/url_');
102
-		$lien = generer_generer_url_arg($type, $p, $_id_objet);
103
-	}
104
-
105
-	$connect = $p->id_boucle ? $p->boucles[$p->id_boucle]->sql_serveur : '';
106
-	if ($type == 'document') {
107
-		$qconnect = _q($connect);
108
-		$doc = "quete_document($_id_objet, $qconnect)";
109
-		if ($fichier) {
110
-			$code = "quete_logo_file($doc, $qconnect)";
111
-		} else {
112
-			$code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
113
-		}
114
-		// (x=non-faux ? y : '') pour affecter x en retournant y
115
-		if ($p->descr['documents']) {
116
-			$code = '(($doublons["documents"] .= ",". '
117
-				. $_id_objet
118
-				. ") ? $code : '')";
119
-		}
120
-	} elseif ($connect) {
121
-		$code = "''";
122
-		spip_log('Les logos distants ne sont pas prevus');
123
-	} else {
124
-		// pour generer_code_logo
125
-		include_spip('balise/id_logo_');
126
-		$champ_logo = '';
127
-		if ($fichier) {
128
-			$champ_logo = 'fichier';
129
-		}
130
-		$code = generer_code_logo($id_objet, $_id_objet, $type, $align, $lien, $p, $suite_logo, $champ_logo);
131
-	}
132
-
133
-	// demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
134
-	if ($coord_x || $coord_y) {
135
-		$code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
136
-	}
137
-
138
-	$p->code = $code;
139
-	$p->interdire_scripts = false;
140
-
141
-	return $p;
58
+    preg_match(',^LOGO_([A-Z_]+?)(|_NORMAL|_SURVOL|_RUBRIQUE)$,i', $p->nom_champ, $regs);
59
+    $type = strtolower($regs[1]);
60
+    $suite_logo = $regs[2];
61
+
62
+    // cas de #LOGO_SITE_SPIP
63
+    if ($type == 'site_spip') {
64
+        $type = 'site';
65
+        $_id_objet = "\"'0'\"";
66
+    }
67
+
68
+    $id_objet = id_table_objet($type);
69
+    if (!isset($_id_objet)) {
70
+        $_id_objet = champ_sql($id_objet, $p);
71
+    }
72
+
73
+    $fichier = ($p->etoile === '**') ? -1 : 0;
74
+    $coord = [];
75
+    $align = $lien = '';
76
+    $mode_logo = '';
77
+
78
+    if ($p->param && !$p->param[0][0]) {
79
+        $params = $p->param[0];
80
+        array_shift($params);
81
+        foreach ($params as $a) {
82
+            if ($a[0]->type === 'texte') {
83
+                $n = $a[0]->texte;
84
+                if (is_numeric($n)) {
85
+                    $coord[] = $n;
86
+                } elseif (in_array($n, ['top', 'left', 'right', 'center', 'bottom'])) {
87
+                    $align = $n;
88
+                } elseif (in_array($n, ['auto', 'icone', 'apercu', 'vignette'])) {
89
+                    $mode_logo = $n;
90
+                }
91
+            } else {
92
+                $lien = calculer_liste($a, $p->descr, $p->boucles, $p->id_boucle);
93
+            }
94
+        }
95
+    }
96
+
97
+    $coord_x = $coord ? (int) array_shift($coord) : 0;
98
+    $coord_y = $coord ? (int) array_shift($coord) : 0;
99
+
100
+    if ($p->etoile === '*') {
101
+        include_spip('balise/url_');
102
+        $lien = generer_generer_url_arg($type, $p, $_id_objet);
103
+    }
104
+
105
+    $connect = $p->id_boucle ? $p->boucles[$p->id_boucle]->sql_serveur : '';
106
+    if ($type == 'document') {
107
+        $qconnect = _q($connect);
108
+        $doc = "quete_document($_id_objet, $qconnect)";
109
+        if ($fichier) {
110
+            $code = "quete_logo_file($doc, $qconnect)";
111
+        } else {
112
+            $code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
113
+        }
114
+        // (x=non-faux ? y : '') pour affecter x en retournant y
115
+        if ($p->descr['documents']) {
116
+            $code = '(($doublons["documents"] .= ",". '
117
+                . $_id_objet
118
+                . ") ? $code : '')";
119
+        }
120
+    } elseif ($connect) {
121
+        $code = "''";
122
+        spip_log('Les logos distants ne sont pas prevus');
123
+    } else {
124
+        // pour generer_code_logo
125
+        include_spip('balise/id_logo_');
126
+        $champ_logo = '';
127
+        if ($fichier) {
128
+            $champ_logo = 'fichier';
129
+        }
130
+        $code = generer_code_logo($id_objet, $_id_objet, $type, $align, $lien, $p, $suite_logo, $champ_logo);
131
+    }
132
+
133
+    // demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
134
+    if ($coord_x || $coord_y) {
135
+        $code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
136
+    }
137
+
138
+    $p->code = $code;
139
+    $p->interdire_scripts = false;
140
+
141
+    return $p;
142 142
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		if ($fichier) {
110 110
 			$code = "quete_logo_file($doc, $qconnect)";
111 111
 		} else {
112
-			$code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
112
+			$code = "quete_logo_document($doc, ".($lien ?: "''").", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
113 113
 		}
114 114
 		// (x=non-faux ? y : '') pour affecter x en retournant y
115 115
 		if ($p->descr['documents']) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 	// demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
134 134
 	if ($coord_x || $coord_y) {
135
-		$code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
135
+		$code = "filtrer('image_graver',filtrer('image_reduire',".$code.", '$coord_x', '$coord_y'))";
136 136
 	}
137 137
 
138 138
 	$p->code = $code;
Please login to merge, or discard this patch.
ecrire/balise/menu_lang_ecrire.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  *     Pile complétée du code compilé
37 37
  **/
38 38
 function balise_MENU_LANG_ECRIRE($p) {
39
-	return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', ['lang']);
39
+    return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', ['lang']);
40 40
 }
41 41
 
42 42
 /**
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
  *   - string: Si pas de multilinguisme
56 56
  */
57 57
 function balise_MENU_LANG_ECRIRE_stat($args, $context_compil) {
58
-	include_spip('inc/lang');
59
-	if (!str_contains((string) $GLOBALS['meta']['langues_proposees'], ',')) {
60
-		return '';
61
-	}
58
+    include_spip('inc/lang');
59
+    if (!str_contains((string) $GLOBALS['meta']['langues_proposees'], ',')) {
60
+        return '';
61
+    }
62 62
 
63
-	return $args;
63
+    return $args;
64 64
 }
65 65
 
66 66
 /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
  *     Liste : Chemin du squelette, durée du cache, contexte
77 77
  **/
78 78
 function balise_MENU_LANG_ECRIRE_dyn($opt) {
79
-	return menu_lang_pour_tous('var_lang_ecrire', $opt);
79
+    return menu_lang_pour_tous('var_lang_ecrire', $opt);
80 80
 }
81 81
 
82 82
 /**
@@ -96,30 +96,30 @@  discard block
 block discarded – undo
96 96
  *     Liste : Chemin du squelette, durée du cache, contexte
97 97
  **/
98 98
 function menu_lang_pour_tous($nom, $default) {
99
-	include_spip('inc/lang');
99
+    include_spip('inc/lang');
100 100
 
101
-	if ($GLOBALS['spip_lang'] != $default) {
102
-		$opt = lang_select($default);  # et remplace
103
-		if ($GLOBALS['spip_lang'] != $default) {
104
-			$default = '';  # annule tout choix par defaut
105
-			if ($opt) {
106
-				lang_select();
107
-			}
108
-		}
109
-	}
101
+    if ($GLOBALS['spip_lang'] != $default) {
102
+        $opt = lang_select($default);  # et remplace
103
+        if ($GLOBALS['spip_lang'] != $default) {
104
+            $default = '';  # annule tout choix par defaut
105
+            if ($opt) {
106
+                lang_select();
107
+            }
108
+        }
109
+    }
110 110
 
111
-	# lien a partir de /
112
-	$cible = parametre_url(self(), 'lang', '', '&');
113
-	$post = generer_url_action('converser', 'redirect=' . rawurlencode((string) $cible), true);
111
+    # lien a partir de /
112
+    $cible = parametre_url(self(), 'lang', '', '&');
113
+    $post = generer_url_action('converser', 'redirect=' . rawurlencode((string) $cible), true);
114 114
 
115
-	return [
116
-		'formulaires/menu_lang',
117
-		3600,
118
-		[
119
-			'nom' => $nom,
120
-			'url' => $post,
121
-			'name' => $nom,
122
-			'default' => $default,
123
-		]
124
-	];
115
+    return [
116
+        'formulaires/menu_lang',
117
+        3600,
118
+        [
119
+            'nom' => $nom,
120
+            'url' => $post,
121
+            'name' => $nom,
122
+            'default' => $default,
123
+        ]
124
+    ];
125 125
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	include_spip('inc/lang');
100 100
 
101 101
 	if ($GLOBALS['spip_lang'] != $default) {
102
-		$opt = lang_select($default);  # et remplace
102
+		$opt = lang_select($default); # et remplace
103 103
 		if ($GLOBALS['spip_lang'] != $default) {
104
-			$default = '';  # annule tout choix par defaut
104
+			$default = ''; # annule tout choix par defaut
105 105
 			if ($opt) {
106 106
 				lang_select();
107 107
 			}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	# lien a partir de /
112 112
 	$cible = parametre_url(self(), 'lang', '', '&');
113
-	$post = generer_url_action('converser', 'redirect=' . rawurlencode((string) $cible), true);
113
+	$post = generer_url_action('converser', 'redirect='.rawurlencode((string) $cible), true);
114 114
 
115 115
 	return [
116 116
 		'formulaires/menu_lang',
Please login to merge, or discard this patch.
ecrire/balise/formulaire_admin.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  *     Pile complétée du code compilé
42 42
  **/
43 43
 function balise_FORMULAIRE_ADMIN($p) {
44
-	return calculer_balise_dynamique($p, 'FORMULAIRE_ADMIN', []);
44
+    return calculer_balise_dynamique($p, 'FORMULAIRE_ADMIN', []);
45 45
 }
46 46
 
47 47
 /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
  *   - chaîne vide sinon.
59 59
  */
60 60
 function balise_FORMULAIRE_ADMIN_stat($args, $context_compil) {
61
-	return $args;
61
+    return $args;
62 62
 }
63 63
 
64 64
 
@@ -83,64 +83,64 @@  discard block
 block discarded – undo
83 83
  **/
84 84
 function balise_FORMULAIRE_ADMIN_dyn($float = '', $debug = '') {
85 85
 
86
-	static $dejafait = false;
86
+    static $dejafait = false;
87 87
 
88
-	if (empty($_COOKIE['spip_admin'])) {
89
-		return '';
90
-	}
88
+    if (empty($_COOKIE['spip_admin'])) {
89
+        return '';
90
+    }
91 91
 
92
-	if (!is_array($debug)) {
93
-		if ($dejafait) {
94
-			return '';
95
-		}
96
-	} else {
97
-		if ($dejafait) {
98
-			if (empty($debug['sourcefile'])) {
99
-				return '';
100
-			}
101
-			foreach ($debug['sourcefile'] as $k => $v) {
102
-				if (str_contains((string) $v, 'administration.') && isset($debug['resultat'][$k . 'tout'])) {
103
-					return $debug['resultat'][$k . 'tout'];
104
-				}
105
-			}
92
+    if (!is_array($debug)) {
93
+        if ($dejafait) {
94
+            return '';
95
+        }
96
+    } else {
97
+        if ($dejafait) {
98
+            if (empty($debug['sourcefile'])) {
99
+                return '';
100
+            }
101
+            foreach ($debug['sourcefile'] as $k => $v) {
102
+                if (str_contains((string) $v, 'administration.') && isset($debug['resultat'][$k . 'tout'])) {
103
+                    return $debug['resultat'][$k . 'tout'];
104
+                }
105
+            }
106 106
 
107
-			return '';
108
-		}
109
-	}
107
+            return '';
108
+        }
109
+    }
110 110
 
111
-	include_spip('inc/autoriser');
112
-	include_spip('base/abstract_sql');
111
+    include_spip('inc/autoriser');
112
+    include_spip('base/abstract_sql');
113 113
 
114 114
 
115
-	$dejafait = true;
115
+    $dejafait = true;
116 116
 
117
-	// Preparer le #ENV des boutons
117
+    // Preparer le #ENV des boutons
118 118
 
119
-	$env = admin_objet();
119
+    $env = admin_objet();
120 120
 
121
-	// Pas de "modifier ce..." ? -> donner "acces a l'espace prive"
122
-	if (!$env) {
123
-		$env['ecrire'] = _DIR_RESTREINT_ABS;
124
-	}
121
+    // Pas de "modifier ce..." ? -> donner "acces a l'espace prive"
122
+    if (!$env) {
123
+        $env['ecrire'] = _DIR_RESTREINT_ABS;
124
+    }
125 125
 
126
-	$env['divclass'] = $float;
127
-	$env['lang'] = admin_lang();
128
-	$env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul');
129
-	$env['debug'] = ((defined('_VAR_PREVIEW') && _VAR_PREVIEW) ? '' : admin_debug());
130
-	$env['analyser'] = (!$env['debug'] && !$GLOBALS['xhtml']) ? '' : admin_valider();
131
-	$env['inclure'] = ((defined('_VAR_INCLURE') && _VAR_INCLURE) ? 'inclure' : '');
126
+    $env['divclass'] = $float;
127
+    $env['lang'] = admin_lang();
128
+    $env['calcul'] = (_request('var_mode') ? 'recalcul' : 'calcul');
129
+    $env['debug'] = ((defined('_VAR_PREVIEW') && _VAR_PREVIEW) ? '' : admin_debug());
130
+    $env['analyser'] = (!$env['debug'] && !$GLOBALS['xhtml']) ? '' : admin_valider();
131
+    $env['inclure'] = ((defined('_VAR_INCLURE') && _VAR_INCLURE) ? 'inclure' : '');
132 132
 
133
-	if (empty($GLOBALS['use_cache'])) {
134
-		$env['use_cache'] = ' *';
135
-	}
133
+    if (empty($GLOBALS['use_cache'])) {
134
+        $env['use_cache'] = ' *';
135
+    }
136 136
 
137
-	if (isset($debug['validation'])) {
138
-		$env['xhtml_error'] = $debug['validation'];
139
-	}
137
+    if (isset($debug['validation'])) {
138
+        $env['xhtml_error'] = $debug['validation'];
139
+    }
140 140
 
141
-	$env['_pipelines']['formulaire_admin'] = [];
141
+    $env['_pipelines']['formulaire_admin'] = [];
142 142
 
143
-	return ['formulaires/administration', 0, $env];
143
+    return ['formulaires/administration', 0, $env];
144 144
 }
145 145
 
146 146
 
@@ -158,46 +158,46 @@  discard block
 block discarded – undo
158 158
  *     Tableau de l'environnement calculé
159 159
  **/
160 160
 function admin_objet() {
161
-	include_spip('inc/urls');
162
-	$env = [];
163
-
164
-	$trouver_table = charger_fonction('trouver_table', 'base');
165
-	$objets = urls_liste_objets(false);
166
-	$objets = array_diff($objets, ['rubrique']);
167
-	$objets = array_reverse($objets);
168
-	array_unshift($objets, 'rubrique');
169
-	foreach ($objets as $obj) {
170
-		$type = $obj;
171
-		if (
172
-			$type == objet_type($type, false)
173
-			&& ($_id_type = id_table_objet($type))
174
-			&& isset($GLOBALS['contexte'][$_id_type])
175
-			&& ($id = $GLOBALS['contexte'][$_id_type])
176
-			&& !is_array($id)
177
-			&& ($id = (int) $id)
178
-			&& ($desc = $trouver_table(table_objet_sql($type)))
179
-		) {
180
-			$id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . (int) $id);
181
-			if ($id) {
182
-				$env[$_id_type] = $id;
183
-				$env['objet'] = $type;
184
-				$env['id_objet'] = $id;
185
-				$env['voir_' . $obj] = str_replace('&', '&', (string) generer_objet_url($id, $obj, '', '', false));
186
-				if (
187
-					isset($desc['field']['id_rubrique'])
188
-					&& $type != 'rubrique'
189
-				) {
190
-					unset($env['id_rubrique']);
191
-					unset($env['voir_rubrique']);
192
-					if (admin_preview($type, $id, $desc)) {
193
-						$env['preview'] = parametre_url(self(), 'var_mode', 'preview', '&');
194
-					}
195
-				}
196
-			}
197
-		}
198
-	}
199
-
200
-	return $env;
161
+    include_spip('inc/urls');
162
+    $env = [];
163
+
164
+    $trouver_table = charger_fonction('trouver_table', 'base');
165
+    $objets = urls_liste_objets(false);
166
+    $objets = array_diff($objets, ['rubrique']);
167
+    $objets = array_reverse($objets);
168
+    array_unshift($objets, 'rubrique');
169
+    foreach ($objets as $obj) {
170
+        $type = $obj;
171
+        if (
172
+            $type == objet_type($type, false)
173
+            && ($_id_type = id_table_objet($type))
174
+            && isset($GLOBALS['contexte'][$_id_type])
175
+            && ($id = $GLOBALS['contexte'][$_id_type])
176
+            && !is_array($id)
177
+            && ($id = (int) $id)
178
+            && ($desc = $trouver_table(table_objet_sql($type)))
179
+        ) {
180
+            $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . (int) $id);
181
+            if ($id) {
182
+                $env[$_id_type] = $id;
183
+                $env['objet'] = $type;
184
+                $env['id_objet'] = $id;
185
+                $env['voir_' . $obj] = str_replace('&', '&', (string) generer_objet_url($id, $obj, '', '', false));
186
+                if (
187
+                    isset($desc['field']['id_rubrique'])
188
+                    && $type != 'rubrique'
189
+                ) {
190
+                    unset($env['id_rubrique']);
191
+                    unset($env['voir_rubrique']);
192
+                    if (admin_preview($type, $id, $desc)) {
193
+                        $env['preview'] = parametre_url(self(), 'var_mode', 'preview', '&');
194
+                    }
195
+                }
196
+            }
197
+        }
198
+    }
199
+
200
+    return $env;
201 201
 }
202 202
 
203 203
 
@@ -215,30 +215,30 @@  discard block
 block discarded – undo
215 215
  *     - Tableau d'un élément sinon.
216 216
  **/
217 217
 function admin_preview($type, $id, $desc = null) {
218
-	if (defined('_VAR_PREVIEW') && _VAR_PREVIEW) {
219
-		return '';
220
-	}
221
-
222
-	if (!$desc) {
223
-		$trouver_table = charger_fonction('trouver_table', 'base');
224
-		$desc = $trouver_table(table_objet_sql($type));
225
-	}
226
-	if (!$desc || !isset($desc['field']['statut'])) {
227
-		return '';
228
-	}
229
-
230
-	include_spip('inc/autoriser');
231
-	if (!autoriser('previsualiser')) {
232
-		return '';
233
-	}
234
-
235
-	$notpub = sql_in('statut', ['prop', 'prive']);
236
-
237
-	if ($type == 'article' && $GLOBALS['meta']['post_dates'] != 'oui') {
238
-		$notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ')';
239
-	}
240
-
241
-	return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . '=' . $id . " AND ($notpub)");
218
+    if (defined('_VAR_PREVIEW') && _VAR_PREVIEW) {
219
+        return '';
220
+    }
221
+
222
+    if (!$desc) {
223
+        $trouver_table = charger_fonction('trouver_table', 'base');
224
+        $desc = $trouver_table(table_objet_sql($type));
225
+    }
226
+    if (!$desc || !isset($desc['field']['statut'])) {
227
+        return '';
228
+    }
229
+
230
+    include_spip('inc/autoriser');
231
+    if (!autoriser('previsualiser')) {
232
+        return '';
233
+    }
234
+
235
+    $notpub = sql_in('statut', ['prop', 'prive']);
236
+
237
+    if ($type == 'article' && $GLOBALS['meta']['post_dates'] != 'oui') {
238
+        $notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ')';
239
+    }
240
+
241
+    return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . '=' . $id . " AND ($notpub)");
242 242
 }
243 243
 
244 244
 
@@ -249,25 +249,25 @@  discard block
 block discarded – undo
249 249
  *     Code de langue
250 250
  **/
251 251
 function admin_lang() {
252
-	$alang = '';
253
-	if (!empty($_COOKIE['spip_admin'])) {
254
-		$email_or_login = preg_replace(',^@,', '', (string) $_COOKIE['spip_admin']);
255
-		$alang = sql_getfetsel('lang', 'spip_auteurs', 'email=' . sql_quote($email_or_login));
256
-		if (!$alang) {
257
-			$alang = sql_getfetsel('lang', 'spip_auteurs', 'login=' . sql_quote($email_or_login));
258
-		}
259
-	}
260
-	if (!$alang) {
261
-		return '';
262
-	}
263
-
264
-	$l = lang_select($alang);
265
-	$alang = $GLOBALS['spip_lang'];
266
-	if ($l) {
267
-		lang_select();
268
-	}
269
-
270
-	return $alang;
252
+    $alang = '';
253
+    if (!empty($_COOKIE['spip_admin'])) {
254
+        $email_or_login = preg_replace(',^@,', '', (string) $_COOKIE['spip_admin']);
255
+        $alang = sql_getfetsel('lang', 'spip_auteurs', 'email=' . sql_quote($email_or_login));
256
+        if (!$alang) {
257
+            $alang = sql_getfetsel('lang', 'spip_auteurs', 'login=' . sql_quote($email_or_login));
258
+        }
259
+    }
260
+    if (!$alang) {
261
+        return '';
262
+    }
263
+
264
+    $l = lang_select($alang);
265
+    $alang = $GLOBALS['spip_lang'];
266
+    if ($l) {
267
+        lang_select();
268
+    }
269
+
270
+    return $alang;
271 271
 }
272 272
 
273 273
 /**
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
  **/
278 278
 function admin_valider() {
279 279
 
280
-	return ((!isset($GLOBALS['xhtml']) || $GLOBALS['xhtml'] !== 'true') ?
281
-		(parametre_url(self(), 'var_mode', 'debug', '&')
282
-			. '&var_mode_affiche=validation') :
283
-		('http://validator.w3.org/check?uri='
284
-			. rawurlencode('http://' . $_SERVER['HTTP_HOST'] . nettoyer_uri())));
280
+    return ((!isset($GLOBALS['xhtml']) || $GLOBALS['xhtml'] !== 'true') ?
281
+        (parametre_url(self(), 'var_mode', 'debug', '&')
282
+            . '&var_mode_affiche=validation') :
283
+        ('http://validator.w3.org/check?uri='
284
+            . rawurlencode('http://' . $_SERVER['HTTP_HOST'] . nettoyer_uri())));
285 285
 }
286 286
 
287 287
 /**
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
  * @return string
291 291
  **/
292 292
 function admin_debug() {
293
-	return (
294
-		(isset($GLOBALS['forcer_debug']) && $GLOBALS['forcer_debug']
295
-		|| isset($GLOBALS['bouton_admin_debug']) && $GLOBALS['bouton_admin_debug']
296
-		|| defined('_VAR_MODE') && _VAR_MODE == 'debug' && isset($_COOKIE['spip_debug']) && $_COOKIE['spip_debug']) && autoriser('debug')
297
-	)
298
-		? parametre_url(self(), 'var_mode', 'debug', '&') : '';
293
+    return (
294
+        (isset($GLOBALS['forcer_debug']) && $GLOBALS['forcer_debug']
295
+        || isset($GLOBALS['bouton_admin_debug']) && $GLOBALS['bouton_admin_debug']
296
+        || defined('_VAR_MODE') && _VAR_MODE == 'debug' && isset($_COOKIE['spip_debug']) && $_COOKIE['spip_debug']) && autoriser('debug')
297
+    )
298
+        ? parametre_url(self(), 'var_mode', 'debug', '&') : '';
299 299
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 				return '';
100 100
 			}
101 101
 			foreach ($debug['sourcefile'] as $k => $v) {
102
-				if (str_contains((string) $v, 'administration.') && isset($debug['resultat'][$k . 'tout'])) {
103
-					return $debug['resultat'][$k . 'tout'];
102
+				if (str_contains((string) $v, 'administration.') && isset($debug['resultat'][$k.'tout'])) {
103
+					return $debug['resultat'][$k.'tout'];
104 104
 				}
105 105
 			}
106 106
 
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 			&& ($id = (int) $id)
178 178
 			&& ($desc = $trouver_table(table_objet_sql($type)))
179 179
 		) {
180
-			$id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . (int) $id);
180
+			$id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".(int) $id);
181 181
 			if ($id) {
182 182
 				$env[$_id_type] = $id;
183 183
 				$env['objet'] = $type;
184 184
 				$env['id_objet'] = $id;
185
-				$env['voir_' . $obj] = str_replace('&', '&', (string) generer_objet_url($id, $obj, '', '', false));
185
+				$env['voir_'.$obj] = str_replace('&', '&', (string) generer_objet_url($id, $obj, '', '', false));
186 186
 				if (
187 187
 					isset($desc['field']['id_rubrique'])
188 188
 					&& $type != 'rubrique'
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	$notpub = sql_in('statut', ['prop', 'prive']);
236 236
 
237 237
 	if ($type == 'article' && $GLOBALS['meta']['post_dates'] != 'oui') {
238
-		$notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ')';
238
+		$notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).')';
239 239
 	}
240 240
 
241
-	return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . '=' . $id . " AND ($notpub)");
241
+	return sql_fetsel('1', table_objet_sql($type), id_table_objet($type).'='.$id." AND ($notpub)");
242 242
 }
243 243
 
244 244
 
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
 	$alang = '';
253 253
 	if (!empty($_COOKIE['spip_admin'])) {
254 254
 		$email_or_login = preg_replace(',^@,', '', (string) $_COOKIE['spip_admin']);
255
-		$alang = sql_getfetsel('lang', 'spip_auteurs', 'email=' . sql_quote($email_or_login));
255
+		$alang = sql_getfetsel('lang', 'spip_auteurs', 'email='.sql_quote($email_or_login));
256 256
 		if (!$alang) {
257
-			$alang = sql_getfetsel('lang', 'spip_auteurs', 'login=' . sql_quote($email_or_login));
257
+			$alang = sql_getfetsel('lang', 'spip_auteurs', 'login='.sql_quote($email_or_login));
258 258
 		}
259 259
 	}
260 260
 	if (!$alang) {
@@ -279,9 +279,8 @@  discard block
 block discarded – undo
279 279
 
280 280
 	return ((!isset($GLOBALS['xhtml']) || $GLOBALS['xhtml'] !== 'true') ?
281 281
 		(parametre_url(self(), 'var_mode', 'debug', '&')
282
-			. '&var_mode_affiche=validation') :
283
-		('http://validator.w3.org/check?uri='
284
-			. rawurlencode('http://' . $_SERVER['HTTP_HOST'] . nettoyer_uri())));
282
+			. '&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri='
283
+			. rawurlencode('http://'.$_SERVER['HTTP_HOST'].nettoyer_uri())));
285 284
 }
286 285
 
287 286
 /**
Please login to merge, or discard this patch.
ecrire/maj/legacy/v40.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * @package SPIP\Core\SQL\Upgrade
20 20
  **/
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 
@@ -34,49 +34,49 @@  discard block
 block discarded – undo
34 34
  **/
35 35
 function maj_timestamp_mysql($tables = null) {
36 36
 
37
-	include_spip('base/dump');
38
-	if (is_null($tables)) {
39
-		$tables = base_lister_toutes_tables();
40
-	} elseif (is_string($tables)) {
41
-		$tables = [$tables];
42
-	} elseif (!is_array($tables)) {
43
-		return;
44
-	}
37
+    include_spip('base/dump');
38
+    if (is_null($tables)) {
39
+        $tables = base_lister_toutes_tables();
40
+    } elseif (is_string($tables)) {
41
+        $tables = [$tables];
42
+    } elseif (!is_array($tables)) {
43
+        return;
44
+    }
45 45
 
46
-	// rien a faire si base non mysql
47
-	if (!str_starts_with((string) $GLOBALS['connexions'][0]['type'], 'mysql')) {
48
-		return;
49
-	}
46
+    // rien a faire si base non mysql
47
+    if (!str_starts_with((string) $GLOBALS['connexions'][0]['type'], 'mysql')) {
48
+        return;
49
+    }
50 50
 
51
-	$trouver_table = charger_fonction('trouver_table', 'base');
52
-	// forcer le vidage de cache
53
-	$trouver_table('');
51
+    $trouver_table = charger_fonction('trouver_table', 'base');
52
+    // forcer le vidage de cache
53
+    $trouver_table('');
54 54
 
55
-	foreach ($tables as $table) {
56
-		if (time() >= _TIME_OUT) {
57
-			return;
58
-		}
59
-		if ($desc = $trouver_table($table)) {
60
-			$fields_corrected = _mysql_remplacements_definitions_table($desc['field']);
61
-			$d = array_diff($desc['field'], $fields_corrected);
62
-			if ($d) {
63
-				spip_log("Table $table TIMESTAMP incorrect", 'maj');
64
-				foreach ($desc['field'] as $field => $type) {
65
-					if ($desc['field'][$field] !== $fields_corrected[$field]) {
66
-						spip_log("Adaptation TIMESTAMP table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
67
-						sql_alter("table $table change $field $field " . $fields_corrected[$field]);
68
-						$trouver_table('');
69
-						$new_desc = $trouver_table($table);
70
-						spip_log(
71
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
72
-							'maj.' . _LOG_INFO_IMPORTANTE
73
-						);
74
-					}
75
-				}
76
-			}
77
-		}
78
-	}
55
+    foreach ($tables as $table) {
56
+        if (time() >= _TIME_OUT) {
57
+            return;
58
+        }
59
+        if ($desc = $trouver_table($table)) {
60
+            $fields_corrected = _mysql_remplacements_definitions_table($desc['field']);
61
+            $d = array_diff($desc['field'], $fields_corrected);
62
+            if ($d) {
63
+                spip_log("Table $table TIMESTAMP incorrect", 'maj');
64
+                foreach ($desc['field'] as $field => $type) {
65
+                    if ($desc['field'][$field] !== $fields_corrected[$field]) {
66
+                        spip_log("Adaptation TIMESTAMP table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
67
+                        sql_alter("table $table change $field $field " . $fields_corrected[$field]);
68
+                        $trouver_table('');
69
+                        $new_desc = $trouver_table($table);
70
+                        spip_log(
71
+                            "Apres conversion $table : " . var_export($new_desc['field'], true),
72
+                            'maj.' . _LOG_INFO_IMPORTANTE
73
+                        );
74
+                    }
75
+                }
76
+            }
77
+        }
78
+    }
79 79
 
80
-	// forcer le vidage de cache
81
-	$trouver_table('');
80
+    // forcer le vidage de cache
81
+    $trouver_table('');
82 82
 }
Please login to merge, or discard this patch.
ecrire/maj/legacy/v21.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @package SPIP\Core\SQL\Upgrade
18 18
  **/
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('base/medias');
@@ -26,27 +26,27 @@  discard block
 block discarded – undo
26 26
 
27 27
 // http://archives.rezo.net/archives/spip-zone.mbox/C6RZKNBUNJYN42IOEOC4QKVCA233AMLI/
28 28
 $GLOBALS['maj'][13833] = [
29
-	['sql_alter', 'TABLE spip_documents_liens ADD INDEX objet(id_objet,objet)']
29
+    ['sql_alter', 'TABLE spip_documents_liens ADD INDEX objet(id_objet,objet)']
30 30
 ];
31 31
 
32 32
 // 2.1
33 33
 
34 34
 $GLOBALS['maj'][13904] = [
35
-	['sql_alter', "TABLE spip_auteurs ADD webmestre varchar(3)  DEFAULT 'non' NOT NULL"],
36
-	[
37
-		'sql_update',
38
-		'spip_auteurs',
39
-		['webmestre' => "'oui'"],
40
-		sql_in('id_auteur', defined('_ID_WEBMESTRES') ? explode(
41
-			':',
42
-			(string) _ID_WEBMESTRES
43
-		) : (autoriser('configurer') ? [$GLOBALS['visiteur_session']['id_auteur']] : [0]))
44
-	] // le webmestre est celui qui fait l'upgrade si rien de defini
35
+    ['sql_alter', "TABLE spip_auteurs ADD webmestre varchar(3)  DEFAULT 'non' NOT NULL"],
36
+    [
37
+        'sql_update',
38
+        'spip_auteurs',
39
+        ['webmestre' => "'oui'"],
40
+        sql_in('id_auteur', defined('_ID_WEBMESTRES') ? explode(
41
+            ':',
42
+            (string) _ID_WEBMESTRES
43
+        ) : (autoriser('configurer') ? [$GLOBALS['visiteur_session']['id_auteur']] : [0]))
44
+    ] // le webmestre est celui qui fait l'upgrade si rien de defini
45 45
 ];
46 46
 
47 47
 // sites plantes en mode "'su" au lieu de "sus"
48 48
 $GLOBALS['maj'][13929] = [
49
-	['sql_update', 'spip_syndic', ['syndication' => "'sus'"], "syndication LIKE '\\'%'"]
49
+    ['sql_update', 'spip_syndic', ['syndication' => "'sus'"], "syndication LIKE '\\'%'"]
50 50
 ];
51 51
 
52 52
 // Types de fichiers m4a/m4b/m4p/m4u/m4v/dv
@@ -60,24 +60,24 @@  discard block
 block discarded – undo
60 60
 // La version 14588 etait une mauvaise piste:
61 61
 // Retour en arriere pour ceux qui l'ont subi, ne rien faire sinon
62 62
 if (@$GLOBALS['meta']['version_installee'] >= 14588) {
63
-	// "mode" est un mot-cle d'Oracle
64
-	$GLOBALS['maj'][14588] = [
65
-		['sql_alter', 'TABLE spip_documents  DROP INDEX mode'],
66
-		[
67
-			'sql_alter',
68
-			"TABLE spip_documents  CHANGE mode genre ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"
69
-		],
70
-		['sql_alter', 'TABLE spip_documents  ADD INDEX genre(genre)']
71
-	];
72
-	// solution moins intrusive au pb de mot-cle d'Oracle, retour avant 14588
73
-	$GLOBALS['maj'][14598] = [
74
-		['sql_alter', 'TABLE spip_documents  DROP INDEX genre'],
75
-		[
76
-			'sql_alter',
77
-			"TABLE spip_documents  CHANGE genre mode ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"
78
-		],
79
-		['sql_alter', 'TABLE spip_documents  ADD INDEX mode(mode)']
80
-	];
63
+    // "mode" est un mot-cle d'Oracle
64
+    $GLOBALS['maj'][14588] = [
65
+        ['sql_alter', 'TABLE spip_documents  DROP INDEX mode'],
66
+        [
67
+            'sql_alter',
68
+            "TABLE spip_documents  CHANGE mode genre ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"
69
+        ],
70
+        ['sql_alter', 'TABLE spip_documents  ADD INDEX genre(genre)']
71
+    ];
72
+    // solution moins intrusive au pb de mot-cle d'Oracle, retour avant 14588
73
+    $GLOBALS['maj'][14598] = [
74
+        ['sql_alter', 'TABLE spip_documents  DROP INDEX genre'],
75
+        [
76
+            'sql_alter',
77
+            "TABLE spip_documents  CHANGE genre mode ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"
78
+        ],
79
+        ['sql_alter', 'TABLE spip_documents  ADD INDEX mode(mode)']
80
+    ];
81 81
 }
82 82
 
83 83
 // Restauration correcte des types mime des fichiers Ogg
Please login to merge, or discard this patch.
ecrire/maj/legacy/v30.php 2 patches
Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
  * @package SPIP\Core\SQL\Upgrade
18 18
  **/
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 
24 24
 $GLOBALS['maj'][16428] = [
25
-	['maj_liens', 'auteur'], // creer la table liens
26
-	['maj_liens', 'auteur', 'article'],
27
-	['sql_drop_table', 'spip_auteurs_articles'],
28
-	['maj_liens', 'auteur', 'rubrique'],
29
-	['sql_drop_table', 'spip_auteurs_rubriques'],
30
-	['maj_liens', 'auteur', 'message'],
31
-	['sql_drop_table', 'spip_auteurs_messages'],
25
+    ['maj_liens', 'auteur'], // creer la table liens
26
+    ['maj_liens', 'auteur', 'article'],
27
+    ['sql_drop_table', 'spip_auteurs_articles'],
28
+    ['maj_liens', 'auteur', 'rubrique'],
29
+    ['sql_drop_table', 'spip_auteurs_rubriques'],
30
+    ['maj_liens', 'auteur', 'message'],
31
+    ['sql_drop_table', 'spip_auteurs_messages'],
32 32
 ];
33 33
 
34 34
 /**
@@ -54,89 +54,89 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function maj_liens($pivot, $l = '') {
56 56
 
57
-	@define('_LOG_FILTRE_GRAVITE', 8);
58
-
59
-	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
60
-
61
-	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
62
-	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's');
63
-	$liens = 'spip_' . $pivots . '_liens';
64
-	$id_pivot = 'id_' . $pivot;
65
-	// Creer spip_auteurs_liens
66
-	global $tables_auxiliaires;
67
-	if (!$l) {
68
-		include_spip('base/auxiliaires');
69
-		include_spip('base/create');
70
-		creer_ou_upgrader_table($liens, $tables_auxiliaires[$liens], false);
71
-	} else {
72
-		// Preparer
73
-		$l = preg_replace(',[^\w],', '', $l); // securite
74
-		$primary = "id_$l";
75
-		$objet = ($l == 'syndic' ? 'site' : $l);
76
-		$ls = ($exceptions_pluriel[$l] ?? $l . 's');
77
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
78
-		$pool = 400;
79
-
80
-		$trouver_table = charger_fonction('trouver_table', 'base');
81
-		if (!$desc = $trouver_table($ancienne_table)) {
82
-			return;
83
-		}
84
-
85
-		// securite pour ne pas perdre de donnees
86
-		if (!$trouver_table($liens)) {
87
-			return;
88
-		}
89
-
90
-		$champs = $desc['field'];
91
-		if (isset($champs['maj'])) {
92
-			unset($champs['maj']);
93
-		}
94
-		if (isset($champs[$primary])) {
95
-			unset($champs[$primary]);
96
-		}
97
-
98
-		$champs = array_keys($champs);
99
-		// ne garder que les champs qui existent sur la table destination
100
-		if ($desc_cible = $trouver_table($liens)) {
101
-			$champs = array_intersect($champs, array_keys($desc_cible['field']));
102
-		}
103
-
104
-		$champs[] = "$primary as id_objet";
105
-		$champs[] = "'$objet' as objet";
106
-		$champs = implode(', ', $champs);
107
-
108
-		// Recopier les donnees
109
-		$sub_pool = 100;
110
-		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
111
-			$insert = [];
112
-			foreach ($ids as $id) {
113
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . (int) $id);
114
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . (int) $id, '', $id_pivot, "$n,$pool")) {
115
-					$n += is_countable($t) ? count($t) : 0;
116
-					// empiler en s'assurant a minima de l'unicite
117
-					while ($r = array_shift($t)) {
118
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
-					}
120
-					if (count($insert) >= $sub_pool) {
121
-						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
122
-						$insert = [];
123
-					}
124
-					// si timeout, sortir, la relance nous ramenera dans cette fonction
125
-					// et on verifiera/repartira de la
126
-					if (time() >= _TIME_OUT) {
127
-						return;
128
-					}
129
-				}
130
-				if (time() >= _TIME_OUT) {
131
-					return;
132
-				}
133
-			}
134
-			if ($insert !== []) {
135
-				maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
136
-			}
137
-			sql_delete($ancienne_table, sql_in($primary, $ids));
138
-		}
139
-	}
57
+    @define('_LOG_FILTRE_GRAVITE', 8);
58
+
59
+    $exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
60
+
61
+    $pivot = preg_replace(',[^\w],', '', $pivot); // securite
62
+    $pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's');
63
+    $liens = 'spip_' . $pivots . '_liens';
64
+    $id_pivot = 'id_' . $pivot;
65
+    // Creer spip_auteurs_liens
66
+    global $tables_auxiliaires;
67
+    if (!$l) {
68
+        include_spip('base/auxiliaires');
69
+        include_spip('base/create');
70
+        creer_ou_upgrader_table($liens, $tables_auxiliaires[$liens], false);
71
+    } else {
72
+        // Preparer
73
+        $l = preg_replace(',[^\w],', '', $l); // securite
74
+        $primary = "id_$l";
75
+        $objet = ($l == 'syndic' ? 'site' : $l);
76
+        $ls = ($exceptions_pluriel[$l] ?? $l . 's');
77
+        $ancienne_table = 'spip_' . $pivots . '_' . $ls;
78
+        $pool = 400;
79
+
80
+        $trouver_table = charger_fonction('trouver_table', 'base');
81
+        if (!$desc = $trouver_table($ancienne_table)) {
82
+            return;
83
+        }
84
+
85
+        // securite pour ne pas perdre de donnees
86
+        if (!$trouver_table($liens)) {
87
+            return;
88
+        }
89
+
90
+        $champs = $desc['field'];
91
+        if (isset($champs['maj'])) {
92
+            unset($champs['maj']);
93
+        }
94
+        if (isset($champs[$primary])) {
95
+            unset($champs[$primary]);
96
+        }
97
+
98
+        $champs = array_keys($champs);
99
+        // ne garder que les champs qui existent sur la table destination
100
+        if ($desc_cible = $trouver_table($liens)) {
101
+            $champs = array_intersect($champs, array_keys($desc_cible['field']));
102
+        }
103
+
104
+        $champs[] = "$primary as id_objet";
105
+        $champs[] = "'$objet' as objet";
106
+        $champs = implode(', ', $champs);
107
+
108
+        // Recopier les donnees
109
+        $sub_pool = 100;
110
+        while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
111
+            $insert = [];
112
+            foreach ($ids as $id) {
113
+                $n = sql_countsel($liens, "objet='$objet' AND id_objet=" . (int) $id);
114
+                while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . (int) $id, '', $id_pivot, "$n,$pool")) {
115
+                    $n += is_countable($t) ? count($t) : 0;
116
+                    // empiler en s'assurant a minima de l'unicite
117
+                    while ($r = array_shift($t)) {
118
+                        $insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
+                    }
120
+                    if (count($insert) >= $sub_pool) {
121
+                        maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
122
+                        $insert = [];
123
+                    }
124
+                    // si timeout, sortir, la relance nous ramenera dans cette fonction
125
+                    // et on verifiera/repartira de la
126
+                    if (time() >= _TIME_OUT) {
127
+                        return;
128
+                    }
129
+                }
130
+                if (time() >= _TIME_OUT) {
131
+                    return;
132
+                }
133
+            }
134
+            if ($insert !== []) {
135
+                maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
136
+            }
137
+            sql_delete($ancienne_table, sql_in($primary, $ids));
138
+        }
139
+    }
140 140
 }
141 141
 
142 142
 /**
@@ -150,86 +150,86 @@  discard block
 block discarded – undo
150 150
  * @return void
151 151
  **/
152 152
 function maj_liens_insertq_multi_check($table, $couples, $desc = []) {
153
-	$n_before = sql_countsel($table);
154
-	sql_insertq_multi($table, $couples, $desc);
155
-	$n_after = sql_countsel($table);
156
-	if (($n_after - $n_before) == count($couples)) {
157
-		return;
158
-	}
159
-	// si ecart, on recommence l'insertion ligne par ligne...
160
-	// moins rapide mais secure : seul le couple en doublon echouera, et non toute la serie
161
-	foreach ($couples as $c) {
162
-		sql_insertq($table, $c, $desc);
163
-	}
153
+    $n_before = sql_countsel($table);
154
+    sql_insertq_multi($table, $couples, $desc);
155
+    $n_after = sql_countsel($table);
156
+    if (($n_after - $n_before) == count($couples)) {
157
+        return;
158
+    }
159
+    // si ecart, on recommence l'insertion ligne par ligne...
160
+    // moins rapide mais secure : seul le couple en doublon echouera, et non toute la serie
161
+    foreach ($couples as $c) {
162
+        sql_insertq($table, $c, $desc);
163
+    }
164 164
 }
165 165
 
166 166
 $GLOBALS['maj'][17311] = [
167
-	[
168
-		'ecrire_meta',
169
-		'multi_objets',
170
-		implode(
171
-			',',
172
-			array_diff(
173
-				[
174
-					(isset($GLOBALS['meta']['multi_rubriques']) && $GLOBALS['meta']['multi_rubriques'] == 'oui')
175
-						? 'spip_rubriques' : '',
176
-					(isset($GLOBALS['meta']['multi_articles']) && $GLOBALS['meta']['multi_articles'] == 'oui')
177
-						? 'spip_articles' : ''
178
-				],
179
-				['']
180
-			)
181
-		)
182
-	],
183
-	[
184
-		'ecrire_meta',
185
-		'gerer_trad_objets',
186
-		implode(
187
-			',',
188
-			array_diff(
189
-				[
190
-					(isset($GLOBALS['meta']['gerer_trad']) && $GLOBALS['meta']['gerer_trad'] == 'oui')
191
-						? 'spip_articles' : ''
192
-				],
193
-				['']
194
-			)
195
-		)
196
-	],
167
+    [
168
+        'ecrire_meta',
169
+        'multi_objets',
170
+        implode(
171
+            ',',
172
+            array_diff(
173
+                [
174
+                    (isset($GLOBALS['meta']['multi_rubriques']) && $GLOBALS['meta']['multi_rubriques'] == 'oui')
175
+                        ? 'spip_rubriques' : '',
176
+                    (isset($GLOBALS['meta']['multi_articles']) && $GLOBALS['meta']['multi_articles'] == 'oui')
177
+                        ? 'spip_articles' : ''
178
+                ],
179
+                ['']
180
+            )
181
+        )
182
+    ],
183
+    [
184
+        'ecrire_meta',
185
+        'gerer_trad_objets',
186
+        implode(
187
+            ',',
188
+            array_diff(
189
+                [
190
+                    (isset($GLOBALS['meta']['gerer_trad']) && $GLOBALS['meta']['gerer_trad'] == 'oui')
191
+                        ? 'spip_articles' : ''
192
+                ],
193
+                ['']
194
+            )
195
+        )
196
+    ],
197 197
 ];
198 198
 $GLOBALS['maj'][17555] = [
199
-	['sql_alter', "TABLE spip_resultats ADD table_objet varchar(30) DEFAULT '' NOT NULL"],
200
-	['sql_alter', "TABLE spip_resultats ADD serveur char(16) DEFAULT '' NOT NULL"],
199
+    ['sql_alter', "TABLE spip_resultats ADD table_objet varchar(30) DEFAULT '' NOT NULL"],
200
+    ['sql_alter', "TABLE spip_resultats ADD serveur char(16) DEFAULT '' NOT NULL"],
201 201
 ];
202 202
 
203 203
 $GLOBALS['maj'][17563] = [
204
-	['sql_alter', "TABLE spip_articles ADD virtuel VARCHAR(255) DEFAULT '' NOT NULL"],
205
-	['sql_update', 'spip_articles', ['virtuel' => 'SUBSTRING(chapo,2)', 'chapo' => "''"], "chapo LIKE '=_%'"],
204
+    ['sql_alter', "TABLE spip_articles ADD virtuel VARCHAR(255) DEFAULT '' NOT NULL"],
205
+    ['sql_update', 'spip_articles', ['virtuel' => 'SUBSTRING(chapo,2)', 'chapo' => "''"], "chapo LIKE '=_%'"],
206 206
 ];
207 207
 
208 208
 $GLOBALS['maj'][17577] = [
209
-	['maj_tables', ['spip_jobs', 'spip_jobs_liens']],
209
+    ['maj_tables', ['spip_jobs', 'spip_jobs_liens']],
210 210
 ];
211 211
 
212 212
 $GLOBALS['maj'][17743] = [
213
-	['sql_update', 'spip_auteurs', ['prefs' => 'bio', 'bio' => "''"], "statut='nouveau' AND bio<>''"],
213
+    ['sql_update', 'spip_auteurs', ['prefs' => 'bio', 'bio' => "''"], "statut='nouveau' AND bio<>''"],
214 214
 ];
215 215
 
216 216
 $GLOBALS['maj'][18219] = [
217
-	['sql_alter', 'TABLE spip_rubriques DROP id_import'],
218
-	['sql_alter', 'TABLE spip_rubriques DROP export'],
217
+    ['sql_alter', 'TABLE spip_rubriques DROP id_import'],
218
+    ['sql_alter', 'TABLE spip_rubriques DROP export'],
219 219
 ];
220 220
 
221 221
 $GLOBALS['maj'][18310] = [
222
-	['sql_alter', "TABLE spip_auteurs_liens CHANGE vu vu VARCHAR(6) DEFAULT 'non' NOT NULL"],
222
+    ['sql_alter', "TABLE spip_auteurs_liens CHANGE vu vu VARCHAR(6) DEFAULT 'non' NOT NULL"],
223 223
 ];
224 224
 
225 225
 $GLOBALS['maj'][18597] = [
226
-	['sql_alter', "TABLE spip_rubriques ADD profondeur smallint(5) DEFAULT '0' NOT NULL"],
227
-	['maj_propager_les_secteurs'],
226
+    ['sql_alter', "TABLE spip_rubriques ADD profondeur smallint(5) DEFAULT '0' NOT NULL"],
227
+    ['maj_propager_les_secteurs'],
228 228
 ];
229 229
 
230 230
 $GLOBALS['maj'][18955] = [
231
-	['sql_alter', 'TABLE spip_auteurs_liens ADD INDEX id_objet (id_objet)'],
232
-	['sql_alter', 'TABLE spip_auteurs_liens ADD INDEX objet (objet)'],
231
+    ['sql_alter', 'TABLE spip_auteurs_liens ADD INDEX id_objet (id_objet)'],
232
+    ['sql_alter', 'TABLE spip_auteurs_liens ADD INDEX objet (objet)'],
233 233
 ];
234 234
 
235 235
 /**
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
  * @uses propager_les_secteurs()
239 239
  **/
240 240
 function maj_propager_les_secteurs() {
241
-	include_spip('inc/rubriques');
242
-	propager_les_secteurs();
241
+    include_spip('inc/rubriques');
242
+    propager_les_secteurs();
243 243
 }
244 244
 
245 245
 /**
@@ -252,87 +252,87 @@  discard block
 block discarded – undo
252 252
 function maj_collation_sqlite() {
253 253
 
254 254
 
255
-	include_spip('base/dump');
256
-	$tables = base_lister_toutes_tables();
257
-
258
-	// rien a faire si base non sqlite
259
-	if (!str_starts_with((string) $GLOBALS['connexions'][0]['type'], 'sqlite')) {
260
-		return;
261
-	}
262
-
263
-	$trouver_table = charger_fonction('trouver_table', 'base');
264
-	// forcer le vidage de cache
265
-	$trouver_table('');
266
-
267
-	// cas particulier spip_auteurs : retablir le collate binary sur le login
268
-	$desc = $trouver_table('spip_auteurs');
269
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
-	if (stripos((string) $desc['field']['login'], 'BINARY') === false) {
271
-		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
272
-		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
273
-		$trouver_table('');
274
-		$new_desc = $trouver_table('spip_auteurs');
275
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
-	}
277
-
278
-	foreach ($tables as $table) {
279
-		if (time() >= _TIME_OUT) {
280
-			return;
281
-		}
282
-		if ($desc = $trouver_table($table)) {
283
-			$desc_collate = _sqlite_remplacements_definitions_table($desc['field']);
284
-			if ($d = array_diff($desc['field'], $desc_collate)) {
285
-				spip_log("Table $table COLLATE incorrects", 'maj');
286
-
287
-				// cas particulier spip_urls :
288
-				// supprimer les doublons avant conversion sinon echec (on garde les urls les plus recentes)
289
-				if ($table == 'spip_urls') {
290
-					// par date DESC pour conserver les urls les plus recentes
291
-					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
292
-					$urls = [];
293
-					foreach ($data as $d) {
294
-						$key = $d['id_parent'] . '::' . strtolower((string) $d['url']);
295
-						if (!isset($urls[$key])) {
296
-							$urls[$key] = true;
297
-						} else {
298
-							spip_log(
299
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
300
-								'maj.' . _LOG_INFO_IMPORTANTE
301
-							);
302
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
-						}
304
-					}
305
-				}
306
-				foreach ($desc['field'] as $field => $type) {
307
-					if ($desc['field'][$field] !== $desc_collate[$field]) {
308
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
309
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
310
-						$trouver_table('');
311
-						$new_desc = $trouver_table($table);
312
-						spip_log(
313
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
314
-							'maj.' . _LOG_INFO_IMPORTANTE
315
-						);
316
-						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
317
-					}
318
-				}
319
-			}
320
-		}
321
-	}
322
-
323
-	// forcer le vidage de cache
324
-	$trouver_table('');
255
+    include_spip('base/dump');
256
+    $tables = base_lister_toutes_tables();
257
+
258
+    // rien a faire si base non sqlite
259
+    if (!str_starts_with((string) $GLOBALS['connexions'][0]['type'], 'sqlite')) {
260
+        return;
261
+    }
262
+
263
+    $trouver_table = charger_fonction('trouver_table', 'base');
264
+    // forcer le vidage de cache
265
+    $trouver_table('');
266
+
267
+    // cas particulier spip_auteurs : retablir le collate binary sur le login
268
+    $desc = $trouver_table('spip_auteurs');
269
+    spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
+    if (stripos((string) $desc['field']['login'], 'BINARY') === false) {
271
+        spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
272
+        sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
273
+        $trouver_table('');
274
+        $new_desc = $trouver_table('spip_auteurs');
275
+        spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
+    }
277
+
278
+    foreach ($tables as $table) {
279
+        if (time() >= _TIME_OUT) {
280
+            return;
281
+        }
282
+        if ($desc = $trouver_table($table)) {
283
+            $desc_collate = _sqlite_remplacements_definitions_table($desc['field']);
284
+            if ($d = array_diff($desc['field'], $desc_collate)) {
285
+                spip_log("Table $table COLLATE incorrects", 'maj');
286
+
287
+                // cas particulier spip_urls :
288
+                // supprimer les doublons avant conversion sinon echec (on garde les urls les plus recentes)
289
+                if ($table == 'spip_urls') {
290
+                    // par date DESC pour conserver les urls les plus recentes
291
+                    $data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
292
+                    $urls = [];
293
+                    foreach ($data as $d) {
294
+                        $key = $d['id_parent'] . '::' . strtolower((string) $d['url']);
295
+                        if (!isset($urls[$key])) {
296
+                            $urls[$key] = true;
297
+                        } else {
298
+                            spip_log(
299
+                                'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
300
+                                'maj.' . _LOG_INFO_IMPORTANTE
301
+                            );
302
+                            sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
+                        }
304
+                    }
305
+                }
306
+                foreach ($desc['field'] as $field => $type) {
307
+                    if ($desc['field'][$field] !== $desc_collate[$field]) {
308
+                        spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
309
+                        sql_alter("table $table change $field $field " . $desc_collate[$field]);
310
+                        $trouver_table('');
311
+                        $new_desc = $trouver_table($table);
312
+                        spip_log(
313
+                            "Apres conversion $table : " . var_export($new_desc['field'], true),
314
+                            'maj.' . _LOG_INFO_IMPORTANTE
315
+                        );
316
+                        continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
317
+                    }
318
+                }
319
+            }
320
+        }
321
+    }
322
+
323
+    // forcer le vidage de cache
324
+    $trouver_table('');
325 325
 }
326 326
 
327 327
 
328 328
 $GLOBALS['maj'][19236] = [
329
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
330
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
-	['maj_collation_sqlite'],
329
+    ['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
330
+    ['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
+    ['maj_collation_sqlite'],
332 332
 ];
333 333
 
334 334
 $GLOBALS['maj'][19268] = [
335
-	['supprimer_toutes_sessions'],
335
+    ['supprimer_toutes_sessions'],
336 336
 ];
337 337
 
338 338
 /**
@@ -341,13 +341,13 @@  discard block
 block discarded – undo
341 341
  * Obligera tous les auteurs à se reconnecter !
342 342
  **/
343 343
 function supprimer_toutes_sessions() {
344
-	spip_log('supprimer sessions auteur');
345
-	if ($dir = opendir(_DIR_SESSIONS)) {
346
-		while (($f = readdir($dir)) !== false) {
347
-			spip_unlink(_DIR_SESSIONS . $f);
348
-			if (time() >= _TIME_OUT) {
349
-				return;
350
-			}
351
-		}
352
-	}
344
+    spip_log('supprimer sessions auteur');
345
+    if ($dir = opendir(_DIR_SESSIONS)) {
346
+        while (($f = readdir($dir)) !== false) {
347
+            spip_unlink(_DIR_SESSIONS . $f);
348
+            if (time() >= _TIME_OUT) {
349
+                return;
350
+            }
351
+        }
352
+    }
353 353
 }
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
60 60
 
61 61
 	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
62
-	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's');
63
-	$liens = 'spip_' . $pivots . '_liens';
64
-	$id_pivot = 'id_' . $pivot;
62
+	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot.'s');
63
+	$liens = 'spip_'.$pivots.'_liens';
64
+	$id_pivot = 'id_'.$pivot;
65 65
 	// Creer spip_auteurs_liens
66 66
 	global $tables_auxiliaires;
67 67
 	if (!$l) {
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 		$l = preg_replace(',[^\w],', '', $l); // securite
74 74
 		$primary = "id_$l";
75 75
 		$objet = ($l == 'syndic' ? 'site' : $l);
76
-		$ls = ($exceptions_pluriel[$l] ?? $l . 's');
77
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
76
+		$ls = ($exceptions_pluriel[$l] ?? $l.'s');
77
+		$ancienne_table = 'spip_'.$pivots.'_'.$ls;
78 78
 		$pool = 400;
79 79
 
80 80
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
111 111
 			$insert = [];
112 112
 			foreach ($ids as $id) {
113
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . (int) $id);
114
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . (int) $id, '', $id_pivot, "$n,$pool")) {
113
+				$n = sql_countsel($liens, "objet='$objet' AND id_objet=".(int) $id);
114
+				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".(int) $id, '', $id_pivot, "$n,$pool")) {
115 115
 					$n += is_countable($t) ? count($t) : 0;
116 116
 					// empiler en s'assurant a minima de l'unicite
117 117
 					while ($r = array_shift($t)) {
118
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
118
+						$insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
119 119
 					}
120 120
 					if (count($insert) >= $sub_pool) {
121 121
 						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
 
267 267
 	// cas particulier spip_auteurs : retablir le collate binary sur le login
268 268
 	$desc = $trouver_table('spip_auteurs');
269
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
269
+	spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
270 270
 	if (stripos((string) $desc['field']['login'], 'BINARY') === false) {
271 271
 		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
272 272
 		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
273 273
 		$trouver_table('');
274 274
 		$new_desc = $trouver_table('spip_auteurs');
275
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
275
+		spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
276 276
 	}
277 277
 
278 278
 	foreach ($tables as $table) {
@@ -291,27 +291,27 @@  discard block
 block discarded – undo
291 291
 					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
292 292
 					$urls = [];
293 293
 					foreach ($data as $d) {
294
-						$key = $d['id_parent'] . '::' . strtolower((string) $d['url']);
294
+						$key = $d['id_parent'].'::'.strtolower((string) $d['url']);
295 295
 						if (!isset($urls[$key])) {
296 296
 							$urls[$key] = true;
297 297
 						} else {
298 298
 							spip_log(
299
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
300
-								'maj.' . _LOG_INFO_IMPORTANTE
299
+								'Suppression doublon dans spip_urls avant conversion : '.serialize($d),
300
+								'maj.'._LOG_INFO_IMPORTANTE
301 301
 							);
302
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
302
+							sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url']));
303 303
 						}
304 304
 					}
305 305
 				}
306 306
 				foreach ($desc['field'] as $field => $type) {
307 307
 					if ($desc['field'][$field] !== $desc_collate[$field]) {
308
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
309
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
308
+						spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE);
309
+						sql_alter("table $table change $field $field ".$desc_collate[$field]);
310 310
 						$trouver_table('');
311 311
 						$new_desc = $trouver_table($table);
312 312
 						spip_log(
313
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
314
-							'maj.' . _LOG_INFO_IMPORTANTE
313
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
314
+							'maj.'._LOG_INFO_IMPORTANTE
315 315
 						);
316 316
 						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
317 317
 					}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
 $GLOBALS['maj'][19236] = [
329 329
 	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
330
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
330
+	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins
331 331
 	['maj_collation_sqlite'],
332 332
 ];
333 333
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	spip_log('supprimer sessions auteur');
345 345
 	if ($dir = opendir(_DIR_SESSIONS)) {
346 346
 		while (($f = readdir($dir)) !== false) {
347
-			spip_unlink(_DIR_SESSIONS . $f);
347
+			spip_unlink(_DIR_SESSIONS.$f);
348 348
 			if (time() >= _TIME_OUT) {
349 349
 				return;
350 350
 			}
Please login to merge, or discard this patch.