Completed
Push — master ( c2652d...a4fa78 )
by cam
01:40
created
ecrire/inc/lang.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	if (is_null($liste_langues)) {
46
-		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
46
+		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? '');
47 47
 	} else {
48 48
 		if (is_array($liste_langues)) {
49 49
 			$liste_langues = implode(',', $liste_langues);
50 50
 		}
51 51
 	}
52
-	$liste_langues = ',' . $liste_langues . ',';
52
+	$liste_langues = ','.$liste_langues.',';
53 53
 
54 54
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
55 55
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	}
192 192
 	foreach ($langues as $l) {
193 193
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
194
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
194
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
195 195
 	}
196 196
 
197 197
 	if (!test_espace_prive()) {
@@ -209,21 +209,20 @@  discard block
 block discarded – undo
209 209
 		$base,
210 210
 		$cible,
211 211
 		(select_langues($nom_select, $change, $ret)
212
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
212
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
213 213
 		" method='post'"
214 214
 	);
215 215
 }
216 216
 
217 217
 function select_langues($nom_select, $change, $options, $label = '') {
218 218
 	static $cpt = 0;
219
-	$id = 'menu_langues' . $cpt++;
219
+	$id = 'menu_langues'.$cpt++;
220 220
 
221 221
 	return
222
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
222
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
223 223
 		"<select name='$nom_select' id='$id' "
224 224
 		. ((test_espace_prive()) ?
225
-			(($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) :
226
-			("class='forml menu_langues'"))
225
+			(($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : ("class='forml menu_langues'"))
227 226
 		. $change
228 227
 		. ">\n"
229 228
 		. $options
@@ -346,7 +345,7 @@  discard block
 block discarded – undo
346 345
 		isset($GLOBALS['meta']['langue_site'])
347 346
 		&& (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
348 347
 	) {
349
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
348
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
350 349
 	}
351 350
 	// en theorie là, la globale est définie, sinon c'est un problème.
352 351
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -458,7 +457,7 @@  discard block
 block discarded – undo
458 457
 	if (!isset($GLOBALS['meta']['langue_site'])) {
459 458
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
460 459
 		$GLOBALS['meta']['langue_site'] = $tout =
461
-			(!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,"))
460
+			(!$all_langs || str_contains(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,"))
462 461
 				? _LANGUE_PAR_DEFAUT
463 462
 				: substr((string) $all_langs, 0, strpos((string) $all_langs, ','));
464 463
 		ecrire_meta('langue_site', $tout);
Please login to merge, or discard this patch.
ecrire/inc/pipelines.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
 		}
64 64
 	}
65 65
 
66
-	return $x . $texte;
66
+	return $x.$texte;
67 67
 }
68 68
 
69 69
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) {
141
-		$insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n";
141
+		$insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n";
142 142
 		$texte = substr_replace($texte, $insert, $pos, 0);
143 143
 	}
144 144
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		}
171 171
 		$texte = substr_replace($texte, $x, $pos, 0);
172 172
 		// pas de preview en fenetre enfant
173
-		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>";
173
+		$x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes((string) $GLOBALS['meta']['adresse_site'])."';}</script>";
174 174
 		if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) {
175 175
 			$pos = -1;
176 176
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 	// inserer avant le </body> fermant si on peut, a la fin de la page sinon
243 243
 	if (($p = strpos($texte, '</body>')) !== false) {
244
-		$texte = substr($texte, 0, $p) . $code . substr($texte, $p);
244
+		$texte = substr($texte, 0, $p).$code.substr($texte, $p);
245 245
 	} else {
246 246
 		$texte .= $code;
247 247
 	}
Please login to merge, or discard this patch.
ecrire/inc/texte.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 	foreach (['script', 'iframe'] as $tag) {
107 107
 		if (
108 108
 			stripos($t, (string) "<$tag") !== false
109
-			&& preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
109
+			&& preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER)
110 110
 		) {
111 111
 			foreach ($r as $regs) {
112 112
 				$t = str_replace(
113 113
 					$regs[0],
114
-					"<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
114
+					"<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>',
115 115
 					$t
116 116
 				);
117 117
 			}
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
 	}
165 165
 
166 166
 	// echapper les tags asp/php
167
-	$t = str_replace('<' . '%', '&lt;%', $arg);
167
+	$t = str_replace('<'.'%', '&lt;%', $arg);
168 168
 
169 169
 	// echapper le php
170
-	$t = str_replace('<' . '?', '&lt;?', $t);
170
+	$t = str_replace('<'.'?', '&lt;?', $t);
171 171
 
172 172
 	// echapper le < script language=php >
173 173
 	$t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 
190 190
 	// Reinserer les echappements des modeles
191 191
 	if (defined('_PROTEGE_JS_MODELES')) {
192
-		$t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES);
192
+		$t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES);
193 193
 	}
194 194
 	if (defined('_PROTEGE_PHP_MODELES')) {
195
-		$t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES);
195
+		$t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES);
196 196
 	}
197 197
 
198 198
 	return $dejavu[$mode_filtre][$arg] = $t;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 define('_TYPO_PROTEGER', "!':;?~%-");
291 291
 define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8");
292 292
 
293
-define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS');
293
+define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS');
294 294
 
295 295
 /**
296 296
  * Corrige la typographie
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 function spip_setcookie(
53 53
 	string $name = '',
54 54
 	string $value = '',
55
-	int|array $expires_or_options = 0,
55
+	int | array $expires_or_options = 0,
56 56
 	string $path = '',
57 57
 	string $domain = '',
58 58
 	bool $secure = false,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 	// in fine renommer le prefixe si besoin
103 103
 	if (str_starts_with($name, 'spip_')) {
104
-		$name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5);
104
+		$name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5);
105 105
 	}
106 106
 
107 107
 	#spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies");
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	}
160 160
 	foreach ($_COOKIE as $name => $value) {
161 161
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
162
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
162
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
163 163
 			$_COOKIE[$spipname] = $value;
164 164
 			$GLOBALS[$spipname] = $value;
165 165
 		}
Please login to merge, or discard this patch.
ecrire/inc/filtres_ecrire.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		// confirmation du deplacement
117 117
 		if (
118 118
 			sql_table_exists('spip_breves')
119
-			&& ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet))
119
+			&& ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.(int) $id_objet))
120 120
 			&& $contient_breves > 0
121 121
 		) {
122 122
 			// FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 			);
131 131
 			$confirm .= "\n<div class='confirmer_deplacement verdana2'>"
132 132
 				. "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
133
-				. $scb .
133
+				. $scb.
134 134
 				"</label></div></div>\n";
135 135
 		} else {
136 136
 			$confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	$form .= $confirm;
140 140
 	if ($actionable) {
141 141
 		if (str_contains($form, '<select')) {
142
-			$form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
143
-				. '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
142
+			$form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>"
143
+				. '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>'
144 144
 				. '</div>';
145 145
 		}
146
-		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
146
+		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form;
147 147
 		if ($action = charger_fonction("editer_$objet", 'action', true)) {
148 148
 			$form = generer_action_auteur(
149 149
 				"editer_$objet",
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
 	include_spip('inc/presentation');
171 171
 
172
-	return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
172
+	return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur();
173 173
 }
174 174
 
175 175
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	if ($statut == 'nouveau') {
246 246
 		if ($attente) {
247 247
 			$statut = $attente;
248
-			$plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
248
+			$plus = ' ('._T('info_statut_auteur_a_confirmer').')';
249 249
 		} else {
250 250
 			return _T('info_statut_auteur_a_confirmer');
251 251
 		}
@@ -258,16 +258,16 @@  discard block
 block discarded – undo
258 258
 		'5poubelle' => _T('texte_statut_poubelle'), // bouh
259 259
 	];
260 260
 	if (isset($recom[$statut])) {
261
-		return $recom[$statut] . $plus;
261
+		return $recom[$statut].$plus;
262 262
 	}
263 263
 
264 264
 	// retrouver directement par le statut sinon
265 265
 	if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
266 266
 		if (isset($recom[$t])) {
267
-			return $recom[$t] . $plus;
267
+			return $recom[$t].$plus;
268 268
 		}
269 269
 
270
-		return _T($t) . $plus;
270
+		return _T($t).$plus;
271 271
 	}
272 272
 
273 273
 	// si on a pas reussi a le traduire, retournons la chaine telle quelle
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 	if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) {
389 389
 		$in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
390
-			? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
390
+			? ' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])
391 391
 			: '';
392 392
 
393 393
 		// on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
@@ -426,13 +426,13 @@  discard block
 block discarded – undo
426 426
 	$parts = parse_url($virtuel);
427 427
 	if (!empty($parts['query']) && str_contains($parts['query'], ']')) {
428 428
 		$query = str_replace(['[', ']'], [urlencode('['), urlencode(']')], $parts['query']);
429
-		$virtuel = str_replace('?' . $parts['query'], "?$query", $virtuel);
429
+		$virtuel = str_replace('?'.$parts['query'], "?$query", $virtuel);
430 430
 	}
431 431
 	if ($virtuel !== $joli) {
432
-		$joli = propre('[' . $joli . ' -> ' . $virtuel . ']');
432
+		$joli = propre('['.$joli.' -> '.$virtuel.']');
433 433
 	}
434 434
 	else {
435
-		$joli = propre('[->' . $virtuel . ']');
435
+		$joli = propre('[->'.$virtuel.']');
436 436
 	}
437 437
 
438 438
 	return $joli;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 	$clic = http_img_pack('rss-16.png', 'RSS', '', $title);
463 463
 
464 464
 	$url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
465
-	return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
465
+	return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>";
466 466
 }
467 467
 
468 468
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	);
535 535
 
536 536
 	if ($alertes = array_filter($alertes)) {
537
-		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
537
+		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>".
538 538
 		implode(' | ', $alertes)
539 539
 		. '</div></div>';
540 540
 	}
@@ -570,13 +570,13 @@  discard block
 block discarded – undo
570 570
  */
571 571
 function afficher_plus_info($lien, $titre = '+', $titre_lien = '') {
572 572
 	$titre = attribut_html($titre);
573
-	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
574
-		http_img_pack('information-16.png', $titre) . '</a>';
573
+	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>".
574
+		http_img_pack('information-16.png', $titre).'</a>';
575 575
 
576 576
 	if (!$titre_lien) {
577 577
 		return $icone;
578 578
 	} else {
579
-		return $icone . "\n<a href='$lien'>$titre_lien</a>";
579
+		return $icone."\n<a href='$lien'>$titre_lien</a>";
580 580
 	}
581 581
 }
582 582
 
Please login to merge, or discard this patch.
ecrire/inc/math.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	// Regarder dans le repertoire local des images TeX et blocs MathML
40
-	if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) {
40
+	if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) {
41 41
 		@mkdir($dir_tex, _SPIP_CHMOD);
42 42
 	}
43
-	$fichier = $dir_tex . md5(trim((string) $tex)) . $ext;
43
+	$fichier = $dir_tex.md5(trim((string) $tex)).$ext;
44 44
 
45 45
 
46 46
 	// Aller chercher l'image sur le serveur
47 47
 	if (!@file_exists($fichier) && $server) {
48
-		spip_log($url = $server . '?' . rawurlencode((string) $tex));
48
+		spip_log($url = $server.'?'.rawurlencode((string) $tex));
49 49
 		include_spip('inc/distant');
50 50
 		recuperer_url($url, ['file' => $fichier]);
51 51
 	}
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			return implode('', file($fichier));
60 60
 		} // TeX
61 61
 		else {
62
-			[, , , $size] = @spip_getimagesize($fichier);
62
+			[,,, $size] = @spip_getimagesize($fichier);
63 63
 			$alt = "alt=\"$tex\" title=\"$tex\"";
64 64
 
65 65
 			return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />";
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 					$expression = str_replace('&amp;', '&', $expression);
126 126
 				}
127 127
 				$echap = produire_image_math($expression);
128
-				$echap = ($t['pre'] ?? '') . $echap . ($t['post'] ?? '');
128
+				$echap = ($t['pre'] ?? '').$echap.($t['post'] ?? '');
129 129
 				$echap = CollecteurHtmlTag::echappementHtmlBase64($echap, $source);
130 130
 
131 131
 				$pos = strpos($texte_milieu, (string) $regs[0]);
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  *     Mot de passe
31 31
  **/
32 32
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
33
-	$seed = (int)round(((float)microtime() + 1) * time());
33
+	$seed = (int) round(((float) microtime() + 1) * time());
34 34
 
35 35
 	mt_srand($seed);
36 36
 	$s = '';
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 			if (!$s) {
42 42
 				$s = random_int(0, mt_getrandmax());
43 43
 			}
44
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
44
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
45 45
 		}
46
-		$r = unpack('Cr', pack('H2', $s . $s));
46
+		$r = unpack('Cr', pack('H2', $s.$s));
47 47
 		$x = $r['r'] & 63;
48 48
 		if ($x < 10) {
49 49
 			$x = chr($x + 48);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	static $seeded;
77 77
 
78 78
 	if (!$seeded) {
79
-		$seed = (int)round(((float)microtime() + 1) * time());
79
+		$seed = (int) round(((float) microtime() + 1) * time());
80 80
 		mt_srand($seed);
81 81
 		$seeded = true;
82 82
 	}
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
163 163
 		}
164 164
 	} else {
165
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . (int) $id_auteur);
165
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.(int) $id_auteur);
166 166
 		if (!$low_sec) {
167 167
 			$low_sec = creer_pass_aleatoire();
168
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . (int) $id_auteur);
168
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.(int) $id_auteur);
169 169
 		}
170 170
 	}
171 171
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) {
217 217
 	$id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0;
218 218
 	$cle = afficher_low_sec($id_auteur, "$script/$format $fond $args");
219
-	$path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : '');
219
+	$path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : '');
220 220
 
221 221
 	return generer_url_api($script, $path, $args, $no_entities, $public);
222 222
 }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
  *     Clé
235 235
  **/
236 236
 function afficher_low_sec($id_auteur, $action = '') {
237
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
237
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
238 238
 }
239 239
 
240 240
 /**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	if (!$id_auteur = (int) $id_auteur) {
266 266
 		return;
267 267
 	} // jamais trop prudent ;)
268
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . (int) $id_auteur);
268
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.(int) $id_auteur);
269 269
 }
270 270
 
271 271
 
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
  *     - void sinon.
284 284
  **/
285 285
 function ecrire_acces() {
286
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
287
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
286
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
287
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
288 288
 
289 289
 	// Cette variable de configuration peut etre posee par un plugin
290 290
 	// par exemple acces_restreint ;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		(!isset($GLOBALS['meta']['creer_htpasswd']) || $GLOBALS['meta']['creer_htpasswd'] != 'oui') && !@file_exists($htaccess)
294 294
 	) {
295 295
 		spip_unlink($htpasswd);
296
-		spip_unlink($htpasswd . '-admin');
296
+		spip_unlink($htpasswd.'-admin');
297 297
 		return;
298 298
 	}
299 299
 
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
 	$pwd_all = ''; // login:htpass pour tous
322 322
 	$pwd_admin = ''; // login:htpass pour les admins
323 323
 
324
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
324
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
325 325
 	while ($row = sql_fetch($res)) {
326 326
 		if (strlen((string) $row['login']) && strlen((string) $row['htpass'])) {
327
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
327
+			$ligne = $row['login'].':'.$row['htpass']."\n";
328 328
 			$pwd_all .= $ligne;
329 329
 			if ($row['statut'] == '0minirezo') {
330 330
 				$pwd_admin .= $ligne;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
  * @return boolean
368 368
  */
369 369
 function verifier_htaccess($rep, $force = false) {
370
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
370
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
371 371
 	if ((@file_exists($htaccess) || defined('_TEST_DIRS')) && !$force) {
372 372
 		return true;
373 373
 	}
@@ -394,17 +394,17 @@  discard block
 block discarded – undo
394 394
 		fwrite($ht, $deny);
395 395
 		fclose($ht);
396 396
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
397
-		$t = rtrim($rep, '/') . '/.ok';
397
+		$t = rtrim($rep, '/').'/.ok';
398 398
 		if ($ht = @fopen($t, 'w')) {
399 399
 			@fclose($ht);
400 400
 			include_spip('inc/distant');
401 401
 			$t = substr($t, strlen(_DIR_RACINE));
402
-			$t = url_de_base() . $t;
402
+			$t = url_de_base().$t;
403 403
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
404 404
 			$ht = ($ht['status'] ?? null) === 403;
405 405
 		}
406 406
 	}
407
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
407
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
408 408
 
409 409
 	return $ht;
410 410
 }
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
431 431
 	$dirs[] = ['extension' => 'distant'];
432 432
 	foreach ($dirs as $e) {
433
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
433
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
434 434
 			if ($f) {
435 435
 				verifier_htaccess($dir);
436 436
 			} else {
437
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
437
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
438 438
 			}
439 439
 		}
440 440
 	}
Please login to merge, or discard this patch.
ecrire/inc/urls.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	) {
193 193
 		$r = nettoyer_url_page($url, $contexte);
194 194
 		if ($r) {
195
-			[$contexte, $type, , , $suite] = $r;
195
+			[$contexte, $type,,, $suite] = $r;
196 196
 			$_id = id_table_objet($type);
197 197
 			$id_objet = $contexte[$_id];
198 198
 			$url_propre = generer_objet_url($id_objet, $type);
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
  */
264 264
 function nettoyer_url_page($url, $contexte = []) {
265 265
 	$url_objets = urls_liste_objets();
266
-	$raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
267
-	$raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
-	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
266
+	$raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,';
267
+	$raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
+	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,';
269 269
 
270 270
 	if (
271 271
 		preg_match($raccourci_url_page_html, $url, $regs)
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	$id = intval($id);
304 304
 	if (!isset($furls[$objet])) {
305 305
 		if (
306
-			function_exists($f = 'generer_' . $objet . '_url_ecrire')
306
+			function_exists($f = 'generer_'.$objet.'_url_ecrire')
307 307
 			|| ($f = charger_fonction($f, 'urls', true))
308
-			|| function_exists($f = 'generer_url_ecrire_' . $objet) // deprecated
308
+			|| function_exists($f = 'generer_url_ecrire_'.$objet) // deprecated
309 309
 			|| ($f = charger_fonction($f, 'urls', true)) // deprecated
310 310
 		) {
311 311
 			$furls[$objet] = $f;
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 	if ($public || $connect) {
325 325
 		return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect);
326 326
 	}
327
-	$a = id_table_objet($objet) . '=' . intval($id);
327
+	$a = id_table_objet($objet).'='.intval($id);
328 328
 	if (!function_exists('objet_info')) {
329 329
 		include_spip('inc/filtres');
330 330
 	}
331 331
 
332
-	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
332
+	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : '');
333 333
 }
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 		sql_updateq(
136 136
 			'spip_rubriques',
137 137
 			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
138
-			'id_rubrique=' . intval($id_rubrique)
138
+			'id_rubrique='.intval($id_rubrique)
139 139
 		);
140
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
140
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique));
141 141
 		if (!$id_parent) {
142 142
 			break;
143 143
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return $id_pred != $id_rubrique;
173 173
 		}
174 174
 		// passer au parent si on a depublie
175
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
175
+		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred));
176 176
 		$id_pred = $r['id_parent'];
177 177
 	}
178 178
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 		$date = date('Y-m-d H:i:s');
198 198
 	}
199 199
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
200
-		' AND date <= ' . sql_quote($date) : '';
200
+		' AND date <= '.sql_quote($date) : '';
201 201
 
202 202
 	if (!$id_rubrique = intval($id_rubrique)) {
203 203
 		return false;
204 204
 	}
205 205
 
206 206
 	// verifier qu'elle existe et est bien publiee
207
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
207
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
208 208
 	if (!$r || $r['statut'] !== 'publie') {
209 209
 		return false;
210 210
 	}
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
 	$compte = [
215 215
 		'articles' => sql_countsel(
216 216
 			'spip_articles',
217
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
217
+			'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates"
218 218
 		),
219
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
219
+		'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"),
220 220
 		'documents' => sql_countsel(
221 221
 			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
222
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
222
+			'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
223 223
 		)
224 224
 	];
225 225
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		}
245 245
 	}
246 246
 
247
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
247
+	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique));
248 248
 
249 249
 #		spip_log("depublier_rubrique $id_pred");
250 250
 	return true;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 	// Afficher les articles post-dates ?
309 309
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
310
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
310
+		'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
311 311
 
312 312
 	$r = sql_select(
313 313
 		'R.id_rubrique AS id, max(A.date) AS date_h',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		sql_updateq(
320 320
 			'spip_rubriques',
321 321
 			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
322
-			'id_rubrique=' . intval($row['id'])
322
+			'id_rubrique='.intval($row['id'])
323 323
 		);
324 324
 	}
325 325
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			sql_updateq(
346 346
 				'spip_rubriques',
347 347
 				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
348
-				'id_rubrique=' . intval($row['id'])
348
+				'id_rubrique='.intval($row['id'])
349 349
 			);
350 350
 			$continuer = true;
351 351
 		}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			&& ($rows = sql_allfetsel(
399 399
 				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
400 400
 				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
401
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
401
+				'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
402 402
 				'',
403 403
 				'R.id_secteur',
404 404
 				'0,100'
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 			&& ($rows = sql_allfetsel(
438 438
 				'id_rubrique as id',
439 439
 				'spip_rubriques',
440
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
440
+				'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select(
441 441
 					'zzz.id_rubrique',
442 442
 					'spip_rubriques AS zzz',
443
-					'zzz.profondeur=' . intval($prof)
444
-				) . ')',
443
+					'zzz.profondeur='.intval($prof)
444
+				).')',
445 445
 				'',
446 446
 				'',
447 447
 				'0,100'
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
456 456
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
457 457
 		// on arrete les frais
458
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
458
+		if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) {
459 459
 			$prof++;
460 460
 			$continuer = true;
461 461
 		}
@@ -463,12 +463,12 @@  discard block
 block discarded – undo
463 463
 
464 464
 	// loger si la table des rubriques semble foireuse
465 465
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
466
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
466
+	if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) {
467 467
 		spip_log(
468
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
468
+			'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)',
469 469
 			_LOG_CRITIQUE
470 470
 		);
471
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
471
+		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1));
472 472
 	}
473 473
 
474 474
 	// reparer les articles
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 	);
480 480
 
481 481
 	while ($row = sql_fetch($r)) {
482
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
482
+		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id']));
483 483
 	}
484 484
 
485 485
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$t = sql_updateq(
511 511
 			'spip_rubriques',
512 512
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
513
-			'id_rubrique=' . intval($id_rubrique)
513
+			'id_rubrique='.intval($id_rubrique)
514 514
 		);
515 515
 	}
516 516
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		sql_updateq(
556 556
 			'spip_articles',
557 557
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
558
-			'id_article=' . intval($id_article)
558
+			'id_article='.intval($id_article)
559 559
 		);
560 560
 	}
561 561
 
@@ -630,11 +630,11 @@  discard block
 block discarded – undo
630 630
 				];
631 631
 				// generer un nom de fonction "anonyme" unique
632 632
 				do {
633
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
633
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax());
634 634
 				} while (function_exists($functionname));
635 635
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
636
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
637
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
636
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
637
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
638 638
 				$res = '';
639 639
 				eval($code);
640 640
 				$res = explode(',', $res);
@@ -736,11 +736,11 @@  discard block
 block discarded – undo
736 736
 		$maxiter-- && ($filles = sql_allfetsel(
737 737
 			'id_rubrique',
738 738
 			'spip_rubriques',
739
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
739
+			sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT')
740 740
 		))
741 741
 	) {
742 742
 		$r = join(',', array_column($filles, 'id_rubrique'));
743
-		$branche .= ',' . $r;
743
+		$branche .= ','.$r;
744 744
 	}
745 745
 
746 746
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
 	if (isset($b[$id])) {
782 782
 		// Notre branche commence par la rubrique de depart si $tout=true
783
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
783
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
784 784
 	}
785 785
 
786 786
 	$hier = '';
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
 		$maxiter-- && ($parents = sql_allfetsel(
794 794
 			'id_parent',
795 795
 			'spip_rubriques',
796
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
796
+			sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT')
797 797
 		))
798 798
 	) {
799 799
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
800
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
800
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
801 801
 	}
802 802
 
803 803
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	include_spip('base/abstract_sql');
830 830
 	if ($check) {
831 831
 		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
832
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
832
+			'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
833 833
 
834 834
 		$r = sql_select(
835 835
 			'DISTINCT A.id_rubrique AS id',
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 	$t = sql_fetsel(
847 847
 		'date',
848 848
 		'spip_articles',
849
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
849
+		"statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')),
850 850
 		'',
851 851
 		'date',
852 852
 		'1'
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		$r = sql_getfetsel(
903 903
 			'id_rubrique',
904 904
 			'spip_rubriques',
905
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
905
+			'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent),
906 906
 			$groupby = [],
907 907
 			$orderby = [],
908 908
 			$limit = '',
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 			sql_updateq(
939 939
 				'spip_rubriques',
940 940
 				['id_secteur' => $id_secteur, 'lang' => $lang],
941
-				'id_rubrique=' . intval($id_rubrique),
941
+				'id_rubrique='.intval($id_rubrique),
942 942
 				[],
943 943
 				$serveur
944 944
 			);
Please login to merge, or discard this patch.