Completed
Push — master ( 2056af...6c9939 )
by cam
01:09
created
ecrire/exec/upgrade.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			. '</b><p> '
45 45
 			. _T(
46 46
 				'texte_nouvelle_version_spip_2',
47
-				['connect' => '<tt>' . _FILE_CONNECT . '</tt>']
47
+				['connect' => '<tt>'._FILE_CONNECT.'</tt>']
48 48
 			)
49 49
 			. generer_form_ecrire(
50 50
 				'upgrade',
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			$GLOBALS['meta']['version_installee'] = 0.0;
66 66
 		} else {
67 67
 			$GLOBALS['meta']['version_installee'] =
68
-				(double)str_replace(',', '.', $GLOBALS['meta']['version_installee']);
68
+				(double) str_replace(',', '.', $GLOBALS['meta']['version_installee']);
69 69
 		}
70 70
 		# NB: str_replace car, sur club-internet, il semble que version_installe soit
71 71
 		# enregistree au format '1,812' et non '1.812'
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			$commentaire = _T('texte_mise_a_niveau_base_1');
80 80
 		}
81 81
 
82
-		$commentaire .= '<br />[' . $GLOBALS['meta']['version_installee'] . '/' . $GLOBALS['spip_version_base'] . ']';
82
+		$commentaire .= '<br />['.$GLOBALS['meta']['version_installee'].'/'.$GLOBALS['spip_version_base'].']';
83 83
 
84 84
 		$_POST['reinstall'] = 'non'; // pour copy_request dans admin
85 85
 		include_spip('inc/headers');
Please login to merge, or discard this patch.
ecrire/exec/admin_plugin.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 	if ($quoi !== 'actifs') {
145 145
 		$lpf = liste_plugin_files();
146 146
 		if ($lpf) {
147
-			echo '<p>' . _T('texte_presente_plugin') . '</p>';
147
+			echo '<p>'._T('texte_presente_plugin').'</p>';
148 148
 		} else {
149 149
 			if (!@is_dir(_DIR_PLUGINS)) {
150
-				echo '<p>' . _T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)])
151
-					. ' &mdash; ' . _T('plugin_info_automatique_creer') . '</p>';
150
+				echo '<p>'._T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)])
151
+					. ' &mdash; '._T('plugin_info_automatique_creer').'</p>';
152 152
 			}
153 153
 		}
154 154
 		$lcpaffiche = $lpf;
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 		if (defined('_DIR_PLUGINS_SUPPL')) {
170 170
 			$nb += count($lcpas);
171 171
 		}
172
-		echo '<h3>' . sinon(
172
+		echo '<h3>'.sinon(
173 173
 			singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'),
174 174
 			_T('plugins_actif_aucun')
175
-		) . '</h3>';
175
+		).'</h3>';
176 176
 	}
177 177
 
178 178
 	if (empty($format)) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 	if ($corps) {
191 191
 		$corps .= "\n<div class='boutons' style='display:none;'>"
192
-			. "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer')
192
+			. "<input type='submit' class='submit save' value='"._T('bouton_enregistrer')
193 193
 			. "' />"
194 194
 			. '</div>';
195 195
 	}
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 		. debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist')
264 264
 		. '<p>'
265 265
 		. _T('plugin_info_plugins_dist_1', ['plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST)])
266
-		. '<br />' . _T('plugin_info_plugins_dist_2')
266
+		. '<br />'._T('plugin_info_plugins_dist_2')
267 267
 		. '</p>'
268 268
 		. $liste
269 269
 		. fin_cadre_trait_couleur(true)
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	$res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees'));
287 287
 	$res .= '<dl>';
288 288
 	foreach ($libs as $lib => $rep) {
289
-		$res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n";
289
+		$res .= "<dt>$lib</dt><dd>".joli_repertoire($rep)."</dd>\n";
290 290
 	}
291 291
 	$res .= '</dl>';
292 292
 	$res .= fin_cadre_enfonce(true);
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	$libs = [];
306 306
 	foreach (array_reverse(creer_chemin()) as $d) {
307 307
 		if (
308
-			is_dir($dir = $d . 'lib/')
308
+			is_dir($dir = $d.'lib/')
309 309
 			and $t = opendir($dir)
310 310
 		) {
311 311
 			while (($f = readdir($t)) !== false) {
Please login to merge, or discard this patch.
ecrire/exec/base_delete_all.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@
 block discarded – undo
36 36
 			spip_log('Erreur base de donnees');
37 37
 			echo minipres(
38 38
 				_T('info_travaux_titre'),
39
-				_T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>'
39
+				_T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>'
40 40
 			);
41 41
 		} else {
42 42
 			$res = base_saisie_tables('delete', $res);
43 43
 			include_spip('inc/headers');
44
-			$res = "\n<ol style='text-align:left'><li>\n" .
45
-				join("</li>\n<li>", $res) .
44
+			$res = "\n<ol style='text-align:left'><li>\n".
45
+				join("</li>\n<li>", $res).
46 46
 				'</li></ol>';
47 47
 			$admin = charger_fonction('admin', 'inc');
48 48
 			$res = $admin('delete_all', _T('titre_page_delete_all'), $res);
Please login to merge, or discard this patch.
ecrire/exec/fond.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
 
28 28
 $fond = _request('exec');
29
-$GLOBALS['delais'] = 0;// pas de cache !
29
+$GLOBALS['delais'] = 0; // pas de cache !
30 30
 // Securite
31 31
 if (strstr($fond, '/')) {
32 32
 	if (
Please login to merge, or discard this patch.
ecrire/req/pg.exp.php 1 patch
Spacing   +83 added lines, -84 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	if (!$link) {
66 66
 		$erreurs[] = pg_last_error();
67 67
 		foreach ($erreurs as $e) {
68
-			spip_log('Echec pg_connect. Erreur : ' . $e, 'pg.' . _LOG_HS);
68
+			spip_log('Echec pg_connect. Erreur : '.$e, 'pg.'._LOG_HS);
69 69
 		}
70 70
 
71 71
 		return false;
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 	}
84 84
 
85 85
 	spip_log(
86
-		"Connexion vers $host, base $db, prefixe $prefixe " . ($link ? 'operationnelle' : 'impossible'),
87
-		'pg.' . _LOG_DEBUG
86
+		"Connexion vers $host, base $db, prefixe $prefixe ".($link ? 'operationnelle' : 'impossible'),
87
+		'pg.'._LOG_DEBUG
88 88
 	);
89 89
 
90 90
 	return !$link ? false : [
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	} else {
175 175
 		$suite = '';
176 176
 	}
177
-	$query = preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
177
+	$query = preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite;
178 178
 
179 179
 	// renvoyer la requete inerte si demandee
180 180
 	if (!$requeter) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	// ou revoir l'api de sql_alter en creant un
244 244
 	// sql_alter_table($table,array($actions));
245 245
 	if (!preg_match('/\s*((\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) {
246
-		spip_log("$query mal comprise", 'pg.' . _LOG_ERREUR);
246
+		spip_log("$query mal comprise", 'pg.'._LOG_ERREUR);
247 247
 
248 248
 		return false;
249 249
 	}
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	$i = 0;
257 257
 	$ouverte = false;
258 258
 	while ($do = array_shift($todo)) {
259
-		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
259
+		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i].','.$do : $do;
260 260
 		$o = (false !== strpos($do, '('));
261 261
 		$f = (false !== strpos($do, ')'));
262 262
 		if ($o and !$f) {
@@ -269,34 +269,34 @@  discard block
 block discarded – undo
269 269
 		}
270 270
 	}
271 271
 	$todo = $todo2;
272
-	$query = $debut . ' ' . array_shift($todo);
272
+	$query = $debut.' '.array_shift($todo);
273 273
 
274 274
 	if (!preg_match('/^\s*(IGNORE\s*)?TABLE\s+(\w+)\s+(ADD|DROP|CHANGE|MODIFY|RENAME)\s*(.*)$/is', $query, $r)) {
275
-		spip_log("$query incompris", 'pg.' . _LOG_ERREUR);
275
+		spip_log("$query incompris", 'pg.'._LOG_ERREUR);
276 276
 	} else {
277 277
 		if ($r[1]) {
278
-			spip_log("j'ignore IGNORE dans $query", 'pg.' . _LOG_AVERTISSEMENT);
278
+			spip_log("j'ignore IGNORE dans $query", 'pg.'._LOG_AVERTISSEMENT);
279 279
 		}
280
-		$f = 'spip_pg_alter_' . strtolower($r[3]);
280
+		$f = 'spip_pg_alter_'.strtolower($r[3]);
281 281
 		if (function_exists($f)) {
282 282
 			$f($r[2], $r[4], $serveur, $requeter);
283 283
 		} else {
284
-			spip_log("$query non prevu", 'pg.' . _LOG_ERREUR);
284
+			spip_log("$query non prevu", 'pg.'._LOG_ERREUR);
285 285
 		}
286 286
 	}
287 287
 	// Alter a plusieurs args. Faudrait optimiser.
288 288
 	if ($todo) {
289
-		spip_pg_alter("TABLE $table " . join(',', $todo));
289
+		spip_pg_alter("TABLE $table ".join(',', $todo));
290 290
 	}
291 291
 }
292 292
 
293 293
 // https://code.spip.net/@spip_pg_alter_change
294 294
 function spip_pg_alter_change($table, $arg, $serveur = '', $requeter = true) {
295 295
 	if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) {
296
-		spip_log("alter change: $arg  incompris", 'pg.' . _LOG_ERREUR);
296
+		spip_log("alter change: $arg  incompris", 'pg.'._LOG_ERREUR);
297 297
 	} else {
298 298
 		list(, $old, $new, $type, $default, $null, $def2) = $r;
299
-		$actions = ["ALTER $old TYPE " . mysql2pg_type($type)];
299
+		$actions = ["ALTER $old TYPE ".mysql2pg_type($type)];
300 300
 		if ($null) {
301 301
 			$actions[] = "ALTER $old SET NOT NULL";
302 302
 		} else {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 			$actions[] = "ALTER $old DROP DEFAULT";
310 310
 		}
311 311
 
312
-		spip_pg_query("ALTER TABLE $table " . join(', ', $actions));
312
+		spip_pg_query("ALTER TABLE $table ".join(', ', $actions));
313 313
 
314 314
 		if ($old != $new) {
315 315
 			spip_pg_query("ALTER TABLE $table RENAME $old TO $new", $serveur);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 // https://code.spip.net/@spip_pg_alter_add
321 321
 function spip_pg_alter_add($table, $arg, $serveur = '', $requeter = true) {
322 322
 	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*(.*)$/', $arg, $r)) {
323
-		spip_log("alter add $arg  incompris", 'pg.' . _LOG_ERREUR);
323
+		spip_log("alter add $arg  incompris", 'pg.'._LOG_ERREUR);
324 324
 
325 325
 		return null;
326 326
 	}
@@ -330,14 +330,14 @@  discard block
 block discarded – undo
330 330
 			$m[2] = $n[1];
331 331
 		}
332 332
 
333
-		return spip_pg_query("ALTER TABLE $table ADD " . $m[1] . ' ' . mysql2pg_type($m[2]), $serveur, $requeter);
333
+		return spip_pg_query("ALTER TABLE $table ADD ".$m[1].' '.mysql2pg_type($m[2]), $serveur, $requeter);
334 334
 	} elseif ($r[1][0] == 'P') {
335 335
 		// la primary peut etre sur plusieurs champs
336 336
 		$r[2] = trim(str_replace('`', '', $r[2]));
337 337
 		$m = ($r[2][0] == '(') ? substr($r[2], 1, -1) : $r[2];
338 338
 
339 339
 		return spip_pg_query(
340
-			"ALTER TABLE $table ADD CONSTRAINT $table" . '_pkey PRIMARY KEY (' . $m . ')',
340
+			"ALTER TABLE $table ADD CONSTRAINT $table".'_pkey PRIMARY KEY ('.$m.')',
341 341
 			$serveur,
342 342
 			$requeter
343 343
 		);
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 				$colonnes = substr($m[1], 1, -1);
357 357
 				if (false !== strpos(',', $colonnes)) {
358 358
 					spip_log('PG : Erreur, impossible de creer un index sur plusieurs colonnes'
359
-						. " sans qu'il ait de nom ($table, ($colonnes))", 'pg.' . _LOG_ERREUR);
359
+						. " sans qu'il ait de nom ($table, ($colonnes))", 'pg.'._LOG_ERREUR);
360 360
 				} else {
361 361
 					$nom_index = $colonnes;
362 362
 				}
@@ -373,23 +373,23 @@  discard block
 block discarded – undo
373 373
 // https://code.spip.net/@spip_pg_alter_drop
374 374
 function spip_pg_alter_drop($table, $arg, $serveur = '', $requeter = true) {
375 375
 	if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*`?(\w*)`?/', $arg, $r)) {
376
-		spip_log("alter drop: $arg  incompris", 'pg.' . _LOG_ERREUR);
376
+		spip_log("alter drop: $arg  incompris", 'pg.'._LOG_ERREUR);
377 377
 	} else {
378 378
 		if (!$r[1] or $r[1] == 'COLUMN') {
379
-			return spip_pg_query("ALTER TABLE $table DROP " . $r[2], $serveur);
379
+			return spip_pg_query("ALTER TABLE $table DROP ".$r[2], $serveur);
380 380
 		} elseif ($r[1][0] == 'P') {
381
-			return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table" . '_pkey', $serveur);
381
+			return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table".'_pkey', $serveur);
382 382
 		} else {
383
-			return spip_pg_query('DROP INDEX ' . $table . '_' . $r[2], $serveur);
383
+			return spip_pg_query('DROP INDEX '.$table.'_'.$r[2], $serveur);
384 384
 		}
385 385
 	}
386 386
 }
387 387
 
388 388
 function spip_pg_alter_modify($table, $arg, $serveur = '', $requeter = true) {
389 389
 	if (!preg_match('/^`?(\w+)`?\s+(.*)$/', $arg, $r)) {
390
-		spip_log("alter modify: $arg  incompris", 'pg.' . _LOG_ERREUR);
390
+		spip_log("alter modify: $arg  incompris", 'pg.'._LOG_ERREUR);
391 391
 	} else {
392
-		return spip_pg_alter_change($table, $r[1] . ' ' . $arg, $serveur = '', $requeter = true);
392
+		return spip_pg_alter_change($table, $r[1].' '.$arg, $serveur = '', $requeter = true);
393 393
 	}
394 394
 }
395 395
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	} elseif (preg_match('/^(TO)\s*`?(\w*)`?/', $arg, $r)) {
406 406
 		$rename = $r[2];
407 407
 	} else {
408
-		spip_log("alter rename: $arg  incompris", 'pg.' . _LOG_ERREUR);
408
+		spip_log("alter rename: $arg  incompris", 'pg.'._LOG_ERREUR);
409 409
 	}
410 410
 
411 411
 	return $rename ? spip_pg_query("ALTER TABLE $table RENAME TO $rename") : false;
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
 function spip_pg_create_index($nom, $table, $champs, $serveur = '', $requeter = true) {
427 427
 	if (!($nom or $table or $champs)) {
428 428
 		spip_log(
429
-			"Champ manquant pour creer un index pg ($nom, $table, (" . @join(',', $champs) . '))',
430
-			'pg.' . _LOG_ERREUR
429
+			"Champ manquant pour creer un index pg ($nom, $table, (".@join(',', $champs).'))',
430
+			'pg.'._LOG_ERREUR
431 431
 		);
432 432
 
433 433
 		return false;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
 	// PG ne differentie pas noms des index en fonction des tables
440 440
 	// il faut donc creer des noms uniques d'index pour une base pg
441
-	$nom = $table . '_' . $nom;
441
+	$nom = $table.'_'.$nom;
442 442
 	// enlever d'eventuelles parentheses deja presentes sur champs
443 443
 	if (!is_array($champs)) {
444 444
 		if ($champs[0] == '(') {
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		}
447 447
 		$champs = [$champs];
448 448
 	}
449
-	$query = "CREATE INDEX $nom ON $table (" . join(',', $champs) . ')';
449
+	$query = "CREATE INDEX $nom ON $table (".join(',', $champs).')';
450 450
 	if (!$requeter) {
451 451
 		return $query;
452 452
 	}
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 	} else {
471 471
 		$suite = '';
472 472
 	}
473
-	$query = 'EXPLAIN ' . preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite;
473
+	$query = 'EXPLAIN '.preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite;
474 474
 
475 475
 	if (!$requeter) {
476 476
 		return $query;
@@ -565,16 +565,16 @@  discard block
 block discarded – undo
565 565
 		}
566 566
 	}
567 567
 	$from = spip_pg_from($from, $prefixe);
568
-	$query = 'SELECT ' . $select
568
+	$query = 'SELECT '.$select
569 569
 		. (!$from ? '' : "\nFROM $from")
570
-		. (!$where ? '' : ("\nWHERE " . (!is_array($where) ? calculer_pg_where($where) : (join(
570
+		. (!$where ? '' : ("\nWHERE ".(!is_array($where) ? calculer_pg_where($where) : (join(
571 571
 			"\n\tAND ",
572 572
 			array_map('calculer_pg_where', $where)
573 573
 		)))))
574 574
 		. spip_pg_groupby($groupby, $from, $select)
575 575
 		. (!$having ? '' : "\nHAVING $having")
576 576
 		. ($orderby ? ("\nORDER BY $orderby") : '')
577
-		. (!$limit ? '' : (" LIMIT $count" . (!$offset ? '' : " OFFSET $offset")));
577
+		. (!$limit ? '' : (" LIMIT $count".(!$offset ? '' : " OFFSET $offset")));
578 578
 
579 579
 	// renvoyer la requete inerte si demandee
580 580
 	if ($requeter === false) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 		$from = spip_pg_select_as($from);
597 597
 	}
598 598
 
599
-	return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1' . $prefixe . '_', $from);
599
+	return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1'.$prefixe.'_', $from);
600 600
 }
601 601
 
602 602
 // https://code.spip.net/@spip_pg_orderby
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 	$arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order));
606 606
 
607 607
 	foreach ($arg as $v) {
608
-		if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+' . $v . '/', $select, $m)) {
608
+		if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+'.$v.'/', $select, $m)) {
609 609
 			$res[] = $m[1];
610 610
 		} else {
611 611
 			$res[] = $v;
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 			$n++;
787 787
 			$res .= "\nwhen $index=$v then $n";
788 788
 		}
789
-		$arg = $m[1] . "case $res else 0 end "
789
+		$arg = $m[1]."case $res else 0 end "
790 790
 			. substr($arg, strlen($m[0]));
791 791
 	}
792 792
 
@@ -831,9 +831,9 @@  discard block
 block discarded – undo
831 831
 	}
832 832
 
833 833
 	if (strtoupper($join) === 'AND') {
834
-		return $exp . join("\n\t$join ", array_map('calculer_pg_where', $v));
834
+		return $exp.join("\n\t$join ", array_map('calculer_pg_where', $v));
835 835
 	} else {
836
-		return $exp . join($join, $v);
836
+		return $exp.join($join, $v);
837 837
 	}
838 838
 }
839 839
 
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
 		if (substr($k, -1) == '@') {
845 845
 			// c'est une jointure qui se refere au from precedent
846 846
 			// pas de virgule
847
-			$argsas .= '  ' . $v;
847
+			$argsas .= '  '.$v;
848 848
 		} else {
849 849
 			$as = '';
850 850
 			//  spip_log("$k : $v", _LOG_DEBUG);
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 				} elseif ($v != $k) {
855 855
 					$p = strpos($v, ' ');
856 856
 					if ($p) {
857
-						$v = substr($v, 0, $p) . " AS $k" . substr($v, $p);
857
+						$v = substr($v, 0, $p)." AS $k".substr($v, $p);
858 858
 					} else {
859 859
 						$as = " AS $k";
860 860
 					}
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 			}
863 863
 			// spip_log("subs $k : $v avec $as", _LOG_DEBUG);
864 864
 			// if (strpos($v, 'JOIN') === false)  $argsas .= ', ';
865
-			$argsas .= ', ' . $v . $as;
865
+			$argsas .= ', '.$v.$as;
866 866
 		}
867 867
 	}
868 868
 
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 	$serveur = '',
896 896
 	$requeter = true
897 897
 ) {
898
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
898
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
899 899
 	$r = spip_pg_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
900 900
 	if (!$requeter) {
901 901
 		return $r;
@@ -1001,8 +1001,8 @@  discard block
 block discarded – undo
1001 1001
 
1002 1002
 	return spip_pg_insert(
1003 1003
 		$table,
1004
-		'(' . join(',', array_keys($couples)) . ')',
1005
-		'(' . join(',', $couples) . ')',
1004
+		'('.join(',', array_keys($couples)).')',
1005
+		'('.join(',', $couples).')',
1006 1006
 		$desc,
1007 1007
 		$serveur,
1008 1008
 		$requeter
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 	$c = isset($tab_couples[0]) ? $tab_couples[0] : [];
1027 1027
 	$les_cles = spip_pg_ajouter_champs_timestamp($table, $c, $desc, $serveur);
1028 1028
 
1029
-	$cles = '(' . join(',', array_keys($les_cles)) . ')';
1029
+	$cles = '('.join(',', array_keys($les_cles)).')';
1030 1030
 	$valeurs = [];
1031 1031
 	foreach ($tab_couples as $couples) {
1032 1032
 		foreach ($couples as $champ => $val) {
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 		// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1036 1036
 		$couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1037 1037
 
1038
-		$valeurs[] = '(' . join(',', $couples) . ')';
1038
+		$valeurs[] = '('.join(',', $couples).')';
1039 1039
 	}
1040 1040
 	$valeurs = implode(', ', $valeurs);
1041 1041
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 	$set = [];
1059 1059
 	foreach ($couples as $champ => $val) {
1060
-		$set[] = $champ . '=' . $val;
1060
+		$set[] = $champ.'='.$val;
1061 1061
 	}
1062 1062
 
1063 1063
 	$query = calculer_pg_expression('UPDATE', $table, ',')
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 // https://code.spip.net/@spip_pg_replace
1095 1095
 function spip_pg_replace($table, $values, $desc, $serveur = '', $requeter = true) {
1096 1096
 	if (!$values) {
1097
-		spip_log("replace vide $table", 'pg.' . _LOG_AVERTISSEMENT);
1097
+		spip_log("replace vide $table", 'pg.'._LOG_AVERTISSEMENT);
1098 1098
 
1099 1099
 		return 0;
1100 1100
 	}
@@ -1128,8 +1128,8 @@  discard block
 block discarded – undo
1128 1128
 	if (!$where) {
1129 1129
 		return spip_pg_insert(
1130 1130
 			$table,
1131
-			'(' . join(',', array_keys($values)) . ')',
1132
-			'(' . join(',', $values) . ')',
1131
+			'('.join(',', array_keys($values)).')',
1132
+			'('.join(',', $values).')',
1133 1133
 			$desc,
1134 1134
 			$serveur
1135 1135
 		);
@@ -1150,12 +1150,11 @@  discard block
 block discarded – undo
1150 1150
 		$couples = pg_affected_rows($couples);
1151 1151
 	}
1152 1152
 	if (!$couples) {
1153
-		$ret = !$seq ? '' :
1154
-			(" RETURNING nextval('$seq') < $prim");
1155
-		$connexion['last'] = $q = "INSERT INTO $table (" . join(',', array_keys($values)) . ') VALUES (' . join(
1153
+		$ret = !$seq ? '' : (" RETURNING nextval('$seq') < $prim");
1154
+		$connexion['last'] = $q = "INSERT INTO $table (".join(',', array_keys($values)).') VALUES ('.join(
1156 1155
 			',',
1157 1156
 			$values
1158
-		) . ")$ret";
1157
+		).")$ret";
1159 1158
 		$couples = spip_pg_query_simple($link, $q);
1160 1159
 		if (!$couples) {
1161 1160
 			return false;
@@ -1204,7 +1203,7 @@  discard block
 block discarded – undo
1204 1203
 	) {
1205 1204
 		return '';
1206 1205
 	} else {
1207
-		return $raw ? $prim : $table . '_' . $prim . '_seq';
1206
+		return $raw ? $prim : $table.'_'.$prim.'_seq';
1208 1207
 	}
1209 1208
 }
1210 1209
 
@@ -1222,22 +1221,22 @@  discard block
 block discarded – undo
1222 1221
 			return spip_pg_frommysql($v);
1223 1222
 		} else {
1224 1223
 			if (strncmp($v, '0000', 4) == 0) {
1225
-				$v = '0001' . substr($v, 4);
1224
+				$v = '0001'.substr($v, 4);
1226 1225
 			}
1227 1226
 			if (strpos($v, '-00-00') === 4) {
1228
-				$v = substr($v, 0, 4) . '-01-01' . substr($v, 10);
1227
+				$v = substr($v, 0, 4).'-01-01'.substr($v, 10);
1229 1228
 			}
1230 1229
 
1231 1230
 			return "timestamp '$v'";
1232 1231
 		}
1233 1232
 	} elseif (!sql_test_int($t)) {
1234
-		return ("'" . pg_escape_string($v) . "'");
1233
+		return ("'".pg_escape_string($v)."'");
1235 1234
 	} elseif (is_numeric($v) or (strpos($v, 'CAST(') === 0)) {
1236 1235
 		return $v;
1237 1236
 	} elseif ($v[0] == '0' and $v[1] !== 'x' and ctype_xdigit(substr($v, 1))) {
1238 1237
 		return substr($v, 1);
1239 1238
 	} else {
1240
-		spip_log("Warning: '$v'  n'est pas de type $t", 'pg.' . _LOG_AVERTISSEMENT);
1239
+		spip_log("Warning: '$v'  n'est pas de type $t", 'pg.'._LOG_AVERTISSEMENT);
1241 1240
 
1242 1241
 		return intval($v);
1243 1242
 	}
@@ -1245,7 +1244,7 @@  discard block
 block discarded – undo
1245 1244
 
1246 1245
 // https://code.spip.net/@spip_pg_hex
1247 1246
 function spip_pg_hex($v) {
1248
-	return "CAST(x'" . $v . "' as bigint)";
1247
+	return "CAST(x'".$v."' as bigint)";
1249 1248
 }
1250 1249
 
1251 1250
 function spip_pg_quote($v, $type = '') {
@@ -1284,15 +1283,15 @@  discard block
 block discarded – undo
1284 1283
 		return $not ? '0=0' : '0=1';
1285 1284
 	}
1286 1285
 	if (strpos($valeurs, "CAST(x'") !== false) {
1287
-		return "($val=" . join("OR $val=", explode(',', $valeurs)) . ')';
1286
+		return "($val=".join("OR $val=", explode(',', $valeurs)).')';
1288 1287
 	}
1289 1288
 	$n = $i = 0;
1290 1289
 	$in_sql = '';
1291 1290
 	while ($n = strpos($valeurs, ',', $n + 1)) {
1292 1291
 		if ((++$i) >= 255) {
1293
-			$in_sql .= "($val $not IN (" .
1294
-				substr($valeurs, 0, $n) .
1295
-				"))\n" .
1292
+			$in_sql .= "($val $not IN (".
1293
+				substr($valeurs, 0, $n).
1294
+				"))\n".
1296 1295
 				($not ? "AND\t" : "OR\t");
1297 1296
 			$valeurs = substr($valeurs, $n + 1);
1298 1297
 			$i = $n = 0;
@@ -1309,7 +1308,7 @@  discard block
 block discarded – undo
1309 1308
 	$s = $link ? pg_last_error($link) : pg_last_error();
1310 1309
 	if ($s) {
1311 1310
 		$s = str_replace('ERROR', 'errcode: 1000 ', $s);
1312
-		spip_log("$s - $query", 'pg.' . _LOG_ERREUR);
1311
+		spip_log("$s - $query", 'pg.'._LOG_ERREUR);
1313 1312
 	}
1314 1313
 
1315 1314
 	return $s;
@@ -1360,7 +1359,7 @@  discard block
 block discarded – undo
1360 1359
 function spip_pg_showbase($match, $serveur = '', $requeter = true) {
1361 1360
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1362 1361
 	$link = $connexion['link'];
1363
-	$connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE ' . _q($match);
1362
+	$connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE '._q($match);
1364 1363
 
1365 1364
 	return spip_pg_query_simple($link, $q);
1366 1365
 }
@@ -1369,7 +1368,7 @@  discard block
 block discarded – undo
1369 1368
 function spip_pg_showtable($nom_table, $serveur = '', $requeter = true) {
1370 1369
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1371 1370
 	$link = $connexion['link'];
1372
-	$connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE ' . _q($nom_table);
1371
+	$connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE '._q($nom_table);
1373 1372
 
1374 1373
 	$res = spip_pg_query_simple($link, $q);
1375 1374
 	if (!$res) {
@@ -1380,15 +1379,15 @@  discard block
 block discarded – undo
1380 1379
 	// il faut en tenir compte dans le return
1381 1380
 	$fields = [];
1382 1381
 	while ($field = pg_fetch_array($res, null, PGSQL_NUM)) {
1383
-		$fields[$field[0]] = $field[2] . (!$field[1] ? '' : (' DEFAULT ' . $field[1]));
1382
+		$fields[$field[0]] = $field[2].(!$field[1] ? '' : (' DEFAULT '.$field[1]));
1384 1383
 	}
1385
-	$connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE ' . _q($nom_table);
1384
+	$connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE '._q($nom_table);
1386 1385
 	$res = spip_pg_query_simple($link, $q);
1387 1386
 	$keys = [];
1388 1387
 	while ($index = pg_fetch_array($res, null, PGSQL_NUM)) {
1389 1388
 		if (preg_match('/CREATE\s+(UNIQUE\s+)?INDEX\s([^\s]+).*\((.*)\)$/', $index[0], $r)) {
1390
-			$nom = str_replace($nom_table . '_', '', $r[2]);
1391
-			$keys[($r[1] ? 'PRIMARY KEY' : ('KEY ' . $nom))] = $r[3];
1389
+			$nom = str_replace($nom_table.'_', '', $r[2]);
1390
+			$keys[($r[1] ? 'PRIMARY KEY' : ('KEY '.$nom))] = $r[3];
1392 1391
 		}
1393 1392
 	}
1394 1393
 
@@ -1421,16 +1420,16 @@  discard block
 block discarded – undo
1421 1420
 		if (strpos($k, 'KEY ') === 0) {
1422 1421
 			$n = str_replace('`', '', $k);
1423 1422
 			$v = str_replace('`', '"', $v);
1424
-			$i = $nom . preg_replace('/KEY +/', '_', $n);
1423
+			$i = $nom.preg_replace('/KEY +/', '_', $n);
1425 1424
 			if ($k != $n) {
1426 1425
 				$i = "\"$i\"";
1427 1426
 			}
1428 1427
 			$keys[] = "CREATE INDEX $i ON $nom ($v);";
1429 1428
 		} elseif (strpos($k, 'UNIQUE ') === 0) {
1430 1429
 			$k = preg_replace('/^UNIQUE +/', '', $k);
1431
-			$prim .= "$s\n\t\tCONSTRAINT " . str_replace('`', '"', $k) . " UNIQUE ($v)";
1430
+			$prim .= "$s\n\t\tCONSTRAINT ".str_replace('`', '"', $k)." UNIQUE ($v)";
1432 1431
 		} else {
1433
-			$prim .= "$s\n\t\t" . str_replace('`', '"', $k) . " ($v)";
1432
+			$prim .= "$s\n\t\t".str_replace('`', '"', $k)." ($v)";
1434 1433
 		}
1435 1434
 		if ($k == 'PRIMARY KEY') {
1436 1435
 			$prim_name = $v;
@@ -1441,17 +1440,17 @@  discard block
 block discarded – undo
1441 1440
 
1442 1441
 	$character_set = '';
1443 1442
 	if (@$GLOBALS['meta']['charset_sql_base']) {
1444
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
1443
+		$character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base'];
1445 1444
 	}
1446 1445
 	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
1447
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
1446
+		$character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base'];
1448 1447
 	}
1449 1448
 
1450 1449
 	foreach ($champs as $k => $v) {
1451 1450
 		$k = str_replace('`', '"', $k);
1452 1451
 		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
1453 1452
 			if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) {
1454
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
1453
+				$v = $defs[1].$character_set.' '.substr($v, strlen($defs[1]));
1455 1454
 			}
1456 1455
 		}
1457 1456
 
@@ -1466,7 +1465,7 @@  discard block
 block discarded – undo
1466 1465
 
1467 1466
 	// En l'absence de "if not exists" en PG, on neutralise les erreurs
1468 1467
 
1469
-	$q = "CREATE $temporary TABLE $nom ($query" . ($prim ? ",$prim" : '') . ')' .
1468
+	$q = "CREATE $temporary TABLE $nom ($query".($prim ? ",$prim" : '').')'.
1470 1469
 		($character_set ? " DEFAULT $character_set" : '')
1471 1470
 		. "\n";
1472 1471
 
@@ -1477,7 +1476,7 @@  discard block
 block discarded – undo
1477 1476
 	$r = @pg_query($link, $q);
1478 1477
 
1479 1478
 	if (!$r) {
1480
-		spip_log("Impossible de creer cette table: $q", 'pg.' . _LOG_ERREUR);
1479
+		spip_log("Impossible de creer cette table: $q", 'pg.'._LOG_ERREUR);
1481 1480
 	} else {
1482 1481
 		foreach ($keys as $index) {
1483 1482
 			pg_query($link, $index);
@@ -1501,13 +1500,13 @@  discard block
 block discarded – undo
1501 1500
 	// vue deja presente
1502 1501
 	if (sql_showtable($nom, false, $serveur)) {
1503 1502
 		if ($requeter) {
1504
-			spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.' . _LOG_ERREUR);
1503
+			spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.'._LOG_ERREUR);
1505 1504
 		}
1506 1505
 
1507 1506
 		return false;
1508 1507
 	}
1509 1508
 
1510
-	$query = "CREATE VIEW $nom AS " . $query_select;
1509
+	$query = "CREATE VIEW $nom AS ".$query_select;
1511 1510
 
1512 1511
 	return spip_pg_query($query, $serveur, $requeter);
1513 1512
 }
@@ -1515,7 +1514,7 @@  discard block
 block discarded – undo
1515 1514
 
1516 1515
 // https://code.spip.net/@spip_pg_set_connect_charset
1517 1516
 function spip_pg_set_connect_charset($charset, $serveur = '', $requeter = true) {
1518
-	spip_log('changement de charset sql a ecrire en PG', 'pg.' . _LOG_ERREUR);
1517
+	spip_log('changement de charset sql a ecrire en PG', 'pg.'._LOG_ERREUR);
1519 1518
 }
1520 1519
 
1521 1520
 
@@ -1529,7 +1528,7 @@  discard block
 block discarded – undo
1529 1528
  **/
1530 1529
 // https://code.spip.net/@spip_sqlite_optimize
1531 1530
 function spip_pg_optimize($table, $serveur = '', $requeter = true) {
1532
-	return spip_pg_query('VACUUM ' . $table, $serveur, $requeter);
1531
+	return spip_pg_query('VACUUM '.$table, $serveur, $requeter);
1533 1532
 }
1534 1533
 
1535 1534
 // Selectionner la sous-chaine dans $objet
Please login to merge, or discard this patch.
ecrire/action/editer_auteur.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	$champs['source'] = $source ? $source : 'spip';
94 94
 
95 95
 	$champs['login'] = '';
96
-	$champs['statut'] = '5poubelle';  // inutilisable tant qu'il n'a pas ete renseigne et institue
96
+	$champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue
97 97
 	$champs['webmestre'] = 'non';
98 98
 	if (empty($champs['imessage'])) {
99 99
 		$champs['imessage'] = 'oui';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		$champs['pass'] = $c['pass'];
314 314
 	}
315 315
 
316
-	$statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
316
+	$statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
317 317
 
318 318
 	if (
319 319
 		isset($c['statut'])
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	// commencer par traiter les cas particuliers des logins et pass
374 374
 	// avant les autres ecritures en base
375 375
 	if (isset($champs['login']) or isset($champs['pass'])) {
376
-		$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
376
+		$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
377 377
 		include_spip('inc/auth');
378 378
 		if (isset($champs['login']) and strlen($champs['login'])) {
379 379
 			if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 			}
382 382
 		}
383 383
 		if (isset($champs['pass']) and strlen($champs['pass'])) {
384
-			$champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
384
+			$champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
385 385
 			if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) {
386 386
 				$erreurs[] = 'ecrire:impossible_modifier_pass_auteur';
387 387
 			}
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 	if (!count($champs)) {
395 395
 		return implode(' ', array_map('_T', $erreurs));
396 396
 	}
397
-	sql_updateq('spip_auteurs', $champs, 'id_auteur=' . $id_auteur);
397
+	sql_updateq('spip_auteurs', $champs, 'id_auteur='.$id_auteur);
398 398
 
399 399
 	// .. mettre a jour les fichiers .htpasswd et .htpasswd-admin
400 400
 	if (
Please login to merge, or discard this patch.
ecrire/action/activer_plugins.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	// recuperer les plugins dans l'ordre des $_POST
33 33
 	$test = [];
34 34
 	foreach (liste_plugin_files() as $file) {
35
-		$test['s' . substr(md5(_DIR_PLUGINS . $file), 0, 16)] = $file;
35
+		$test['s'.substr(md5(_DIR_PLUGINS.$file), 0, 16)] = $file;
36 36
 	}
37 37
 	if (defined('_DIR_PLUGINS_SUPPL')) {
38 38
 		foreach (liste_plugin_files(_DIR_PLUGINS_SUPPL) as $file) {
39
-			$test['s' . substr(md5(_DIR_PLUGINS_SUPPL . $file), 0, 16)] = $file;
39
+			$test['s'.substr(md5(_DIR_PLUGINS_SUPPL.$file), 0, 16)] = $file;
40 40
 		}
41 41
 	}
42 42
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		}
49 49
 	}
50 50
 
51
-	spip_log("Changement des plugins actifs par l'auteur " . $GLOBALS['visiteur_session']['id_auteur'] . ': ' . join(
51
+	spip_log("Changement des plugins actifs par l'auteur ".$GLOBALS['visiteur_session']['id_auteur'].': '.join(
52 52
 		',',
53 53
 		$plugin
54 54
 	));
Please login to merge, or discard this patch.
ecrire/action/editer_objet.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function objet_modifier($objet, $id, $set = null) {
78 78
 	if (($t = objet_type($objet)) !== $objet) {
79
-		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
79
+		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
80 80
 		$objet = $t;
81 81
 	}
82 82
 	if (
83
-		include_spip('action/editer_' . $objet)
84
-		and function_exists($modifier = $objet . '_modifier')
83
+		include_spip('action/editer_'.$objet)
84
+		and function_exists($modifier = $objet.'_modifier')
85 85
 	) {
86 86
 		return $modifier($id, $set);
87 87
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$trouver_table = charger_fonction('trouver_table', 'base');
91 91
 	$desc = $trouver_table($table_sql);
92 92
 	if (!$desc or !isset($desc['field'])) {
93
-		spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR);
93
+		spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR);
94 94
 
95 95
 		return _L("Erreur objet $objet inconnu");
96 96
 	}
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
  */
170 170
 function objet_inserer($objet, $id_parent = null, $set = null) {
171 171
 	if (($t = objet_type($objet)) !== $objet) {
172
-		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
172
+		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
173 173
 		$objet = $t;
174 174
 	}
175 175
 	if (
176
-		include_spip('action/editer_' . $objet)
177
-		and function_exists($inserer = $objet . '_inserer')
176
+		include_spip('action/editer_'.$objet)
177
+		and function_exists($inserer = $objet.'_inserer')
178 178
 	) {
179 179
 		return $inserer($id_parent, $set);
180 180
 	}
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 			$row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1');
196 196
 			$id_rubrique = $row['id_rubrique'];
197 197
 		} else {
198
-			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
198
+			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
199 199
 		}
200 200
 
201 201
 		$champs['id_rubrique'] = $id_rubrique;
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function objet_instituer($objet, $id, $c, $calcul_rub = true) {
315 315
 	if (($t = objet_type($objet)) !== $objet) {
316
-		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
316
+		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
317 317
 		$objet = $t;
318 318
 	}
319 319
 	if (
320
-		include_spip('action/editer_' . $objet)
321
-		and function_exists($instituer = $objet . '_instituer')
320
+		include_spip('action/editer_'.$objet)
321
+		and function_exists($instituer = $objet.'_instituer')
322 322
 	) {
323 323
 		return $instituer($id, $c, $calcul_rub);
324 324
 	}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	$sel[] = ($champ_date ? "$champ_date as date" : "'' as date");
348 348
 	$sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique');
349 349
 
350
-	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id));
350
+	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id));
351 351
 
352 352
 	$id_rubrique = $row['id_rubrique'];
353 353
 	$statut_ancien = $statut = $row['statut'];
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 			if ($s != 'publie' and autoriser('modifier', $objet, $id)) {
371 371
 				$statut = $champs['statut'] = $s;
372 372
 			} else {
373
-				spip_log("editer_objet $objet #$id refus " . json_encode($c), 'editer' . _LOG_INFO_IMPORTANTE);
373
+				spip_log("editer_objet $objet #$id refus ".json_encode($c), 'editer'._LOG_INFO_IMPORTANTE);
374 374
 			}
375 375
 		}
376 376
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		and isset($c['id_parent'])
401 401
 		and $id_parent = $c['id_parent']
402 402
 		and $id_parent != $id_rubrique
403
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
403
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
404 404
 	) {
405 405
 		$champs['id_rubrique'] = $id_parent;
406 406
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	// Si on deplace l'objet
500 500
 	// changer aussi son secteur et sa langue (si heritee)
501 501
 	if (isset($champs['id_rubrique'])) {
502
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
502
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
503 503
 		$langue = $row_rub['lang'];
504 504
 
505 505
 		if (isset($desc['field']['id_secteur'])) {
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 				sql_fetsel(
512 512
 					'1',
513 513
 					$table_sql,
514
-					id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
514
+					id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
515 515
 				)
516 516
 			) {
517 517
 				$champs['lang'] = $langue;
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	if (!$champs) {
523 523
 		return;
524 524
 	}
525
-	sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id));
525
+	sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id));
526 526
 
527 527
 	// Changer le statut des rubriques concernees
528 528
 	if ($cond) {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
  */
567 567
 function objet_lire($objet, $valeur_id, $options = []) {
568 568
 	if (($t = objet_type($objet)) !== $objet) {
569
-		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
569
+		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
570 570
 		$objet = $t;
571 571
 	}
572 572
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 	) {
589 589
 		// Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet.
590 590
 		if (
591
-			include_spip('action/editer_' . $objet)
591
+			include_spip('action/editer_'.$objet)
592 592
 			and function_exists($lire = "${objet}_lire_champs")
593 593
 		) {
594 594
 			$valeurs = $lire($objet, $valeur_id, $champ_id);
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 
599 599
 			// La condition est appliquée sur le champ désigné par l'utilisateur.
600 600
 			$where = [
601
-				"${champ_id}=" . sql_quote($valeur_id)
601
+				"${champ_id}=".sql_quote($valeur_id)
602 602
 			];
603 603
 
604 604
 			// Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide.
Please login to merge, or discard this patch.
ecrire/action/calculer_taille_cache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@
 block discarded – undo
43 43
 			'ecrire:taille_cache_image',
44 44
 			[
45 45
 				'dir' => joli_repertoire(_DIR_VAR),
46
-				'taille' => '<b>' . (taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet') . '</b>'
46
+				'taille' => '<b>'.(taille_en_octets($taille) > 0 ? taille_en_octets($taille) : '0 octet').'</b>'
47 47
 			]
48 48
 		);
49 49
 	} else {
50 50
 		include_spip('inc/invalideur');
51 51
 		$taille =
52 52
 			calculer_taille_dossier(_DIR_CACHE_XML)
53
-			+ calculer_taille_dossier(_DIR_CACHE . 'skel/')
54
-			+ calculer_taille_dossier(_DIR_CACHE . 'wheels/')
55
-			+ calculer_taille_dossier(_DIR_CACHE . 'contextes/');
53
+			+ calculer_taille_dossier(_DIR_CACHE.'skel/')
54
+			+ calculer_taille_dossier(_DIR_CACHE.'wheels/')
55
+			+ calculer_taille_dossier(_DIR_CACHE.'contextes/');
56 56
 		$taille += intval(taille_du_cache());
57 57
 		if ($taille <= 150000) {
58 58
 			$res = _T('taille_cache_vide');
Please login to merge, or discard this patch.