Completed
Pull Request — master (#42)
by
unknown
01:14
created
ecrire/public/format_html.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,36 +31,36 @@  discard block
 block discarded – undo
31 31
 
32 32
 function format_inclure_html($file, $args, $prof) {
33 33
 	if (strpos($file, '#') === false) {
34
-		$t = $file ? ('(' . $file . ')') : '';
34
+		$t = $file ? ('('.$file.')') : '';
35 35
 	} else {
36
-		$t = '{fond=' . $file . '}';
36
+		$t = '{fond='.$file.'}';
37 37
 	}
38
-	$args = !$args ? '' : ('{' . join(', ', $args) . '}');
38
+	$args = !$args ? '' : ('{'.join(', ', $args).'}');
39 39
 
40
-	return ('<INCLURE' . $t . $args . '>');
40
+	return ('<INCLURE'.$t.$args.'>');
41 41
 }
42 42
 
43 43
 function format_polyglotte_html($args, $prof) {
44 44
 	$contenu = [];
45 45
 	foreach ($args as $l => $t) {
46
-		$contenu[] = ($l ? "[$l]" : '') . $t;
46
+		$contenu[] = ($l ? "[$l]" : '').$t;
47 47
 	}
48 48
 
49
-	return ('<multi>' . join(' ', $contenu) . '</multi>');
49
+	return ('<multi>'.join(' ', $contenu).'</multi>');
50 50
 }
51 51
 
52 52
 function format_idiome_html($nom, $module, $args, $filtres, $prof) {
53 53
 	foreach ($args as $k => $v) {
54 54
 		$args[$k] = "$k=$v";
55 55
 	}
56
-	$args = (!$args ? '' : ('{' . join(',', $args) . '}'));
56
+	$args = (!$args ? '' : ('{'.join(',', $args).'}'));
57 57
 
58
-	return ('<:' . ($module ? "$module:" : '') . $nom . $args . $filtres . ':>');
58
+	return ('<:'.($module ? "$module:" : '').$nom.$args.$filtres.':>');
59 59
 }
60 60
 
61 61
 function format_champ_html($nom, $boucle, $etoile, $avant, $apres, $args, $filtres, $prof) {
62 62
 	$nom = '#'
63
-		. ($boucle ? ($boucle . ':') : '')
63
+		. ($boucle ? ($boucle.':') : '')
64 64
 		. $nom
65 65
 		. $etoile
66 66
 		. $args
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 		$critere[$k] = $crit_s;
91 91
 	}
92 92
 
93
-	return (!$critere ? '' : ('{' . join(',', $critere) . '}'));
93
+	return (!$critere ? '' : ('{'.join(',', $critere).'}'));
94 94
 }
95 95
 
96 96
 function format_liste_html($fonc, $args, $prof) {
97 97
 	return ((($fonc !== '') ? "|$fonc" : $fonc)
98
-		. (!$args ? '' : ('{' . join(',', $args) . '}')));
98
+		. (!$args ? '' : ('{'.join(',', $args).'}')));
99 99
 }
100 100
 
101 101
 // Concatenation sans separateur: verifier qu'on ne cree pas de faux lexemes
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			// si un texte se termine par ( et est suivi d'un champ
112 112
 			// ou assimiles, forcer la notation pleine
113 113
 			if ($c1 == '(' and substr($texte2, 0, 1) == '#') {
114
-				$args[$i + 1][0] = '[(' . $texte2 . ')]';
114
+				$args[$i + 1][0] = '[('.$texte2.')]';
115 115
 			}
116 116
 		} else {
117 117
 			if ($type == 'texte') {
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 				($c1 == '}' and substr(ltrim($texte2), 0, 1) == '|')
125 125
 				or (preg_match('/[\w\d_*]/', $c1) and preg_match('/^[\w\d_*{|]/', $texte2))
126 126
 			) {
127
-				$args[$i][0] = '[(' . $texte . ')]';
127
+				$args[$i][0] = '[('.$texte.')]';
128 128
 			}
129 129
 		}
130 130
 	}
131 131
 
132
-	return join('', array_map(function ($arg) {
132
+	return join('', array_map(function($arg) {
133 133
  return reset($arg);
134 134
 	}, $args));
135 135
 }
Please login to merge, or discard this patch.
ecrire/public/styliser_par_z.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 			$apl_constant = '_Z_AJAX_PARALLEL_LOAD';
54 54
 			$page = _SPIP_PAGE;
55 55
 			$echafauder = charger_fonction('echafauder', 'public', true);
56
-			define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim(
56
+			define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim(
57 57
 				_DIR_PLUGIN_DIST,
58 58
 				'/'
59 59
 			) : ''));
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			and in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z
78 78
 			and defined($apl_constant)
79 79
 			and in_array($dir, explode(',', constant($apl_constant))) // et dans un demande en APL
80
-			and $pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL
80
+			and $pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL
81 81
 		) {
82 82
 			$flux['data'] = $pipe;
83 83
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			$echafauder = '';
91 91
 		}
92 92
 		if ($prepend) {
93
-			$squelette = substr(find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext"));
93
+			$squelette = substr(find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext"));
94 94
 			if ($squelette) {
95 95
 				$flux['data'] = $squelette;
96 96
 			}
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 				// se brancher sur contenu/xx si il existe
114 114
 				// ou si c'est un objet spip, associe a une table, utiliser le fond homonyme
115 115
 				if (!isset($disponible[$fond])) {
116
-					$disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, $echafauder);
116
+					$disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, $echafauder);
117 117
 				}
118 118
 
119 119
 				if ($disponible[$fond]) {
120
-					$flux['data'] = substr(find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext"));
120
+					$flux['data'] = substr(find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext"));
121 121
 				}
122 122
 			}
123 123
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 					$type = $flux['args']['contexte'][$page];
131 131
 				}
132 132
 				if (!isset($disponible[$type])) {
133
-					$disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder);
133
+					$disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder);
134 134
 				}
135 135
 				if (is_string($disponible[$type])) {
136 136
 					$flux['data'] = $disponible[$type];
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 					$flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext);
146 146
 				} else {
147 147
 					$flux['data'] = ($disponible['404'] = z_contenu_disponible(
148
-						$prefix_path . $prepend,
148
+						$prefix_path.$prepend,
149 149
 						$z_contenu,
150 150
 						'404',
151 151
 						$ext,
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 						$type = $flux['args']['contexte'][$page];
170 170
 					}
171 171
 					if ($type !== 'page' and !isset($disponible[$type])) {
172
-						$disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder);
172
+						$disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder);
173 173
 					}
174 174
 					if ($type == 'page' or $disponible[$type]) {
175
-						$flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext);
175
+						$flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext);
176 176
 					}
177 177
 				}
178 178
 			}
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 				isset($flux['args']['contexte']['type-page'])
189 189
 				and (
190 190
 					(isset($flux['args']['contexte']['composition'])
191
-						and file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext"))
191
+						and file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext"))
192 192
 					or
193
-					file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext")
193
+					file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext")
194 194
 				)
195 195
 			) {
196 196
 				$flux['data'] = $f;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		} elseif (
199 199
 			$fond == 'structure'
200 200
 			and z_sanitize_var_zajax()
201
-			and $f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext")
201
+			and $f = find_in_path($prefix_path.$prepend.'ajax'.".$ext")
202 202
 		) {
203 203
 			$flux['data'] = substr($f, 0, -strlen(".$ext"));
204 204
 		} // chercher le fond correspondant a la composition
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			and $dir = explode('/', $dir)
210 210
 			and $dir = reset($dir)
211 211
 			and in_array($dir, $z_blocs)
212
-			and $f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext")
212
+			and $f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext")
213 213
 		) {
214 214
 			$flux['data'] = substr($f, 0, -strlen(".$ext"));
215 215
 		}
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 function z_fond_valide($squelette) {
272 272
 	if (
273 273
 		!_ZCORE_EXCLURE_PATH
274
-		or !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette)
274
+		or !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette)
275 275
 	) {
276 276
 		return true;
277 277
 	}
@@ -395,23 +395,23 @@  discard block
 block discarded – undo
395 395
 		}
396 396
 		$dir = z_blocs(test_espace_prive());
397 397
 		$dir = reset($dir);
398
-		$scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper($primary) . ',env}>';
398
+		$scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper($primary).',env}>';
399 399
 	} // page objets
400 400
 	elseif ($type = $desc_exec and strpos($type, '/') === false) {
401 401
 		$dir = z_blocs(test_espace_prive());
402 402
 		$dir = reset($dir);
403
-		$scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />';
403
+		$scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />';
404 404
 	}
405 405
 	// morceau d'objet : on fournit le fond de sibstitution dans $desc_exec
406 406
 	// et objet et tire de $table
407 407
 	elseif ($fond = $desc_exec) {
408 408
 		$dir = md5(dirname($fond));
409
-		$scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />';
409
+		$scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />';
410 410
 	}
411 411
 
412 412
 	$base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false);
413 413
 	$base_dir = sous_repertoire($base_dir, $dir, false);
414
-	$f = $base_dir . "$exec";
414
+	$f = $base_dir."$exec";
415 415
 	ecrire_fichier("$f.$ext", $scaffold);
416 416
 
417 417
 	return $f;
Please login to merge, or discard this patch.
ecrire/public/evaluer_page.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 	ob_start();
46 46
 	if (strpos($page['texte'], '?xml') !== false) {
47
-		$page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']);
47
+		$page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']);
48 48
 	}
49 49
 
50 50
 	try {
51
-		$res = eval('?' . '>' . $page['texte']);
51
+		$res = eval('?'.'>'.$page['texte']);
52 52
 		// error catching 5.2<=PHP<7
53 53
 		if (
54 54
 			$res === false
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 			if (!function_exists('numerote_ligne_php')) {
61 61
 				function numerote_ligne_php($match) {
62 62
 					$GLOBALS['numero_ligne_php']++;
63
-					return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/';
63
+					return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/';
64 64
 				}
65 65
 			}
66
-			$code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
66
+			$code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
67 67
 			$code = trim(highlight_string($code, true));
68
-			erreur_squelette('L' . $erreur['line'] . ': ' . $erreur['message'] . '<br />' . $code, [$page['source'],'',$erreur['file'],'',$GLOBALS['spip_lang']]);
68
+			erreur_squelette('L'.$erreur['line'].': '.$erreur['message'].'<br />'.$code, [$page['source'], '', $erreur['file'], '', $GLOBALS['spip_lang']]);
69 69
 			$page['texte'] = '<!-- Erreur -->';
70 70
 		}
71 71
 		else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 		if (!function_exists('numerote_ligne_php')) {
79 79
 			function numerote_ligne_php($match) {
80 80
 				$GLOBALS['numero_ligne_php']++;
81
-				return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/';
81
+				return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/';
82 82
 			}
83 83
 		}
84
-		$code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
84
+		$code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
85 85
 		$code = trim(highlight_string($code, true));
86
-		erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]);
86
+		erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]);
87 87
 		$page['texte'] = '<!-- Erreur -->';
88 88
 	}
89 89
 	ob_end_clean();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	$page['process_ins'] = 'html';
92 92
 
93 93
 	if (strpos($page['texte'], '?xml') !== false) {
94
-		$page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']);
94
+		$page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']);
95 95
 	}
96 96
 }
97 97
 
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
  */
365 365
 function balise_DOSSIER_SQUELETTE_dist($p) {
366 366
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
367
-	$p->code = "_DIR_RACINE . '$code'" .
367
+	$p->code = "_DIR_RACINE . '$code'".
368 368
 		$p->interdire_scripts = false;
369 369
 
370 370
 	return $p;
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
  */
384 384
 function balise_SQUELETTE_dist($p) {
385 385
 	$code = addslashes($p->descr['sourcefile']);
386
-	$p->code = "'$code'" .
386
+	$p->code = "'$code'".
387 387
 		$p->interdire_scripts = false;
388 388
 
389 389
 	return $p;
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
  **/
436 436
 function balise_NOM_SITE_dist($p) {
437 437
 	if (!$p->etoile) {
438
-		$p->code = 'supprimer_numero(calculer_url(' .
439
-			champ_sql('url_site', $p) . ',' .
440
-			champ_sql('nom_site', $p) .
438
+		$p->code = 'supprimer_numero(calculer_url('.
439
+			champ_sql('url_site', $p).','.
440
+			champ_sql('nom_site', $p).
441 441
 			", 'titre', \$connect, false))";
442 442
 	} else {
443 443
 		$p->code = champ_sql('nom_site', $p);
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
  *     Pile complétée par le code à générer
589 589
  **/
590 590
 function balise_POPULARITE_ABSOLUE_dist($p) {
591
-	$p->code = 'ceil(' .
592
-		champ_sql('popularite', $p) .
591
+	$p->code = 'ceil('.
592
+		champ_sql('popularite', $p).
593 593
 		')';
594 594
 	$p->interdire_scripts = false;
595 595
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);
671 671
 ;
672 672
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
673
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
673
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
674 674
 	}
675 675
 	$p->interdire_scripts = true;
676 676
 
@@ -809,16 +809,16 @@  discard block
 block discarded – undo
809 809
 	$trouver_table = charger_fonction('trouver_table', 'base');
810 810
 	if ($desc = $trouver_table(table_objet_sql($type_objet))) {
811 811
 		if (isset($desc['field']['descriptif'])) {
812
-			$_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ',';
812
+			$_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).',';
813 813
 		}
814 814
 		if (isset($desc['field']['texte'])) {
815
-			$_ligne .= "'texte' => " . champ_sql('texte', $p) . ',';
815
+			$_ligne .= "'texte' => ".champ_sql('texte', $p).',';
816 816
 		}
817 817
 		if (isset($desc['field']['chapo'])) {
818
-			$_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ',';
818
+			$_ligne .= "'chapo' => ".champ_sql('chapo', $p).',';
819 819
 		}
820 820
 		if (isset($desc['introduction_longueur'])) {
821
-			$_introduction_longueur = "'" . $desc['introduction_longueur'] . "'";
821
+			$_introduction_longueur = "'".$desc['introduction_longueur']."'";
822 822
 		}
823 823
 	}
824 824
 	$_ligne .= ')';
@@ -917,10 +917,10 @@  discard block
 block discarded – undo
917 917
 		$p->code = sprintf(
918 918
 			CODE_RECUPERER_FOND,
919 919
 			"'modeles/lesauteurs'",
920
-			"array('objet'=>'" . $objet .
921
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
922
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
923
-			($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) .
920
+			"array('objet'=>'".$objet.
921
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
922
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
923
+			($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)).
924 924
 			')',
925 925
 			"'trim'=>true, 'compil'=>array($c)",
926 926
 			_q($connect)
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 					$m = trim($m);
990 990
 					if ($m != "''") {
991 991
 						if (!preg_match(',\W,', $m)) {
992
-							$m = $boucle->id_table . ".$m";
992
+							$m = $boucle->id_table.".$m";
993 993
 						}
994 994
 
995 995
 						$m .= ' AS titre_rang';
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 	$f_pagination = chercher_filtre('pagination');
1151 1151
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1152 1152
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1153
-		: ("'debut" . substr($type, 1));
1153
+		: ("'debut".substr($type, 1));
1154 1154
 
1155 1155
 	$p->code = sprintf(
1156 1156
 		CODE_PAGINATION,
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']];
1295 1295
 		erreur_squelette($msg, $p);
1296 1296
 	} else {
1297
-		$p->code = 'find_in_path(' . $arg . ')';
1297
+		$p->code = 'find_in_path('.$arg.')';
1298 1298
 	}
1299 1299
 
1300 1300
 	$p->interdire_scripts = false;
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']];
1330 1330
 		erreur_squelette($msg, $p);
1331 1331
 	} else {
1332
-		$p->code = 'chemin_image(' . $arg . ')';
1332
+		$p->code = 'chemin_image('.$arg.')';
1333 1333
 	}
1334 1334
 
1335 1335
 	$p->interdire_scripts = false;
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1384 1384
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1385 1385
 		if ($src) {
1386
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1386
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1387 1387
 		} else {
1388 1388
 			$p->code = 'serialize($Pile[0]??[])';
1389 1389
 		}
@@ -1436,8 +1436,8 @@  discard block
 block discarded – undo
1436 1436
 	$_sinon = interprete_argument_balise(2, $p);
1437 1437
 	$_unserialize = sinon(interprete_argument_balise(3, $p), 'false');
1438 1438
 
1439
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1440
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1439
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1440
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1441 1441
 
1442 1442
 	return $p;
1443 1443
 }
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
 		$err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']];
1531 1531
 		erreur_squelette($err_b_s_a, $p);
1532 1532
 	} else {
1533
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1533
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1534 1534
 	}
1535 1535
 
1536 1536
 	$p->interdire_scripts = false;
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
 			)
1579 1579
 		) {
1580 1580
 			$p->code = /* $r[1]. */
1581
-				'(' . $r[2] . ')';
1581
+				'('.$r[2].')';
1582 1582
 		} else {
1583 1583
 			$p->code = "eval('return '.$php.';')";
1584 1584
 		}
@@ -1822,9 +1822,9 @@  discard block
 block discarded – undo
1822 1822
 
1823 1823
 		// noter la duree du cache dans un entete proprietaire
1824 1824
 
1825
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1825
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1826 1826
 			. $duree
1827
-			. '"); ?' . "'.'>'";
1827
+			. '"); ?'."'.'>'";
1828 1828
 
1829 1829
 		// Remplir le header Cache-Control
1830 1830
 		// cas #CACHE{0}
@@ -1845,9 +1845,9 @@  discard block
 block discarded – undo
1845 1845
 				$pa == 'cache-client'
1846 1846
 				and $duree > 0
1847 1847
 			) {
1848
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1848
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1849 1849
 					. $duree
1850
-					. '"); ?' . "'.'>'";
1850
+					. '"); ?'."'.'>'";
1851 1851
 				// il semble logique, si on cache-client, de ne pas invalider
1852 1852
 				$pa = 'statique';
1853 1853
 			}
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
 				$pa == 'statique'
1857 1857
 				and $duree > 0
1858 1858
 			) {
1859
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1859
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1860 1860
 			}
1861 1861
 		}
1862 1862
 	} else {
@@ -2020,9 +2020,9 @@  discard block
 block discarded – undo
2020 2020
 		if ($p->etoile) {
2021 2021
 			$_options[] = "'etoile'=>true";
2022 2022
 		}
2023
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')';
2023
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')';
2024 2024
 
2025
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2025
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2026 2026
 		if ($flag_env) {
2027 2027
 			$_l = "array_merge(\$Pile[0],$_l)";
2028 2028
 		}
@@ -2032,7 +2032,7 @@  discard block
 block discarded – undo
2032 2032
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']];
2033 2033
 		erreur_squelette($msg, $p);
2034 2034
 	} else {
2035
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2035
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2036 2036
 	}
2037 2037
 
2038 2038
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2080,7 +2080,7 @@  discard block
 block discarded – undo
2080 2080
 		unset($_contexte[1]);
2081 2081
 
2082 2082
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2083
-			$nom = "'modeles/" . substr($nom, 1);
2083
+			$nom = "'modeles/".substr($nom, 1);
2084 2084
 		} else {
2085 2085
 			$nom = "'modeles/' . $nom";
2086 2086
 		}
@@ -2097,8 +2097,8 @@  discard block
 block discarded – undo
2097 2097
 			$primary = $p->boucles[$p->id_boucle]->primary;
2098 2098
 			if (!strpos($primary, ',')) {
2099 2099
 				$id = champ_sql($primary, $p);
2100
-				$_contexte[] = "'$primary'=>" . $id;
2101
-				$_contexte[] = "'id'=>" . $id;
2100
+				$_contexte[] = "'$primary'=>".$id;
2101
+				$_contexte[] = "'id'=>".$id;
2102 2102
 			}
2103 2103
 		}
2104 2104
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2110,11 +2110,11 @@  discard block
 block discarded – undo
2110 2110
 		$_options = memoriser_contexte_compil($p);
2111 2111
 		$_options = "'compil'=>array($_options), 'trim'=>true";
2112 2112
 		if (isset($_contexte['ajax'])) {
2113
-			$_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2113
+			$_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2114 2114
 			unset($_contexte['ajax']);
2115 2115
 		}
2116 2116
 
2117
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2117
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2118 2118
 		if ($flag_env) {
2119 2119
 			$_l = "array_merge(\$Pile[0],$_l)";
2120 2120
 		}
@@ -2224,12 +2224,12 @@  discard block
 block discarded – undo
2224 2224
 function balise_DOUBLONS_dist($p) {
2225 2225
 	if ($type = interprete_argument_balise(1, $p)) {
2226 2226
 		if ($famille = interprete_argument_balise(2, $p)) {
2227
-			$type .= '.' . $famille;
2227
+			$type .= '.'.$famille;
2228 2228
 		}
2229
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2229
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2230 2230
 		if (!$p->etoile) {
2231 2231
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2232
-				. $p->code . ')))';
2232
+				. $p->code.')))';
2233 2233
 		}
2234 2234
 	} else {
2235 2235
 		$p->code = '$doublons';
@@ -2358,7 +2358,7 @@  discard block
 block discarded – undo
2358 2358
 			$_code[] = "$_key => $_val";
2359 2359
 		}
2360 2360
 	} while ($_key && $_val);
2361
-	$p->code = 'array(' . join(', ', $_code) . ')';
2361
+	$p->code = 'array('.join(', ', $_code).')';
2362 2362
 	$p->interdire_scripts = false;
2363 2363
 
2364 2364
 	return $p;
@@ -2385,7 +2385,7 @@  discard block
 block discarded – undo
2385 2385
 	while ($_val = interprete_argument_balise($n++, $p)) {
2386 2386
 		$_code[] = $_val;
2387 2387
 	}
2388
-	$p->code = 'array(' . join(', ', $_code) . ')';
2388
+	$p->code = 'array('.join(', ', $_code).')';
2389 2389
 	$p->interdire_scripts = false;
2390 2390
 
2391 2391
 	return $p;
@@ -2430,10 +2430,10 @@  discard block
 block discarded – undo
2430 2430
 		$_code[] = $_v;
2431 2431
 	}
2432 2432
 
2433
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(
2433
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(
2434 2434
 		', ',
2435 2435
 		$_code
2436
-	) . ')?" ":"")';
2436
+	).')?" ":"")';
2437 2437
 	$p->interdire_scripts = false;
2438 2438
 
2439 2439
 	return $p;
@@ -2466,7 +2466,7 @@  discard block
 block discarded – undo
2466 2466
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2467 2467
 
2468 2468
 	$f = chercher_filtre('info_plugin');
2469
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2469
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2470 2470
 
2471 2471
 	return $p;
2472 2472
 }
@@ -2716,12 +2716,12 @@  discard block
 block discarded – undo
2716 2716
 	$_issens = "in_array($_champ,array('>','<'))";
2717 2717
 	$_sens = "(strpos('< >',$_champ)-1)";
2718 2718
 
2719
-	$_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom'];
2719
+	$_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom'];
2720 2720
 	$_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)";
2721
-	$_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')";
2722
-	$_on = '$s?(' . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)";
2721
+	$_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')";
2722
+	$_on = '$s?('.$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)";
2723 2723
 
2724
-	$p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : '') . ')';
2724
+	$p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : '').')';
2725 2725
 	//$p->code = "''";
2726 2726
 	$p->interdire_scripts = false;
2727 2727
 
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2796 2796
 	}
2797 2797
 
2798
-	$p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')";
2798
+	$p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')";
2799 2799
 	$p->interdire_scripts = false;
2800 2800
 
2801 2801
 	return $p;
Please login to merge, or discard this patch.
ecrire/public/fonctions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$texte = $intro;
85 85
 	} else {
86 86
 		if (
87
-			strpos("\n" . $texte, "\n|") === false
87
+			strpos("\n".$texte, "\n|") === false
88 88
 			and strlen($texte) > 2.5 * $longueur
89 89
 		) {
90 90
 			if (strpos($texte, '<multi') !== false) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	if ($pas < 1) {
169 169
 		return '';
170 170
 	}
171
-	$ancre = 'pagination' . $nom; // #pagination_articles
172
-	$debut = 'debut' . $nom; // 'debut_articles'
171
+	$ancre = 'pagination'.$nom; // #pagination_articles
172
+	$debut = 'debut'.$nom; // 'debut_articles'
173 173
 
174 174
 	// n'afficher l'ancre qu'une fois
175 175
 	if (!isset($ancres[$ancre])) {
176
-		$bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>";
176
+		$bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>";
177 177
 	} else {
178 178
 		$bloc_ancre = '';
179 179
 	}
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 
206 206
 	if ($modele) {
207 207
 		$pagination['type_pagination'] = $modele;
208
-		if (trouver_fond('pagination_' . $modele, 'modeles')) {
209
-			$modele = '_' . $modele;
208
+		if (trouver_fond('pagination_'.$modele, 'modeles')) {
209
+			$modele = '_'.$modele;
210 210
 		}
211 211
 		else {
212 212
 			$modele = '';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 function lister_objets_avec_logos($type) {
292 292
 
293 293
 	$objet = objet_type($type);
294
-	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet));
294
+	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet));
295 295
 	if ($ids) {
296 296
 		$ids = array_column($ids, 'id_objet');
297 297
 		return implode(',', $ids);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 		case 'sinum ':
466 466
 			return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}";
467 467
 		default:
468
-			return $champ . $senstri;
468
+			return $champ.$senstri;
469 469
 	}
470 470
 }
471 471
 
Please login to merge, or discard this patch.
ecrire/public/assembler.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 	$GLOBALS['contexte'] = calculer_contexte();
39 39
 	$page = ['contexte_implicite' => calculer_contexte_implicite()];
40
-	$page['contexte_implicite']['cache'] = $fond . preg_replace(
40
+	$page['contexte_implicite']['cache'] = $fond.preg_replace(
41 41
 		',\.[a-zA-Z0-9]*$,',
42 42
 		'',
43 43
 		preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI'])
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			if ($page === '') {
139 139
 				$erreur = _T(
140 140
 					'info_erreur_squelette2',
141
-					['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES]
141
+					['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES]
142 142
 				);
143 143
 				erreur_squelette($erreur);
144 144
 				// eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		and !isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
184 184
 		and !isset($page['entetes']['Last-Modified'])
185 185
 	) {
186
-		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT';
186
+		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT';
187 187
 	}
188 188
 
189 189
 	// fermer la connexion apres les headers si requete HEAD
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		'spip_version_code' => $GLOBALS['spip_version_code'],
249 249
 	];
250 250
 	if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
251
-		$contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST'];
251
+		$contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST'];
252 252
 	}
253 253
 
254 254
 	return $contexte_implicite;
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 			}
580 580
 		}
581 581
 		if (is_null($id)) {
582
-			$msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
582
+			$msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
583 583
 			erreur_squelette($msg);
584 584
 			// on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant
585 585
 			$id = 0;
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		}
627 627
 
628 628
 		if (preg_match(',^[a-z0-9_]+$,', $soustype)) {
629
-			if (!trouve_modele($fond = ($type . '_' . $soustype))) {
629
+			if (!trouve_modele($fond = ($type.'_'.$soustype))) {
630 630
 				$fond = '';
631 631
 				$class = $soustype;
632 632
 			}
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 
642 642
 		return false;
643 643
 	}
644
-	$fond = 'modeles/' . $fond;
644
+	$fond = 'modeles/'.$fond;
645 645
 	// Creer le contexte
646 646
 	$contexte = $env;
647 647
 	$contexte['dir_racine'] = _DIR_RACINE; # eviter de mixer un cache racine et un cache ecrire (meme si pour l'instant les modeles ne sont pas caches, le resultat etant different il faut que le contexte en tienne compte
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	// sinon, s'il y a un lien, on l'ajoute classiquement
683 683
 	if (
684 684
 		strstr(
685
-			' ' . ($classes = extraire_attribut($retour, 'class')) . ' ',
685
+			' '.($classes = extraire_attribut($retour, 'class')).' ',
686 686
 			'spip_lien_ok'
687 687
 		)
688 688
 	) {
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 		);
694 694
 	} else {
695 695
 		if ($lien) {
696
-			$retour = "<a href='" . $lien['href'] . "' class='" . $lien['class'] . "'>" . $retour . '</a>';
696
+			$retour = "<a href='".$lien['href']."' class='".$lien['class']."'>".$retour.'</a>';
697 697
 		}
698 698
 	}
699 699
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 		return $page;
718 718
 	}
719 719
 	// eval $page et affecte $res
720
-	include _ROOT_RESTREINT . 'public/evaluer_page.php';
720
+	include _ROOT_RESTREINT.'public/evaluer_page.php';
721 721
 
722 722
 	// Lever un drapeau (global) si le fond utilise #SESSION
723 723
 	// a destination de public/parametrer
@@ -785,16 +785,16 @@  discard block
 block discarded – undo
785 785
 			if (($pos = strpos($head, '<head>')) !== false) {
786 786
 				$head = substr_replace($head, $base, $pos + 6, 0);
787 787
 			} elseif (preg_match(',<head[^>]*>,i', $head, $r)) {
788
-				$head = str_replace($r[0], $r[0] . $base, $head);
788
+				$head = str_replace($r[0], $r[0].$base, $head);
789 789
 			}
790
-			$texte = $head . substr($texte, $poshead);
790
+			$texte = $head.substr($texte, $poshead);
791 791
 		}
792 792
 		if ($href_base) {
793 793
 			// gerer les ancres
794 794
 			$base = $_SERVER['REQUEST_URI'];
795 795
 			// pas de guillemets ni < dans l'URL qu'on insere dans le HTML
796 796
 			if (strpos($base, "'") or strpos($base, '"') or strpos($base, '<')) {
797
-				$base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base);
797
+				$base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base);
798 798
 			}
799 799
 			if (strpos($texte, "href='#") !== false) {
800 800
 				$texte = str_replace("href='#", "href='$base#", $texte);
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function generer_nom_fichier_cache($contexte, $page) {
30 30
 	$u = md5(var_export([$contexte, $page], true));
31 31
 
32
-	return $u . '.cache';
32
+	return $u.'.cache';
33 33
 }
34 34
 
35 35
 /**
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 	else {
63 63
 		// en lecture on essaye pa de creer les repertoires, on va au plus vite
64
-		$rep = _DIR_CACHE . "$d/";
64
+		$rep = _DIR_CACHE."$d/";
65 65
 	}
66 66
 
67
-	return $rep . $u . '.cache';
67
+	return $rep.$u.'.cache';
68 68
 }
69 69
 
70 70
 /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		);
116 116
 	}
117 117
 
118
-	return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']);
118
+	return crc32($GLOBALS['meta']['cache_signature'].$page['texte']);
119 119
 }
120 120
 
121 121
 /**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		// "cache sessionne" ; sa date indique la date de validite
272 272
 		// des caches sessionnes
273 273
 		if (!$tmp = lire_cache($chemin_cache)) {
274
-			spip_log('Creation cache sessionne ' . $chemin_cache);
274
+			spip_log('Creation cache sessionne '.$chemin_cache);
275 275
 			$tmp = [
276 276
 				'invalideurs' => ['session' => ''],
277 277
 				'lastmodified' => $_SERVER['REQUEST_TIME']
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 	// l'enregistrer, compresse ou non...
298 298
 	$ok = ecrire_cache($chemin_cache, $pagez);
299 299
 
300
-	spip_log((_IS_BOT ? 'Bot:' : '') . "Creation du cache $chemin_cache pour "
301
-		. $page['entetes']['X-Spip-Cache'] . ' secondes' . ($ok ? '' : ' (erreur!)'), _LOG_INFO);
300
+	spip_log((_IS_BOT ? 'Bot:' : '')."Creation du cache $chemin_cache pour "
301
+		. $page['entetes']['X-Spip-Cache'].' secondes'.($ok ? '' : ' (erreur!)'), _LOG_INFO);
302 302
 
303 303
 	// Inserer ses invalideurs
304 304
 	include_spip('inc/invalideur');
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 function nettoyer_petit_cache($prefix, $duree = 300) {
320 320
 	// determiner le repertoire a purger : 'tmp/CACHE/rech/'
321 321
 	$dircache = sous_repertoire(_DIR_CACHE, $prefix);
322
-	if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) {
322
+	if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) {
323 323
 		foreach (preg_files($dircache, '[.]txt$') as $f) {
324 324
 			if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) {
325 325
 				spip_unlink($f);
@@ -414,9 +414,9 @@  discard block
 block discarded – undo
414 414
 		if (spip_connect()) {
415 415
 			include_spip('inc/invalideur');
416 416
 			retire_caches($chemin_cache); # API invalideur inutile
417
-			supprimer_fichier(_DIR_CACHE . $chemin_cache);
417
+			supprimer_fichier(_DIR_CACHE.$chemin_cache);
418 418
 			if (isset($chemin_cache_session) and $chemin_cache_session) {
419
-				supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
419
+				supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
420 420
 			}
421 421
 		}
422 422
 	}
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
 		$page = ['contexte_implicite' => $contexte_implicite]; // ignorer le cache deja lu
434 434
 		include_spip('inc/invalideur');
435 435
 		retire_caches($chemin_cache); # API invalideur inutile
436
-		supprimer_fichier(_DIR_CACHE . $chemin_cache);
436
+		supprimer_fichier(_DIR_CACHE.$chemin_cache);
437 437
 		if (isset($chemin_cache_session) and $chemin_cache_session) {
438
-			supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
438
+			supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
439 439
 		}
440 440
 	}
441 441
 
Please login to merge, or discard this patch.
ecrire/public/composer.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$GLOBALS['debug_objets']['courant'] = $nom;
55 55
 	}
56 56
 
57
-	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php';
57
+	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php';
58 58
 
59 59
 	// si squelette est deja compile et perenne, le charger
60 60
 	if (!squelette_obsolete($phpfile, $source)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		#}
68 68
 	}
69 69
 
70
-	if (file_exists($lib = $squelette . '_fonctions' . '.php')) {
70
+	if (file_exists($lib = $squelette.'_fonctions'.'.php')) {
71 71
 		include_once $lib;
72 72
 	}
73 73
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			eval("return true; $f ;");
96 96
 		} catch (\ParseError $e) {
97 97
 			// Code syntaxiquement faux (critere etc mal programme')
98
-			$msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage();
98
+			$msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage();
99 99
 			erreur_squelette($msg, $boucle);
100 100
 			// continuer pour trouver d'autres fautes eventuelles
101 101
 			// mais prevenir que c'est mort
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 	if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
125 125
 		// Tracer ce qui vient d'etre compile
126
-		$GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code;
126
+		$GLOBALS['debug_objets']['code'][$nom.'tout'] = $code;
127 127
 
128 128
 		// si c'est ce que demande le debusqueur, lui passer la main
129 129
 		if (
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 		$code = "
147 147
 /*
148 148
  * Squelette : $sourcefile
149
- * Date :      " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT
150
- * Compile :   ' . gmdate('D, d M Y H:i:s', time()) . ' GMT
151
- * ' . (!$boucles ? 'Pas de boucle' : ('Boucles :   ' . $noms)) . '
149
+ * Date :      ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT
150
+ * Compile :   ' . gmdate('D, d M Y H:i:s', time()).' GMT
151
+ * ' . (!$boucles ? 'Pas de boucle' : ('Boucles :   '.$noms)).'
152 152
  */ ';
153 153
 	}
154 154
 
155
-	$code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>';
155
+	$code = '<'."?php\n".$code.join('', $boucles)."\n?".'>';
156 156
 	if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) {
157 157
 		ecrire_fichier($phpfile, $code);
158 158
 	}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			$j = join('-', array_map('ucwords', explode('-', strtolower($r[2]))));
217 217
 
218 218
 			if ($j == 'X-Spip-Filtre' and isset($headers[$j])) {
219
-				$headers[$j] .= '|' . $r[3];
219
+				$headers[$j] .= '|'.$r[3];
220 220
 			} else {
221 221
 				$headers[$j] = $r[3];
222 222
 			}
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 	}
225 225
 	// S'agit-il d'un resultat constant ou contenant du code php
226 226
 	$process_ins = (
227
-		strpos($corps, '<' . '?') === false
227
+		strpos($corps, '<'.'?') === false
228 228
 		or
229
-		(strpos($corps, '<' . '?xml') !== false and
230
-			strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
229
+		(strpos($corps, '<'.'?xml') !== false and
230
+			strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
231 231
 	)
232 232
 		? 'html'
233 233
 		: 'php';
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 		if ($process_ins == 'html') {
258 258
 			$skel['process_ins'] = (
259
-				strpos($corps, '<' . '?') === false
259
+				strpos($corps, '<'.'?') === false
260 260
 				or
261
-				(strpos($corps, '<' . '?xml') !== false and
262
-					strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
261
+				(strpos($corps, '<'.'?xml') !== false and
262
+					strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
263 263
 			)
264 264
 				? 'html'
265 265
 				: 'php';
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 //
278 278
 
279 279
 /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */
280
-define('CODE_INCLURE_BALISE', '<' . '?php 
280
+define('CODE_INCLURE_BALISE', '<'.'?php 
281 281
 include_once("%s");
282 282
 if ($lang_select = "%s") $lang_select = lang_select($lang_select);
283 283
 inserer_balise_dynamique(balise_%s_dyn(%s), array(%s));
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		// pas de lien symbolique sous Windows
309 309
 		and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false)
310 310
 	) {
311
-		$file = './" . _DIR_RACINE . "' . $file;
311
+		$file = './" . _DIR_RACINE . "'.$file;
312 312
 	}
313 313
 
314 314
 	$lang = $context_compil[4];
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 	$args = array_map('argumenter_squelette', $args);
320 320
 	if (!empty($context_compil['appel_php_depuis_modele'])) {
321
-		$args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')';
321
+		$args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')';
322 322
 	}
323 323
 	$args = join(', ', $args);
324 324
 
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
 	if (is_object($v)) {
353 353
 		return var_export($v, true);
354 354
 	} elseif (!is_array($v)) {
355
-		return "'" . texte_script($v) . "'";
355
+		return "'".texte_script($v)."'";
356 356
 	} else {
357 357
 		$out = [];
358 358
 		foreach ($v as $k => $val) {
359
-			$out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val);
359
+			$out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val);
360 360
 		}
361 361
 
362
-		return 'array(' . join(', ', $out) . ')';
362
+		return 'array('.join(', ', $out).')';
363 363
 	}
364 364
 }
365 365
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	}
438 438
 
439 439
 	// Y a-t-il une fonction de traitement des arguments ?
440
-	$f = 'balise_' . $nom_balise . '_stat';
440
+	$f = 'balise_'.$nom_balise.'_stat';
441 441
 
442 442
 	$r = !function_exists($f) ? $args : $f($args, $context_compil);
443 443
 
@@ -447,18 +447,18 @@  discard block
 block discarded – undo
447 447
 
448 448
 	// verifier que la fonction dyn est la,
449 449
 	// sinon se replier sur la generique si elle existe
450
-	if (!function_exists('balise_' . $nom_balise . '_dyn')) {
450
+	if (!function_exists('balise_'.$nom_balise.'_dyn')) {
451 451
 		if (
452 452
 			$balise_generique = chercher_balise_generique($nom)
453 453
 			and $nom_balise_generique = $balise_generique['nom_generique']
454
-			and $file = include_spip('balise/' . strtolower($nom_balise_generique))
455
-			and function_exists('balise_' . $nom_balise_generique . '_dyn')
454
+			and $file = include_spip('balise/'.strtolower($nom_balise_generique))
455
+			and function_exists('balise_'.$nom_balise_generique.'_dyn')
456 456
 		) {
457 457
 			// et lui injecter en premier arg le nom de la balise
458 458
 			array_unshift($r, $nom);
459 459
 			$nom_balise = $nom_balise_generique;
460 460
 			if (!_DIR_RESTREINT) {
461
-				$file = _DIR_RESTREINT_ABS . $file;
461
+				$file = _DIR_RESTREINT_ABS.$file;
462 462
 			}
463 463
 		} else {
464 464
 			$msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]];
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		$n = '';
561 561
 		foreach (explode(',', $liste) as $val) {
562 562
 			if ($a = intval($val) and $val === strval($a)) {
563
-				$n .= ',' . $val;
563
+				$n .= ','.$val;
564 564
 			}
565 565
 		}
566 566
 		if (strlen($n)) {
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
 			// on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction
740 740
 			$i = 0;
741 741
 			do {
742
-				$where[$k] = remplace_sous_requete($w, '(' . calculer_select(
743
-					[$sous[1] . ' AS id'],
742
+				$where[$k] = remplace_sous_requete($w, '('.calculer_select(
743
+					[$sous[1].' AS id'],
744 744
 					$from,
745 745
 					$from_type,
746 746
 					$wheresub,
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 					$id,
754 754
 					$serveur,
755 755
 					false
756
-				) . ')');
756
+				).')');
757 757
 				if (!$i) {
758 758
 					$i = 1;
759 759
 					$wherestring = calculer_where_to_string($where[$k]);
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 		if ($sous[0] == 'SUBSELECT') {
774 774
 			// c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having)
775 775
 			array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ?
776
-			$where[$k] = remplace_sous_requete($w, '(' . calculer_select(
776
+			$where[$k] = remplace_sous_requete($w, '('.calculer_select(
777 777
 				$sous[1], # select
778 778
 				$sous[2], #from
779 779
 				[], #from_type
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 				$id,
789 789
 				$serveur,
790 790
 				false
791
-			) . ')');
791
+			).')');
792 792
 		}
793 793
 		array_pop($where_simples);
794 794
 	}
@@ -851,15 +851,15 @@  discard block
 block discarded – undo
851 851
 			// sans recours a preg_match
852 852
 			// un implode(' ',..) est fait dans reinjecte_joint un peu plus bas
853 853
 			$afrom[$t][$cle] = [
854
-				"\n" .
855
-				(isset($from_type[$cle]) ? $from_type[$cle] : 'INNER') . ' JOIN',
854
+				"\n".
855
+				(isset($from_type[$cle]) ? $from_type[$cle] : 'INNER').' JOIN',
856 856
 				$from[$cle],
857 857
 				"AS $cle",
858 858
 				'ON (',
859 859
 				"$cle.$c",
860 860
 				'=',
861 861
 				"$t.$carr",
862
-				($and ? 'AND ' . $and : '') .
862
+				($and ? 'AND '.$and : '').
863 863
 				')'
864 864
 			];
865 865
 			if (isset($afrom[$cle])) {
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 		$t = key($from);
898 898
 		$c = current($from);
899 899
 		reset($from);
900
-		$e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/';
900
+		$e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/';
901 901
 		if (
902 902
 			!(strpos($t, ' ') or // jointure des le depart cf boucle_doc
903 903
 				calculer_jointnul($t, $select, $e) or
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 			unset($afrom[$t][$nt]);
916 916
 			$afrom[$nt] = $afrom[$t];
917 917
 			unset($afrom[$t]);
918
-			$e = '/\b' . preg_quote($nfrom[6]) . '\b/';
918
+			$e = '/\b'.preg_quote($nfrom[6]).'\b/';
919 919
 			$t = $nfrom[4];
920 920
 			$alias = '';
921 921
 			// verifier que les deux cles sont homonymes, sinon installer un alias dans le select
@@ -926,14 +926,14 @@  discard block
 block discarded – undo
926 926
 			if ($newcle != $oldcle) {
927 927
 				// si l'ancienne cle etait deja dans le select avec un AS
928 928
 				// reprendre simplement ce AS
929
-				$as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/';
929
+				$as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/';
930 930
 				if (preg_match($as, implode(',', $select), $m)) {
931 931
 					$alias = '';
932 932
 				} else {
933
-					$alias = ', ' . $nfrom[4] . " AS $oldcle";
933
+					$alias = ', '.$nfrom[4]." AS $oldcle";
934 934
 				}
935 935
 			}
936
-			$select = remplacer_jointnul($t . $alias, $select, $e);
936
+			$select = remplacer_jointnul($t.$alias, $select, $e);
937 937
 			$join = remplacer_jointnul($t, $join, $e);
938 938
 			$where = remplacer_jointnul($t, $where, $e);
939 939
 			$having = remplacer_jointnul($t, $having, $e);
@@ -983,9 +983,9 @@  discard block
 block discarded – undo
983 983
 	} else {
984 984
 		$exp = '';
985 985
 		if (strtoupper($join) === 'AND') {
986
-			return $exp . join(" $join ", array_map('calculer_where_to_string', $v));
986
+			return $exp.join(" $join ", array_map('calculer_where_to_string', $v));
987 987
 		} else {
988
-			return $exp . join($join, $v);
988
+			return $exp.join($join, $v);
989 989
 		}
990 990
 	}
991 991
 }
@@ -1051,6 +1051,6 @@  discard block
 block discarded – undo
1051 1051
 	}
1052 1052
 
1053 1053
 	return $mime_type
1054
-	. (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_'
1055
-	. md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : ''));
1054
+	. (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_'
1055
+	. md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : ''));
1056 1056
 }
Please login to merge, or discard this patch.
ecrire/public/boucles.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
  **/
83 83
 function boucle_HIERARCHIE_dist($id_boucle, &$boucles) {
84 84
 	$boucle = &$boucles[$id_boucle];
85
-	$id_table = $boucle->id_table . '.id_rubrique';
85
+	$id_table = $boucle->id_table.'.id_rubrique';
86 86
 
87 87
 	// Si la boucle mere est une boucle RUBRIQUES il faut ignorer la feuille
88 88
 	// sauf en presence du critere {tout} (vu par phraser_html)
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		. '$hierarchie = calcul_hierarchie_in($id_rubrique,'
96 96
 		. (isset($boucle->modificateur['tout']) ? 'true' : 'false')
97 97
 		. ");\n\t"
98
-		. 'if (!$hierarchie) return "";' . "\n\t";
98
+		. 'if (!$hierarchie) return "";'."\n\t";
99 99
 
100 100
 	$boucle->where[] = ["'IN'", "'$id_table'", '"($hierarchie)"'];
101 101
 
Please login to merge, or discard this patch.