Completed
Push — master ( 81a660...8ce9c8 )
by cam
01:32
created
ecrire/plugins/verifie_conformite.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 	}
51 51
 	if (is_null($p)) {
52
-		$arbre = ['erreur' => [_T('erreur_plugin_tag_plugin_absent') . " : $plug"]];
52
+		$arbre = ['erreur' => [_T('erreur_plugin_tag_plugin_absent')." : $plug"]];
53 53
 		$silence = true;
54 54
 	} else {
55 55
 		$arbre = $p;
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 		if (isset($arbre['etat'])) {
85 85
 			$etat = trim(end($arbre['etat']));
86 86
 			if (!in_array($etat, $etats)) {
87
-				$arbre['erreur'][] = _T('erreur_plugin_etat_inconnu') . " : '$etat'";
87
+				$arbre['erreur'][] = _T('erreur_plugin_etat_inconnu')." : '$etat'";
88 88
 			}
89 89
 		}
90 90
 		if (isset($arbre['options'])) {
91 91
 			foreach ($arbre['options'] as $optfile) {
92 92
 				$optfile = trim($optfile);
93
-				if (!@is_readable($dir_plugins . "$plug/$optfile") && !$silence) {
94
-					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $optfile";
93
+				if (!@is_readable($dir_plugins."$plug/$optfile") && !$silence) {
94
+					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $optfile";
95 95
 				}
96 96
 			}
97 97
 		}
98 98
 		if (isset($arbre['fonctions'])) {
99 99
 			foreach ($arbre['fonctions'] as $optfile) {
100 100
 				$optfile = trim($optfile);
101
-				if (!@is_readable($dir_plugins . "$plug/$optfile") && !$silence) {
102
-					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $optfile";
101
+				if (!@is_readable($dir_plugins."$plug/$optfile") && !$silence) {
102
+					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $optfile";
103 103
 				}
104 104
 			}
105 105
 		}
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 			$action = $pipe['action'] ?? $pipe['nom'];
126 126
 			// verif que la methode a un nom autorise
127 127
 			if (in_array(strtolower($action), $liste_methodes_reservees) && !$silence) {
128
-				$arbre['erreur'][] = _T('erreur_plugin_nom_fonction_interdit') . " : $action";
128
+				$arbre['erreur'][] = _T('erreur_plugin_nom_fonction_interdit')." : $action";
129 129
 			}
130 130
 			if (isset($pipe['inclure'])) {
131
-				$inclure = $dir_plugins . "$plug/" . $pipe['inclure'];
131
+				$inclure = $dir_plugins."$plug/".$pipe['inclure'];
132 132
 				if (!@is_readable($inclure) && !$silence) {
133
-					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $inclure";
133
+					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $inclure";
134 134
 				}
135 135
 			}
136 136
 		}
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 			foreach ($arbre['noisette'] as $k => $nut) {
200 200
 				$nut = preg_replace(',[.]html$,uims', '', trim($nut));
201 201
 				$arbre['noisette'][$k] = $nut;
202
-				if (!@is_readable($dir_plugins . "$plug/$nut.html") && !$silence) {
203
-					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $nut";
202
+				if (!@is_readable($dir_plugins."$plug/$nut.html") && !$silence) {
203
+					$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $nut";
204 204
 				}
205 205
 			}
206 206
 		}
Please login to merge, or discard this patch.
ecrire/plugins/afficher_nom_plugin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 	// numerotons les occurences d'un meme prefix
38 38
 	$versions[$info['prefix']] = isset($versions[$info['prefix']]) ? $versions[$info['prefix']] + 1 : '';
39
-	$id = $info['prefix'] . $versions[$info['prefix']];
39
+	$id = $info['prefix'].$versions[$info['prefix']];
40 40
 
41 41
 	$class = $class_li;
42 42
 	$class .= $actif ? ' actif' : '';
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 	$prefix = $info['prefix'];
54 54
 	$dir = "$dir_plugins$plug_file/lang/$prefix";
55 55
 	$desc = plugin_propre($info['description'], $dir);
56
-	$url_stat = parametre_url($url_page, 'plugin', $dir_plugins . $plug_file);
56
+	$url_stat = parametre_url($url_page, 'plugin', $dir_plugins.$plug_file);
57 57
 
58
-	$s .= "<strong class='nom'>" . typo($info['nom']) . '</strong>';
59
-	$s .= " <span class='version'>" . $info['version'] . '</span>';
60
-	$s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . '</span>';
58
+	$s .= "<strong class='nom'>".typo($info['nom']).'</strong>';
59
+	$s .= " <span class='version'>".$info['version'].'</span>';
60
+	$s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat']).'</span>';
61 61
 	$s .= '</div>';
62 62
 
63 63
 	if ($erreur) {
64
-		$s .= "<div class='erreur'>" . implode('<br >', $info['erreur']) . '</div>';
64
+		$s .= "<div class='erreur'>".implode('<br >', $info['erreur']).'</div>';
65 65
 	}
66 66
 
67
-	return $s . '</li>';
67
+	return $s.'</li>';
68 68
 }
Please login to merge, or discard this patch.
config/ecran_securite.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
  * Test utilisateur
16 16
  */
17 17
 if (isset($_GET['test_ecran_securite'])) {
18
-	$ecran_securite_raison = 'test ' . _ECRAN_SECURITE;
18
+	$ecran_securite_raison = 'test '._ECRAN_SECURITE;
19 19
 }
20 20
 
21
-if (file_exists($f = __DIR__ . DIRECTORY_SEPARATOR  . 'ecran_securite_options.php')) {
21
+if (file_exists($f = __DIR__.DIRECTORY_SEPARATOR.'ecran_securite_options.php')) {
22 22
 	include ($f);
23 23
 }
24 24
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 						'yats',
227 227
 						'yeti',
228 228
 						'zeerch'
229
-					)) . ',i',
230
-				(string)$_SERVER['HTTP_USER_AGENT']
229
+					)).',i',
230
+				(string) $_SERVER['HTTP_USER_AGENT']
231 231
 			)
232 232
 	);
233 233
 }
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
 		'_IS_BOT_FRIEND',
237 237
 		isset($_SERVER['HTTP_USER_AGENT'])
238 238
 			and preg_match(
239
-				',' . implode('|', array(
239
+				','.implode('|', array(
240 240
 					'facebookexternalhit',
241 241
 					'twitterbot',
242 242
 					'flipboardproxy',
243 243
 					'wordpress'
244
-				)) . ',i',
245
-				(string)$_SERVER['HTTP_USER_AGENT']
244
+				)).',i',
245
+				(string) $_SERVER['HTTP_USER_AGENT']
246 246
 			)
247 247
 	);
248 248
 }
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
  */
292 292
 foreach (array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax_ancre', 'nom_fichier') as $var) {
293 293
 	if (isset($_GET[$var])) {
294
-		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_GET[$var]);
294
+		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_GET[$var]);
295 295
 	}
296 296
 	if (isset($_POST[$var])) {
297
-		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_POST[$var]);
297
+		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_POST[$var]);
298 298
 	}
299 299
 }
300 300
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
  * Filtre l'accès à spip_acces_doc (injection SQL en 1.8.2x)
303 303
  */
304 304
 if (isset($_SERVER['REQUEST_URI'])) {
305
-	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string)$_SERVER['REQUEST_URI'])) {
306
-		$file = addslashes((string)$_GET['file']);
305
+	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string) $_SERVER['REQUEST_URI'])) {
306
+		$file = addslashes((string) $_GET['file']);
307 307
 	}
308 308
 }
309 309
 
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
  */
324 324
 if (
325 325
 	isset($_REQUEST['partie_cal'])
326
-	and $_REQUEST['partie_cal'] !== htmlentities((string)$_REQUEST['partie_cal'])
326
+	and $_REQUEST['partie_cal'] !== htmlentities((string) $_REQUEST['partie_cal'])
327 327
 ) {
328 328
 	$ecran_securite_raison = "partie_cal";
329 329
 }
330 330
 if (
331 331
 	isset($_REQUEST['echelle'])
332
-	and $_REQUEST['echelle'] !== htmlentities((string)$_REQUEST['echelle'])
332
+	and $_REQUEST['echelle'] !== htmlentities((string) $_REQUEST['echelle'])
333 333
 ) {
334 334
 	$ecran_securite_raison = "echelle";
335 335
 }
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
  */
340 340
 if (
341 341
 	isset($_REQUEST['exec'])
342
-	and !preg_match(',^[\w-]+$,', (string)$_REQUEST['exec'])
342
+	and !preg_match(',^[\w-]+$,', (string) $_REQUEST['exec'])
343 343
 ) {
344 344
 	$ecran_securite_raison = "exec";
345 345
 }
346 346
 if (
347 347
 	isset($_REQUEST['cherche_auteur'])
348
-	and preg_match(',[<],', (string)$_REQUEST['cherche_auteur'])
348
+	and preg_match(',[<],', (string) $_REQUEST['cherche_auteur'])
349 349
 ) {
350 350
 	$ecran_securite_raison = "cherche_auteur";
351 351
 }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	isset($_REQUEST['exec'])
354 354
 	and $_REQUEST['exec'] == 'auteurs'
355 355
 	and isset($_REQUEST['recherche'])
356
-	and preg_match(',[<],', (string)$_REQUEST['recherche'])
356
+	and preg_match(',[<],', (string) $_REQUEST['recherche'])
357 357
 ) {
358 358
 	$ecran_securite_raison = "recherche";
359 359
 }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	isset($_REQUEST['exec'])
362 362
 	and $_REQUEST['exec'] == 'info_plugin'
363 363
 	and isset($_REQUEST['plugin'])
364
-	and preg_match(',[<],', (string)$_REQUEST['plugin'])
364
+	and preg_match(',[<],', (string) $_REQUEST['plugin'])
365 365
 ) {
366 366
 	$ecran_securite_raison = "plugin";
367 367
 }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 				echo minipres(_T('info_acces_interdit'));
389 389
 				exit;
390 390
 			}
391
-			require _DIR_RESTREINT . 'action/configurer.php';
391
+			require _DIR_RESTREINT.'action/configurer.php';
392 392
 			action_configurer_dist();
393 393
 		}
394 394
 	}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 if (_IS_BOT) {
441 441
 	if (
442 442
 		(isset($_REQUEST['echelle']) and isset($_REQUEST['partie_cal']) and isset($_REQUEST['type']))
443
-		or (strpos((string)$_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string)$_SERVER['REQUEST_URI']))
444
-		or (isset($_REQUEST['calendrier_annee']) and strpos((string)$_SERVER['REQUEST_URI'], 'debut_'))
445
-		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string)$_SERVER['REQUEST_URI']))
443
+		or (strpos((string) $_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string) $_SERVER['REQUEST_URI']))
444
+		or (isset($_REQUEST['calendrier_annee']) and strpos((string) $_SERVER['REQUEST_URI'], 'debut_'))
445
+		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string) $_SERVER['REQUEST_URI']))
446 446
 	) {
447 447
 		$ecran_securite_raison = "robot agenda/double pagination";
448 448
 	}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	if ($_REQUEST['page'] == 'test_cfg') {
457 457
 		$ecran_securite_raison = "test_cfg";
458 458
 	}
459
-	if ($_REQUEST['page'] !== htmlspecialchars((string)$_REQUEST['page'])) {
459
+	if ($_REQUEST['page'] !== htmlspecialchars((string) $_REQUEST['page'])) {
460 460
 		$ecran_securite_raison = "xsspage";
461 461
 	}
462 462
 	if (
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
  */
473 473
 foreach (array('var_login') as $var) {
474 474
 	if (isset($_REQUEST[$var]) and is_array($_REQUEST[$var])) {
475
-		$ecran_securite_raison = "xss " . $var;
475
+		$ecran_securite_raison = "xss ".$var;
476 476
 	}
477 477
 }
478 478
 
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
  */
521 521
 if (
522 522
 	isset($_REQUEST['nom_sauvegarde'])
523
-	and strstr((string)$_REQUEST['nom_sauvegarde'], '/')
523
+	and strstr((string) $_REQUEST['nom_sauvegarde'], '/')
524 524
 ) {
525 525
 	$ecran_securite_raison = 'nom_sauvegarde manipulee';
526 526
 }
527 527
 if (
528 528
 	isset($_REQUEST['znom_sauvegarde'])
529
-	and strstr((string)$_REQUEST['znom_sauvegarde'], '/')
529
+	and strstr((string) $_REQUEST['znom_sauvegarde'], '/')
530 530
 ) {
531 531
 	$ecran_securite_raison = 'znom_sauvegarde manipulee';
532 532
 }
@@ -669,23 +669,23 @@  discard block
 block discarded – undo
669 669
  */
670 670
 function __ecran_test_if_serialized($data) {
671 671
 	$data = trim($data);
672
-	if ('N;' === $data) {return true;}
673
-	if (strlen($data) < 4) {return false;}
674
-	if (':' !== $data[1]) {return false;}
672
+	if ('N;' === $data) {return true; }
673
+	if (strlen($data) < 4) {return false; }
674
+	if (':' !== $data[1]) {return false; }
675 675
 	$semicolon = strpos($data, ';');
676 676
 	$brace = strpos($data, '}');
677 677
 	// Either ; or } must exist.
678
-	if (false === $semicolon && false === $brace) {return false;}
678
+	if (false === $semicolon && false === $brace) {return false; }
679 679
 	// But neither must be in the first X characters.
680
-	if (false !== $semicolon && $semicolon < 3) {return false;}
681
-	if (false !== $brace && $brace < 4) {return false;}
680
+	if (false !== $semicolon && $semicolon < 3) {return false; }
681
+	if (false !== $brace && $brace < 4) {return false; }
682 682
 	$token = $data[0];
683 683
 	if (in_array($token, array('s', 'S'))) {
684
-		if (false === strpos($data, '"')) {return false;}
684
+		if (false === strpos($data, '"')) {return false; }
685 685
 	} elseif (in_array($token, array('a', 'O', 'C', 'o', 'E'))) {
686
-		return (bool)preg_match("/^{$token}:[0-9]+:/s", $data);
686
+		return (bool) preg_match("/^{$token}:[0-9]+:/s", $data);
687 687
 	} elseif (in_array($token, array('b', 'i', 'd'))) {
688
-		return (bool)preg_match("/^{$token}:[0-9.E+-]+;/", $data);
688
+		return (bool) preg_match("/^{$token}:[0-9.E+-]+;/", $data);
689 689
 	}
690 690
 	return false;
691 691
 }
Please login to merge, or discard this patch.
ecrire/inc_version.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
52 52
 
53 53
 /** chemin absolu vers la racine */
54
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
54
+define('_ROOT_RACINE', dirname(__DIR__).'/');
55 55
 /** chemin absolu vers le repertoire de travail */
56
-define('_ROOT_CWD', getcwd() . '/');
56
+define('_ROOT_CWD', getcwd().'/');
57 57
 /** chemin absolu vers ecrire */
58
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
58
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
59 59
 
60 60
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
61 61
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 // inclure l'ecran de securite si il n'a pas été inclus en prepend php
81 81
 if (
82 82
 	!defined('_ECRAN_SECURITE')
83
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
83
+	and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
84 84
 ) {
85 85
 	include $f;
86 86
 }
87 87
 
88 88
 // et on peut lancer l'autoloader
89
-require_once __DIR__ . '/../vendor/autoload.php';
89
+require_once __DIR__.'/../vendor/autoload.php';
90 90
 
91 91
 // Icones
92 92
 if (!defined('_NOM_IMG_PACK')) {
@@ -94,17 +94,17 @@  discard block
 block discarded – undo
94 94
 	define('_NOM_IMG_PACK', 'images/');
95 95
 }
96 96
 /** le chemin http (relatif) vers les images standard */
97
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
97
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
98 98
 
99 99
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
100
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
100
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
101 101
 
102 102
 if (!defined('_JAVASCRIPT')) {
103 103
 	/** Nom du repertoire des  bibliotheques JavaScript */
104 104
 	define('_JAVASCRIPT', 'javascript/');
105 105
 } // utilisable avec #CHEMIN et find_in_path
106 106
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
107
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
107
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
108 108
 
109 109
 
110 110
 /** Le nom du fichier de personnalisation */
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 
115 115
 // Son emplacement absolu si on le trouve
116 116
 if (
117
-	@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
118
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
117
+	@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
118
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
119 119
 ) {
120 120
 	/** Emplacement absolu du fichier d'option */
121 121
 	define('_FILE_OPTIONS', $f);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			// UA plus cibles
152 152
 			. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
153 153
 			. ',i',
154
-			(string)$_SERVER['HTTP_USER_AGENT']
154
+			(string) $_SERVER['HTTP_USER_AGENT']
155 155
 		)
156 156
 	);
157 157
 }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 # la matrice standard (fichiers definissant les fonctions a inclure)
394 394
 $spip_matrice = [];
395 395
 # les plugins a activer
396
-$plugins = [];  // voir le contenu du repertoire /plugins/
396
+$plugins = []; // voir le contenu du repertoire /plugins/
397 397
 # les surcharges de include_spip()
398 398
 $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
399 399
 
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
 //
472 472
 // Charger les fonctions liees aux serveurs Http et Sql.
473 473
 //
474
-require_once _ROOT_RESTREINT . 'inc/utils.php';
475
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
474
+require_once _ROOT_RESTREINT.'inc/utils.php';
475
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
476 476
 
477 477
 // Definition personnelles eventuelles
478 478
 
@@ -495,10 +495,10 @@  discard block
 block discarded – undo
495 495
 // ===> on execute en neutralisant les messages d'erreur
496 496
 
497 497
 spip_initialisation_core(
498
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
499
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
500
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
501
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
498
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
499
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
500
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
501
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
502 502
 );
503 503
 
504 504
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		include_spip('inc/lang');
555 555
 		utiliser_langue_visiteur();
556 556
 		include_spip('inc/minipres');
557
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]);
557
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]);
558 558
 		exit;
559 559
 	}
560 560
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 	}
594 594
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
595 595
 		include_spip('inc/filtres_mini');
596
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt'));
596
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt'));
597 597
 	} else {
598 598
 		// header minimal
599
-		header(_HEADER_COMPOSED_BY . ' @ www.spip.net');
599
+		header(_HEADER_COMPOSED_BY.' @ www.spip.net');
600 600
 	}
601 601
 }
602 602
 
603 603
 $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : ''));
604
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
604
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.
ecrire/balise/formulaire_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		if ($max_prof > 0) {
39 39
 			return array_map(
40 40
 				function($v) use ($max_prof) {
41
-					return protege_champ($v, $max_prof-1);
41
+					return protege_champ($v, $max_prof - 1);
42 42
 				},
43 43
 				$valeur
44 44
 			);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			foreach ($erreurs as $k => $v) {
319 319
 				if (is_string($v) and strlen(trim($v)) and strpos($k, '_') !== 0) {
320 320
 					// on encapsule dans un span car ces messages sont en general simple, juste du texte, et deja dans un span dans le form
321
-					$valeurs['erreurs'][$k] = "<span role='alert'>" . $erreurs[$k] . '</span>';
321
+					$valeurs['erreurs'][$k] = "<span role='alert'>".$erreurs[$k].'</span>';
322 322
 				}
323 323
 			}
324 324
 		}
Please login to merge, or discard this patch.
prive/formulaires/configurer_reducteur.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,5 +125,5 @@
 block discarded – undo
125 125
 		return '';
126 126
 	}
127 127
 
128
-	return generer_url_action('tester', "arg=$process&time=" . time());
128
+	return generer_url_action('tester', "arg=$process&time=".time());
129 129
 }
Please login to merge, or discard this patch.
ecrire/action/tester.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 			_PNMSCALE_COMMAND
76 76
 		);
77 77
 
78
-		$vignette = _ROOT_IMG_PACK . 'test.jpg';
79
-		$dest = _DIR_VAR . 'test-jpg.jpg';
80
-		$commande = "$jpegtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest";
78
+		$vignette = _ROOT_IMG_PACK.'test.jpg';
79
+		$dest = _DIR_VAR.'test-jpg.jpg';
80
+		$commande = "$jpegtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest";
81 81
 		spip_log($commande);
82 82
 		exec($commande);
83 83
 		if (($taille = @getimagesize($dest)) && $taille[1] == 10) {
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 		}
86 86
 		$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
87 87
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
88
-		$vignette = _ROOT_IMG_PACK . 'test.gif';
89
-		$dest = _DIR_VAR . 'test-gif.jpg';
90
-		$commande = "$giftopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest";
88
+		$vignette = _ROOT_IMG_PACK.'test.gif';
89
+		$dest = _DIR_VAR.'test-gif.jpg';
90
+		$commande = "$giftopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest";
91 91
 		spip_log($commande);
92 92
 		exec($commande);
93 93
 		if (($taille = @getimagesize($dest)) && $taille[1] == 10) {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 		}
96 96
 
97 97
 		$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
98
-		$vignette = _ROOT_IMG_PACK . 'test.png';
99
-		$dest = _DIR_VAR . 'test-gif.jpg';
100
-		$commande = "$pngtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest";
98
+		$vignette = _ROOT_IMG_PACK.'test.png';
99
+		$dest = _DIR_VAR.'test-gif.jpg';
100
+		$commande = "$pngtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest";
101 101
 		spip_log($commande);
102 102
 		exec($commande);
103 103
 		if (($taille = @getimagesize($dest)) && $taille[1] == 10) {
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 		include_spip('inc/filtres');
113 113
 		include_spip('inc/filtres_images_mini');
114 114
 		$taille_preview = 150;
115
-		$image = _image_valeurs_trans(_DIR_IMG_PACK . 'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg');
115
+		$image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg');
116 116
 
117
-		$image['fichier_dest'] = _DIR_VAR . "test_$arg";
117
+		$image['fichier_dest'] = _DIR_VAR."test_$arg";
118 118
 
119 119
 		if (
120 120
 			($preview = _image_creer_vignette($image, $taille_preview, $taille_preview, $arg, true))
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($valeurs['fichier_dest']);
1324
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1324
+	$destfile = basename($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', _PNMSCALE_COMMAND);
1442 1442
 		if ($format == 'jpg') {
1443 1443
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _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', _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', _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.