Completed
Push — master ( 350a8b...37aa61 )
by cam
01:39
created
ecrire/inc/filtres.php 1 patch
Spacing   +119 added lines, -120 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	}
96 96
 
97 97
 	include_fichiers_fonctions();
98
-	foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) {
98
+	foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) {
99 99
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
100 100
 		if (is_callable($f)) {
101 101
 			return $f;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	// affichage "GIT [master: abcdef]"
231 231
 	$commit = $desc['commit_short'] ?? $desc['commit'];
232 232
 	if ($desc['branch']) {
233
-		$commit = $desc['branch'] . ': ' . $commit;
233
+		$commit = $desc['branch'].': '.$commit;
234 234
 	}
235 235
 	return "{$desc['vcs']} [$commit]";
236 236
 }
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 	}
252 252
 
253 253
 	// version installee par GIT
254
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
254
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
255 255
 		$currentHead = trim(substr((string) $c, 4));
256
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
256
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
257 257
 			return [
258 258
 				'vcs' => 'GIT',
259 259
 				'branch' => basename($currentHead),
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 
269 269
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
270 270
 // et laisser passer les fonctions personnelles baptisees image_...
271
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
272
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
273
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
274
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
275
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
276
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
271
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
272
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
273
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
274
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
275
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
276
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
277 277
 
278 278
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
279 279
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -432,8 +432,8 @@  discard block
 block discarded – undo
432 432
  */
433 433
 function filtre_debug(mixed $val, $key = null) {
434 434
 	$debug = (
435
-		is_null($key) ? '' : (var_export($key, true) . ' = ')
436
-		) . var_export($val, true);
435
+		is_null($key) ? '' : (var_export($key, true).' = ')
436
+		).var_export($val, true);
437 437
 
438 438
 	include_spip('inc/autoriser');
439 439
 	if (autoriser('webmestre')) {
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 		$is_file = false;
490 490
 	}
491 491
 	if ($is_file) {
492
-		$is_local_file = function ($path) {
492
+		$is_local_file = function($path) {
493 493
 			if (str_contains($path, '?')) {
494 494
 				$path = supprimer_timestamp($path);
495 495
 				// remove ?24px added by find_in_theme on .svg files
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 					&& preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)
538 538
 				) {
539 539
 					$srcover = $match[1];
540
-					$srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args);
540
+					$srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args);
541 541
 					$srcover_filter = extraire_attribut($srcover_filter, 'src');
542 542
 					$reduit = str_replace($srcover, $srcover_filter, (string) $reduit);
543 543
 				}
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 	// " -> &quot; et tout ce genre de choses
937 937
 	$u = $GLOBALS['meta']['pcre_u'];
938 938
 	$texte = str_replace('&nbsp;', ' ', $texte);
939
-	$texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte);
939
+	$texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte);
940 940
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
941 941
 	$texte = entites_html($texte, false, false);
942 942
 	// mais bien echapper les double quotes !
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 		return '';
999 999
 	}
1000 1000
 	return preg_replace(
1001
-		',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1001
+		',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1002 1002
 		'',
1003 1003
 		$texte
1004 1004
 	);
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 	if (
1028 1028
 		$texte
1029 1029
 		&& preg_match(
1030
-			',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S',
1030
+			',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S',
1031 1031
 			$texte,
1032 1032
 			$regs
1033 1033
 		)
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
  **/
1117 1117
 function textebrut($texte) {
1118 1118
 	$u = $GLOBALS['meta']['pcre_u'];
1119
-	$texte = preg_replace('/\s+/S' . $u, ' ', $texte);
1119
+	$texte = preg_replace('/\s+/S'.$u, ' ', $texte);
1120 1120
 	$texte = preg_replace('/<(p|br)( [^>]*)?>/iS', "\n\n", $texte);
1121 1121
 	$texte = preg_replace("/^\n+/", '', $texte);
1122 1122
 	$texte = preg_replace("/\n+$/", '', $texte);
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 		)
1152 1152
 	) {
1153 1153
 		foreach ($liens[0] as $a) {
1154
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1154
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1155 1155
 			$ablank = inserer_attribut($a, 'rel', $rel);
1156 1156
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1157 1157
 			$texte = str_replace($a, $ablank, $texte);
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 		foreach ($regs[0] as $a) {
1177 1177
 			$rel = extraire_attribut($a, 'rel') ?? '';
1178 1178
 			if (!str_contains($rel, 'nofollow')) {
1179
-				$rel = 'nofollow' . ($rel ? " $rel" : '');
1179
+				$rel = 'nofollow'.($rel ? " $rel" : '');
1180 1180
 				$anofollow = inserer_attribut($a, 'rel', $rel);
1181 1181
 				$texte = str_replace($a, $anofollow, $texte);
1182 1182
 			}
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 	$texte = preg_replace('@</p>@iS', "\n", $texte);
1207 1207
 	$texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte);
1208 1208
 
1209
-	return preg_replace('@^\s*<br />@S' . $u, '', $texte);
1209
+	return preg_replace('@^\s*<br />@S'.$u, '', $texte);
1210 1210
 }
1211 1211
 
1212 1212
 
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 		return $texte;
1241 1241
 	}
1242 1242
 	include_spip('inc/texte');
1243
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1243
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1244 1244
 		'div' : 'span';
1245 1245
 
1246 1246
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 
1332 1332
 		// Calcul de la taille et choix de l'unité
1333 1333
 		$affichage = _T(
1334
-			'spip:taille_' . $unites[$puissance] . $suffixe_item,
1334
+			'spip:taille_'.$unites[$puissance].$suffixe_item,
1335 1335
 			[
1336 1336
 				'taille' => round($octets / $kilo ** $puissance, $precisions[$puissance])
1337 1337
 			]
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 	}
1366 1366
 	$u = $GLOBALS['meta']['pcre_u'];
1367 1367
 	if ($textebrut) {
1368
-		$texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte));
1368
+		$texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte));
1369 1369
 	}
1370 1370
 	$texte = texte_backend($texte);
1371 1371
 	$texte = str_replace(["'", '"'], ['&#039;', '&#034;'], $texte);
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 	# un message pour abs_url
1401 1401
 	$GLOBALS['mode_abs_url'] = 'url';
1402 1402
 	$url = trim($url);
1403
-	$r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS';
1403
+	$r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS';
1404 1404
 
1405 1405
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1406 1406
 }
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
 
1606 1606
 	$debut = '';
1607 1607
 	$suite = $texte;
1608
-	while ($t = strpos((string) ('-' . $suite), "\n", 1)) {
1608
+	while ($t = strpos((string) ('-'.$suite), "\n", 1)) {
1609 1609
 		$debut .= substr($suite, 0, $t - 1);
1610 1610
 		$suite = substr($suite, $t);
1611 1611
 		$car = substr($suite, 0, 1);
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 			$suite = substr($suite, strlen($regs[0]));
1624 1624
 		}
1625 1625
 	}
1626
-	$texte = $debut . $suite;
1626
+	$texte = $debut.$suite;
1627 1627
 
1628 1628
 	if ($collecteurModeles) {
1629 1629
 		$texte = $collecteurModeles->retablir($texte);
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
 
1632 1632
 	$texte = echappe_retour($texte);
1633 1633
 
1634
-	return $texte . $fin;
1634
+	return $texte.$fin;
1635 1635
 }
1636 1636
 
1637 1637
 
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
 	if (is_array($balise)) {
1901 1901
 		array_walk(
1902 1902
 			$balise,
1903
-			function (&$a, $key, $t) {
1903
+			function(&$a, $key, $t) {
1904 1904
 				$a = extraire_attribut($a, $t);
1905 1905
 			},
1906 1906
 			$attribut
@@ -1994,14 +1994,14 @@  discard block
 block discarded – undo
1994 1994
 
1995 1995
 	if ($old !== null) {
1996 1996
 		// Remplacer l'ancien attribut du meme nom
1997
-		$balise = $r[1] . $insert . $r[5];
1997
+		$balise = $r[1].$insert.$r[5];
1998 1998
 	} else {
1999 1999
 		// preferer une balise " />" (comme <img />)
2000 2000
 		if (preg_match(',/>,', $balise)) {
2001
-			$balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1);
2001
+			$balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1);
2002 2002
 		} // sinon une balise <a ...> ... </a>
2003 2003
 		else {
2004
-			$balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1);
2004
+			$balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1);
2005 2005
 		}
2006 2006
 	}
2007 2007
 
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
 			in_array($operation, ['ajouter', 'commuter'])
2060 2060
 			&& !$is_class_presente
2061 2061
 		) {
2062
-			$class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c);
2062
+			$class_new = ltrim(rtrim($class_new ?? '').' '.$c);
2063 2063
 		} elseif (
2064 2064
 			in_array($operation, ['supprimer', 'commuter'])
2065 2065
 			&& $is_class_presente
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
 // Quelques fonctions de calcul arithmetique
2130 2130
 //
2131 2131
 function floatstr($a) {
2132
-	return str_replace(',', '.', (string)(float) $a);
2132
+	return str_replace(',', '.', (string) (float) $a);
2133 2133
 }
2134 2134
 function strize($f, $a, $b) {
2135 2135
 	return floatstr($f(floatstr($a), floatstr($b)));
@@ -2270,13 +2270,13 @@  discard block
 block discarded – undo
2270 2270
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2271 2271
 		define('_TAGS_NOM_AUTEUR', '');
2272 2272
 	}
2273
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2273
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2274 2274
 	foreach ($tags_acceptes as $tag) {
2275 2275
 		if (strlen($tag)) {
2276
-			$remp1[] = '<' . trim($tag) . '>';
2277
-			$remp1[] = '</' . trim($tag) . '>';
2278
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2279
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2276
+			$remp1[] = '<'.trim($tag).'>';
2277
+			$remp1[] = '</'.trim($tag).'>';
2278
+			$remp2[] = '\x60'.trim($tag).'\x61';
2279
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2280 2280
 		}
2281 2281
 	}
2282 2282
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2395,10 +2395,10 @@  discard block
 block discarded – undo
2395 2395
 	$fichier = basename($url);
2396 2396
 
2397 2397
 	return '<a rel="enclosure"'
2398
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2399
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2400
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2401
-	. '>' . $fichier . '</a>';
2398
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2399
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2400
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2401
+	. '>'.$fichier.'</a>';
2402 2402
 }
2403 2403
 
2404 2404
 /**
@@ -2426,9 +2426,9 @@  discard block
 block discarded – undo
2426 2426
 			} # vieux data
2427 2427
 			$fichier = basename($url);
2428 2428
 			$enclosures[] = '<enclosure'
2429
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2430
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2431
-				. ($length ? ' length="' . $length . '"' : '')
2429
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2430
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2431
+				. ($length ? ' length="'.$length.'"' : '')
2432 2432
 				. ' />';
2433 2433
 		}
2434 2434
 	}
@@ -2454,7 +2454,7 @@  discard block
 block discarded – undo
2454 2454
 		if (extraire_attribut($e, 'rel') == 'tag') {
2455 2455
 			$subjects .= '<dc:subject>'
2456 2456
 				. texte_backend(textebrut($e))
2457
-				. '</dc:subject>' . "\n";
2457
+				. '</dc:subject>'."\n";
2458 2458
 		}
2459 2459
 	}
2460 2460
 
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 	if (is_array($texte)) {
2491 2491
 		array_walk(
2492 2492
 			$texte,
2493
-			function (&$a, $key, $t) {
2493
+			function(&$a, $key, $t) {
2494 2494
 				$a = extraire_balise($a, $t);
2495 2495
 			},
2496 2496
 			$tag
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
 	if (is_array($texte)) {
2539 2539
 		array_walk(
2540 2540
 			$texte,
2541
-			function (&$a, $key, $t) {
2541
+			function(&$a, $key, $t) {
2542 2542
 				$a = extraire_balises($a, $t);
2543 2543
 			},
2544 2544
 			$tag
@@ -2671,7 +2671,7 @@  discard block
 block discarded – undo
2671 2671
 		if ($fond != '404') {
2672 2672
 			$contexte = array_shift($p);
2673 2673
 			$contexte['page'] = $fond;
2674
-			$action = preg_replace('/([?]' . preg_quote((string) $fond, '/') . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2674
+			$action = preg_replace('/([?]'.preg_quote((string) $fond, '/').'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2675 2675
 		}
2676 2676
 	}
2677 2677
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2726,9 +2726,9 @@  discard block
 block discarded – undo
2726 2726
 			. '"'
2727 2727
 			. (is_null($val)
2728 2728
 				? ''
2729
-				: ' value="' . entites_html($val) . '"'
2729
+				: ' value="'.entites_html($val).'"'
2730 2730
 			)
2731
-			. ' type="hidden"' . "\n/>";
2731
+			. ' type="hidden"'."\n/>";
2732 2732
 	}
2733 2733
 
2734 2734
 	return implode('', $hidden);
@@ -2838,7 +2838,7 @@  discard block
 block discarded – undo
2838 2838
 
2839 2839
 	return preg_replace_callback(
2840 2840
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2841
-		fn($x) => "url('" . suivre_lien($path, $x[1]) . "')",
2841
+		fn($x) => "url('".suivre_lien($path, $x[1])."')",
2842 2842
 		$contenu
2843 2843
 	);
2844 2844
 }
@@ -2899,14 +2899,14 @@  discard block
 block discarded – undo
2899 2899
 	) {
2900 2900
 		$distant = true;
2901 2901
 		$cssf = parse_url($css);
2902
-		$cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : '');
2902
+		$cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : '');
2903 2903
 		$cssf = preg_replace(',[?:&=],', '_', $cssf);
2904 2904
 	} else {
2905 2905
 		$distant = false;
2906 2906
 		$cssf = $css;
2907 2907
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2908 2908
 		//propose (rien a faire dans ce cas)
2909
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2909
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2910 2910
 		if (@file_exists($f)) {
2911 2911
 			return $f;
2912 2912
 		}
@@ -2916,7 +2916,7 @@  discard block
 block discarded – undo
2916 2916
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2917 2917
 	$f = $dir_var
2918 2918
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2919
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2919
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2920 2920
 
2921 2921
 	// la css peut etre distante (url absolue !)
2922 2922
 	$contenu = null;
@@ -2963,8 +2963,8 @@  discard block
 block discarded – undo
2963 2963
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2964 2964
 		elseif (str_starts_with($css_direction, $dir_var)) {
2965 2965
 			$css_direction = substr($css_direction, strlen($dir_var));
2966
-			$src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction;
2967
-			$css_direction = '/@@@@@@/' . $css_direction;
2966
+			$src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction;
2967
+			$css_direction = '/@@@@@@/'.$css_direction;
2968 2968
 		}
2969 2969
 		$src[] = $regs[0][$k];
2970 2970
 		$src_direction_css[] = str_replace($import_css, $css_direction, (string) $regs[0][$k]);
@@ -3013,7 +3013,7 @@  discard block
 block discarded – undo
3013 3013
 
3014 3014
 	$f = basename($css, '.css');
3015 3015
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3016
-		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3016
+		. preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3017 3017
 		. '.css';
3018 3018
 
3019 3019
 	if (@filemtime($f) > @filemtime($css) && _VAR_MODE != 'recalcul') {
@@ -3024,7 +3024,7 @@  discard block
 block discarded – undo
3024 3024
 	if ($url_absolue_css == $css) {
3025 3025
 		if (
3026 3026
 			strncmp((string) $GLOBALS['meta']['adresse_site'], $css, $l = strlen((string) $GLOBALS['meta']['adresse_site'])) != 0
3027
-			|| !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3027
+			|| !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3028 3028
 		) {
3029 3029
 			include_spip('inc/distant');
3030 3030
 			$contenu = recuperer_url($css);
@@ -3136,7 +3136,7 @@  discard block
 block discarded – undo
3136 3136
 	$expression = str_replace('\/', '/', $expression);
3137 3137
 	$expression = str_replace('/', '\/', $expression);
3138 3138
 
3139
-	if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) {
3139
+	if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) {
3140 3140
 		if (isset($r[$capte])) {
3141 3141
 			return $r[$capte];
3142 3142
 		} else {
@@ -3178,7 +3178,7 @@  discard block
 block discarded – undo
3178 3178
 	$expression = str_replace('\/', '/', $expression);
3179 3179
 	$expression = str_replace('/', '\/', $expression);
3180 3180
 
3181
-	return (string) preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3181
+	return (string) preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3182 3182
 }
3183 3183
 
3184 3184
 
@@ -3197,7 +3197,7 @@  discard block
 block discarded – undo
3197 3197
 function traiter_doublons_documents(&$doublons, $letexte) {
3198 3198
 
3199 3199
 	// Verifier dans le texte & les notes (pas beau, helas)
3200
-	$t = $letexte . $GLOBALS['les_notes'];
3200
+	$t = $letexte.$GLOBALS['les_notes'];
3201 3201
 
3202 3202
 	if (
3203 3203
 		strstr($t, 'spip_document_')
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
 		if (!isset($doublons['documents'])) {
3212 3212
 			$doublons['documents'] = '';
3213 3213
 		}
3214
-		$doublons['documents'] .= ',' . implode(',', $matches[1]);
3214
+		$doublons['documents'] .= ','.implode(',', $matches[1]);
3215 3215
 	}
3216 3216
 
3217 3217
 	return $letexte;
@@ -3268,7 +3268,7 @@  discard block
 block discarded – undo
3268 3268
 	if ($env) {
3269 3269
 		foreach ($env as $i => $j) {
3270 3270
 			if (is_string($j) && !in_array($i, $ignore_params)) {
3271
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3271
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3272 3272
 			}
3273 3273
 		}
3274 3274
 	}
@@ -3307,7 +3307,7 @@  discard block
 block discarded – undo
3307 3307
 	if ($env) {
3308 3308
 		foreach ($env as $i => $j) {
3309 3309
 			if (is_string($j) && !in_array($i, $ignore_params)) {
3310
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3310
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3311 3311
 			}
3312 3312
 		}
3313 3313
 	}
@@ -3381,11 +3381,11 @@  discard block
 block discarded – undo
3381 3381
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3382 3382
 	if (
3383 3383
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3384
-		&& ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg')
3384
+		&& ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg')
3385 3385
 		&& file_exists($variante_svg_generique)
3386 3386
 	) {
3387 3387
 		if (
3388
-			($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg')
3388
+			($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg')
3389 3389
 			&& file_exists($variante_svg_size)
3390 3390
 		) {
3391 3391
 			$img_file = $variante_svg_size;
@@ -3441,7 +3441,7 @@  discard block
 block discarded – undo
3441 3441
 				return '';
3442 3442
 			}
3443 3443
 		}
3444
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3444
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3445 3445
 	}
3446 3446
 
3447 3447
 	if (file_exists($img_file)) {
@@ -3451,14 +3451,14 @@  discard block
 block discarded – undo
3451 3451
 		$alt = '';
3452 3452
 	}
3453 3453
 	elseif ($alt || $alt === '') {
3454
-		$alt = " alt='" . attribut_html($alt) . "'";
3454
+		$alt = " alt='".attribut_html($alt)."'";
3455 3455
 	}
3456 3456
 	else {
3457
-		$alt = " alt='" . attribut_html($title) . "'";
3457
+		$alt = " alt='".attribut_html($title)."'";
3458 3458
 	}
3459
-	return "<img src='" . attribut_html($img_file) . "'$alt"
3460
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3461
-	. ' ' . ltrim($atts)
3459
+	return "<img src='".attribut_html($img_file)."'$alt"
3460
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3461
+	. ' '.ltrim($atts)
3462 3462
 	. ' />';
3463 3463
 }
3464 3464
 
@@ -3472,10 +3472,10 @@  discard block
 block discarded – undo
3472 3472
  */
3473 3473
 function http_style_background($img, $att = '', $size = null) {
3474 3474
 	if ($size && is_numeric($size)) {
3475
-		$size = trim($size) . 'px';
3475
+		$size = trim($size).'px';
3476 3476
 	}
3477
-	return " style='background" .
3478
-		($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';'
3477
+	return " style='background".
3478
+		($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';'
3479 3479
 		. ($size ? "background-size:{$size};" : '')
3480 3480
 		. "'";
3481 3481
 }
@@ -3585,7 +3585,7 @@  discard block
 block discarded – undo
3585 3585
 		$img = http_img_pack(
3586 3586
 			$img,
3587 3587
 			$alt,
3588
-			$class ? " class='" . attribut_html($class) . "'" : '',
3588
+			$class ? " class='".attribut_html($class)."'" : '',
3589 3589
 			'',
3590 3590
 			['chemin_image' => false, 'utiliser_suffixe_size' => false]
3591 3591
 		);
@@ -3685,9 +3685,9 @@  discard block
 block discarded – undo
3685 3685
 	// regler le alt
3686 3686
 	if ($alt) {
3687 3687
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3688
-		$id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4);
3688
+		$id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4);
3689 3689
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3690
-		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3690
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3691 3691
 		$balise_svg .= $title;
3692 3692
 	}
3693 3693
 	else {
@@ -3735,7 +3735,7 @@  discard block
 block discarded – undo
3735 3735
 	if (is_array($tableau)) {
3736 3736
 		foreach ($tableau as $k => $v) {
3737 3737
 			$res = recuperer_fond(
3738
-				'modeles/' . $modele,
3738
+				'modeles/'.$modele,
3739 3739
 				array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v]))
3740 3740
 			);
3741 3741
 			$texte .= $res;
@@ -3917,7 +3917,7 @@  discard block
 block discarded – undo
3917 3917
 	}
3918 3918
 
3919 3919
 	$c = serialize($c);
3920
-	$cle = calculer_cle_action($form . $c);
3920
+	$cle = calculer_cle_action($form.$c);
3921 3921
 	$c = "$cle:$c";
3922 3922
 
3923 3923
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3975,15 +3975,15 @@  discard block
 block discarded – undo
3975 3975
 	}
3976 3976
 	// toujours encoder l'url source dans le bloc ajax
3977 3977
 	$r = self();
3978
-	$r = ' data-origin="' . $r . '"';
3978
+	$r = ' data-origin="'.$r.'"';
3979 3979
 	$class = 'ajaxbloc';
3980 3980
 	if ($ajaxid && is_string($ajaxid)) {
3981 3981
 		// ajaxid est normalement conforme a un nom de classe css
3982 3982
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3983
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3983
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3984 3984
 	}
3985 3985
 
3986
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3986
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3987 3987
 }
3988 3988
 
3989 3989
 /**
@@ -4028,7 +4028,7 @@  discard block
 block discarded – undo
4028 4028
 		$cle = substr((string) $c, 0, $p);
4029 4029
 		$c = substr((string) $c, $p + 1);
4030 4030
 
4031
-		if ($cle === calculer_cle_action($form . $c)) {
4031
+		if ($cle === calculer_cle_action($form.$c)) {
4032 4032
 			return @unserialize($c);
4033 4033
 		}
4034 4034
 	}
@@ -4148,13 +4148,13 @@  discard block
 block discarded – undo
4148 4148
 				}
4149 4149
 			}
4150 4150
 		}
4151
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4151
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4152 4152
 	} else {
4153 4153
 		$bal = 'a';
4154 4154
 		$att = "href='$url'"
4155
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4156
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4157
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4155
+			. ($title ? " title='".attribut_html($title)."'" : '')
4156
+			. ($class ? " class='".attribut_html($class)."'" : '')
4157
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4158 4158
 			. $evt;
4159 4159
 	}
4160 4160
 	if ($libelle === null) {
@@ -4291,7 +4291,7 @@  discard block
 block discarded – undo
4291 4291
 
4292 4292
 	// Icône
4293 4293
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4294
-	$icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>";
4294
+	$icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>";
4295 4295
 
4296 4296
 	// Markup final
4297 4297
 	if ($type == 'lien') {
@@ -4566,16 +4566,16 @@  discard block
 block discarded – undo
4566 4566
 		$class_form = 'ajax';
4567 4567
 		$class = str_replace('ajax', '', $class);
4568 4568
 	}
4569
-	$class_btn = 'submit ' . trim($class);
4569
+	$class_btn = 'submit '.trim($class);
4570 4570
 
4571 4571
 	if ($confirm) {
4572
-		$confirm = 'confirm("' . attribut_html($confirm) . '")';
4572
+		$confirm = 'confirm("'.attribut_html($confirm).'")';
4573 4573
 		$callback = $callback ? "$confirm?($callback):false" : $confirm;
4574 4574
 	}
4575
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : '';
4575
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : '';
4576 4576
 	$title = $title ? " title='$title'" : '';
4577 4577
 
4578
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4578
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4579 4579
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4580 4580
 }
4581 4581
 
@@ -4639,14 +4639,14 @@  discard block
 block discarded – undo
4639 4639
 		$champ_titre = '';
4640 4640
 		if ($demande_titre) {
4641 4641
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4642
-			$champ_titre = (empty($desc['titre'])) ? '' : ', ' . $desc['titre'];
4642
+			$champ_titre = (empty($desc['titre'])) ? '' : ', '.$desc['titre'];
4643 4643
 		}
4644 4644
 		include_spip('base/abstract_sql');
4645 4645
 		include_spip('base/connect_sql');
4646 4646
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4647
-			'*' . $champ_titre,
4647
+			'*'.$champ_titre,
4648 4648
 			$desc['table_sql'],
4649
-			id_table_objet($type_objet) . ' = ' . (int) $id_objet
4649
+			id_table_objet($type_objet).' = '.(int) $id_objet
4650 4650
 		);
4651 4651
 
4652 4652
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4737,8 +4737,7 @@  discard block
 block discarded – undo
4737 4737
 	if (isset($ligne_sql['chapo'])) {
4738 4738
 		$chapo = $ligne_sql['chapo'];
4739 4739
 		$texte = strlen((string) $descriptif) ?
4740
-			'' :
4741
-			"$chapo \n\n $texte";
4740
+			'' : "$chapo \n\n $texte";
4742 4741
 	}
4743 4742
 
4744 4743
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4810,7 +4809,7 @@  discard block
 block discarded – undo
4810 4809
 		return $texte;
4811 4810
 	}
4812 4811
 
4813
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", (string) $traitement);
4812
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", (string) $traitement);
4814 4813
 
4815 4814
 	// signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag
4816 4815
 	if (test_espace_prive()) {
@@ -4846,7 +4845,7 @@  discard block
 block discarded – undo
4846 4845
 	}
4847 4846
 	$url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect);
4848 4847
 
4849
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>';
4848
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>';
4850 4849
 }
4851 4850
 
4852 4851
 /**
@@ -4872,9 +4871,9 @@  discard block
 block discarded – undo
4872 4871
 function wrap($texte, $wrap) {
4873 4872
 	$balises = extraire_balises($wrap);
4874 4873
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4875
-		$texte = $wrap . $texte;
4874
+		$texte = $wrap.$texte;
4876 4875
 		$regs = array_reverse($regs[1]);
4877
-		$wrap = '</' . implode('></', $regs) . '>';
4876
+		$wrap = '</'.implode('></', $regs).'>';
4878 4877
 		$texte .= $wrap;
4879 4878
 	}
4880 4879
 
@@ -4904,7 +4903,7 @@  discard block
 block discarded – undo
4904 4903
 
4905 4904
 	// caster $u en array si besoin
4906 4905
 	if (is_object($u)) {
4907
-		$u = (array)$u;
4906
+		$u = (array) $u;
4908 4907
 	}
4909 4908
 
4910 4909
 	if (is_array($u)) {
@@ -4926,7 +4925,7 @@  discard block
 block discarded – undo
4926 4925
 		// sinon on passe a la ligne et on indente
4927 4926
 		$i_str = str_pad('', $indent, ' ');
4928 4927
 		foreach ($u as $k => $v) {
4929
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4928
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4930 4929
 		}
4931 4930
 
4932 4931
 		return $out;
@@ -4980,7 +4979,7 @@  discard block
 block discarded – undo
4980 4979
  * @return string
4981 4980
  */
4982 4981
 function objet_icone($objet, $taille = 24, $class = '') {
4983
-	$icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png';
4982
+	$icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png';
4984 4983
 	$icone = chemin_image($icone);
4985 4984
 	$balise_img = charger_filtre('balise_img');
4986 4985
 
@@ -5006,7 +5005,7 @@  discard block
 block discarded – undo
5006 5005
  */
5007 5006
 function objet_T($objet, $chaine, $args = [], $options = []) {
5008 5007
 	$chaine = explode(':', $chaine);
5009
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) {
5008
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) {
5010 5009
 		return $t;
5011 5010
 	}
5012 5011
 	$chaine = implode(':', $chaine);
@@ -5072,7 +5071,7 @@  discard block
 block discarded – undo
5072 5071
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
5073 5072
 
5074 5073
 	// calculer le nom de la css
5075
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5074
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5076 5075
 	$nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond));
5077 5076
 	$contexte_implicite = calculer_contexte_implicite();
5078 5077
 
@@ -5080,14 +5079,14 @@  discard block
 block discarded – undo
5080 5079
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5081 5080
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5082 5081
 	if (isset($options['hash_on_content']) && $options['hash_on_content']) {
5083
-		$hash = md5((string) ($contexte_implicite['host'] . '::' . $cache));
5082
+		$hash = md5((string) ($contexte_implicite['host'].'::'.$cache));
5084 5083
 	}
5085 5084
 	else {
5086 5085
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5087 5086
 		ksort($contexte);
5088
-		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
5087
+		$hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect);
5089 5088
 	}
5090
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5089
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5091 5090
 
5092 5091
 	// mettre a jour le fichier si il n'existe pas
5093 5092
 	// ou trop ancien
@@ -5095,8 +5094,8 @@  discard block
 block discarded – undo
5095 5094
 	// et recopie sur le fichier cible uniquement si il change
5096 5095
 	if (
5097 5096
 		!file_exists($filename)
5098
-		|| !file_exists($filename . '.last')
5099
-		|| isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename . '.last') < $cache['lastmodified']
5097
+		|| !file_exists($filename.'.last')
5098
+		|| isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename.'.last') < $cache['lastmodified']
5100 5099
 		|| defined('_VAR_MODE') && _VAR_MODE == 'recalcul'
5101 5100
 	) {
5102 5101
 		$contenu = $cache['texte'];
@@ -5120,10 +5119,10 @@  discard block
 block discarded – undo
5120 5119
 			}
5121 5120
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5122 5121
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5123
-			$comment .= "}\n   md5:" . md5((string) $contenu) . " */\n";
5122
+			$comment .= "}\n   md5:".md5((string) $contenu)." */\n";
5124 5123
 		}
5125 5124
 		// et ecrire le fichier si il change
5126
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5125
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5127 5126
 	}
5128 5127
 
5129 5128
 	return timestamp($filename);
@@ -5350,7 +5349,7 @@  discard block
 block discarded – undo
5350 5349
 	if ($e > 0 && strlen($mid) > 8) {
5351 5350
 		$mid = '***...***';
5352 5351
 	}
5353
-	return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : '');
5352
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5354 5353
 }
5355 5354
 
5356 5355
 
@@ -5412,7 +5411,7 @@  discard block
 block discarded – undo
5412 5411
 		case 'id':
5413 5412
 		case 'anchor':
5414 5413
 			if (preg_match(',^\d,', $texte)) {
5415
-				$texte = substr($type, 0, 1) . $texte;
5414
+				$texte = substr($type, 0, 1).$texte;
5416 5415
 			}
5417 5416
 	}
5418 5417
 
@@ -5422,9 +5421,9 @@  discard block
 block discarded – undo
5422 5421
 
5423 5422
 	if (strlen($texte) < $longueur_mini && $longueur_mini < $longueur_maxi) {
5424 5423
 		if (preg_match(',^\d,', $texte)) {
5425
-			$texte = ($type ? substr($type, 0, 1) : 's') . $texte;
5424
+			$texte = ($type ? substr($type, 0, 1) : 's').$texte;
5426 5425
 		}
5427
-		$texte .= $separateur . md5($original);
5426
+		$texte .= $separateur.md5($original);
5428 5427
 		$texte = substr($texte, 0, $longueur_mini);
5429 5428
 	}
5430 5429
 
Please login to merge, or discard this patch.
ecrire/inc/plonger.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	$res = sql_select(
34 34
 		'rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant',
35 35
 		'spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)',
36
-		'rub1.id_parent = ' . sql_quote($id_rubrique) . '
37
-			AND rub1.id_rubrique!=' . sql_quote($exclu) . '
38
-			AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu) . ')',
36
+		'rub1.id_parent = '.sql_quote($id_rubrique).'
37
+			AND rub1.id_rubrique!=' . sql_quote($exclu).'
38
+			AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu).')',
39 39
 		'',
40 40
 		'0+rub1.titre,rub1.titre'
41 41
 	);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 				if ($row['langue_choisie'] != 'oui') {
49 49
 					$t .= ' <small title="'
50 50
 						. traduire_nom_langue($row['lang'])
51
-						. '">[' . $row['lang'] . ']</small>';
51
+						. '">['.$row['lang'].']</small>';
52 52
 				}
53 53
 				$ordre[$row['id_rubrique']] = $t;
54 54
 			}
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 	$next = $list[$col] ?? 0;
58 58
 	if ($ordre) {
59
-		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1));
59
+		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=".($col + 1));
60 60
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
61
-		$args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event";
61
+		$args = "'$idom',this,$col,'".$GLOBALS['spip_lang_left']."','$info',event";
62 62
 
63 63
 		foreach ($ordre as $id => $titrebrut) {
64 64
 			$titre = supprimer_numero($titrebrut);
65 65
 
66
-			$classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : 'petit-secteur');
66
+			$classe1 = 'petit-item '.($id_rubrique ? 'petite-rubrique' : 'petit-secteur');
67 67
 			if (isset($rub[$id]['enfants'])) {
68 68
 				$classe2 = " class='rub-ouverte'";
69 69
 				$url = "\nhref='$rec&amp;id=$id'";
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 				$url = "\nhref='javascript:void(0)'";
73 73
 			}
74 74
 
75
-			$js_func = $do . '_selection_titre';
75
+			$js_func = $do.'_selection_titre';
76 76
 			$click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn "
77 77
 				. (is_array($list) ? "aff_selection_provisoire($id,$args)" : ' false')
78 78
 # ce lien provoque la selection (directe) de la rubrique cliquee
@@ -98,17 +98,17 @@  discard block
 block discarded – undo
98 98
 		}
99 99
 	}
100 100
 
101
-	$idom2 = $idom . '_col_' . ($col + 1);
101
+	$idom2 = $idom.'_col_'.($col + 1);
102 102
 	$left = ($col * 250);
103 103
 
104 104
 	return http_img_pack(
105 105
 		'loader.svg',
106 106
 		'',
107
-		"class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ': '
107
+		"class='loader' style='visibility: hidden; position: absolute; ".$GLOBALS['spip_lang_left'].': '
108 108
 		. ($left - 30)
109 109
 		. "px; top: 2px; z-index: 2;' id='img_$idom2'"
110 110
 	)
111
-	. "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ': '
111
+	. "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; ".$GLOBALS['spip_lang_left'].': '
112 112
 	. ($left - 250)
113 113
 	. "px;'>"
114 114
 	. $ret
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  *     Mot de passe
31 31
  **/
32 32
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
33
-	$seed = (int)round(((float)microtime() + 1) * time());
33
+	$seed = (int) round(((float) microtime() + 1) * time());
34 34
 
35 35
 	mt_srand($seed);
36 36
 	$s = '';
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 			if (!$s) {
42 42
 				$s = random_int(0, mt_getrandmax());
43 43
 			}
44
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
44
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
45 45
 		}
46
-		$r = unpack('Cr', pack('H2', $s . $s));
46
+		$r = unpack('Cr', pack('H2', $s.$s));
47 47
 		$x = $r['r'] & 63;
48 48
 		if ($x < 10) {
49 49
 			$x = chr($x + 48);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	static $seeded;
77 77
 
78 78
 	if (!$seeded) {
79
-		$seed = (int)round(((float)microtime() + 1) * time());
79
+		$seed = (int) round(((float) microtime() + 1) * time());
80 80
 		mt_srand($seed);
81 81
 		$seeded = true;
82 82
 	}
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
163 163
 		}
164 164
 	} else {
165
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . (int) $id_auteur);
165
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.(int) $id_auteur);
166 166
 		if (!$low_sec) {
167 167
 			$low_sec = creer_pass_aleatoire();
168
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . (int) $id_auteur);
168
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.(int) $id_auteur);
169 169
 		}
170 170
 	}
171 171
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) {
217 217
 	$id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0;
218 218
 	$cle = afficher_low_sec($id_auteur, "$script/$format $fond $args");
219
-	$path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : '');
219
+	$path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : '');
220 220
 
221 221
 	return generer_url_api($script, $path, $args, $no_entities = false, $public);
222 222
 }
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 	foreach ($args as $val => $var) {
241 241
 		if ($var) {
242 242
 			if ($val != 'statut') {
243
-				$a .= ':' . $val . '-' . $var;
243
+				$a .= ':'.$val.'-'.$var;
244 244
 			}
245
-			$b .= $val . '=' . $var . '&';
245
+			$b .= $val.'='.$var.'&';
246 246
 		}
247 247
 	}
248 248
 	$a = substr($a, 1);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
  *     Clé
273 273
  **/
274 274
 function afficher_low_sec($id_auteur, $action = '') {
275
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
275
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
276 276
 }
277 277
 
278 278
 /**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 	if (!$id_auteur = (int) $id_auteur) {
304 304
 		return;
305 305
 	} // jamais trop prudent ;)
306
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . (int) $id_auteur);
306
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.(int) $id_auteur);
307 307
 }
308 308
 
309 309
 
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
  *     - void sinon.
322 322
  **/
323 323
 function ecrire_acces() {
324
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
325
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
324
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
325
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
326 326
 
327 327
 	// Cette variable de configuration peut etre posee par un plugin
328 328
 	// par exemple acces_restreint ;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		(!isset($GLOBALS['meta']['creer_htpasswd']) || $GLOBALS['meta']['creer_htpasswd'] != 'oui') && !@file_exists($htaccess)
332 332
 	) {
333 333
 		spip_unlink($htpasswd);
334
-		spip_unlink($htpasswd . '-admin');
334
+		spip_unlink($htpasswd.'-admin');
335 335
 		return;
336 336
 	}
337 337
 
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 	$pwd_all = ''; // login:htpass pour tous
360 360
 	$pwd_admin = ''; // login:htpass pour les admins
361 361
 
362
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
362
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
363 363
 	while ($row = sql_fetch($res)) {
364 364
 		if (strlen((string) $row['login']) && strlen((string) $row['htpass'])) {
365
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
365
+			$ligne = $row['login'].':'.$row['htpass']."\n";
366 366
 			$pwd_all .= $ligne;
367 367
 			if ($row['statut'] == '0minirezo') {
368 368
 				$pwd_admin .= $ligne;
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
  * @return boolean
406 406
  */
407 407
 function verifier_htaccess($rep, $force = false) {
408
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
408
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
409 409
 	if ((@file_exists($htaccess) || defined('_TEST_DIRS')) && !$force) {
410 410
 		return true;
411 411
 	}
@@ -432,17 +432,17 @@  discard block
 block discarded – undo
432 432
 		fwrite($ht, $deny);
433 433
 		fclose($ht);
434 434
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
435
-		$t = rtrim($rep, '/') . '/.ok';
435
+		$t = rtrim($rep, '/').'/.ok';
436 436
 		if ($ht = @fopen($t, 'w')) {
437 437
 			@fclose($ht);
438 438
 			include_spip('inc/distant');
439 439
 			$t = substr($t, strlen(_DIR_RACINE));
440
-			$t = url_de_base() . $t;
440
+			$t = url_de_base().$t;
441 441
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
442 442
 			$ht = ($ht['status'] ?? null) === 403;
443 443
 		}
444 444
 	}
445
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
445
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
446 446
 
447 447
 	return $ht;
448 448
 }
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
469 469
 	$dirs[] = ['extension' => 'distant'];
470 470
 	foreach ($dirs as $e) {
471
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
471
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
472 472
 			if ($f) {
473 473
 				verifier_htaccess($dir);
474 474
 			} else {
475
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
475
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
476 476
 			}
477 477
 		}
478 478
 	}
Please login to merge, or discard this patch.
ecrire/inc/rechercher.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	if (str_starts_with($recherche, '/') && str_ends_with($recherche, '/') && strlen($recherche) > 2) {
99 99
 		// c'est une preg
100 100
 		$recherche_trans = translitteration($recherche);
101
-		$preg = $recherche_trans . $options['preg_flags'];
101
+		$preg = $recherche_trans.$options['preg_flags'];
102 102
 		$is_preg = true;
103 103
 	} else {
104 104
 		// s'il y a plusieurs mots il faut les chercher tous : oblige REGEXP,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 			}
119 119
 		}
120 120
 
121
-		if (preg_match(',\s+,' . $u, $recherche_mod)) {
121
+		if (preg_match(',\s+,'.$u, $recherche_mod)) {
122 122
 			$is_preg = true;
123 123
 
124 124
 			$recherche_inter = '|';
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 			foreach ($recherche_mots as $mot) {
129 129
 				if (strlen($mot) >= $min_long) {
130 130
 					// echapper les caracteres de regexp qui sont eventuellement dans la recherche
131
-					$recherche_inter .= preg_quote($mot) . ' ';
131
+					$recherche_inter .= preg_quote($mot).' ';
132 132
 					$petits_mots = false;
133 133
 				}
134 134
 			}
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 
137 137
 			// mais on cherche quand même l'expression complète, même si elle
138 138
 			// comporte des mots de moins de quatre lettres
139
-			$recherche = trim(preg_replace(',\s+,' . $u, '|', $recherche_inter), '|');
139
+			$recherche = trim(preg_replace(',\s+,'.$u, '|', $recherche_inter), '|');
140 140
 			if (!$recherche || $petits_mots) {
141 141
 				$recherche = preg_quote($recherche_org);
142 142
 			}
143 143
 			$recherche_trans = translitteration($recherche);
144 144
 		}
145 145
 
146
-		$preg = '/' . str_replace('/', '\\/', (string) $recherche_trans) . '/' . $options['preg_flags'];
146
+		$preg = '/'.str_replace('/', '\\/', (string) $recherche_trans).'/'.$options['preg_flags'];
147 147
 	}
148 148
 
149 149
 	// Si la chaine est inactive, on va utiliser LIKE pour aller plus vite
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 		}
181 181
 		$q = sql_quote(
182 182
 			'%'
183
-			. preg_replace(',\s+,' . $u, '%', $q)
183
+			. preg_replace(',\s+,'.$u, '%', $q)
184 184
 			. '%'
185 185
 		);
186 186
 
187
-		$preg = '/' . preg_replace(',\s+,' . $u, '.+', trim((string) $recherche_mod)) . '/' . $options['preg_flags'];
187
+		$preg = '/'.preg_replace(',\s+,'.$u, '.+', trim((string) $recherche_mod)).'/'.$options['preg_flags'];
188 188
 	} else {
189 189
 		$methode = 'REGEXP';
190 190
 		$q = sql_quote(trim($recherche, '/'));
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 	foreach ($tables as $table => $champs) {
304 304
 		# lock via memoization, si dispo
305 305
 		if (function_exists('cache_lock')) {
306
-			cache_lock($lock = _RECHERCHE_LOCK_KEY . ' ' . $table . ' ' . $recherche);
306
+			cache_lock($lock = _RECHERCHE_LOCK_KEY.' '.$table.' '.$recherche);
307 307
 		}
308 308
 
309 309
 		spip_timer('rech');
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 
320 320
 		spip_log(
321
-			"recherche $table ($recherche) : " . (is_countable($results[$table]) ? count($results[$table]) : 0) . ' resultats ' . spip_timer('rech'),
321
+			"recherche $table ($recherche) : ".(is_countable($results[$table]) ? count($results[$table]) : 0).' resultats '.spip_timer('rech'),
322 322
 			'recherche'
323 323
 		);
324 324
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
 	$results = recherche_en_base($recherche, $tables, $options);
354 354
 
355
-	$preg = '/' . str_replace('/', '\\/', (string) $recherche) . '/' . $options['preg_flags'];
355
+	$preg = '/'.str_replace('/', '\\/', (string) $recherche).'/'.$options['preg_flags'];
356 356
 
357 357
 	foreach ($results as $table => $r) {
358 358
 		$_id_table = id_table_objet($table);
Please login to merge, or discard this patch.
ecrire/inc/icone_renommer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 
47 47
 	$dir = 'images/';
48 48
 	$f = "$type-$size.png";
49
-	if ($icone = find_in_theme($dir . $f)) {
49
+	if ($icone = find_in_theme($dir.$f)) {
50 50
 		$dir = dirname((string) $icone);
51 51
 		$fond = $icone;
52 52
 
53 53
 		if (
54 54
 			$rtl
55
-			&& ($fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename((string) $icone)))
55
+			&& ($fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename((string) $icone)))
56 56
 			&& file_exists($fr)
57 57
 		) {
58 58
 			$fond = $fr;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 
70 70
 		$fonction = '';
71
-		if (in_array($action, ['add','del', 'new', 'edit', 'config'])) {
71
+		if (in_array($action, ['add', 'del', 'new', 'edit', 'config'])) {
72 72
 			$fonction = $action;
73 73
 		}
74 74
 
Please login to merge, or discard this patch.
ecrire/inc/auth.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	}
59 59
 
60 60
 	$n = (int) sql_errno();
61
-	spip_log("Erreur base de donnees $n " . sql_error());
61
+	spip_log("Erreur base de donnees $n ".sql_error());
62 62
 
63 63
 	return $n ?: 1;
64 64
 }
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
 		// erreur SQL a afficher
102 102
 		$raison = minipres(
103 103
 			_T('info_travaux_titre'),
104
-			_T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>'
104
+			_T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>'
105 105
 		);
106 106
 	} elseif (@$raison['statut']) {
107 107
 		// un simple visiteur n'a pas acces a l'espace prive
108
-		spip_log('connexion refusee a ' . @$raison['id_auteur']);
108
+		spip_log('connexion refusee a '.@$raison['id_auteur']);
109 109
 		$est_connecte = (!empty($GLOBALS['visiteur_session']['login']) && !empty($GLOBALS['visiteur_session']['statut'])); // idem test balise #URL_LOGOUT
110 110
 		$raison = minipres(
111 111
 			_T('avis_erreur_connexion'),
112 112
 			_T('avis_erreur_visiteur')
113 113
 				// Lien vers le site public
114
-				. '<br /><a href="' . url_de_base() . '">' . _T('login_retour_public') . '</a>'
114
+				. '<br /><a href="'.url_de_base().'">'._T('login_retour_public').'</a>'
115 115
 				// Si la personne est connectée, lien de déconnexion ramenant vers la page de login
116
-				. ($est_connecte ? ' | <a href="' . generer_url_public('', 'action=logout&amp;logout=prive') . '">' . _T('icone_deconnecter') . '</a>' : '')
116
+				. ($est_connecte ? ' | <a href="'.generer_url_public('', 'action=logout&amp;logout=prive').'">'._T('icone_deconnecter').'</a>' : '')
117 117
 		);
118 118
 	} else {
119 119
 		// auteur en fin de droits ...
@@ -201,8 +201,7 @@  discard block
 block discarded – undo
201 201
 	$where = (is_numeric($id_auteur)
202 202
 		/*AND $id_auteur>0*/ // reprise lors des restaurations
203 203
 	) ?
204
-		"id_auteur=$id_auteur" :
205
-		(strlen((string) $GLOBALS['connect_login']) ? 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text') : '');
204
+		"id_auteur=$id_auteur" : (strlen((string) $GLOBALS['connect_login']) ? 'login='.sql_quote($GLOBALS['connect_login'], '', 'text') : '');
206 205
 
207 206
 	if (!$where) {
208 207
 		return '';
@@ -244,7 +243,7 @@  discard block
 block discarded – undo
244 243
 	$GLOBALS['connect_login'] = $row['login'];
245 244
 	$GLOBALS['connect_statut'] = $row['statut'];
246 245
 
247
-	$GLOBALS['visiteur_session'] = array_merge((array)$GLOBALS['visiteur_session'], $row);
246
+	$GLOBALS['visiteur_session'] = array_merge((array) $GLOBALS['visiteur_session'], $row);
248 247
 
249 248
 	// au cas ou : ne pas memoriser les champs sensibles
250 249
 	unset($GLOBALS['visiteur_session']['pass']);
@@ -316,7 +315,7 @@  discard block
 block discarded – undo
316 315
  * @return string
317 316
  */
318 317
 function auth_a_loger() {
319
-	$redirect = generer_url_public('login', 'url=' . rawurlencode((string) self('&', true)), true);
318
+	$redirect = generer_url_public('login', 'url='.rawurlencode((string) self('&', true)), true);
320 319
 
321 320
 	// un echec au "bonjour" (login initial) quand le statut est
322 321
 	// inconnu signale sans doute un probleme de cookies
@@ -352,7 +351,7 @@  discard block
 block discarded – undo
352 351
 	$date ??= date('Y-m-d H:i:s');
353 352
 
354 353
 	if (abs(strtotime($date) - $connect_quand) >= 60) {
355
-		sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . (int) $row['id_auteur']);
354
+		sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.(int) $row['id_auteur']);
356 355
 		$row['en_ligne'] = $date;
357 356
 	}
358 357
 
@@ -460,7 +459,7 @@  discard block
 block discarded – undo
460 459
 	if (
461 460
 		!$login
462 461
 		|| !($login_base = auth_retrouver_login($login, $serveur))
463
-		|| !($row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur))
462
+		|| !($row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur))
464 463
 	) {
465 464
 		// generer de fausses infos, mais credibles, pour eviter une attaque
466 465
 		// https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691
@@ -569,7 +568,7 @@  discard block
 block discarded – undo
569 568
 	sql_updateq(
570 569
 		'spip_auteurs',
571 570
 		['prefs' => serialize($p)],
572
-		'id_auteur=' . (int) $auteur['id_auteur']
571
+		'id_auteur='.(int) $auteur['id_auteur']
573 572
 	);
574 573
 
575 574
 	//  bloquer ici le visiteur qui tente d'abuser de ses droits
@@ -733,7 +732,7 @@  discard block
 block discarded – undo
733 732
 		return false;
734 733
 	}
735 734
 
736
-	$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur);
735
+	$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur);
737 736
 
738 737
 	if (!$row) {
739 738
 		if (
@@ -789,11 +788,11 @@  discard block
 block discarded – undo
789 788
 	$retour = $retour ?: _T('icone_retour');
790 789
 	$corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] ";
791 790
 	if ($url) {
792
-		$corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]";
791
+		$corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]";
793 792
 	}
794 793
 
795 794
 	if ($lien) {
796
-		$corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]';
795
+		$corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]';
797 796
 	}
798 797
 	include_spip('inc/minipres');
799 798
 	echo minipres($pb, $corps);
Please login to merge, or discard this patch.
ecrire/inc/journal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 		return;
28 28
 	}
29 29
 	if ($opt) {
30
-		$phrase .= ' :: ' . str_replace("\n", ' ', implode(', ', $opt));
30
+		$phrase .= ' :: '.str_replace("\n", ' ', implode(', ', $opt));
31 31
 	}
32 32
 	spip_log($phrase, 'journal');
33 33
 }
Please login to merge, or discard this patch.
ecrire/inc/envoyer_mail.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 	// ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin
133 133
 	if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', (string) $from)) {
134
-		$from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', (string) $from))) . ')';
134
+		$from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', (string) $from))).')';
135 135
 	}
136 136
 
137 137
 	// nettoyer les &eacute; &#8217, &emdash; etc...
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		if (!_TEST_EMAIL_DEST) {
170 170
 			return false;
171 171
 		} else {
172
-			$texte = "Dest : $destinataire\r\n" . $texte;
172
+			$texte = "Dest : $destinataire\r\n".$texte;
173 173
 			$destinataire = _TEST_EMAIL_DEST;
174 174
 		}
175 175
 	}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	// Ajouter le Content-Type et consort s'il n'y est pas deja
194 194
 	if (!str_contains($headers, 'Content-Type: ')) {
195 195
 		$type =
196
-			"Content-Type: text/plain;charset=\"$charset\";\n" .
196
+			"Content-Type: text/plain;charset=\"$charset\";\n".
197 197
 			"Content-Transfer-Encoding: 8bit\n";
198 198
 	} else {
199 199
 		$type = '';
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
 
202 202
 	// calculer un identifiant unique
203 203
 	// Marie Toto <[email protected]> => @toto.com
204
-	$domain = preg_match('/@[^\s>]+/', $from, $domain) ? $domain[0] : '@unknown-' . md5($from) . '.org';
205
-	$uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain;
204
+	$domain = preg_match('/@[^\s>]+/', $from, $domain) ? $domain[0] : '@unknown-'.md5($from).'.org';
205
+	$uniq = random_int(0, mt_getrandmax()).'_'.md5($to.$texte).$domain;
206 206
 
207 207
 	// Si multi-part, s'en servir comme borne ...
208 208
 	if ($parts) {
209
-		$texte = "--$uniq\n$type\n" . $texte . "\n";
209
+		$texte = "--$uniq\n$type\n".$texte."\n";
210 210
 		foreach ($parts as $part) {
211
-			$n = strlen((string) $part[1]) . ($part[0] ? "\n" : '');
211
+			$n = strlen((string) $part[1]).($part[0] ? "\n" : '');
212 212
 			$e = implode("\n", $part[0]);
213
-			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1];
213
+			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1];
214 214
 		}
215 215
 		$texte .= "\n\n--$uniq--\n";
216 216
 		// Si boundary n'est pas entre guillemets,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
 	// .. et s'en servir pour plaire a SpamAssassin
222 222
 
223
-	$mid = 'Message-Id: <' . $uniq . '>';
223
+	$mid = 'Message-Id: <'.$uniq.'>';
224 224
 
225 225
 	// indispensable pour les sites qui collent d'office From: serveur-http
226 226
 	// sauf si deja mis par l'envoyeur
Please login to merge, or discard this patch.
ecrire/inc/lien_court.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	$coupe_url = defined('_MAX_COUPE_URL') ? _MAX_COUPE_URL : 35;
26 26
 
27 27
 	if (strlen((string) $url) > $long_url) {
28
-		$url = substr((string) $url, 0, $coupe_url) . '...';
28
+		$url = substr((string) $url, 0, $coupe_url).'...';
29 29
 	}
30 30
 
31 31
 	return $url;
Please login to merge, or discard this patch.