Completed
Push — master ( a38486...89fc77 )
by cam
01:34
created
ecrire/inc/surligne.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 function surligner_mots($page, $surcharge_surligne = '') {
38 38
 	$surlignejs_engines = [
39 39
 		[
40
-			',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i',
40
+			','.str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']).',i',
41 41
 			',recherche=([^&]+),i'
42 42
 		], //SPIP
43 43
 		[',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 			//good referrer found or var_recherche is not null
73 73
 			include_spip('inc/filtres');
74 74
 			$script = "
75
-      <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script>
75
+      <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js'))."'></script>
76 76
       <script type='text/javascript'>
77 77
        var highlighter = function() {
78 78
 		  jQuery(this).SearchHighlight({
79
-            tag_name:'" . (html5_permis() ? 'mark' : 'span') . "',
79
+            tag_name:'" . (html5_permis() ? 'mark' : 'span')."',
80 80
             style_name:'spip_surligne',
81 81
             exact:'whole',
82 82
             style_name_suffix:false,
83
-            engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i],
83
+            engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site'])."/i,/recherche=([^&]+)/i],
84 84
             highlight:'.surlignable',
85 85
             nohighlight:'.pas_surlignable'" .
86 86
 				($surcharge_surligne ? ",
87
-            keys:'$surcharge_surligne'" : '') . ',
87
+            keys:'$surcharge_surligne'" : '').',
88 88
             min_length: 3
89 89
           });
90 90
 	  }
Please login to merge, or discard this patch.
ecrire/base/trouver_table.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	// de connexion, et tout risque d'ambiguite
91 91
 	if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) {
92 92
 		$nom_cache_desc_sql[$serveur][$objets_sql] =
93
-			_DIR_CACHE . 'sql_desc_'
93
+			_DIR_CACHE.'sql_desc_'
94 94
 			. ($serveur ? "{$serveur}_" : '')
95
-			. substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8)
95
+			. substr(md5($connexion['db'].':'.$connexion['prefixe'].":$objets_sql"), 0, 8)
96 96
 			. '.txt';
97 97
 		// nouveau nom de cache = nouvelle version en memoire
98 98
 		unset($connexion['tables']);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	if ($connexion['spip_connect_version']) {
121 121
 		if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) {
122 122
 			$nom = $GLOBALS['table_des_tables'][$nom];
123
-			$nom_sql = 'spip_' . $nom;
123
+			$nom_sql = 'spip_'.$nom;
124 124
 		}
125 125
 	}
126 126
 
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
 		// meme si pas d'abreviation declaree, trouver la table spip_$nom
148 148
 		// si c'est une table principale,
149 149
 		// puisqu'on le fait aussi pour les tables auxiliaires
150
-		elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) {
151
-			$nom_sql = 'spip_' . $nom;
150
+		elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_'.$nom])) {
151
+			$nom_sql = 'spip_'.$nom;
152 152
 			$fdesc = &$GLOBALS['tables_principales'][$nom_sql];
153 153
 		} elseif (
154 154
 			isset($GLOBALS['tables_auxiliaires'][$n = $nom])
155
-			or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom])
155
+			or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_'.$nom])
156 156
 		) {
157 157
 			$nom_sql = $n;
158 158
 			$fdesc = &$GLOBALS['tables_auxiliaires'][$n];
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		) {
169 169
 			if (!$fdesc) {
170 170
 				$log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG;
171
-				spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level);
171
+				spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base'.$log_level);
172 172
 
173 173
 				return null;
174 174
 			}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			$desc['exist'] = true;
181 181
 			// gerer le cas des cles vides (echec de l'analyse sur une vue par exemple)
182 182
 			// pour recuperer la declaration de lister_tables_objets_sql() si il y en a une
183
-			if (! $desc['key']) {
183
+			if (!$desc['key']) {
184 184
 				spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base');
185 185
 				unset($desc['key']);
186 186
 			}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		if (!isset($desc['key']) && !empty($fdesc['key'])) {
198 198
 			$desc['key'] = $fdesc['key'];
199 199
 		}
200
-		if (! isset($desc['key'])) {
200
+		if (!isset($desc['key'])) {
201 201
 			$desc['key'] = [];
202 202
 		}
203 203
 
Please login to merge, or discard this patch.
ecrire/action/editer_article.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	);
107 107
 
108 108
 	// Si l'article est publie, invalider les caches et demander sa reindexation
109
-	$t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article));
109
+	$t = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id_article));
110 110
 	$invalideur = $indexation = false;
111 111
 	if ($t == 'publie') {
112 112
 		$invalideur = "id='article/$id_article'";
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			$id_article,
120 120
 			[
121 121
 			'data' => $set,
122
-			'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article],
122
+			'nonvide' => ['titre' => _T('info_nouvel_article').' '._T('info_numero_abbreviation').$id_article],
123 123
 			'invalideur' => $invalideur,
124 124
 			'indexation' => $indexation,
125 125
 			'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		} elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') {
310 310
 			$statut = $champs['statut'] = $s;
311 311
 		} else {
312
-			spip_log("editer_article $id_article refus " . join(' ', $c));
312
+			spip_log("editer_article $id_article refus ".join(' ', $c));
313 313
 		}
314 314
 
315 315
 		// En cas de publication, fixer la date a "maintenant"
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		isset($c['id_parent'])
335 335
 		and $id_parent = $c['id_parent']
336 336
 		and $id_parent != $id_rubrique
337
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
337
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
338 338
 	) {
339 339
 		$champs['id_rubrique'] = $id_parent;
340 340
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	// Si on deplace l'article
436 436
 	//  changer aussi son secteur et sa langue (si heritee)
437 437
 	if (isset($champs['id_rubrique'])) {
438
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
438
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
439 439
 
440 440
 		$langue = $row_rub['lang'];
441 441
 		$champs['id_secteur'] = $row_rub['id_secteur'];
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 			sql_fetsel(
444 444
 				'1',
445 445
 				'spip_articles',
446
-				'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
446
+				'id_article='.intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
447 447
 			)
448 448
 		) {
449 449
 			$champs['lang'] = $langue;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		return;
455 455
 	}
456 456
 
457
-	sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article));
457
+	sql_updateq('spip_articles', $champs, 'id_article='.intval($id_article));
458 458
 
459 459
 	// Changer le statut des rubriques concernees
460 460
 
@@ -475,6 +475,6 @@  discard block
 block discarded – undo
475 475
 		foreach ($plus as $n => $t) {
476 476
 			$plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t);
477 477
 		}
478
-		set_request('texte', join('', $plus) . _request('texte'));
478
+		set_request('texte', join('', $plus)._request('texte'));
479 479
 	}
480 480
 }
Please login to merge, or discard this patch.
ecrire/auth/ldap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	$credentials_ldap = ['ldap_dn' => $dn, 'ldap_password' => $pass];
69 69
 
70 70
 	// Si l'utilisateur figure deja dans la base, y recuperer les infos
71
-	$r = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login) . " AND source='ldap'", '', '', '', '', $serveur);
71
+	$r = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login)." AND source='ldap'", '', '', '', '', $serveur);
72 72
 
73 73
 	if ($r) {
74 74
 		return array_merge($r, $credentials_ldap);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	if ($r) {
93 93
 		return array_merge(
94 94
 			$credentials_ldap,
95
-			sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($r), '', '', '', '', $serveur)
95
+			sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($r), '', '', '', '', $serveur)
96 96
 		);
97 97
 	}
98 98
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	$connexion = spip_connect($serveur);
122 122
 	if (!is_array($connexion['ldap'])) {
123 123
 		if ($connexion['authentification']['ldap']) {
124
-			$f = _DIR_CONNECT . $connexion['authentification']['ldap'];
124
+			$f = _DIR_CONNECT.$connexion['authentification']['ldap'];
125 125
 			unset($GLOBALS['ldap_link']);
126 126
 			if (is_readable($f)) {
127 127
 				include_once($f);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 	if (!ldap_bind($link, $dn, session_get('ldap_password'))) {
335 335
 		return false;
336 336
 	}
337
-	$encoded_pass = '{MD5}' . base64_encode(pack('H*', md5($new_pass)));
337
+	$encoded_pass = '{MD5}'.base64_encode(pack('H*', md5($new_pass)));
338 338
 	$success = ldap_mod_replace($link, $dn, ['userPassword' => $encoded_pass]);
339 339
 
340 340
 	return $success;
Please login to merge, or discard this patch.
ecrire/inc/documents.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) {
65
-		$fichier = _DIR_IMG . $fichier;
65
+		$fichier = _DIR_IMG.$fichier;
66 66
 	}
67 67
 
68 68
 	// fichier normal
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
 			or !$r = verifier_upload_autorise($dest)
159 159
 			or $r['autozip']
160 160
 		) {
161
-			$dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1];
161
+			$dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1];
162 162
 			break;
163 163
 		}
164 164
 		else {
165 165
 			$dest = substr($dest, 0, -strlen($m[0]));
166
-			$ext = $m[1] . '.' . $ext;
166
+			$ext = $m[1].'.'.$ext;
167 167
 		}
168 168
 	}
169 169
 
170 170
 	// Si le document "source" est deja au bon endroit, ne rien faire
171
-	if ($source == ($dir . $dest . '.' . $ext)) {
171
+	if ($source == ($dir.$dest.'.'.$ext)) {
172 172
 		return $source;
173 173
 	}
174 174
 
175 175
 	// sinon tourner jusqu'a trouver un numero correct
176 176
 	$n = 0;
177
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
177
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
178 178
 		;
179 179
 	}
180 180
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 function deplacer_fichier_upload($source, $dest, $move = false) {
236 236
 	// Securite
237 237
 	if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) {
238
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
238
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
239 239
 	} else {
240 240
 		$dest = preg_replace(',\.\.+,', '.', $dest);
241 241
 	}
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 
318 318
 		default: /* autre */
319 319
 			if (!$msg) {
320
-				$msg = _T('pass_erreur') . ' ' . $error
321
-					. '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
320
+				$msg = _T('pass_erreur').' '.$error
321
+					. '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
322 322
 			}
323 323
 			break;
324 324
 	}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	include_spip('inc/minipres');
337 337
 	echo minipres(
338 338
 		$msg,
339
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>'
339
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>'
340 340
 	);
341 341
 	exit;
342 342
 }
Please login to merge, or discard this patch.
ecrire/public.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	if (!defined('_DIR_RESTREINT_ABS')) {
31 31
 		if (
32 32
 			defined('_DIR_RESTREINT')
33
-			and @file_exists(_ROOT_RESTREINT . 'inc_version.php')
33
+			and @file_exists(_ROOT_RESTREINT.'inc_version.php')
34 34
 		) {
35
-			include_once _ROOT_RESTREINT . 'inc_version.php';
35
+			include_once _ROOT_RESTREINT.'inc_version.php';
36 36
 		} else {
37 37
 			die('inc_version absent ?');
38 38
 		}
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		} // fond demande dans l'url par page=xxxx ?
44 44
 		else {
45 45
 			if (isset($_GET[_SPIP_PAGE])) {
46
-				$fond = (string)$_GET[_SPIP_PAGE];
46
+				$fond = (string) $_GET[_SPIP_PAGE];
47 47
 
48 48
 				// Securite
49 49
 				if (
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			// lancer les taches sur affichage final, comme le cron
108 108
 			// mais sans rien afficher
109 109
 			$GLOBALS['html'] = false; // ne rien afficher
110
-			pipeline('affichage_final' . _PIPELINE_SUFFIX, '');
110
+			pipeline('affichage_final'._PIPELINE_SUFFIX, '');
111 111
 			exit; // le hit est fini !
112 112
 		}
113 113
 	}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	// Content-Type ?
125 125
 	if (!isset($page['entetes']['Content-Type'])) {
126 126
 		$charset = $GLOBALS['meta']['charset'] ?? 'utf-8';
127
-		$page['entetes']['Content-Type'] = 'text/html; charset=' . $charset;
127
+		$page['entetes']['Content-Type'] = 'text/html; charset='.$charset;
128 128
 		$html = true;
129 129
 	} else {
130 130
 		$html = preg_match(',^\s*text/html,', $page['entetes']['Content-Type']);
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 
151 151
 	// traitements sur les entetes avant envoi
152 152
 	// peut servir pour le plugin de stats
153
-	$page['entetes'] = pipeline('affichage_entetes_final' . _PIPELINE_SUFFIX, $page['entetes']);
153
+	$page['entetes'] = pipeline('affichage_entetes_final'._PIPELINE_SUFFIX, $page['entetes']);
154 154
 
155 155
 
156 156
 	// eval $page et affecte $res
157
-	include _ROOT_RESTREINT . 'public/evaluer_page.php';
157
+	include _ROOT_RESTREINT.'public/evaluer_page.php';
158 158
 	envoyer_entetes($page['entetes']);
159 159
 	if ($res === false) {
160 160
 		include_spip('inc/autoriser');
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	//
174 174
 	// (c'est ici qu'on fait var_recherche, validation, boutons d'admin,
175 175
 	// cf. public/assembler.php)
176
-	echo pipeline('affichage_final' . _PIPELINE_SUFFIX, $page['texte']);
176
+	echo pipeline('affichage_final'._PIPELINE_SUFFIX, $page['texte']);
177 177
 
178 178
 	if ($lang) {
179 179
 		lang_select();
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		if ($html and ($affiche_boutons_admin or $debug)) {
190 190
 			$var_mode_affiche = _request('var_mode_affiche');
191 191
 			$var_mode_objet = _request('var_mode_objet');
192
-			$GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet . 'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : '');
192
+			$GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet.'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : '');
193 193
 			echo erreur_squelette(false);
194 194
 		}
195 195
 	} else {
Please login to merge, or discard this patch.
ecrire/iterateur/data.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		// Si a ce stade on n'a pas de table, il y a un bug
235 235
 		if (!is_array($this->tableau)) {
236 236
 			$this->err = true;
237
-			spip_log('erreur datasource ' . var_export($command, true));
237
+			spip_log('erreur datasource '.var_export($command, true));
238 238
 		}
239 239
 
240 240
 		// {datapath query.results}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			isset($this->command['sourcemode'])
277 277
 			and !in_array($this->command['sourcemode'], ['table', 'array', 'tableau'])
278 278
 		) {
279
-			charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true);
279
+			charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true);
280 280
 		}
281 281
 
282 282
 		# le premier argument peut etre un array, une URL etc.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		# avons-nous un cache dispo ?
286 286
 		$cle = null;
287 287
 		if (is_string($src)) {
288
-			$cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true));
288
+			$cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true));
289 289
 		}
290 290
 
291 291
 		$cache = $this->cache_get($cle);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
 					if (
346 346
 						!$this->err
347
-						and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true)
347
+						and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true)
348 348
 					) {
349 349
 						$args = $this->command['source'];
350 350
 						$args[0] = $data;
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
 							$tv = '%s';
485 485
 						} # {par valeur/xx/yy} ??
486 486
 						else {
487
-							$tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')';
487
+							$tv = 'table_valeur(%s, '.var_export($r[1], true).')';
488 488
 						}
489 489
 						$sortfunc .= '
490
-					$a = ' . sprintf($tv, '$aa') . ';
491
-					$b = ' . sprintf($tv, '$bb') . ';
490
+					$a = ' . sprintf($tv, '$aa').';
491
+					$b = ' . sprintf($tv, '$bb').';
492 492
 					if ($a <> $b)
493
-						return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;';
493
+						return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;';
494 494
 					}
495 495
 				}
496 496
 			}
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 function inc_sql_to_array_dist($data) {
644 644
 	# sortir le connecteur de $data
645 645
 	preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v);
646
-	$serveur = (string)$v[1];
646
+	$serveur = (string) $v[1];
647 647
 	$req = trim($v[2]);
648 648
 	if ($s = sql_query($req, $serveur)) {
649 649
 		$r = [];
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 		$json = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
669 669
 	} catch (JsonException $e) {
670 670
 		$json = null;
671
-		spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO);
671
+		spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO);
672 672
 	}
673 673
 	return is_array($json) ? (array) $json : [];
674 674
 }
@@ -688,13 +688,13 @@  discard block
 block discarded – undo
688 688
 	$i = 1;
689 689
 	foreach ($entete as $k => $v) {
690 690
 		if (trim($v) == '') {
691
-			$v = 'col' . $i;
691
+			$v = 'col'.$i;
692 692
 		} // reperer des eventuelles cases vides
693 693
 		if (is_numeric($v) and $v < 0) {
694
-			$v = '__' . $v;
694
+			$v = '__'.$v;
695 695
 		} // ne pas risquer d'ecraser une cle numerique
696 696
 		if (is_numeric($v)) {
697
-			$v = '_' . $v;
697
+			$v = '_'.$v;
698 698
 		} // ne pas risquer d'ecraser une cle numerique
699 699
 		$v = strtolower(preg_replace(',\W+,', '_', translitteration($v)));
700 700
 		foreach ($csv as &$item) {
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
  * @return array|bool
781 781
  */
782 782
 function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) {
783
-	return (array)preg_files($dir, $regexp, $limit);
783
+	return (array) preg_files($dir, $regexp, $limit);
784 784
 }
785 785
 
786 786
 /**
@@ -795,13 +795,13 @@  discard block
 block discarded – undo
795 795
 	$glob_to_array = charger_fonction('glob_to_array', 'inc');
796 796
 	$a = $glob_to_array($data);
797 797
 	foreach ($a as &$v) {
798
-		$b = (array)@stat($v);
798
+		$b = (array) @stat($v);
799 799
 		foreach ($b as $k => $ignore) {
800 800
 			if (is_numeric($k)) {
801 801
 				unset($b[$k]);
802 802
 			}
803 803
 		}
804
-		$b['file'] = preg_replace('`/$`', '', $v) ;
804
+		$b['file'] = preg_replace('`/$`', '', $v);
805 805
 		$v = array_merge(
806 806
 			pathinfo($v),
807 807
 			$b
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	$xml_array = [];
822 822
 	for ($object->rewind(); $object->valid(); $object->next()) {
823 823
 		if (array_key_exists($key = $object->key(), $xml_array)) {
824
-			$key .= '-' . uniqid();
824
+			$key .= '-'.uniqid();
825 825
 		}
826 826
 		$vars = get_object_vars($object->current());
827 827
 		if (isset($vars['@attributes'])) {
Please login to merge, or discard this patch.
ecrire/maj/legacy/v30.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
61 61
 
62 62
 	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
63
-	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's');
64
-	$liens = 'spip_' . $pivots . '_liens';
65
-	$id_pivot = 'id_' . $pivot;
63
+	$pivots = ($exceptions_pluriel[$pivot] ?? $pivot.'s');
64
+	$liens = 'spip_'.$pivots.'_liens';
65
+	$id_pivot = 'id_'.$pivot;
66 66
 	// Creer spip_auteurs_liens
67 67
 	global $tables_auxiliaires;
68 68
 	if (!$l) {
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 		$l = preg_replace(',[^\w],', '', $l); // securite
75 75
 		$primary = "id_$l";
76 76
 		$objet = ($l == 'syndic' ? 'site' : $l);
77
-		$ls = ($exceptions_pluriel[$l] ?? $l . 's');
78
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
77
+		$ls = ($exceptions_pluriel[$l] ?? $l.'s');
78
+		$ancienne_table = 'spip_'.$pivots.'_'.$ls;
79 79
 		$pool = 400;
80 80
 
81 81
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
112 112
 			$insert = [];
113 113
 			foreach ($ids as $id) {
114
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id));
115
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) {
114
+				$n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id));
115
+				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) {
116 116
 					$n += is_countable($t) ? count($t) : 0;
117 117
 					// empiler en s'assurant a minima de l'unicite
118 118
 					while ($r = array_shift($t)) {
119
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
+						$insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
120 120
 					}
121 121
 					if (count($insert) >= $sub_pool) {
122 122
 						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 
268 268
 	// cas particulier spip_auteurs : retablir le collate binary sur le login
269 269
 	$desc = $trouver_table('spip_auteurs');
270
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
+	spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
271 271
 	if (stripos($desc['field']['login'], 'BINARY') === false) {
272 272
 		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
273 273
 		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
274 274
 		$trouver_table('');
275 275
 		$new_desc = $trouver_table('spip_auteurs');
276
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
+		spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
277 277
 	}
278 278
 
279 279
 	foreach ($tables as $table) {
@@ -292,27 +292,27 @@  discard block
 block discarded – undo
292 292
 					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
293 293
 					$urls = [];
294 294
 					foreach ($data as $d) {
295
-						$key = $d['id_parent'] . '::' . strtolower($d['url']);
295
+						$key = $d['id_parent'].'::'.strtolower($d['url']);
296 296
 						if (!isset($urls[$key])) {
297 297
 							$urls[$key] = true;
298 298
 						} else {
299 299
 							spip_log(
300
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
301
-								'maj.' . _LOG_INFO_IMPORTANTE
300
+								'Suppression doublon dans spip_urls avant conversion : '.serialize($d),
301
+								'maj.'._LOG_INFO_IMPORTANTE
302 302
 							);
303
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
+							sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url']));
304 304
 						}
305 305
 					}
306 306
 				}
307 307
 				foreach ($desc['field'] as $field => $type) {
308 308
 					if ($desc['field'][$field] !== $desc_collate[$field]) {
309
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
310
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
309
+						spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE);
310
+						sql_alter("table $table change $field $field ".$desc_collate[$field]);
311 311
 						$trouver_table('');
312 312
 						$new_desc = $trouver_table($table);
313 313
 						spip_log(
314
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
315
-							'maj.' . _LOG_INFO_IMPORTANTE
314
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
315
+							'maj.'._LOG_INFO_IMPORTANTE
316 316
 						);
317 317
 						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
318 318
 					}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 $GLOBALS['maj'][19236] = [
330 330
 	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
331
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
+	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins
332 332
 	['maj_collation_sqlite'],
333 333
 ];
334 334
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	spip_log('supprimer sessions auteur');
346 346
 	if ($dir = opendir(_DIR_SESSIONS)) {
347 347
 		while (($f = readdir($dir)) !== false) {
348
-			spip_unlink(_DIR_SESSIONS . $f);
348
+			spip_unlink(_DIR_SESSIONS.$f);
349 349
 			if (time() >= _TIME_OUT) {
350 350
 				return;
351 351
 			}
Please login to merge, or discard this patch.
ecrire/action/editer_auteur.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	$champs['source'] = $source ?: 'spip';
94 94
 
95 95
 	$champs['login'] = '';
96
-	$champs['statut'] = '5poubelle';  // inutilisable tant qu'il n'a pas ete renseigne et institue
96
+	$champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue
97 97
 	$champs['webmestre'] = 'non';
98 98
 	if (empty($champs['imessage'])) {
99 99
 		$champs['imessage'] = 'oui';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		$champs['pass'] = $c['pass'];
314 314
 	}
315 315
 
316
-	$statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
316
+	$statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
317 317
 
318 318
 	if (
319 319
 		isset($c['statut'])
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	// commencer par traiter les cas particuliers des logins et pass
374 374
 	// avant les autres ecritures en base
375 375
 	if (isset($champs['login']) or isset($champs['pass'])) {
376
-		$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
376
+		$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
377 377
 		include_spip('inc/auth');
378 378
 		if (isset($champs['login']) and strlen($champs['login'])) {
379 379
 			if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 			}
382 382
 		}
383 383
 		if (isset($champs['pass']) and strlen($champs['pass'])) {
384
-			$champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
384
+			$champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
385 385
 			if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) {
386 386
 				$erreurs[] = 'ecrire:impossible_modifier_pass_auteur';
387 387
 			}
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 	if (!(is_countable($champs) ? count($champs) : 0)) {
395 395
 		return implode(' ', array_map('_T', $erreurs));
396 396
 	}
397
-	sql_updateq('spip_auteurs', $champs, 'id_auteur=' . $id_auteur);
397
+	sql_updateq('spip_auteurs', $champs, 'id_auteur='.$id_auteur);
398 398
 
399 399
 	// .. mettre a jour les fichiers .htpasswd et .htpasswd-admin
400 400
 	if (
Please login to merge, or discard this patch.