Completed
Push — master ( 3fe97a...7569f9 )
by cam
02:24
created
ecrire/inc/headers.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
 		|| (
79 79
 			!empty($_SERVER['SERVER_SOFTWARE'])
80 80
 				&& _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE
81
-				&& preg_match('/' . _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SOFTWARE'])
81
+				&& preg_match('/'._SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SOFTWARE'])
82 82
 			|| !empty($_SERVER['SERVER_SIGNATURE'])
83 83
 				&& _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE
84
-				&& preg_match('/' . _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SIGNATURE'])
84
+				&& preg_match('/'._SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SIGNATURE'])
85 85
 			|| function_exists('apache_getenv')
86 86
 			|| defined('_SERVER_APACHE')
87 87
 		)
88 88
 	) {
89
-		@header('Location: ' . $url);
89
+		@header('Location: '.$url);
90 90
 		$equiv = '';
91 91
 	} else {
92
-		@header('Refresh: 0; url=' . $url);
92
+		@header('Refresh: 0; url='.$url);
93 93
 		if (isset($GLOBALS['meta']['charset'])) {
94
-			@header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']);
94
+			@header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']);
95 95
 		}
96 96
 		$equiv = "<meta http-equiv='Refresh' content='0; url=$url'>";
97 97
 	}
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 	html_lang_attributes(), '
104 104
 <head>',
105 105
 	$equiv, '
106
-<title>HTTP ' . $status . '</title>
107
-' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset=' . $GLOBALS['meta']['charset'] . '">' : '') . '
106
+<title>HTTP ' . $status.'</title>
107
+' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset='.$GLOBALS['meta']['charset'].'">' : '').'
108 108
 </head>
109 109
 <body>
110
-<h1>HTTP ' . $status . '</h1>
110
+<h1>HTTP ' . $status.'</h1>
111 111
 <a href="',
112 112
 	quote_amp($url),
113 113
 	'">',
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		# en theorie on devrait faire ca tout le temps, mais quand la chaine
143 143
 		# commence par ? c'est imperatif, sinon l'url finale n'est pas la bonne
144 144
 		if ($url[0] == '?') {
145
-			$url = url_de_base() . $url;
145
+			$url = url_de_base().$url;
146 146
 		}
147 147
 		$url = str_replace('&amp;', '&', (string) $url);
148 148
 		spip_log("redirige formulaire ajax: $url");
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 		if ($format == 'ajaxform') {
151 151
 			return [
152 152
 				// on renvoie un lien masque qui sera traite par ajaxCallback.js
153
-				'<a href="' . quote_amp($url) . '" name="ajax_redirect"  style="display:none;">' . _T('navigateur_pas_redirige') . '</a>',
153
+				'<a href="'.quote_amp($url).'" name="ajax_redirect"  style="display:none;">'._T('navigateur_pas_redirige').'</a>',
154 154
 				// et un message au cas ou
155
-				'<br /><a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>'
155
+				'<br /><a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>'
156 156
 			];
157 157
 		} else // format message texte, tout en js inline
158 158
 		{
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 				"<script type='text/javascript'>if (parent.window){parent.window.document.location.replace(\"$url\");} else {document.location.replace(\"$url\");}</script>"
162 162
 				. http_img_pack('loader.svg', '', " class='loader'")
163 163
 				. '<br />'
164
-				. '<a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>';
164
+				. '<a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>';
165 165
 		}
166 166
 	}
167 167
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	header("Content-Type: text/html; charset=$charset");
221 221
 	header('Expires: 0');
222
-	header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
222
+	header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
223 223
 	header('Cache-Control: no-cache, must-revalidate');
224 224
 	header('Pragma: no-cache');
225 225
 }
Please login to merge, or discard this patch.
ecrire/inc/modifier.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 	// Appels incomplets (sans $c)
114 114
 	if (!is_array($c)) {
115
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
115
+		spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c');
116 116
 
117 117
 		return _T('erreur_technique_enregistrement_impossible');
118 118
 	}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	$champs = array_map('corriger_caracteres', $champs);
148 148
 
149 149
 	// On récupère l'état avant toute modification
150
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
150
+	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet);
151 151
 
152 152
 	// Envoyer aux plugins
153 153
 	$champs = pipeline(
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				$id_rubrique = 0;
203 203
 				if (isset($desc['field']['id_rubrique'])) {
204 204
 					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
205
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . (int) $id_objet);
205
+					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".(int) $id_objet);
206 206
 				}
207 207
 				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
208 208
 				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 		}
224 224
 
225 225
 		// allez on commit la modif
226
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . (int) $id_objet, [], $serveur);
226
+		sql_updateq($spip_table_objet, $champs, "$id_table_objet=".(int) $id_objet, [], $serveur);
227 227
 
228 228
 		// on verifie si elle est bien passee
229 229
 		$moof = sql_fetsel(
230 230
 			array_keys($champs),
231 231
 			$spip_table_objet,
232
-			"$id_table_objet=" . (int) $id_objet,
232
+			"$id_table_objet=".(int) $id_objet,
233 233
 			[],
234 234
 			[],
235 235
 			'',
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
 			// c'est un cas exceptionnel
266 266
 			if ($liste !== []) {
267 267
 				spip_log(
268
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
269
-					'modifier.' . _LOG_CRITIQUE
268
+					"Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true),
269
+					'modifier.'._LOG_CRITIQUE
270 270
 				);
271 271
 
272 272
 				return _T(
273 273
 					'erreur_technique_enregistrement_champs',
274
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
274
+					['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"]
275 275
 				);
276 276
 			}
277 277
 		}
@@ -333,18 +333,18 @@  discard block
 block discarded – undo
333 333
 	include_spip('inc/filtres_mini');
334 334
 	$qui = '';
335 335
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
336
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
336
+		$qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#';
337 337
 	}
338 338
 	if (!empty($GLOBALS['visiteur_session']['nom'])) {
339
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
339
+		$qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#';
340 340
 	}
341 341
 	if ($qui == '') {
342
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
342
+		$qui = '#ip:'.$GLOBALS['ip'].'#';
343 343
 	}
344
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . implode(
344
+	journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.implode(
345 345
 		'+',
346 346
 		array_diff(array_keys($champs), ['date_modif'])
347
-	) . ')'), [
347
+	).')'), [
348 348
 		'faire' => 'modifier',
349 349
 		'quoi' => $objet,
350 350
 		'id' => $id_objet
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
@@ -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/meta.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 			renouvelle_alea();
65 65
 			$new = false;
66 66
 		} else {
67
-			spip_log("impossible d'ecrire dans " . $cache);
67
+			spip_log("impossible d'ecrire dans ".$cache);
68 68
 		}
69 69
 	}
70 70
 	// et refaire le cache si on a du lire en base
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	if (!isset($touch[$table])) {
165 165
 		touch_meta($antidate, $table);
166 166
 	}
167
-	sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
167
+	sql_delete('spip_'.$table, "nom='$nom'", '', 'continue');
168 168
 	unset($GLOBALS[$table][$nom]);
169 169
 	if (!isset($touch[$table])) {
170 170
 		touch_meta($antidate, $table);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		return;
197 197
 	}
198 198
 	include_spip('base/abstract_sql');
199
-	$res = sql_select('*', 'spip_' . $table, 'nom=' . sql_quote($nom), '', '', '', '', '', 'continue');
199
+	$res = sql_select('*', 'spip_'.$table, 'nom='.sql_quote($nom), '', '', '', '', '', 'continue');
200 200
 	// table pas encore installee, travailler en php seulement
201 201
 	if (!$res) {
202 202
 		$GLOBALS[$table][$nom] = $valeur;
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 		$r['impt'] = sql_quote($importable, '', 'text');
232 232
 	}
233 233
 	if ($row) {
234
-		sql_update('spip_' . $table, $r, 'nom=' . sql_quote($nom));
234
+		sql_update('spip_'.$table, $r, 'nom='.sql_quote($nom));
235 235
 	} else {
236
-		sql_insert('spip_' . $table, '(' . implode(',', array_keys($r)) . ')', '(' . implode(',', array_values($r)) . ')');
236
+		sql_insert('spip_'.$table, '('.implode(',', array_keys($r)).')', '('.implode(',', array_values($r)).')');
237 237
 	}
238 238
 	if (!isset($touch[$table])) {
239 239
 		touch_meta($antidate, $table);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
  *     Nom du fichier cache
251 251
  **/
252 252
 function cache_meta($table = 'meta') {
253
-	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
253
+	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE.$table.'.php');
254 254
 }
255 255
 
256 256
 /**
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 	$blue = dechex($blue);
43 43
 
44 44
 	if (strlen($red) == 1) {
45
-		$red = '0' . $red;
45
+		$red = '0'.$red;
46 46
 	}
47 47
 	if (strlen($green) == 1) {
48
-		$green = '0' . $green;
48
+		$green = '0'.$green;
49 49
 	}
50 50
 	if (strlen($blue) == 1) {
51
-		$blue = '0' . $blue;
51
+		$blue = '0'.$blue;
52 52
 	}
53 53
 
54 54
 	return "$red$green$blue";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	$couleur = couleur_html_to_hex($couleur);
68 68
 	$couleur = ltrim($couleur, '#');
69 69
 	if (strlen($couleur) === 3) {
70
-		$couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2];
70
+		$couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2];
71 71
 	}
72 72
 	$retour = [];
73 73
 	$retour['red'] = hexdec(substr($couleur, 0, 2));
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	$var_G = ($G / 255);
126 126
 	$var_B = ($B / 255);
127 127
 
128
-	$var_Min = min($var_R, $var_G, $var_B);   //Min. value of RGB
129
-	$var_Max = max($var_R, $var_G, $var_B);   //Max. value of RGB
130
-	$del_Max = $var_Max - $var_Min;           //Delta RGB value
128
+	$var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB
129
+	$var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB
130
+	$del_Max = $var_Max - $var_Min; //Delta RGB value
131 131
 
132 132
 	$L = ($var_Max + $var_Min) / 2;
133 133
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
  */
186 186
 function _couleur_hsl_to_rgb($H, $S, $L) {
187 187
 	// helper
188
-	$hue_2_rgb = function ($v1, $v2, $vH) {
188
+	$hue_2_rgb = function($v1, $v2, $vH) {
189 189
 		if ($vH < 0) {
190 190
 			$vH += 1;
191 191
 		}
@@ -319,11 +319,11 @@  discard block
 block discarded – undo
319 319
 		}
320 320
 	} elseif (
321 321
 		preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs)
322
-		&& ($extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]))
322
+		&& ($extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]))
323 323
 		&& in_array($extension, _image_extensions_acceptees_en_entree())
324 324
 	) {
325 325
 		# gerer img src="data:....base64"
326
-		$local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension);
326
+		$local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension);
327 327
 		if (!file_exists($local)) {
328 328
 			ecrire_fichier($local, base64_decode($regs[2]));
329 329
 		}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	// les protocoles web prennent au moins 3 lettres
341 341
 	if (tester_url_absolue($source)) {
342 342
 		include_spip('inc/distant');
343
-		$fichier = _DIR_RACINE . copie_locale($source);
343
+		$fichier = _DIR_RACINE.copie_locale($source);
344 344
 		if (!$fichier) {
345 345
 			return '';
346 346
 		}
@@ -442,9 +442,9 @@  discard block
 block discarded – undo
442 442
 			// on garde la terminaison initiale car image simplement copiee
443 443
 			// et on postfixe son nom avec un md5 du path
444 444
 			$terminaison_dest = $terminaison;
445
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
445
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
446 446
 		} else {
447
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
447
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
448 448
 		}
449 449
 		$cache = sous_repertoire(_DIR_VAR, $cache);
450 450
 		$cache = sous_repertoire($cache, $effet);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		$fichier_dest = substr($fichier_dest, 2);
456 456
 	}
457 457
 
458
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
458
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
459 459
 
460 460
 	$GLOBALS['images_calculees'][] = $fichier_dest;
461 461
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	}
482 482
 	if ($creer && !@file_exists($fichier)) {
483 483
 		if (!@file_exists("$fichier.src")) {
484
-			spip_log("Image absente : $fichier", 'images' . _LOG_ERREUR);
484
+			spip_log("Image absente : $fichier", 'images'._LOG_ERREUR);
485 485
 
486 486
 			return false;
487 487
 		}
@@ -491,15 +491,15 @@  discard block
 block discarded – undo
491 491
 
492 492
 	if ($creer) {
493 493
 		spip_log(
494
-			'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
495
-			'images' . _LOG_DEBUG
494
+			'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
495
+			'images'._LOG_DEBUG
496 496
 		);
497 497
 	}
498 498
 
499 499
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
500
-	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction;
500
+	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction;
501 501
 	$ret['fichier'] = $fichier;
502
-	$ret['fonction_image'] = '_image_image' . $terminaison_dest;
502
+	$ret['fonction_image'] = '_image_image'.$terminaison_dest;
503 503
 	$ret['fichier_dest'] = $fichier_dest;
504 504
 	$ret['format_source'] = _image_extension_normalisee($terminaison);
505 505
 	$ret['format_dest'] = $terminaison_dest;
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 
643 643
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
644 644
 	if ($_terminaison && $_terminaison !== $terminaison) {
645
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
645
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
646 646
 		$terminaison = $_terminaison;
647 647
 	}
648 648
 	return $terminaison;
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 	if (!function_exists('imagepng')) {
778 778
 		return false;
779 779
 	}
780
-	$tmp = $fichier . '.tmp';
780
+	$tmp = $fichier.'.tmp';
781 781
 	$ret = imagepng($img, $tmp);
782 782
 	if (file_exists($tmp)) {
783 783
 		$taille_test = @getimagesize($tmp);
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 	if (!function_exists('imagegif')) {
813 813
 		return false;
814 814
 	}
815
-	$tmp = $fichier . '.tmp';
815
+	$tmp = $fichier.'.tmp';
816 816
 	$ret = imagegif($img, $tmp);
817 817
 	if (file_exists($tmp)) {
818 818
 		$taille_test = @getimagesize($tmp);
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 	if (!function_exists('imagejpeg')) {
853 853
 		return false;
854 854
 	}
855
-	$tmp = $fichier . '.tmp';
855
+	$tmp = $fichier.'.tmp';
856 856
 
857 857
 	// Enable interlancing
858 858
 	imageinterlace($img, true);
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 	if (!function_exists('imagewebp')) {
914 914
 		return false;
915 915
 	}
916
-	$tmp = $fichier . '.tmp';
916
+	$tmp = $fichier.'.tmp';
917 917
 	$ret = imagewebp($img, $tmp, $qualite);
918 918
 	if (file_exists($tmp)) {
919 919
 		$taille_test = @getimagesize($tmp);
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
  */
948 948
 function _image_imagesvg($img, $fichier) {
949 949
 
950
-	$tmp = $fichier . '.tmp';
950
+	$tmp = $fichier.'.tmp';
951 951
 	if (!str_contains($img, '<')) {
952 952
 		$img = supprimer_timestamp($img);
953 953
 		if (!file_exists($img)) {
@@ -1004,14 +1004,14 @@  discard block
 block discarded – undo
1004 1004
  */
1005 1005
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1006 1006
 	if (is_null($fonction)) {
1007
-		$fonction = '_image_image' . $valeurs['format_dest'];
1007
+		$fonction = '_image_image'.$valeurs['format_dest'];
1008 1008
 	}
1009 1009
 	$ret = false;
1010 1010
 	#un flag pour reperer les images gravees
1011 1011
 	$lock = (
1012 1012
 		!statut_effacer_images_temporaires('get')
1013 1013
 		|| @file_exists($valeurs['fichier_dest'])
1014
-		&& !@file_exists($valeurs['fichier_dest'] . '.src')
1014
+		&& !@file_exists($valeurs['fichier_dest'].'.src')
1015 1015
 	);
1016 1016
 	if (
1017 1017
 		function_exists($fonction)
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 		[$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']);
1024 1024
 		$valeurs['date'] = @filemtime($valeurs['fichier_dest']);
1025 1025
 		// pour la retrouver apres disparition
1026
-		ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1026
+		ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1027 1027
 	}
1028 1028
 
1029 1029
 	return $ret;
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 
1199 1199
 	// attributs deprecies. Transformer en CSS
1200 1200
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1201
-		$style = "margin:{$espace}px;" . $style;
1201
+		$style = "margin:{$espace}px;".$style;
1202 1202
 		$tag = inserer_attribut($tag, 'hspace', '');
1203 1203
 	}
1204 1204
 
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 	$image = $valeurs['fichier'];
1322 1322
 	$format = $valeurs['format_source'];
1323 1323
 	$destdir = dirname((string) $valeurs['fichier_dest']);
1324
-	$destfile = basename((string) $valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1324
+	$destfile = basename((string) $valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1325 1325
 
1326 1326
 	$format_sortie = $valeurs['format_dest'];
1327 1327
 
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
 
1354 1354
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1355 1355
 	if ($srcWidth && $srcWidth <= $maxWidth && $srcHeight <= $maxHeight) {
1356
-		$vignette = $destination . '.' . $format;
1356
+		$vignette = $destination.'.'.$format;
1357 1357
 		@copy($image, $vignette);
1358 1358
 	}
1359 1359
 
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 		include_spip('inc/svg');
1362 1362
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1363 1363
 			$format_sortie = 'svg';
1364
-			$vignette = $destination . '.' . $format_sortie;
1364
+			$vignette = $destination.'.'.$format_sortie;
1365 1365
 			$valeurs['fichier_dest'] = $vignette;
1366 1366
 			_image_gd_output($svg, $valeurs);
1367 1367
 		}
@@ -1373,9 +1373,9 @@  discard block
 block discarded – undo
1373 1373
 			define('_CONVERT_COMMAND', 'convert');
1374 1374
 		} // Securite : mes_options.php peut preciser le chemin absolu
1375 1375
 		if (!defined('_RESIZE_COMMAND')) {
1376
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -orient Undefined -resize %xx%y! %src %dest');
1376
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -orient Undefined -resize %xx%y! %src %dest');
1377 1377
 		}
1378
-		$vignette = $destination . '.' . $format_sortie;
1378
+		$vignette = $destination.'.'.$format_sortie;
1379 1379
 		$commande = str_replace(
1380 1380
 			['%x', '%y', '%src', '%dest'],
1381 1381
 			[
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 		if (!@file_exists($vignette)) {
1392 1392
 			spip_log("echec convert sur $vignette");
1393 1393
 
1394
-			return;  // echec commande
1394
+			return; // echec commande
1395 1395
 		}
1396 1396
 	}
1397 1397
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 		if (!$output) {
1409 1409
 			return;
1410 1410
 		}
1411
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1411
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1412 1412
 
1413 1413
 		$imagick = new Imagick();
1414 1414
 		$imagick->readImage(realpath($image));
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
 			$destHeight,
1418 1418
 			Imagick::FILTER_LANCZOS,
1419 1419
 			1
1420
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1420
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1421 1421
 		$imagick->writeImage($vignette);
1422 1422
 
1423 1423
 		if (!@file_exists($vignette)) {
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
 			return;
1427 1427
 		}
1428 1428
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1429
-		$vignette = $destination . '.' . $format_sortie;
1429
+		$vignette = $destination.'.'.$format_sortie;
1430 1430
 	}
1431 1431
 
1432 1432
 	// netpbm
@@ -1437,11 +1437,11 @@  discard block
 block discarded – undo
1437 1437
 		if (_PNMSCALE_COMMAND == '') {
1438 1438
 			return;
1439 1439
 		}
1440
-		$vignette = $destination . '.' . $format_sortie;
1440
+		$vignette = $destination.'.'.$format_sortie;
1441 1441
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', (string) _PNMSCALE_COMMAND);
1442 1442
 		if ($format == 'jpg') {
1443 1443
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', (string) _PNMSCALE_COMMAND);
1444
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1444
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1445 1445
 			if (!($s = @filesize($vignette))) {
1446 1446
 				spip_unlink($vignette);
1447 1447
 			}
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 		} else {
1454 1454
 			if ($format == 'gif') {
1455 1455
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', (string) _PNMSCALE_COMMAND);
1456
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1456
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1457 1457
 				if (!($s = @filesize($vignette))) {
1458 1458
 					spip_unlink($vignette);
1459 1459
 				}
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
 			} else {
1466 1466
 				if ($format == 'png') {
1467 1467
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', (string) _PNMSCALE_COMMAND);
1468
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1468
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1469 1469
 					if (!($s = @filesize($vignette))) {
1470 1470
 						spip_unlink($vignette);
1471 1471
 					}
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
 			return;
1488 1488
 		}
1489 1489
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1490
-			spip_log('vignette gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1490
+			spip_log('vignette gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1491 1491
 
1492 1492
 			return;
1493 1493
 		}
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
 		// de l'image, de facon a tromper le cache du navigateur
1791 1791
 		// quand on fait supprimer/reuploader un logo
1792 1792
 		// (pas de filemtime si SAFE MODE)
1793
-		$date = test_espace_prive() ? ('?' . $date) : '';
1793
+		$date = test_espace_prive() ? ('?'.$date) : '';
1794 1794
 
1795 1795
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1796 1796
 	}
@@ -1868,9 +1868,9 @@  discard block
 block discarded – undo
1868 1868
 					$b = $argb['blue'];
1869 1869
 
1870 1870
 					if ($bpp[$key] == 32) {
1871
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1871
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1872 1872
 					} elseif ($bpp[$key] === 24) {
1873
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1873
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1874 1874
 					}
1875 1875
 
1876 1876
 					if ($a < 128) {
@@ -1897,48 +1897,48 @@  discard block
 block discarded – undo
1897 1897
 
1898 1898
 			// BITMAPINFOHEADER - 40 bytes
1899 1899
 			$BitmapInfoHeader[$key] = '';
1900
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1901
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1900
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1901
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1902 1902
 			// The biHeight member specifies the combined
1903 1903
 			// height of the XOR and AND masks.
1904 1904
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1905
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1906
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1907
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1908
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1909
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1910
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1911
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1912
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1905
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1906
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1907
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1908
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1909
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1910
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1911
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1912
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1913 1913
 		}
1914 1914
 
1915 1915
 
1916
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1917
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1918
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1916
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1917
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1918
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1919 1919
 
1920 1920
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1921 1921
 		foreach (array_keys($gd_image_array) as $key) {
1922 1922
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1923 1923
 
1924
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1925
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1926
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1927
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1924
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1925
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1926
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1927
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1928 1928
 
1929
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1930
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1929
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1930
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1931 1931
 
1932 1932
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1933 1933
 			$icondata .= phpthumb_functions::LittleEndian2String(
1934 1934
 				$dwBytesInRes,
1935 1935
 				4
1936
-			);     // dwBytesInRes;	// How many bytes in this resource?
1936
+			); // dwBytesInRes;	// How many bytes in this resource?
1937 1937
 
1938 1938
 			$icondata .= phpthumb_functions::LittleEndian2String(
1939 1939
 				$dwImageOffset,
1940 1940
 				4
1941
-			);    // dwImageOffset;   // Where in the file is this image?
1941
+			); // dwImageOffset;   // Where in the file is this image?
1942 1942
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1943 1943
 			$dwImageOffset += strlen($icXOR[$key]);
1944 1944
 			$dwImageOffset += strlen($icAND[$key]);
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
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		if ($res) {
55 55
 			return $res;
56 56
 		}
57
-		spip_log("meta: $script " . print_r($_POST, true));
57
+		spip_log("meta: $script ".print_r($_POST, true));
58 58
 		ecrire_meta($script, serialize($_POST));
59 59
 	}
60 60
 
@@ -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
 /**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	} else {
198 198
 		$dir = dir_admin();
199 199
 		$signal = fichier_admin($script);
200
-		if (@file_exists($dir . $signal)) {
200
+		if (@file_exists($dir.$signal)) {
201 201
 			spip_log("Action admin: $action");
202 202
 
203 203
 			return '';
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 				return '';
217 217
 			}
218
-			$corps .= '<input type="hidden" name="validation_admin" value="' . $signal . '" />';
218
+			$corps .= '<input type="hidden" name="validation_admin" value="'.$signal.'" />';
219 219
 			$suivant = _T('bouton_valider');
220 220
 			$js = '';
221 221
 		} else {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 				. "</legend>\n<label for='fichier'>"
231 231
 				. _T('info_creer_repertoire')
232 232
 				. "</label>\n"
233
-				. "<span id='signal' class='formo'>" . $signal . '</span>'
233
+				. "<span id='signal' class='formo'>".$signal.'</span>'
234 234
 				. "<input type='hidden' id='fichier' name='fichier' value='"
235 235
 				. $signal
236 236
 				. "' />"
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
  *     Nom de l'action (en base) qui a été exécutée
268 268
  **/
269 269
 function fin_admin($action) {
270
-	$signal = dir_admin() . fichier_admin($action);
270
+	$signal = dir_admin().fichier_admin($action);
271 271
 	spip_unlink($signal);
272 272
 	if ($action != 'delete_all') {
273 273
 		effacer_meta($action);
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 	include_spip('inc/filtres');
296 296
 	foreach ([...$_POST, ...$_GET] as $n => $c) {
297 297
 		if (!in_array($n, ['fichier', 'exec', 'validation_admin']) && !is_array($c)) {
298
-			$suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" .
299
-				entites_html($c) .
298
+			$suite .= "\n<input type='hidden' name='".spip_htmlspecialchars($n)."' value='".
299
+				entites_html($c).
300 300
 				"'  />";
301 301
 		}
302 302
 	}
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.