Completed
Push — master ( a04e6b...ef338c )
by cam
01:24
created
ecrire/inc/bandeau.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			$_id = $e['id_table_objet'];
51 51
 			if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) {
52 52
 				$table = $e['table_objet_sql'];
53
-				$row = sql_fetsel('*', $table, "$_id=" . intval($id));
53
+				$row = sql_fetsel('*', $table, "$_id=".intval($id));
54 54
 				if (isset($row['id_rubrique'])) {
55 55
 					$contexte['id_rubrique'] = $row['id_rubrique'];
56 56
 					if (isset($row['id_secteur'])) {
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
118 118
 					+ [
119 119
 						$id => new Bouton(
120
-							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
121
-							$infos['titre'],  // titre
120
+							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
121
+							$infos['titre'], // titre
122 122
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
123 123
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
124 124
 						)
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
136 136
 					+ [
137 137
 						$id => new Bouton(
138
-							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
139
-							$infos['titre'],  // titre
138
+							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
139
+							$infos['titre'], // titre
140 140
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
141 141
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
142 142
 						)
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			$libelles = $isfavoris = $favoris = [];
182 182
 			foreach ($menu->sousmenu as $key => $item) {
183 183
 				$libelles[$key] = strtolower(translitteration(_T($item->libelle)));
184
-				$isfavoris[$key] = (bool)$item->favori;
184
+				$isfavoris[$key] = (bool) $item->favori;
185 185
 				$favoris[$key] = $item->favori;
186 186
 			}
187 187
 			if ($avec_favoris) {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		$url = str_replace('&', '&', $url);
224 224
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
225 225
 			if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) {
226
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique']));
226
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique']));
227 227
 			}
228 228
 			$val = _request($matches[2], $contexte);
229 229
 			$url = parametre_url($url, $matches[1], $val ? $val : '', '&');
Please login to merge, or discard this patch.
ecrire/inc/urls.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
  */
212 212
 function nettoyer_url_page($url, $contexte = []) {
213 213
 	$url_objets = urls_liste_objets();
214
-	$raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
215
-	$raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
216
-	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
214
+	$raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,';
215
+	$raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
216
+	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,';
217 217
 
218 218
 	if (
219 219
 		preg_match($raccourci_url_page_html, $url, $regs)
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	static $furls = [];
252 252
 	if (!isset($furls[$objet])) {
253 253
 		if (
254
-			function_exists($f = 'generer_url_ecrire_' . $objet)
254
+			function_exists($f = 'generer_url_ecrire_'.$objet)
255 255
 			// ou definie par un plugin
256 256
 			or $f = charger_fonction($f, 'urls', true)
257 257
 		) {
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 	if ($public or $connect) {
272 272
 		return generer_url_entite_absolue($id, $objet, $args, $ancre, $connect);
273 273
 	}
274
-	$a = id_table_objet($objet) . '=' . intval($id);
274
+	$a = id_table_objet($objet).'='.intval($id);
275 275
 	if (!function_exists('objet_info')) {
276 276
 		include_spip('inc/filtres');
277 277
 	}
278 278
 
279
-	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
279
+	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : '');
280 280
 }
Please login to merge, or discard this patch.
ecrire/inc/math.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	// Regarder dans le repertoire local des images TeX et blocs MathML
40
-	if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) {
40
+	if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) {
41 41
 		@mkdir($dir_tex, _SPIP_CHMOD);
42 42
 	}
43
-	$fichier = $dir_tex . md5(trim($tex)) . $ext;
43
+	$fichier = $dir_tex.md5(trim($tex)).$ext;
44 44
 
45 45
 
46 46
 	if (!@file_exists($fichier)) {
47 47
 		// Aller chercher l'image sur le serveur
48 48
 		if ($server) {
49
-			spip_log($url = $server . '?' . rawurlencode($tex));
49
+			spip_log($url = $server.'?'.rawurlencode($tex));
50 50
 			include_spip('inc/distant');
51 51
 			recuperer_url($url, ['file' => $fichier]);
52 52
 		}
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			return implode('', file($fichier));
62 62
 		} // TeX
63 63
 		else {
64
-			list(, , , $size) = @spip_getimagesize($fichier);
64
+			list(,,, $size) = @spip_getimagesize($fichier);
65 65
 			$alt = "alt=\"$tex\" title=\"$tex\"";
66 66
 
67 67
 			return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />";
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 			if ($defaire_amp) {
129 129
 				$expression = str_replace('&amp;', '&', $expression);
130 130
 			}
131
-			$echap = "\n<p class=\"spip\" style=\"text-align: center;\">" . produire_image_math($expression) . "</p>\n";
131
+			$echap = "\n<p class=\"spip\" style=\"text-align: center;\">".produire_image_math($expression)."</p>\n";
132 132
 			$pos = strpos($texte_milieu, $regs[0]);
133 133
 			$texte_milieu = substr($texte_milieu, 0, $pos)
134 134
 				. code_echappement($echap, $source)
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 				. substr($texte_milieu, $pos + strlen($regs[0]));
149 149
 		}
150 150
 
151
-		$texte_a_voir = $texte_debut . $texte_milieu . $texte_fin;
151
+		$texte_a_voir = $texte_debut.$texte_milieu.$texte_fin;
152 152
 	}
153 153
 
154 154
 	return $texte_a_voir;
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 function extraire_date($texte) {
39 39
 	// format = 2001-08
40 40
 	if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) {
41
-		return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01';
41
+		return $regs[1].'-'.sprintf('%02d', $regs[2]).'-01';
42 42
 	}
43 43
 }
44 44
 
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 		if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
70 70
 			$regs = array_pad($regs, 4, null); // eviter notice php
71
-			$date = $regs[1] . '-00-00' . $regs[3];
71
+			$date = $regs[1].'-00-00'.$regs[3];
72 72
 		} else {
73 73
 			if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) {
74 74
 				$regs = array_pad($regs, 4, null); // eviter notice php
75
-				$date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3];
75
+				$date = preg_replace('@/@', '-', $regs[1]).'-00'.$regs[3];
76 76
 			} else {
77 77
 				$date = date('Y-m-d H:i:s', strtotime($date));
78 78
 			}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 function vider_date($letexte, $verif_format_date = false) {
99 99
 	if (
100 100
 		!$verif_format_date
101
-		or (in_array(strlen($letexte), [10,19]) and
101
+		or (in_array(strlen($letexte), [10, 19]) and
102 102
 			  preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte))
103 103
 	) {
104 104
 		if (strncmp('0000-00-00', $letexte, 10) == 0) {
@@ -381,17 +381,17 @@  discard block
 block discarded – undo
381 381
 	if ($decal > 3600 * 24 * 30) {
382 382
 		$mois = floor($decal / (3600 * 24 * 30));
383 383
 		if ($mois < 2) {
384
-			$delai = "$mois " . _T('date_un_mois');
384
+			$delai = "$mois "._T('date_un_mois');
385 385
 		} else {
386
-			$delai = "$mois " . _T('date_mois');
386
+			$delai = "$mois "._T('date_mois');
387 387
 		}
388 388
 	} else {
389 389
 		if ($decal > 3600 * 24 * 7) {
390 390
 			$semaines = floor($decal / (3600 * 24 * 7));
391 391
 			if ($semaines < 2) {
392
-				$delai = "$semaines " . _T('date_une_semaine');
392
+				$delai = "$semaines "._T('date_une_semaine');
393 393
 			} else {
394
-				$delai = "$semaines " . _T('date_semaines');
394
+				$delai = "$semaines "._T('date_semaines');
395 395
 			}
396 396
 		} else {
397 397
 			if ($decal > 3600 * 24) {
@@ -399,30 +399,30 @@  discard block
 block discarded – undo
399 399
 				if ($jours < 2) {
400 400
 					return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier');
401 401
 				} else {
402
-					$delai = "$jours " . _T('date_jours');
402
+					$delai = "$jours "._T('date_jours');
403 403
 				}
404 404
 			} else {
405 405
 				if ($decal >= 3600) {
406 406
 					$heures = floor($decal / 3600);
407 407
 					if ($heures < 2) {
408
-						$delai = "$heures " . _T('date_une_heure');
408
+						$delai = "$heures "._T('date_une_heure');
409 409
 					} else {
410
-						$delai = "$heures " . _T('date_heures');
410
+						$delai = "$heures "._T('date_heures');
411 411
 					}
412 412
 				} else {
413 413
 					if ($decal >= 60) {
414 414
 						$minutes = floor($decal / 60);
415 415
 						if ($minutes < 2) {
416
-							$delai = "$minutes " . _T('date_une_minute');
416
+							$delai = "$minutes "._T('date_une_minute');
417 417
 						} else {
418
-							$delai = "$minutes " . _T('date_minutes');
418
+							$delai = "$minutes "._T('date_minutes');
419 419
 						}
420 420
 					} else {
421 421
 						$secondes = ceil($decal);
422 422
 						if ($secondes < 2) {
423
-							$delai = "$secondes " . _T('date_une_seconde');
423
+							$delai = "$secondes "._T('date_une_seconde');
424 424
 						} else {
425
-							$delai = "$secondes " . _T('date_secondes');
425
+							$delai = "$secondes "._T('date_secondes');
426 426
 						}
427 427
 					}
428 428
 				}
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		$njour = 0;
518 518
 	} else {
519 519
 		$njour = intval($jour);
520
-		if ($jourth = _T('date_jnum' . $jour)) {
520
+		if ($jourth = _T('date_jnum'.$jour)) {
521 521
 			$jour = $jourth;
522 522
 		}
523 523
 	}
@@ -525,10 +525,10 @@  discard block
 block discarded – undo
525 525
 	$mois = intval($mois);
526 526
 	if ($mois > 0 and $mois < 13) {
527 527
 		/* Traiter le cas "abbr" pour les noms de mois */
528
-		$param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : '');
529
-		$nommois = _T('date_mois_' . $mois . $param);
528
+		$param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_'.$options['param'] : '');
529
+		$nommois = _T('date_mois_'.$mois.$param);
530 530
 		if ($jour) {
531
-			$jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]);
531
+			$jourmois = _T('date_de_mois_'.$mois, ['j' => $jour, 'nommois' => $nommois]);
532 532
 		} else {
533 533
 			$jourmois = $nommois;
534 534
 		}
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 	}
539 539
 
540 540
 	if ($annee < 0) {
541
-		$annee = -$annee . ' ' . _T('date_avant_jc');
541
+		$annee = -$annee.' '._T('date_avant_jc');
542 542
 		$avjc = true;
543 543
 	} else {
544 544
 		$avjc = false;
@@ -564,11 +564,11 @@  discard block
 block discarded – undo
564 564
 				}
565 565
 			}
566 566
 			if ($vue == 'saison') {
567
-				return $saison ? _T('date_saison_' . $saison) : '';
567
+				return $saison ? _T('date_saison_'.$saison) : '';
568 568
 			} else {
569 569
 				return $saison ? trim(_T(
570 570
 					'date_fmt_saison_annee',
571
-					['saison' => _T('date_saison_' . $saison), 'annee' => $annee]
571
+					['saison' => _T('date_saison_'.$saison), 'annee' => $annee]
572 572
 				)) : '';
573 573
 			}
574 574
 
@@ -645,9 +645,9 @@  discard block
 block discarded – undo
645 645
 			}
646 646
 			$nom = mktime(1, 1, 1, $mois, $njour, $annee);
647 647
 			$nom = 1 + date('w', $nom);
648
-			$param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : '');
648
+			$param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : '');
649 649
 
650
-			return _T('date_jour_' . $nom . $param);
650
+			return _T('date_jour_'.$nom.$param);
651 651
 
652 652
 		case 'mois_annee':
653 653
 			if ($avjc) {
@@ -1042,8 +1042,8 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
 	$dtstart = $dtend = $dtabbr = '';
1044 1044
 	if (strpos($forme, 'hcal') !== false) {
1045
-		$dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
1046
-		$dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
1045
+		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
1046
+		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
1047 1047
 		$dtabbr = '</abbr>';
1048 1048
 	}
1049 1049
 
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 			}
1092 1092
 		} else {
1093 1093
 			if ($dtabbr && $dtstart) {
1094
-				$s = $dtstart . spip_ucfirst($s) . $dtabbr;
1094
+				$s = $dtstart.spip_ucfirst($s).$dtabbr;
1095 1095
 			} else {
1096 1096
 				$s = spip_ucfirst($s);
1097 1097
 			}
@@ -1114,8 +1114,8 @@  discard block
 block discarded – undo
1114 1114
 				$date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]);
1115 1115
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1116 1116
 			}
1117
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1118
-			$date_fin = $dtend . $date_fin . $dtabbr;
1117
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1118
+			$date_fin = $dtend.$date_fin.$dtabbr;
1119 1119
 
1120 1120
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1121 1121
 		} else {
@@ -1132,8 +1132,8 @@  discard block
 block discarded – undo
1132 1132
 				$date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]);
1133 1133
 			}
1134 1134
 
1135
-			$date_debut = $dtstart . $date_debut . $dtabbr;
1136
-			$date_fin = $dtend . $date_fin . $dtabbr;
1135
+			$date_debut = $dtstart.$date_debut.$dtabbr;
1136
+			$date_fin = $dtend.$date_fin.$dtabbr;
1137 1137
 			$s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]);
1138 1138
 		}
1139 1139
 	}
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 		$d = date('Y-m-d');
1238 1238
 	}
1239 1239
 
1240
-	return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2);
1240
+	return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2);
1241 1241
 }
1242 1242
 
1243 1243
 /**
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 		$d = date('Y-m-d');
1258 1258
 	}
1259 1259
 
1260
-	return substr($d, 0, 4) . substr($d, 5, 2);
1260
+	return substr($d, 0, 4).substr($d, 5, 2);
1261 1261
 }
1262 1262
 
1263 1263
 /**
Please login to merge, or discard this patch.
ecrire/inc/cvt_configurer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	) {
39 39
 		// Pour tous les formulaires CONFIGURER, ayant une fonction charger ou pas, on teste si autorisé
40 40
 		include_spip('inc/autoriser');
41
-		if (!autoriser('configurer', '_' . substr($form, 11))) {
41
+		if (!autoriser('configurer', '_'.substr($form, 11))) {
42 42
 			return false;
43 43
 		}
44 44
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		and !charger_fonction('traiter', "formulaires/$form/", true) // sans fonction traiter()
73 73
 	) {
74 74
 		$trace = cvtconf_formulaires_configurer_enregistre($form, $flux['args']['args']);
75
-		$flux['data'] = ['message_ok' => _T('config_info_enregistree') . $trace, 'editable' => true];
75
+		$flux['data'] = ['message_ok' => _T('config_info_enregistree').$trace, 'editable' => true];
76 76
 	}
77 77
 
78 78
 	return $flux;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$prefixe = $valeurs['_meta_prefixe'];
147 147
 	}
148 148
 	if (isset($valeurs['_meta_stockage'])) {
149
-		$stockage = $valeurs['_meta_stockage'] . '::';
149
+		$stockage = $valeurs['_meta_stockage'].'::';
150 150
 	}
151 151
 
152 152
 	// si on indique juste une table, il faut vider les autres proprietes
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
 	// sinon cas analyse du squelette
173 173
 	if (
174
-		$f = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/')
174
+		$f = find_in_path($form.'.'._EXTENSION_SQUELETTES, 'formulaires/')
175 175
 		and lire_fichier($f, $contenu)
176 176
 	) {
177 177
 		for ($i = 0; $i < 2; $i++) {
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 		lire_metas($table);
229 229
 	}
230 230
 
231
-	$prefixe = ($prefixe ? $prefixe . '_' : '');
231
+	$prefixe = ($prefixe ? $prefixe.'_' : '');
232 232
 	$table = ($table) ? "/$table/" : '';
233
-	$casier = ($casier) ? rtrim($casier, '/') . '/' : ''; // slash final, sinon rien
233
+	$casier = ($casier) ? rtrim($casier, '/').'/' : ''; // slash final, sinon rien
234 234
 
235 235
 	foreach ($store as $k => $v) {
236 236
 		ecrire_config("$stockage$table$prefixe$casier$k", $v);
237 237
 		if (_request('var_mode') == 'configurer' and autoriser('webmestre')) {
238
-			$trace .= "<br />table $table : " . $prefixe . $k . " = $v;";
238
+			$trace .= "<br />table $table : ".$prefixe.$k." = $v;";
239 239
 		}
240 240
 	}
241 241
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	list($table, $casier, $prefixe, $stockage) = cvtconf_definir_configurer_conteneur($form, $valeurs);
253 253
 
254 254
 	$table = ($table) ? "/$table/" : '';
255
-	$prefixe = ($prefixe ? $prefixe . '_' : '');
255
+	$prefixe = ($prefixe ? $prefixe.'_' : '');
256 256
 	if ($casier) {
257 257
 		$meta = lire_config("$stockage$table$prefixe$casier");
258 258
 		$prefixe = '';
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 
264 264
 	foreach ($valeurs as $k => $v) {
265 265
 		if (substr($k, 0, 1) !== '_') {
266
-			$valeurs[$k] = (isset($meta[$prefixe . $k]) ? $meta[$prefixe . $k] : null);
266
+			$valeurs[$k] = (isset($meta[$prefixe.$k]) ? $meta[$prefixe.$k] : null);
267 267
 		}
268 268
 	}
269 269
 }
Please login to merge, or discard this patch.
ecrire/inc/puce_statut.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -416,7 +416,7 @@
 block discarded – undo
416 416
 	$h = generer_action_auteur('instituer_objet', "$type-$id-$statut");
417 417
 	$t = supprimer_tags($titre);
418 418
 
419
-	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>';
419
+	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>';
420 420
 }
421 421
 
422 422
 // compat
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 		sql_updateq(
135 135
 			'spip_rubriques',
136 136
 			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
137
-			'id_rubrique=' . intval($id_rubrique)
137
+			'id_rubrique='.intval($id_rubrique)
138 138
 		);
139
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
139
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique));
140 140
 		if (!$id_parent) {
141 141
 			break;
142 142
 		}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 			return $id_pred != $id_rubrique;
172 172
 		}
173 173
 		// passer au parent si on a depublie
174
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
174
+		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred));
175 175
 		$id_pred = $r['id_parent'];
176 176
 	}
177 177
 
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
 		$date = date('Y-m-d H:i:s');
197 197
 	}
198 198
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
199
-		' AND date <= ' . sql_quote($date) : '';
199
+		' AND date <= '.sql_quote($date) : '';
200 200
 
201 201
 	if (!$id_rubrique = intval($id_rubrique)) {
202 202
 		return false;
203 203
 	}
204 204
 
205 205
 	// verifier qu'elle existe et est bien publiee
206
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
206
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
207 207
 	if (!$r or $r['statut'] !== 'publie') {
208 208
 		return false;
209 209
 	}
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 	$compte = [
214 214
 		'articles' => sql_countsel(
215 215
 			'spip_articles',
216
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
216
+			'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates"
217 217
 		),
218
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
218
+		'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"),
219 219
 		'documents' => sql_countsel(
220 220
 			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
221
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
221
+			'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
222 222
 		)
223 223
 	];
224 224
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		}
244 244
 	}
245 245
 
246
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
246
+	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique));
247 247
 
248 248
 #		spip_log("depublier_rubrique $id_pred");
249 249
 	return true;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
 	// Afficher les articles post-dates ?
308 308
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
309
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
309
+		'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
310 310
 
311 311
 	$r = sql_select(
312 312
 		'R.id_rubrique AS id, max(A.date) AS date_h',
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 		sql_updateq(
319 319
 			'spip_rubriques',
320 320
 			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
321
-			'id_rubrique=' . intval($row['id'])
321
+			'id_rubrique='.intval($row['id'])
322 322
 		);
323 323
 	}
324 324
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 			sql_updateq(
345 345
 				'spip_rubriques',
346 346
 				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
347
-				'id_rubrique=' . intval($row['id'])
347
+				'id_rubrique='.intval($row['id'])
348 348
 			);
349 349
 			$continuer = true;
350 350
 		}
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			and $rows = sql_allfetsel(
398 398
 				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
399 399
 				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
400
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
400
+				'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
401 401
 				'',
402 402
 				'R.id_secteur',
403 403
 				'0,100'
@@ -436,11 +436,11 @@  discard block
 block discarded – undo
436 436
 			and $rows = sql_allfetsel(
437 437
 				'id_rubrique as id',
438 438
 				'spip_rubriques',
439
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
439
+				'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select(
440 440
 					'zzz.id_rubrique',
441 441
 					'spip_rubriques AS zzz',
442
-					'zzz.profondeur=' . intval($prof)
443
-				) . ')',
442
+					'zzz.profondeur='.intval($prof)
443
+				).')',
444 444
 				'',
445 445
 				'',
446 446
 				'0,100'
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
455 455
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
456 456
 		// on arrete les frais
457
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
457
+		if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) {
458 458
 			$prof++;
459 459
 			$continuer = true;
460 460
 		}
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
 
463 463
 	// loger si la table des rubriques semble foireuse
464 464
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
465
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
465
+	if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) {
466 466
 		spip_log(
467
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
467
+			'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)',
468 468
 			_LOG_CRITIQUE
469 469
 		);
470
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
470
+		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1));
471 471
 	}
472 472
 
473 473
 	// reparer les articles
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	);
479 479
 
480 480
 	while ($row = sql_fetch($r)) {
481
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
481
+		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id']));
482 482
 	}
483 483
 
484 484
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 		$t = sql_updateq(
510 510
 			'spip_rubriques',
511 511
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
512
-			'id_rubrique=' . intval($id_rubrique)
512
+			'id_rubrique='.intval($id_rubrique)
513 513
 		);
514 514
 	}
515 515
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		sql_updateq(
555 555
 			'spip_articles',
556 556
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
557
-			'id_article=' . intval($id_article)
557
+			'id_article='.intval($id_article)
558 558
 		);
559 559
 	}
560 560
 
@@ -629,11 +629,11 @@  discard block
 block discarded – undo
629 629
 				];
630 630
 				// generer un nom de fonction "anonyme" unique
631 631
 				do {
632
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand();
632
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.rand();
633 633
 				} while (function_exists($functionname));
634 634
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
635
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
636
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
635
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
636
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
637 637
 				$res = '';
638 638
 				eval($code);
639 639
 				$res = explode(',', $res);
@@ -735,11 +735,11 @@  discard block
 block discarded – undo
735 735
 		$maxiter-- and $filles = sql_allfetsel(
736 736
 			'id_rubrique',
737 737
 			'spip_rubriques',
738
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
738
+			sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT')
739 739
 		)
740 740
 	) {
741 741
 		$r = join(',', array_column($filles, 'id_rubrique'));
742
-		$branche .= ',' . $r;
742
+		$branche .= ','.$r;
743 743
 	}
744 744
 
745 745
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 
780 780
 	if (isset($b[$id])) {
781 781
 		// Notre branche commence par la rubrique de depart si $tout=true
782
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
782
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
783 783
 	}
784 784
 
785 785
 	$hier = '';
@@ -792,11 +792,11 @@  discard block
 block discarded – undo
792 792
 		$maxiter-- and $parents = sql_allfetsel(
793 793
 			'id_parent',
794 794
 			'spip_rubriques',
795
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
795
+			sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT')
796 796
 		)
797 797
 	) {
798 798
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
799
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
799
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
800 800
 	}
801 801
 
802 802
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 	include_spip('base/abstract_sql');
829 829
 	if ($check) {
830 830
 		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
831
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
831
+			'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
832 832
 
833 833
 		$r = sql_select(
834 834
 			'DISTINCT A.id_rubrique AS id',
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 	$t = sql_fetsel(
846 846
 		'date',
847 847
 		'spip_articles',
848
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
848
+		"statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')),
849 849
 		'',
850 850
 		'date',
851 851
 		'1'
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		$r = sql_getfetsel(
902 902
 			'id_rubrique',
903 903
 			'spip_rubriques',
904
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
904
+			'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent),
905 905
 			$groupby = [],
906 906
 			$orderby = [],
907 907
 			$limit = '',
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 			sql_updateq(
938 938
 				'spip_rubriques',
939 939
 				['id_secteur' => $id_secteur, 'lang' => $lang],
940
-				'id_rubrique=' . intval($id_rubrique),
940
+				'id_rubrique='.intval($id_rubrique),
941 941
 				$desc = '',
942 942
 				$serveur
943 943
 			);
Please login to merge, or discard this patch.
ecrire/inc/filtres_mini.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	if ($query) {
48
-		$url .= '?' . $query;
48
+		$url .= '?'.$query;
49 49
 	}
50 50
 
51
-	return '/' . preg_replace(',^/,S', '', $url);
51
+	return '/'.preg_replace(',^/,S', '', $url);
52 52
 }
53 53
 
54 54
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) {
76 76
 		$r = array_pad($r, 3, null);
77 77
 
78
-		return $r[1] . resolve_path($r[2]);
78
+		return $r[1].resolve_path($r[2]);
79 79
 	}
80 80
 
81 81
 	# L'url site spip est un lien absolu aussi
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 	switch (substr($lien, 0, 1)) {
98 98
 		case '/':
99
-			return $debut . resolve_path($lien);
99
+			return $debut.resolve_path($lien);
100 100
 		case '#':
101
-			return $debut . resolve_path($dir . $mot . $get . $lien);
101
+			return $debut.resolve_path($dir.$mot.$get.$lien);
102 102
 		case '':
103
-			return $debut . resolve_path($dir . $mot . $get . $hash);
103
+			return $debut.resolve_path($dir.$mot.$get.$hash);
104 104
 		default:
105
-			return $debut . resolve_path($dir . $lien);
105
+			return $debut.resolve_path($dir.$lien);
106 106
 	}
107 107
 }
108 108
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		return '';
131 131
 	}
132 132
 	if (!$base) {
133
-		$base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
133
+		$base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
134 134
 	}
135 135
 
136 136
 	return suivre_lien($base, $url);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
  * @param array $protocoles_autorises
154 154
  * @return bool
155 155
  */
156
-function protocole_verifier($url_absolue, $protocoles_autorises = ['http','https']) {
156
+function protocole_verifier($url_absolue, $protocoles_autorises = ['http', 'https']) {
157 157
 
158 158
 	if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) {
159 159
 		$protocole = $m[1];
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	$blue = dechex($blue);
44 44
 
45 45
 	if (strlen($red) == 1) {
46
-		$red = '0' . $red;
46
+		$red = '0'.$red;
47 47
 	}
48 48
 	if (strlen($green) == 1) {
49
-		$green = '0' . $green;
49
+		$green = '0'.$green;
50 50
 	}
51 51
 	if (strlen($blue) == 1) {
52
-		$blue = '0' . $blue;
52
+		$blue = '0'.$blue;
53 53
 	}
54 54
 
55 55
 	return "$red$green$blue";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	$couleur = couleur_html_to_hex($couleur);
68 68
 	$couleur = ltrim($couleur, '#');
69 69
 	if (strlen($couleur) === 3) {
70
-		$couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2];
70
+		$couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2];
71 71
 	}
72 72
 	$retour = [];
73 73
 	$retour['red'] = hexdec(substr($couleur, 0, 2));
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 	$var_G = ($G / 255);
125 125
 	$var_B = ($B / 255);
126 126
 
127
-	$var_Min = min($var_R, $var_G, $var_B);   //Min. value of RGB
128
-	$var_Max = max($var_R, $var_G, $var_B);   //Max. value of RGB
129
-	$del_Max = $var_Max - $var_Min;           //Delta RGB value
127
+	$var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB
128
+	$var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB
129
+	$del_Max = $var_Max - $var_Min; //Delta RGB value
130 130
 
131 131
 	$L = ($var_Max + $var_Min) / 2;
132 132
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
  */
189 189
 function _couleur_hsl_to_rgb($H, $S, $L) {
190 190
 	// helper
191
-	$hue_2_rgb = function ($v1, $v2, $vH) {
191
+	$hue_2_rgb = function($v1, $v2, $vH) {
192 192
 		if ($vH < 0) {
193 193
 			$vH += 1;
194 194
 		}
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
 	} # gerer img src="data:....base64"
319 319
 	elseif (
320 320
 		preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs)
321
-		and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1])
321
+		and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1])
322 322
 		and in_array($extension, _image_extensions_acceptees_en_entree())
323 323
 	) {
324
-		$local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension);
324
+		$local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension);
325 325
 		if (!file_exists($local)) {
326 326
 			ecrire_fichier($local, base64_decode($regs[2]));
327 327
 		}
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	// les protocoles web prennent au moins 3 lettres
336 336
 	if (tester_url_absolue($source)) {
337 337
 		include_spip('inc/distant');
338
-		$fichier = _DIR_RACINE . copie_locale($source);
338
+		$fichier = _DIR_RACINE.copie_locale($source);
339 339
 		if (!$fichier) {
340 340
 			return '';
341 341
 		}
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 			// on garde la terminaison initiale car image simplement copiee
428 428
 			// et on postfixe son nom avec un md5 du path
429 429
 			$terminaison_dest = $terminaison;
430
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
430
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
431 431
 		} else {
432
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
432
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
433 433
 		}
434 434
 		$cache = sous_repertoire(_DIR_VAR, $cache);
435 435
 		$cache = sous_repertoire($cache, $effet);
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 		$fichier_dest = substr($fichier_dest, 2);
441 441
 	}
442 442
 
443
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
443
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
444 444
 
445 445
 	$GLOBALS['images_calculees'][] = $fichier_dest;
446 446
 
@@ -478,15 +478,15 @@  discard block
 block discarded – undo
478 478
 
479 479
 	if ($creer) {
480 480
 		spip_log(
481
-			'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
482
-			'images' . _LOG_DEBUG
481
+			'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
482
+			'images'._LOG_DEBUG
483 483
 		);
484 484
 	}
485 485
 
486 486
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
487
-	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction;
487
+	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction;
488 488
 	$ret['fichier'] = $fichier;
489
-	$ret['fonction_image'] = '_image_image' . $terminaison_dest;
489
+	$ret['fonction_image'] = '_image_image'.$terminaison_dest;
490 490
 	$ret['fichier_dest'] = $fichier_dest;
491 491
 	$ret['format_source'] = _image_extension_normalisee($terminaison);
492 492
 	$ret['format_dest'] = $terminaison_dest;
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 
636 636
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
637 637
 	if ($_terminaison and $_terminaison !== $terminaison) {
638
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
638
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
639 639
 		$terminaison = $_terminaison;
640 640
 	}
641 641
 	return $terminaison;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 	if (!function_exists('imagepng')) {
793 793
 		return false;
794 794
 	}
795
-	$tmp = $fichier . '.tmp';
795
+	$tmp = $fichier.'.tmp';
796 796
 	$ret = imagepng($img, $tmp);
797 797
 	if (file_exists($tmp)) {
798 798
 		$taille_test = getimagesize($tmp);
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 	if (!function_exists('imagegif')) {
828 828
 		return false;
829 829
 	}
830
-	$tmp = $fichier . '.tmp';
830
+	$tmp = $fichier.'.tmp';
831 831
 	$ret = imagegif($img, $tmp);
832 832
 	if (file_exists($tmp)) {
833 833
 		$taille_test = getimagesize($tmp);
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 	if (!function_exists('imagejpeg')) {
868 868
 		return false;
869 869
 	}
870
-	$tmp = $fichier . '.tmp';
870
+	$tmp = $fichier.'.tmp';
871 871
 
872 872
 	// Enable interlancing
873 873
 	imageinterlace($img, true);
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 	if (!function_exists('imagewebp')) {
929 929
 		return false;
930 930
 	}
931
-	$tmp = $fichier . '.tmp';
931
+	$tmp = $fichier.'.tmp';
932 932
 	$ret = imagewebp($img, $tmp, $qualite);
933 933
 	if (file_exists($tmp)) {
934 934
 		$taille_test = getimagesize($tmp);
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
  */
963 963
 function _image_imagesvg($img, $fichier) {
964 964
 
965
-	$tmp = $fichier . '.tmp';
965
+	$tmp = $fichier.'.tmp';
966 966
 	if (strpos($img, '<') === false) {
967 967
 		$img = supprimer_timestamp($img);
968 968
 		if (!file_exists($img)) {
@@ -1019,13 +1019,13 @@  discard block
 block discarded – undo
1019 1019
  */
1020 1020
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1021 1021
 	if (is_null($fonction)) {
1022
-		$fonction = '_image_image' . $valeurs['format_dest'];
1022
+		$fonction = '_image_image'.$valeurs['format_dest'];
1023 1023
 	}
1024 1024
 	$ret = false;
1025 1025
 	#un flag pour reperer les images gravees
1026 1026
 	$lock =
1027 1027
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1028
-	or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'));
1028
+	or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'));
1029 1029
 	if (
1030 1030
 		function_exists($fonction)
1031 1031
 		&& ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 			// dans tous les cas mettre a jour la taille de l'image finale
1037 1037
 			list($valeurs['hauteur_dest'], $valeurs['largeur_dest']) = taille_image($valeurs['fichier_dest']);
1038 1038
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1039
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1039
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1040 1040
 		}
1041 1041
 	}
1042 1042
 
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 
1250 1250
 	// attributs deprecies. Transformer en CSS
1251 1251
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1252
-		$style = "margin:${espace}px;" . $style;
1252
+		$style = "margin:${espace}px;".$style;
1253 1253
 		$tag = inserer_attribut($tag, 'hspace', '');
1254 1254
 	}
1255 1255
 
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 	$image = $valeurs['fichier'];
1375 1375
 	$format = $valeurs['format_source'];
1376 1376
 	$destdir = dirname($valeurs['fichier_dest']);
1377
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1377
+	$destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1378 1378
 
1379 1379
 	$format_sortie = $valeurs['format_dest'];
1380 1380
 
@@ -1406,14 +1406,14 @@  discard block
 block discarded – undo
1406 1406
 
1407 1407
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1408 1408
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1409
-		$vignette = $destination . '.' . $format;
1409
+		$vignette = $destination.'.'.$format;
1410 1410
 		@copy($image, $vignette);
1411 1411
 	}
1412 1412
 
1413 1413
 	elseif ($valeurs['format_source'] === 'svg') {
1414 1414
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1415 1415
 			$format_sortie = 'svg';
1416
-			$vignette = $destination . '.' . $format_sortie;
1416
+			$vignette = $destination.'.'.$format_sortie;
1417 1417
 			$valeurs['fichier_dest'] = $vignette;
1418 1418
 			_image_gd_output($svg, $valeurs);
1419 1419
 		}
@@ -1425,9 +1425,9 @@  discard block
 block discarded – undo
1425 1425
 			define('_CONVERT_COMMAND', 'convert');
1426 1426
 		} // Securite : mes_options.php peut preciser le chemin absolu
1427 1427
 		if (!defined('_RESIZE_COMMAND')) {
1428
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest');
1428
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest');
1429 1429
 		}
1430
-		$vignette = $destination . '.' . $format_sortie;
1430
+		$vignette = $destination.'.'.$format_sortie;
1431 1431
 		$commande = str_replace(
1432 1432
 			['%x', '%y', '%src', '%dest'],
1433 1433
 			[
@@ -1443,13 +1443,13 @@  discard block
 block discarded – undo
1443 1443
 		if (!@file_exists($vignette)) {
1444 1444
 			spip_log("echec convert sur $vignette");
1445 1445
 
1446
-			return;  // echec commande
1446
+			return; // echec commande
1447 1447
 		}
1448 1448
 	}
1449 1449
 
1450 1450
 	// php5 imagemagick
1451 1451
 	elseif ($process == 'imagick') {
1452
-		$vignette = "$destination." . $format_sortie;
1452
+		$vignette = "$destination.".$format_sortie;
1453 1453
 
1454 1454
 		if (!class_exists('Imagick')) {
1455 1455
 			spip_log('Classe Imagick absente !', _LOG_ERREUR);
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 			$destHeight,
1464 1464
 			Imagick::FILTER_LANCZOS,
1465 1465
 			1
1466
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1466
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1467 1467
 		$imagick->writeImage($vignette);
1468 1468
 
1469 1469
 		if (!@file_exists($vignette)) {
@@ -1481,11 +1481,11 @@  discard block
 block discarded – undo
1481 1481
 		if (_PNMSCALE_COMMAND == '') {
1482 1482
 			return;
1483 1483
 		}
1484
-		$vignette = $destination . '.' . $format_sortie;
1484
+		$vignette = $destination.'.'.$format_sortie;
1485 1485
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1486 1486
 		if ($format == 'jpg') {
1487 1487
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1488
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1488
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1489 1489
 			if (!($s = @filesize($vignette))) {
1490 1490
 				spip_unlink($vignette);
1491 1491
 			}
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
 		} else {
1498 1498
 			if ($format == 'gif') {
1499 1499
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1500
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1500
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1501 1501
 				if (!($s = @filesize($vignette))) {
1502 1502
 					spip_unlink($vignette);
1503 1503
 				}
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 			} else {
1510 1510
 				if ($format == 'png') {
1511 1511
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1512
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1512
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1513 1513
 					if (!($s = @filesize($vignette))) {
1514 1514
 						spip_unlink($vignette);
1515 1515
 					}
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
 			return;
1532 1532
 		}
1533 1533
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1534
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1534
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1535 1535
 
1536 1536
 			return;
1537 1537
 		}
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 		// de l'image, de facon a tromper le cache du navigateur
1844 1844
 		// quand on fait supprimer/reuploader un logo
1845 1845
 		// (pas de filemtime si SAFE MODE)
1846
-		$date = test_espace_prive() ? ('?' . $date) : '';
1846
+		$date = test_espace_prive() ? ('?'.$date) : '';
1847 1847
 
1848 1848
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1849 1849
 	}
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 	public static function LittleEndian2String($number, $minbytes = 1) {
1891 1891
 		$intstring = '';
1892 1892
 		while ($number > 0) {
1893
-			$intstring = $intstring . chr($number & 255);
1893
+			$intstring = $intstring.chr($number & 255);
1894 1894
 			$number >>= 8;
1895 1895
 		}
1896 1896
 
@@ -1922,9 +1922,9 @@  discard block
 block discarded – undo
1922 1922
 					$b = $argb['blue'];
1923 1923
 
1924 1924
 					if ($bpp[$key] == 32) {
1925
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1925
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1926 1926
 					} elseif ($bpp[$key] == 24) {
1927
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1927
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1928 1928
 					}
1929 1929
 
1930 1930
 					if ($a < 128) {
@@ -1951,48 +1951,48 @@  discard block
 block discarded – undo
1951 1951
 
1952 1952
 			// BITMAPINFOHEADER - 40 bytes
1953 1953
 			$BitmapInfoHeader[$key] = '';
1954
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1955
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1954
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1955
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1956 1956
 			// The biHeight member specifies the combined
1957 1957
 			// height of the XOR and AND masks.
1958 1958
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1959
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1960
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1961
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1962
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1963
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1964
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1965
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1966
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1959
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1960
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1961
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1962
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1963
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1964
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1965
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1966
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1967 1967
 		}
1968 1968
 
1969 1969
 
1970
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1971
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1972
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1970
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1971
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1972
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1973 1973
 
1974 1974
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1975 1975
 		foreach ($gd_image_array as $key => $gd_image) {
1976 1976
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1977 1977
 
1978
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1979
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1980
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1981
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1978
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1979
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1980
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1981
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1982 1982
 
1983
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1984
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1983
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1984
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1985 1985
 
1986 1986
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1987 1987
 			$icondata .= phpthumb_functions::LittleEndian2String(
1988 1988
 				$dwBytesInRes,
1989 1989
 				4
1990
-			);     // dwBytesInRes;	// How many bytes in this resource?
1990
+			); // dwBytesInRes;	// How many bytes in this resource?
1991 1991
 
1992 1992
 			$icondata .= phpthumb_functions::LittleEndian2String(
1993 1993
 				$dwImageOffset,
1994 1994
 				4
1995
-			);    // dwImageOffset;   // Where in the file is this image?
1995
+			); // dwImageOffset;   // Where in the file is this image?
1996 1996
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1997 1997
 			$dwImageOffset += strlen($icXOR[$key]);
1998 1998
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.