Completed
Push — master ( 6c9939...4ccfda )
by cam
01:06
created
ecrire/iterateur/data.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		// Si a ce stade on n'a pas de table, il y a un bug
235 235
 		if (!is_array($this->tableau)) {
236 236
 			$this->err = true;
237
-			spip_log('erreur datasource ' . var_export($command, true));
237
+			spip_log('erreur datasource '.var_export($command, true));
238 238
 		}
239 239
 
240 240
 		// {datapath query.results}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			isset($this->command['sourcemode'])
277 277
 			and !in_array($this->command['sourcemode'], ['table', 'array', 'tableau'])
278 278
 		) {
279
-			charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true);
279
+			charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true);
280 280
 		}
281 281
 
282 282
 		# le premier argument peut etre un array, une URL etc.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		# avons-nous un cache dispo ?
286 286
 		$cle = null;
287 287
 		if (is_string($src)) {
288
-			$cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true));
288
+			$cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true));
289 289
 		}
290 290
 
291 291
 		$cache = $this->cache_get($cle);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
 					if (
346 346
 						!$this->err
347
-						and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true)
347
+						and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true)
348 348
 					) {
349 349
 						$args = $this->command['source'];
350 350
 						$args[0] = $data;
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
 							$tv = '%s';
485 485
 						} # {par valeur/xx/yy} ??
486 486
 						else {
487
-							$tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')';
487
+							$tv = 'table_valeur(%s, '.var_export($r[1], true).')';
488 488
 						}
489 489
 						$sortfunc .= '
490
-					$a = ' . sprintf($tv, '$aa') . ';
491
-					$b = ' . sprintf($tv, '$bb') . ';
490
+					$a = ' . sprintf($tv, '$aa').';
491
+					$b = ' . sprintf($tv, '$bb').';
492 492
 					if ($a <> $b)
493
-						return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;';
493
+						return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;';
494 494
 					}
495 495
 				}
496 496
 			}
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 function inc_sql_to_array_dist($data) {
644 644
 	# sortir le connecteur de $data
645 645
 	preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v);
646
-	$serveur = (string)$v[1];
646
+	$serveur = (string) $v[1];
647 647
 	$req = trim($v[2]);
648 648
 	if ($s = sql_query($req, $serveur)) {
649 649
 		$r = [];
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 		$json = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
669 669
 	} catch (JsonException $e) {
670 670
 		$json = null;
671
-		spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO);
671
+		spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO);
672 672
 	}
673 673
 	return is_array($json) ? (array) $json : [];
674 674
 }
@@ -688,13 +688,13 @@  discard block
 block discarded – undo
688 688
 	$i = 1;
689 689
 	foreach ($entete as $k => $v) {
690 690
 		if (trim($v) == '') {
691
-			$v = 'col' . $i;
691
+			$v = 'col'.$i;
692 692
 		} // reperer des eventuelles cases vides
693 693
 		if (is_numeric($v) and $v < 0) {
694
-			$v = '__' . $v;
694
+			$v = '__'.$v;
695 695
 		} // ne pas risquer d'ecraser une cle numerique
696 696
 		if (is_numeric($v)) {
697
-			$v = '_' . $v;
697
+			$v = '_'.$v;
698 698
 		} // ne pas risquer d'ecraser une cle numerique
699 699
 		$v = strtolower(preg_replace(',\W+,', '_', translitteration($v)));
700 700
 		foreach ($csv as &$item) {
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
  * @return array|bool
781 781
  */
782 782
 function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) {
783
-	return (array)preg_files($dir, $regexp, $limit);
783
+	return (array) preg_files($dir, $regexp, $limit);
784 784
 }
785 785
 
786 786
 /**
@@ -795,13 +795,13 @@  discard block
 block discarded – undo
795 795
 	$glob_to_array = charger_fonction('glob_to_array', 'inc');
796 796
 	$a = $glob_to_array($data);
797 797
 	foreach ($a as &$v) {
798
-		$b = (array)@stat($v);
798
+		$b = (array) @stat($v);
799 799
 		foreach ($b as $k => $ignore) {
800 800
 			if (is_numeric($k)) {
801 801
 				unset($b[$k]);
802 802
 			}
803 803
 		}
804
-		$b['file'] = preg_replace('`/$`', '', $v) ;
804
+		$b['file'] = preg_replace('`/$`', '', $v);
805 805
 		$v = array_merge(
806 806
 			pathinfo($v),
807 807
 			$b
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	$xml_array = [];
822 822
 	for ($object->rewind(); $object->valid(); $object->next()) {
823 823
 		if (array_key_exists($key = $object->key(), $xml_array)) {
824
-			$key .= '-' . uniqid();
824
+			$key .= '-'.uniqid();
825 825
 		}
826 826
 		$vars = get_object_vars($object->current());
827 827
 		if (isset($vars['@attributes'])) {
Please login to merge, or discard this patch.
ecrire/maj/2021.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
 }
24 24
 
25 25
 $GLOBALS['maj'][2021_02_18_00] = [
26
-	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ],
27
-	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ],
26
+	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"],
27
+	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"],
28 28
 ];
Please login to merge, or discard this patch.
ecrire/maj/legacy/v30.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
61 61
 
62 62
 	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
63
-	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's');
64
-	$liens = 'spip_' . $pivots . '_liens';
65
-	$id_pivot = 'id_' . $pivot;
63
+	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot.'s');
64
+	$liens = 'spip_'.$pivots.'_liens';
65
+	$id_pivot = 'id_'.$pivot;
66 66
 	// Creer spip_auteurs_liens
67 67
 	global $tables_auxiliaires;
68 68
 	if (!$l) {
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 		$l = preg_replace(',[^\w],', '', $l); // securite
75 75
 		$primary = "id_$l";
76 76
 		$objet = ($l == 'syndic' ? 'site' : $l);
77
-		$ls = ($exceptions_pluriel[$l] ?? $l . 's');
78
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
77
+		$ls = ($exceptions_pluriel[$l] ?? $l.'s');
78
+		$ancienne_table = 'spip_'.$pivots.'_'.$ls;
79 79
 		$pool = 400;
80 80
 
81 81
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
112 112
 			$insert = [];
113 113
 			foreach ($ids as $id) {
114
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id));
115
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) {
114
+				$n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id));
115
+				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) {
116 116
 					$n += is_countable($t) ? count($t) : 0;
117 117
 					// empiler en s'assurant a minima de l'unicite
118 118
 					while ($r = array_shift($t)) {
119
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
+						$insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
120 120
 					}
121 121
 					if (count($insert) >= $sub_pool) {
122 122
 						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 
268 268
 	// cas particulier spip_auteurs : retablir le collate binary sur le login
269 269
 	$desc = $trouver_table('spip_auteurs');
270
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
+	spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
271 271
 	if (stripos($desc['field']['login'], 'BINARY') === false) {
272 272
 		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
273 273
 		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
274 274
 		$trouver_table('');
275 275
 		$new_desc = $trouver_table('spip_auteurs');
276
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
+		spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
277 277
 	}
278 278
 
279 279
 	foreach ($tables as $table) {
@@ -292,27 +292,27 @@  discard block
 block discarded – undo
292 292
 					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
293 293
 					$urls = [];
294 294
 					foreach ($data as $d) {
295
-						$key = $d['id_parent'] . '::' . strtolower($d['url']);
295
+						$key = $d['id_parent'].'::'.strtolower($d['url']);
296 296
 						if (!isset($urls[$key])) {
297 297
 							$urls[$key] = true;
298 298
 						} else {
299 299
 							spip_log(
300
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
301
-								'maj.' . _LOG_INFO_IMPORTANTE
300
+								'Suppression doublon dans spip_urls avant conversion : '.serialize($d),
301
+								'maj.'._LOG_INFO_IMPORTANTE
302 302
 							);
303
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
+							sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url']));
304 304
 						}
305 305
 					}
306 306
 				}
307 307
 				foreach ($desc['field'] as $field => $type) {
308 308
 					if ($desc['field'][$field] !== $desc_collate[$field]) {
309
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
310
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
309
+						spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE);
310
+						sql_alter("table $table change $field $field ".$desc_collate[$field]);
311 311
 						$trouver_table('');
312 312
 						$new_desc = $trouver_table($table);
313 313
 						spip_log(
314
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
315
-							'maj.' . _LOG_INFO_IMPORTANTE
314
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
315
+							'maj.'._LOG_INFO_IMPORTANTE
316 316
 						);
317 317
 						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
318 318
 					}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 $GLOBALS['maj'][19236] = [
330 330
 	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
331
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
+	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins
332 332
 	['maj_collation_sqlite'],
333 333
 ];
334 334
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	spip_log('supprimer sessions auteur');
346 346
 	if ($dir = opendir(_DIR_SESSIONS)) {
347 347
 		while (($f = readdir($dir)) !== false) {
348
-			spip_unlink(_DIR_SESSIONS . $f);
348
+			spip_unlink(_DIR_SESSIONS.$f);
349 349
 			if (time() >= _TIME_OUT) {
350 350
 				return;
351 351
 			}
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 ?: '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 (!(is_countable($champs) ? count($champs) : 0)) {
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/editer_liens.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	$l = '';
54 54
 	if (
55 55
 		$primary = id_table_objet($objet)
56
-		and $trouver_table($l = $table_sql . '_liens', '', true, ['log_missing' => false])
56
+		and $trouver_table($l = $table_sql.'_liens', '', true, ['log_missing' => false])
57 57
 		and !preg_match(',[^\w],', $primary)
58 58
 		and !preg_match(',[^\w],', $l)
59 59
 	) {
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
  * @return int
213 213
  */
214 214
 function objet_optimiser_liens($objets_source, $objets_lies) {
215
-	spip_log('objet_optimiser_liens : ' . json_encode($objets_source, JSON_THROW_ON_ERROR) . ', ' . json_encode($objets_lies, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG);
215
+	spip_log('objet_optimiser_liens : '.json_encode($objets_source, JSON_THROW_ON_ERROR).', '.json_encode($objets_lies, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG);
216 216
 	return objet_traiter_liaisons('lien_optimise', $objets_source, $objets_lies);
217 217
 }
218 218
 
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 					$where_meme_lien = implode(' AND ', $where_meme_lien);
447 447
 					// on decale les liens de rang_lien>=la valeur inseree pour faire la place
448 448
 					// sauf sur le meme lien avec un role eventuellement different
449
-					$w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>=' . intval($insertions['rang_lien']), "NOT($where_meme_lien)"]);
449
+					$w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>='.intval($insertions['rang_lien']), "NOT($where_meme_lien)"]);
450 450
 					sql_update($table_lien, ['rang_lien' => 'rang_lien+1'], $w);
451 451
 				}
452 452
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 					$rang = 1;
512 512
 					foreach ($liens as $lien) {
513 513
 						if (empty($deja_reordonne[$lien[$primary]][$lien['objet']][$lien['id_objet']])) {
514
-							$where = lien_where($primary, $lien[$primary], $lien['objet'], $lien['id_objet'], ['rang_lien!=' . intval($rang)]);
514
+							$where = lien_where($primary, $lien[$primary], $lien['objet'], $lien['id_objet'], ['rang_lien!='.intval($rang)]);
515 515
 							sql_updateq($table_lien, ['rang_lien' => $rang], $where);
516 516
 
517 517
 							if (empty($deja_reordonne[$lien[$primary]])) {
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 			addslashes($primary),
588 588
 			array_map('intval', $id_source),
589 589
 			$not
590
-		) : addslashes($primary) . ($not ? '<>' : '=') . intval($id_source));
590
+		) : addslashes($primary).($not ? '<>' : '=').intval($id_source));
591 591
 	} elseif ($not) {
592 592
 		$where[] = '0=1';
593 593
 	} // idiot mais quand meme
@@ -599,14 +599,14 @@  discard block
 block discarded – undo
599 599
 	}
600 600
 
601 601
 	if ($objet !== '*') {
602
-		$where[] = 'objet=' . sql_quote($objet);
602
+		$where[] = 'objet='.sql_quote($objet);
603 603
 	}
604 604
 	if ($id_objet !== '*') {
605 605
 		$where[] = (is_array($id_objet) ? sql_in(
606 606
 			'id_objet',
607 607
 			array_map('intval', $id_objet),
608 608
 			$not
609
-		) : 'id_objet' . ($not ? '<>' : '=') . intval($id_objet));
609
+		) : 'id_objet'.($not ? '<>' : '=').intval($id_objet));
610 610
 	} elseif ($not) {
611 611
 		$where[] = '0=1';
612 612
 	} // idiot mais quand meme
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 function lien_rang_where($table_lien, $primary, $id_source, $objet, $id_objet, $cond = []) {
628 628
 
629 629
 	// si on veut compter les rangs autrement que le core ne le fait par defaut, fournir le where adhoc
630
-	if (function_exists($f = 'lien_rang_where_' . $table_lien)) {
630
+	if (function_exists($f = 'lien_rang_where_'.$table_lien)) {
631 631
 		return $f($primary, $id_source, $objet, $id_objet, $cond);
632 632
 	}
633 633
 
@@ -792,8 +792,8 @@  discard block
 block discarded – undo
792 792
 					// il faut les eliminier en repetant la condition dans le where L.objet='xxx'
793 793
 					"$table_lien AS L
794 794
 									LEFT JOIN $spip_table_objet AS O
795
-										ON (O.$id_table_objet=L.id_objet AND L.objet=" . sql_quote($type) . ')',
796
-					'L.objet=' . sql_quote($type) . " AND O.$id_table_objet IS NULL"
795
+										ON (O.$id_table_objet=L.id_objet AND L.objet=".sql_quote($type).')',
796
+					'L.objet='.sql_quote($type)." AND O.$id_table_objet IS NULL"
797 797
 				);
798 798
 				// sur une cle primaire composee, pas d'autres solutions que de virer un a un
799 799
 				while ($row = sql_fetch($res)) {
@@ -802,13 +802,13 @@  discard block
 block discarded – undo
802 802
 					}
803 803
 					$e = sql_delete(
804 804
 						$table_lien,
805
-						["$primary=" . $row['id'], 'id_objet=' . $row['id_objet'], 'objet=' . sql_quote($type)]
805
+						["$primary=".$row['id'], 'id_objet='.$row['id_objet'], 'objet='.sql_quote($type)]
806 806
 					);
807 807
 					if ($e != false) {
808 808
 						$dels += $e;
809 809
 						spip_log(
810
-							'lien_optimise: Entree ' . $row['id'] . '/' . $row['id_objet'] . "/$type supprimee dans la table $table_lien",
811
-							'genie' . _LOG_INFO_IMPORTANTE
810
+							'lien_optimise: Entree '.$row['id'].'/'.$row['id_objet']."/$type supprimee dans la table $table_lien",
811
+							'genie'._LOG_INFO_IMPORTANTE
812 812
 						);
813 813
 					}
814 814
 				}
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 					// sauf sur le meme lien avec un role eventuellement different
913 913
 					$where_meme_lien = lien_where($primary, $id, $objet, $id_objet);
914 914
 					$where_meme_lien = implode(' AND ', $where_meme_lien);
915
-					$w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>=' . intval($qualif['rang_lien']), "NOT($where_meme_lien)"]);
915
+					$w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>='.intval($qualif['rang_lien']), "NOT($where_meme_lien)"]);
916 916
 					sql_update($table_lien, ['rang_lien' => 'rang_lien+1'], $w);
917 917
 				}
918 918
 				// tous les liens de même rôle recoivent le rang indiqué aussi
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
  */
1005 1005
 function lien_propage_date_modif($objet, $ids) {
1006 1006
 	static $done = [];
1007
-	$hash = md5($objet . serialize($ids));
1007
+	$hash = md5($objet.serialize($ids));
1008 1008
 
1009 1009
 	// sql_updateq, peut être un rien lent.
1010 1010
 	// On évite de l'appeler 2 fois sur les mêmes choses
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 		and isset($desc['field']['date_modif'])
1021 1021
 	) {
1022 1022
 		$primary = id_table_objet($objet);
1023
-		$where = (is_array($ids) ? sql_in($primary, array_map('intval', $ids)) : "$primary=" . intval($ids));
1023
+		$where = (is_array($ids) ? sql_in($primary, array_map('intval', $ids)) : "$primary=".intval($ids));
1024 1024
 		sql_updateq($table, ['date_modif' => date('Y-m-d H:i:s')], $where);
1025 1025
 	}
1026 1026
 
Please login to merge, or discard this patch.
ecrire/action/editer_objet.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function objet_modifier($objet, $id, $set = null) {
78 78
 	if (($t = objet_type($objet)) !== $objet) {
79
-		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
79
+		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
80 80
 		$objet = $t;
81 81
 	}
82 82
 	if (
83
-		include_spip('action/editer_' . $objet)
84
-		and function_exists($modifier = $objet . '_modifier')
83
+		include_spip('action/editer_'.$objet)
84
+		and function_exists($modifier = $objet.'_modifier')
85 85
 	) {
86 86
 		return $modifier($id, $set);
87 87
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$trouver_table = charger_fonction('trouver_table', 'base');
91 91
 	$desc = $trouver_table($table_sql);
92 92
 	if (!$desc or !isset($desc['field'])) {
93
-		spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR);
93
+		spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR);
94 94
 
95 95
 		return _L("Erreur objet $objet inconnu");
96 96
 	}
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 function objet_inserer($objet, $id_parent = null, $set = null) {
171 171
 	$d = null;
172 172
 	if (($t = objet_type($objet)) !== $objet) {
173
-		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
173
+		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
174 174
 		$objet = $t;
175 175
 	}
176 176
 	if (
177
-		include_spip('action/editer_' . $objet)
178
-		and function_exists($inserer = $objet . '_inserer')
177
+		include_spip('action/editer_'.$objet)
178
+		and function_exists($inserer = $objet.'_inserer')
179 179
 	) {
180 180
 		return $inserer($id_parent, $set);
181 181
 	}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			$row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1');
197 197
 			$id_rubrique = $row['id_rubrique'];
198 198
 		} else {
199
-			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
199
+			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
200 200
 		}
201 201
 
202 202
 		$champs['id_rubrique'] = $id_rubrique;
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
  */
315 315
 function objet_instituer($objet, $id, $c, $calcul_rub = true) {
316 316
 	if (($t = objet_type($objet)) !== $objet) {
317
-		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
317
+		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
318 318
 		$objet = $t;
319 319
 	}
320 320
 	if (
321
-		include_spip('action/editer_' . $objet)
322
-		and function_exists($instituer = $objet . '_instituer')
321
+		include_spip('action/editer_'.$objet)
322
+		and function_exists($instituer = $objet.'_instituer')
323 323
 	) {
324 324
 		return $instituer($id, $c, $calcul_rub);
325 325
 	}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	$sel[] = ($champ_date ? "$champ_date as date" : "'' as date");
349 349
 	$sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique');
350 350
 
351
-	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id));
351
+	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id));
352 352
 
353 353
 	$id_rubrique = $row['id_rubrique'];
354 354
 	$statut_ancien = $statut = $row['statut'];
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			if ($s != 'publie' and autoriser('modifier', $objet, $id)) {
372 372
 				$statut = $champs['statut'] = $s;
373 373
 			} else {
374
-				spip_log("editer_objet $objet #$id refus " . json_encode($c, JSON_THROW_ON_ERROR), 'editer' . _LOG_INFO_IMPORTANTE);
374
+				spip_log("editer_objet $objet #$id refus ".json_encode($c, JSON_THROW_ON_ERROR), 'editer'._LOG_INFO_IMPORTANTE);
375 375
 			}
376 376
 		}
377 377
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		and isset($c['id_parent'])
402 402
 		and $id_parent = $c['id_parent']
403 403
 		and $id_parent != $id_rubrique
404
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
404
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
405 405
 	) {
406 406
 		$champs['id_rubrique'] = $id_parent;
407 407
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	// Si on deplace l'objet
501 501
 	// changer aussi son secteur et sa langue (si heritee)
502 502
 	if (isset($champs['id_rubrique'])) {
503
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
503
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
504 504
 		$langue = $row_rub['lang'];
505 505
 
506 506
 		if (isset($desc['field']['id_secteur'])) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 				sql_fetsel(
513 513
 					'1',
514 514
 					$table_sql,
515
-					id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
515
+					id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
516 516
 				)
517 517
 			) {
518 518
 				$champs['lang'] = $langue;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 	if (!$champs) {
524 524
 		return;
525 525
 	}
526
-	sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id));
526
+	sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id));
527 527
 
528 528
 	// Changer le statut des rubriques concernees
529 529
 	if ($cond) {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
  */
568 568
 function objet_lire($objet, $valeur_id, $options = []) {
569 569
 	if (($t = objet_type($objet)) !== $objet) {
570
-		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
570
+		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
571 571
 		$objet = $t;
572 572
 	}
573 573
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 	) {
590 590
 		// Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet.
591 591
 		if (
592
-			include_spip('action/editer_' . $objet)
592
+			include_spip('action/editer_'.$objet)
593 593
 			and function_exists($lire = "${objet}_lire_champs")
594 594
 		) {
595 595
 			$valeurs = $lire($objet, $valeur_id, $champ_id);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 			// La condition est appliquée sur le champ désigné par l'utilisateur.
601 601
 			$where = [
602
-				"${champ_id}=" . sql_quote($valeur_id)
602
+				"${champ_id}=".sql_quote($valeur_id)
603 603
 			];
604 604
 
605 605
 			// Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide.
Please login to merge, or discard this patch.
ecrire/action/editer_logo.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		return $erreur;
90 90
 	}
91 91
 	// chercher dans la base
92
-	$mode_document = 'logo' . $mode;
92
+	$mode_document = 'logo'.$mode;
93 93
 
94 94
 	include_spip('inc/documents');
95 95
 	$erreur = '';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$tmp_name = false;
107 107
 		if (file_exists($source)) {
108 108
 			$tmp_name = $source;
109
-		} elseif (file_exists($f = determine_upload() . $source)) {
109
+		} elseif (file_exists($f = determine_upload().$source)) {
110 110
 			$tmp_name = $f;
111 111
 		}
112 112
 		if (!$tmp_name) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 	if (!is_numeric($id_document)) {
142 142
 		$erreur = ($id_document ?: 'Erreur inconnue');
143
-		spip_log("Erreur ajout logo : $erreur pour source=" . json_encode($source, JSON_THROW_ON_ERROR), 'logo');
143
+		spip_log("Erreur ajout logo : $erreur pour source=".json_encode($source, JSON_THROW_ON_ERROR), 'logo');
144 144
 		return $erreur;
145 145
 	}
146 146
 
@@ -166,23 +166,23 @@  discard block
 block discarded – undo
166 166
 	$desc = $trouver_table($table);
167 167
 
168 168
 	foreach (['on', 'off'] as $mode) {
169
-		$nom_base = $type . $mode;
169
+		$nom_base = $type.$mode;
170 170
 		$dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG);
171 171
 
172
-		$files = glob($dir . $nom_base . '*');
172
+		$files = glob($dir.$nom_base.'*');
173 173
 		// est-ce que c'est une nouvelle tentative de migration ?
174 174
 		// dans ce cas les logos sont deja dans IMG/logo/
175 175
 		if (!(is_countable($files) ? count($files) : 0)) {
176
-			$files = glob($dir_logos . $nom_base . '*');
176
+			$files = glob($dir_logos.$nom_base.'*');
177 177
 			if (is_countable($files) ? count($files) : 0) {
178 178
 				// mais il faut verifier si ils ont pas deja ete migres pour tout ou partie
179 179
 				$filescheck = [];
180 180
 				foreach ($files as $file) {
181
-					$short = basename(dirname($file)) . DIRECTORY_SEPARATOR . basename($file);
181
+					$short = basename(dirname($file)).DIRECTORY_SEPARATOR.basename($file);
182 182
 					$filescheck[$short] = $file;
183 183
 				}
184 184
 				// trouver ceux deja migres
185
-				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck)) . " AND mode LIKE 'logo%'");
185
+				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck))." AND mode LIKE 'logo%'");
186 186
 				if (is_countable($deja) ? count($deja) : 0) {
187 187
 					$deja = array_column($deja, 'fichier');
188 188
 					$restant = array_diff(array_keys($filescheck), $deja);
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
 			}
202 202
 		}
203 203
 
204
-		spip_log("logo_migrer_en_base $objet $mode : " . (is_countable($files) ? count($files) : 0) . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE);
204
+		spip_log("logo_migrer_en_base $objet $mode : ".(is_countable($files) ? count($files) : 0).' logos restant', 'maj'._LOG_INFO_IMPORTANTE);
205 205
 
206 206
 		$deja = [];
207 207
 		foreach ($files as $file) {
208
-			$logo = substr($file, strlen($dir . $nom_base));
208
+			$logo = substr($file, strlen($dir.$nom_base));
209 209
 			$logo = explode('.', $logo);
210 210
 			if (
211 211
 				is_numeric($logo[0])
@@ -216,16 +216,16 @@  discard block
 block discarded – undo
216 216
 					// if no logo in base
217 217
 					if (!$logo or (is_countable($logo) ? count($logo) : 0) < 6) {
218 218
 						foreach ($formats_logos as $format) {
219
-							if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) {
219
+							if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) {
220 220
 								if (isset($desc['field']['date_modif'])) {
221 221
 									$date_modif = sql_getfetsel('date_modif', $table, "$_id_objet=$id_objet");
222 222
 								} else {
223 223
 									$date_modif = null;
224 224
 								}
225 225
 								// logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre
226
-								@rename($d, $dir_logos . $nom);
226
+								@rename($d, $dir_logos.$nom);
227 227
 								// et on le declare comme nouveau logo
228
-								logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom);
228
+								logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom);
229 229
 								if ($date_modif) {
230 230
 									sql_updateq($table, ['date_modif' => $date_modif], "$_id_objet=$id_objet");
231 231
 								}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 			// si le fichier est encore la on le move : rien a faire ici
240 240
 			// (sauf si c'est une re-migration : il est deja dans logo/ donc il bouge pas)
241 241
 			if ($dir !== $dir_logos and file_exists($file)) {
242
-				@rename($file, $dir_logos_erreurs . basename($file));
242
+				@rename($file, $dir_logos_erreurs.basename($file));
243 243
 			}
244 244
 
245 245
 			if ($time_limit and time() > $time_limit) {
Please login to merge, or discard this patch.
ecrire/action/tester_taille.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']);
77 77
 		if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) {
78 78
 			$t = $t * 0.9; // marge de securite
79
-			echo round($t / 1_000_000, 3) . ' Mpx';
79
+			echo round($t / 1_000_000, 3).' Mpx';
80 80
 		} else {
81 81
 			// c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue"
82 82
 			$t = 0;
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
 	$image_source = chemin_image('test.png');
113 113
 	$GLOBALS['redirect'] = generer_url_action(
114 114
 		'tester_taille',
115
-		"i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test']
115
+		"i=$i&arg=".$GLOBALS['taille_min'].'-'.$GLOBALS['taille_test']
116 116
 	);
117 117
 
118 118
 	ob_start('action_tester_taille_error_handler');
119 119
 	filtrer('image_recadre', $image_source, $taille, $taille);
120
-	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
120
+	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
121 121
 
122 122
 	// si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee
123 123
 	// si $GLOBALS['taille_min']==0 (car on est au premier coup)
124 124
 	if ($GLOBALS['taille_min'] == 0) {
125 125
 		$taille = $GLOBALS['taille_max'];
126 126
 		filtrer('image_recadre', $image_source, $taille, $taille);
127
-		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
127
+		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
128 128
 	}
129 129
 	ob_end_clean();
130 130
 
Please login to merge, or discard this patch.
ecrire/action/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	if ($change_session == 'oui') {
60 60
 		$session = charger_fonction('session', 'inc');
61 61
 		$session(true);
62
-		spip_log('statut 204 pour ' . $_SERVER['REQUEST_URI']);
62
+		spip_log('statut 204 pour '.$_SERVER['REQUEST_URI']);
63 63
 		http_response_code(204); // No Content
64 64
 		return;
65 65
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				_T('info_connexion_refusee'),
80 80
 				_T('login_login_pass_incorrect'),
81 81
 				_T('login_retour_site'),
82
-				'url=' . rawurlencode($redirect),
82
+				'url='.rawurlencode($redirect),
83 83
 				_T('login_nouvelle_tentative'),
84 84
 				(strpos($url, (string) _DIR_RESTREINT_ABS) !== false)
85 85
 			);
Please login to merge, or discard this patch.