Completed
Push — master ( 47be08...0b670a )
by cam
01:02
created
ecrire/inc/editer.php 1 patch
Spacing   +24 added lines, -25 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	if (
222 222
 		$config_fonc
223 223
 		and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
224
-		and $config_fonc !== $table_objet . '_edit_config'
224
+		and $config_fonc !== $table_objet.'_edit_config'
225 225
 	) {
226 226
 		if (
227 227
 			$args = test_formulaire_inclus_par_modele()
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 	// Appel direct dans un squelette
237 237
 	if (!$row) {
238 238
 		if (!$new or $lier_trad) {
239
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
239
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
240 240
 				$row = $select($id, $id_parent, $lier_trad);
241 241
 				// si on a une fonction precharger, elle pu faire un reglage de langue
242 242
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
243 243
 			} else {
244
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
244
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
245 245
 			}
246 246
 			if (!$new) {
247 247
 				$md5 = controles_md5($row ?? []);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	if ($config_fonc) {
292 292
 		$contexte['config'] = $config = $config_fonc($contexte);
293 293
 		if (!$lang_default) {
294
-			$lang_default = $config['langue'] ?? session_get('lang') ;
294
+			$lang_default = $config['langue'] ?? session_get('lang');
295 295
 		}
296 296
 	}
297 297
 	$config = $config + [
@@ -315,13 +315,12 @@  discard block
 block discarded – undo
315 315
 		unset($contexte['lang']);
316 316
 	}
317 317
 
318
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
319
-		(!$lier_trad ? '' :
320
-			("\n<input type='hidden' name='lier_trad' value='" .
321
-				$lier_trad .
322
-				"' />" .
323
-				"\n<input type='hidden' name='changer_lang' value='" .
324
-				$lang_default .
318
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
319
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
320
+				$lier_trad.
321
+				"' />".
322
+				"\n<input type='hidden' name='changer_lang' value='".
323
+				$lang_default.
325 324
 				"' />"))
326 325
 		. $hidden
327 326
 		. ($md5 ?? '');
@@ -361,14 +360,14 @@  discard block
 block discarded – undo
361 360
 	$aider = charger_fonction('aider', 'inc');
362 361
 	if (strlen($texte) > 28 * 1024) {
363 362
 		$texte = str_replace("\r\n", "\n", $texte);
364
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
363
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
365 364
 		if ($pos > 0 and $pos < 32 * 1024) {
366
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
365
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
367 366
 			$suite = substr($texte, $pos + 2);
368 367
 		} else {
369
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
368
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
370 369
 			if (!($pos > 0 and $pos < 32 * 1024)) {
371
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
370
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
372 371
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
373 372
 			} else {
374 373
 				$decalage = 1;
@@ -399,13 +398,13 @@  discard block
 block discarded – undo
399 398
 	}
400 399
 
401 400
 	include_spip('inc/barre');
402
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
401
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
403 402
 	$nombre = 0;
404 403
 
405 404
 	while (strlen($texte) > 29 * 1024) {
406 405
 		$nombre++;
407 406
 		[$texte1, $texte] = coupe_trop_long($texte);
408
-		$textes_supplement .= '<br />' .
407
+		$textes_supplement .= '<br />'.
409 408
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
410 409
 	}
411 410
 
@@ -488,7 +487,7 @@  discard block
 block discarded – undo
488 487
 	$ctr = [];
489 488
 	foreach ($data as $key => $val) {
490 489
 		$m = md5($val ?? '');
491
-		$k = $prefixe . $key;
490
+		$k = $prefixe.$key;
492 491
 
493 492
 		switch ($format) {
494 493
 			case 'html':
@@ -501,7 +500,7 @@  discard block
 block discarded – undo
501 500
 	}
502 501
 
503 502
 	if ($format === 'html') {
504
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
503
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
505 504
 	} else {
506 505
 		return $ctr;
507 506
 	}
@@ -653,7 +652,7 @@  discard block
 block discarded – undo
653 652
 	// On elimine les donnees non modifiees par le formulaire (mais
654 653
 	// potentiellement modifiees entre temps par un autre utilisateur)
655 654
 	foreach ($champs as $key => $val) {
656
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
655
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
657 656
 			if (is_scalar($val) and $m == md5($val)) {
658 657
 				unset($champs[$key]);
659 658
 			}
@@ -682,7 +681,7 @@  discard block
 block discarded – undo
682 681
 	// de conflit.
683 682
 	$ctrh = $ctrq = $conflits = [];
684 683
 	foreach (array_keys($champs) as $key) {
685
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
684
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
686 685
 			$ctrh[$key] = $m;
687 686
 			$ctrq[] = $key;
688 687
 		}
@@ -716,8 +715,8 @@  discard block
 block discarded – undo
716 715
  */
717 716
 function display_conflit_champ($x) {
718 717
 	if (strstr($x, "\n") or strlen($x) > 80) {
719
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
718
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
720 719
 	} else {
721
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
720
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
722 721
 	}
723 722
 }
Please login to merge, or discard this patch.
ecrire/inc/exporter_csv.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	$champ = preg_replace(',[\s]+,ms', ' ', $champ);
39 39
 	$champ = str_replace('"', '""', $champ);
40 40
 
41
-	return '"' . $champ . '"';
41
+	return '"'.$champ.'"';
42 42
 }
43 43
 
44 44
 /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	if ($callback) {
59 59
 		$ligne = $callback($nb, $ligne, $delim, $importer_charset);
60 60
 	}
61
-	$output = join($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n";
61
+	$output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n";
62 62
 	if ($importer_charset) {
63 63
 		$output = str_replace('’', '\'', $output);
64 64
 		$output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$fichier = 'php://output';
176 176
 	}
177 177
 	else {
178
-	$fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename;
178
+	$fichier = sous_repertoire(_DIR_CACHE, 'export').$filename;
179 179
 	}
180 180
 
181 181
 	$fp = fopen($fichier, 'w');
Please login to merge, or discard this patch.
ecrire/action/api_transmettre.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 
94 94
 	$res = ltrim($res['texte']);
95 95
 	if (empty($res)) {
96
-		spip_log("$arg $qs resultat vide", 'transmettre' . _LOG_INFO_IMPORTANTE);
96
+		spip_log("$arg $qs resultat vide", 'transmettre'._LOG_INFO_IMPORTANTE);
97 97
 	}
98 98
 
99 99
 	echo $res;
Please login to merge, or discard this patch.
ecrire/base/connect_sql.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19 19
 	return;
20 20
 }
21
-require_once _ROOT_RESTREINT . 'base/objets.php';
21
+require_once _ROOT_RESTREINT.'base/objets.php';
22 22
 
23 23
 
24 24
 /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$f = (!preg_match('/^[\w\.]*$/', $serveur))
60 60
 			? '' // nom de serveur mal ecrit
61 61
 			: ($serveur ?
62
-				(_DIR_CONNECT . $serveur . '.php') // serveur externe
62
+				(_DIR_CONNECT.$serveur.'.php') // serveur externe
63 63
 				: (_FILE_CONNECT ?: ($install ? _FILE_CONNECT_TMP // init du serveur principal
64 64
 						: ''))); // installation pas faite
65 65
 
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 	// chargement de la version du jeu de fonctions
102 102
 	// si pas dans le fichier par defaut
103 103
 	$type = $GLOBALS['db_ok']['type'];
104
-	$jeu = 'spip_' . $type . '_functions_' . $version;
104
+	$jeu = 'spip_'.$type.'_functions_'.$version;
105 105
 	if (!isset($GLOBALS[$jeu])) {
106
-		if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) {
106
+		if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) {
107 107
 			spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS);
108 108
 
109 109
 			// ne plus reessayer
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 	$connexion = spip_connect($serveur);
166 166
 	$e = sql_errno($serveur);
167 167
 	$t = ($connexion['type'] ?? 'sql');
168
-	$m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']);
169
-	$f = $t . $serveur;
170
-	spip_log($m, $f . '.' . _LOG_ERREUR);
168
+	$m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']);
169
+	$f = $t.$serveur;
170
+	spip_log($m, $f.'.'._LOG_ERREUR);
171 171
 }
172 172
 
173 173
 /**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	// si en cours d'installation ou si db=@test@ on ne pose rien
254 254
 	// car c'est un test de connexion
255 255
 	if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') {
256
-		$f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out';
256
+		$f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out';
257 257
 	} elseif ($db == '@test@') {
258 258
 		$db = '';
259 259
 	}
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 	// En cas d'indisponibilite du serveur, eviter de le bombarder
293 293
 	if ($f) {
294 294
 		@touch($f);
295
-		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS);
295
+		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS);
296 296
 	}
297 297
 	return null;
298 298
 }
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
 	} elseif (is_array($a)) {
391 391
 		return join(',', array_map('_q', $a));
392 392
 	} elseif (is_scalar($a)) {
393
-		return ("'" . addslashes($a) . "'");
393
+		return ("'".addslashes($a)."'");
394 394
 	} elseif ($a === null) {
395 395
 		return "''";
396 396
 	}
397
-	throw new \RuntimeException('Can’t use _q with ' . gettype($a));
397
+	throw new \RuntimeException('Can’t use _q with '.gettype($a));
398 398
 }
399 399
 
400 400
 /**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 				$next = reset($textes);
446 446
 				if (
447 447
 					strpos($next, "'") === 0
448
-					and strpos($query_echappees, $part . $next, $currentpos) === $nextpos
448
+					and strpos($query_echappees, $part.$next, $currentpos) === $nextpos
449 449
 				) {
450 450
 					$part .= array_shift($textes);
451 451
 				}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 			$parts[$k] = [
458 458
 				'texte' => $part,
459 459
 				'position' => $nextpos,
460
-				'placeholder' => '%' . $k . '$s',
460
+				'placeholder' => '%'.$k.'$s',
461 461
 			];
462 462
 			$currentpos = $nextpos + strlen($part);
463 463
 		}
Please login to merge, or discard this patch.
ecrire/public/evaluer_page.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 	ob_start();
48 48
 	if (strpos($page['texte'], '?xml') !== false) {
49
-		$page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']);
49
+		$page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']);
50 50
 	}
51 51
 
52 52
 	try {
53
-		$res = eval('?' . '>' . $page['texte']);
53
+		$res = eval('?'.'>'.$page['texte']);
54 54
 		$page['texte'] = ob_get_contents();
55 55
 	} catch (\Throwable $e) {
56 56
 		$code = $page['texte'];
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 		if (!function_exists('numerote_ligne_php')) {
59 59
 			function numerote_ligne_php($match) {
60 60
 				$GLOBALS['numero_ligne_php']++;
61
-				return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/';
61
+				return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/';
62 62
 			}
63 63
 		}
64
-		$code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
64
+		$code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
65 65
 		$code = trim(highlight_string($code, true));
66
-		erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]);
66
+		erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]);
67 67
 		$page['texte'] = '<!-- Erreur -->';
68 68
 	}
69 69
 	ob_end_clean();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	$page['process_ins'] = 'html';
72 72
 
73 73
 	if (strpos($page['texte'], '?xml') !== false) {
74
-		$page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']);
74
+		$page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']);
75 75
 	}
76 76
 }
77 77
 
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 		sql_updateq(
136 136
 			'spip_rubriques',
137 137
 			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
138
-			'id_rubrique=' . intval($id_rubrique)
138
+			'id_rubrique='.intval($id_rubrique)
139 139
 		);
140
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
140
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique));
141 141
 		if (!$id_parent) {
142 142
 			break;
143 143
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return $id_pred != $id_rubrique;
173 173
 		}
174 174
 		// passer au parent si on a depublie
175
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
175
+		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred));
176 176
 		$id_pred = $r['id_parent'];
177 177
 	}
178 178
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 		$date = date('Y-m-d H:i:s');
198 198
 	}
199 199
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
200
-		' AND date <= ' . sql_quote($date) : '';
200
+		' AND date <= '.sql_quote($date) : '';
201 201
 
202 202
 	if (!$id_rubrique = intval($id_rubrique)) {
203 203
 		return false;
204 204
 	}
205 205
 
206 206
 	// verifier qu'elle existe et est bien publiee
207
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
207
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
208 208
 	if (!$r or $r['statut'] !== 'publie') {
209 209
 		return false;
210 210
 	}
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
 	$compte = [
215 215
 		'articles' => sql_countsel(
216 216
 			'spip_articles',
217
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
217
+			'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates"
218 218
 		),
219
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
219
+		'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"),
220 220
 		'documents' => sql_countsel(
221 221
 			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
222
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
222
+			'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
223 223
 		)
224 224
 	];
225 225
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		}
245 245
 	}
246 246
 
247
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
247
+	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique));
248 248
 
249 249
 #		spip_log("depublier_rubrique $id_pred");
250 250
 	return true;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 	// Afficher les articles post-dates ?
309 309
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
310
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
310
+		'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
311 311
 
312 312
 	$r = sql_select(
313 313
 		'R.id_rubrique AS id, max(A.date) AS date_h',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		sql_updateq(
320 320
 			'spip_rubriques',
321 321
 			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
322
-			'id_rubrique=' . intval($row['id'])
322
+			'id_rubrique='.intval($row['id'])
323 323
 		);
324 324
 	}
325 325
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			sql_updateq(
346 346
 				'spip_rubriques',
347 347
 				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
348
-				'id_rubrique=' . intval($row['id'])
348
+				'id_rubrique='.intval($row['id'])
349 349
 			);
350 350
 			$continuer = true;
351 351
 		}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			and $rows = sql_allfetsel(
399 399
 				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
400 400
 				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
401
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
401
+				'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
402 402
 				'',
403 403
 				'R.id_secteur',
404 404
 				'0,100'
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 			and $rows = sql_allfetsel(
438 438
 				'id_rubrique as id',
439 439
 				'spip_rubriques',
440
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
440
+				'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select(
441 441
 					'zzz.id_rubrique',
442 442
 					'spip_rubriques AS zzz',
443
-					'zzz.profondeur=' . intval($prof)
444
-				) . ')',
443
+					'zzz.profondeur='.intval($prof)
444
+				).')',
445 445
 				'',
446 446
 				'',
447 447
 				'0,100'
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
456 456
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
457 457
 		// on arrete les frais
458
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
458
+		if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) {
459 459
 			$prof++;
460 460
 			$continuer = true;
461 461
 		}
@@ -463,12 +463,12 @@  discard block
 block discarded – undo
463 463
 
464 464
 	// loger si la table des rubriques semble foireuse
465 465
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
466
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
466
+	if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) {
467 467
 		spip_log(
468
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
468
+			'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)',
469 469
 			_LOG_CRITIQUE
470 470
 		);
471
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
471
+		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1));
472 472
 	}
473 473
 
474 474
 	// reparer les articles
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 	);
480 480
 
481 481
 	while ($row = sql_fetch($r)) {
482
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
482
+		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id']));
483 483
 	}
484 484
 
485 485
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$t = sql_updateq(
511 511
 			'spip_rubriques',
512 512
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
513
-			'id_rubrique=' . intval($id_rubrique)
513
+			'id_rubrique='.intval($id_rubrique)
514 514
 		);
515 515
 	}
516 516
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		sql_updateq(
556 556
 			'spip_articles',
557 557
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
558
-			'id_article=' . intval($id_article)
558
+			'id_article='.intval($id_article)
559 559
 		);
560 560
 	}
561 561
 
@@ -630,11 +630,11 @@  discard block
 block discarded – undo
630 630
 				];
631 631
 				// generer un nom de fonction "anonyme" unique
632 632
 				do {
633
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
633
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax());
634 634
 				} while (function_exists($functionname));
635 635
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
636
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
637
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
636
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
637
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
638 638
 				$res = '';
639 639
 				eval($code);
640 640
 				$res = explode(',', $res);
@@ -736,11 +736,11 @@  discard block
 block discarded – undo
736 736
 		$maxiter-- and $filles = sql_allfetsel(
737 737
 			'id_rubrique',
738 738
 			'spip_rubriques',
739
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
739
+			sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT')
740 740
 		)
741 741
 	) {
742 742
 		$r = join(',', array_column($filles, 'id_rubrique'));
743
-		$branche .= ',' . $r;
743
+		$branche .= ','.$r;
744 744
 	}
745 745
 
746 746
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
 	if (isset($b[$id])) {
782 782
 		// Notre branche commence par la rubrique de depart si $tout=true
783
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
783
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
784 784
 	}
785 785
 
786 786
 	$hier = '';
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
 		$maxiter-- and $parents = sql_allfetsel(
794 794
 			'id_parent',
795 795
 			'spip_rubriques',
796
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
796
+			sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT')
797 797
 		)
798 798
 	) {
799 799
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
800
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
800
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
801 801
 	}
802 802
 
803 803
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	include_spip('base/abstract_sql');
830 830
 	if ($check) {
831 831
 		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
832
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
832
+			'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
833 833
 
834 834
 		$r = sql_select(
835 835
 			'DISTINCT A.id_rubrique AS id',
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 	$t = sql_fetsel(
847 847
 		'date',
848 848
 		'spip_articles',
849
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
849
+		"statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')),
850 850
 		'',
851 851
 		'date',
852 852
 		'1'
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		$r = sql_getfetsel(
903 903
 			'id_rubrique',
904 904
 			'spip_rubriques',
905
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
905
+			'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent),
906 906
 			$groupby = [],
907 907
 			$orderby = [],
908 908
 			$limit = '',
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 			sql_updateq(
939 939
 				'spip_rubriques',
940 940
 				['id_secteur' => $id_secteur, 'lang' => $lang],
941
-				'id_rubrique=' . intval($id_rubrique),
941
+				'id_rubrique='.intval($id_rubrique),
942 942
 				[],
943 943
 				$serveur
944 944
 			);
Please login to merge, or discard this patch.
ecrire/inc/modifier.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 	// Appels incomplets (sans $c)
115 115
 	if (!is_array($c)) {
116
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
116
+		spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c');
117 117
 
118 118
 		return _T('erreur_technique_enregistrement_impossible');
119 119
 	}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	$champs = array_map('corriger_caracteres', $champs);
147 147
 
148 148
 	// On récupère l'état avant toute modification
149
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
149
+	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet);
150 150
 
151 151
 	// Envoyer aux plugins
152 152
 	$champs = pipeline(
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 				$id_rubrique = 0;
201 201
 				if (isset($desc['field']['id_rubrique'])) {
202 202
 					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
203
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
203
+					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet));
204 204
 				}
205 205
 				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
206 206
 				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
 		}
223 223
 
224 224
 		// allez on commit la modif
225
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), [], $serveur);
225
+		sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), [], $serveur);
226 226
 
227 227
 		// on verifie si elle est bien passee
228 228
 		$moof = sql_fetsel(
229 229
 			array_keys($champs),
230 230
 			$spip_table_objet,
231
-			"$id_table_objet=" . intval($id_objet),
231
+			"$id_table_objet=".intval($id_objet),
232 232
 			[],
233 233
 			[],
234 234
 			'',
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
 			// c'est un cas exceptionnel
265 265
 			if (count($liste)) {
266 266
 				spip_log(
267
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
268
-					'modifier.' . _LOG_CRITIQUE
267
+					"Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true),
268
+					'modifier.'._LOG_CRITIQUE
269 269
 				);
270 270
 
271 271
 				return _T(
272 272
 					'erreur_technique_enregistrement_champs',
273
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
273
+					['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"]
274 274
 				);
275 275
 			}
276 276
 		}
@@ -312,18 +312,18 @@  discard block
 block discarded – undo
312 312
 	include_spip('inc/filtres_mini');
313 313
 	$qui = '';
314 314
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
315
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
315
+		$qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#';
316 316
 	}
317 317
 	if (!empty($GLOBALS['visiteur_session']['nom'])) {
318
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
318
+		$qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#';
319 319
 	}
320 320
 	if ($qui == '') {
321
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
321
+		$qui = '#ip:'.$GLOBALS['ip'].'#';
322 322
 	}
323
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
323
+	journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join(
324 324
 		'+',
325 325
 		array_diff(array_keys($champs), ['date_modif'])
326
-	) . ')'), [
326
+	).')'), [
327 327
 		'faire' => 'modifier',
328 328
 		'quoi' => $objet,
329 329
 		'id' => $id_objet
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	$s = '';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 			if (!$s) {
43 43
 				$s = random_int(0, mt_getrandmax());
44 44
 			}
45
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
45
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
46 46
 		}
47
-		$r = unpack('Cr', pack('H2', $s . $s));
47
+		$r = unpack('Cr', pack('H2', $s.$s));
48 48
 		$x = $r['r'] & 63;
49 49
 		if ($x < 10) {
50 50
 			$x = chr($x + 48);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	static $seeded;
83 83
 
84 84
 	if (!$seeded) {
85
-		$seed = (int)round(((float)microtime() + 1) * time());
85
+		$seed = (int) round(((float) microtime() + 1) * time());
86 86
 		mt_srand($seed);
87 87
 		$seeded = true;
88 88
 	}
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
169 169
 		}
170 170
 	} else {
171
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur));
171
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur));
172 172
 		if (!$low_sec) {
173 173
 			$low_sec = creer_pass_aleatoire();
174
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur));
174
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur));
175 175
 		}
176 176
 	}
177 177
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) {
230 230
 	$id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0;
231 231
 	$cle = afficher_low_sec($id_auteur, "$script/$format $fond $args");
232
-	$path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : '');
232
+	$path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : '');
233 233
 
234 234
 	return generer_url_api($script, $path, $args, $no_entities = false, $public);
235 235
 }
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 	foreach ($args as $val => $var) {
254 254
 		if ($var) {
255 255
 			if ($val <> 'statut') {
256
-				$a .= ':' . $val . '-' . $var;
256
+				$a .= ':'.$val.'-'.$var;
257 257
 			}
258
-			$b .= $val . '=' . $var . '&';
258
+			$b .= $val.'='.$var.'&';
259 259
 		}
260 260
 	}
261 261
 	$a = substr($a, 1);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
  *     Clé
286 286
  **/
287 287
 function afficher_low_sec($id_auteur, $action = '') {
288
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
288
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
289 289
 }
290 290
 
291 291
 /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	if (!$id_auteur = intval($id_auteur)) {
317 317
 		return;
318 318
 	} // jamais trop prudent ;)
319
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur));
319
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur));
320 320
 }
321 321
 
322 322
 /**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
  */
327 327
 function initialiser_sel() {
328 328
 	if (!isset($GLOBALS['htsalt'])) {
329
-		$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
329
+		$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
330 330
 	}
331 331
 	return $GLOBALS['htsalt'];
332 332
 }
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
  *     - void sinon.
346 346
  **/
347 347
 function ecrire_acces() {
348
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
349
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
348
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
349
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
350 350
 
351 351
 	// Cette variable de configuration peut etre posee par un plugin
352 352
 	// par exemple acces_restreint ;
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		and !@file_exists($htaccess)
358 358
 	) {
359 359
 		spip_unlink($htpasswd);
360
-		spip_unlink($htpasswd . '-admin');
360
+		spip_unlink($htpasswd.'-admin');
361 361
 		return;
362 362
 	}
363 363
 
@@ -385,10 +385,10 @@  discard block
 block discarded – undo
385 385
 	$pwd_all = ''; // login:htpass pour tous
386 386
 	$pwd_admin = ''; // login:htpass pour les admins
387 387
 
388
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
388
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
389 389
 	while ($row = sql_fetch($res)) {
390 390
 		if (strlen($row['login']) and strlen($row['htpass'])) {
391
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
391
+			$ligne = $row['login'].':'.$row['htpass']."\n";
392 392
 			$pwd_all .= $ligne;
393 393
 			if ($row['statut'] == '0minirezo') {
394 394
 				$pwd_admin .= $ligne;
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
  * @return boolean
434 434
  */
435 435
 function verifier_htaccess($rep, $force = false) {
436
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
436
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
437 437
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
438 438
 		return true;
439 439
 	}
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 		fputs($ht, $deny);
463 463
 		fclose($ht);
464 464
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
465
-		$t = rtrim($rep, '/') . '/.ok';
465
+		$t = rtrim($rep, '/').'/.ok';
466 466
 		if ($ht = @fopen($t, 'w')) {
467 467
 			@fclose($ht);
468 468
 			include_spip('inc/distant');
469 469
 			$t = substr($t, strlen(_DIR_RACINE));
470
-			$t = url_de_base() . $t;
470
+			$t = url_de_base().$t;
471 471
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
472 472
 			$ht = ($ht['status'] ?? null) === 403;
473 473
 		}
474 474
 	}
475
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
475
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
476 476
 
477 477
 	return $ht;
478 478
 }
@@ -498,11 +498,11 @@  discard block
 block discarded – undo
498 498
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
499 499
 	$dirs[] = ['extension' => 'distant'];
500 500
 	foreach ($dirs as $e) {
501
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
501
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
502 502
 			if ($f) {
503 503
 				verifier_htaccess($dir);
504 504
 			} else {
505
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
505
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
506 506
 			}
507 507
 		}
508 508
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 function extraire_date($texte): string {
40 40
 	// format = 2001-08
41 41
 	if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) {
42
-		return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01';
42
+		return $regs[1].'-'.sprintf('%02d', $regs[2]).'-01';
43 43
 	}
44 44
 	return '';
45 45
 }
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 		}
71 71
 		if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
72 72
 			$regs = array_pad($regs, 4, null); // eviter notice php
73
-			$date = $regs[1] . '-00-00' . $regs[3];
73
+			$date = $regs[1].'-00-00'.$regs[3];
74 74
 		} else {
75 75
 			if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
76 76
 				$regs = array_pad($regs, 4, null); // eviter notice php
77
-				$date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3];
77
+				$date = preg_replace('@/@', '-', $regs[1]).'-00'.$regs[3];
78 78
 			} else {
79 79
 				$date = date('Y-m-d H:i:s', strtotime($date));
80 80
 			}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 function vider_date($letexte, $verif_format_date = false): string {
101 101
 	if (
102 102
 		!$verif_format_date
103
-		or (in_array(strlen($letexte), [10,19]) and
103
+		or (in_array(strlen($letexte), [10, 19]) and
104 104
 			  preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte))
105 105
 	) {
106 106
 		if (strncmp('0000-00-00', $letexte, 10) == 0) {
@@ -387,17 +387,17 @@  discard block
 block discarded – undo
387 387
 	if ($decal > 3600 * 24 * 30) {
388 388
 		$mois = floor($decal / (3600 * 24 * 30));
389 389
 		if ($mois < 2) {
390
-			$delai = "$mois " . _T('date_un_mois');
390
+			$delai = "$mois "._T('date_un_mois');
391 391
 		} else {
392
-			$delai = "$mois " . _T('date_mois');
392
+			$delai = "$mois "._T('date_mois');
393 393
 		}
394 394
 	} else {
395 395
 		if ($decal > 3600 * 24 * 7) {
396 396
 			$semaines = floor($decal / (3600 * 24 * 7));
397 397
 			if ($semaines < 2) {
398
-				$delai = "$semaines " . _T('date_une_semaine');
398
+				$delai = "$semaines "._T('date_une_semaine');
399 399
 			} else {
400
-				$delai = "$semaines " . _T('date_semaines');
400
+				$delai = "$semaines "._T('date_semaines');
401 401
 			}
402 402
 		} else {
403 403
 			if ($decal > 3600 * 24) {
@@ -405,30 +405,30 @@  discard block
 block discarded – undo
405 405
 				if ($jours < 2) {
406 406
 					return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier');
407 407
 				} else {
408
-					$delai = "$jours " . _T('date_jours');
408
+					$delai = "$jours "._T('date_jours');
409 409
 				}
410 410
 			} else {
411 411
 				if ($decal >= 3600) {
412 412
 					$heures = floor($decal / 3600);
413 413
 					if ($heures < 2) {
414
-						$delai = "$heures " . _T('date_une_heure');
414
+						$delai = "$heures "._T('date_une_heure');
415 415
 					} else {
416
-						$delai = "$heures " . _T('date_heures');
416
+						$delai = "$heures "._T('date_heures');
417 417
 					}
418 418
 				} else {
419 419
 					if ($decal >= 60) {
420 420
 						$minutes = floor($decal / 60);
421 421
 						if ($minutes < 2) {
422
-							$delai = "$minutes " . _T('date_une_minute');
422
+							$delai = "$minutes "._T('date_une_minute');
423 423
 						} else {
424
-							$delai = "$minutes " . _T('date_minutes');
424
+							$delai = "$minutes "._T('date_minutes');
425 425
 						}
426 426
 					} else {
427 427
 						$secondes = ceil($decal);
428 428
 						if ($secondes < 2) {
429
-							$delai = "$secondes " . _T('date_une_seconde');
429
+							$delai = "$secondes "._T('date_une_seconde');
430 430
 						} else {
431
-							$delai = "$secondes " . _T('date_secondes');
431
+							$delai = "$secondes "._T('date_secondes');
432 432
 						}
433 433
 					}
434 434
 				}
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 		$njour = 0;
522 522
 	} else {
523 523
 		$njour = intval($jour);
524
-		if ($jourth = _T('date_jnum' . $jour)) {
524
+		if ($jourth = _T('date_jnum'.$jour)) {
525 525
 			$jour = $jourth;
526 526
 		}
527 527
 	}
@@ -529,10 +529,10 @@  discard block
 block discarded – undo
529 529
 	$mois = intval($mois);
530 530
 	if ($mois > 0 and $mois < 13) {
531 531
 		/* Traiter le cas "abbr" pour les noms de mois */
532
-		$param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : '');
533
-		$nommois = _T('date_mois_' . $mois . $param);
532
+		$param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_'.$options['param'] : '');
533
+		$nommois = _T('date_mois_'.$mois.$param);
534 534
 		if ($jour) {
535
-			$jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]);
535
+			$jourmois = _T('date_de_mois_'.$mois, ['j' => $jour, 'nommois' => $nommois]);
536 536
 		} else {
537 537
 			$jourmois = $nommois;
538 538
 		}
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 	}
543 543
 
544 544
 	if ($annee < 0) {
545
-		$annee = -$annee . ' ' . _T('date_avant_jc');
545
+		$annee = -$annee.' '._T('date_avant_jc');
546 546
 		$avjc = true;
547 547
 	} else {
548 548
 		$avjc = false;
@@ -568,11 +568,11 @@  discard block
 block discarded – undo
568 568
 				}
569 569
 			}
570 570
 			if ($vue == 'saison') {
571
-				return $saison ? _T('date_saison_' . $saison) : '';
571
+				return $saison ? _T('date_saison_'.$saison) : '';
572 572
 			} else {
573 573
 				return $saison ? trim(_T(
574 574
 					'date_fmt_saison_annee',
575
-					['saison' => _T('date_saison_' . $saison), 'annee' => $annee]
575
+					['saison' => _T('date_saison_'.$saison), 'annee' => $annee]
576 576
 				)) : '';
577 577
 			}
578 578
 
@@ -649,9 +649,9 @@  discard block
 block discarded – undo
649 649
 			}
650 650
 			$nom = mktime(1, 1, 1, $mois, $njour, $annee);
651 651
 			$nom = 1 + date('w', $nom);
652
-			$param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
652
+			$param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : '');
653 653
 
654
-			return _T('date_jour_' . $nom . $param);
654
+			return _T('date_jour_'.$nom.$param);
655 655
 
656 656
 		case 'mois_annee':
657 657
 			if ($avjc) {
@@ -1046,8 +1046,8 @@  discard block
 block discarded – undo
1046 1046
 
1047 1047
 	$dtstart = $dtend = $dtabbr = '';
1048 1048
 	if (strpos($forme, 'hcal') !== false) {
1049
-		$dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1050
-		$dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1049
+		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
1050
+		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
1051 1051
 		$dtabbr = '</abbr>';
1052 1052
 	}
1053 1053
 
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 			}
1096 1096
 		} else {
1097 1097
 			if ($dtabbr && $dtstart) {
1098
-				$s = $dtstart . spip_ucfirst($s) . $dtabbr;
1098
+				$s = $dtstart.spip_ucfirst($s).$dtabbr;
1099 1099
 			} else {
1100 1100
 				$s = spip_ucfirst($s);
1101 1101
 			}
@@ -1118,8 +1118,8 @@  discard block
 block discarded – undo
1118 1118
 				$date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1119 1119
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1120 1120
 			}
1121
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1122
-			$date_fin = $dtend . $date_fin . $dtabbr;
1121
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1122
+			$date_fin = $dtend.$date_fin.$dtabbr;
1123 1123
 
1124 1124
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1125 1125
 		} else {
@@ -1136,8 +1136,8 @@  discard block
 block discarded – undo
1136 1136
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1137 1137
 			}
1138 1138
 
1139
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1140
-			$date_fin = $dtend . $date_fin . $dtabbr;
1139
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1140
+			$date_fin = $dtend.$date_fin.$dtabbr;
1141 1141
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1142 1142
 		}
1143 1143
 	}
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 		$d = date('Y-m-d');
1242 1242
 	}
1243 1243
 
1244
-	return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1244
+	return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2);
1245 1245
 }
1246 1246
 
1247 1247
 /**
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 		$d = date('Y-m-d');
1262 1262
 	}
1263 1263
 
1264
-	return substr($d, 0, 4) . substr($d, 5, 2);
1264
+	return substr($d, 0, 4).substr($d, 5, 2);
1265 1265
 }
1266 1266
 
1267 1267
 /**
Please login to merge, or discard this patch.