Completed
Push — master ( 11381c...fc67b6 )
by cam
01:49
created
ecrire/inc/documents.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	if (!str_starts_with($fichier, (string) _DIR_IMG)) {
64
-		$fichier = _DIR_IMG . $fichier;
64
+		$fichier = _DIR_IMG.$fichier;
65 65
 	}
66 66
 
67 67
 	// fichier normal
@@ -154,22 +154,22 @@  discard block
 block discarded – undo
154 154
 			|| !($r = verifier_upload_autorise($dest))
155 155
 			|| !empty($r['autozip'])
156 156
 		) {
157
-			$dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1];
157
+			$dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1];
158 158
 			break;
159 159
 		} else {
160 160
 			$dest = substr($dest, 0, -strlen($m[0]));
161
-			$ext = $m[1] . '.' . $ext;
161
+			$ext = $m[1].'.'.$ext;
162 162
 		}
163 163
 	}
164 164
 
165 165
 	// Si le document "source" est deja au bon endroit, ne rien faire
166
-	if ($source == ($dir . $dest . '.' . $ext)) {
166
+	if ($source == ($dir.$dest.'.'.$ext)) {
167 167
 		return $source;
168 168
 	}
169 169
 
170 170
 	// sinon tourner jusqu'a trouver un numero correct
171 171
 	$n = 0;
172
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
172
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
173 173
 		;
174 174
 	}
175 175
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 function deplacer_fichier_upload($source, $dest, $move = false) {
231 231
 	// Securite
232 232
 	if (str_starts_with($dest, (string) _DIR_RACINE)) {
233
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen((string) _DIR_RACINE)));
233
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen((string) _DIR_RACINE)));
234 234
 	} else {
235 235
 		$dest = preg_replace(',\.\.+,', '.', $dest);
236 236
 	}
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 
309 309
 		default: /* autre */
310 310
 			if (!$msg) {
311
-				$msg = _T('pass_erreur') . ' ' . $error
312
-					. '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
311
+				$msg = _T('pass_erreur').' '.$error
312
+					. '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
313 313
 			}
314 314
 			break;
315 315
 	}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	include_spip('inc/minipres');
328 328
 	echo minipres(
329 329
 		$msg,
330
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode((string) $GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>'
330
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode((string) $GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>'
331 331
 	);
332 332
 	exit;
333 333
 }
Please login to merge, or discard this patch.
ecrire/inc/filtres_mini.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	if ($query) {
47
-		$url .= '?' . $query;
47
+		$url .= '?'.$query;
48 48
 	}
49 49
 
50
-	return '/' . preg_replace(',^/,S', '', (string) $url);
50
+	return '/'.preg_replace(',^/,S', '', (string) $url);
51 51
 }
52 52
 
53 53
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) {
78 78
 		$r = array_pad($r, 3, '');
79 79
 
80
-		return $r[1] . resolve_path($r[2]);
80
+		return $r[1].resolve_path($r[2]);
81 81
 	}
82 82
 
83 83
 	# L'url site spip est un lien absolu aussi
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
 		$hash = $regs[5] ?? '';
98 98
 	}
99 99
 	return match (substr($lien, 0, 1)) {
100
-		'/' => $debut . resolve_path($lien),
101
-		'#' => $debut . resolve_path($dir . $mot . $get . $lien),
102
-		'' => $debut . resolve_path($dir . $mot . $get . $hash),
103
-		default => $debut . resolve_path($dir . $lien),
100
+		'/' => $debut.resolve_path($lien),
101
+		'#' => $debut.resolve_path($dir.$mot.$get.$lien),
102
+		'' => $debut.resolve_path($dir.$mot.$get.$hash),
103
+		default => $debut.resolve_path($dir.$lien),
104 104
 	};
105 105
 }
106 106
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		return '';
130 130
 	}
131 131
 	if (!$base) {
132
-		$base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
132
+		$base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
133 133
 	}
134 134
 
135 135
 	return suivre_lien($base, $url);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
  * @param array $protocoles_autorises
153 153
  * @return bool
154 154
  */
155
-function protocole_verifier($url_absolue, $protocoles_autorises = ['http','https']) {
155
+function protocole_verifier($url_absolue, $protocoles_autorises = ['http', 'https']) {
156 156
 
157 157
 	if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) {
158 158
 		$protocole = $m[1];
Please login to merge, or discard this patch.
ecrire/inc/precharger_objet.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 	// si l'objet existe deja, on retourne simplement ses valeurs
52 52
 	if (is_numeric($id_objet)) {
53
-		return sql_fetsel('*', $table, "$_id_objet=" . (int) $id_objet);
53
+		return sql_fetsel('*', $table, "$_id_objet=".(int) $id_objet);
54 54
 	}
55 55
 
56 56
 	// ici, on demande une creation.
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	// si demande de traduction
65 65
 	// on recupere les valeurs de la traduction
66 66
 	if ($lier_trad) {
67
-		if ($select = charger_fonction('precharger_traduction_' . $type, 'inc', true)) {
67
+		if ($select = charger_fonction('precharger_traduction_'.$type, 'inc', true)) {
68 68
 			$row = $select($id_objet, $id_rubrique, $lier_trad);
69 69
 		} else {
70 70
 			$row = precharger_traduction_objet($type, $id_objet, $id_rubrique, $lier_trad, $champ_titre);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 	// recuperer le secteur, pour affecter les bons champs extras
101 101
 	if ($id_rubrique && $is_secteur && !$row['id_secteur']) {
102
-		$row_rub = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . sql_quote($id_rubrique));
102
+		$row_rub = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.sql_quote($id_rubrique));
103 103
 		$row['id_secteur'] = $row_rub;
104 104
 	}
105 105
 
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 	$_id_objet = id_table_objet($table);
130 130
 
131 131
 	// Recuperer les donnees de l'objet original
132
-	$row = sql_fetsel('*', $table, "$_id_objet=" . (int) $lier_trad);
132
+	$row = sql_fetsel('*', $table, "$_id_objet=".(int) $lier_trad);
133 133
 	if ($row) {
134 134
 		include_spip('inc/filtres');
135
-		$row[$champ_titre] = filtrer_entites(objet_T($type, 'info_nouvelle_traduction')) . ' ' . $row[$champ_titre];
135
+		$row[$champ_titre] = filtrer_entites(objet_T($type, 'info_nouvelle_traduction')).' '.$row[$champ_titre];
136 136
 	} else {
137 137
 		$row = [];
138 138
 	}
@@ -182,14 +182,14 @@  discard block
 block discarded – undo
182 182
 					$id_parent = 0;
183 183
 				} else {
184 184
 					// on cherche une rubrique soeur dans la bonne langue
185
-					$row_rub = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique);
185
+					$row_rub = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique);
186 186
 					$id_parent = $row_rub['id_parent'];
187 187
 				}
188 188
 
189 189
 				$row_rub = sql_fetsel(
190 190
 					'id_rubrique',
191 191
 					'spip_rubriques',
192
-					"lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=" . (int) $id_parent
192
+					"lang='".$GLOBALS['spip_lang']."' AND id_parent=".(int) $id_parent
193 193
 				);
194 194
 				if ($row_rub) {
195 195
 					$row['id_rubrique'] = $row_rub['id_rubrique'];
Please login to merge, or discard this patch.
ecrire/inc/xml.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 					$p !== false
137 137
 					&& ($morceau = substr($txt, $d, $p - $d))
138 138
 					&& ($nopen += preg_match_all(
139
-						'{<' . preg_quote((string) $closing_tag) . '(\s*>|\s[^>]*[^/>]>)}is',
139
+						'{<'.preg_quote((string) $closing_tag).'(\s*>|\s[^>]*[^/>]>)}is',
140 140
 						$morceau,
141 141
 						$matches,
142 142
 						PREG_SET_ORDER
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
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	include_spip('inc/texte');
20 20
 	$titre = $descriptif = '';
21 21
 	if ($type === 'rubrique') {
22
-		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . (int) $id);
22
+		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.(int) $id);
23 23
 		if ($row) {
24 24
 			$titre = typo($row['titre']);
25 25
 			$descriptif = propre($row['descriptif']);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			include_spip('inc/filtres_images_mini');
42 42
 			$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
43 43
 			if ($res) {
44
-				$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
44
+				$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
45 45
 			}
46 46
 		}
47 47
 	}
@@ -62,21 +62,21 @@  discard block
 block discarded – undo
62 62
 		'  '
63 63
 	);
64 64
 
65
-	$js_func = $do . '_selection_titre';
65
+	$js_func = $do.'_selection_titre';
66 66
 
67 67
 	return "<div style='display: none;'>"
68
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
69
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
68
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
69
+	. "<input type='text' id='".$rac."_sel2' value=\""
70 70
 	. entites_html($titre)
71 71
 	. '" />'
72 72
 	. '</div>'
73 73
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
74 74
 	. '<div class="informer__item">'
75 75
 	. ($res ?: '')
76
-	. "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>'
77
-	. ($descriptif ? "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>' : '')
76
+	. "<p class='informer__titre'><b>".safehtml($titre).'</b></p>'
77
+	. ($descriptif ? "<div class='informer__descriptif'>".safehtml($descriptif).'</div>' : '')
78 78
 	. '</div>'
79
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
79
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
80 80
 	. "<input type='submit' class='fondo btn submit' value='"
81 81
 	. _T('bouton_choisir')
82 82
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.
ecrire/inc/chercher_rubrique.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (isset($data[$root])) { # pas de racine sauf pour les rubriques
143 143
 	$r = "<option$selected value='$root' class='$class' style='$style'>$espace"
144 144
 			. $data[$root]
145
-			. '</option>' . "\n";
145
+			. '</option>'."\n";
146 146
 	} else {
147 147
 		$r = '';
148 148
 	}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	}
171 171
 
172 172
 	// et voila le travail
173
-	return $r . $sous;
173
+	return $r.$sous;
174 174
 }
175 175
 
176 176
 /**
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	while ($r = sql_fetch($q)) {
219 219
 		if (autoriser('voir', 'rubrique', $r['id_rubrique'])) {
220 220
 			// titre largeur maxi a 50
221
-			$titre = couper(supprimer_tags(typo($r['titre'])) . ' ', 50);
221
+			$titre = couper(supprimer_tags(typo($r['titre'])).' ', 50);
222 222
 			if (
223 223
 				$GLOBALS['meta']['multi_rubriques'] == 'oui'
224 224
 				&& ($r['langue_choisie'] == 'oui' || $r['id_parent'] == 0)
225 225
 			) {
226
-				$titre .= ' [' . traduire_nom_langue($r['lang']) . ']';
226
+				$titre .= ' ['.traduire_nom_langue($r['lang']).']';
227 227
 			}
228 228
 			$data[$r['id_rubrique']] = $titre;
229 229
 			$enfants[$r['id_parent']][] = $r['id_rubrique'];
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	$att = " id='id_parent' name='id_parent'\nclass='selecteur_parent verdana1'";
251 251
 
252 252
 	if (preg_match(',^<option[^<>]*value=.(\d*).[^<>]*>([^<]*)</option>$,', $opt, $r)) {
253
-		$r = "<input$att type='hidden' value='" . $r[1] . "' />" . $r[2];
253
+		$r = "<input$att type='hidden' value='".$r[1]."' />".$r[2];
254 254
 	} else {
255
-		$r = '<select' . $att . " size='1'>\n$opt</select>\n";
255
+		$r = '<select'.$att." size='1'>\n$opt</select>\n";
256 256
 	}
257 257
 
258 258
 	# message pour neuneus (a supprimer ?)
@@ -294,13 +294,13 @@  discard block
 block discarded – undo
294 294
 function selecteur_rubrique_ajax($id_rubrique, $type, $restreint, $idem = 0, $do = 'aff') {
295 295
 
296 296
 	if ($id_rubrique) {
297
-		$titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique);
297
+		$titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique);
298 298
 	} else {
299 299
 		$titre = $type == 'auteur' ? '&nbsp;' : _T('info_racine_site');
300 300
 	}
301 301
 
302 302
 	$titre = str_replace('&amp;', '&', (string) entites_html(textebrut(typo($titre))));
303
-	$init = " disabled='disabled' type='text' value=\"" . $titre . "\"\nstyle='width:300px;'";
303
+	$init = " disabled='disabled' type='text' value=\"".$titre."\"\nstyle='width:300px;'";
304 304
 
305 305
 	$url = generer_url_ecrire('selectionner', "id=$id_rubrique&type=$type&do=$do"
306 306
 		. ($idem ? "&exclus=$idem" : '')
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		. " jQuery(this).toggleClass('toggled'); "
350 350
 		. "return charger_node_url_si_vide('"
351 351
 		. $url
352
-		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='" . attribut_html(_T('titre_image_selecteur')) . "'>"
352
+		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='".attribut_html(_T('titre_image_selecteur'))."'>"
353 353
 		. $img_icone
354 354
 		. "</a><img src='"
355 355
 		. chemin_image('loader.svg')
Please login to merge, or discard this patch.
ecrire/inc/cvt_multietapes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,9 +313,9 @@
 block discarded – undo
313 313
 		&& ($e = $flux['args']['contexte']['_etape']) > 1
314 314
 		&& ($ext = $flux['args']['ext'])
315 315
 		&& ($f = $flux['data'])
316
-		&& file_exists($f . "_$e.$ext")
316
+		&& file_exists($f."_$e.$ext")
317 317
 	) {
318
-		$flux['data'] = $f . "_$e";
318
+		$flux['data'] = $f."_$e";
319 319
 	}
320 320
 
321 321
 	return $flux;
Please login to merge, or discard this patch.
ecrire/inc/layer.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
 		$class = ' blocreplie';
53 53
 	}
54 54
 
55
-	return '<div ' . ($id ? "id='$id' " : '') . "class='bloc_depliable$class'>";
55
+	return '<div '.($id ? "id='$id' " : '')."class='bloc_depliable$class'>";
56 56
 }
57 57
 
58 58
 function fin_block() {
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 // $deplie : true (deplie) ou false (plie) ou -1 (inactif) ou 'incertain' pour que le bouton s'auto init au chargement de la page
64 64
 // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit)
65 65
 function bouton_block_depliable($texte, $deplie, $ids = '') {
66
-	$bouton_id = 'b' . substr(md5($texte . microtime()), 0, 8);
66
+	$bouton_id = 'b'.substr(md5($texte.microtime()), 0, 8);
67 67
 
68 68
 	$class = ($deplie === true) ? ' deplie' : (($deplie == -1) ? ' impliable' : ' replie');
69 69
 	if (strlen((string) $ids)) {
70 70
 		$cible = explode(',', (string) $ids);
71
-		$cible = '#' . implode(',#', $cible);
71
+		$cible = '#'.implode(',#', $cible);
72 72
 	} else {
73 73
 		$cible = "#$bouton_id + div.bloc_depliable";
74 74
 	}
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
@@ -69,17 +69,17 @@
 block discarded – undo
69 69
 		// compat < SPIP 3.3
70 70
 		include_spip('inc/filtres_images_mini');
71 71
 		$c['couleur_foncee'] = $c['couleur_theme'];
72
-		$c['couleur_claire'] = '#' . couleur_eclaircir($c['couleur_theme'], .5);
72
+		$c['couleur_claire'] = '#'.couleur_eclaircir($c['couleur_theme'], .5);
73 73
 
74 74
 		return
75
-			'couleur_theme=' . substr((string) $c['couleur_theme'], 1)
75
+			'couleur_theme='.substr((string) $c['couleur_theme'], 1)
76 76
 			// compat < SPIP 3.3
77
-			. '&couleur_claire=' . substr($c['couleur_claire'], 1)
78
-			. '&couleur_foncee=' . substr((string) $c['couleur_foncee'], 1);
77
+			. '&couleur_claire='.substr($c['couleur_claire'], 1)
78
+			. '&couleur_foncee='.substr((string) $c['couleur_foncee'], 1);
79 79
 	} else {
80 80
 		if (is_array($choix)) {
81 81
 			// compat < SPIP 3.3
82
-			$compat_spip_33 = function ($c) {
82
+			$compat_spip_33 = function($c) {
83 83
 				if (!isset($c['couleur_theme'])) {
84 84
 					$c['couleur_theme'] = $c['couleur_foncee'];
85 85
 					unset($c['couleur_foncee']);
Please login to merge, or discard this patch.