Completed
Push — master ( a11e7a...eb91e6 )
by cam
01:05
created
ecrire/inc_version.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *  Ce programme est un logiciel libre distribué sous licence GNU/GPL.     *
10 10
 \***************************************************************************/
11 11
 
12
-require_once __DIR__ . '/../vendor/autoload.php';
12
+require_once __DIR__.'/../vendor/autoload.php';
13 13
 
14 14
 /**
15 15
  * Initialisation de SPIP
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
54 54
 
55 55
 /** chemin absolu vers la racine */
56
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
56
+define('_ROOT_RACINE', dirname(__DIR__).'/');
57 57
 /** chemin absolu vers le repertoire de travail */
58
-define('_ROOT_CWD', getcwd() . '/');
58
+define('_ROOT_CWD', getcwd().'/');
59 59
 /** chemin absolu vers ecrire */
60
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
60
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
61 61
 
62 62
 // Icones
63 63
 if (!defined('_NOM_IMG_PACK')) {
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 	define('_NOM_IMG_PACK', 'images/');
66 66
 }
67 67
 /** le chemin http (relatif) vers les images standard */
68
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
68
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
69 69
 
70 70
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
71
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
71
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
72 72
 
73 73
 if (!defined('_JAVASCRIPT')) {
74 74
 	/** Nom du repertoire des  bibliotheques JavaScript */
75 75
 	define('_JAVASCRIPT', 'javascript/');
76 76
 } // utilisable avec #CHEMIN et find_in_path
77 77
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
78
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
78
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
79 79
 
80 80
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
81 81
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 
107 107
 // Son emplacement absolu si on le trouve
108 108
 if (
109
-	@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
110
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
109
+	@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
110
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
111 111
 ) {
112 112
 	/** Emplacement absolu du fichier d'option */
113 113
 	define('_FILE_OPTIONS', $f);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 // inclure l'ecran de securite
132 132
 if (
133 133
 	!defined('_ECRAN_SECURITE')
134
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
134
+	and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
135 135
 ) {
136 136
 	include $f;
137 137
 }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			// UA plus cibles
153 153
 			. '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'
154 154
 			. ',i',
155
-			(string)$_SERVER['HTTP_USER_AGENT']
155
+			(string) $_SERVER['HTTP_USER_AGENT']
156 156
 		)
157 157
 	);
158 158
 }
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 # la matrice standard (fichiers definissant les fonctions a inclure)
395 395
 $spip_matrice = [];
396 396
 # les plugins a activer
397
-$plugins = [];  // voir le contenu du repertoire /plugins/
397
+$plugins = []; // voir le contenu du repertoire /plugins/
398 398
 # les surcharges de include_spip()
399 399
 $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
400 400
 
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 //
473 473
 // Charger les fonctions liees aux serveurs Http et Sql.
474 474
 //
475
-require_once _ROOT_RESTREINT . 'inc/utils.php';
476
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
475
+require_once _ROOT_RESTREINT.'inc/utils.php';
476
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
477 477
 
478 478
 // Definition personnelles eventuelles
479 479
 
@@ -496,10 +496,10 @@  discard block
 block discarded – undo
496 496
 // ===> on execute en neutralisant les messages d'erreur
497 497
 
498 498
 spip_initialisation_core(
499
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
500
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
501
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
502
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
499
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
500
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
501
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
502
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
503 503
 );
504 504
 
505 505
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		// Si on est dans le site public, dire que qq s'en occupe
555 555
 		include_spip('inc/minipres');
556 556
 		utiliser_langue_visiteur();
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/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *  Ce programme est un logiciel libre distribué sous licence GNU/GPL.     *
10 10
 \***************************************************************************/
11 11
 
12
-require_once __DIR__ . '/../vendor/autoload.php';
12
+require_once __DIR__.'/../vendor/autoload.php';
13 13
 
14 14
 /**
15 15
  * Fichier d'exécution de l'interface privée
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 // Determiner l'action demandee
30 30
 //
31 31
 
32
-$exec = (string)_request('exec');
32
+$exec = (string) _request('exec');
33 33
 $reinstall = (!is_null(_request('reinstall'))) ? _request('reinstall') : ($exec == 'install' ? 'oui' : null);
34 34
 //
35 35
 // Les scripts d'insallation n'authentifient pas, forcement,
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 			or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo')
116 116
 		)
117 117
 	) {
118
-		spip_log('Quand la meta admin vaut ' .
119
-			$GLOBALS['meta']['admin'] .
120
-			' seul un admin peut se connecter et sans AJAX.' .
118
+		spip_log('Quand la meta admin vaut '.
119
+			$GLOBALS['meta']['admin'].
120
+			' seul un admin peut se connecter et sans AJAX.'.
121 121
 			' En cas de probleme, detruire cette meta.');
122 122
 		die(_T('info_travaux_texte'));
123 123
 	}
Please login to merge, or discard this patch.
ecrire/src/Compilateur/Iterateur/Data.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		// Si a ce stade on n'a pas de table, il y a un bug
164 164
 		if (!is_array($this->tableau)) {
165 165
 			$this->err = true;
166
-			spip_log('erreur datasource ' . var_export($command, true));
166
+			spip_log('erreur datasource '.var_export($command, true));
167 167
 		}
168 168
 
169 169
 		// {datapath query.results}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			isset($this->command['sourcemode'])
206 206
 			and !in_array($this->command['sourcemode'], ['table', 'array', 'tableau'])
207 207
 		) {
208
-			charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true);
208
+			charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true);
209 209
 		}
210 210
 
211 211
 		# le premier argument peut etre un array, une URL etc.
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		# avons-nous un cache dispo ?
215 215
 		$cle = null;
216 216
 		if (is_string($src)) {
217
-			$cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true));
217
+			$cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true));
218 218
 		}
219 219
 
220 220
 		$cache = $this->cache_get($cle);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 					}
273 273
 					if (
274 274
 						!$this->err
275
-						and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true)
275
+						and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true)
276 276
 					) {
277 277
 						$args = $this->command['source'];
278 278
 						$args[0] = $data;
@@ -412,13 +412,13 @@  discard block
 block discarded – undo
412 412
 							$tv = '%s';
413 413
 						} # {par valeur/xx/yy} ??
414 414
 						else {
415
-							$tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')';
415
+							$tv = 'table_valeur(%s, '.var_export($r[1], true).')';
416 416
 						}
417 417
 						$sortfunc .= '
418
-					$a = ' . sprintf($tv, '$aa') . ';
419
-					$b = ' . sprintf($tv, '$bb') . ';
418
+					$a = ' . sprintf($tv, '$aa').';
419
+					$b = ' . sprintf($tv, '$bb').';
420 420
 					if ($a <> $b)
421
-						return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;';
421
+						return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;';
422 422
 					}
423 423
 				}
424 424
 			}
Please login to merge, or discard this patch.
ecrire/src/Afficher/Minipres.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 			$titre = ($titre == 'install')
109 109
 				? _T('avis_espace_interdit')
110
-				: $titre . '&nbsp;: ' . _T('info_acces_interdit');
110
+				: $titre.'&nbsp;: '._T('info_acces_interdit');
111 111
 
112 112
 			$statut = $GLOBALS['visiteur_session']['statut'] ?? '';
113 113
 			$nom = $GLOBALS['visiteur_session']['nom'] ?? '';
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			}
128 128
 
129 129
 			$corps = "";
130
-			spip_log($nom . " $titre " . $_SERVER['REQUEST_URI'], 'minipres');
130
+			spip_log($nom." $titre ".$_SERVER['REQUEST_URI'], 'minipres');
131 131
 		}
132 132
 
133 133
 		$options['footer'] = $footer;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			foreach ($_POST as $v => $c) {
148 148
 				$url = parametre_url($url, $v, $c, '&');
149 149
 			}
150
-			ajax_retour('<div>' . $titre . redirige_formulaire($url) . '</div>', false);
150
+			ajax_retour('<div>'.$titre.redirige_formulaire($url).'</div>', false);
151 151
 			return '';
152 152
 		}
153 153
 	}
Please login to merge, or discard this patch.
ecrire/src/Afficher/Minipublic.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
 
65 65
 		$page_title = (isset($options['page_title']) ? $options['page_title'] : $GLOBALS['meta']['nom_site']);
66 66
 		$doctype = (isset($options['doctype']) ? $options['doctype'] : "<!DOCTYPE html>");
67
-		$doctype = trim($doctype) . "\n";
67
+		$doctype = trim($doctype)."\n";
68 68
 		$charset = (isset($options['charset']) ? $options['charset'] : "utf-8");
69 69
 		$all_inline = (isset($options['all_inline']) ? $options['all_inline'] : true);
70 70
 		$onLoad = (isset($options['onLoad']) ? $options['onLoad'] : '');
71 71
 		if ($onLoad) {
72
-			$onLoad = ' onload="' . attribut_html($onLoad) . '"';
72
+			$onLoad = ' onload="'.attribut_html($onLoad).'"';
73 73
 		}
74 74
 
75 75
 		# envoyer le charset
76 76
 		if (!headers_sent()) {
77
-			header('Content-Type: text/html; charset=' . $charset);
77
+			header('Content-Type: text/html; charset='.$charset);
78 78
 		}
79 79
 
80 80
 		$css = '';
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			. "--minipublic-color-theme--s: $s;"
96 96
 			. "--minipublic-color-theme--l: $l;}";
97 97
 		$vars = file_get_contents(find_in_theme('minipublic.vars.css'));
98
-		$inline .= "\n" . trim($vars);
98
+		$inline .= "\n".trim($vars);
99 99
 		if (function_exists('minifier')) {
100 100
 			$inline = minifier($inline, 'css');
101 101
 		}
@@ -122,31 +122,31 @@  discard block
 block discarded – undo
122 122
 			}
123 123
 			$css = "$inline\n$css";
124 124
 			if (!empty($options['css'])) {
125
-				$css .= "\n" . $options['css'];
125
+				$css .= "\n".$options['css'];
126 126
 			}
127 127
 			$css = "<style type='text/css'>$css</style>";
128 128
 		} else {
129 129
 			$css = "<style type='text/css'>$inline</style>";
130 130
 			foreach ($files as $name) {
131 131
 				$file = timestamp(direction_css($name));
132
-				$css .= "<link rel='stylesheet' href='" . attribut_html($file) . "' type='text/css' />\n";
132
+				$css .= "<link rel='stylesheet' href='".attribut_html($file)."' type='text/css' />\n";
133 133
 			}
134 134
 			if (!empty($options['css'])) {
135
-				$css .= "<style type='text/css'>" . $options['css'] . "</style>";
135
+				$css .= "<style type='text/css'>".$options['css']."</style>";
136 136
 			}
137 137
 		}
138 138
 
139
-		return $doctype .
140
-			html_lang_attributes() .
141
-			"<head>\n" .
142
-			'<title>' .
143
-			textebrut($page_title) .
144
-			"</title>\n" .
145
-			"<meta name=\"viewport\" content=\"width=device-width\" />\n" .
146
-			$css .
147
-			(empty($options['head']) ? "" : $options['head']) .
148
-			"</head>\n" .
149
-			"<body{$onLoad} class=\"minipublic\">\n" .
139
+		return $doctype.
140
+			html_lang_attributes().
141
+			"<head>\n".
142
+			'<title>'.
143
+			textebrut($page_title).
144
+			"</title>\n".
145
+			"<meta name=\"viewport\" content=\"width=device-width\" />\n".
146
+			$css.
147
+			(empty($options['head']) ? "" : $options['head']).
148
+			"</head>\n".
149
+			"<body{$onLoad} class=\"minipublic\">\n".
150 150
 			"\t<div class=\"minipublic-bloc\">\n";
151 151
 	}
152 152
 
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	protected function ouvreCorps($options = []) {
159 159
 		$url_site = url_de_base();
160
-		$header = "<header>\n" .
161
-			"<h1><a href=\"" . attribut_html($url_site) . "\">" . interdire_scripts($GLOBALS['meta']['nom_site']) . "</a></h1>\n";
160
+		$header = "<header>\n".
161
+			"<h1><a href=\"".attribut_html($url_site)."\">".interdire_scripts($GLOBALS['meta']['nom_site'])."</a></h1>\n";
162 162
 
163 163
 		$titre = (isset($options['titre']) ? $options['titre'] : '');
164 164
 		if ($titre) {
165
-			$header .= "<h2>" . interdire_scripts($titre) . "</h2>";
165
+			$header .= "<h2>".interdire_scripts($titre)."</h2>";
166 166
 		}
167 167
 		$header .= "</header>";
168 168
 
169
-		return $header . "<div class='corps'>\n";
169
+		return $header."<div class='corps'>\n";
170 170
 	}
171 171
 
172 172
 	/**
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		if (isset($options['footer'])) {
181 181
 			$footer = $options['footer'];
182 182
 		} else {
183
-			$footer = "<a href=\"" . attribut_html($url_site) . "\">" . _T('retour') . "</a>\n";
183
+			$footer = "<a href=\"".attribut_html($url_site)."\">"._T('retour')."</a>\n";
184 184
 		}
185 185
 		if (!empty($footer)) {
186 186
 			$footer = "<footer>\n{$footer}</footer>";
187 187
 		}
188 188
 
189
-		return "</div>\n" . $footer;
189
+		return "</div>\n".$footer;
190 190
 	}
191 191
 
192 192
 
Please login to merge, or discard this patch.
ecrire/base/connect_sql.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18 18
 	return;
19 19
 }
20
-require_once _ROOT_RESTREINT . 'base/objets.php';
20
+require_once _ROOT_RESTREINT.'base/objets.php';
21 21
 
22 22
 
23 23
 /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			// serveur externe et nom de serveur bien ecrit ?
61 61
 			if (defined('_DIR_CONNECT')
62 62
 				and preg_match('/^[\w\.]*$/', $serveur)) {
63
-				$f = _DIR_CONNECT . $serveur . '.php';
63
+				$f = _DIR_CONNECT.$serveur.'.php';
64 64
 				if (!is_readable($f) and !$install) {
65 65
 					// chercher une declaration de serveur dans le path
66 66
 					// qui peut servir à des plugins à declarer des connexions à une base sqlite
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	// chargement de la version du jeu de fonctions
111 111
 	// si pas dans le fichier par defaut
112 112
 	$type = $GLOBALS['db_ok']['type'];
113
-	$jeu = 'spip_' . $type . '_functions_' . $version;
113
+	$jeu = 'spip_'.$type.'_functions_'.$version;
114 114
 	if (!isset($GLOBALS[$jeu])) {
115
-		if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) {
115
+		if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) {
116 116
 			spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS);
117 117
 
118 118
 			// ne plus reessayer
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 	$connexion = spip_connect($serveur);
175 175
 	$e = sql_errno($serveur);
176 176
 	$t = ($connexion['type'] ?? 'sql');
177
-	$m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']);
178
-	$f = $t . $serveur;
179
-	spip_log($m, $f . '.' . _LOG_ERREUR);
177
+	$m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']);
178
+	$f = $t.$serveur;
179
+	spip_log($m, $f.'.'._LOG_ERREUR);
180 180
 }
181 181
 
182 182
 /**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	// si en cours d'installation ou si db=@test@ on ne pose rien
263 263
 	// car c'est un test de connexion
264 264
 	if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') {
265
-		$f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out';
265
+		$f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out';
266 266
 	} elseif ($db == '@test@') {
267 267
 		$db = '';
268 268
 	}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	// En cas d'indisponibilite du serveur, eviter de le bombarder
302 302
 	if ($f) {
303 303
 		@touch($f);
304
-		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS);
304
+		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS);
305 305
 	}
306 306
 	return null;
307 307
 }
@@ -398,11 +398,11 @@  discard block
 block discarded – undo
398 398
 	} elseif (is_array($a)) {
399 399
 		return join(',', array_map('_q', $a));
400 400
 	} elseif (is_scalar($a)) {
401
-		return ("'" . addslashes($a) . "'");
401
+		return ("'".addslashes($a)."'");
402 402
 	} elseif ($a === null) {
403 403
 		return "''";
404 404
 	}
405
-	throw new \RuntimeException('Can’t use _q with ' . gettype($a));
405
+	throw new \RuntimeException('Can’t use _q with '.gettype($a));
406 406
 }
407 407
 
408 408
 /**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 				$next = reset($textes);
454 454
 				if (
455 455
 					strpos($next, "'") === 0
456
-					and strpos($query_echappees, $part . $next, $currentpos) === $nextpos
456
+					and strpos($query_echappees, $part.$next, $currentpos) === $nextpos
457 457
 				) {
458 458
 					$part .= array_shift($textes);
459 459
 				}
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 			$parts[$k] = [
466 466
 				'texte' => $part,
467 467
 				'position' => $nextpos,
468
-				'placeholder' => '%' . $k . '$s',
468
+				'placeholder' => '%'.$k.'$s',
469 469
 			];
470 470
 			$currentpos = $nextpos + strlen($part);
471 471
 		}
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
 
@@ -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
 		}
@@ -444,9 +444,9 @@  discard block
 block discarded – undo
444 444
 			// on garde la terminaison initiale car image simplement copiee
445 445
 			// et on postfixe son nom avec un md5 du path
446 446
 			$terminaison_dest = $terminaison;
447
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
447
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
448 448
 		} else {
449
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
449
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
450 450
 		}
451 451
 		$cache = sous_repertoire(_DIR_VAR, $cache);
452 452
 		$cache = sous_repertoire($cache, $effet);
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		$fichier_dest = substr($fichier_dest, 2);
458 458
 	}
459 459
 
460
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
460
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
461 461
 
462 462
 	$GLOBALS['images_calculees'][] = $fichier_dest;
463 463
 
@@ -495,15 +495,15 @@  discard block
 block discarded – undo
495 495
 
496 496
 	if ($creer) {
497 497
 		spip_log(
498
-			'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
499
-			'images' . _LOG_DEBUG
498
+			'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
499
+			'images'._LOG_DEBUG
500 500
 		);
501 501
 	}
502 502
 
503 503
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
504
-	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction;
504
+	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction;
505 505
 	$ret['fichier'] = $fichier;
506
-	$ret['fonction_image'] = '_image_image' . $terminaison_dest;
506
+	$ret['fonction_image'] = '_image_image'.$terminaison_dest;
507 507
 	$ret['fichier_dest'] = $fichier_dest;
508 508
 	$ret['format_source'] = _image_extension_normalisee($terminaison);
509 509
 	$ret['format_dest'] = $terminaison_dest;
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 
654 654
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
655 655
 	if ($_terminaison and $_terminaison !== $terminaison) {
656
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
656
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
657 657
 		$terminaison = $_terminaison;
658 658
 	}
659 659
 	return $terminaison;
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 	if (!function_exists('imagepng')) {
811 811
 		return false;
812 812
 	}
813
-	$tmp = $fichier . '.tmp';
813
+	$tmp = $fichier.'.tmp';
814 814
 	$ret = imagepng($img, $tmp);
815 815
 	if (file_exists($tmp)) {
816 816
 		$taille_test = @getimagesize($tmp);
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 	if (!function_exists('imagegif')) {
846 846
 		return false;
847 847
 	}
848
-	$tmp = $fichier . '.tmp';
848
+	$tmp = $fichier.'.tmp';
849 849
 	$ret = imagegif($img, $tmp);
850 850
 	if (file_exists($tmp)) {
851 851
 		$taille_test = @getimagesize($tmp);
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 	if (!function_exists('imagejpeg')) {
886 886
 		return false;
887 887
 	}
888
-	$tmp = $fichier . '.tmp';
888
+	$tmp = $fichier.'.tmp';
889 889
 
890 890
 	// Enable interlancing
891 891
 	imageinterlace($img, true);
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 	if (!function_exists('imagewebp')) {
947 947
 		return false;
948 948
 	}
949
-	$tmp = $fichier . '.tmp';
949
+	$tmp = $fichier.'.tmp';
950 950
 	$ret = imagewebp($img, $tmp, $qualite);
951 951
 	if (file_exists($tmp)) {
952 952
 		$taille_test = @getimagesize($tmp);
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
  */
981 981
 function _image_imagesvg($img, $fichier) {
982 982
 
983
-	$tmp = $fichier . '.tmp';
983
+	$tmp = $fichier.'.tmp';
984 984
 	if (strpos($img, '<') === false) {
985 985
 		$img = supprimer_timestamp($img);
986 986
 		if (!file_exists($img)) {
@@ -1037,13 +1037,13 @@  discard block
 block discarded – undo
1037 1037
  */
1038 1038
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1039 1039
 	if (is_null($fonction)) {
1040
-		$fonction = '_image_image' . $valeurs['format_dest'];
1040
+		$fonction = '_image_image'.$valeurs['format_dest'];
1041 1041
 	}
1042 1042
 	$ret = false;
1043 1043
 	#un flag pour reperer les images gravees
1044 1044
 	$lock = (
1045 1045
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1046
-		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'))
1046
+		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'))
1047 1047
 	);
1048 1048
 	if (
1049 1049
 		function_exists($fonction)
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 			// dans tous les cas mettre a jour la taille de l'image finale
1056 1056
 			[$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']);
1057 1057
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1058
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1058
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1059 1059
 		}
1060 1060
 	}
1061 1061
 
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 
1231 1231
 	// attributs deprecies. Transformer en CSS
1232 1232
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1233
-		$style = "margin:{$espace}px;" . $style;
1233
+		$style = "margin:{$espace}px;".$style;
1234 1234
 		$tag = inserer_attribut($tag, 'hspace', '');
1235 1235
 	}
1236 1236
 
@@ -1357,7 +1357,7 @@  discard block
 block discarded – undo
1357 1357
 	$image = $valeurs['fichier'];
1358 1358
 	$format = $valeurs['format_source'];
1359 1359
 	$destdir = dirname($valeurs['fichier_dest']);
1360
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1360
+	$destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1361 1361
 
1362 1362
 	$format_sortie = $valeurs['format_dest'];
1363 1363
 
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 
1390 1390
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1391 1391
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1392
-		$vignette = $destination . '.' . $format;
1392
+		$vignette = $destination.'.'.$format;
1393 1393
 		@copy($image, $vignette);
1394 1394
 	}
1395 1395
 
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
 		include_spip('inc/svg');
1398 1398
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1399 1399
 			$format_sortie = 'svg';
1400
-			$vignette = $destination . '.' . $format_sortie;
1400
+			$vignette = $destination.'.'.$format_sortie;
1401 1401
 			$valeurs['fichier_dest'] = $vignette;
1402 1402
 			_image_gd_output($svg, $valeurs);
1403 1403
 		}
@@ -1409,9 +1409,9 @@  discard block
 block discarded – undo
1409 1409
 			define('_CONVERT_COMMAND', 'convert');
1410 1410
 		} // Securite : mes_options.php peut preciser le chemin absolu
1411 1411
 		if (!defined('_RESIZE_COMMAND')) {
1412
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -orient Undefined -resize %xx%y! %src %dest');
1412
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -orient Undefined -resize %xx%y! %src %dest');
1413 1413
 		}
1414
-		$vignette = $destination . '.' . $format_sortie;
1414
+		$vignette = $destination.'.'.$format_sortie;
1415 1415
 		$commande = str_replace(
1416 1416
 			['%x', '%y', '%src', '%dest'],
1417 1417
 			[
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 		if (!@file_exists($vignette)) {
1428 1428
 			spip_log("echec convert sur $vignette");
1429 1429
 
1430
-			return;  // echec commande
1430
+			return; // echec commande
1431 1431
 		}
1432 1432
 	}
1433 1433
 
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		if (!$output) {
1445 1445
 			return;
1446 1446
 		}
1447
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1447
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1448 1448
 
1449 1449
 		$imagick = new Imagick();
1450 1450
 		$imagick->readImage(realpath($image));
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 			$destHeight,
1454 1454
 			Imagick::FILTER_LANCZOS,
1455 1455
 			1
1456
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1456
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1457 1457
 		$imagick->writeImage($vignette);
1458 1458
 
1459 1459
 		if (!@file_exists($vignette)) {
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 			return;
1463 1463
 		}
1464 1464
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1465
-		$vignette = $destination . '.' . $format_sortie;
1465
+		$vignette = $destination.'.'.$format_sortie;
1466 1466
 	}
1467 1467
 
1468 1468
 	// netpbm
@@ -1473,11 +1473,11 @@  discard block
 block discarded – undo
1473 1473
 		if (_PNMSCALE_COMMAND == '') {
1474 1474
 			return;
1475 1475
 		}
1476
-		$vignette = $destination . '.' . $format_sortie;
1476
+		$vignette = $destination.'.'.$format_sortie;
1477 1477
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1478 1478
 		if ($format == 'jpg') {
1479 1479
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1480
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1480
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1481 1481
 			if (!($s = @filesize($vignette))) {
1482 1482
 				spip_unlink($vignette);
1483 1483
 			}
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 		} else {
1490 1490
 			if ($format == 'gif') {
1491 1491
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1492
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1492
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1493 1493
 				if (!($s = @filesize($vignette))) {
1494 1494
 					spip_unlink($vignette);
1495 1495
 				}
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 			} else {
1502 1502
 				if ($format == 'png') {
1503 1503
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1504
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1504
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1505 1505
 					if (!($s = @filesize($vignette))) {
1506 1506
 						spip_unlink($vignette);
1507 1507
 					}
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 			return;
1524 1524
 		}
1525 1525
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1526
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1526
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1527 1527
 
1528 1528
 			return;
1529 1529
 		}
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 		// de l'image, de facon a tromper le cache du navigateur
1834 1834
 		// quand on fait supprimer/reuploader un logo
1835 1835
 		// (pas de filemtime si SAFE MODE)
1836
-		$date = test_espace_prive() ? ('?' . $date) : '';
1836
+		$date = test_espace_prive() ? ('?'.$date) : '';
1837 1837
 
1838 1838
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1839 1839
 	}
@@ -1879,7 +1879,7 @@  discard block
 block discarded – undo
1879 1879
 	public static function LittleEndian2String($number, $minbytes = 1) {
1880 1880
 		$intstring = '';
1881 1881
 		while ($number > 0) {
1882
-			$intstring = $intstring . chr($number & 255);
1882
+			$intstring = $intstring.chr($number & 255);
1883 1883
 			$number >>= 8;
1884 1884
 		}
1885 1885
 
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
 					$b = $argb['blue'];
1912 1912
 
1913 1913
 					if ($bpp[$key] == 32) {
1914
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1914
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1915 1915
 					} elseif ($bpp[$key] == 24) {
1916
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1916
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1917 1917
 					}
1918 1918
 
1919 1919
 					if ($a < 128) {
@@ -1940,48 +1940,48 @@  discard block
 block discarded – undo
1940 1940
 
1941 1941
 			// BITMAPINFOHEADER - 40 bytes
1942 1942
 			$BitmapInfoHeader[$key] = '';
1943
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1944
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1943
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1944
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1945 1945
 			// The biHeight member specifies the combined
1946 1946
 			// height of the XOR and AND masks.
1947 1947
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1948
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1949
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1950
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1951
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1952
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1953
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1954
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1955
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1948
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1949
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1950
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1951
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1952
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1953
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1954
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1955
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1956 1956
 		}
1957 1957
 
1958 1958
 
1959
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1960
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1961
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1959
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1960
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1961
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1962 1962
 
1963 1963
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1964 1964
 		foreach ($gd_image_array as $key => $gd_image) {
1965 1965
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1966 1966
 
1967
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1968
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1969
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1970
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1967
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1968
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1969
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1970
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1971 1971
 
1972
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1973
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1972
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1973
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1974 1974
 
1975 1975
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1976 1976
 			$icondata .= phpthumb_functions::LittleEndian2String(
1977 1977
 				$dwBytesInRes,
1978 1978
 				4
1979
-			);     // dwBytesInRes;	// How many bytes in this resource?
1979
+			); // dwBytesInRes;	// How many bytes in this resource?
1980 1980
 
1981 1981
 			$icondata .= phpthumb_functions::LittleEndian2String(
1982 1982
 				$dwImageOffset,
1983 1983
 				4
1984
-			);    // dwImageOffset;   // Where in the file is this image?
1984
+			); // dwImageOffset;   // Where in the file is this image?
1985 1985
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1986 1986
 			$dwImageOffset += strlen($icXOR[$key]);
1987 1987
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.
ecrire/genie/mise_a_jour.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 function genie_mise_a_jour_dist($t) {
29 29
 	include_spip('inc/meta');
30 30
 	$maj = info_maj($GLOBALS['spip_version_branche']);
31
-	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : '', 'non');
31
+	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche']."|$maj") : '', 'non');
32 32
 
33 33
 	mise_a_jour_ecran_securite();
34 34
 
35
-	spip_log('Verification version SPIP : ' . ($maj ?: 'version a jour'), 'verifie_maj');
35
+	spip_log('Verification version SPIP : '.($maj ?: 'version a jour'), 'verifie_maj');
36 36
 
37 37
 	return 1;
38 38
 }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	// si l'ecran n'est pas deja present ou pas updatable, sortir
58 58
 	if (
59 59
 		!_URL_ECRAN_SECURITE
60
-		or !file_exists($filename = _DIR_ETC . 'ecran_securite.php')
60
+		or !file_exists($filename = _DIR_ETC.'ecran_securite.php')
61 61
 		or !is_writable($filename)
62 62
 		or !$last_modified = filemtime($filename)
63 63
 		or !$md5 = md5_file($filename)
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	include_spip('inc/distant');
69
-	$tmp_file = _DIR_TMP . 'ecran_securite.php';
69
+	$tmp_file = _DIR_TMP.'ecran_securite.php';
70 70
 	$url = parametre_url(_URL_ECRAN_SECURITE, 'md5', $md5);
71 71
 	$url = parametre_url($url, 'vspip', $GLOBALS['spip_version_branche']);
72 72
 	$res = recuperer_url($url, [
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			include_once $tmp_file;
86 86
 			// ok, on le copie a la place de l'ecran existant
87 87
 			// en backupant l'ecran avant, au cas ou
88
-			@copy($filename, $filename . '-bck-' . date('Y-m-d-His', $last_modified));
88
+			@copy($filename, $filename.'-bck-'.date('Y-m-d-His', $last_modified));
89 89
 			@rename($tmp_file, $filename);
90 90
 		} else {
91 91
 			@unlink($tmp_file);
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
 function info_maj($version) {
109 109
 	include_spip('inc/plugin');
110 110
 
111
-	$nom = _DIR_CACHE . _VERSIONS_LISTE;
111
+	$nom = _DIR_CACHE._VERSIONS_LISTE;
112 112
 	$contenu = !file_exists($nom) ? '' : file_get_contents($nom);
113 113
 	$contenu = info_maj_cache($nom, $contenu);
114 114
 	try {
115 115
 		$contenu = json_decode($contenu, true, 512, JSON_THROW_ON_ERROR);
116 116
 	} catch (JsonException $e) {
117
-		spip_log('Failed to parse Json data : ' . $e->getMessage(), 'verifie_maj');
117
+		spip_log('Failed to parse Json data : '.$e->getMessage(), 'verifie_maj');
118 118
 		return '';
119 119
 	}
120 120
 
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	foreach ($contenu['versions'] as $v => $path) {
127 127
 		$v = explode('.', $v);
128 128
 		[$maj2, $min2, $rev2] = $v;
129
-		$branche_maj = $maj2 . '.' . $min2;
130
-		$version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
129
+		$branche_maj = $maj2.'.'.$min2;
130
+		$version_maj = $maj2.'.'.$min2.'.'.$rev2;
131 131
 		// d'abord les mises à jour de la même branche
132 132
 		if (
133 133
 			(spip_version_compare($version, $version_maj, '<'))
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 		return '';
150 150
 	}
151 151
 
152
-	$message = $liste ? _T('nouvelle_version_spip', ['version' => $liste]) . ($liste_majeure ? ' | ' : '') : '';
152
+	$message = $liste ? _T('nouvelle_version_spip', ['version' => $liste]).($liste_majeure ? ' | ' : '') : '';
153 153
 	$message .= $liste_majeure ? _T('nouvelle_version_spip_majeure', ['version' => $liste_majeure]) : '';
154 154
 
155
-	return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$liste'>" . $message . '</a>';
155
+	return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$liste'>".$message.'</a>';
156 156
 }
157 157
 
158 158
 /**
Please login to merge, or discard this patch.