Completed
Push — master ( cacd66...717daf )
by cam
02:37 queued 21s
created
ecrire/inc/modifier.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 	// Appels incomplets (sans $c)
115 115
 	if (!is_array($c)) {
116
-		spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c');
116
+		spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c');
117 117
 
118 118
 		return _T('erreur_technique_enregistrement_impossible');
119 119
 	}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	// N'accepter que les champs qui existent dans la table
141 141
 	$champs = array_intersect_key($c, $desc['field']);
142 142
 	// et dont la valeur n'est pas null
143
-	$champs = array_filter($champs, static function($var){return $var !== null;} );
143
+	$champs = array_filter($champs, static function($var) {return $var !== null; } );
144 144
 	// TODO: ici aussi on peut valider les contenus
145 145
 	// en fonction du type
146 146
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	$champs = array_map('corriger_caracteres', $champs);
149 149
 
150 150
 	// On récupère l'état avant toute modification
151
-	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet);
151
+	$row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet);
152 152
 
153 153
 	// Envoyer aux plugins
154 154
 	$champs = pipeline(
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 				$id_rubrique = 0;
204 204
 				if (isset($desc['field']['id_rubrique'])) {
205 205
 					$parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique';
206
-					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet));
206
+					$id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet));
207 207
 				}
208 208
 				$instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action');
209 209
 				$champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur);
@@ -225,13 +225,13 @@  discard block
 block discarded – undo
225 225
 		}
226 226
 
227 227
 		// allez on commit la modif
228
-		sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), [], $serveur);
228
+		sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), [], $serveur);
229 229
 
230 230
 		// on verifie si elle est bien passee
231 231
 		$moof = sql_fetsel(
232 232
 			array_keys($champs),
233 233
 			$spip_table_objet,
234
-			"$id_table_objet=" . intval($id_objet),
234
+			"$id_table_objet=".intval($id_objet),
235 235
 			[],
236 236
 			[],
237 237
 			'',
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 			// c'est un cas exceptionnel
268 268
 			if (count($liste)) {
269 269
 				spip_log(
270
-					"Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true),
271
-					'modifier.' . _LOG_CRITIQUE
270
+					"Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true),
271
+					'modifier.'._LOG_CRITIQUE
272 272
 				);
273 273
 
274 274
 				return _T(
275 275
 					'erreur_technique_enregistrement_champs',
276
-					['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"]
276
+					['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"]
277 277
 				);
278 278
 			}
279 279
 		}
@@ -315,18 +315,18 @@  discard block
 block discarded – undo
315 315
 	include_spip('inc/filtres_mini');
316 316
 	$qui = '';
317 317
 	if (!empty($GLOBALS['visiteur_session']['id_auteur'])) {
318
-		$qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#';
318
+		$qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#';
319 319
 	}
320 320
 	if (!empty($GLOBALS['visiteur_session']['nom'])) {
321
-		$qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#';
321
+		$qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#';
322 322
 	}
323 323
 	if ($qui == '') {
324
-		$qui = '#ip:' . $GLOBALS['ip'] . '#';
324
+		$qui = '#ip:'.$GLOBALS['ip'].'#';
325 325
 	}
326
-	journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join(
326
+	journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join(
327 327
 		'+',
328 328
 		array_diff(array_keys($champs), ['date_modif'])
329
-	) . ')'), [
329
+	).')'), [
330 330
 		'faire' => 'modifier',
331 331
 		'quoi' => $objet,
332 332
 		'id' => $id_objet
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +24 added lines, -25 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	if (
221 221
 		$config_fonc
222 222
 		and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
223
-		and $config_fonc !== $table_objet . '_edit_config'
223
+		and $config_fonc !== $table_objet.'_edit_config'
224 224
 	) {
225 225
 		if (
226 226
 			$args = test_formulaire_inclus_par_modele()
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 	// Appel direct dans un squelette
236 236
 	if (!$row) {
237 237
 		if (!$new or $lier_trad) {
238
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
238
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
239 239
 				$row = $select($id, $id_parent, $lier_trad);
240 240
 				// si on a une fonction precharger, elle pu faire un reglage de langue
241 241
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
242 242
 			} else {
243
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
243
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
244 244
 			}
245 245
 			if (!$new) {
246 246
 				$md5 = controles_md5($row ?: []);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	if ($config_fonc) {
291 291
 		$contexte['config'] = $config = $config_fonc($contexte);
292 292
 		if (!$lang_default) {
293
-			$lang_default = $config['langue'] ?? session_get('lang') ;
293
+			$lang_default = $config['langue'] ?? session_get('lang');
294 294
 		}
295 295
 	}
296 296
 	$config = $config + [
@@ -314,13 +314,12 @@  discard block
 block discarded – undo
314 314
 		unset($contexte['lang']);
315 315
 	}
316 316
 
317
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
318
-		(!$lier_trad ? '' :
319
-			("\n<input type='hidden' name='lier_trad' value='" .
320
-				$lier_trad .
321
-				"' />" .
322
-				"\n<input type='hidden' name='changer_lang' value='" .
323
-				$lang_default .
317
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
318
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
319
+				$lier_trad.
320
+				"' />".
321
+				"\n<input type='hidden' name='changer_lang' value='".
322
+				$lang_default.
324 323
 				"' />"))
325 324
 		. $hidden
326 325
 		. ($md5 ?? '');
@@ -360,14 +359,14 @@  discard block
 block discarded – undo
360 359
 	$aider = charger_fonction('aider', 'inc');
361 360
 	if (strlen($texte) > 28 * 1024) {
362 361
 		$texte = str_replace("\r\n", "\n", $texte);
363
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
362
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
364 363
 		if ($pos > 0 and $pos < 32 * 1024) {
365
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
364
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
366 365
 			$suite = substr($texte, $pos + 2);
367 366
 		} else {
368
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
367
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
369 368
 			if (!($pos > 0 and $pos < 32 * 1024)) {
370
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
369
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
371 370
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
372 371
 			} else {
373 372
 				$decalage = 1;
@@ -398,13 +397,13 @@  discard block
 block discarded – undo
398 397
 	}
399 398
 
400 399
 	include_spip('inc/barre');
401
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
400
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
402 401
 	$nombre = 0;
403 402
 
404 403
 	while (strlen($texte) > 29 * 1024) {
405 404
 		$nombre++;
406 405
 		[$texte1, $texte] = coupe_trop_long($texte);
407
-		$textes_supplement .= '<br />' .
406
+		$textes_supplement .= '<br />'.
408 407
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
409 408
 	}
410 409
 
@@ -487,7 +486,7 @@  discard block
 block discarded – undo
487 486
 	$ctr = [];
488 487
 	foreach ($data as $key => $val) {
489 488
 		$m = md5($val ?? '');
490
-		$k = $prefixe . $key;
489
+		$k = $prefixe.$key;
491 490
 
492 491
 		switch ($format) {
493 492
 			case 'html':
@@ -500,7 +499,7 @@  discard block
 block discarded – undo
500 499
 	}
501 500
 
502 501
 	if ($format === 'html') {
503
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
502
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
504 503
 	} else {
505 504
 		return $ctr;
506 505
 	}
@@ -652,7 +651,7 @@  discard block
 block discarded – undo
652 651
 	// On elimine les donnees non modifiees par le formulaire (mais
653 652
 	// potentiellement modifiees entre temps par un autre utilisateur)
654 653
 	foreach ($champs as $key => $val) {
655
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
654
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
656 655
 			if (is_scalar($val) and $m == md5($val)) {
657 656
 				unset($champs[$key]);
658 657
 			}
@@ -681,7 +680,7 @@  discard block
 block discarded – undo
681 680
 	// de conflit.
682 681
 	$ctrh = $ctrq = $conflits = [];
683 682
 	foreach (array_keys($champs) as $key) {
684
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
683
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
685 684
 			$ctrh[$key] = $m;
686 685
 			$ctrq[] = $key;
687 686
 		}
@@ -715,8 +714,8 @@  discard block
 block discarded – undo
715 714
  */
716 715
 function display_conflit_champ($x) {
717 716
 	if (strstr($x, "\n") or strlen($x) > 80) {
718
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
717
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
719 718
 	} else {
720
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
719
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
721 720
 	}
722 721
 }
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
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	$blue = dechex($blue);
44 44
 
45 45
 	if (strlen($red) == 1) {
46
-		$red = '0' . $red;
46
+		$red = '0'.$red;
47 47
 	}
48 48
 	if (strlen($green) == 1) {
49
-		$green = '0' . $green;
49
+		$green = '0'.$green;
50 50
 	}
51 51
 	if (strlen($blue) == 1) {
52
-		$blue = '0' . $blue;
52
+		$blue = '0'.$blue;
53 53
 	}
54 54
 
55 55
 	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
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
  */
190 190
 function _couleur_hsl_to_rgb($H, $S, $L) {
191 191
 	// helper
192
-	$hue_2_rgb = function ($v1, $v2, $vH) {
192
+	$hue_2_rgb = function($v1, $v2, $vH) {
193 193
 		if ($vH < 0) {
194 194
 			$vH += 1;
195 195
 		}
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 		$img = "<img src='$source' />";
322 322
 	} elseif (
323 323
 		preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs)
324
-		and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1])
324
+		and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1])
325 325
 		and in_array($extension, _image_extensions_acceptees_en_entree())
326 326
 	) {
327 327
 		# gerer img src="data:....base64"
328
-		$local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension);
328
+		$local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension);
329 329
 		if (!file_exists($local)) {
330 330
 			ecrire_fichier($local, base64_decode($regs[2]));
331 331
 		}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	// les protocoles web prennent au moins 3 lettres
343 343
 	if (tester_url_absolue($source)) {
344 344
 		include_spip('inc/distant');
345
-		$fichier = _DIR_RACINE . copie_locale($source);
345
+		$fichier = _DIR_RACINE.copie_locale($source);
346 346
 		if (!$fichier) {
347 347
 			return '';
348 348
 		}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 			// on garde la terminaison initiale car image simplement copiee
441 441
 			// et on postfixe son nom avec un md5 du path
442 442
 			$terminaison_dest = $terminaison;
443
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
443
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
444 444
 		} else {
445
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
445
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
446 446
 		}
447 447
 		$cache = sous_repertoire(_DIR_VAR, $cache);
448 448
 		$cache = sous_repertoire($cache, $effet);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$fichier_dest = substr($fichier_dest, 2);
454 454
 	}
455 455
 
456
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
456
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
457 457
 
458 458
 	$GLOBALS['images_calculees'][] = $fichier_dest;
459 459
 
@@ -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;
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
650 650
 	if ($_terminaison and $_terminaison !== $terminaison) {
651
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
651
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
652 652
 		$terminaison = $_terminaison;
653 653
 	}
654 654
 	return $terminaison;
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 	if (!function_exists('imagepng')) {
806 806
 		return false;
807 807
 	}
808
-	$tmp = $fichier . '.tmp';
808
+	$tmp = $fichier.'.tmp';
809 809
 	$ret = imagepng($img, $tmp);
810 810
 	if (file_exists($tmp)) {
811 811
 		$taille_test = getimagesize($tmp);
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 	if (!function_exists('imagegif')) {
841 841
 		return false;
842 842
 	}
843
-	$tmp = $fichier . '.tmp';
843
+	$tmp = $fichier.'.tmp';
844 844
 	$ret = imagegif($img, $tmp);
845 845
 	if (file_exists($tmp)) {
846 846
 		$taille_test = getimagesize($tmp);
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 	if (!function_exists('imagejpeg')) {
881 881
 		return false;
882 882
 	}
883
-	$tmp = $fichier . '.tmp';
883
+	$tmp = $fichier.'.tmp';
884 884
 
885 885
 	// Enable interlancing
886 886
 	imageinterlace($img, true);
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 	if (!function_exists('imagewebp')) {
942 942
 		return false;
943 943
 	}
944
-	$tmp = $fichier . '.tmp';
944
+	$tmp = $fichier.'.tmp';
945 945
 	$ret = imagewebp($img, $tmp, $qualite);
946 946
 	if (file_exists($tmp)) {
947 947
 		$taille_test = getimagesize($tmp);
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
  */
976 976
 function _image_imagesvg($img, $fichier) {
977 977
 
978
-	$tmp = $fichier . '.tmp';
978
+	$tmp = $fichier.'.tmp';
979 979
 	if (strpos($img, '<') === false) {
980 980
 		$img = supprimer_timestamp($img);
981 981
 		if (!file_exists($img)) {
@@ -1032,14 +1032,14 @@  discard block
 block discarded – undo
1032 1032
  */
1033 1033
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1034 1034
 	if (is_null($fonction)) {
1035
-		$fonction = '_image_image' . $valeurs['format_dest'];
1035
+		$fonction = '_image_image'.$valeurs['format_dest'];
1036 1036
 	}
1037 1037
 	$ret = false;
1038 1038
 	#un flag pour reperer les images gravees
1039 1039
 	$lock = (
1040 1040
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1041 1041
 	    or
1042
-		(@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'))
1042
+		(@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'))
1043 1043
 		);
1044 1044
 	if (
1045 1045
 		function_exists($fonction)
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
 			// dans tous les cas mettre a jour la taille de l'image finale
1052 1052
 			[$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']);
1053 1053
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1054
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1054
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1055 1055
 		}
1056 1056
 	}
1057 1057
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 
1227 1227
 	// attributs deprecies. Transformer en CSS
1228 1228
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1229
-		$style = "margin:${espace}px;" . $style;
1229
+		$style = "margin:${espace}px;".$style;
1230 1230
 		$tag = inserer_attribut($tag, 'hspace', '');
1231 1231
 	}
1232 1232
 
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
 	$image = $valeurs['fichier'];
1354 1354
 	$format = $valeurs['format_source'];
1355 1355
 	$destdir = dirname($valeurs['fichier_dest']);
1356
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1356
+	$destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1357 1357
 
1358 1358
 	$format_sortie = $valeurs['format_dest'];
1359 1359
 
@@ -1385,14 +1385,14 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1387 1387
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1388
-		$vignette = $destination . '.' . $format;
1388
+		$vignette = $destination.'.'.$format;
1389 1389
 		@copy($image, $vignette);
1390 1390
 	}
1391 1391
 
1392 1392
 	elseif ($valeurs['format_source'] === 'svg') {
1393 1393
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1394 1394
 			$format_sortie = 'svg';
1395
-			$vignette = $destination . '.' . $format_sortie;
1395
+			$vignette = $destination.'.'.$format_sortie;
1396 1396
 			$valeurs['fichier_dest'] = $vignette;
1397 1397
 			_image_gd_output($svg, $valeurs);
1398 1398
 		}
@@ -1404,9 +1404,9 @@  discard block
 block discarded – undo
1404 1404
 			define('_CONVERT_COMMAND', 'convert');
1405 1405
 		} // Securite : mes_options.php peut preciser le chemin absolu
1406 1406
 		if (!defined('_RESIZE_COMMAND')) {
1407
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest');
1407
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest');
1408 1408
 		}
1409
-		$vignette = $destination . '.' . $format_sortie;
1409
+		$vignette = $destination.'.'.$format_sortie;
1410 1410
 		$commande = str_replace(
1411 1411
 			['%x', '%y', '%src', '%dest'],
1412 1412
 			[
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 		if (!@file_exists($vignette)) {
1423 1423
 			spip_log("echec convert sur $vignette");
1424 1424
 
1425
-			return;  // echec commande
1425
+			return; // echec commande
1426 1426
 		}
1427 1427
 	}
1428 1428
 
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 		if (!$output) {
1441 1441
 			return;
1442 1442
 		}
1443
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1443
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1444 1444
 
1445 1445
 		$imagick = new Imagick();
1446 1446
 		$imagick->readImage(realpath($image));
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 			$destHeight,
1450 1450
 			Imagick::FILTER_LANCZOS,
1451 1451
 			1
1452
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1452
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1453 1453
 		$imagick->writeImage($vignette);
1454 1454
 
1455 1455
 		if (!@file_exists($vignette)) {
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 			return;
1459 1459
 		}
1460 1460
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1461
-		$vignette = $destination . '.' . $format_sortie;
1461
+		$vignette = $destination.'.'.$format_sortie;
1462 1462
 	}
1463 1463
 
1464 1464
 	// netpbm
@@ -1469,11 +1469,11 @@  discard block
 block discarded – undo
1469 1469
 		if (_PNMSCALE_COMMAND == '') {
1470 1470
 			return;
1471 1471
 		}
1472
-		$vignette = $destination . '.' . $format_sortie;
1472
+		$vignette = $destination.'.'.$format_sortie;
1473 1473
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1474 1474
 		if ($format == 'jpg') {
1475 1475
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1476
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1476
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1477 1477
 			if (!($s = @filesize($vignette))) {
1478 1478
 				spip_unlink($vignette);
1479 1479
 			}
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 		} else {
1486 1486
 			if ($format == 'gif') {
1487 1487
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1488
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1488
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1489 1489
 				if (!($s = @filesize($vignette))) {
1490 1490
 					spip_unlink($vignette);
1491 1491
 				}
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
 			} else {
1498 1498
 				if ($format == 'png') {
1499 1499
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1500
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1500
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1501 1501
 					if (!($s = @filesize($vignette))) {
1502 1502
 						spip_unlink($vignette);
1503 1503
 					}
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
 			return;
1520 1520
 		}
1521 1521
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1522
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1522
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1523 1523
 
1524 1524
 			return;
1525 1525
 		}
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
 		// de l'image, de facon a tromper le cache du navigateur
1832 1832
 		// quand on fait supprimer/reuploader un logo
1833 1833
 		// (pas de filemtime si SAFE MODE)
1834
-		$date = test_espace_prive() ? ('?' . $date) : '';
1834
+		$date = test_espace_prive() ? ('?'.$date) : '';
1835 1835
 
1836 1836
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1837 1837
 	}
@@ -1877,7 +1877,7 @@  discard block
 block discarded – undo
1877 1877
 	public static function LittleEndian2String($number, $minbytes = 1) {
1878 1878
 		$intstring = '';
1879 1879
 		while ($number > 0) {
1880
-			$intstring = $intstring . chr($number & 255);
1880
+			$intstring = $intstring.chr($number & 255);
1881 1881
 			$number >>= 8;
1882 1882
 		}
1883 1883
 
@@ -1909,9 +1909,9 @@  discard block
 block discarded – undo
1909 1909
 					$b = $argb['blue'];
1910 1910
 
1911 1911
 					if ($bpp[$key] == 32) {
1912
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1912
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1913 1913
 					} elseif ($bpp[$key] == 24) {
1914
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1914
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1915 1915
 					}
1916 1916
 
1917 1917
 					if ($a < 128) {
@@ -1938,48 +1938,48 @@  discard block
 block discarded – undo
1938 1938
 
1939 1939
 			// BITMAPINFOHEADER - 40 bytes
1940 1940
 			$BitmapInfoHeader[$key] = '';
1941
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1942
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1941
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1942
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1943 1943
 			// The biHeight member specifies the combined
1944 1944
 			// height of the XOR and AND masks.
1945 1945
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1946
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1947
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1948
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1949
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1950
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1951
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1952
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1953
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1946
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1947
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1948
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1949
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1950
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1951
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1952
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1953
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1954 1954
 		}
1955 1955
 
1956 1956
 
1957
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1958
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1959
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1957
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1958
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1959
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1960 1960
 
1961 1961
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1962 1962
 		foreach ($gd_image_array as $key => $gd_image) {
1963 1963
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1964 1964
 
1965
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1966
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1967
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1968
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1965
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1966
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1967
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1968
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1969 1969
 
1970
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1971
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1970
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1971
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1972 1972
 
1973 1973
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1974 1974
 			$icondata .= phpthumb_functions::LittleEndian2String(
1975 1975
 				$dwBytesInRes,
1976 1976
 				4
1977
-			);     // dwBytesInRes;	// How many bytes in this resource?
1977
+			); // dwBytesInRes;	// How many bytes in this resource?
1978 1978
 
1979 1979
 			$icondata .= phpthumb_functions::LittleEndian2String(
1980 1980
 				$dwImageOffset,
1981 1981
 				4
1982
-			);    // dwImageOffset;   // Where in the file is this image?
1982
+			); // dwImageOffset;   // Where in the file is this image?
1983 1983
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1984 1984
 			$dwImageOffset += strlen($icXOR[$key]);
1985 1985
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.
prive/formulaires/editer_liens.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	// L'éditabilité :) est définie par un test permanent (par exemple "associermots") ET le 4ème argument
107 107
 	include_spip('inc/autoriser');
108
-	$editable = ($editable and autoriser('associer' . $table_source, $objet, $id_objet)
108
+	$editable = ($editable and autoriser('associer'.$table_source, $objet, $id_objet)
109 109
 		and autoriser('modifier', $objet, $id_objet));
110 110
 
111 111
 	if (
@@ -119,15 +119,15 @@  discard block
 block discarded – undo
119 119
 
120 120
 	// squelettes de vue et de d'association
121 121
 	// ils sont différents si des rôles sont définis.
122
-	$skel_vue = $table_source . '_lies';
123
-	$skel_ajout = $table_source . '_associer';
122
+	$skel_vue = $table_source.'_lies';
123
+	$skel_ajout = $table_source.'_associer';
124 124
 
125 125
 	// description des roles
126 126
 	include_spip('inc/roles');
127 127
 	if ($roles = roles_presents($objet_source, $objet)) {
128 128
 		// on demande de nouveaux squelettes en conséquence
129
-		$skel_vue = $table_source . '_roles_lies';
130
-		$skel_ajout = $table_source . '_roles_associer';
129
+		$skel_vue = $table_source.'_roles_lies';
130
+		$skel_ajout = $table_source.'_roles_associer';
131 131
 	}
132 132
 
133 133
 	$oups = '';
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 function lien_retrouver_qualif($objet_lien, $lien) {
427 427
 	// un role est défini dans la liaison
428 428
 	$defs = explode('-', $lien);
429
-	[$objet1, , $objet2, , $role] = array_pad($defs, 5, null);
429
+	[$objet1,, $objet2,, $role] = array_pad($defs, 5, null);
430 430
 	if ($objet_lien == $objet1) {
431 431
 		$colonne_role = roles_colonne($objet1, $objet2);
432 432
 	} else {
Please login to merge, or discard this patch.