Completed
Pull Request — master (#42)
by
unknown
01:14
created
ecrire/inc/lang.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 function changer_langue($lang, $liste_langues = null) {
41 41
 
42 42
 	if (is_null($liste_langues)) {
43
-		$liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'];
43
+		$liste_langues = @$GLOBALS['meta']['langues_proposees'].','.@$GLOBALS['meta']['langues_multilingue'];
44 44
 	}
45 45
 	else {
46 46
 		if (is_array($liste_langues)) {
47 47
 			$liste_langues = implode(',', $liste_langues);
48 48
 		}
49 49
 	}
50
-	$liste_langues = ',' . $liste_langues . ',';
50
+	$liste_langues = ','.$liste_langues.',';
51 51
 
52 52
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
53 53
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	}
200 200
 	foreach ($langues as $l) {
201 201
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
202
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
202
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
203 203
 	}
204 204
 
205 205
 	if (!test_espace_prive()) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$base,
218 218
 		$cible,
219 219
 		(select_langues($nom_select, $change, $ret)
220
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
220
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
221 221
 		" method='post'"
222 222
 	);
223 223
 }
@@ -225,16 +225,14 @@  discard block
 block discarded – undo
225 225
 // https://code.spip.net/@select_langues
226 226
 function select_langues($nom_select, $change, $options, $label = '') {
227 227
 	static $cpt = 0;
228
-	$id = 'menu_langues' . $cpt++;
228
+	$id = 'menu_langues'.$cpt++;
229 229
 
230 230
 	return
231
-		"<label for='$id'>" . ($label ? $label : _T('info_langues')) . '</label> ' .
231
+		"<label for='$id'>".($label ? $label : _T('info_langues')).'</label> '.
232 232
 		"<select name='$nom_select' id='$id' "
233 233
 		. ((!test_espace_prive()) ?
234
-			("class='forml menu_langues'") :
235
-			(($nom_select == 'var_lang_ecrire') ?
236
-				("class='lang_ecrire'") :
237
-				"class='fondl'"))
234
+			("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ?
235
+				("class='lang_ecrire'") : "class='fondl'"))
238 236
 		. $change
239 237
 		. ">\n"
240 238
 		. $options
@@ -360,7 +358,7 @@  discard block
 block discarded – undo
360 358
 		and (!isset($GLOBALS['spip_lang'])
361 359
 			or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
362 360
 	) {
363
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
361
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
364 362
 	}
365 363
 	// en theorie là, la globale est définie, sinon c'est un problème.
366 364
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -463,7 +461,7 @@  discard block
 block discarded – undo
463 461
 	if (!isset($GLOBALS['meta']['langue_site'])) {
464 462
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
465 463
 		$GLOBALS['meta']['langue_site'] = $tout =
466
-			(!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', ",$all_langs,") !== false))
464
+			(!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', ",$all_langs,") !== false))
467 465
 				? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ','));
468 466
 		ecrire_meta('langue_site', $tout);
469 467
 	}
Please login to merge, or discard this patch.
ecrire/inc/pipelines_ecrire.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
 
94 94
 		$titre = '<title>['
95 95
 			. $nom_site_spip
96
-			. '] ' . $match
96
+			. '] '.$match
97 97
 			. '</title>';
98 98
 
99 99
 		$texte = substr_replace($texte, $titre, $p + 6, 0);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			$flux['data']['texte'] = pipeline(
156 156
 				'affiche_droite',
157 157
 				['args' => $flux['args']['contexte'], 'data' => $flux['data']['texte']]
158
-			) . liste_objets_bloques(
158
+			).liste_objets_bloques(
159 159
 				$exec,
160 160
 				$flux['args']['contexte']
161 161
 			);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 				$flux['data']['texte'] = str_replace('<!--affiche_milieu-->', recuperer_fond(
191 191
 					'prive/objets/editer/traductions',
192 192
 					['objet' => $objet, 'id_objet' => $id, 'espace_prive' => 1]
193
-				) . '<!--affiche_milieu-->', $flux['data']['texte']);
193
+				).'<!--affiche_milieu-->', $flux['data']['texte']);
194 194
 				$flux['data']['texte'] = pipeline('afficher_fiche_objet', [
195 195
 					'args' => [
196 196
 						'contexte' => $flux['args']['contexte'],
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$full_marqueur = "$ouvrir$marqueur$fermer";
259 259
 
260 260
 		// Le marqueur est absent : on l'ajoute avant l'élément indiqué
261
-		if ($marqueur_pos  === false) {
261
+		if ($marqueur_pos === false) {
262 262
 			$texte = preg_replace(
263 263
 				",$inserer_avant,",
264 264
 				"$full_marqueur\\0",
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		}
306 306
 	}
307 307
 	if ($res) {
308
-		$flux['data'] = $res . $flux['data'];
308
+		$flux['data'] = $res.$flux['data'];
309 309
 	}
310 310
 
311 311
 	return $flux;
Please login to merge, or discard this patch.
ecrire/inc/informer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	include_spip('inc/texte');
22 22
 	$titre = $descriptif = '';
23 23
 	if ($type == 'rubrique') {
24
-		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id));
24
+		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id));
25 25
 		if ($row) {
26 26
 			$titre = typo($row['titre']);
27 27
 			$descriptif = propre($row['descriptif']);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 				include_spip('inc/filtres_images_mini');
40 40
 				$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
41 41
 				if ($res) {
42
-					$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
42
+					$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
43 43
 				}
44 44
 			}
45 45
 		}
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 		'  '
62 62
 	);
63 63
 
64
-	$js_func = $do . '_selection_titre';
64
+	$js_func = $do.'_selection_titre';
65 65
 
66 66
 	return "<div style='display: none;'>"
67
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
68
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
67
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
68
+	. "<input type='text' id='".$rac."_sel2' value=\""
69 69
 	. entites_html($titre)
70 70
 	. '" />'
71 71
 	. '</div>'
72 72
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
73 73
 	. '<div class="informer__item">'
74 74
 	. (!$res ? '' : $res)
75
-	. "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>'
76
-	. (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>')
75
+	. "<p class='informer__titre'><b>".safehtml($titre).'</b></p>'
76
+	. (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>')
77 77
 	. '</div>'
78
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
78
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
79 79
 	. "<input type='submit' class='fondo btn submit' value='"
80 80
 	. _T('bouton_choisir')
81 81
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.
ecrire/inc/admin.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		if ($res) {
56 56
 			return $res;
57 57
 		}
58
-		spip_log("meta: $script " . print_r($_POST, true));
58
+		spip_log("meta: $script ".print_r($_POST, true));
59 59
 		ecrire_meta($script, serialize($_POST));
60 60
 	}
61 61
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	}
125 125
 	// on pourrait statuer automatiquement les webmestres a l'init d'une action auth par ftp ... ?
126 126
 
127
-	spip_log("admin $pref" . ($valeur ? ' (reprise)' : ' (init)'), $journal);
127
+	spip_log("admin $pref".($valeur ? ' (reprise)' : ' (init)'), $journal);
128 128
 
129 129
 	return '';
130 130
 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (autoriser('configurer')) {
143 143
 		return _DIR_TMP;
144 144
 	} else {
145
-		return _DIR_TRANSFERT . $GLOBALS['visiteur_session']['login'] . '/';
145
+		return _DIR_TRANSFERT.$GLOBALS['visiteur_session']['login'].'/';
146 146
 	}
147 147
 }
148 148
 
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
  *     Nom du fichier
161 161
  **/
162 162
 function fichier_admin($action, $pref = 'admin_') {
163
-	return $pref .
164
-	substr(md5($action . (time() & ~2047) . $GLOBALS['visiteur_session']['login']), 0, 10);
163
+	return $pref.
164
+	substr(md5($action.(time() & ~2047).$GLOBALS['visiteur_session']['login']), 0, 10);
165 165
 }
166 166
 
167 167
 /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	} else {
195 195
 		$dir = dir_admin();
196 196
 		$signal = fichier_admin($script);
197
-		if (@file_exists($dir . $signal)) {
197
+		if (@file_exists($dir.$signal)) {
198 198
 			spip_log("Action admin: $action");
199 199
 
200 200
 			return '';
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 				return '';
214 214
 			}
215
-			$corps .= '<input type="hidden" name="validation_admin" value="' . $signal . '" />';
215
+			$corps .= '<input type="hidden" name="validation_admin" value="'.$signal.'" />';
216 216
 			$suivant = _T('bouton_valider');
217 217
 			$js = '';
218 218
 		} else {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				. "</legend>\n<label for='fichier'>"
228 228
 				. _T('info_creer_repertoire')
229 229
 				. "</label>\n"
230
-				. "<span id='signal' class='formo'>" . $signal . '</span>'
230
+				. "<span id='signal' class='formo'>".$signal.'</span>'
231 231
 				. "<input type='hidden' id='fichier' name='fichier' value='"
232 232
 				. $signal
233 233
 				. "' />"
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
  *     Nom de l'action (en base) qui a été exécutée
265 265
  **/
266 266
 function fin_admin($action) {
267
-	$signal = dir_admin() . fichier_admin($action);
267
+	$signal = dir_admin().fichier_admin($action);
268 268
 	spip_unlink($signal);
269 269
 	if ($action != 'delete_all') {
270 270
 		effacer_meta($action);
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 	include_spip('inc/filtres');
293 293
 	foreach (array_merge($_POST, $_GET) as $n => $c) {
294 294
 		if (!in_array($n, ['fichier', 'exec', 'validation_admin']) and !is_array($c)) {
295
-			$suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" .
296
-				entites_html($c) .
295
+			$suite .= "\n<input type='hidden' name='".spip_htmlspecialchars($n)."' value='".
296
+				entites_html($c).
297 297
 				"'  />";
298 298
 		}
299 299
 	}
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$contenu = @gzfile($fichier);
123 123
 	}
124 124
 
125
-	return is_array($contenu) ? join('', $contenu) : (string)$contenu;
125
+	return is_array($contenu) ? join('', $contenu) : (string) $contenu;
126 126
 }
127 127
 
128 128
 
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
  */
316 316
 function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) {
317 317
 	if (substr($fichier, -4) !== '.php') {
318
-		spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
318
+		spip_log('Erreur de programmation: '.$fichier.' doit finir par .php');
319 319
 	}
320
-	$contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
320
+	$contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu;
321 321
 
322 322
 	return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
323 323
 }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
  * @return bool
331 331
  */
332 332
 function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) {
333
-	$fichier_tmp = $fichier . '.last';
333
+	$fichier_tmp = $fichier.'.last';
334 334
 	if (!ecrire_fichier($fichier_tmp, $contenu, true)) {
335 335
 		return false;
336 336
 	}
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
  */
371 371
 function lire_fichier_securise($fichier, &$contenu, $options = []) {
372 372
 	if ($res = lire_fichier($fichier, $contenu, $options)) {
373
-		$contenu = substr($contenu, strlen('<' . "?php die ('Acces interdit'); ?" . ">\n"));
373
+		$contenu = substr($contenu, strlen('<'."?php die ('Acces interdit'); ?".">\n"));
374 374
 	}
375 375
 
376 376
 	return $res;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 				$wait = 0;
541 541
 			}
542 542
 		}
543
-		spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE);
543
+		spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
544 544
 		if ($wait) {
545 545
 			sleep($duree + 1);
546 546
 		}
@@ -568,9 +568,9 @@  discard block
 block discarded – undo
568 568
 		if ($item == '.' || $item == '..') {
569 569
 			continue;
570 570
 		}
571
-		if (!supprimer_repertoire($dir . '/' . $item)) {
572
-			@chmod($dir . '/' . $item, 0777);
573
-			if (!supprimer_repertoire($dir . '/' . $item)) {
571
+		if (!supprimer_repertoire($dir.'/'.$item)) {
572
+			@chmod($dir.'/'.$item, 0777);
573
+			if (!supprimer_repertoire($dir.'/'.$item)) {
574 574
 				return false;
575 575
 			}
576 576
 		};
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	if (!strlen($subdir)) {
616 616
 		$n = strrpos($base, '/');
617 617
 		if ($n === false) {
618
-			return $nobase ? '' : ($base . '/');
618
+			return $nobase ? '' : ($base.'/');
619 619
 		}
620 620
 		$subdir = substr($base, $n + 1);
621 621
 		$base = substr($base, 0, $n + 1);
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
 	}
626 626
 
627 627
 	$baseaff = $nobase ? '' : $base;
628
-	if (isset($dirs[$base . $subdir])) {
629
-		return $baseaff . $dirs[$base . $subdir];
628
+	if (isset($dirs[$base.$subdir])) {
629
+		return $baseaff.$dirs[$base.$subdir];
630 630
 	}
631 631
 
632
-	$path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
632
+	$path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
633 633
 
634 634
 	if (file_exists("$path/.ok")) {
635
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
635
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
636 636
 	}
637 637
 
638 638
 	@mkdir($path, _SPIP_CHMOD);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 		@touch("$path/.ok");
643 643
 		spip_log("creation $base$subdir/");
644 644
 
645
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
645
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
646 646
 	}
647 647
 
648 648
 	// en cas d'echec c'est peut etre tout simplement que le disque est plein :
@@ -652,10 +652,10 @@  discard block
 block discarded – undo
652 652
 		return '';
653 653
 	}
654 654
 	if (!_DIR_RESTREINT) {
655
-		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
655
+		$base = preg_replace(',^'._DIR_RACINE.',', '', $base);
656 656
 	}
657 657
 	$base .= $subdir;
658
-	raler_fichier($base . '/.ok');
658
+	raler_fichier($base.'/.ok');
659 659
 }
660 660
 
661 661
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 								$maxfiles - $nbfiles,
729 729
 								$recurs
730 730
 							);
731
-							$fichiers = array_merge((array)$beginning, (array)$end);
731
+							$fichiers = array_merge((array) $beginning, (array) $end);
732 732
 							$nbfiles = count($fichiers);
733 733
 						}
734 734
 					}
Please login to merge, or discard this patch.
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,20 +72,20 @@  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'>/*<![CDATA[*/
77 77
       if (window.jQuery)
78 78
         (function(\$){\$(function(){
79 79
           \$(document).SearchHighlight({
80
-            tag_name:'" . (html5_permis() ? 'mark' : 'span') . "',
80
+            tag_name:'" . (html5_permis() ? 'mark' : 'span')."',
81 81
             style_name:'spip_surligne',
82 82
             exact:'whole',
83 83
             style_name_suffix:false,
84
-            engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i],
84
+            engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site'])."/i,/recherche=([^&]+)/i],
85 85
             highlight:'.surlignable',
86 86
             nohighlight:'.pas_surlignable'" .
87 87
 				($surcharge_surligne ? ",
88
-            keys:'$surcharge_surligne'" : '') . ',
88
+            keys:'$surcharge_surligne'" : '').',
89 89
             min_length: 3
90 90
           })
91 91
         });
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
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	srand($seed);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 			if (!$s) {
44 44
 				$s = rand();
45 45
 			}
46
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
46
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
47 47
 		}
48
-		$r = unpack('Cr', pack('H2', $s . $s));
48
+		$r = unpack('Cr', pack('H2', $s.$s));
49 49
 		$x = $r['r'] & 63;
50 50
 		if ($x < 10) {
51 51
 			$x = chr($x + 48);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	static $seeded;
84 84
 
85 85
 	if (!$seeded) {
86
-		$seed = (int)round(((float)microtime() + 1) * time());
86
+		$seed = (int) round(((float) microtime() + 1) * time());
87 87
 		mt_srand($seed);
88 88
 		srand($seed);
89 89
 		$seeded = true;
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
171 171
 		}
172 172
 	} else {
173
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur));
173
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur));
174 174
 		if (!$low_sec) {
175 175
 			$low_sec = creer_pass_aleatoire();
176
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur));
176
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur));
177 177
 		}
178 178
 	}
179 179
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 	foreach ($args as $val => $var) {
198 198
 		if ($var) {
199 199
 			if ($val <> 'statut') {
200
-				$a .= ':' . $val . '-' . $var;
200
+				$a .= ':'.$val.'-'.$var;
201 201
 			}
202
-			$b .= $val . '=' . $var . '&';
202
+			$b .= $val.'='.$var.'&';
203 203
 		}
204 204
 	}
205 205
 	$a = substr($a, 1);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
  *     Clé
230 230
  **/
231 231
 function afficher_low_sec($id_auteur, $action = '') {
232
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
232
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
233 233
 }
234 234
 
235 235
 /**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	if (!$id_auteur = intval($id_auteur)) {
261 261
 		return;
262 262
 	} // jamais trop prudent ;)
263
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur));
263
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur));
264 264
 }
265 265
 
266 266
 /**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 function initialiser_sel() {
272 272
 	if (!isset($GLOBALS['htsalt'])) {
273 273
 		if (CRYPT_MD5) {
274
-			$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
274
+			$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
275 275
 		} else {
276 276
 			$GLOBALS['htsalt'] = '';
277 277
 		}
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
  *     - void sinon.
294 294
  **/
295 295
 function ecrire_acces() {
296
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
297
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
296
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
297
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
298 298
 
299 299
 	// Cette variable de configuration peut etre posee par un plugin
300 300
 	// par exemple acces_restreint ;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		and !@file_exists($htaccess)
306 306
 	) {
307 307
 		spip_unlink($htpasswd);
308
-		spip_unlink($htpasswd . '-admin');
308
+		spip_unlink($htpasswd.'-admin');
309 309
 		return;
310 310
 	}
311 311
 
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
 	$pwd_all = ''; // login:htpass pour tous
335 335
 	$pwd_admin = ''; // login:htpass pour les admins
336 336
 
337
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
337
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
338 338
 	while ($row = sql_fetch($res)) {
339 339
 		if (strlen($row['login']) and strlen($row['htpass'])) {
340
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
340
+			$ligne = $row['login'].':'.$row['htpass']."\n";
341 341
 			$pwd_all .= $ligne;
342 342
 			if ($row['statut'] == '0minirezo') {
343 343
 				$pwd_admin .= $ligne;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
  * @return boolean
383 383
  */
384 384
 function verifier_htaccess($rep, $force = false) {
385
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
385
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
386 386
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
387 387
 		return true;
388 388
 	}
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 		fputs($ht, $deny);
412 412
 		fclose($ht);
413 413
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
414
-		$t = rtrim($rep, '/') . '/.ok';
414
+		$t = rtrim($rep, '/').'/.ok';
415 415
 		if ($ht = @fopen($t, 'w')) {
416 416
 			@fclose($ht);
417 417
 			include_spip('inc/distant');
418 418
 			$t = substr($t, strlen(_DIR_RACINE));
419
-			$t = url_de_base() . $t;
419
+			$t = url_de_base().$t;
420 420
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
421 421
 			$ht = ($ht['status'] ?? null) === 403;
422 422
 		}
423 423
 	}
424
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
424
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
425 425
 
426 426
 	return $ht;
427 427
 }
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
448 448
 	$dirs[] = ['extension' => 'distant'];
449 449
 	foreach ($dirs as $e) {
450
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
450
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
451 451
 			if ($f) {
452 452
 				verifier_htaccess($dir);
453 453
 			} else {
454
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
454
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
455 455
 			}
456 456
 		}
457 457
 	}
Please login to merge, or discard this patch.
ecrire/inc/documents.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
 	$dest = preg_replace(',-r(90|180|270)$,', '', $dest);
155 155
 
156 156
 	// Si le document "source" est deja au bon endroit, ne rien faire
157
-	if ($source == ($dir . $dest . '.' . $ext)) {
157
+	if ($source == ($dir.$dest.'.'.$ext)) {
158 158
 		return $source;
159 159
 	}
160 160
 
161 161
 	// sinon tourner jusqu'a trouver un numero correct
162 162
 	$n = 0;
163
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
163
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
164 164
 		;
165 165
 	}
166 166
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 function deplacer_fichier_upload($source, $dest, $move = false) {
222 222
 	// Securite
223 223
 	if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) {
224
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
224
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
225 225
 	} else {
226 226
 		$dest = preg_replace(',\.\.+,', '.', $dest);
227 227
 	}
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
 
304 304
 		default: /* autre */
305 305
 			if (!$msg) {
306
-				$msg = _T('pass_erreur') . ' ' . $error
307
-					. '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
306
+				$msg = _T('pass_erreur').' '.$error
307
+					. '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
308 308
 			}
309 309
 			break;
310 310
 	}
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	include_spip('inc/minipres');
323 323
 	echo minipres(
324 324
 		$msg,
325
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>'
325
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>'
326 326
 	);
327 327
 	exit;
328 328
 }
Please login to merge, or discard this patch.
ecrire/inc/couleurs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,17 +70,17 @@
 block discarded – undo
70 70
 		// compat < SPIP 3.3
71 71
 		include_spip('inc/filtres_images_mini');
72 72
 		$c['couleur_foncee'] = $c['couleur_theme'];
73
-		$c['couleur_claire'] = '#' . couleur_eclaircir($c['couleur_theme'], .5);
73
+		$c['couleur_claire'] = '#'.couleur_eclaircir($c['couleur_theme'], .5);
74 74
 
75 75
 		return
76
-			'couleur_theme=' . substr($c['couleur_theme'], 1)
76
+			'couleur_theme='.substr($c['couleur_theme'], 1)
77 77
 			// compat < SPIP 3.3
78
-			. '&couleur_claire=' . substr($c['couleur_claire'], 1)
79
-			. '&couleur_foncee=' . substr($c['couleur_foncee'], 1);
78
+			. '&couleur_claire='.substr($c['couleur_claire'], 1)
79
+			. '&couleur_foncee='.substr($c['couleur_foncee'], 1);
80 80
 	} else {
81 81
 		if (is_array($choix)) {
82 82
 			// compat < SPIP 3.3
83
-			$compat_spip_33 = function ($c) {
83
+			$compat_spip_33 = function($c) {
84 84
 				if (!isset($c['couleur_theme'])) {
85 85
 					$c['couleur_theme'] = $c['couleur_foncee'];
86 86
 					unset($c['couleur_foncee']);
Please login to merge, or discard this patch.