Completed
Push — master ( 7208c3...09b169 )
by cam
01:22
created
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +35 added lines, -36 removed lines patch added patch discarded remove patch
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
 		$class_li .= " error";
58 58
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'",
59 59
 				_T('plugin_info_erreur_xml'))
60
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
60
+			. "<div class='erreur'>".join('<br >', $info['erreur'])."</div>";
61 61
 		$checkable = false;
62 62
 
63
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
63
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
64 64
 		$class_li .= " error";
65 65
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)),
66 66
 				" class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom)))
67
-			. "<div class='erreur'>" . implode("<br />",
68
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>";
67
+			. "<div class='erreur'>".implode("<br />",
68
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])."</div>";
69 69
 	} else {
70 70
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : "";
71
-		if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])){
71
+		if (defined('_DEV_VERSION_SPIP_COMPAT') and !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
72 72
 			//$info['slogan'] = _T('plugin_info_non_compatible_spip');
73 73
 			$erreur = http_img_pack("plugin-dis-32.png", _T('plugin_info_non_compatible_spip'), " class='picto_err picto_compat_forcee'",
74 74
 				_L('Version incompatible : compatibilité forcée'));
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 	// numerotons les occurrences d'un meme prefix
79 79
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
80 80
 
81
-	$class_li .= ($actif ? " actif" : "") . ($expose ? " on" : "");
81
+	$class_li .= ($actif ? " actif" : "").($expose ? " on" : "");
82 82
 
83 83
 	return "<li id='$prefix$id' class='$class_li'>"
84 84
 	. ((!$checkable and !$checked)
85
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
85
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
86 86
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
87 87
 	. $cfg
88 88
 	. $erreur
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	$prefix = strtolower($infos['prefix']);
101 101
 	// si paquet.xml fournit un squelette, le prendre
102 102
 	if (isset($infos['config']) and $infos['config']) {
103
-		return recuperer_fond("$dir$nom/" . $infos['config'],
103
+		return recuperer_fond("$dir$nom/".$infos['config'],
104 104
 			array(
105
-				'script' => 'configurer_' . $prefix,
105
+				'script' => 'configurer_'.$prefix,
106 106
 				'nom' => $nom
107 107
 			));
108 108
 	}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	// sinon prendre le squelette std sur le nom std
121 121
 	return recuperer_fond("prive/squelettes/inclure/cfg",
122 122
 		array(
123
-			'script' => 'configurer_' . $prefix,
123
+			'script' => 'configurer_'.$prefix,
124 124
 			'nom' => $nom
125 125
 		));
126 126
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
136 136
 	. ($actif ? " checked='checked'" : "")
137 137
 	. " class='checkbox'  value='O' />"
138
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . "</label>"
138
+	. "\n<label for='label_$id_input'>"._T('activer_plugin')."</label>"
139 139
 	. "</div>";
140 140
 }
141 141
 
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 	. "<h3><a href='$url' rel='info'>"
191 191
 	. $nom
192 192
 	. "</a></h3>"
193
-	. " <span class='version'>" . $info['version'] . "</span>"
193
+	. " <span class='version'>".$info['version']."</span>"
194 194
 	. " <span class='etat'> - "
195 195
 	. plugin_etat_en_clair($info['etat'])
196 196
 	. "</span>"
197
-	. "<div class='short'>" . $slogan . "</div>"
197
+	. "<div class='short'>".$slogan."</div>"
198 198
 	. $i
199 199
 	. "</div>";
200 200
 }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	$text2 = _T('info_desinstaller_plugin');
210 210
 	$file = basename($plug_file);
211 211
 
212
-	return "<div class='actions'>[" .
212
+	return "<div class='actions'>[".
213 213
 	"<a href='$action'
214 214
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
215 215
 	. $text
@@ -231,17 +231,17 @@  discard block
 block discarded – undo
231 231
 		$etat = 'developpement';
232 232
 	}
233 233
 
234
-	return _T('plugin_etat_' . $etat);
234
+	return _T('plugin_etat_'.$etat);
235 235
 }
236 236
 
237 237
 // https://code.spip.net/@plugin_propre
238
-function plugin_propre($texte, $module = '',$propre='propre') {
238
+function plugin_propre($texte, $module = '', $propre = 'propre') {
239 239
 	// retirer le retour a la racine du module, car le find_in_path se fait depuis la racine
240 240
 	if (_DIR_RACINE and strncmp($module, _DIR_RACINE, strlen(_DIR_RACINE)) == 0) {
241 241
 		$module = substr($module, strlen(_DIR_RACINE));
242 242
 	}
243 243
 	if (preg_match("|^\w+_[\w_]+$|", $texte)) {
244
-		$texte = _T(($module ? "$module:" : '') . $texte, array(), array('force' => false));
244
+		$texte = _T(($module ? "$module:" : '').$texte, array(), array('force' => false));
245 245
 	}
246 246
 
247 247
 	return $propre($texte);
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 	if (isset($info['documentation'])
274 274
 		and $lien = $info['documentation']
275 275
 	) {
276
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
276
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
277 277
 	}
278
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
278
+	$s .= "<dd class='desc'>".$description."</dd>\n";
279 279
 
280 280
 	if (isset($info['auteur'])) {
281 281
 		if (is_array($info['auteur'])) {
@@ -285,15 +285,15 @@  discard block
 block discarded – undo
285 285
 			$a = trim($info['auteur']);
286 286
 		}
287 287
 		if ($a) {
288
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre($a,
289
-					$dir)) . "</dd>\n";
288
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre($a,
289
+					$dir))."</dd>\n";
290 290
 		}
291 291
 	}
292 292
 
293 293
 	if (isset($info['credit'])) {
294 294
 		if ($a = formater_credits($info['credit'], ', ')) {
295
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre($a,
296
-					$dir)) . "</dd>\n";
295
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre($a,
296
+					$dir))."</dd>\n";
297 297
 		}
298 298
 	}
299 299
 
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 			$a = trim($info['licence']);
306 306
 		}
307 307
 		if ($a) {
308
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre($a,
309
-					$dir)) . "</dd>\n";
308
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre($a,
309
+					$dir))."</dd>\n";
310 310
 		}
311 311
 	}
312 312
 
@@ -317,23 +317,22 @@  discard block
 block discarded – undo
317 317
 	//
318 318
 	$infotech = array();
319 319
 
320
-	$version = "<dt>" . _T('version') . "</dt><dd>" . $info['version'];
320
+	$version = "<dt>"._T('version')."</dt><dd>".$info['version'];
321 321
 	// Version VCS
322
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
323
-		$version .= ' ' . $vcs;
322
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
323
+		$version .= ' '.$vcs;
324 324
 	}
325 325
 	$version .= "</dd>";
326 326
 	$infotech[] = $version;
327
-	$infotech[] = "<dt>" . _T('repertoire_plugins') . "</dt><dd>" . joli_repertoire("$dir_plugins$plug_file") . "</dd>";
327
+	$infotech[] = "<dt>"._T('repertoire_plugins')."</dt><dd>".joli_repertoire("$dir_plugins$plug_file")."</dd>";
328 328
 	// source zip le cas echeant
329
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log)
329
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log)
330 330
 		and preg_match(',^source:(.*)$,m', $log, $r))
331
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . "</dd>"
331
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1])."</dd>"
332 332
 		: '';
333 333
 
334
-	$infotech[] = !$info['necessite'] ? '' :
335
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(' ',
336
-				array_map('array_shift', $info['necessite'])) . '</dd>');
334
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(' ',
335
+				array_map('array_shift', $info['necessite'])).'</dd>');
337 336
 
338 337
 	$s .= "<dl class='tech'>"
339 338
 		. join('', $infotech)
@@ -354,8 +353,8 @@  discard block
 block discarded – undo
354 353
 		$texte .=
355 354
 			(!is_array($_credit))
356 355
 				? PtoBR(propre($_credit))
357
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
358
-				$_credit['nom'] .
356
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
357
+				$_credit['nom'].
359 358
 				($_credit['url'] ? '</a>' : '');
360 359
 	}
361 360
 
Please login to merge, or discard this patch.
ecrire/inc/commencer_page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$titre = "["
91 91
 		. $nom_site_spip
92 92
 		. "]"
93
-		. ($titre ? " " . textebrut(typo($titre)) : "");
93
+		. ($titre ? " ".textebrut(typo($titre)) : "");
94 94
 
95 95
 	return _DOCTYPE_ECRIRE
96 96
 	. html_lang_attributes()
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) {
134 134
 
135 135
 	$res = pipeline('body_prive', "<body class='"
136
-		. init_body_class() . " " . _request('exec') . "'"
136
+		. init_body_class()." "._request('exec')."'"
137 137
 		. ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : "")
138 138
 		. '>');
139 139
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 	$couleur = isset($prefs['couleur']) ? (int) $prefs['couleur'] : 2;
178 178
 
179
-	$classes = $GLOBALS['spip_ecran'] . " spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils " . $display_class[$GLOBALS['spip_display']];
179
+	$classes = $GLOBALS['spip_ecran']." spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils ".$display_class[$GLOBALS['spip_display']];
180 180
 	return spip_sanitize_classname($classes);
181 181
 }
182 182
 
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +167 added lines, -168 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	}
95 95
 
96 96
 	include_fichiers_fonctions();
97
-	foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) {
97
+	foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) {
98 98
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
99 99
 		// fonction ou name\space\fonction
100 100
 		if (is_callable($f)) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	// affichage "GIT [master: abcdef]"
222 222
 	$commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit'];
223 223
 	if ($desc['branch']) {
224
-		$commit = $desc['branch'] . ': ' . $commit;
224
+		$commit = $desc['branch'].': '.$commit;
225 225
 	}
226 226
 	return "{$desc['vcs']} [$commit]";
227 227
 }
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 	}
241 241
 
242 242
 	// version installee par GIT
243
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
243
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
244 244
 		$currentHead = trim(substr($c, 4));
245
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
245
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
246 246
 			return [
247 247
 				'vcs' => 'GIT',
248 248
 				'branch' => basename($currentHead),
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 		$dir = '.';
270 270
 	}
271 271
 	// version installee par SVN
272
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
273
-		$db = new SQLite3($dir . '/.svn/wc.db');
272
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
273
+		$db = new SQLite3($dir.'/.svn/wc.db');
274 274
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
275 275
 		if ($result) {
276 276
 			$row = $result->fetchArray();
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
 
289 289
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
290 290
 // et laisser passer les fonctions personnelles baptisees image_...
291
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
292
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
293
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
294
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
295
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
296
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
291
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
292
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
293
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
294
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
295
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
296
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
297 297
 
298 298
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
299 299
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function filtre_debug($val, $key = null) {
454 454
 	$debug = (
455
-		is_null($key) ? '' : (var_export($key, true) . " = ")
456
-		) . var_export($val, true);
455
+		is_null($key) ? '' : (var_export($key, true)." = ")
456
+		).var_export($val, true);
457 457
 
458 458
 	include_spip('inc/autoriser');
459 459
 	if (autoriser('webmestre')) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
553 553
 							$srcover = $match[1];
554 554
 							array_shift($args);
555
-							array_unshift($args, "<img src='" . $match[1] . "' />");
555
+							array_unshift($args, "<img src='".$match[1]."' />");
556 556
 							$srcover_filter = call_user_func_array($filtre, $args);
557 557
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
558 558
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -623,14 +623,14 @@  discard block
 block discarded – undo
623 623
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
624 624
 			}
625 625
 		}
626
-		elseif(strpos($src, "<svg") !== false) {
626
+		elseif (strpos($src, "<svg") !== false) {
627 627
 			include_spip('inc/svg');
628
-			if ($attrs = svg_lire_attributs($src)){
628
+			if ($attrs = svg_lire_attributs($src)) {
629 629
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
630
-				if (!$srcWidth){
630
+				if (!$srcWidth) {
631 631
 					$largeur_img[$src] = $srcWidth = $width;
632 632
 				}
633
-				if (!$srcHeight){
633
+				if (!$srcHeight) {
634 634
 					$hauteur_img[$src] = $srcHeight = $height;
635 635
 				}
636 636
 			}
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	// " -> &quot; et tout ce genre de choses
915 915
 	$u = $GLOBALS['meta']['pcre_u'];
916 916
 	$texte = str_replace("&nbsp;", " ", $texte);
917
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
917
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
918 918
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
919 919
 	$texte = entites_html($texte, false, false);
920 920
 	// mais bien echapper les double quotes !
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  **/
975 975
 function supprimer_numero($texte) {
976 976
 	return preg_replace(
977
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
977
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
978 978
 		"", $texte);
979 979
 }
980 980
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
  **/
1000 1000
 function recuperer_numero($texte) {
1001 1001
 	if (preg_match(
1002
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
1002
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
1003 1003
 		$texte, $regs)) {
1004 1004
 		return strval($regs[1]);
1005 1005
 	} else {
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
  **/
1085 1085
 function textebrut($texte) {
1086 1086
 	$u = $GLOBALS['meta']['pcre_u'];
1087
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
1088
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
1087
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
1088
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
1089 1089
 	$texte = preg_replace("/^\n+/", "", $texte);
1090 1090
 	$texte = preg_replace("/\n+$/", "", $texte);
1091 1091
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1114 1114
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1115 1115
 		foreach ($liens[0] as $a) {
1116
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1116
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1117 1117
 			$ablank = inserer_attribut($a, 'rel', $rel);
1118 1118
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1119 1119
 			$texte = str_replace($a, $ablank, $texte);
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 		foreach ($regs[0] as $a) {
1139 1139
 			$rel = extraire_attribut($a, "rel");
1140 1140
 			if (strpos($rel, "nofollow") === false) {
1141
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1141
+				$rel = "nofollow".($rel ? " $rel" : "");
1142 1142
 				$anofollow = inserer_attribut($a, "rel", $rel);
1143 1143
 				$texte = str_replace($a, $anofollow, $texte);
1144 1144
 			}
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 	$u = $GLOBALS['meta']['pcre_u'];
1168 1168
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1169 1169
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1170
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1170
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1171 1171
 
1172 1172
 	return $texte;
1173 1173
 }
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		return $texte;
1199 1199
 	}
1200 1200
 	include_spip('inc/texte');
1201
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1201
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1202 1202
 		'div' : 'span';
1203 1203
 
1204 1204
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 function attribut_html($texte, $textebrut = true) {
1308 1308
 	$u = $GLOBALS['meta']['pcre_u'];
1309 1309
 	if ($textebrut) {
1310
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1310
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1311 1311
 	}
1312 1312
 	$texte = texte_backend($texte);
1313 1313
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 	# un message pour abs_url
1337 1337
 	$GLOBALS['mode_abs_url'] = 'url';
1338 1338
 	$url = trim($url);
1339
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1339
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1340 1340
 
1341 1341
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1342 1342
 }
@@ -1538,14 +1538,14 @@  discard block
 block discarded – undo
1538 1538
 	if (strpos($texte, "<") !== false) {
1539 1539
 		include_spip('inc/lien');
1540 1540
 		if (defined('_PREG_MODELE')) {
1541
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1541
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1542 1542
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1543 1543
 		}
1544 1544
 	}
1545 1545
 
1546 1546
 	$debut = '';
1547 1547
 	$suite = $texte;
1548
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1548
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1549 1549
 		$debut .= substr($suite, 0, $t - 1);
1550 1550
 		$suite = substr($suite, $t);
1551 1551
 		$car = substr($suite, 0, 1);
@@ -1562,11 +1562,11 @@  discard block
 block discarded – undo
1562 1562
 			$suite = substr($suite, strlen($regs[0]));
1563 1563
 		}
1564 1564
 	}
1565
-	$texte = $debut . $suite;
1565
+	$texte = $debut.$suite;
1566 1566
 
1567 1567
 	$texte = echappe_retour($texte);
1568 1568
 
1569
-	return $texte . $fin;
1569
+	return $texte.$fin;
1570 1570
 }
1571 1571
 
1572 1572
 
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 		}
1628 1628
 
1629 1629
 		foreach ($regs as $reg) {
1630
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1630
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1631 1631
 			$desc = $traduire($cle, $lang, true);
1632 1632
 			$l = $desc->langue;
1633 1633
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1740,9 +1740,9 @@  discard block
 block discarded – undo
1740 1740
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1741 1741
 					include_spip('inc/texte');
1742 1742
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1743
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1743
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1744 1744
 					if ($mode === 'div') {
1745
-						$trad = rtrim($trad) . "\n\n";
1745
+						$trad = rtrim($trad)."\n\n";
1746 1746
 					}
1747 1747
 					$trad = code_echappement($trad, 'multi', false, $mode);
1748 1748
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
 	if (is_array($balise)) {
1937 1937
 		array_walk(
1938 1938
 			$balise,
1939
-			function(&$a, $key, $t){
1939
+			function(&$a, $key, $t) {
1940 1940
 				$a = extraire_attribut($a, $t);
1941 1941
 			},
1942 1942
 			$attribut
@@ -2023,14 +2023,14 @@  discard block
 block discarded – undo
2023 2023
 
2024 2024
 	if ($old !== null) {
2025 2025
 		// Remplacer l'ancien attribut du meme nom
2026
-		$balise = $r[1] . $insert . $r[5];
2026
+		$balise = $r[1].$insert.$r[5];
2027 2027
 	} else {
2028 2028
 		// preferer une balise " />" (comme <img />)
2029 2029
 		if (preg_match(',/>,', $balise)) {
2030
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
2030
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
2031 2031
 		} // sinon une balise <a ...> ... </a>
2032 2032
 		else {
2033
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
2033
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
2034 2034
 		}
2035 2035
 	}
2036 2036
 
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
  * @param string $operation
2064 2064
  * @return string
2065 2065
  */
2066
-function modifier_class($balise, $class, $operation='ajouter') {
2066
+function modifier_class($balise, $class, $operation = 'ajouter') {
2067 2067
 	if (is_string($class)) {
2068 2068
 		$class = explode(' ', trim($class));
2069 2069
 	}
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 				}
2089 2089
 				if (in_array($operation, ['ajouter', 'commuter'])
2090 2090
 					and !$is_class_presente) {
2091
-					$class_new = rtrim($class_new) . " " . $c;
2091
+					$class_new = rtrim($class_new)." ".$c;
2092 2092
 				}
2093 2093
 				elseif (in_array($operation, ['supprimer', 'commuter'])
2094 2094
 					and $is_class_presente) {
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
  * @param string|array $class
2117 2117
  * @return string
2118 2118
  */
2119
-function ajouter_class($balise, $class){
2119
+function ajouter_class($balise, $class) {
2120 2120
 	return modifier_class($balise, $class, 'ajouter');
2121 2121
 }
2122 2122
 
@@ -2126,7 +2126,7 @@  discard block
 block discarded – undo
2126 2126
  * @param string|array $class
2127 2127
  * @return string
2128 2128
  */
2129
-function supprimer_class($balise, $class){
2129
+function supprimer_class($balise, $class) {
2130 2130
 	return modifier_class($balise, $class, 'supprimer');
2131 2131
 }
2132 2132
 
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
  * @param string|array $class
2138 2138
  * @return string
2139 2139
  */
2140
-function commuter_class($balise, $class){
2140
+function commuter_class($balise, $class) {
2141 2141
 	return modifier_class($balise, $class, 'commuter');
2142 2142
 }
2143 2143
 
@@ -2157,8 +2157,8 @@  discard block
 block discarded – undo
2157 2157
 //
2158 2158
 // Quelques fonctions de calcul arithmetique
2159 2159
 //
2160
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
2161
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
2160
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
2161
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
2162 2162
 
2163 2163
 /**
2164 2164
  * Additionne 2 nombres
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
 function plus($a, $b) {
2179 2179
 	return $a + $b;
2180 2180
 }
2181
-function strplus($a, $b) {return strize('plus', $a, $b);}
2181
+function strplus($a, $b) {return strize('plus', $a, $b); }
2182 2182
 /**
2183 2183
  * Soustrait 2 nombres
2184 2184
  *
@@ -2197,7 +2197,7 @@  discard block
 block discarded – undo
2197 2197
 function moins($a, $b) {
2198 2198
 	return $a - $b;
2199 2199
 }
2200
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2200
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2201 2201
 
2202 2202
 /**
2203 2203
  * Multiplie 2 nombres
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
 function mult($a, $b) {
2219 2219
 	return $a * $b;
2220 2220
 }
2221
-function strmult($a, $b) {return strize('mult', $a, $b);}
2221
+function strmult($a, $b) {return strize('mult', $a, $b); }
2222 2222
 
2223 2223
 /**
2224 2224
  * Divise 2 nombres
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
 function div($a, $b) {
2240 2240
 	return $b ? $a / $b : 0;
2241 2241
 }
2242
-function strdiv($a, $b) {return strize('div', $a, $b);}
2242
+function strdiv($a, $b) {return strize('div', $a, $b); }
2243 2243
 
2244 2244
 /**
2245 2245
  * Retourne le modulo 2 nombres
@@ -2280,13 +2280,13 @@  discard block
 block discarded – undo
2280 2280
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2281 2281
 		define('_TAGS_NOM_AUTEUR', '');
2282 2282
 	}
2283
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2283
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2284 2284
 	foreach ($tags_acceptes as $tag) {
2285 2285
 		if (strlen($tag)) {
2286
-			$remp1[] = '<' . trim($tag) . '>';
2287
-			$remp1[] = '</' . trim($tag) . '>';
2288
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2289
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2286
+			$remp1[] = '<'.trim($tag).'>';
2287
+			$remp1[] = '</'.trim($tag).'>';
2288
+			$remp2[] = '\x60'.trim($tag).'\x61';
2289
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2290 2290
 		}
2291 2291
 	}
2292 2292
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2336,7 +2336,7 @@  discard block
 block discarded – undo
2336 2336
 			$s[] = preg_replace(',>[^<]+</a>,S',
2337 2337
 				'>'
2338 2338
 				. http_img_pack('attachment-16.png', $t,
2339
-					'title="' . attribut_html($t) . '"')
2339
+					'title="'.attribut_html($t).'"')
2340 2340
 				. '</a>', $tag);
2341 2341
 		}
2342 2342
 	}
@@ -2397,10 +2397,10 @@  discard block
 block discarded – undo
2397 2397
 	$fichier = basename($url);
2398 2398
 
2399 2399
 	return '<a rel="enclosure"'
2400
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2401
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2402
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2403
-	. '>' . $fichier . '</a>';
2400
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2401
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2402
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2403
+	. '>'.$fichier.'</a>';
2404 2404
 }
2405 2405
 
2406 2406
 /**
@@ -2428,9 +2428,9 @@  discard block
 block discarded – undo
2428 2428
 			} # vieux data
2429 2429
 			$fichier = basename($url);
2430 2430
 			$enclosures[] = '<enclosure'
2431
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2432
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2433
-				. ($length ? ' length="' . $length . '"' : '')
2431
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2432
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2433
+				. ($length ? ' length="'.$length.'"' : '')
2434 2434
 				. ' />';
2435 2435
 		}
2436 2436
 	}
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 		if (extraire_attribut($e, 'rel') == 'tag') {
2457 2457
 			$subjects .= '<dc:subject>'
2458 2458
 				. texte_backend(textebrut($e))
2459
-				. '</dc:subject>' . "\n";
2459
+				. '</dc:subject>'."\n";
2460 2460
 		}
2461 2461
 	}
2462 2462
 
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 	if (is_array($texte)) {
2493 2493
 		array_walk(
2494 2494
 			$texte,
2495
-			function(&$a, $key, $t){
2495
+			function(&$a, $key, $t) {
2496 2496
 				$a = extraire_balise($a, $t);
2497 2497
 			},
2498 2498
 			$tag
@@ -2536,7 +2536,7 @@  discard block
 block discarded – undo
2536 2536
 	if (is_array($texte)) {
2537 2537
 		array_walk(
2538 2538
 			$texte,
2539
-			function(&$a, $key, $t){
2539
+			function(&$a, $key, $t) {
2540 2540
 				$a = extraire_balises($a, $t);
2541 2541
 			},
2542 2542
 			$tag
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 		if ($fond != '404') {
2663 2663
 			$contexte = array_shift($p);
2664 2664
 			$contexte['page'] = $fond;
2665
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2665
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2666 2666
 		}
2667 2667
 	}
2668 2668
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2717,9 +2717,9 @@  discard block
 block discarded – undo
2717 2717
 			. '"'
2718 2718
 			. (is_null($val)
2719 2719
 				? ''
2720
-				: ' value="' . entites_html($val) . '"'
2720
+				: ' value="'.entites_html($val).'"'
2721 2721
 			)
2722
-			. ' type="hidden"' . "\n/>";
2722
+			. ' type="hidden"'."\n/>";
2723 2723
 	}
2724 2724
 
2725 2725
 	return join("", $hidden);
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 	return preg_replace_callback(
2831 2831
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2832 2832
 		function($x) use ($path) {
2833
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2833
+			return "url('".suivre_lien($path, $x[1])."')";
2834 2834
 		},
2835 2835
 		$contenu
2836 2836
 	);
@@ -2892,14 +2892,14 @@  discard block
 block discarded – undo
2892 2892
 	) {
2893 2893
 		$distant = true;
2894 2894
 		$cssf = parse_url($css);
2895
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2895
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2896 2896
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2897 2897
 	} else {
2898 2898
 		$distant = false;
2899 2899
 		$cssf = $css;
2900 2900
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2901 2901
 		//propose (rien a faire dans ce cas)
2902
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2902
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2903 2903
 		if (@file_exists($f)) {
2904 2904
 			return $f;
2905 2905
 		}
@@ -2909,7 +2909,7 @@  discard block
 block discarded – undo
2909 2909
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2910 2910
 	$f = $dir_var
2911 2911
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2912
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2912
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2913 2913
 
2914 2914
 	// la css peut etre distante (url absolue !)
2915 2915
 	if ($distant) {
@@ -2954,8 +2954,8 @@  discard block
 block discarded – undo
2954 2954
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2955 2955
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2956 2956
 			$css_direction = substr($css_direction, strlen($dir_var));
2957
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2958
-			$css_direction = "/@@@@@@/" . $css_direction;
2957
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2958
+			$css_direction = "/@@@@@@/".$css_direction;
2959 2959
 		}
2960 2960
 		$src[] = $regs[0][$k];
2961 2961
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
 
3005 3005
 	$f = basename($css, '.css');
3006 3006
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3007
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3007
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3008 3008
 		. '.css';
3009 3009
 
3010 3010
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3013,7 +3013,7 @@  discard block
 block discarded – undo
3013 3013
 
3014 3014
 	if ($url_absolue_css == $css) {
3015 3015
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3016
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3016
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3017 3017
 		) {
3018 3018
 			include_spip('inc/distant');
3019 3019
 			$contenu = recuperer_url($css);
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
 	$expression = str_replace("\/", "/", $expression);
3126 3126
 	$expression = str_replace("/", "\/", $expression);
3127 3127
 
3128
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3128
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3129 3129
 		if (isset($r[$capte])) {
3130 3130
 			return $r[$capte];
3131 3131
 		} else {
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 	$expression = str_replace("\/", "/", $expression);
3164 3164
 	$expression = str_replace("/", "\/", $expression);
3165 3165
 
3166
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3166
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3167 3167
 }
3168 3168
 
3169 3169
 
@@ -3182,7 +3182,7 @@  discard block
 block discarded – undo
3182 3182
 function traiter_doublons_documents(&$doublons, $letexte) {
3183 3183
 
3184 3184
 	// Verifier dans le texte & les notes (pas beau, helas)
3185
-	$t = $letexte . $GLOBALS['les_notes'];
3185
+	$t = $letexte.$GLOBALS['les_notes'];
3186 3186
 
3187 3187
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3188 3188
 		and preg_match_all(
@@ -3192,7 +3192,7 @@  discard block
 block discarded – undo
3192 3192
 		if (!isset($doublons['documents'])) {
3193 3193
 			$doublons['documents'] = "";
3194 3194
 		}
3195
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3195
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3196 3196
 	}
3197 3197
 
3198 3198
 	return $letexte;
@@ -3249,7 +3249,7 @@  discard block
 block discarded – undo
3249 3249
 	if ($env) {
3250 3250
 		foreach ($env as $i => $j) {
3251 3251
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3252
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3252
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3253 3253
 			}
3254 3254
 		}
3255 3255
 	}
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
 	if ($env) {
3289 3289
 		foreach ($env as $i => $j) {
3290 3290
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3291
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3291
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3292 3292
 			}
3293 3293
 		}
3294 3294
 	}
@@ -3361,9 +3361,9 @@  discard block
 block discarded – undo
3361 3361
 	// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3362 3362
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3363 3363
 	if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3364
-	  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3364
+	  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3365 3365
 	  and file_exists($variante_svg_generique)) {
3366
-		if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3366
+		if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) {
3367 3367
 			$img_file = $variante_svg_size;
3368 3368
 		}
3369 3369
 		else {
@@ -3394,13 +3394,13 @@  discard block
 block discarded – undo
3394 3394
 
3395 3395
 	$img_file = $img;
3396 3396
 	if ($p = strpos($img_file, '?')) {
3397
-		$img_file = substr($img_file,0, $p);
3397
+		$img_file = substr($img_file, 0, $p);
3398 3398
 	}
3399 3399
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3400 3400
 		$img_file = chemin_image($img);
3401 3401
 	}
3402 3402
 	else {
3403
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3403
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3404 3404
 			$img_file = http_img_variante_svg_si_possible($img_file);
3405 3405
 		}
3406 3406
 	}
@@ -3420,7 +3420,7 @@  discard block
 block discarded – undo
3420 3420
 				return "";
3421 3421
 			}
3422 3422
 		}
3423
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3423
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3424 3424
 	}
3425 3425
 
3426 3426
 	if (file_exists($img_file)) {
@@ -3429,15 +3429,15 @@  discard block
 block discarded – undo
3429 3429
 	if ($alt === false) {
3430 3430
 		$alt = '';
3431 3431
 	}
3432
-	elseif($alt or $alt==='') {
3432
+	elseif ($alt or $alt === '') {
3433 3433
 		$alt = " alt='".attribut_html($alt)."'";
3434 3434
 	}
3435 3435
 	else {
3436 3436
 		$alt = " alt='".attribut_html($title)."'";
3437 3437
 	}
3438 3438
 	return "<img src='$img_file'$alt"
3439
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3440
-	. " " . ltrim($atts)
3439
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3440
+	. " ".ltrim($atts)
3441 3441
 	. " />";
3442 3442
 }
3443 3443
 
@@ -3449,12 +3449,12 @@  discard block
 block discarded – undo
3449 3449
  * @param string $size
3450 3450
  * @return string
3451 3451
  */
3452
-function http_style_background($img, $att = '', $size=null) {
3453
-	if ($size and is_numeric($size)){
3454
-		$size = trim($size) . "px";
3452
+function http_style_background($img, $att = '', $size = null) {
3453
+	if ($size and is_numeric($size)) {
3454
+		$size = trim($size)."px";
3455 3455
 	}
3456
-	return " style='background" .
3457
-		($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
3456
+	return " style='background".
3457
+		($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";"
3458 3458
 		. ($size ? "background-size:{$size};" : '')
3459 3459
 		. "'";
3460 3460
 }
@@ -3480,7 +3480,7 @@  discard block
 block discarded – undo
3480 3480
 			$args[] = $maybe_size;
3481 3481
 			$maybe_size = null;
3482 3482
 		}
3483
-		while (count($args)<2) {
3483
+		while (count($args) < 2) {
3484 3484
 			$args[] = null; // default alt or class
3485 3485
 		}
3486 3486
 		$args[] = $maybe_size;
@@ -3490,7 +3490,7 @@  discard block
 block discarded – undo
3490 3490
 
3491 3491
 function helper_filtre_balise_img_svg_size($img, $size) {
3492 3492
 	// si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite
3493
-	if (strpos($size, '@') === 0 and substr($size,-1) === 'x') {
3493
+	if (strpos($size, '@') === 0 and substr($size, -1) === 'x') {
3494 3494
 		$coef = floatval(substr($size, 1, -1));
3495 3495
 		list($h, $w) = taille_image($img);
3496 3496
 		$height = intval(round($h / $coef));
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
  * @return string
3546 3546
  *     Code HTML de la balise IMG
3547 3547
  */
3548
-function filtre_balise_img_dist($img, $alt = '', $class = null, $size=null) {
3548
+function filtre_balise_img_dist($img, $alt = '', $class = null, $size = null) {
3549 3549
 
3550 3550
 	list($alt, $class, $size) = helper_filtre_balise_img_svg_arguments($alt, $class, $size);
3551 3551
 
@@ -3564,7 +3564,7 @@  discard block
 block discarded – undo
3564 3564
 		}
3565 3565
 	}
3566 3566
 	else {
3567
-		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3567
+		$img = http_img_pack($img, $alt, $class ? " class='".attribut_html($class)."'" : '', '',
3568 3568
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3569 3569
 		if (is_null($alt)) {
3570 3570
 			$img = vider_attribut($img, 'alt');
@@ -3610,16 +3610,16 @@  discard block
 block discarded – undo
3610 3610
  * @return string
3611 3611
  *     Code HTML de la balise SVG
3612 3612
  */
3613
-function filtre_balise_svg_dist($img, $alt = '', $class = null, $size=null) {
3613
+function filtre_balise_svg_dist($img, $alt = '', $class = null, $size = null) {
3614 3614
 
3615 3615
 	$img = trim($img);
3616 3616
 	$img_file = $img;
3617
-	if (strpos($img, '<svg') === false){
3618
-		if ($p = strpos($img_file, '?')){
3617
+	if (strpos($img, '<svg') === false) {
3618
+		if ($p = strpos($img_file, '?')) {
3619 3619
 			$img_file = substr($img_file, 0, $p);
3620 3620
 		}
3621 3621
 
3622
-		if (!$img_file or !$svg = file_get_contents($img_file)){
3622
+		if (!$img_file or !$svg = file_get_contents($img_file)) {
3623 3623
 			return '';
3624 3624
 		}
3625 3625
 	}
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
 	$balise_svg_source = $balise_svg;
3635 3635
 
3636 3636
 	// entete XML à supprimer
3637
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3637
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3638 3638
 
3639 3639
 	// IE est toujours mon ami
3640 3640
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3650,11 +3650,11 @@  discard block
 block discarded – undo
3650 3650
 	}
3651 3651
 
3652 3652
 	// regler le alt
3653
-	if ($alt){
3653
+	if ($alt) {
3654 3654
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3655
-		$id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4);
3655
+		$id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4);
3656 3656
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3657
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3657
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3658 3658
 		$balise_svg .= $title;
3659 3659
 	}
3660 3660
 	else {
@@ -3701,7 +3701,7 @@  discard block
 block discarded – undo
3701 3701
 	$texte = '';
3702 3702
 	if (is_array($tableau)) {
3703 3703
 		foreach ($tableau as $k => $v) {
3704
-			$res = recuperer_fond('modeles/' . $modele,
3704
+			$res = recuperer_fond('modeles/'.$modele,
3705 3705
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3706 3706
 			);
3707 3707
 			$texte .= $res;
@@ -3878,7 +3878,7 @@  discard block
 block discarded – undo
3878 3878
 	}
3879 3879
 
3880 3880
 	$c = serialize($c);
3881
-	$cle = calculer_cle_action($form . $c);
3881
+	$cle = calculer_cle_action($form.$c);
3882 3882
 	$c = "$cle:$c";
3883 3883
 
3884 3884
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3935,15 +3935,15 @@  discard block
 block discarded – undo
3935 3935
 	}
3936 3936
 	// toujours encoder l'url source dans le bloc ajax
3937 3937
 	$r = self();
3938
-	$r = ' data-origin="' . $r . '"';
3938
+	$r = ' data-origin="'.$r.'"';
3939 3939
 	$class = 'ajaxbloc';
3940 3940
 	if ($ajaxid and is_string($ajaxid)) {
3941 3941
 		// ajaxid est normalement conforme a un nom de classe css
3942 3942
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3943
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3943
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3944 3944
 	}
3945 3945
 
3946
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3946
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3947 3947
 }
3948 3948
 
3949 3949
 /**
@@ -3982,11 +3982,11 @@  discard block
 block discarded – undo
3982 3982
 	// extraire la signature en debut de contexte
3983 3983
 	// et la verifier avant de deserializer
3984 3984
 	// format : signature:donneesserializees
3985
-	if ($p = strpos($c,":")){
3986
-		$cle = substr($c,0,$p);
3987
-		$c = substr($c,$p+1);
3985
+	if ($p = strpos($c, ":")) {
3986
+		$cle = substr($c, 0, $p);
3987
+		$c = substr($c, $p + 1);
3988 3988
 
3989
-		if ($cle == calculer_cle_action($form . $c)) {
3989
+		if ($cle == calculer_cle_action($form.$c)) {
3990 3990
 			$env = @unserialize($c);
3991 3991
 			return $env;
3992 3992
 		}
@@ -4092,24 +4092,24 @@  discard block
 block discarded – undo
4092 4092
 		$att = "";
4093 4093
 		// si $on passe la balise et optionnelement une ou ++classe
4094 4094
 		// a.active span.selected.active etc....
4095
-		if (is_string($on) and (strncmp($on, 'a', 1)==0 or strncmp($on, 'span', 4)==0 or strncmp($on, 'strong', 6)==0)){
4095
+		if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) {
4096 4096
 			$on = explode(".", $on);
4097 4097
 			// on verifie que c'est exactement une des 3 balises a, span ou strong
4098
-			if (in_array(reset($on), array('a', 'span', 'strong'))){
4098
+			if (in_array(reset($on), array('a', 'span', 'strong'))) {
4099 4099
 				$bal = array_shift($on);
4100 4100
 				$class = implode(" ", $on);
4101
-				if ($bal=="a"){
4101
+				if ($bal == "a") {
4102 4102
 					$att = 'href="#" ';
4103 4103
 				}
4104 4104
 			}
4105 4105
 		}
4106
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4106
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4107 4107
 	} else {
4108 4108
 		$bal = 'a';
4109 4109
 		$att = "href='$url'"
4110
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4111
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4112
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4110
+			. ($title ? " title='".attribut_html($title)."'" : '')
4111
+			. ($class ? " class='".attribut_html($class)."'" : '')
4112
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4113 4113
 			. $evt;
4114 4114
 	}
4115 4115
 	if ($libelle === null) {
@@ -4244,7 +4244,7 @@  discard block
 block discarded – undo
4244 4244
 
4245 4245
 	// Icône
4246 4246
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4247
-	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>";
4247
+	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>";
4248 4248
 
4249 4249
 	// Markup final
4250 4250
 	if ($type == 'lien') {
@@ -4519,20 +4519,20 @@  discard block
 block discarded – undo
4519 4519
 		$class_form = 'ajax';
4520 4520
 		$class = str_replace('ajax', '', $class);
4521 4521
 	}
4522
-	$class_btn = 'submit ' . trim($class);
4522
+	$class_btn = 'submit '.trim($class);
4523 4523
 
4524 4524
 	if ($confirm) {
4525
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4525
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4526 4526
 		if ($callback) {
4527 4527
 			$callback = "$confirm?($callback):false";
4528 4528
 		} else {
4529 4529
 			$callback = $confirm;
4530 4530
 		}
4531 4531
 	}
4532
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4532
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4533 4533
 	$title = $title ? " title='$title'" : '';
4534 4534
 
4535
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4535
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4536 4536
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4537 4537
 }
4538 4538
 
@@ -4596,14 +4596,14 @@  discard block
 block discarded – undo
4596 4596
 		$champ_titre = "";
4597 4597
 		if ($demande_titre) {
4598 4598
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4599
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4599
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4600 4600
 		}
4601 4601
 		include_spip('base/abstract_sql');
4602 4602
 		include_spip('base/connect_sql');
4603 4603
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4604
-			'*' . $champ_titre,
4604
+			'*'.$champ_titre,
4605 4605
 			$desc['table_sql'],
4606
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4606
+			id_table_objet($type_objet).' = '.intval($id_objet)
4607 4607
 		);
4608 4608
 
4609 4609
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4677,8 +4677,7 @@  discard block
 block discarded – undo
4677 4677
 	if (isset($ligne_sql['chapo'])) {
4678 4678
 		$chapo = $ligne_sql['chapo'];
4679 4679
 		$texte = strlen($descriptif) ?
4680
-			'' :
4681
-			"$chapo \n\n $texte";
4680
+			'' : "$chapo \n\n $texte";
4682 4681
 	}
4683 4682
 
4684 4683
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4745,7 +4744,7 @@  discard block
 block discarded – undo
4745 4744
 		return $texte;
4746 4745
 	}
4747 4746
 
4748
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4747
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4749 4748
 
4750 4749
 	// Fournir $connect et $Pile[0] au traitement si besoin
4751 4750
 	$Pile = array(0 => $env);
@@ -4779,7 +4778,7 @@  discard block
 block discarded – undo
4779 4778
 	}
4780 4779
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4781 4780
 
4782
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4781
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4783 4782
 }
4784 4783
 
4785 4784
 
@@ -4798,10 +4797,10 @@  discard block
 block discarded – undo
4798 4797
 function wrap($texte, $wrap) {
4799 4798
 	$balises = extraire_balises($wrap);
4800 4799
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4801
-		$texte = $wrap . $texte;
4800
+		$texte = $wrap.$texte;
4802 4801
 		$regs = array_reverse($regs[1]);
4803
-		$wrap = "</" . implode("></", $regs) . ">";
4804
-		$texte = $texte . $wrap;
4802
+		$wrap = "</".implode("></", $regs).">";
4803
+		$texte = $texte.$wrap;
4805 4804
 	}
4806 4805
 
4807 4806
 	return $texte;
@@ -4832,7 +4831,7 @@  discard block
 block discarded – undo
4832 4831
 
4833 4832
 	// caster $u en array si besoin
4834 4833
 	if (is_object($u)) {
4835
-		$u = (array)$u;
4834
+		$u = (array) $u;
4836 4835
 	}
4837 4836
 
4838 4837
 	if (is_array($u)) {
@@ -4853,7 +4852,7 @@  discard block
 block discarded – undo
4853 4852
 		// sinon on passe a la ligne et on indente
4854 4853
 		$i_str = str_pad("", $indent, " ");
4855 4854
 		foreach ($u as $k => $v) {
4856
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4855
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4857 4856
 		}
4858 4857
 
4859 4858
 		return $out;
@@ -4906,8 +4905,8 @@  discard block
 block discarded – undo
4906 4905
  * @param string $class
4907 4906
  * @return string
4908 4907
  */
4909
-function objet_icone($objet, $taille = 24, $class='') {
4910
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4908
+function objet_icone($objet, $taille = 24, $class = '') {
4909
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4911 4910
 	$icone = chemin_image($icone);
4912 4911
 	$balise_img = charger_filtre('balise_img');
4913 4912
 
@@ -4931,12 +4930,12 @@  discard block
 block discarded – undo
4931 4930
  * @param array $options
4932 4931
  * @return string
4933 4932
  */
4934
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4935
-	$chaine = explode(':',$chaine);
4936
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4933
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4934
+	$chaine = explode(':', $chaine);
4935
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4937 4936
 		return $t;
4938 4937
 	}
4939
-	$chaine = implode(':',$chaine);
4938
+	$chaine = implode(':', $chaine);
4940 4939
 	return _T($chaine, $args, $options);
4941 4940
 }
4942 4941
 
@@ -4998,7 +4997,7 @@  discard block
 block discarded – undo
4998 4997
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4999 4998
 
5000 4999
 	// calculer le nom de la css
5001
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
5000
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
5002 5001
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
5003 5002
 	$contexte_implicite = calculer_contexte_implicite();
5004 5003
 
@@ -5006,22 +5005,22 @@  discard block
 block discarded – undo
5006 5005
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
5007 5006
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5008 5007
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
5009
-		$hash = md5($contexte_implicite['host'] . '::'. $cache);
5008
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
5010 5009
 	}
5011 5010
 	else {
5012 5011
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5013 5012
 		ksort($contexte);
5014
-		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
5013
+		$hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect);
5015 5014
 	}
5016
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
5015
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5017 5016
 
5018 5017
 	// mettre a jour le fichier si il n'existe pas
5019 5018
 	// ou trop ancien
5020 5019
 	// le dernier fichier produit est toujours suffixe par .last
5021 5020
 	// et recopie sur le fichier cible uniquement si il change
5022 5021
 	if (!file_exists($filename)
5023
-		or !file_exists($filename . ".last")
5024
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
5022
+		or !file_exists($filename.".last")
5023
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
5025 5024
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5026 5025
 	) {
5027 5026
 		$contenu = $cache['texte'];
@@ -5040,10 +5039,10 @@  discard block
 block discarded – undo
5040 5039
 			}
5041 5040
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5042 5041
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5043
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5042
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5044 5043
 		}
5045 5044
 		// et ecrire le fichier si il change
5046
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5045
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5047 5046
 	}
5048 5047
 
5049 5048
 	return timestamp($filename);
@@ -5238,11 +5237,11 @@  discard block
 block discarded – undo
5238 5237
 function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) {
5239 5238
 	$l = strlen($passe);
5240 5239
 
5241
-	if ($l<=8 or !$afficher_partiellement){
5240
+	if ($l <= 8 or !$afficher_partiellement) {
5242 5241
 		if (!$l) {
5243 5242
 			return ''; // montrer qu'il y a pas de mot de passe si il y en a pas
5244 5243
 		}
5245
-		return str_pad('',$afficher_partiellement ? $l : 16,'*');
5244
+		return str_pad('', $afficher_partiellement ? $l : 16, '*');
5246 5245
 	}
5247 5246
 
5248 5247
 	if (is_null($portion_pourcent)) {
@@ -5256,11 +5255,11 @@  discard block
 block discarded – undo
5256 5255
 	}
5257 5256
 	$e = intval(ceil($l * $portion_pourcent / 100 / 2));
5258 5257
 	$e = max($e, 0);
5259
-	$mid = str_pad('',$l-2*$e,'*');
5260
-	if ($e>0 and strlen($mid)>8){
5258
+	$mid = str_pad('', $l - 2 * $e, '*');
5259
+	if ($e > 0 and strlen($mid) > 8) {
5261 5260
 		$mid = '***...***';
5262 5261
 	}
5263
-	return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : '');
5262
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5264 5263
 }
5265 5264
 
5266 5265
 
@@ -5282,9 +5281,9 @@  discard block
 block discarded – undo
5282 5281
 function identifiant_slug($texte, $type = '', $options = array()) {
5283 5282
 
5284 5283
 	$original = $texte;
5285
-	$separateur = (isset($options['separateur'])?$options['separateur']:'_');
5286
-	$longueur_maxi = (isset($options['longueur_maxi'])?$options['longueur_maxi']:60);
5287
-	$longueur_mini = (isset($options['longueur_mini'])?$options['longueur_mini']:0);
5284
+	$separateur = (isset($options['separateur']) ? $options['separateur'] : '_');
5285
+	$longueur_maxi = (isset($options['longueur_maxi']) ? $options['longueur_maxi'] : 60);
5286
+	$longueur_mini = (isset($options['longueur_mini']) ? $options['longueur_mini'] : 0);
5288 5287
 
5289 5288
 	if (!function_exists('translitteration')) {
5290 5289
 		include_spip('inc/charsets');
@@ -5326,15 +5325,15 @@  discard block
 block discarded – undo
5326 5325
 			}
5327 5326
 	}
5328 5327
 
5329
-	if (strlen($texte)>$longueur_maxi) {
5328
+	if (strlen($texte) > $longueur_maxi) {
5330 5329
 		$texte = substr($texte, 0, $longueur_maxi);
5331 5330
 	}
5332 5331
 
5333 5332
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5334 5333
 		if (preg_match(',^\d,', $texte)) {
5335
-			$texte = ($type ? substr($type,0,1) : "s") . $texte;
5334
+			$texte = ($type ? substr($type, 0, 1) : "s").$texte;
5336 5335
 		}
5337
-		$texte .= $separateur . md5($original);
5336
+		$texte .= $separateur.md5($original);
5338 5337
 		$texte = substr($texte, 0, $longueur_mini);
5339 5338
 	}
5340 5339
 
Please login to merge, or discard this patch.
ecrire/inc_version.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
50 50
 
51 51
 /** chemin absolu vers la racine */
52
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
52
+define('_ROOT_RACINE', dirname(__DIR__).'/');
53 53
 /** chemin absolu vers le repertoire de travail */
54
-define('_ROOT_CWD', getcwd() . '/');
54
+define('_ROOT_CWD', getcwd().'/');
55 55
 /** chemin absolu vers ecrire */
56
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
56
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
57 57
 
58 58
 // Icones
59 59
 if (!defined('_NOM_IMG_PACK')) {
@@ -61,17 +61,17 @@  discard block
 block discarded – undo
61 61
 	define('_NOM_IMG_PACK', 'images/');
62 62
 }
63 63
 /** le chemin http (relatif) vers les images standard */
64
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
64
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
65 65
 
66 66
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
67
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
67
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
68 68
 
69 69
 if (!defined('_JAVASCRIPT')) {
70 70
 	/** Nom du repertoire des  bibliotheques JavaScript */
71 71
 	define('_JAVASCRIPT', 'javascript/');
72 72
 } // utilisable avec #CHEMIN et find_in_path
73 73
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
74
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
74
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
75 75
 
76 76
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
77 77
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // Son emplacement absolu si on le trouve
104
-if (@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
105
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
104
+if (@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
105
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
106 106
 ) {
107 107
 	/** Emplacement absolu du fichier d'option */
108 108
 	define('_FILE_OPTIONS', $f);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 // Inclure l'ecran de securite
127 127
 if (!defined('_ECRAN_SECURITE')
128
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
128
+	and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
129 129
 ) {
130 130
 	include $f;
131 131
 }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			. 'MSIE 6\.0|'
145 145
 			// UA plus cibles
146 146
 			. '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'
147
-			. ',i', (string)$_SERVER['HTTP_USER_AGENT'])
147
+			. ',i', (string) $_SERVER['HTTP_USER_AGENT'])
148 148
 	);
149 149
 }
150 150
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 //
275 275
 // Prendre en compte les entetes HTTP_X_FORWARDED_XX
276 276
 //
277
-if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
277
+if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
278 278
 	if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
279 279
 		$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
280 280
 	}
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
 		$_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
283 283
 	}
284 284
 }
285
-if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])){
286
-	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
285
+if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
286
+	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])) {
287 287
 		$_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
288
-		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
288
+		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
289 289
 			$_SERVER['HTTPS'] = 'on';
290 290
 			if (isset($_SERVER['REQUEST_SCHEME'])) {
291 291
 				$_SERVER['REQUEST_SCHEME'] = 'https';
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 		}
294 294
 	}
295 295
 	$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
296
-	if (strpos($host,',')!==false){
297
-		$h = explode(',',$host);
296
+	if (strpos($host, ',') !== false) {
297
+		$h = explode(',', $host);
298 298
 		$host = trim(reset($h));
299 299
 	}
300 300
 	// securite sur le contenu de l'entete
@@ -306,12 +306,12 @@  discard block
 block discarded – undo
306 306
 //
307 307
 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
308 308
 	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
309
-	if (strpos($ip,',')!==false){
310
-		$ip = explode(',',$ip);
309
+	if (strpos($ip, ',') !== false) {
310
+		$ip = explode(',', $ip);
311 311
 		$ip = reset($ip);
312 312
 	}
313 313
 	// ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
314
-	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
314
+	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] === '127.0.0.1') {
315 315
 		$_SERVER['REMOTE_ADDR'] = $ip;
316 316
 	}
317 317
 }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 # la matrice standard (fichiers definissant les fonctions a inclure)
385 385
 $spip_matrice = array();
386 386
 # les plugins a activer
387
-$plugins = array();  // voir le contenu du repertoire /plugins/
387
+$plugins = array(); // voir le contenu du repertoire /plugins/
388 388
 # les surcharges de include_spip()
389 389
 $surcharges = array(); // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
390 390
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
 // cette version dev accepte tous les plugins compatible avec la version ci-dessous
440 440
 // a supprimer en phase beta/rc/release
441
-define('_DEV_VERSION_SPIP_COMPAT',"4.0.99");
441
+define('_DEV_VERSION_SPIP_COMPAT', "4.0.99");
442 442
 // version des signatures de fonctions PHP
443 443
 // (= date de leur derniere modif cassant la compatibilite et/ou necessitant un recalcul des squelettes)
444 444
 $spip_version_code = 20210708;
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
 //
463 463
 // Charger les fonctions liees aux serveurs Http et Sql.
464 464
 //
465
-require_once _ROOT_RESTREINT . 'inc/utils.php';
466
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
465
+require_once _ROOT_RESTREINT.'inc/utils.php';
466
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
467 467
 
468 468
 // Definition personnelles eventuelles
469 469
 
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 // ===> on execute en neutralisant les messages d'erreur
487 487
 
488 488
 spip_initialisation_core(
489
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
490
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
491
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
492
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
489
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
490
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
491
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
492
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
493 493
 );
494 494
 
495 495
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 		// Si on est dans le site public, dire que qq s'en occupe
545 545
 		include_spip('inc/minipres');
546 546
 		utiliser_langue_visiteur();
547
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>", array('status' => 503));
547
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte')."</p>", array('status' => 503));
548 548
 		exit;
549 549
 	}
550 550
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 	if (!function_exists('session_set')) {
559 559
 		include_spip('inc/session');
560 560
 	}
561
-	$t = preg_replace(",\W,","_", $t);
561
+	$t = preg_replace(",\W,", "_", $t);
562 562
 	if ($v = _request($t)) {
563 563
 		session_set($t, $v);
564 564
 	}
@@ -582,12 +582,12 @@  discard block
 block discarded – undo
582 582
 	}
583 583
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
584 584
 		include_spip('inc/filtres_mini');
585
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . "config.txt"));
585
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR."config.txt"));
586 586
 	} else {
587 587
 		// header minimal
588
-		header(_HEADER_COMPOSED_BY . " @ www.spip.net");
588
+		header(_HEADER_COMPOSED_BY." @ www.spip.net");
589 589
 	}
590 590
 }
591 591
 
592 592
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
593
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
593
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.
ecrire/plugins/get_infos.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	static $filecache = '';
38 38
 
39 39
 	if ($cache === '') {
40
-		$filecache = _DIR_TMP . "plugin_xml_cache.gz";
40
+		$filecache = _DIR_TMP."plugin_xml_cache.gz";
41 41
 		if (is_file($filecache)) {
42 42
 			lire_fichier($filecache, $contenu);
43 43
 			$cache = unserialize($contenu);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	if (isset($ret['prefix']) and $ret['prefix'] == 'spip') {
128 128
 		$ret['procure']['php'] = array('nom' => 'php', 'version' => phpversion());
129 129
 		foreach (get_loaded_extensions() as $ext) {
130
-			$ret['procure']['php:' . $ext] = array('nom' => 'php:' . $ext, 'version' => phpversion($ext));
130
+			$ret['procure']['php:'.$ext] = array('nom' => 'php:'.$ext, 'version' => phpversion($ext));
131 131
 		}
132 132
 	}
133 133
 	$diff = ($ret != $pcache);
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	// celle du texte) et public (spip_lang est la langue du texte)
45 45
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
46 46
 
47
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
47
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
48 48
 	if ($dir == 'rtl') {
49 49
 		$p .= '_rtl';
50 50
 	}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 }
68 68
 
69 69
 if (!defined('_BALISES_BLOCS_REGEXP')) {
70
-	define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
70
+	define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
71 71
 }
72 72
 
73 73
 //
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	// Tester si on echappe en span ou en div
87 87
 	if (is_null($mode) or !in_array($mode, array('div', 'span'))) {
88
-		$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span';
88
+		$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span';
89 89
 	}
90 90
 
91 91
 	// Decouper en morceaux, base64 a des probleme selon la taille de la pile
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	// echapper les < dans <code>
118 118
 	// on utilise _PROTEGE_BLOCS pour simplifier le code et la maintenance, mais on est interesse que par <code>
119 119
 	if (strpos($pre, "<") !== false
120
-		and preg_match_all(_PROTEGE_BLOCS, $pre, $matches, PREG_SET_ORDER)){
120
+		and preg_match_all(_PROTEGE_BLOCS, $pre, $matches, PREG_SET_ORDER)) {
121 121
 
122
-		foreach ($matches as $m){
123
-			if ($m[1]==='code'){
124
-				$code = "<code" . $m[2] . ">" . spip_htmlspecialchars($m[3]) . "</code>";
122
+		foreach ($matches as $m) {
123
+			if ($m[1] === 'code') {
124
+				$code = "<code".$m[2].">".spip_htmlspecialchars($m[3])."</code>";
125 125
 				$pre = str_replace($m[0], $code, $pre);
126 126
 			}
127 127
 		}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 // Echapper les <code>...</ code>
133 133
 // https://code.spip.net/@traiter_echap_code_dist
134 134
 function traiter_echap_code_dist($regs) {
135
-	list(, , $att, $corps) = $regs;
135
+	list(,, $att, $corps) = $regs;
136 136
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
137 137
 
138 138
 	// ne pas mettre le <div...> s'il n'y a qu'une ligne
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 		$echap = nl2br($echap);
144 144
 		$echap = "<div style='text-align: left;' "
145 145
 			. "class='spip_code' dir='ltr'><code$att>"
146
-			. $echap . "</code></div>";
146
+			. $echap."</code></div>";
147 147
 	} else {
148
-		$echap = "<code$att class='spip_code' dir='ltr'>" . $echap . "</code>";
148
+		$echap = "<code$att class='spip_code' dir='ltr'>".$echap."</code>";
149 149
 	}
150 150
 
151 151
 	$echap = str_replace("\t", "&nbsp; &nbsp; &nbsp; &nbsp; ", $echap);
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 				$echap = $regs[0];
235 235
 			} // sinon les traiter selon le cas
236 236
 			else {
237
-				if (function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1]))
238
-				  or function_exists($f = $f . '_dist')) {
237
+				if (function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1]))
238
+				  or function_exists($f = $f.'_dist')) {
239 239
 					$echap = $f($regs);
240 240
 				}
241 241
 			}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	// (derogatoire car on ne peut pas faire passer < ? ... ? >
255 255
 	// dans une callback autonommee
256 256
 	if (strpos($preg ? $preg : _PROTEGE_BLOCS, 'script') !== false) {
257
-		if (strpos($letexte, "<" . "?") !== false and preg_match_all(',<[?].*($|[?]>),UisS',
257
+		if (strpos($letexte, "<"."?") !== false and preg_match_all(',<[?].*($|[?]>),UisS',
258 258
 				$letexte, $matches, PREG_SET_ORDER)
259 259
 		) {
260 260
 			foreach ($matches as $regs) {
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		$max_prof = 5;
280 280
 		while (strpos($letexte, "<") !== false
281 281
 			and
282
-			preg_match_all(',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS',
282
+			preg_match_all(',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS',
283 283
 				$letexte, $regs, PREG_SET_ORDER)
284 284
 			and $max_prof--) {
285 285
 			foreach ($regs as $reg) {
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 					}
293 293
 				}
294 294
 				if ($at) {
295
-					$rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>';
295
+					$rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>';
296 296
 					foreach ($at as $attr => $a) {
297 297
 						$rempl = inserer_attribut($rempl, $attr, $a);
298 298
 					}
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 	$texte = nettoyer_raccourcis_typo($texte);
372 372
 
373 373
 	// balises de sauts de ligne et paragraphe
374
-	$texte = preg_replace("/<p( [^>]*)?" . ">/", "\r", $texte);
375
-	$texte = preg_replace("/<br( [^>]*)?" . ">/", "\n", $texte);
374
+	$texte = preg_replace("/<p( [^>]*)?".">/", "\r", $texte);
375
+	$texte = preg_replace("/<br( [^>]*)?".">/", "\n", $texte);
376 376
 
377 377
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
378 378
 	$texte = str_replace("\n\n", "\r", $texte);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	// supprimer les tags
381 381
 	$texte = supprimer_tags($texte);
382 382
 	$texte = trim(str_replace("\n", " ", $texte));
383
-	$texte .= "\n";  // marquer la fin
383
+	$texte .= "\n"; // marquer la fin
384 384
 
385 385
 	// corriger la longueur de coupe
386 386
 	// en fonction de la presence de caracteres utf
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	// couper au mot precedent
396 396
 	$long = spip_substr($texte, 0, max($taille - 4, 1));
397 397
 	$u = $GLOBALS['meta']['pcre_u'];
398
-	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
398
+	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
399 399
 	if (is_null($suite)) {
400 400
 		$suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : '&nbsp;(...)');
401 401
 	}
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	if (spip_strlen($court) < max(0.75 * $taille, 2)) {
406 406
 		$points = '';
407 407
 		$long = spip_substr($texte, 0, $taille);
408
-		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
408
+		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
409 409
 		// encore trop court ? couper au caractere
410 410
 		if (spip_strlen($texte) < 0.75 * $taille) {
411 411
 			$texte = $long;
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	// supprimer l'eventuelle entite finale mal coupee
426 426
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
427 427
 
428
-	return quote_amp(trim($texte)) . $points;
428
+	return quote_amp(trim($texte)).$points;
429 429
 }
430 430
 
431 431
 
@@ -438,16 +438,16 @@  discard block
 block discarded – undo
438 438
 				define('_PROTEGE_JS_MODELES', creer_uniqid());
439 439
 			}
440 440
 			foreach ($r as $regs) {
441
-				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
441
+				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t);
442 442
 			}
443 443
 		}
444
-		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
444
+		if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) {
445 445
 			if (!defined('_PROTEGE_PHP_MODELES')) {
446 446
 				include_spip('inc/acces');
447 447
 				define('_PROTEGE_PHP_MODELES', creer_uniqid());
448 448
 			}
449 449
 			foreach ($r as $regs) {
450
-				$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t);
450
+				$t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t);
451 451
 			}
452 452
 		}
453 453
 	}
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
  * @param bool $strict
483 483
  * @return string
484 484
  */
485
-function echapper_html_suspect($texte, $strict=true) {
485
+function echapper_html_suspect($texte, $strict = true) {
486 486
 	static $echapper_html_suspect;
487 487
 	if (!$texte or !is_string($texte)) {
488 488
 		return $texte;
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 	// quand c'est du texte qui passe par propre on est plus coulant tant qu'il y a pas d'attribut du type onxxx=
505 505
 	// car sinon on declenche sur les modeles ou ressources
506 506
 	if (!$strict and
507
-	  (strpos($texte,'on') === false or !preg_match(",<\w+.*\bon\w+\s*=,UimsS", $texte))
508
-	  ){
507
+	  (strpos($texte, 'on') === false or !preg_match(",<\w+.*\bon\w+\s*=,UimsS", $texte))
508
+	  ) {
509 509
 		return $texte;
510 510
 	}
511 511
 
@@ -587,9 +587,9 @@  discard block
 block discarded – undo
587 587
  **/
588 588
 function supprime_img($letexte, $message = null) {
589 589
 	if ($message === null) {
590
-		$message = '(' . _T('img_indisponible') . ')';
590
+		$message = '('._T('img_indisponible').')';
591 591
 	}
592 592
 
593
-	return preg_replace(',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
593
+	return preg_replace(',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
594 594
 		$message, $letexte);
595 595
 }
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
24 24
 if (!defined('_DIR_PLUGINS_AUTO')) {
25
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
25
+	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/');
26 26
 }
27 27
 
28 28
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 				if ($dir) {
371 371
 					$dir .= "/";
372 372
 				}
373
-				$dir .= "procure:" . $procure['nom'];
373
+				$dir .= "procure:".$procure['nom'];
374 374
 
375 375
 				$procure['etat'] = '?';
376 376
 				$procure['dir_type'] = $resume['dir_type'];
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		$plug = $resume['dir'];
552 552
 		$k = $infos[$dir_type][$plug];
553 553
 
554
-		$plug = constant($dir_type) . $plug;
554
+		$plug = constant($dir_type).$plug;
555 555
 		if (!isset($msg[$p])) {
556 556
 			if (isset($resume['erreur']) and $resume['erreur']) {
557 557
 				$msg[$p] = array($resume['erreur']);
@@ -594,10 +594,10 @@  discard block
 block discarded – undo
594 594
 		$list = $raw ? array() : $GLOBALS['meta']['plugin_erreur_activation'];
595 595
 	} elseif (!$raw) {
596 596
 		foreach ($list as $plug => $msg) {
597
-			$list[$plug] = "<li>" . _T('plugin_impossible_activer', array('plugin' => $plug))
598
-				. "<ul><li>" . implode("</li><li>", $msg) . "</li></ul></li>";
597
+			$list[$plug] = "<li>"._T('plugin_impossible_activer', array('plugin' => $plug))
598
+				. "<ul><li>".implode("</li><li>", $msg)."</li></ul></li>";
599 599
 		}
600
-		$list = "<ul>" . join("\n", $list) . "</ul>";
600
+		$list = "<ul>".join("\n", $list)."</ul>";
601 601
 	}
602 602
 	if ($raz) {
603 603
 		effacer_meta('plugin_erreur_activation');
@@ -711,13 +711,13 @@  discard block
 block discarded – undo
711 711
 			if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) {
712 712
 				return _T("plugin_${balise}_${type}", array(
713 713
 					'plugin' => $nom,
714
-					'version' => ' &ge; ' . $minimum
714
+					'version' => ' &ge; '.$minimum
715 715
 				));
716 716
 			}
717 717
 			if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) {
718 718
 				return _T("plugin_${balise}_${type}", array(
719 719
 					'plugin' => $nom,
720
-					'version' => ' &gt; ' . $minimum
720
+					'version' => ' &gt; '.$minimum
721 721
 				));
722 722
 			}
723 723
 		}
@@ -726,13 +726,13 @@  discard block
 block discarded – undo
726 726
 			if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) {
727 727
 				return _T("plugin_${balise}_${type}", array(
728 728
 					'plugin' => $nom,
729
-					'version' => ' &le; ' . $maximum
729
+					'version' => ' &le; '.$maximum
730 730
 				));
731 731
 			}
732 732
 			if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) {
733 733
 				return _T("plugin_${balise}_plugin", array(
734 734
 					'plugin' => $nom,
735
-					'version' => ' &lt; ' . $maximum
735
+					'version' => ' &lt; '.$maximum
736 736
 				));
737 737
 			}
738 738
 		}
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 		include_spip('inc/charger_plugin');
752 752
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
753 753
 	}*/
754
-	return _T('plugin_necessite_lib', array('lib' => $lib)) . " <a href='$url'>$url</a>";
754
+	return _T('plugin_necessite_lib', array('lib' => $lib))." <a href='$url'>$url</a>";
755 755
 }
756 756
 
757 757
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 	foreach ($plugin_valides as $p => $resume) {
851 851
 		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
852 852
 		if (0 !== strpos($p, 'PHP:') and $p !== 'PHP') {
853
-			$header[] = $p . ($resume['version'] ? "(" . $resume['version'] . ")" : "");
853
+			$header[] = $p.($resume['version'] ? "(".$resume['version'].")" : "");
854 854
 		}
855 855
 		if ($resume['dir']) {
856 856
 			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
@@ -874,10 +874,10 @@  discard block
 block discarded – undo
874 874
 	ecrire_meta('plugin_attente', serialize($liste));
875 875
 	$header = strtolower(implode(",", $header));
876 876
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
877
-		ecrire_fichier(_DIR_VAR . "config.txt",
878
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : "Composed-By: SPIP") . ' ' . $GLOBALS['spip_version_affichee'] . " @ www.spip.net + " . $header);
877
+		ecrire_fichier(_DIR_VAR."config.txt",
878
+			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : "Composed-By: SPIP").' '.$GLOBALS['spip_version_affichee']." @ www.spip.net + ".$header);
879 879
 	} else {
880
-		@unlink(_DIR_VAR . "config.txt");
880
+		@unlink(_DIR_VAR."config.txt");
881 881
 	}
882 882
 	// generer charger_plugins_chemin.php
883 883
 	plugins_precompile_chemin($plugin_valides, $ordre);
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 			// definir le plugin, donc le path avant l'include du fichier options
932 932
 			// permet de faire des include_spip pour attraper un inc_ du plugin
933 933
 
934
-			$dir = $dir_type . ".'" . $plug . "/'";
934
+			$dir = $dir_type.".'".$plug."/'";
935 935
 
936 936
 			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
937 937
 			if (
@@ -942,11 +942,11 @@  discard block
 block discarded – undo
942 942
 				if (!$info['chemin']) {
943 943
 					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
944 944
 					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
945
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
945
+					if (is_dir(constant($dir_type).$plug.'/squelettes/')) {
946 946
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
947 947
 					}
948 948
 				}
949
-				else{
949
+				else {
950 950
 					foreach ($info['chemin'] as $chemin) {
951 951
 						if (!isset($chemin['version']) or plugin_version_compatible($chemin['version'],
952 952
 								$GLOBALS['spip_version_branche'], 'spip')
@@ -959,13 +959,13 @@  discard block
 block discarded – undo
959 959
 								$dir = '';
960 960
 							}
961 961
 							if (strlen($dir)) {
962
-								$dir = rtrim($dir, '/') . '/';
962
+								$dir = rtrim($dir, '/').'/';
963 963
 							}
964 964
 							if (!isset($chemin['type']) or $chemin['type'] == 'public') {
965
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : "");
965
+								$chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : "");
966 966
 							}
967 967
 							if (!isset($chemin['type']) or $chemin['type'] == 'prive') {
968
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : "");
968
+								$chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : "");
969 969
 							}
970 970
 						}
971 971
 					}
@@ -974,9 +974,9 @@  discard block
 block discarded – undo
974 974
 		}
975 975
 	}
976 976
 	if (count($chemins['public']) or count($chemins['prive'])) {
977
-		$contenu .= "if (_DIR_RESTREINT) _chemin([" . implode(',',
978
-				array_reverse($chemins['public'])) . "]);\n"
979
-			. "else _chemin([" . implode(',', array_reverse($chemins['prive'])) . "]);\n";
977
+		$contenu .= "if (_DIR_RESTREINT) _chemin([".implode(',',
978
+				array_reverse($chemins['public']))."]);\n"
979
+			. "else _chemin([".implode(',', array_reverse($chemins['prive']))."]);\n";
980 980
 	}
981 981
 
982 982
 	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 					and strpos($dir, ":") === false // exclure le cas des procure:
1025 1025
 					and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1026 1026
 				) {
1027
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . "_" . $charge . ".php"))) {
1027
+					if (is_readable("$dir$plug/".($file = $info['prefix']."_".$charge.".php"))) {
1028 1028
 						$info[$charge] = array($file);
1029 1029
 					}
1030 1030
 				}
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 						) {
1041 1041
 							unset($info[$charge][$k]);
1042 1042
 						} else {
1043
-							$_file = $root_dir_type . ".'$plug/$file'";
1043
+							$_file = $root_dir_type.".'$plug/$file'";
1044 1044
 							$contenu[$charge] .= "include_once_check($_file);\n";
1045 1045
 						}
1046 1046
 					}
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 		}
1051 1051
 	}
1052 1052
 
1053
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1053
+	$contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options'];
1054 1054
 	$contenu['fonctions'] .= plugin_ongletbouton("boutons_plugins", $boutons)
1055 1055
 		. plugin_ongletbouton("onglets_plugins", $onglets);
1056 1056
 
@@ -1085,12 +1085,12 @@  discard block
 block discarded – undo
1085 1085
 		define("_UPDATED_$nom", $val);
1086 1086
 		define("_UPDATED_md5_$nom", $md5);
1087 1087
 	}
1088
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1088
+	$val = "unserialize('".str_replace("'", "\'", $val)."')";
1089 1089
 
1090 1090
 	return
1091 1091
 		"if (!function_exists('$nom')) {\n"
1092 1092
 		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1093
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1093
+		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n"
1094 1094
 		. "}\n";
1095 1095
 }
1096 1096
 
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1114 1114
 		include_once(_CACHE_PLUGINS_OPT);
1115 1115
 	} else {
1116
-		spip_log("pipelines desactives: impossible de produire " . _CACHE_PLUGINS_OPT);
1116
+		spip_log("pipelines desactives: impossible de produire "._CACHE_PLUGINS_OPT);
1117 1117
 	}
1118 1118
 }
1119 1119
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 			$dir_type = $plugin_valides[$p]['dir_type'];
1151 1151
 			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1152 1152
 			$plug = $plugin_valides[$p]['dir'];
1153
-			$prefix = (($info['prefix'] == "spip") ? "" : $info['prefix'] . "_");
1153
+			$prefix = (($info['prefix'] == "spip") ? "" : $info['prefix']."_");
1154 1154
 			if (isset($info['pipeline']) and is_array($info['pipeline'])) {
1155 1155
 				foreach ($info['pipeline'] as $pipe) {
1156 1156
 					$nom = $pipe['nom'];
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 						}
1181 1181
 						if (isset($pipe['inclure'])) {
1182 1182
 							$GLOBALS['spip_matrice']["$prefix$action"] =
1183
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1183
+								"$root_dir_type:$plug/".$pipe['inclure'];
1184 1184
 						}
1185 1185
 					}
1186 1186
 				}
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 					$prepend_code['taches_generales_cron'] = "";
1191 1191
 				}
1192 1192
 				foreach ($info['genie'] as $genie) {
1193
-					$nom = $prefix . $genie['nom'];
1193
+					$nom = $prefix.$genie['nom'];
1194 1194
 					$periode = max(60, intval($genie['periode']));
1195 1195
 					if (charger_fonction($nom, "genie", true)) {
1196 1196
 						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
@@ -1208,13 +1208,13 @@  discard block
 block discarded – undo
1208 1208
 				}
1209 1209
 				foreach ($info['style'] as $style) {
1210 1210
 					if (isset($style['path']) and $style['path']) {
1211
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1211
+						$code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) ";
1212 1212
 					} else {
1213
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1213
+						$code = "if (\$f='".addslashes($style['url'])."') ";
1214 1214
 					}
1215 1215
 					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1216 1216
 					if (isset($style['media']) and strlen($style['media'])) {
1217
-						$code .= " media=\"" . addslashes($style['media']) . "\"";
1217
+						$code .= " media=\"".addslashes($style['media'])."\"";
1218 1218
 					}
1219 1219
 					$code .= "/>';\n";
1220 1220
 					if ($style['type'] != 'prive') {
@@ -1234,9 +1234,9 @@  discard block
 block discarded – undo
1234 1234
 			if (isset($info['script']) and count($info['script'])) {
1235 1235
 				foreach ($info['script'] as $script) {
1236 1236
 					if (isset($script['path']) and $script['path']) {
1237
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1237
+						$code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) ";
1238 1238
 					} else {
1239
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1239
+						$code = "if (\$f='".addslashes($script['url'])."') ";
1240 1240
 					}
1241 1241
 					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1242 1242
 					if ($script['type'] != 'prive') {
@@ -1299,10 +1299,10 @@  discard block
 block discarded – undo
1299 1299
 		unset($GLOBALS['spip_pipeline']['all']);
1300 1300
 		$all_pipes = trim(array_shift($a));
1301 1301
 		if ($all_pipes) {
1302
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1302
+			$all_pipes = '|'.ltrim($all_pipes, '|');
1303 1303
 		}
1304 1304
 		if (count($a)) {
1305
-			$all_pipes_end = '||' . array_shift($a);
1305
+			$all_pipes_end = '||'.array_shift($a);
1306 1306
 		}
1307 1307
 	}
1308 1308
 	$content = "";
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 		// Eclater le pipeline en filtres et appliquer chaque filtre
1320 1320
 		foreach ($pipe as $fonc) {
1321 1321
 			$fonc = trim($fonc);
1322
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1322
+			$s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n";
1323 1323
 			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1324 1324
 				$file = $GLOBALS['spip_matrice'][$fonc];
1325 1325
 				$file = "'$file'";
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 					if (defined($root_dir)) {
1331 1331
 						$dir = $root_dir;
1332 1332
 					}
1333
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1333
+					$file = str_replace($regs[0], "'.".$dir.".'", $file);
1334 1334
 					$file = str_replace("''.", "", $file);
1335 1335
 					$file = str_replace(constant($dir), '', $file);
1336 1336
 				}
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 		$content .= "// Pipeline $action \n"
1344 1344
 			. "function execute_pipeline_$action(&\$val){\n"
1345 1345
 			. $s_inc
1346
-			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1346
+			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '')
1347 1347
 			. $s_call
1348 1348
 			. "return \$val;\n}\n";
1349 1349
 	}
@@ -1399,9 +1399,9 @@  discard block
 block discarded – undo
1399 1399
 					$result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T("plugin_info_upgrade_ok") : _T("plugin_info_install_ok")) : _T("avis_operation_echec"));
1400 1400
 					if (_IS_CLI) {
1401 1401
 						include_spip('inc/filtres');
1402
-						$trace = ltrim(textebrut($trace) . "\n" . $result);
1403
-						$trace = "    " . str_replace("\n", "\n    ", $trace);
1404
-						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1402
+						$trace = ltrim(textebrut($trace)."\n".$result);
1403
+						$trace = "    ".str_replace("\n", "\n    ", $trace);
1404
+						echo "\n".($ok ? 'OK  ' : '/!\ ').textebrut($titre)."\n",
1405 1405
 						  $trace,
1406 1406
 						  "\n";
1407 1407
 					}
@@ -1436,18 +1436,18 @@  discard block
 block discarded – undo
1436 1436
 		$GLOBALS['fichier_php_compile_recent'] = 0;
1437 1437
 	}
1438 1438
 
1439
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1439
+	$contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>';
1440 1440
 	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1441 1441
 	// si pas de modif on ne touche pas au fichier initial
1442 1442
 	if (file_exists($nom)) {
1443 1443
 		if (substr($nom, -4) == '.php') {
1444
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1444
+			$fichier_tmp = substr($nom, 0, -4).'.tmp.php';
1445 1445
 		}
1446 1446
 		else {
1447
-			$fichier_tmp = $nom . '.tmp';
1447
+			$fichier_tmp = $nom.'.tmp';
1448 1448
 		}
1449 1449
 		file_put_contents($fichier_tmp, $contenu);
1450
-		if(md5_file($nom) == md5_file($fichier_tmp)) {
1450
+		if (md5_file($nom) == md5_file($fichier_tmp)) {
1451 1451
 			$GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1452 1452
 			@unlink($fichier_tmp);
1453 1453
 			return;
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	// on accepte pas une fonction de config inconnue si elle vient d'un modele
216 216
 	if ($config_fonc
217 217
 	  and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
218
-	  and $config_fonc !== $table_objet . '_edit_config') {
218
+	  and $config_fonc !== $table_objet.'_edit_config') {
219 219
 		if ($args = test_formulaire_inclus_par_modele()
220 220
 		  and in_array($config_fonc, $args)) {
221 221
 			$config_fonc = '';
@@ -227,12 +227,12 @@  discard block
 block discarded – undo
227 227
 	// Appel direct dans un squelette
228 228
 	if (!$row) {
229 229
 		if (!$new or $lier_trad) {
230
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
230
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
231 231
 				$row = $select($id, $id_parent, $lier_trad);
232 232
 				// si on a une fonction precharger, elle pu faire un reglage de langue
233 233
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
234 234
 			} else {
235
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
235
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
236 236
 			}
237 237
 			if (!$new) {
238 238
 				$md5 = controles_md5($row);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	if ($config_fonc) {
282 282
 		$contexte['config'] = $config = $config_fonc($contexte);
283 283
 		if (!$lang_default) {
284
-			$lang_default = $config['langue'] ?? session_get('lang') ;
284
+			$lang_default = $config['langue'] ?? session_get('lang');
285 285
 		}
286 286
 	}
287 287
 	$config = $config + array(
@@ -305,13 +305,12 @@  discard block
 block discarded – undo
305 305
 		unset($contexte['lang']);
306 306
 	}
307 307
 
308
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
309
-		(!$lier_trad ? '' :
310
-			("\n<input type='hidden' name='lier_trad' value='" .
311
-				$lier_trad .
312
-				"' />" .
313
-				"\n<input type='hidden' name='changer_lang' value='" .
314
-				$lang_default .
308
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
309
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
310
+				$lier_trad.
311
+				"' />".
312
+				"\n<input type='hidden' name='changer_lang' value='".
313
+				$lang_default.
315 314
 				"' />"))
316 315
 		. $hidden
317 316
 		. (isset($md5) ? $md5 : '');
@@ -326,8 +325,8 @@  discard block
 block discarded – undo
326 325
 
327 326
 	// et in fine placer l'autorisation
328 327
 	include_spip('inc/autoriser');
329
-	if (intval($id)){
330
-		if (!autoriser('modifier', $type, intval($id))){
328
+	if (intval($id)) {
329
+		if (!autoriser('modifier', $type, intval($id))) {
331 330
 			$valeurs['editable'] = '';
332 331
 		}
333 332
 	}
@@ -351,14 +350,14 @@  discard block
 block discarded – undo
351 350
 	$aider = charger_fonction('aider', 'inc');
352 351
 	if (strlen($texte) > 28 * 1024) {
353 352
 		$texte = str_replace("\r\n", "\n", $texte);
354
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
353
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
355 354
 		if ($pos > 0 and $pos < 32 * 1024) {
356
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
355
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
357 356
 			$suite = substr($texte, $pos + 2);
358 357
 		} else {
359
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
358
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
360 359
 			if (!($pos > 0 and $pos < 32 * 1024)) {
361
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
360
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
362 361
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
363 362
 			} else {
364 363
 				$decalage = 1;
@@ -388,13 +387,13 @@  discard block
 block discarded – undo
388 387
 	}
389 388
 
390 389
 	include_spip('inc/barre');
391
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
390
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
392 391
 	$nombre = 0;
393 392
 
394 393
 	while (strlen($texte) > 29 * 1024) {
395 394
 		$nombre++;
396 395
 		list($texte1, $texte) = coupe_trop_long($texte);
397
-		$textes_supplement .= '<br />' .
396
+		$textes_supplement .= '<br />'.
398 397
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
399 398
 	}
400 399
 
@@ -482,7 +481,7 @@  discard block
 block discarded – undo
482 481
 	$ctr = array();
483 482
 	foreach ($data as $key => $val) {
484 483
 		$m = md5($val);
485
-		$k = $prefixe . $key;
484
+		$k = $prefixe.$key;
486 485
 
487 486
 		switch ($format) {
488 487
 			case 'html':
@@ -495,7 +494,7 @@  discard block
 block discarded – undo
495 494
 	}
496 495
 
497 496
 	if ($format == 'html') {
498
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
497
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
499 498
 	} else {
500 499
 		return $ctr;
501 500
 	}
@@ -646,7 +645,7 @@  discard block
 block discarded – undo
646 645
 	// On elimine les donnees non modifiees par le formulaire (mais
647 646
 	// potentiellement modifiees entre temps par un autre utilisateur)
648 647
 	foreach ($champs as $key => $val) {
649
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
648
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
650 649
 			if (is_scalar($val) and $m == md5($val)) {
651 650
 				unset($champs[$key]);
652 651
 			}
@@ -675,7 +674,7 @@  discard block
 block discarded – undo
675 674
 	// de conflit.
676 675
 	$ctrh = $ctrq = $conflits = array();
677 676
 	foreach (array_keys($champs) as $key) {
678
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
677
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
679 678
 			$ctrh[$key] = $m;
680 679
 			$ctrq[] = $key;
681 680
 		}
@@ -708,9 +707,9 @@  discard block
 block discarded – undo
708 707
  */
709 708
 function display_conflit_champ($x) {
710 709
 	if (strstr($x, "\n") or strlen($x) > 80) {
711
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
710
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
712 711
 	} else {
713
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
712
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
714 713
 	}
715 714
 }
716 715
 
@@ -750,11 +749,11 @@  discard block
 block discarded – undo
750 749
 		) : $champ;
751 750
 
752 751
 		$diffs[] = "<h2>$titre</h2>\n"
753
-			. '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n"
754
-			. "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n"
755
-			. '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>'
752
+			. '<h3>'._T('info_conflit_edition_differences')."</h3>\n"
753
+			. "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n"
754
+			. '<h4>'._T('info_conflit_edition_votre_version').'</h4>'
756 755
 			. display_conflit_champ($a['post'])
757
-			. '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>'
756
+			. '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>'
758 757
 			. display_conflit_champ($base);
759 758
 	}
760 759
 
@@ -762,16 +761,16 @@  discard block
 block discarded – undo
762 761
 		$id = uniqid(rand());
763 762
 		$redirect = "<form action='$redirect' method='get'
764 763
 			id='$id'
765
-			style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n"
764
+			style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n"
766 765
 			. form_hidden($redirect)
767
-			. "<input type='submit' value='" . _T('icone_retour') . "' />
766
+			. "<input type='submit' value='"._T('icone_retour')."' />
768 767
 		</form>\n";
769 768
 
770 769
 		// pour les documents, on est probablement en ajax : il faut ajaxer
771 770
 		if (_AJAX) {
772 771
 			$redirect .= '<script type="text/javascript">'
773
-				. 'setTimeout(function(){$("#' . $id . '")
774
-			.ajaxForm({target:$("#' . $id . '").parent()});
772
+				. 'setTimeout(function(){$("#'.$id.'")
773
+			.ajaxForm({target:$("#' . $id.'").parent()});
775 774
 			}, 200);'
776 775
 				. "</script>\n";
777 776
 		}
@@ -790,9 +789,9 @@  discard block
 block discarded – undo
790 789
 .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; }
791 790
 .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; }
792 791
 </style>'
793
-		. '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>'
794
-		. '<p>' . _T('texte_conflit_edition_correction') . '</p>'
795
-		. "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>"
792
+		. '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>'
793
+		. '<p>'._T('texte_conflit_edition_correction').'</p>'
794
+		. "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>"
796 795
 		. join("\n", $diffs)
797 796
 		. "</div>\n"
798 797
 
Please login to merge, or discard this patch.