Completed
Push — master ( ad9227...bd2221 )
by cam
01:15
created
ecrire/src/Chiffrer/Chiffrement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
31 31
 		$padded_message = sodium_pad($message, 16);
32 32
 		$encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key);
33
-		$encoded = base64_encode($salt . $nonce . $encrypted);
33
+		$encoded = base64_encode($salt.$nonce.$encrypted);
34 34
 		sodium_memzero($key);
35 35
 		sodium_memzero($nonce);
36 36
 		sodium_memzero($salt);
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 		$decoded = base64_decode($encoded);
48 48
 		$salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES);
49 49
 		$nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
50
-		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
50
+		$encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES +\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
51 51
 		$key = self::deriveKeyFromPassword($key, $salt);
52 52
 		$padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key);
53 53
 		sodium_memzero($key);
54 54
 		sodium_memzero($nonce);
55 55
 		sodium_memzero($salt);
56 56
 		if ($padded_message === false) {
57
-			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG);
57
+			spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer'._LOG_DEBUG);
58 58
 			return null;
59 59
 		}
60 60
 		return sodium_unpad($padded_message, 16);
Please login to merge, or discard this patch.
ecrire/src/Admin/Bouton.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 		/** L'URL de la page (null => ?exec=nom) */
29 29
 		public ?string $url = null,
30 30
 		/** Arguments supplémentaires de l'URL */
31
-		public string|array|null $urlArg = null,
31
+		public string | array | null $urlArg = null,
32 32
 		/** URL du javascript */
33 33
 		public ?string $url2 = null,
34 34
 		/** Pour ouvrir une fenêtre à part */
Please login to merge, or discard this patch.
ecrire/plugins/get_infos.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	static $filecache = '';
39 39
 
40 40
 	if ($cache === '') {
41
-		$filecache = _DIR_TMP . 'plugin_xml_cache.gz';
41
+		$filecache = _DIR_TMP.'plugin_xml_cache.gz';
42 42
 		if (is_file($filecache)) {
43 43
 			lire_fichier($filecache, $contenu);
44 44
 			$cache = unserialize($contenu);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	if (isset($ret['prefix']) && $ret['prefix'] == 'spip') {
128 128
 		$ret['procure']['php'] = ['nom' => 'php', 'version' => phpversion()];
129 129
 		foreach (get_loaded_extensions() as $ext) {
130
-			$ret['procure']['php:' . $ext] = ['nom' => 'php:' . $ext, 'version' => phpversion($ext)];
130
+			$ret['procure']['php:'.$ext] = ['nom' => 'php:'.$ext, 'version' => phpversion($ext)];
131 131
 		}
132 132
 	}
133 133
 	$diff = ($ret != $pcache);
Please login to merge, or discard this patch.
ecrire/plugins/afficher_liste.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	asort($liste_plugins);
64 64
 	$exposed = urldecode(_request('plugin') ?? '');
65 65
 
66
-	$block_par_lettre = false;//count($liste_plugins)>10;
66
+	$block_par_lettre = false; //count($liste_plugins)>10;
67 67
 	$fast_liste_plugins_actifs = [];
68 68
 	$fast_liste_plugins_checked = [];
69 69
 	if (is_array($liste_plugins_actifs)) {
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 		$actif = isset($fast_liste_plugins_actifs[$plug]);
89 89
 		$checked = isset($fast_liste_plugins_checked[$plug]);
90 90
 		$block_actif |= $actif;
91
-		$expose = ($exposed && ($exposed == $plug || $exposed === $dir_plugins . $plug || $exposed === substr(
91
+		$expose = ($exposed && ($exposed == $plug || $exposed === $dir_plugins.$plug || $exposed === substr(
92 92
 			$dir_plugins,
93 93
 			strlen(_DIR_RACINE)
94
-		) . $plug));
95
-		$block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins) . "\n";
94
+		).$plug));
95
+		$block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins)."\n";
96 96
 	}
97 97
 	$res .= $block_par_lettre ? affiche_block_initiale($initiale, $block, $block_actif) : $block;
98 98
 	$class = basename($dir_plugins);
Please login to merge, or discard this patch.
prive/formulaires/configurer_reducteur.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,5 +125,5 @@
 block discarded – undo
125 125
 		return '';
126 126
 	}
127 127
 
128
-	return generer_url_action('tester', "arg=$process&time=" . time());
128
+	return generer_url_action('tester', "arg=$process&time=".time());
129 129
 }
Please login to merge, or discard this patch.
prive/formulaires/declarer_bases.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	if (defined('_DECLARER_CHOIX_DB')) {
30 30
 		$nom_connect = _DECLARER_CHOIX_DB;
31 31
 		$n = '';
32
-		while (in_array($nom_connect . $n, $deja)) {
32
+		while (in_array($nom_connect.$n, $deja)) {
33 33
 			$n = ($n ? $n + 1 : 1);
34 34
 		}
35 35
 		$nom_connect .= $n;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 function liste_serveurs() {
59 59
 	$options = [];
60
-	$dir = _DIR_RESTREINT . 'req/';
60
+	$dir = _DIR_RESTREINT.'req/';
61 61
 	$d = opendir($dir);
62 62
 	if (!$d) {
63 63
 		return [];
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 	while ($f = readdir($d)) {
66 66
 		if (
67 67
 			preg_match('/^(.*)[.]php$/', $f, $s)
68
-			&& is_readable($f = $dir . $f)
68
+			&& is_readable($f = $dir.$f)
69 69
 		) {
70 70
 			require_once($f);
71 71
 			$s = $s[1];
72
-			$v = 'spip_versions_' . $s;
72
+			$v = 'spip_versions_'.$s;
73 73
 			if (function_exists($v) && $v()) {
74 74
 				$options[$s] = "install_select_type_$s";
75 75
 			} else {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 	$link = spip_connect_db($adresse_db, '', $login_db, $pass_db, '@test@', $serveur_db);
129 129
 	if ($link) {
130
-		$GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_' . $serveur_db . '_functions_' . $GLOBALS['spip_sql_version']];
130
+		$GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_'.$serveur_db.'_functions_'.$GLOBALS['spip_sql_version']];
131 131
 		$GLOBALS['connexions'][$serveur_db] = $link;
132 132
 		define('_DECLARER_SERVEUR_DB', $serveur_db);
133 133
 		define('_DECLARER_ADRESSE_DB', $adresse_db);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		$f = preg_replace(',[^\w],', '', (string) $nom_connect);
178 178
 		if ($f !== $nom_connect) {
179 179
 			$erreurs['nom_connect'] = _T('erreur_nom_connect_incorrect');
180
-		} elseif (file_exists(_DIR_CONNECT . $nom_connect . '.php')) {
180
+		} elseif (file_exists(_DIR_CONNECT.$nom_connect.'.php')) {
181 181
 			$erreurs['nom_connect'] = _T('erreur_connect_deja_existant');
182 182
 		} else {
183 183
 			define('_DECLARER_NOM_CONNECT', $nom_connect);
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 			''
212 212
 		);
213 213
 
214
-	install_fichier_connexion(_DIR_CONNECT . _DECLARER_NOM_CONNECT . '.php', $conn);
214
+	install_fichier_connexion(_DIR_CONNECT._DECLARER_NOM_CONNECT.'.php', $conn);
215 215
 
216 216
 	return [
217
-		'message_ok' => _T('install_connect_ok', ['connect' => '<strong>' . _DECLARER_NOM_CONNECT . '</strong>'])
217
+		'message_ok' => _T('install_connect_ok', ['connect' => '<strong>'._DECLARER_NOM_CONNECT.'</strong>'])
218 218
 	];
219 219
 }
Please login to merge, or discard this patch.
prive/formulaires/editer_auteur.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		unset($erreurs['new_login']);
174 174
 	}
175 175
 
176
-	$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur);
176
+	$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.(int) $id_auteur);
177 177
 	$auth_methode = ($auth_methode ?: 'spip');
178 178
 	include_spip('inc/auth');
179 179
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			!autoriser('modifier', 'auteur', $id_auteur, null, ['email' => '?'])
190 190
 			&& $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur
191 191
 			&& !strlen(trim((string) $email))
192
-			&& $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur))
192
+			&& $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.(int) $id_auteur))
193 193
 		) {
194 194
 			$erreurs['email'] = (($id_auteur == $GLOBALS['visiteur_session']['id_auteur']) ? _T('form_email_non_valide') : _T('form_prop_indiquer_email'));
195 195
 		} else {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			#Nouvel auteur
205 205
 			if ((int) $id_auteur == 0) {
206 206
 				#Un auteur existe deja avec cette adresse ?
207
-				if (sql_countsel('spip_auteurs', 'email=' . sql_quote($email)) > 0) {
207
+				if (sql_countsel('spip_auteurs', 'email='.sql_quote($email)) > 0) {
208 208
 					$erreurs['email'] = _T('erreur_email_deja_existant');
209 209
 				}
210 210
 			} else {
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
 				if (
213 213
 					sql_countsel(
214 214
 						'spip_auteurs',
215
-						'email=' . sql_quote($email)
215
+						'email='.sql_quote($email)
216 216
 					) > 0
217 217
 					&& $id_auteur != ($id_auteur_ancien = sql_getfetsel(
218 218
 						'id_auteur',
219 219
 						'spip_auteurs',
220
-						'email=' . sql_quote($email)
220
+						'email='.sql_quote($email)
221 221
 					))
222 222
 				) {
223 223
 					$erreurs['email'] = _T('erreur_email_deja_existant');
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 		&& (!str_contains((string) $url, ':')
239 239
 		&& strncasecmp((string) $url, 'www.', 4) === 0)
240 240
 	) {
241
-		$url = 'http://' . $url;
241
+		$url = 'http://'.$url;
242 242
 		set_request('url_site', $url);
243 243
 	}
244 244
 	// traiter les liens implicites avant de tester l'url
@@ -253,11 +253,11 @@  discard block
 block discarded – undo
253 253
 		$erreurs['login'] = _T('info_non_modifiable');
254 254
 	}
255 255
 	elseif (
256
-		($login = _request('new_login')) && $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur)
256
+		($login = _request('new_login')) && $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.(int) $id_auteur)
257 257
 	) {
258 258
 		// on verifie la meme chose que dans auteurs_edit_config()
259 259
 		if (
260
-			! auth_autoriser_modifier_login($auth_methode)
260
+			!auth_autoriser_modifier_login($auth_methode)
261 261
 			|| !autoriser('modifier', 'auteur', (int) $id_auteur, null, ['login' => true])
262 262
 			// legacy : ne pas risquer d'autoriser la modif login si fonction d'autorisation pas mise a jour et ne teste que l'option email
263 263
 			|| !autoriser('modifier', 'auteur', (int) $id_auteur, null, ['email' => true])
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		// et de revenir sur son profil
385 385
 		if (
386 386
 			$GLOBALS['visiteur_session']['id_auteur'] == $id_auteur
387
-			&& $email_nouveau != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur))
387
+			&& $email_nouveau != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.(int) $id_auteur))
388 388
 		) {
389 389
 			$envoyer_mail = charger_fonction('envoyer_mail', 'inc');
390 390
 			$texte = _T(
@@ -423,12 +423,12 @@  discard block
 block discarded – undo
423 423
 		if (isset($erreurs['message_ok'])) {
424 424
 			if (!isset($res['message_ok'])) { $res['message_ok'] = '';
425 425
 			}
426
-			$res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']);
426
+			$res['message_ok'] = trim($res['message_ok'].' '.$erreurs['message_ok']);
427 427
 		}
428 428
 		if (isset($erreurs['message_erreur']) && $erreurs['message_erreur']) {
429 429
 			if (!isset($res['message_erreur'])) { $res['message_erreur'] = '';
430 430
 			}
431
-			$res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']);
431
+			$res['message_erreur'] = trim($res['message_erreur'].' '.$erreurs['message_erreur']);
432 432
 		}
433 433
 	}
434 434
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 
456 456
 
457 457
 function auteur_reset_password($id_auteur, $erreurs = []) {
458
-	$auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur);
458
+	$auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.(int) $id_auteur);
459 459
 	$config = auteurs_edit_config($auteur);
460 460
 
461 461
 	if ($config['edit_pass']) {
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		include_spip('action/editer_auteur');
491 491
 		auteur_modifier($id_auteur, $set);
492 492
 
493
-		$row = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur);
493
+		$row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.(int) $id_auteur);
494 494
 		include_spip('inc/filtres');
495 495
 		if (
496 496
 			$notifier
Please login to merge, or discard this patch.
prive/formulaires/login.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 			# preparer un lien pour quand redirige_formulaire ne fonctionne pas
144 144
 			$m = redirige_formulaire($res['redirect']);
145 145
 			$valeurs['_deja_loge'] = inserer_attribut(
146
-				'<a>' . _T('login_par_ici') . "</a>$m",
146
+				'<a>'._T('login_par_ici')."</a>$m",
147 147
 				'href',
148 148
 				$res['redirect']
149 149
 			);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 function login_autoriser() {
291 291
 	include_spip('inc/autoriser');
292 292
 	if (!autoriser('ecrire')) {
293
-		$h = generer_url_action('logout', 'logout=prive&url=' . urlencode((string) self()));
293
+		$h = generer_url_action('logout', 'logout=prive&url='.urlencode((string) self()));
294 294
 
295 295
 		return [
296 296
 			'message_erreur' => '<h1>'
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 				. '</h1><p>'
299 299
 				. _T('texte_erreur_visiteur')
300 300
 				. "</p><p class='retour'>[<a href='$h'>"
301
-				. _T('icone_deconnecter') . '</a>]</p>'
301
+				. _T('icone_deconnecter').'</a>]</p>'
302 302
 		];
303 303
 	}
304 304
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		// transformer la cible absolue en cible relative
351 351
 		// pour pas echouer quand la meta adresse_site est foireuse
352 352
 		if (strncmp((string) $cible, (string) ($u = url_de_base()), strlen((string) $u)) == 0) {
353
-			$cible = './' . substr((string) $cible, strlen((string) $u));
353
+			$cible = './'.substr((string) $cible, strlen((string) $u));
354 354
 		} elseif (tester_url_absolue($cible) && !defined('_AUTORISER_LOGIN_ABS_REDIRECT')) {
355 355
 			// si c'est une url absolue, refuser la redirection
356 356
 			// sauf si cette securite est levee volontairement par le webmestre
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	if ($cible && $cible != self('&') && $cible != self()) {
363 363
 		$res['redirect'] = $cible;
364 364
 		$res['message_ok'] = inserer_attribut(
365
-			'<a>' . _T('login_par_ici') . '</a>',
365
+			'<a>'._T('login_par_ici').'</a>',
366 366
 			'href',
367 367
 			$cible
368 368
 		);
Please login to merge, or discard this patch.
prive/transmettre/rss/a_suivre_fonctions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 			}
16 16
 		}
17 17
 		krsort($items);
18
-		$texte = str_replace($placeholder, implode("\n\t", $items) . "\n", (string) $texte);
18
+		$texte = str_replace($placeholder, implode("\n\t", $items)."\n", (string) $texte);
19 19
 	}
20 20
 
21 21
 	return $texte;
Please login to merge, or discard this patch.