Completed
Push — master ( cacd66...717daf )
by cam
02:37 queued 21s
created
ecrire/action/inscrire_auteur.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	include_spip('base/abstract_sql');
64
-	$res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email']));
64
+	$res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email='.sql_quote($desc['email']));
65 65
 	// erreur ?
66 66
 	if (!$res) {
67 67
 		return _T('titre_probleme_technique');
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 
218 218
 	$login = $login_base;
219 219
 
220
-	for ($i = 1;; $i++) {
220
+	for ($i = 1; ; $i++) {
221 221
 		if (!sql_countsel('spip_auteurs', "login='$login'")) {
222 222
 			return $login;
223 223
 		}
224
-		$login = $login_base . $i;
224
+		$login = $login_base.$i;
225 225
 	}
226 226
 }
227 227
 
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
 	do {
362 362
 		// Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer
363 363
 		// tous les jetons connus pour vérifier le jeton d’un auteur.
364
-		$public = substr(creer_uniqid(), 0, 7) . '.';
365
-		$jeton = $public . creer_uniqid();
366
-		$jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site());
367
-		sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur));
368
-	} while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1);
364
+		$public = substr(creer_uniqid(), 0, 7).'.';
365
+		$jeton = $public.creer_uniqid();
366
+		$jeton_chiffre_prefixe = $public.Chiffrement::chiffrer($jeton, SpipCles::secret_du_site());
367
+		sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur='.intval($id_auteur));
368
+	} while (sql_countsel('spip_auteurs', 'cookie_oubli='.sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1);
369 369
 
370 370
 	return $jeton;
371 371
 }
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
  */
383 383
 function auteur_lire_jeton(int $id_auteur, bool $autoInit = false): ?string {
384 384
 	include_spip('base/abstract_sql');
385
-	$jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur);
385
+	$jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur='.$id_auteur);
386 386
 	if ($jeton_chiffre_prefixe) {
387 387
 		include_spip('inc/chiffrer');
388 388
 		$jeton_chiffre = substr($jeton_chiffre_prefixe, 8);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	$public = substr($jeton, 0, 8);
415 415
 
416 416
 	// Les auteurs qui ont un jetons ressemblant
417
-	$auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%'));
417
+	$auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE '.sql_quote($public.'%'));
418 418
 	foreach ($auteurs as $auteur) {
419 419
 		$jeton_chiffre = substr($auteur['cookie_oubli'], 8);
420 420
 		$_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site());
@@ -433,5 +433,5 @@  discard block
 block discarded – undo
433 433
  */
434 434
 function auteur_effacer_jeton($id_auteur) {
435 435
 	include_spip('base/abstract_sql');
436
-	return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur));
436
+	return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur='.intval($id_auteur));
437 437
 }
Please login to merge, or discard this patch.
ecrire/inc/presenter_enfants.php 1 patch
Spacing   +25 added lines, -26 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	$result = sql_select(
44 44
 		'id_rubrique, id_parent, titre, descriptif, lang',
45 45
 		'spip_rubriques',
46
-		'id_parent=' . intval($collection),
46
+		'id_parent='.intval($collection),
47 47
 		'',
48 48
 		'0+titre,titre',
49 49
 		$debut == -1 ? '' : "$debut,$limite"
@@ -74,19 +74,18 @@  discard block
 block discarded – undo
74 74
 				}
75 75
 			}
76 76
 
77
-			$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' :
78
-					http_img_pack(
77
+			$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack(
79 78
 						'auteur-0minirezo-16.png',
80 79
 						'',
81 80
 						" width='16' height='16'",
82 81
 						_T('image_administrer_rubrique')
83
-					)) .
84
-				" <a class='titremlien' dir='$lang_dir'" .
85
-				($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') .
86
-				" href='" .
87
-				generer_objet_url($id_rubrique, 'rubrique') .
88
-				"'><span class='titre'>" .
89
-				$rang . $titre
82
+					)).
83
+				" <a class='titremlien' dir='$lang_dir'".
84
+				($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : '').
85
+				" href='".
86
+				generer_objet_url($id_rubrique, 'rubrique').
87
+				"'><span class='titre'>".
88
+				$rang.$titre
90 89
 				. '</span>'
91 90
 				. (is_string($logo) ? $logo : '')
92 91
 				. '</a>';
@@ -96,8 +95,8 @@  discard block
 block discarded – undo
96 95
 				;
97 96
 
98 97
 			$res[] =
99
-				debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) .
100
-				$les_sous_enfants .
98
+				debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre).
99
+				$les_sous_enfants.
101 100
 				fin_cadre_sous_rub();
102 101
 		}
103 102
 	}
@@ -116,7 +115,7 @@  discard block
 block discarded – undo
116 115
  *  Le contenu du bloc dépliable
117 116
  */
118 117
 function sous_enfant_rub($collection2) {
119
-	$nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2));
118
+	$nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2));
120 119
 
121 120
 	$retour = '';
122 121
 	$pagination = '';
@@ -128,23 +127,23 @@  discard block
 block discarded – undo
128 127
 	 * Si > 500 on affiche une pagination
129 128
 	 */
130 129
 	if ($nb > $limite) {
131
-		$debut = _request('debut_rubrique' . $collection2) ?: $debut;
130
+		$debut = _request('debut_rubrique'.$collection2) ?: $debut;
132 131
 		$pagination = chercher_filtre('pagination');
133
-		$pagination = '<nav class="pagination">' . $pagination(
132
+		$pagination = '<nav class="pagination">'.$pagination(
134 133
 			$nb,
135
-			'_rubrique' . $collection2,
134
+			'_rubrique'.$collection2,
136 135
 			$debut,
137 136
 			$limite,
138 137
 			true,
139 138
 			'prive'
140
-		) . '</nav>';
139
+		).'</nav>';
141 140
 		$limite = $debut + $limite;
142 141
 	}
143 142
 
144 143
 	$result = sql_select(
145 144
 		'id_rubrique, id_parent, titre, lang',
146 145
 		'spip_rubriques',
147
-		'id_parent=' . intval($collection2),
146
+		'id_parent='.intval($collection2),
148 147
 		'',
149 148
 		'0+titre,titre',
150 149
 		$debut == -1 ? '' : "$debut,$limite"
@@ -164,14 +163,14 @@  discard block
 block discarded – undo
164 163
 		changer_typo($row['lang']);
165 164
 		$lang_dir = lang_dir($row['lang']);
166 165
 		if (autoriser('voir', 'rubrique', $id_rubrique2)) {
167
-			$retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_objet_url(
166
+			$retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_objet_url(
168 167
 				$id_rubrique2,
169 168
 				'rubrique'
170
-			) . "'>" . $rang2 . $titre2 . "</a></li>\n";
169
+			)."'>".$rang2.$titre2."</a></li>\n";
171 170
 		}
172 171
 	}
173 172
 
174
-	$retour = $pagination . $retour . $pagination;
173
+	$retour = $pagination.$retour.$pagination;
175 174
 
176 175
 	if (!$retour) {
177 176
 		return '';
@@ -180,7 +179,7 @@  discard block
 block discarded – undo
180 179
 	return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2")
181 180
 	. "\n<ul class='liste-items sous-sous-rub'>\n"
182 181
 	. $retour
183
-	. "</ul>\n" . fin_block() . "\n\n";
182
+	. "</ul>\n".fin_block()."\n\n";
184 183
 }
185 184
 
186 185
 /**
@@ -199,13 +198,13 @@  discard block
 block discarded – undo
199 198
 	$debut = 0;
200 199
 	$limite = 500;
201 200
 
202
-	$nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique));
201
+	$nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique));
203 202
 
204 203
 	if ($nb > $limite) {
205
-		$debut = _request('debut_rubrique' . $id_rubrique) ?: $debut;
204
+		$debut = _request('debut_rubrique'.$id_rubrique) ?: $debut;
206 205
 		$pagination = chercher_filtre('pagination');
207
-		$pagination = '<br class="nettoyeur"><nav class="pagination">' .
208
-			$pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') .
206
+		$pagination = '<br class="nettoyeur"><nav class="pagination">'.
207
+			$pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive').
209 208
 		'</nav>';
210 209
 	}
211 210
 
Please login to merge, or discard this patch.
ecrire/public/decompiler.php 1 patch
Spacing   +18 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	$type .= ($struct->type_requete ?: $struct->table_optionnelle);
30 30
 
31 31
 	if ($struct->jointures_explicites) {
32
-		$type .= ' ' . $struct->jointures_explicites;
32
+		$type .= ' '.$struct->jointures_explicites;
33 33
 	}
34 34
 	if ($struct->table_optionnelle) {
35 35
 		$type .= '?';
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 
39 39
 	$crit = $struct->param;
40 40
 	if ($crit and !is_array($crit[0])) {
41
-		$type = strtolower($type) . array_shift($crit);
41
+		$type = strtolower($type).array_shift($crit);
42 42
 	}
43 43
 	$crit = decompiler_criteres($struct, $fmt, $prof);
44 44
 
45
-	$f = 'format_boucle_' . $fmt;
45
+	$f = 'format_boucle_'.$fmt;
46 46
 
47 47
 	return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof);
48 48
 }
@@ -55,21 +55,20 @@  discard block
 block discarded – undo
55 55
 			$res[] = decompiler_($v, $fmt, $prof);
56 56
 		}
57 57
 	}
58
-	$file = is_string($struct->texte) ? $struct->texte :
59
-		decompiler_($struct->texte, $fmt, $prof);
60
-	$f = 'format_inclure_' . $fmt;
58
+	$file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof);
59
+	$f = 'format_inclure_'.$fmt;
61 60
 
62 61
 	return $f($file, $res, $prof);
63 62
 }
64 63
 
65 64
 function decompiler_texte($struct, $fmt = '', $prof = 0) {
66
-	$f = 'format_texte_' . $fmt;
65
+	$f = 'format_texte_'.$fmt;
67 66
 
68 67
 	return strlen($struct->texte) ? $f($struct->texte, $prof) : '';
69 68
 }
70 69
 
71 70
 function decompiler_polyglotte($struct, $fmt = '', $prof = 0) {
72
-	$f = 'format_polyglotte_' . $fmt;
71
+	$f = 'format_polyglotte_'.$fmt;
73 72
 
74 73
 	return $f($struct->traductions, $prof);
75 74
 }
@@ -82,7 +81,7 @@  discard block
 block discarded – undo
82 81
 
83 82
 	$filtres = decompiler_liste($struct->param, $fmt, $prof);
84 83
 
85
-	$f = 'format_idiome_' . $fmt;
84
+	$f = 'format_idiome_'.$fmt;
86 85
 
87 86
 	return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof);
88 87
 }
@@ -97,7 +96,7 @@  discard block
 block discarded – undo
97 96
 		}
98 97
 		$filtres = decompiler_liste($p, $fmt, $prof);
99 98
 	}
100
-	$f = 'format_champ_' . $fmt;
99
+	$f = 'format_champ_'.$fmt;
101 100
 
102 101
 	return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof);
103 102
 }
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
 	if (!is_array($sources)) {
107 106
 		return '';
108 107
 	}
109
-	$f = 'format_liste_' . $fmt;
108
+	$f = 'format_liste_'.$fmt;
110 109
 	$res = '';
111 110
 	foreach ($sources as $arg) {
112 111
 		if (!is_array($arg)) {
@@ -123,7 +122,7 @@  discard block
 block discarded – undo
123 122
 				and (strlen($v[0]->apres) == 1)
124 123
 				and $v[0]->apres == $v[0]->avant
125 124
 			) {
126
-				$args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres;
125
+				$args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres;
127 126
 			} else {
128 127
 				$args[] = decompiler_($v, $fmt, 0 - $prof);
129 128
 			}
@@ -146,7 +145,7 @@  discard block
 block discarded – undo
146 145
 		return '';
147 146
 	}
148 147
 	$res = '';
149
-	$f = 'format_critere_' . $fmt;
148
+	$f = 'format_critere_'.$fmt;
150 149
 	foreach ($sources as $crit) {
151 150
 		if (!is_array($crit)) {
152 151
 			continue;
@@ -159,13 +158,13 @@  discard block
 block discarded – undo
159 158
 				and $v[0]->type == 'texte'
160 159
 				and $v[0]->apres
161 160
 			) {
162
-				$args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]];
161
+				$args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]];
163 162
 			} else {
164 163
 				$res2 = [];
165 164
 				foreach ($v as $k => $p) {
166 165
 					if (
167 166
 						isset($p->type)
168
-						and function_exists($d = 'decompiler_' . $p->type)
167
+						and function_exists($d = 'decompiler_'.$p->type)
169 168
 					) {
170 169
 						$r = $d($p, $fmt, (0 - $prof));
171 170
 						$res2[] = [$p->type, $r];
@@ -193,7 +192,7 @@  discard block
 block discarded – undo
193 192
 		if (!isset($p->type)) {
194 193
 			continue;
195 194
 		} #??????
196
-		$d = 'decompiler_' . $p->type;
195
+		$d = 'decompiler_'.$p->type;
197 196
 		$next = $liste[$k + 1] ?? false;
198 197
 		// Forcer le champ etendu si son source (pas les reecritures)
199 198
 		// contenait des args et s'il est suivi d'espaces,
@@ -218,16 +217,16 @@  discard block
 block discarded – undo
218 217
 		}
219 218
 		$contenu[] = [$d($p, $fmt, $prof2), $p->type];
220 219
 	}
221
-	$f = 'format_suite_' . $fmt;
220
+	$f = 'format_suite_'.$fmt;
222 221
 
223 222
 	return $f($contenu);
224 223
 }
225 224
 
226 225
 function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') {
227
-	if (!include_spip('public/format_' . $fmt)) {
226
+	if (!include_spip('public/format_'.$fmt)) {
228 227
 		return "'$fmt'?";
229 228
 	}
230
-	$f = 'decompiler_' . $quoi;
229
+	$f = 'decompiler_'.$quoi;
231 230
 
232 231
 	return $f($liste, $fmt, $prof);
233 232
 }
Please login to merge, or discard this patch.
ecrire/inc/queue.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	$md5args = md5($arguments);
71 71
 
72 72
 	// si pas de date programee, des que possible
73
-	$duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND ';
73
+	$duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND ';
74 74
 	if (!$time) {
75 75
 		$time = time();
76 76
 		$duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution
@@ -96,9 +96,8 @@  discard block
 block discarded – undo
96 96
 			'id_job',
97 97
 			'spip_jobs',
98 98
 			$duplicate_where =
99
-				$duplicate_where . 'fonction=' . sql_quote($function)
100
-				. (($no_duplicate === 'function_only') ? '' :
101
-			' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file))
99
+				$duplicate_where.'fonction='.sql_quote($function)
100
+				. (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file))
102 101
 		)
103 102
 	) {
104 103
 		return $id_job;
@@ -111,9 +110,9 @@  discard block
 block discarded – undo
111 110
 	if (
112 111
 		$no_duplicate
113 112
 		and
114
-		$id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where")
113
+		$id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where")
115 114
 	) {
116
-		sql_delete('spip_jobs', 'id_job=' . intval($id_job));
115
+		sql_delete('spip_jobs', 'id_job='.intval($id_job));
117 116
 
118 117
 		return $id_prev;
119 118
 	}
@@ -125,9 +124,9 @@  discard block
 block discarded – undo
125 124
 	// ie cas d'un char non acceptables sur certains type de champs
126 125
 	// qui coupe la valeur
127 126
 	if (defined('_JQ_INSERT_CHECK_ARGS') and $id_job) {
128
-		$args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job));
127
+		$args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job));
129 128
 		if ($args !== $arguments) {
130
-			spip_log('arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' . var_export(
129
+			spip_log('arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : '.var_export(
131 130
 				$arguments,
132 131
 				true
133 132
 			), 'queue');
@@ -157,7 +156,7 @@  discard block
 block discarded – undo
157 156
 function queue_purger() {
158 157
 	include_spip('base/abstract_sql');
159 158
 	sql_delete('spip_jobs');
160
-	sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')');
159
+	sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')');
161 160
 	include_spip('inc/genie');
162 161
 	genie_queue_watch_dist();
163 162
 }
@@ -173,8 +172,8 @@  discard block
 block discarded – undo
173 172
 	include_spip('base/abstract_sql');
174 173
 
175 174
 	if (
176
-		$row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job))
177
-		and $res = sql_delete('spip_jobs', 'id_job=' . intval($id_job))
175
+		$row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job))
176
+		and $res = sql_delete('spip_jobs', 'id_job='.intval($id_job))
178 177
 	) {
179 178
 		queue_unlink_job($id_job);
180 179
 		// est-ce une tache cron qu'il faut relancer ?
@@ -224,7 +223,7 @@  discard block
 block discarded – undo
224 223
  *  resultat du sql_delete
225 224
  */
226 225
 function queue_unlink_job($id_job) {
227
-	return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job));
226
+	return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job));
228 227
 }
229 228
 
230 229
 /**
@@ -240,7 +239,7 @@  discard block
 block discarded – undo
240 239
 	// deserialiser les arguments
241 240
 	$args = unserialize($row['args']);
242 241
 	if (!is_array($args)) {
243
-		spip_log('arguments job errones ' . var_export($row, true), 'queue');
242
+		spip_log('arguments job errones '.var_export($row, true), 'queue');
244 243
 		$args = [];
245 244
 	}
246 245
 
@@ -257,14 +256,14 @@  discard block
 block discarded – undo
257 256
 	}
258 257
 
259 258
 	if (!function_exists($fonction)) {
260
-		spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue');
259
+		spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue');
261 260
 
262 261
 		return false;
263 262
 	}
264 263
 
265
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue');
264
+	spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue');
266 265
 	$res = $fonction(...$args);
267
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue');
266
+	spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue');
268 267
 
269 268
 	return $res;
270 269
 }
@@ -295,14 +294,14 @@  discard block
 block discarded – undo
295 294
 function queue_schedule($force_jobs = null) {
296 295
 	$time = time();
297 296
 	if (defined('_DEBUG_BLOCK_QUEUE')) {
298
-		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG);
297
+		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG);
299 298
 
300 299
 		return;
301 300
 	}
302 301
 
303 302
 	// rien a faire si le prochain job est encore dans le futur
304 303
 	if (queue_sleep_time_to_next_job() > 0 and (!$force_jobs or !count($force_jobs))) {
305
-		spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG);
304
+		spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG);
306 305
 
307 306
 		return;
308 307
 	}
@@ -323,7 +322,7 @@  discard block
 block discarded – undo
323 322
 	}
324 323
 	$end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE;
325 324
 
326
-	spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG);
325
+	spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG);
327 326
 
328 327
 	if (!defined('_JQ_MAX_JOBS_EXECUTE')) {
329 328
 		define('_JQ_MAX_JOBS_EXECUTE', 200);
@@ -337,19 +336,19 @@  discard block
 block discarded – undo
337 336
 	// lorsqu'un job cron n'a pas fini, sa priorite est descendue
338 337
 	// pour qu'il ne bloque pas les autres jobs en attente
339 338
 	if (is_array($force_jobs) and count($force_jobs)) {
340
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs);
339
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs);
341 340
 	} else {
342 341
 		$now = date('Y-m-d H:i:s', $time);
343
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now);
342
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now);
344 343
 	}
345 344
 
346 345
 	register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible
347
-	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1));
346
+	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1));
348 347
 	do {
349 348
 		if ($row = array_shift($res)) {
350 349
 			$nbj++;
351 350
 			// il faut un verrou, a base de sql_delete
352
-			if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) {
351
+			if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) {
353 352
 				#spip_log("JQ schedule job ".$nbj." OK",'jq');
354 353
 				// on reinsert dans la base aussitot avec un status=_JQ_PENDING
355 354
 				$row['status'] = _JQ_PENDING;
@@ -364,13 +363,13 @@  discard block
 block discarded – undo
364 363
 				queue_close_job($row, $time, $result);
365 364
 			}
366 365
 		}
367
-		spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG);
366
+		spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG);
368 367
 	} while ($nbj < _JQ_MAX_JOBS_EXECUTE and $row and $time < $end_time);
369
-	spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG);
368
+	spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG);
370 369
 
371 370
 	if ($row = array_shift($res)) {
372 371
 		queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP
373
-		spip_log('JQ encore !', 'jq' . _LOG_DEBUG);
372
+		spip_log('JQ encore !', 'jq'._LOG_DEBUG);
374 373
 	} else {
375 374
 		queue_update_next_job_time();
376 375
 	}
@@ -405,9 +404,9 @@  discard block
 block discarded – undo
405 404
 		}
406 405
 	}
407 406
 	// purger ses liens eventuels avec des objets
408
-	sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job']));
407
+	sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job']));
409 408
 	// supprimer le job fini
410
-	sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']));
409
+	sql_delete('spip_jobs', 'id_job='.intval($row['id_job']));
411 410
 }
412 411
 
413 412
 /**
@@ -480,18 +479,18 @@  discard block
 block discarded – undo
480 479
 	$res = sql_allfetsel(
481 480
 		'*',
482 481
 		'spip_jobs',
483
-		'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180))
482
+		'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180))
484 483
 	);
485 484
 	if (is_array($res)) {
486 485
 		foreach ($res as $row) {
487 486
 			queue_close_job($row, $time);
488
-			spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, 1), 'job_mort' . _LOG_ERREUR);
487
+			spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, 1), 'job_mort'._LOG_ERREUR);
489 488
 		}
490 489
 	}
491 490
 
492 491
 	// chercher la date du prochain job si pas connu
493 492
 	if (is_null($next) or is_null(queue_sleep_time_to_next_job())) {
494
-		$date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1');
493
+		$date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1');
495 494
 		$next = strtotime($date);
496 495
 	}
497 496
 	if (!is_null($next_time)) {
@@ -504,7 +503,7 @@  discard block
 block discarded – undo
504 503
 		if (is_null($nb_jobs_scheduled)) {
505 504
 			$nb_jobs_scheduled = sql_countsel(
506 505
 				'spip_jobs',
507
-				'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time))
506
+				'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time))
508 507
 			);
509 508
 		} elseif ($next <= $time) {
510 509
 			$nb_jobs_scheduled++;
@@ -573,7 +572,7 @@  discard block
 block discarded – undo
573 572
 	}
574 573
 
575 574
 	// ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent
576
-	if (file_exists($lock = _DIR_TMP . 'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
575
+	if (file_exists($lock = _DIR_TMP.'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
577 576
 		return $texte;
578 577
 	}
579 578
 
@@ -645,7 +644,7 @@  discard block
 block discarded – undo
645 644
 				$port = 80;
646 645
 		}
647 646
 		$fp = @fsockopen(
648
-			$scheme . $parts['host'],
647
+			$scheme.$parts['host'],
649 648
 			$parts['port'] ?? $port,
650 649
 			$errno,
651 650
 			$errstr,
@@ -655,13 +654,13 @@  discard block
 block discarded – undo
655 654
 		if ($fp) {
656 655
 			$host_sent = $parts['host'];
657 656
 			if (isset($parts['port']) and $parts['port'] !== $port) {
658
-				$host_sent .= ':' . $parts['port'];
657
+				$host_sent .= ':'.$parts['port'];
659 658
 			}
660 659
 			$timeout = 200; // ms
661 660
 			stream_set_timeout($fp, 0, $timeout * 1000);
662
-			$query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : '');
663
-			$out = 'GET ' . $query . " HTTP/1.1\r\n";
664
-			$out .= 'Host: ' . $host_sent . "\r\n";
661
+			$query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : '');
662
+			$out = 'GET '.$query." HTTP/1.1\r\n";
663
+			$out .= 'Host: '.$host_sent."\r\n";
665 664
 			$out .= "Connection: Close\r\n\r\n";
666 665
 			fwrite($fp, $out);
667 666
 			spip_timer('read');
Please login to merge, or discard this patch.
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		if (!$fonc) {
139 139
 			$fonc = $GLOBALS['debug_objets']['principal'];
140 140
 		}
141
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
141
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : ''));
142 142
 	}
143 143
 	if ($message === false) {
144 144
 		lang_select();
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	$fond = $GLOBALS['fond'] ?? '';
168 168
 	// une erreur critique sort $message en array
169 169
 	$debug = is_array($msg) ? $msg[1] : $msg;
170
-	spip_log('Debug: ' . $debug . ' (' . $fond . ')');
170
+	spip_log('Debug: '.$debug.' ('.$fond.')');
171 171
 
172 172
 	return $msg;
173 173
 }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 function debusquer_bandeau($erreurs) {
176 176
 
177 177
 	if (!empty($erreurs)) {
178
-		$n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')];
178
+		$n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')];
179 179
 
180 180
 		return debusquer_navigation($erreurs, $n);
181 181
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -208,25 +208,25 @@  discard block
 block discarded – undo
208 208
 			$valeur_simple = [];
209 209
 			foreach ($valeur as $v) {
210 210
 				if (is_array($v)) {
211
-					$valeur_simple[] = 'array:' . count($v);
211
+					$valeur_simple[] = 'array:'.count($v);
212 212
 				} elseif (is_object($v)) {
213 213
 					$valeur_simple[] = get_class($v);
214 214
 				} elseif (is_string($v)) {
215
-					$valeur_simple[] = "'" . $v . "'";
215
+					$valeur_simple[] = "'".$v."'";
216 216
 				} else {
217 217
 					$valeur_simple[] = $v;
218 218
 				}
219 219
 			}
220 220
 			$n = count($valeur);
221
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
222
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
221
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
222
+			$valeur .= '['.join(', ', $valeur_simple).']';
223 223
 		} elseif (is_object($valeur)) {
224 224
 			$valeur = get_class($valeur);
225 225
 		} elseif (is_string($valeur)) {
226
-			$valeur = "'" . $valeur . "'";
226
+			$valeur = "'".$valeur."'";
227 227
 		}
228
-		$res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom))
229
-			. '</strong></td><td>:&nbsp;' . nl2br((string) entites_html($valeur))
228
+		$res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom))
229
+			. '</strong></td><td>:&nbsp;'.nl2br((string) entites_html($valeur))
230 230
 			. "</td></tr>\n";
231 231
 	}
232 232
 
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
 				$nom_code = $lieu->descr['nom'];
255 255
 				$skel = $lieu->descr['sourcefile'];
256 256
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
257
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
257
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
258 258
 				$skel = "<a href='$h3'><b>$skel</b></a>";
259 259
 				if ($boucle) {
260
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
260
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
261 261
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
262 262
 				}
263 263
 			}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	}
347 347
 
348 348
 	// Requete erronee
349
-	$err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
349
+	$err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
350 350
 		. spip_htmlspecialchars($msg)
351 351
 		. "\n<br /><span style='color: red'><b>"
352 352
 		. spip_htmlspecialchars($query)
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') {
362 362
 
363
-	$id = $nom . $boucle;
363
+	$id = $nom.$boucle;
364 364
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
365 365
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
366 366
 			if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) {
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		}
407 407
 	}
408 408
 	}
409
-	$incl = ',' . $reg[1] . '[.]\w$,';
409
+	$incl = ','.$reg[1].'[.]\w$,';
410 410
 
411 411
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
412 412
 		if (preg_match($incl, $v)) {
@@ -421,16 +421,13 @@  discard block
 block discarded – undo
421 421
 	[$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom);
422 422
 
423 423
 	if (!$boucle) {
424
-		return !$ligne ? '' :
425
-			(' (' .
426
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
427
-					_T('squelette_ligne')) .
424
+		return !$ligne ? '' : (' ('.
425
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
428 426
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
429 427
 	} else {
430 428
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
431 429
 
432
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
433
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
430
+		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
434 431
 	}
435 432
 }
436 433
 
@@ -452,14 +449,14 @@  discard block
 block discarded – undo
452 449
 
453 450
 	$s = preg_replace(
454 451
 		',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
455
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
452
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
456 453
 		$s
457 454
 	);
458 455
 
459 456
 
460 457
 	$tableau = explode('<br />', $s);
461 458
 
462
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
459
+	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n";
463 460
 
464 461
 	$format10 = str_replace('white', 'lightgrey', $format);
465 462
 	$formaterr = 'color: red;';
@@ -503,7 +500,7 @@  discard block
 block discarded – undo
503 500
 	. '" style="cursor: pointer;">'
504 501
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
505 502
 	. '</div>
506
-	' . $res . "</div>\n";
503
+	' . $res."</div>\n";
507 504
 }
508 505
 
509 506
 // l'environnement graphique du debuggueur
@@ -525,14 +522,14 @@  discard block
 block discarded – undo
525 522
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
526 523
 				[$legend, $texte, $res2] = debusquer_source($fonc, $mode);
527 524
 				$texte .= $res2;
528
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
529
-				$legend = _T('zbug_' . $mode);
530
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
525
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
526
+				$legend = _T('zbug_'.$mode);
527
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
531 528
 				$texte = ancre_texte($texte, ['', '']);
532 529
 			}
533 530
 		} else {
534 531
 			if (strlen(trim($res))) {
535
-				return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
532
+				return "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
536 533
 			} else {
537 534
 				// cas de l'appel sur erreur: montre la page
538 535
 				return $GLOBALS['debug_objets']['resultat']['tout'] ?? '';
@@ -540,7 +537,7 @@  discard block
 block discarded – undo
540 537
 		}
541 538
 	} else {
542 539
 		$valider = charger_fonction('valider', 'xml');
543
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
540
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
544 541
 		// Si erreur, signaler leur nombre dans le formulaire admin
545 542
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
546 543
 		[$texte, $err] = emboite_texte($val, $fonc, $self);
@@ -551,14 +548,14 @@  discard block
 block discarded – undo
551 548
 		} else {
552 549
 			$err = ": $err";
553 550
 		}
554
-		$legend = _T('validation') . ' ' . $err;
551
+		$legend = _T('validation').' '.$err;
555 552
 		$res = $id = '';
556 553
 	}
557 554
 
558 555
 	return !trim($texte) ? '' : (
559
-		"<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
556
+		"<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
560 557
 		. "<div id='debug_boucle'><fieldset$id><legend>"
561
-		. "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> &#8593; "
558
+		. "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> &#8593; "
562 559
 		. ($legend ?: $mode)
563 560
 		. '</a></legend>'
564 561
 		. $texte
@@ -569,7 +566,7 @@  discard block
 block discarded – undo
569 566
 
570 567
 function emboite_texte($res, $fonc = '', $self = '') {
571 568
 	$errs = $res->err;
572
-	$texte = $res->entete . ($errs ? '' : $res->page);
569
+	$texte = $res->entete.($errs ? '' : $res->page);
573 570
 
574 571
 	if (!$texte and !$errs) {
575 572
 		return [ancre_texte('', ['', '']), false];
@@ -625,7 +622,7 @@  discard block
 block discarded – undo
625 622
 		$err = "<h2 style='text-align: center'>"
626 623
 			. $i
627 624
 			. "<a href='#fin_err'>"
628
-			. ' ' . _T('erreur_texte')
625
+			. ' '._T('erreur_texte')
629 626
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
630 627
 			. $err
631 628
 			. " </table><a id='fin_err'></a>";
@@ -635,9 +632,9 @@  discard block
 block discarded – undo
635 632
 		[$msg, $fermant, $ouvrant] = $errs[0];
636 633
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
637 634
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
638
-		$err = $msg .
639
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
640
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
635
+		$err = $msg.
636
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
637
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
641 638
 
642 639
 		return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err];
643 640
 	}
@@ -670,7 +667,7 @@  discard block
 block discarded – undo
670 667
 			['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]]
671 668
 		);
672 669
 
673
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
670
+		$res .= "<fieldset id='f_".$nom."'><legend>"
674 671
 			. $t_skel
675 672
 			. ' '
676 673
 			. $sourcefile
@@ -685,7 +682,7 @@  discard block
 block discarded – undo
685 682
 			. "'>"
686 683
 			. _T('zbug_calcul')
687 684
 			. '</a></legend>'
688
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
685
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
689 686
 			. debusquer_contexte($contexte[$sourcefile])
690 687
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
691 688
 		. "</fieldset>\n";
@@ -706,33 +703,33 @@  discard block
 block discarded – undo
706 703
 			$nom = $boucle->id_boucle;
707 704
 			$req = $boucle->type_requete;
708 705
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
709
-			$self2 = $self . '&amp;var_mode_objet=' . $objet;
710
-
711
-			$res .= "\n<tr style='background-color: " .
712
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
713
-				"'><td  align='right'>$i</td><td>\n" .
714
-				"<a  class='debug_link_boucle' href='" .
715
-				$self2 .
716
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
717
-				_T('zbug_boucle') .
718
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
719
-				$self2 .
720
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
721
-				_T('zbug_resultat') .
722
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
723
-				$self2 .
724
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
725
-				_T('zbug_code') .
726
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
727
-				str_replace('var_mode=', 'var_profile=', $self2) .
728
-				"'>" .
729
-				_T('zbug_calcul') .
730
-				"</a></td><td>\n" .
731
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
732
-				"</td><td>\n" .
733
-				$req .
734
-				"</td><td>\n" .
735
-				spip_htmlspecialchars($crit) .
706
+			$self2 = $self.'&amp;var_mode_objet='.$objet;
707
+
708
+			$res .= "\n<tr style='background-color: ".
709
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
710
+				"'><td  align='right'>$i</td><td>\n".
711
+				"<a  class='debug_link_boucle' href='".
712
+				$self2.
713
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
714
+				_T('zbug_boucle').
715
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
716
+				$self2.
717
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
718
+				_T('zbug_resultat').
719
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
720
+				$self2.
721
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
722
+				_T('zbug_code').
723
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
724
+				str_replace('var_mode=', 'var_profile=', $self2).
725
+				"'>".
726
+				_T('zbug_calcul').
727
+				"</a></td><td>\n".
728
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
729
+				"</td><td>\n".
730
+				$req.
731
+				"</td><td>\n".
732
+				spip_htmlspecialchars($crit).
736 733
 				'</td></tr>';
737 734
 		}
738 735
 	}
@@ -759,7 +756,7 @@  discard block
 block discarded – undo
759 756
 		}
760 757
 		//  permettre le copier/coller facile
761 758
 		// $res = ancre_texte($req, array(), true);
762
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
759
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
763 760
 		//  formatage et affichage des resultats bruts de la requete
764 761
 		$ress_req = spip_query($req);
765 762
 		$brut_sql = '';
@@ -769,10 +766,10 @@  discard block
 block discarded – undo
769 766
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
770 767
 		while ($retours_sql = sql_fetch($ress_req)) {
771 768
 			if ($num <= $max_aff) {
772
-				$brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>';
769
+				$brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>';
773 770
 				$brut_sql .= '<p>';
774 771
 				foreach ($retours_sql as $key => $val) {
775
-					$brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
772
+					$brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n";
776 773
 				}
777 774
 				$brut_sql .= '</p>';
778 775
 			}
@@ -783,14 +780,14 @@  discard block
 block discarded – undo
783 780
 			//  ne pas afficher les $contexte_inclus
784 781
 			$view = preg_replace(',<\?php.+\?[>],Uims', '', $view);
785 782
 			if ($view) {
786
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>';
783
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>';
787 784
 			}
788 785
 		}
789 786
 	} elseif ($affiche == 'code') {
790 787
 		$legend = $nom;
791
-		$res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>');
788
+		$res = ancre_texte('<'."?php\n".$quoi."\n?".'>');
792 789
 	} elseif ($affiche == 'boucle') {
793
-		$legend = _T('zbug_boucle') . ' ' . $nom;
790
+		$legend = _T('zbug_boucle').' '.$nom;
794 791
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
795 792
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
796 793
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -808,23 +805,23 @@  discard block
 block discarded – undo
808 805
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
809 806
 	include_spip('inc/texte'); // pour corriger_typo
810 807
 
811
-	return _DOCTYPE_ECRIRE .
812
-	html_lang_attributes() .
813
-	"<head>\n<title>" .
814
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
815
-		_T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' .
816
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
817
-	")</title>\n" .
818
-	"<meta http-equiv='Content-Type' content='text/html" .
819
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
820
-	"' />\n" .
808
+	return _DOCTYPE_ECRIRE.
809
+	html_lang_attributes().
810
+	"<head>\n<title>".
811
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
812
+		_T('admin_debug').' '.spip_htmlspecialchars($titre).' ('.
813
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
814
+	")</title>\n".
815
+	"<meta http-equiv='Content-Type' content='text/html".
816
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
817
+	"' />\n".
821 818
 	http_script('', 'jquery.js')
822
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
823
-	. "' type='text/css' />" .
824
-	"</head>\n" .
825
-	"<body style='margin:0 10px;'>\n" .
826
-	"<div id='spip-debug-header'>" .
827
-	$corps .
828
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
819
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
820
+	. "' type='text/css' />".
821
+	"</head>\n".
822
+	"<body style='margin:0 10px;'>\n".
823
+	"<div id='spip-debug-header'>".
824
+	$corps.
825
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
829 826
 	'</div></body></html>';
830 827
 }
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
 	// in fine renommer le prefixe si besoin
107 107
 	if (strpos($name, 'spip_') === 0) {
108
-		$name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5);
108
+		$name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5);
109 109
 	}
110 110
 
111 111
 	#spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	}
164 164
 	foreach ($_COOKIE as $name => $value) {
165 165
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
166
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
166
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
167 167
 			$_COOKIE[$spipname] = $value;
168 168
 			$GLOBALS[$spipname] = $value;
169 169
 		}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 // mais apres la fonction autoriser()
121 121
 if ($f = find_in_path('mes_fonctions.php')) {
122 122
 	global $dossier_squelettes;
123
-	include_once(_ROOT_CWD . $f);
123
+	include_once(_ROOT_CWD.$f);
124 124
 }
125 125
 
126 126
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$qui = $GLOBALS['visiteur_session'] ?: [];
163 163
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
164 164
 	} elseif (is_numeric($qui)) {
165
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
165
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
166 166
 	}
167 167
 
168 168
 	// Admins restreints, on construit ici (pas generique mais...)
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	}
173 173
 
174 174
 	spip_log(
175
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
176
-		'autoriser' . _LOG_DEBUG
175
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
176
+		'autoriser'._LOG_DEBUG
177 177
 	);
178 178
 
179 179
 	// passer par objet_type pour avoir les alias
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
190 190
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
191 191
 	) {
192
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
192
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
193 193
 		return true;
194 194
 	}
195 195
 
@@ -198,18 +198,18 @@  discard block
 block discarded – undo
198 198
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
199 199
 	$fonctions = $type
200 200
 		? [
201
-			'autoriser_' . $type . '_' . $faire,
202
-			'autoriser_' . $type . '_' . $faire . '_dist',
203
-			'autoriser_' . $type,
204
-			'autoriser_' . $type . '_dist',
205
-			'autoriser_' . $faire,
206
-			'autoriser_' . $faire . '_dist',
201
+			'autoriser_'.$type.'_'.$faire,
202
+			'autoriser_'.$type.'_'.$faire.'_dist',
203
+			'autoriser_'.$type,
204
+			'autoriser_'.$type.'_dist',
205
+			'autoriser_'.$faire,
206
+			'autoriser_'.$faire.'_dist',
207 207
 			'autoriser_defaut',
208 208
 			'autoriser_defaut_dist'
209 209
 		]
210 210
 		: [
211
-			'autoriser_' . $faire,
212
-			'autoriser_' . $faire . '_dist',
211
+			'autoriser_'.$faire,
212
+			'autoriser_'.$faire.'_dist',
213 213
 			'autoriser_defaut',
214 214
 			'autoriser_defaut_dist'
215 215
 		];
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	}
223 223
 
224 224
 	spip_log(
225
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
226
-		'autoriser' . _LOG_DEBUG
225
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
226
+		'autoriser'._LOG_DEBUG
227 227
 	);
228 228
 
229 229
 	return $a;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
373 373
 
374 374
 	// Le visiteur a-t-il un statut prevu par la config ?
375
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
375
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
376 376
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
377 377
 	}
378 378
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 				} // pas de champ passe a la demande => NIET
431 431
 				$previsu = explode(',', $c['previsu']);
432 432
 				// regarder si ce statut est autorise pour l'auteur
433
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
433
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
434 434
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
435 435
 					// sinon l’auteur en session
436 436
 					include_spip('inc/securiser_action');
@@ -444,12 +444,12 @@  discard block
 block discarded – undo
444 444
 
445 445
 					if (!$id_auteur) {
446 446
 						return false;
447
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
447
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
448 448
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
449 449
 					} elseif (
450 450
 						!sql_countsel(
451 451
 							'spip_auteurs_liens',
452
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
452
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
453 453
 						)
454 454
 					) {
455 455
 						return false;
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 			// multilinguisme par secteur et objet rattaché à une rubrique
495 495
 			$primary = id_table_objet($type);
496 496
 			if ($table != 'spip_rubriques') {
497
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
497
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
498 498
 			} else {
499 499
 				$id_rubrique = $id;
500 500
 			}
501
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
501
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
502 502
 			if (!$id_secteur > 0) {
503 503
 				$id_secteur = $id_rubrique;
504 504
 			}
505
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
506
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
505
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
506
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
507 507
 			if ($langue_secteur != $langue_objet) {
508 508
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
509 509
 				return true;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
512 512
 				return false;
513 513
 			} else {
514
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
514
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
515 515
 				if ($id_parent != 0) {
516 516
 					// sous-rubriques : pas de choix de langue
517 517
 					return false;
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 
564 564
 	if (!isset($opt['statut'])) {
565 565
 		if (isset($desc['field']['statut'])) {
566
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
566
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
567 567
 		} else {
568 568
 			$statut = 'publie';
569 569
 		} // pas de statut => publie
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
 		return false;
738 738
 	}
739 739
 
740
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
740
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
741 741
 		return false;
742 742
 	}
743 743
 
744
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
744
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
745 745
 		return false;
746 746
 	}
747 747
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	if (!$id) {
779 779
 		return false;
780 780
 	}
781
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
781
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
782 782
 
783 783
 	return
784 784
 		$r
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 				(!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true))
790 790
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
791 791
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
792
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
792
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
793 793
 			)
794 794
 		);
795 795
 }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 		if (!$id) {
848 848
 			return false;
849 849
 		}
850
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
850
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
851 851
 	}
852 852
 
853 853
 	return
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 		or
859 859
 		($id
860 860
 			and $qui['id_auteur']
861
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
861
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
862 862
 }
863 863
 
864 864
 
@@ -879,8 +879,8 @@  discard block
 block discarded – undo
879 879
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
880 880
 	# securite, mais on aurait pas du arriver ici !
881 881
 	if (
882
-		function_exists($f = 'autoriser_' . $type . '_voir')
883
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
882
+		function_exists($f = 'autoriser_'.$type.'_voir')
883
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
884 884
 	) {
885 885
 		return $f($faire, $type, $id, $qui, $opt);
886 886
 	}
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 	$n = sql_fetsel(
1012 1012
 		'A.id_article',
1013 1013
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1014
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1014
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1015 1015
 	);
1016 1016
 
1017 1017
 	return $n ? true : false;
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 		and $r = sql_allfetsel(
1224 1224
 			'id_objet',
1225 1225
 			'spip_auteurs_liens',
1226
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1226
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1227 1227
 		)
1228 1228
 		and is_countable($r) ? count($r) : 0
1229 1229
 	) {
@@ -1908,8 +1908,8 @@  discard block
 block discarded – undo
1908 1908
 function auteurs_objet($objet, $id_objet, $cond = '') {
1909 1909
 	$objet = objet_type($objet);
1910 1910
 	$where = [
1911
-		'objet=' . sql_quote($objet),
1912
-		'id_objet=' . intval($id_objet)
1911
+		'objet='.sql_quote($objet),
1912
+		'id_objet='.intval($id_objet)
1913 1913
 	];
1914 1914
 	if (!empty($cond)) {
1915 1915
 		if (is_array($cond)) {
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 	return sql_allfetsel(
1945 1945
 		'id_auteur',
1946 1946
 		'spip_auteurs_liens',
1947
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1947
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1948 1948
 	);
1949 1949
 }
1950 1950
 
Please login to merge, or discard this patch.
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	];
44 44
 	$options = array_merge($defaut, $options);
45 45
 	if (is_numeric($options['expires']) and $options['expires'] > 0) {
46
-		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT';
46
+		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT';
47 47
 	}
48 48
 
49 49
 	if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) {
73 73
 	// toujours envoyer un content type, meme vide !
74 74
 	header('Accept-Ranges: bytes');
75
-	header('Content-Type: ' . $content_type);
75
+	header('Content-Type: '.$content_type);
76 76
 
77 77
 	if ($attachment) {
78 78
 		$f = basename($fichier);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	else {
91 91
 		$f = basename($fichier);
92 92
 		header("Content-Disposition: inline; filename=\"$f\";");
93
-		header('Expires: ' . $expires); // set expiration time
93
+		header('Expires: '.$expires); // set expiration time
94 94
 	}
95 95
 }
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
143 143
 	if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
144 144
 		### Offset signifies where we should begin to read the file
145
-		$byteOffset = (int)$match[1];
145
+		$byteOffset = (int) $match[1];
146 146
 
147 147
 
148 148
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
149 149
 		if (isset($match[2])) {
150
-			$finishBytes = (int)$match[2];
150
+			$finishBytes = (int) $match[2];
151 151
 			$byteLength = $finishBytes + 1;
152 152
 		} else {
153 153
 			$finishBytes = $fileSize - 1;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 	// partial content
170 170
 	header('HTTP/1.1 206 Partial content');
171
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
171
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
172 172
 
173 173
 
174 174
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.
ecrire/inc/install.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  **/
45 45
 function install_fichier_connexion($nom, $texte) {
46
-	$texte = '<' . "?php\n"
46
+	$texte = '<'."?php\n"
47 47
 		. "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n"
48 48
 		. $texte;
49 49
 
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 		return $regs;
113 113
 	} else {
114 114
 		$ar = '\s*\'([^\']*)\'';
115
-		$r = '\s*,' . $ar;
115
+		$r = '\s*,'.$ar;
116 116
 		$r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#";
117 117
 		if (preg_match($r, $s, $regs)) {
118
-			$regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';');
118
+			$regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';');
119 119
 			array_shift($regs);
120 120
 			array_shift($regs);
121 121
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	// Si on n'a pas la bonne version de PHP, c'est la fin
181 181
 	if ($err) {
182 182
 		die("<div class='error'>"
183
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"
183
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"
184 184
 			. "<li><strong>{$err[0]}</strong></li>\n</ul></div>");
185 185
 	}
186 186
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 	if ($err) {
203 203
 		echo "<div class='error'>"
204
-			. '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>";
204
+			. '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>";
205 205
 		foreach ($err as $e) {
206 206
 			echo "<li><strong>$e</strong></li>\n";
207 207
 		}
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
 
236 236
 function info_etape($titre, $complement = '') {
237
-	return '<h2>' . $titre . "</h2>\n" .
238
-	($complement ? '' . $complement . "\n" : '');
237
+	return '<h2>'.$titre."</h2>\n".
238
+	($complement ? ''.$complement."\n" : '');
239 239
 }
240 240
 
241 241
 /**
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
 		$code = _T('bouton_suivant');
250 250
 	}
251 251
 	static $suivant = 0;
252
-	$id = 'suivant' . (($suivant > 0) ? strval($suivant) : '');
252
+	$id = 'suivant'.(($suivant > 0) ? strval($suivant) : '');
253 253
 	$suivant += 1;
254 254
 
255
-	return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" .
256
-	$code .
255
+	return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"".
256
+	$code.
257 257
 	" >>\" /></p>\n";
258 258
 }
259 259
 
260 260
 function info_progression_etape($en_cours, $phase, $dir, $erreur = false) {
261 261
 	$intitule_etat = [];
262 262
 	//$en_cours = _request('etape')?_request('etape'):"";
263
-	$liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$');
263
+	$liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$');
264 264
 	$debut = 1;
265 265
 	$etat = 'ok';
266 266
 	$last = count($liste);
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
 			$aff_etapes .= "<li class='$class'><div class='fond'>";
301 301
 			$aff_etapes .= ($debut == $en_cours) ? '<strong>' : '';
302
-			$aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
302
+			$aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em>&nbsp;: </em>";
303 303
 			$aff_etapes .= $intitule_etat["$phase"][$debut];
304 304
 			$aff_etapes .= ($debut == $en_cours) ? '</strong>' : '';
305 305
 			$aff_etapes .= '</div></li>';
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 
315 315
 
316 316
 function fieldset($legend, $champs = [], $apres = '', $avant = '') {
317
-	return "<fieldset>\n" .
318
-	$avant .
319
-	($legend ? '<legend>' . $legend . "</legend>\n" : '') .
320
-	fieldset_champs($champs) .
321
-	$apres .
317
+	return "<fieldset>\n".
318
+	$avant.
319
+	($legend ? '<legend>'.$legend."</legend>\n" : '').
320
+	fieldset_champs($champs).
321
+	$apres.
322 322
 	"</fieldset>\n";
323 323
 }
324 324
 
@@ -328,18 +328,18 @@  discard block
 block discarded – undo
328 328
 		$type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text');
329 329
 		$class = isset($contenu['hidden']) ? '' : "class='formo' size='40' ";
330 330
 		if (isset($contenu['alternatives'])) {
331
-			$fieldset .= $contenu['label'] . "\n";
331
+			$fieldset .= $contenu['label']."\n";
332 332
 			foreach ($contenu['alternatives'] as $valeur => $label) {
333
-				$fieldset .= "<input type='radio' name='" . $nom .
333
+				$fieldset .= "<input type='radio' name='".$nom.
334 334
 					"' id='$nom-$valeur' value='$valeur'"
335 335
 					. (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '')
336 336
 					. "/>\n";
337
-				$fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n";
337
+				$fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n";
338 338
 			}
339 339
 			$fieldset .= "<br />\n";
340 340
 		} else {
341
-			$fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n";
342
-			$fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'"
341
+			$fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n";
342
+			$fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'"
343 343
 				. (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '')
344 344
 				. ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '')
345 345
 				. " />\n";
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
 function install_select_serveur() {
353 353
 	$options = [];
354
-	$dir = _DIR_RESTREINT . 'req/';
354
+	$dir = _DIR_RESTREINT.'req/';
355 355
 	$d = opendir($dir);
356 356
 	if (!$d) {
357 357
 		return [];
@@ -359,17 +359,17 @@  discard block
 block discarded – undo
359 359
 	while (($f = readdir($d)) !== false) {
360 360
 		if (
361 361
 			(preg_match('/^(.*)[.]php$/', $f, $s))
362
-			and is_readable($f = $dir . $f)
362
+			and is_readable($f = $dir.$f)
363 363
 		) {
364 364
 			require_once($f);
365 365
 			$s = $s[1];
366
-			$v = 'spip_versions_' . $s;
366
+			$v = 'spip_versions_'.$s;
367 367
 			if (function_exists($v) and $v()) {
368 368
 				$titre = _T("install_select_type_$s");
369 369
 				// proposer mysql par defaut si dispo
370 370
 				$checked = ($s == 'mysql' ? " checked='checked'" : '');
371 371
 				$options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>"
372
-					. "<label for='$s'>" . ($titre ?: $s) . '</label></li>';
372
+					. "<label for='$s'>".($titre ?: $s).'</label></li>';
373 373
 			} else {
374 374
 				spip_log("$s: portage indisponible");
375 375
 			}
@@ -387,8 +387,8 @@  discard block
 block discarded – undo
387 387
 		"\n<input type='hidden' name='etape' value='$etape' />"
388 388
 		. $hidden
389 389
 		. (_request('echec') ?
390
-			('<p><b>' . _T('avis_connexion_echec_1') .
391
-				'</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>')
390
+			('<p><b>'._T('avis_connexion_echec_1').
391
+				'</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>')
392 392
 			: '')
393 393
 
394 394
 		. ($jquery ? http_script('', 'jquery.js') : '')
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 		});')
427 427
 
428 428
 		. ($server_db
429
-			? '<input type="hidden" name="server_db" value="' . $server_db . '" />'
429
+			? '<input type="hidden" name="server_db" value="'.$server_db.'" />'
430 430
 			. (($predef[0])
431
-				? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>')
431
+				? ('<h3>'._T('install_serveur_hebergeur').'</h3>')
432 432
 				: '')
433 433
 			: ('<fieldset><legend>'
434 434
 				. _T('install_select_type_db')
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
 				. "\n</ul>\n</div></fieldset>")
444 444
 		)
445 445
 		. '<div id="install_adresse_base_hebergeur">'
446
-		. '<p>' . _T('texte_connexion_mysql') . '</p>'
446
+		. '<p>'._T('texte_connexion_mysql').'</p>'
447 447
 		. ($predef[1]
448
-			? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>'
448
+			? '<h3>'._T('install_adresse_base_hebergeur').'</h3>'
449 449
 			: fieldset(
450 450
 				_T('entree_base_donnee_1'),
451 451
 				[
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
 		. '<div id="install_login_base_hebergeur">'
462 462
 		. ($predef[2]
463
-			? '<h3>' . _T('install_login_base_hebergeur') . '</h3>'
463
+			? '<h3>'._T('install_login_base_hebergeur').'</h3>'
464 464
 			: fieldset(
465 465
 				_T('entree_login_connexion_1'),
466 466
 				[
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 
476 476
 		. '<div id="install_pass_base_hebergeur">'
477 477
 		. ($predef[3]
478
-			? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>'
478
+			? '<h3>'._T('install_pass_base_hebergeur').'</h3>'
479 479
 			: fieldset(
480 480
 				_T('entree_mot_passe_1'),
481 481
 				[
@@ -497,20 +497,20 @@  discard block
 block discarded – undo
497 497
 function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) {
498 498
 	return ((defined('_INSTALL_HOST_DB'))
499 499
 		? ''
500
-		: "\n<input type='hidden' name='adresse_db'  value=\"" . spip_htmlspecialchars($adresse_db) . '" />'
500
+		: "\n<input type='hidden' name='adresse_db'  value=\"".spip_htmlspecialchars($adresse_db).'" />'
501 501
 	)
502 502
 	. ((defined('_INSTALL_USER_DB'))
503 503
 		? ''
504
-		: "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />'
504
+		: "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />'
505 505
 	)
506 506
 	. ((defined('_INSTALL_PASS_DB'))
507 507
 		? ''
508
-		: "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />'
508
+		: "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />'
509 509
 	)
510 510
 
511 511
 	. ((defined('_INSTALL_SERVER_DB'))
512 512
 		? ''
513
-		: "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />'
513
+		: "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />'
514 514
 	);
515 515
 }
516 516
 
Please login to merge, or discard this patch.