Completed
Push — master ( 3fe97a...7569f9 )
by cam
02:24
created
ecrire/inc/puce_statut.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 			$out .= afficher_script_statut($id, $type, -$zero - $i++ * $unit, statut_image($type, $s), $s, _T($t));
390 390
 		}
391 391
 
392
-		return $out . '</span>';
392
+		return $out.'</span>';
393 393
 	} else {
394 394
 		$nom = 'puce_statut_';
395 395
 		$action = generer_url_ecrire('puce_statut', '', true);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	$h = generer_action_auteur('instituer_objet', "$type-$id-$statut");
407 407
 	$t = supprimer_tags($titre);
408 408
 
409
-	return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>" . http_img_pack($img, $t) . '</a>';
409
+	return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>".http_img_pack($img, $t).'</a>';
410 410
 }
411 411
 
412 412
 // compat
Please login to merge, or discard this patch.
ecrire/inc/traduire.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	static $dirs = [];
43 43
 	$liste = [];
44 44
 	foreach (creer_chemin() as $dir) {
45
-		if (!isset($dirs[$a = $dir . $dirname])) {
45
+		if (!isset($dirs[$a = $dir.$dirname])) {
46 46
 			$dirs[$a] = (is_dir($a) || !$a);
47 47
 		}
48 48
 		if ($dirs[$a] && is_readable($a .= $file)) {
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
  **/
67 67
 function chercher_module_lang($module, $lang = '') {
68 68
 	if ($lang) {
69
-		$lang = '_' . $lang;
69
+		$lang = '_'.$lang;
70 70
 	}
71 71
 
72 72
 	// 1) dans un repertoire nomme lang/ se trouvant sur le chemin
73 73
 	if (
74 74
 		$f = ($module == 'local'
75
-		? find_in_path($module . $lang . '.php', 'lang/')
76
-		: find_langs_in_path($module . $lang . '.php', 'lang/'))
75
+		? find_in_path($module.$lang.'.php', 'lang/')
76
+		: find_langs_in_path($module.$lang.'.php', 'lang/'))
77 77
 	) {
78 78
 		return is_array($f) ? $f : [$f];
79 79
 	}
80 80
 
81 81
 	// 2) directement dans le chemin (old style, uniquement pour local)
82 82
 	return ($module == 'local' || strpos($module, '/'))
83
-		? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false)
83
+		? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false)
84 84
 		: false;
85 85
 }
86 86
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  **/
105 105
 function charger_langue($lang, $module = 'spip') {
106 106
 	static $langs = [];
107
-	$var = 'i18n_' . $module . '_' . $lang;
107
+	$var = 'i18n_'.$module.'_'.$lang;
108 108
 	if (!isset($langs[$lang])) {
109 109
 		$langs[$lang] = [];
110 110
 		if ($lang) {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 	foreach ($langs[$lang] as $l) {
121 121
 		if ($fichiers_lang = chercher_module_lang($module, $l)) {
122
-			$GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l;
122
+			$GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l;
123 123
 			$GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang));
124 124
 			surcharger_langue($fichiers_lang);
125 125
 			if ($l !== $lang) {
126
-				$GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l];
126
+				$GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l];
127 127
 			}
128
-			$GLOBALS['lang_' . $var] = $l;
128
+			$GLOBALS['lang_'.$var] = $l;
129 129
 			#spip_log("module de langue : {$module}_$l.php", 'traduire');
130 130
 			break;
131 131
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
  */
144 144
 function lire_fichier_langue(string $fichier): array {
145 145
 	$idx_lang_before = $GLOBALS['idx_lang'] ?? null;
146
-	$idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire';
146
+	$idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire';
147 147
 	$GLOBALS['idx_lang'] = $idx_lang_tmp;
148 148
 	$idx_lang = include $fichier;
149 149
 	$GLOBALS['idx_lang'] = $idx_lang_before;
@@ -254,27 +254,27 @@  discard block
 block discarded – undo
254 254
 	} else {
255 255
 		$modules = ['spip', 'ecrire'];
256 256
 		$code = $ori;
257
-		$ori_complet = implode('|', $modules) . ':' . $ori;
257
+		$ori_complet = implode('|', $modules).':'.$ori;
258 258
 	}
259 259
 
260 260
 	$desc = new Description();
261 261
 
262 262
 	// parcourir tous les modules jusqu'a ce qu'on trouve
263 263
 	foreach ($modules as $module) {
264
-		$var = 'i18n_' . $module . '_' . $lang;
264
+		$var = 'i18n_'.$module.'_'.$lang;
265 265
 
266 266
 		if (empty($GLOBALS[$var])) {
267 267
 			charger_langue($lang, $module);
268 268
 			// surcharges persos -- on cherche
269 269
 			// (lang/)local_xx.php et/ou (lang/)local.php ...
270
-			if (!isset($local['local_' . $lang])) {
270
+			if (!isset($local['local_'.$lang])) {
271 271
 				// redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer)
272 272
 				$GLOBALS['idx_lang'] = $var;
273 273
 				// ... (lang/)local_xx.php
274
-				$local['local_' . $lang] = chercher_module_lang('local', $lang);
274
+				$local['local_'.$lang] = chercher_module_lang('local', $lang);
275 275
 			}
276
-			if ($local['local_' . $lang]) {
277
-				surcharger_langue($local['local_' . $lang]);
276
+			if ($local['local_'.$lang]) {
277
+				surcharger_langue($local['local_'.$lang]);
278 278
 			}
279 279
 			// ... puis (lang/)local.php
280 280
 			if (!isset($local['local'])) {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		if (isset($GLOBALS[$var][$code])) {
289 289
 			$desc->code = $code;
290 290
 			$desc->module = $module;
291
-			$desc->langue = $GLOBALS['lang_' . $var] ?? $lang;
291
+			$desc->langue = $GLOBALS['lang_'.$var] ?? $lang;
292 292
 			$desc->texte = $GLOBALS[$var][$code];
293 293
 			break;
294 294
 		}
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
 	if (!$desc->mode && $desc->texte) {
347 347
 		// ne pas modifier 2 fois l'affichage
348 348
 		$desc->mode = 'traduction';
349
-		$classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : '');
349
+		$classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : '');
350 350
 		$desc->texte = '<span '
351
-			. 'lang=' . $desc->langue
352
-			. ' class=' . $classe
353
-			. ' data-module=' . $desc->module
354
-			. ' data-code=' . $desc->code
355
-			. ' title=' . $modules . '(' . $desc->langue . ')>'
351
+			. 'lang='.$desc->langue
352
+			. ' class='.$classe
353
+			. ' data-module='.$desc->module
354
+			. ' data-code='.$desc->code
355
+			. ' title='.$modules.'('.$desc->langue.')>'
356 356
 			. $desc->texte
357 357
 			. '</span>';
358 358
 		$desc->texte = str_replace(
Please login to merge, or discard this patch.
ecrire/inc/bandeau.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 			$_id = $e['id_table_objet'];
52 52
 			if (isset($contexte[$_id]) && ($id = (int) $contexte[$_id])) {
53 53
 				$table = $e['table_objet_sql'];
54
-				$row = sql_fetsel('*', $table, "$_id=" . (int) $id);
54
+				$row = sql_fetsel('*', $table, "$_id=".(int) $id);
55 55
 				if (isset($row['id_rubrique'])) {
56 56
 					$contexte['id_rubrique'] = $row['id_rubrique'];
57 57
 					if (isset($row['id_secteur'])) {
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
116 116
 					+ [
117 117
 						$id => new Bouton(
118
-							($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
119
-							$infos['titre'],  // titre
118
+							($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
119
+							$infos['titre'], // titre
120 120
 							(isset($infos['action']) && $infos['action']) ? $infos['action'] : null,
121 121
 							(isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null
122 122
 						)
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
134 134
 					+ [
135 135
 						$id => new Bouton(
136
-							($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
137
-							$infos['titre'],  // titre
136
+							($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
137
+							$infos['titre'], // titre
138 138
 							(isset($infos['action']) && $infos['action']) ? $infos['action'] : null,
139 139
 							(isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null
140 140
 						)
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$url = str_replace('&amp;', '&', $url);
222 222
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
223 223
 			if ($matches[2] == 'id_secteur' && !isset($contexte['id_secteur']) && isset($contexte['id_rubrique'])) {
224
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $contexte['id_rubrique']);
224
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $contexte['id_rubrique']);
225 225
 			}
226 226
 			$val = _request($matches[2], $contexte);
227 227
 			$url = parametre_url($url, $matches[1], $val ?: '', '&');
Please login to merge, or discard this patch.
ecrire/inc/selectionner.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 	if ($aff_racine) {
55 55
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
56
-		$idom3 = $idom . '_selection';
56
+		$idom3 = $idom.'_selection';
57 57
 
58 58
 		$onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;";
59 59
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			'  '
72 72
 		);
73 73
 
74
-		$js_func = $do . '_selection_titre';
74
+		$js_func = $do.'_selection_titre';
75 75
 		$ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');";
76 76
 
77 77
 		$aff_racine = "<div class='petit-item petite-racine item'>"
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
  **/
113 113
 function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '') {
114 114
 
115
-	$idom1 = $idom . '_champ_recherche';
116
-	$idom2 = $idom . '_principal';
117
-	$idom3 = $idom . '_selection';
118
-	$idom4 = $idom . '_col_1';
119
-	$idom5 = 'img_' . $idom4;
120
-	$idom6 = $idom . '_fonc';
115
+	$idom1 = $idom.'_champ_recherche';
116
+	$idom2 = $idom.'_principal';
117
+	$idom3 = $idom.'_selection';
118
+	$idom4 = $idom.'_col_1';
119
+	$idom5 = 'img_'.$idom4;
120
+	$idom6 = $idom.'_fonc';
121 121
 
122 122
 	return "<div id='$idom'>"
123 123
 	. "<a id='$idom6' style='visibility: hidden;'"
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 	. http_img_pack(
128 128
 		'loader.svg',
129 129
 		'',
130
-		"class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'"
130
+		"class='loader' style='visibility: hidden;float:".$GLOBALS['spip_lang_right']."' id='$idom5'"
131 131
 	)
132 132
 	. ''
133
-	. "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'"
133
+	. "<input style='width: 10em;float:".$GLOBALS['spip_lang_right'].";' type='text' class='text search' id='$idom1' placeholder='"._T('info_rechercher')."'"
134 134
 	// eliminer Return car il provoque la soumission (balise unique)
135 135
 	// et eliminer Tab pour la navigation au clavier
136 136
 	// ce serait encore mieux de ne le faire que s'il y a encore plusieurs
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 
178 178
 	$liste = $id_rubrique;
179 179
 	$id_rubrique = (int) $id_rubrique;
180
-	while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = ' . $id_rubrique)) {
181
-		$liste = $id_rubrique . ",$liste";
180
+	while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = '.$id_rubrique)) {
181
+		$liste = $id_rubrique.",$liste";
182 182
 	}
183 183
 
184 184
 	return explode(',', "0,$liste");
Please login to merge, or discard this patch.
ecrire/inc/completer_traduction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 		$champs[] = 'virtuel';
55 55
 	}
56 56
 
57
-	$data = sql_fetsel('*', $desc['table'], $_id_table . '=' . (int) $id_trad);
57
+	$data = sql_fetsel('*', $desc['table'], $_id_table.'='.(int) $id_trad);
58 58
 
59 59
 	foreach ($champs as $c) {
60 60
 		$set[$c] = $data[$c];
Please login to merge, or discard this patch.
ecrire/inc/log.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 	// si spip_log() est appelé dans mes_options, toutes les constantes n'ont pas été définies
36 36
 	$logfile =
37
-		($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES))
37
+		($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES))
38 38
 		. $logname
39 39
 		. ($logsuf ?? (defined('_FILE_LOG_SUFFIX') ? _FILE_LOG_SUFFIX : '.log'));
40 40
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 	// Si le repertoire défini n'existe pas, poser dans tmp/
52 52
 	if (!$test_repertoire[$d]) {
53
-		$logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log';
53
+		$logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log';
54 54
 	}
55 55
 
56 56
 	$rotate = 0;
57
-	$pid = '(pid ' . @getmypid() . ')';
57
+	$pid = '(pid '.@getmypid().')';
58 58
 
59 59
 	// accepter spip_log( Array )
60 60
 	if (!is_string($message)) {
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 			$fi = substr($fi, strlen(_ROOT_RACINE));
70 70
 		}
71 71
 		$fu = $debug[2]['function'] ?? '';
72
-		$debugverb = "$fi:L$l:$fu" . '():';
72
+		$debugverb = "$fi:L$l:$fu".'():';
73 73
 	}
74 74
 
75
-	$m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' '
75
+	$m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' '
76 76
 		//distinguer les logs prives et publics dans les grep
77 77
 		. $debugverb
78 78
 		. (test_espace_prive() ? ':Pri:' : ':Pub:')
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	if (
97 97
 		$rotate-- > 0 && function_exists('spip_unlink')
98 98
 	) {
99
-		spip_unlink($logfile . '.' . $rotate);
99
+		spip_unlink($logfile.'.'.$rotate);
100 100
 		while ($rotate--) {
101
-			@rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1));
101
+			@rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1));
102 102
 		}
103 103
 	}
104 104
 
Please login to merge, or discard this patch.
ecrire/inc/securiser_action.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	}
93 93
 
94 94
 	$arg = parametre_url($url_action, 'arg');
95
-	$confirm = md5("$action:$arg:" . realpath(__FILE__));
95
+	$confirm = md5("$action:$arg:".realpath(__FILE__));
96 96
 	if (_request('confirm_action') === $confirm) {
97 97
 		return true;
98 98
 	}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		} else {
146 146
 			return generer_url_action(
147 147
 				$action,
148
-				'arg=' . rawurlencode($arg) . "&hash=$hash" . ($r ? "&redirect=$r" : ''),
148
+				'arg='.rawurlencode($arg)."&hash=$hash".($r ? "&redirect=$r" : ''),
149 149
 				$mode,
150 150
 				$public
151 151
 			);
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 	$hash = calculer_action_auteur("$action-$arg");
157 157
 	$att .= " style='margin: 0px; border: 0px'";
158 158
 	if ($redirect) {
159
-		$redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", '&#39;', $redirect) . "' />";
159
+		$redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", '&#39;', $redirect)."' />";
160 160
 	}
161
-	$mode .= $redirect . "
161
+	$mode .= $redirect."
162 162
 <input name='hash' type='hidden' value='$hash' />
163 163
 <input name='arg' type='hidden' value='$arg' />";
164 164
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	$pass ??= '';
227 227
 	$entry = "$action:$id_auteur:$pass:$alea";
228 228
 	if (!isset($sha[$entry])) {
229
-		$sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea));
229
+		$sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea));
230 230
 	}
231 231
 
232 232
 	return $sha[$entry];
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	// On nettoie l’URL de tous les var_.
337 337
 	$url = nettoyer_uri_var($url);
338 338
 
339
-	$token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea);
339
+	$token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea);
340 340
 	return "$id_auteur-$token";
341 341
 }
342 342
 
Please login to merge, or discard this patch.
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	];
43 43
 	$options = array_merge($defaut, $options);
44 44
 	if (is_numeric($options['expires']) && $options['expires'] > 0) {
45
-		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT';
45
+		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT';
46 46
 	}
47 47
 
48 48
 	if (is_null($options) && isset($_SERVER['HTTP_RANGE'])) {
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) {
72 72
 	// toujours envoyer un content type, meme vide !
73 73
 	header('Accept-Ranges: bytes');
74
-	header('Content-Type: ' . $content_type);
74
+	header('Content-Type: '.$content_type);
75 75
 
76 76
 	if (($fs = stat($fichier)) && !empty($fs['size']) && !empty($fs['mtime'])) {
77
-		header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $fs['mtime']) . ' GMT');
77
+		header('Last-Modified: '.gmdate('D, d M Y H:i:s', $fs['mtime']).' GMT');
78 78
 		header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, '0')));
79 79
 	}
80 80
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	else {
95 95
 		$f = (is_string($attachment) ? $attachment : basename($fichier));
96 96
 		header("Content-Disposition: inline; filename=\"$f\";");
97
-		header('Expires: ' . $expires); // set expiration time
97
+		header('Expires: '.$expires); // set expiration time
98 98
 	}
99 99
 }
100 100
 
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
147 147
 	if ($range && preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
148 148
 		### Offset signifies where we should begin to read the file
149
-		$byteOffset = (int)$match[1];
149
+		$byteOffset = (int) $match[1];
150 150
 
151 151
 
152 152
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
153 153
 		if (isset($match[2])) {
154
-			$finishBytes = (int)$match[2];
154
+			$finishBytes = (int) $match[2];
155 155
 			$byteLength = $finishBytes + 1;
156 156
 		} else {
157 157
 			$finishBytes = $fileSize - 1;
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 	// partial content
174 174
 	header('HTTP/1.1 206 Partial content');
175
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
175
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
176 176
 
177 177
 
178 178
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.
ecrire/inc/svg.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		return $fichier;
56 56
 	}
57 57
 	if (!file_exists($fichier)) {
58
-		$fichier  = supprimer_timestamp($fichier);
58
+		$fichier = supprimer_timestamp($fichier);
59 59
 		if (!file_exists($fichier)) {
60 60
 			return false;
61 61
 		}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 function svg_change_balise_svg($svg, $old_balise_svg, $attributs) {
146 146
 	$new_balise_svg = '<svg';
147 147
 	foreach ($attributs as $k => $v) {
148
-		$new_balise_svg .= " $k=\"" . entites_html($v) . '"';
148
+		$new_balise_svg .= " $k=\"".entites_html($v).'"';
149 149
 	}
150 150
 	$new_balise_svg .= '>';
151 151
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 function svg_insert_shapes($svg, $shapes, $start = true) {
164 164
 
165 165
 	if ($start === false || $start === 'end') {
166
-		$svg = str_replace('</svg>', $shapes . '</svg>', $svg);
166
+		$svg = str_replace('</svg>', $shapes.'</svg>', $svg);
167 167
 	}
168 168
 	else {
169 169
 		$p = stripos($svg, '<svg');
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
  */
185 185
 function svg_clip_in_box($svg, $x, $y, $width, $height) {
186 186
 	$rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />";
187
-	$id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8);
187
+	$id = 'clip-'.substr(md5($rect.strlen($svg)), 0, 8);
188 188
 	$clippath = "<clipPath id=\"$id\">$rect</clipPath>";
189 189
 	$g = "<g clip-path=\"url(#$id)\">";
190
-	$svg = svg_insert_shapes($svg, $clippath . $g);
190
+	$svg = svg_insert_shapes($svg, $clippath.$g);
191 191
 	return svg_insert_shapes($svg, '</g>', false);
192 192
 }
193 193
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	) {
206 206
 		[$balise_svg, $attributs] = $svg_infos;
207 207
 		if (!isset($attributs['viewBox'])) {
208
-			$attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height'];
208
+			$attributs['viewBox'] = '0 0 '.$attributs['width'].' '.$attributs['height'];
209 209
 		}
210 210
 		$attributs['width'] = (string) $new_width;
211 211
 		$attributs['height'] = (string) $new_height;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	else {
229 229
 		$couleur = couleur_html_to_hex($couleur);
230 230
 	}
231
-	return '#' . ltrim($couleur, '#');
231
+	return '#'.ltrim($couleur, '#');
232 232
 }
233 233
 
234 234
 /**
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 function svg_couleur_to_rgb($couleur) {
240 240
 	if (str_starts_with($couleur, 'rgb(')) {
241 241
 		$c = explode(',', substr($couleur, 4));
242
-		return ['red' => (int) $c[0],'green' => (int) $c[1],'blue' => (int) $c[2]];
242
+		return ['red' => (int) $c[0], 'green' => (int) $c[1], 'blue' => (int) $c[2]];
243 243
 	}
244 244
 	return _couleur_hex_to_dec($couleur);
245 245
 }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 			$background_color = svg_couleur_to_hexa($background_color);
454 454
 			if (isset($attributs['viewBox'])) {
455 455
 				$viewBox = explode(' ', $attributs['viewBox']);
456
-				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>";
456
+				$rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\"/>";
457 457
 			}
458 458
 			else {
459 459
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 			$background_color = svg_couleur_to_hexa($background_color);
484 484
 			if (isset($attributs['viewBox'])) {
485 485
 				$viewBox = explode(' ', $attributs['viewBox']);
486
-				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>";
486
+				$rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>";
487 487
 			}
488 488
 			else {
489 489
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 			$g = '<g';
513 513
 			foreach ($attributs as $k => $v) {
514 514
 				if (strlen($v)) {
515
-					$g .= " $k=\"" . attribut_html($v) . '"';
515
+					$g .= " $k=\"".attribut_html($v).'"';
516 516
 				}
517 517
 			}
518 518
 			if (strlen($g) > 2) {
@@ -540,10 +540,10 @@  discard block
 block discarded – undo
540 540
 	) {
541 541
 		if ($filter_def) {
542 542
 			[$balise_svg, ] = $svg_infos;
543
-			$filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8);
543
+			$filter_id = 'filter-'.substr(md5($filter_def.strlen($svg)), 0, 8);
544 544
 			$filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>";
545 545
 			$g = "<g filter=\"url(#$filter_id)\">";
546
-			$svg = svg_insert_shapes($svg, $filter . $g);
546
+			$svg = svg_insert_shapes($svg, $filter.$g);
547 547
 			$svg = svg_insert_shapes($svg, '</g>', false);
548 548
 		}
549 549
 		return $svg;
Please login to merge, or discard this patch.