Completed
Push — master ( 11381c...fc67b6 )
by cam
01:49
created
ecrire/bootstrap/inc/path.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @param null|array $add List of «plugins» directories to add
14 14
  */
15 15
 function spip_paths(
16
-	null|array $add = null,
16
+	null | array $add = null,
17 17
 ): AggregatorInterface {
18 18
 	static $paths = null;
19 19
 	static $last_dossier_squelettes = null;
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 		$paths = new GroupAggregator(Group::cases(), _ROOT_CWD);
25 25
 		$paths = $paths->with(Group::App, [
26 26
 			_DIR_RACINE,
27
-			_DIR_RACINE . 'squelettes-dist/',
28
-			_DIR_RACINE . 'prive/',
27
+			_DIR_RACINE.'squelettes-dist/',
28
+			_DIR_RACINE.'prive/',
29 29
 			_DIR_RESTREINT,
30 30
 		]);
31 31
 
32
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
33
-			$paths = $paths->with(Group::Templates, [_DIR_RACINE . 'squelettes']);
32
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
33
+			$paths = $paths->with(Group::Templates, [_DIR_RACINE.'squelettes']);
34 34
 		}
35 35
 	}
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$ds = explode(':', $dossier_squelettes);
45 45
 			foreach ($ds as $key => $directory) {
46 46
 				if (!str_starts_with($directory, '/')) {
47
-					$ds[$key] = _DIR_RACINE . $directory;
47
+					$ds[$key] = _DIR_RACINE.$directory;
48 48
 				}
49 49
 			}
50 50
 			$paths = $paths->with(Group::ExtraTemplates, $ds);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
  * @return array
102 102
  *     Liste des chemins, par ordre de priorité.
103 103
  **/
104
-function _chemin(string|array|null $dir_path = null): array {
104
+function _chemin(string | array | null $dir_path = null): array {
105 105
 	if (is_array($dir_path) || (is_string($dir_path) && strlen($dir_path))) {
106 106
 		spip_paths(add: is_array($dir_path) ? $dir_path : explode(':', $dir_path));
107 107
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 function creer_chemin(): array {
118 118
 	$dirs = spip_paths()->getDirectories();
119 119
 	// canal historique: avec / sauf si ''
120
-	return array_map(fn ($dir) => $dir === '' ? $dir : $dir . DIRECTORY_SEPARATOR, $dirs);
120
+	return array_map(fn ($dir) => $dir === '' ? $dir : $dir.DIRECTORY_SEPARATOR, $dirs);
121 121
 }
122 122
 
123 123
 /**
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
164 164
 	if (
165 165
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
166
-		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg')
166
+		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg')
167 167
 		&& ($f = find_in_theme("$file_svg_generique"))
168 168
 	) {
169
-		if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) {
169
+		if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) {
170 170
 			return $themefiles["$subdir$file"] = $fsize;
171 171
 		}
172 172
 		else {
173
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
173
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
174 174
 		}
175 175
 	}
176 176
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			return $themefiles["$subdir$file"] = $f;
181 181
 		}
182 182
 	}
183
-	spip_logger('theme')->info("$file introuvable dans le theme prive " . reset($themes));
183
+	spip_logger('theme')->info("$file introuvable dans le theme prive ".reset($themes));
184 184
 
185 185
 	return $themefiles["$subdir$file"] = '';
186 186
 }
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
  *     - string : chemin du fichier trouvé
261 261
  *     - false : fichier introuvable
262 262
  **/
263
-function find_in_path(string $file, string $dirname = '', bool|string $include = false): ?string {
263
+function find_in_path(string $file, string $dirname = '', bool | string $include = false): ?string {
264 264
 
265 265
 	$loader = spip_paths_loader();
266 266
 
267 267
 	if ($dirname) {
268
-		$file = rtrim($dirname, '/') . '/' . $file;
268
+		$file = rtrim($dirname, '/').'/'.$file;
269 269
 	}
270 270
 
271 271
 	$path = $loader->get($file);
272 272
 	// find in path retourne des chemins relatif, si possible
273 273
 	if ($path !== null && str_starts_with($path, _ROOT_RACINE)) {
274
-		$path = _DIR_RACINE . substr($path, strlen(_ROOT_RACINE));
274
+		$path = _DIR_RACINE.substr($path, strlen(_ROOT_RACINE));
275 275
 	}
276 276
 
277 277
 	if ($include === false) {
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
327 327
 	// on a pas encore inclus flock.php
328 328
 	if (!function_exists('preg_files')) {
329
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
329
+		include_once _ROOT_RESTREINT.'inc/flock.php';
330 330
 	}
331 331
 
332 332
 	// Parcourir le chemin
333 333
 	foreach (creer_chemin() as $d) {
334
-		$f = $d . $dir;
334
+		$f = $d.$dir;
335 335
 		if (@is_dir($f)) {
336 336
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
337 337
 			foreach ($liste as $chemin) {
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/jobs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
 
145 145
 	if ($queue_next_job_time == -1) {
146 146
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
147
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
147
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
148 148
 		}
149 149
 		// utiliser un cache memoire si dispo
150 150
 		if (function_exists('cache_get') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) {
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/logging.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	if ($loggerFactory === null) {
37 37
 		$spipToMonologLevels = [
38 38
 			Level::Emergency, // _LOG_HS
39
-			Level::Alert,     // _LOG_ALERTE_ROUGE
40
-			Level::Critical,  // _LOG_CRITIQUE
41
-			Level::Error,     // _LOG_ERREUR
42
-			Level::Warning,   // _LOG_AVERTISSEMENT
43
-			Level::Notice,    // _LOG_INFO_IMPORTANTE
44
-			Level::Info,      // _LOG_INFO
45
-			Level::Debug,     // _LOG_DEBUG
39
+			Level::Alert, // _LOG_ALERTE_ROUGE
40
+			Level::Critical, // _LOG_CRITIQUE
41
+			Level::Error, // _LOG_ERREUR
42
+			Level::Warning, // _LOG_AVERTISSEMENT
43
+			Level::Notice, // _LOG_INFO_IMPORTANTE
44
+			Level::Info, // _LOG_INFO
45
+			Level::Debug, // _LOG_DEBUG
46 46
 		];
47 47
 
48 48
 		$config = [
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			// échappement des log
56 56
 			'brut' => defined('_LOG_BRUT') ? constant('_LOG_BRUT') : null,
57 57
 			// à quel level on commence à logguer
58
-			'max_level' => (function() use ($spipToMonologLevels): Level {
58
+			'max_level' => (function() use ($spipToMonologLevels) : Level {
59 59
 				if (!defined('_LOG_FILTRE_GRAVITE')) {
60 60
 					return Level::Notice;
61 61
 				}
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
 {
137 137
     static $spipToMonologLevels = [
138 138
 		Level::Emergency, // _LOG_HS
139
-		Level::Alert,     // _LOG_ALERTE_ROUGE
140
-		Level::Critical,  // _LOG_CRITIQUE
141
-		Level::Error,     // _LOG_ERREUR
142
-		Level::Warning,   // _LOG_AVERTISSEMENT
143
-		Level::Notice,    // _LOG_INFO_IMPORTANTE
144
-		Level::Info,      // _LOG_INFO
145
-		Level::Debug,     // _LOG_DEBUG
139
+		Level::Alert, // _LOG_ALERTE_ROUGE
140
+		Level::Critical, // _LOG_CRITIQUE
141
+		Level::Error, // _LOG_ERREUR
142
+		Level::Warning, // _LOG_AVERTISSEMENT
143
+		Level::Notice, // _LOG_INFO_IMPORTANTE
144
+		Level::Info, // _LOG_INFO
145
+		Level::Debug, // _LOG_DEBUG
146 146
     ];
147 147
 
148 148
 	# Éviter de trop polluer les logs de dépréciation
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/urls.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	foreach ($regexp as $r => $e) {
86 86
 		$regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e));
87 87
 	}
88
-	$regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,';
88
+	$regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,';
89 89
 	$ajouts = array_flip(explode('|', $c));
90 90
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
91 91
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			// Ajout. Pour une variable, remplacer au meme endroit,
113 113
 			// pour un tableau ce sera fait dans la prochaine boucle
114 114
 			elseif (!str_ends_with($r[1], '[]')) {
115
-				$url[$n] = $r[1] . '=' . $u;
115
+				$url[$n] = $r[1].'='.$u;
116 116
 				unset($ajouts[$r[1]]);
117 117
 			}
118 118
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 	} elseif ($testv) {
134 134
 		foreach ($ajouts as $k => $n) {
135 135
 			if (!is_array($v)) {
136
-				$url[] = $k . '=' . $u;
136
+				$url[] = $k.'='.$u;
137 137
 			} else {
138
-				$id = (str_ends_with($k, '[]')) ? $k : ($k . '[]');
138
+				$id = (str_ends_with($k, '[]')) ? $k : ($k.'[]');
139 139
 				foreach ($v as $w) {
140
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
140
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
141 141
 				}
142 142
 			}
143 143
 		}
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 
149 149
 	// recomposer l'adresse
150 150
 	if ($url) {
151
-		$a .= '?' . join($sep, $url);
151
+		$a .= '?'.join($sep, $url);
152 152
 	}
153 153
 
154
-	return $a . $ancre;
154
+	return $a.$ancre;
155 155
 }
156 156
 
157 157
 /**
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			translitteration($ancre)
182 182
 		);
183 183
 	}
184
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
184
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
185 185
 }
186 186
 
187 187
 /**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			if (str_starts_with($var, '^')) {
227 227
 				$var = substr($var, 1);
228 228
 			} else {
229
-				$var = '[^=&]*' . $var;
229
+				$var = '[^=&]*'.$var;
230 230
 			}
231 231
 			if (str_ends_with($var, '$')) {
232 232
 				$var = substr($var, 0, -1);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 				$var .= '[^=&]*';
235 235
 			}
236 236
 		}
237
-		$preg_nettoyer = ',([?&])(' . implode('|', $preg_nettoyer_vars) . ')=[^&]*(&|$),i';
237
+		$preg_nettoyer = ',([?&])('.implode('|', $preg_nettoyer_vars).')=[^&]*(&|$),i';
238 238
 	}
239 239
 	if (empty($request_uri)) {
240 240
 		return $request_uri;
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	}
365 365
 
366 366
 	// On a ete gentil mais la ....
367
-	spip_logger()->error("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect");
367
+	spip_logger()->error("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect");
368 368
 
369 369
 	return '';
370 370
 }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	include_spip('base/connect_sql');
416 416
 	$id_type = id_table_objet($entite, $public);
417 417
 
418
-	return _DIR_RACINE . get_spip_script('./')
419
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
418
+	return _DIR_RACINE.get_spip_script('./')
419
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
420 420
 	. (!$args ? '' : "&$args")
421 421
 	. (!$ancre ? '' : "#$ancre");
422 422
 }
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				!empty($_SERVER['QUERY_STRING'])
567 567
 				&& !str_contains($_SERVER['REQUEST_URI'], '?')
568 568
 			) {
569
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
569
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
570 570
 			}
571 571
 		}
572 572
 	}
@@ -604,9 +604,9 @@  discard block
 block discarded – undo
604 604
 		array_shift($myself);
605 605
 		$myself = implode('/', $myself);
606 606
 	}
607
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
607
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
608 608
 
609
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
609
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
610 610
 
611 611
 	return $url;
612 612
 }
@@ -645,16 +645,16 @@  discard block
 block discarded – undo
645 645
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
646 646
 	$script ??= '';
647 647
 	if (!$rel) {
648
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
648
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
649 649
 	} else {
650 650
 		if (!is_string($rel)) {
651
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
651
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
652 652
 		}
653 653
 	}
654 654
 
655 655
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
656 656
 	if ($script && ($script <> 'accueil' || $rel)) {
657
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
657
+		$args = "?exec=$script".(!$args ? '' : "&$args");
658 658
 	} elseif ($args) {
659 659
 		$args = "?$args";
660 660
 	}
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 		$args .= "#$ancre";
663 663
 	}
664 664
 
665
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
665
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
666 666
 }
667 667
 
668 668
 //
@@ -744,10 +744,10 @@  discard block
 block discarded – undo
744 744
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
745 745
 		}
746 746
 		if ($args) {
747
-			$action .= (str_contains($action, '?') ? '&' : '?') . $args;
747
+			$action .= (str_contains($action, '?') ? '&' : '?').$args;
748 748
 		}
749 749
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
750
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
750
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
751 751
 	}
752 752
 
753 753
 	if (!$no_entities) {
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 
760 760
 function generer_url_prive($script, $args = '', $no_entities = false) {
761 761
 
762
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
762
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
763 763
 }
764 764
 
765 765
 
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 		: generer_url_public('', '', false, false);
788 788
 	$url = parametre_url($url, 'action', $script);
789 789
 	if ($args) {
790
-		$url .= quote_amp('&' . $args);
790
+		$url .= quote_amp('&'.$args);
791 791
 	}
792 792
 
793 793
 	if ($no_entities) {
@@ -821,9 +821,9 @@  discard block
 block discarded – undo
821 821
 	}
822 822
 	$url =
823 823
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
824
-	. $script . '/'
824
+	. $script.'/'
825 825
 	. ($path ? trim($path, '/') : '')
826
-	. ($args ? '?' . quote_amp($args) : '');
826
+	. ($args ? '?'.quote_amp($args) : '');
827 827
 
828 828
 	if ($no_entities) {
829 829
 		$url = str_replace('&amp;', '&', $url);
Please login to merge, or discard this patch.
ecrire/genie/optimiser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function optimiser_caches_contextes() {
52 52
 	sous_repertoire(_DIR_CACHE, 'contextes');
53
-	if (is_dir($d = _DIR_CACHE . 'contextes')) {
53
+	if (is_dir($d = _DIR_CACHE.'contextes')) {
54 54
 		include_spip('inc/invalideur');
55 55
 		purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]);
56 56
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	$logger = spip_logger('genie');
99
-	$logger->debug('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR));
99
+	$logger->debug('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR));
100 100
 	if ($tables) {
101 101
 		$table_op = (int) (lire_config('optimiser_table', 0) + 1) % count($tables);
102 102
 		ecrire_config('optimiser_table', $table_op);
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 	sql_free($sel);
141 141
 
142 142
 	if ($in) {
143
-		sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : ''));
144
-		spip_logger('genie')->debug("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)));
143
+		sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : ''));
144
+		spip_logger('genie')->debug("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)));
145 145
 	}
146 146
 
147 147
 	return count($in);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) {
222 222
 		define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600);
223 223
 	}
224
-	sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU)));
224
+	sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU)));
225 225
 
226 226
 	/**
227 227
 	 * Permet aux plugins de compléter l'optimisation suite aux éléments disparus
Please login to merge, or discard this patch.
ecrire/genie/mise_a_jour.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 function genie_mise_a_jour_dist($t) {
29 29
 	include_spip('inc/meta');
30 30
 	$maj = info_maj($GLOBALS['spip_version_branche']);
31
-	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : '', 'non');
31
+	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche']."|$maj") : '', 'non');
32 32
 
33 33
 	mise_a_jour_ecran_securite();
34 34
 
35
-	spip_logger('verifie_maj')->info('Verification version SPIP : ' . ($maj ?: 'version a jour'));
35
+	spip_logger('verifie_maj')->info('Verification version SPIP : '.($maj ?: 'version a jour'));
36 36
 
37 37
 	return 1;
38 38
 }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	// si l'ecran n'est pas deja present ou pas updatable, sortir
58 58
 	if (
59 59
 		!_URL_ECRAN_SECURITE
60
-		|| !file_exists($filename = _DIR_ETC . 'ecran_securite.php')
60
+		|| !file_exists($filename = _DIR_ETC.'ecran_securite.php')
61 61
 		|| !is_writable($filename)
62 62
 		|| !($last_modified = filemtime($filename))
63 63
 		|| !($md5 = md5_file($filename))
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	include_spip('inc/distant');
69
-	$tmp_file = _DIR_TMP . 'ecran_securite.php';
69
+	$tmp_file = _DIR_TMP.'ecran_securite.php';
70 70
 	$url = parametre_url(_URL_ECRAN_SECURITE, 'md5', $md5);
71 71
 	$url = parametre_url($url, 'vspip', $GLOBALS['spip_version_branche']);
72 72
 	$res = recuperer_url($url, [
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			include_once $tmp_file;
86 86
 			// ok, on le copie a la place de l'ecran existant
87 87
 			// en backupant l'ecran avant, au cas ou
88
-			@copy($filename, $filename . '-bck-' . date('Y-m-d-His', $last_modified));
88
+			@copy($filename, $filename.'-bck-'.date('Y-m-d-His', $last_modified));
89 89
 			@rename($tmp_file, $filename);
90 90
 		} else {
91 91
 			@unlink($tmp_file);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$message[] = _T('nouvelle_version_spip_majeure', ['version' => $maj['majeure']]);
128 128
 	}
129 129
 
130
-	return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="' . $maj['mineure'] . '">' . implode(' | ', $message) . '</a>';
130
+	return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="'.$maj['mineure'].'">'.implode(' | ', $message).'</a>';
131 131
 }
132 132
 
133 133
 /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 function info_maj_cache(): ?array {
145 145
 	$contenu = '';
146 146
 	$options = [];
147
-	$nom = _DIR_CACHE . _VERSIONS_LISTE;
147
+	$nom = _DIR_CACHE._VERSIONS_LISTE;
148 148
 	if (file_exists($nom)) {
149 149
 		$contenu = file_get_contents($nom);
150 150
 		$options['if_modified_since'] = filemtime($nom);
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	try {
166 166
 		$json = json_decode((string) $contenu, true, 512, JSON_THROW_ON_ERROR);
167 167
 	} catch (JsonException $e) {
168
-		spip_logger('verifie_maj')->info('Failed to parse Json data : ' . $e->getMessage());
168
+		spip_logger('verifie_maj')->info('Failed to parse Json data : '.$e->getMessage());
169 169
 		return null;
170 170
 	}
171 171
 
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 
198 198
 	foreach ($versions as $v) {
199 199
 		[$maj2, $min2, $rev2] = explode('.', $v);
200
-		$branche_maj = $maj2 . '.' . $min2;
201
-		$version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
200
+		$branche_maj = $maj2.'.'.$min2;
201
+		$version_maj = $maj2.'.'.$min2.'.'.$rev2;
202 202
 		$is_version_stable = is_numeric($rev2);
203 203
 		// d'abord les mises à jour de la même branche (version mineure)
204 204
 		if (
Please login to merge, or discard this patch.
ecrire/balise/url_.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 function generer_generer_url_arg($type, $p, $_id) {
75 75
 	if ($s = trouver_nom_serveur_distant($p)) {
76 76
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
77
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
77
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
78 78
 			return $f($type, $_id, $s);
79 79
 		}
80 80
 		if (!$GLOBALS['connexions'][strtolower((string) $s)]['spip_connect_version']) {
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 		# exception des urls de documents sur un serveur distant...
85 85
 		if ($type == 'document') {
86 86
 			return
87
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
88
-				"quete_meta('dir_img', $s) . \n\t" .
87
+				"quete_meta('adresse_site', $s) . '/' .\n\t".
88
+				"quete_meta('dir_img', $s) . \n\t".
89 89
 				"quete_fichier($_id,$s)";
90 90
 		}
91 91
 		$s = ", '', '', $s, quete_meta('type_urls', $s)";
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  */
226 226
 function balise_URL_SITE_SPIP_dist($p) {
227 227
 	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
228
-	$p->code = 'spip_htmlspecialchars(' . $p->code . ')';
228
+	$p->code = 'spip_htmlspecialchars('.$p->code.')';
229 229
 	$p->interdire_scripts = false;
230 230
 
231 231
 	return $p;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	if ($s = trouver_nom_serveur_distant($p)) {
267 267
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
268 268
 		// elle devra aussi traiter le cas derogatoire type=page
269
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
269
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
270 270
 			if ($args && $args !== "''") {
271 271
 				$code .= ", $args";
272 272
 			}
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 			$p->code = $code;
275 275
 			return $p;
276 276
 		}
277
-		$s = 'connect=' . addslashes((string) $s);
277
+		$s = 'connect='.addslashes((string) $s);
278 278
 		$args = (($args && $args !== "''") ? "$args . '&$s'" : "'$s'");
279 279
 	}
280 280
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		$code = "generer_url_public($code, $args$noentities)";
290 290
 	}
291 291
 	$p->code = $code;
292
-	spip_logger()->info("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args");
292
+	spip_logger()->info("Calcul url page : connect vaut $s ca donne :".$p->code." args $args");
293 293
 
294 294
 	#$p->interdire_scripts = true;
295 295
 	return $p;
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			$fonc .= ",$args$noentities";
334 334
 		}
335 335
 	}
336
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
336
+	$p->code = 'generer_url_ecrire('.$fonc.')';
337 337
 	$p->interdire_scripts = false;
338 338
 
339 339
 	return $p;
@@ -368,17 +368,17 @@  discard block
 block discarded – undo
368 368
 
369 369
 	$args = interprete_argument_balise(2, $p);
370 370
 	if ($args != "''" && $args !== null) {
371
-		$p->code .= ',' . $args;
371
+		$p->code .= ','.$args;
372 372
 	}
373 373
 	$redirect = interprete_argument_balise(3, $p);
374 374
 	if ($redirect != "''" && $redirect !== null) {
375 375
 		if ($args == "''" || $args === null) {
376 376
 			$p->code .= ",''";
377 377
 		}
378
-		$p->code .= ',' . $redirect;
378
+		$p->code .= ','.$redirect;
379 379
 	}
380 380
 
381
-	$p->code = 'generer_action_auteur(' . $p->code . ')';
381
+	$p->code = 'generer_action_auteur('.$p->code.')';
382 382
 	$p->interdire_scripts = false;
383 383
 
384 384
 	return $p;
Please login to merge, or discard this patch.
ecrire/maj/legacy/v40.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@
 block discarded – undo
64 64
 				foreach ($desc['field'] as $field => $type) {
65 65
 					if ($desc['field'][$field] !== $fields_corrected[$field]) {
66 66
 						spip_logger('maj')->notice("Adaptation TIMESTAMP table $table");
67
-						sql_alter("table $table change $field $field " . $fields_corrected[$field]);
67
+						sql_alter("table $table change $field $field ".$fields_corrected[$field]);
68 68
 						$trouver_table('');
69 69
 						$new_desc = $trouver_table($table);
70 70
 						spip_logger('maj')->notice(
71
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
71
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
72 72
 						);
73 73
 					}
74 74
 				}
Please login to merge, or discard this patch.
ecrire/maj/2021.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 $GLOBALS['maj'][2021_02_18_00] = [
25
-	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ],
26
-	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ],
25
+	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"],
26
+	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"],
27 27
 ];
28 28
 
29 29
 $GLOBALS['maj'][2022_02_23_02] = [
30
-	['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL" ],
31
-	['sql_delete', 'spip_meta', "nom='secret_du_site'" ],
30
+	['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL"],
31
+	['sql_delete', 'spip_meta', "nom='secret_du_site'"],
32 32
 ];
33 33
 
34 34
 $GLOBALS['maj'][2022_02_23_03] = [
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		spip_logger('maj')->info('supprimer sessions auteur');
48 48
 		if ($dir = opendir(_DIR_SESSIONS)) {
49 49
 			while (($f = readdir($dir)) !== false) {
50
-				spip_unlink(_DIR_SESSIONS . $f);
50
+				spip_unlink(_DIR_SESSIONS.$f);
51 51
 				if (time() >= _TIME_OUT) {
52 52
 					return;
53 53
 				}
Please login to merge, or discard this patch.