Completed
Pull Request — master (#42)
by
unknown
01:14
created
ecrire/inc/preselectionner_parent_nouvel_objet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$id_rubrique = $GLOBALS['connect_id_rubrique'][0];
43 43
 	} elseif (
44 44
 		is_int(_AUTO_SELECTION_RUBRIQUE)
45
-		and sql_fetsel('id_rubrique', 'spip_rubriques', 'id_rubrique=' . intval(_AUTO_SELECTION_RUBRIQUE))
45
+		and sql_fetsel('id_rubrique', 'spip_rubriques', 'id_rubrique='.intval(_AUTO_SELECTION_RUBRIQUE))
46 46
 	) {
47 47
 		$id_rubrique = _AUTO_SELECTION_RUBRIQUE;
48 48
 	} else {
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 		$id_rubrique = $row_rub['id_rubrique'];
52 52
 	}
53 53
 	// si le choix ne convient pas, on cherche dans un secteur
54
-	if (!autoriser('creer' . $objet . 'dans', 'rubrique', $id_rubrique)) {
54
+	if (!autoriser('creer'.$objet.'dans', 'rubrique', $id_rubrique)) {
55 55
 		$id_rubrique = '';
56 56
 		// manque de chance, la rubrique n'est pas autorisee, on cherche un des secteurs autorises
57 57
 		$res = sql_select('id_rubrique', 'spip_rubriques', 'id_parent=0');
58 58
 		while (!$id_rubrique and $row_rub = sql_fetch($res)) {
59
-			if (autoriser('creer' . $objet . 'dans', 'rubrique', $row_rub['id_rubrique'])) {
59
+			if (autoriser('creer'.$objet.'dans', 'rubrique', $row_rub['id_rubrique'])) {
60 60
 				$id_rubrique = $row_rub['id_rubrique'];
61 61
 			}
62 62
 		}
Please login to merge, or discard this patch.
ecrire/inc/filtres_selecteur_generique.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 	// si id numerique et un seul objet possible, pas d'ambiguite
160 160
 	if (is_numeric($ref) and count($objets) === 1) {
161
-		$ref = reset($objets) . $ref;
161
+		$ref = reset($objets).$ref;
162 162
 	}
163 163
 
164 164
 	// Si la référence ne correspond à rien, c'est fini
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		return json_export(false);
167 167
 	}
168 168
 	// Sinon on récupère les infos utiles
169
-	@list($type, , $id, , , , ) = $match;
169
+	@list($type,, $id,,,,) = $match;
170 170
 
171 171
 	// On regarde si le type trouvé fait partie des objets sélectionnables
172 172
 	if (!in_array(table_objet($type), $objets)) {
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 		$types = (is_array($types) ? array_filter($types) : []);
212 212
 
213 213
 		// recuperer tous les freres et soeurs de la rubrique visee
214
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
215
-		$fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent=' . intval($id_parent));
214
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
215
+		$fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent='.intval($id_parent));
216 216
 		$fratrie = array_column($fratrie, 'id_rubrique');
217 217
 		$has = sql_allfetsel('DISTINCT id_parent', 'spip_rubriques', sql_in('id_parent', $fratrie));
218 218
 		$has = array_column($has, 'id_parent');
Please login to merge, or discard this patch.
ecrire/inc/session.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	spip_log("supprimer sessions auteur $id_auteur", 'session');
83 83
 	if ($toutes or $id_auteur !== $GLOBALS['visiteur_session']['id_auteur']) {
84 84
 		if ($dir = opendir(_DIR_SESSIONS)) {
85
-			$t = $_SERVER['REQUEST_TIME']  - (4 * _RENOUVELLE_ALEA); // 48h par defaut
86
-			$t_short = $_SERVER['REQUEST_TIME']  - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
85
+			$t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut
86
+			$t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut
87 87
 			$t = time() - (4 * _RENOUVELLE_ALEA);
88 88
 			while (($f = readdir($dir)) !== false) {
89 89
 				$nb_files++;
90 90
 				if (preg_match(',^[^\d-]*(-?\d+)_\w{32}\.php[3]?$,', $f, $regs)) {
91
-					$f = _DIR_SESSIONS . $f;
91
+					$f = _DIR_SESSIONS.$f;
92 92
 					if (($actives and $regs[1] == $id_auteur) or ($t > filemtime($f))) {
93 93
 						spip_unlink($f);
94 94
 					}
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 
172 172
 	if (
173 173
 		!isset($_COOKIE['spip_session'])
174
-		or !preg_match(',^' . $id_auteur . '_,', $_COOKIE['spip_session'])
174
+		or !preg_match(',^'.$id_auteur.'_,', $_COOKIE['spip_session'])
175 175
 	) {
176
-		$_COOKIE['spip_session'] = $id_auteur . '_' . md5(uniqid(rand(), true));
176
+		$_COOKIE['spip_session'] = $id_auteur.'_'.md5(uniqid(rand(), true));
177 177
 	}
178 178
 
179 179
 	// Maintenant on sait qu'on a des choses à écrire
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	} else {
207 207
 		$fichier_session = fichier_session('alea_ephemere');
208 208
 		if (!ecrire_fichier_session($fichier_session, $auteur)) {
209
-			spip_log('Echec ecriture fichier session ' . $fichier_session, 'session' . _LOG_HS);
209
+			spip_log('Echec ecriture fichier session '.$fichier_session, 'session'._LOG_HS);
210 210
 			include_spip('inc/minipres');
211 211
 			echo minipres();
212 212
 			exit;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		include_spip('inc/autoriser');
230 230
 	}
231 231
 	if (autoriser('ecrire', '', '', $auteur) and _DUREE_COOKIE_ADMIN) {
232
-		spip_setcookie('spip_admin', '@' . ($auteur['email'] ?: $auteur['login']), [
232
+		spip_setcookie('spip_admin', '@'.($auteur['email'] ?: $auteur['login']), [
233 233
 			'expires' => time() + max(_DUREE_COOKIE_ADMIN, $duree)
234 234
 		]);
235 235
 	} // sinon le supprimer ...
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 			$coef = 20;
271 271
 		}
272 272
 	}
273
-	return (int)(_RENOUVELLE_ALEA * $coef);
273
+	return (int) (_RENOUVELLE_ALEA * $coef);
274 274
 }
275 275
 
276 276
 /**
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 			// Renouveler la session avec l'alea courant
320 320
 			include($fichier_session);
321
-			spip_log('renouvelle session ' . $GLOBALS['visiteur_session']['id_auteur'], 'session');
321
+			spip_log('renouvelle session '.$GLOBALS['visiteur_session']['id_auteur'], 'session');
322 322
 			spip_unlink($fichier_session);
323 323
 			ajouter_session($GLOBALS['visiteur_session']);
324 324
 		}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		}
351 351
 	} else {
352 352
 		if ($change) {
353
-			spip_log("rejoue session $fichier_session " . $_COOKIE['spip_session'], 'session');
353
+			spip_log("rejoue session $fichier_session ".$_COOKIE['spip_session'], 'session');
354 354
 			if ($fichier_session) {
355 355
 				spip_unlink($fichier_session);
356 356
 			}
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	}
568 568
 
569 569
 	// liste des sessions
570
-	$sessions = preg_files(_DIR_SESSIONS, '/' . $id_auteur . '_.*\.php$');
570
+	$sessions = preg_files(_DIR_SESSIONS, '/'.$id_auteur.'_.*\.php$');
571 571
 
572 572
 	// si on en a plus que la limite, supprimer les plus vieilles
573 573
 	// si ce ne sont pas des sessions anonymes car elles sont alors chacune differentes
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	$auteur = preparer_ecriture_session($auteur);
649 649
 
650 650
 	// enregistrer les autres donnees du visiteur
651
-	$texte = '<' . "?php\n";
651
+	$texte = '<'."?php\n";
652 652
 	foreach ($auteur as $var => $val) {
653
-		$texte .= '$GLOBALS[\'visiteur_session\'][' . var_export($var, true) . '] = '
654
-			. var_export($val, true) . ";\n";
653
+		$texte .= '$GLOBALS[\'visiteur_session\']['.var_export($var, true).'] = '
654
+			. var_export($val, true).";\n";
655 655
 	}
656
-	$texte .= '?' . ">\n";
656
+	$texte .= '?'.">\n";
657 657
 
658 658
 	return ecrire_fichier($fichier, $texte);
659 659
 }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 		$repertoire = sous_repertoire(_DIR_SESSIONS, '', false, $tantpis);
684 684
 		$c = $_COOKIE['spip_session'];
685 685
 
686
-		return $repertoire . intval($c) . '_' . md5($c . ' ' . $GLOBALS['meta'][$alea]) . '.php';
686
+		return $repertoire.intval($c).'_'.md5($c.' '.$GLOBALS['meta'][$alea]).'.php';
687 687
 	}
688 688
 }
689 689
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
  * @return string
702 702
  */
703 703
 function rejouer_session() {
704
-	return '<img src="' . generer_url_action('cookie', 'change_session=oui', true) . '" width="0" height="0" alt="" />';
704
+	return '<img src="'.generer_url_action('cookie', 'change_session=oui', true).'" width="0" height="0" alt="" />';
705 705
 }
706 706
 
707 707
 
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 		return $res;
717 717
 	}
718 718
 
719
-	return $res = md5($GLOBALS['ip'] . (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''));
719
+	return $res = md5($GLOBALS['ip'].(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''));
720 720
 }
721 721
 
722 722
 
Please login to merge, or discard this patch.
ecrire/inc/envoyer_mail.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 	// ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin
136 136
 	if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) {
137
-		$from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')';
137
+		$from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')';
138 138
 	}
139 139
 
140 140
 	// nettoyer les &eacute; &#8217, &emdash; etc...
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		if (!_TEST_EMAIL_DEST) {
172 172
 			return false;
173 173
 		} else {
174
-			$texte = "Dest : $destinataire\r\n" . $texte;
174
+			$texte = "Dest : $destinataire\r\n".$texte;
175 175
 			$destinataire = _TEST_EMAIL_DEST;
176 176
 		}
177 177
 	}
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	// Ajouter le Content-Type et consort s'il n'y est pas deja
196 196
 	if (strpos($headers, 'Content-Type: ') === false) {
197 197
 		$type =
198
-			"Content-Type: text/plain;charset=\"$charset\";\n" .
198
+			"Content-Type: text/plain;charset=\"$charset\";\n".
199 199
 			"Content-Transfer-Encoding: 8bit\n";
200 200
 	} else {
201 201
 		$type = '';
@@ -207,17 +207,17 @@  discard block
 block discarded – undo
207 207
 		$domain = $domain[0];
208 208
 	}
209 209
 	else {
210
-		$domain = '@unknown-' . md5($from) . '.org';
210
+		$domain = '@unknown-'.md5($from).'.org';
211 211
 	}
212
-	$uniq = rand() . '_' . md5($to . $texte) . $domain;
212
+	$uniq = rand().'_'.md5($to.$texte).$domain;
213 213
 
214 214
 	// Si multi-part, s'en servir comme borne ...
215 215
 	if ($parts) {
216
-		$texte = "--$uniq\n$type\n" . $texte . "\n";
216
+		$texte = "--$uniq\n$type\n".$texte."\n";
217 217
 		foreach ($parts as $part) {
218
-			$n = strlen($part[1]) . ($part[0] ? "\n" : '');
218
+			$n = strlen($part[1]).($part[0] ? "\n" : '');
219 219
 			$e = join("\n", $part[0]);
220
-			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1];
220
+			$texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1];
221 221
 		}
222 222
 		$texte .= "\n\n--$uniq--\n";
223 223
 		// Si boundary n'est pas entre guillemets,
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 	// .. et s'en servir pour plaire a SpamAssassin
229 229
 
230
-	$mid = 'Message-Id: <' . $uniq . '>';
230
+	$mid = 'Message-Id: <'.$uniq.'>';
231 231
 
232 232
 	// indispensable pour les sites qui collent d'office From: serveur-http
233 233
 	// sauf si deja mis par l'envoyeur
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 ?
@@ -223,7 +222,7 @@  discard block
 block discarded – undo
223 222
  *  resultat du sql_delete
224 223
  */
225 224
 function queue_unlink_job($id_job) {
226
-	return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job));
225
+	return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job));
227 226
 }
228 227
 
229 228
 /**
@@ -239,7 +238,7 @@  discard block
 block discarded – undo
239 238
 	// deserialiser les arguments
240 239
 	$args = unserialize($row['args']);
241 240
 	if ($args === false) {
242
-		spip_log('arguments job errones ' . var_export($row, true), 'queue');
241
+		spip_log('arguments job errones '.var_export($row, true), 'queue');
243 242
 		$args = [];
244 243
 	}
245 244
 
@@ -256,12 +255,12 @@  discard block
 block discarded – undo
256 255
 	}
257 256
 
258 257
 	if (!function_exists($fonction)) {
259
-		spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue');
258
+		spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue');
260 259
 
261 260
 		return false;
262 261
 	}
263 262
 
264
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue');
263
+	spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue');
265 264
 	switch (count($args)) {
266 265
 		case 0:
267 266
 			$res = $fonction();
@@ -311,7 +310,7 @@  discard block
 block discarded – undo
311 310
 			# plus lent mais completement generique
312 311
 			$res = call_user_func_array($fonction, $args);
313 312
 	}
314
-	spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue');
313
+	spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue');
315 314
 
316 315
 	return $res;
317 316
 }
@@ -342,14 +341,14 @@  discard block
 block discarded – undo
342 341
 function queue_schedule($force_jobs = null) {
343 342
 	$time = time();
344 343
 	if (defined('_DEBUG_BLOCK_QUEUE')) {
345
-		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG);
344
+		spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG);
346 345
 
347 346
 		return;
348 347
 	}
349 348
 
350 349
 	// rien a faire si le prochain job est encore dans le futur
351 350
 	if (queue_sleep_time_to_next_job() > 0 and (!$force_jobs or !count($force_jobs))) {
352
-		spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG);
351
+		spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG);
353 352
 
354 353
 		return;
355 354
 	}
@@ -370,7 +369,7 @@  discard block
 block discarded – undo
370 369
 	}
371 370
 	$end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE;
372 371
 
373
-	spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG);
372
+	spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG);
374 373
 
375 374
 	if (!defined('_JQ_MAX_JOBS_EXECUTE')) {
376 375
 		define('_JQ_MAX_JOBS_EXECUTE', 200);
@@ -384,19 +383,19 @@  discard block
 block discarded – undo
384 383
 	// lorsqu'un job cron n'a pas fini, sa priorite est descendue
385 384
 	// pour qu'il ne bloque pas les autres jobs en attente
386 385
 	if (is_array($force_jobs) and count($force_jobs)) {
387
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs);
386
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs);
388 387
 	} else {
389 388
 		$now = date('Y-m-d H:i:s', $time);
390
-		$cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now);
389
+		$cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now);
391 390
 	}
392 391
 
393 392
 	register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible
394
-	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1));
393
+	$res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1));
395 394
 	do {
396 395
 		if ($row = array_shift($res)) {
397 396
 			$nbj++;
398 397
 			// il faut un verrou, a base de sql_delete
399
-			if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) {
398
+			if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) {
400 399
 				#spip_log("JQ schedule job ".$nbj." OK",'jq');
401 400
 				// on reinsert dans la base aussitot avec un status=_JQ_PENDING
402 401
 				$row['status'] = _JQ_PENDING;
@@ -411,13 +410,13 @@  discard block
 block discarded – undo
411 410
 				queue_close_job($row, $time, $result);
412 411
 			}
413 412
 		}
414
-		spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG);
413
+		spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG);
415 414
 	} while ($nbj < _JQ_MAX_JOBS_EXECUTE and $row and $time < $end_time);
416
-	spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG);
415
+	spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG);
417 416
 
418 417
 	if ($row = array_shift($res)) {
419 418
 		queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP
420
-		spip_log('JQ encore !', 'jq' . _LOG_DEBUG);
419
+		spip_log('JQ encore !', 'jq'._LOG_DEBUG);
421 420
 	} else {
422 421
 		queue_update_next_job_time();
423 422
 	}
@@ -452,9 +451,9 @@  discard block
 block discarded – undo
452 451
 		}
453 452
 	}
454 453
 	// purger ses liens eventuels avec des objets
455
-	sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job']));
454
+	sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job']));
456 455
 	// supprimer le job fini
457
-	sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']));
456
+	sql_delete('spip_jobs', 'id_job='.intval($row['id_job']));
458 457
 }
459 458
 
460 459
 /**
@@ -527,18 +526,18 @@  discard block
 block discarded – undo
527 526
 	$res = sql_allfetsel(
528 527
 		'*',
529 528
 		'spip_jobs',
530
-		'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180))
529
+		'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180))
531 530
 	);
532 531
 	if (is_array($res)) {
533 532
 		foreach ($res as $row) {
534 533
 			queue_close_job($row, $time);
535
-			spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, 1), 'job_mort' . _LOG_ERREUR);
534
+			spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, 1), 'job_mort'._LOG_ERREUR);
536 535
 		}
537 536
 	}
538 537
 
539 538
 	// chercher la date du prochain job si pas connu
540 539
 	if (is_null($next) or is_null(queue_sleep_time_to_next_job())) {
541
-		$date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1');
540
+		$date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1');
542 541
 		$next = strtotime($date);
543 542
 	}
544 543
 	if (!is_null($next_time)) {
@@ -551,7 +550,7 @@  discard block
 block discarded – undo
551 550
 		if (is_null($nb_jobs_scheduled)) {
552 551
 			$nb_jobs_scheduled = sql_countsel(
553 552
 				'spip_jobs',
554
-				'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time))
553
+				'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time))
555 554
 			);
556 555
 		} elseif ($next <= $time) {
557 556
 			$nb_jobs_scheduled++;
@@ -620,7 +619,7 @@  discard block
 block discarded – undo
620 619
 	}
621 620
 
622 621
 	// ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent
623
-	if (file_exists($lock = _DIR_TMP . 'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
622
+	if (file_exists($lock = _DIR_TMP.'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) {
624 623
 		return $texte;
625 624
 	}
626 625
 
@@ -692,7 +691,7 @@  discard block
 block discarded – undo
692 691
 				$port = 80;
693 692
 		}
694 693
 		$fp = @fsockopen(
695
-			$scheme . $parts['host'],
694
+			$scheme.$parts['host'],
696 695
 			isset($parts['port']) ? $parts['port'] : $port,
697 696
 			$errno,
698 697
 			$errstr,
@@ -702,13 +701,13 @@  discard block
 block discarded – undo
702 701
 		if ($fp) {
703 702
 			$host_sent = $parts['host'];
704 703
 			if (isset($parts['port']) and $parts['port'] !== $port) {
705
-				$host_sent .= ':' . $parts['port'];
704
+				$host_sent .= ':'.$parts['port'];
706 705
 			}
707 706
 			$timeout = 200; // ms
708 707
 			stream_set_timeout($fp, 0, $timeout * 1000);
709
-			$query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : '');
710
-			$out = 'GET ' . $query . " HTTP/1.1\r\n";
711
-			$out .= 'Host: ' . $host_sent . "\r\n";
708
+			$query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : '');
709
+			$out = 'GET '.$query." HTTP/1.1\r\n";
710
+			$out .= 'Host: '.$host_sent."\r\n";
712 711
 			$out .= "Connection: Close\r\n\r\n";
713 712
 			fwrite($fp, $out);
714 713
 			spip_timer('read');
Please login to merge, or discard this patch.
ecrire/inc/texte.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
 	foreach (['script', 'iframe'] as $tag) {
106 106
 		if (
107 107
 			stripos($t, "<$tag") !== false
108
-			and preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
108
+			and preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER)
109 109
 		) {
110 110
 			foreach ($r as $regs) {
111 111
 				$t = str_replace(
112 112
 					$regs[0],
113
-					"<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
113
+					"<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>',
114 114
 					$t
115 115
 				);
116 116
 			}
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 	}
164 164
 
165 165
 	// echapper les tags asp/php
166
-	$t = str_replace('<' . '%', '&lt;%', $arg);
166
+	$t = str_replace('<'.'%', '&lt;%', $arg);
167 167
 
168 168
 	// echapper le php
169
-	$t = str_replace('<' . '?', '&lt;?', $t);
169
+	$t = str_replace('<'.'?', '&lt;?', $t);
170 170
 
171 171
 	// echapper le < script language=php >
172 172
 	$t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
 
189 189
 	// Reinserer les echappements des modeles
190 190
 	if (defined('_PROTEGE_JS_MODELES')) {
191
-		$t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES);
191
+		$t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES);
192 192
 	}
193 193
 	if (defined('_PROTEGE_PHP_MODELES')) {
194
-		$t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES);
194
+		$t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES);
195 195
 	}
196 196
 
197 197
 	return $dejavu[$mode_filtre][$arg] = $t;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 define('_TYPO_PROTEGER', "!':;?~%-");
290 290
 define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8");
291 291
 
292
-define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS');
292
+define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS');
293 293
 
294 294
 /**
295 295
  * Corrige la typographie
Please login to merge, or discard this patch.
ecrire/inc/xml.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
 					$p !== false
138 138
 					and ($morceau = substr($txt, $d, $p - $d))
139 139
 					and (($nopen += preg_match_all(
140
-						'{<' . preg_quote($closing_tag) . '(\s*>|\s[^>]*[^/>]>)}is',
140
+						'{<'.preg_quote($closing_tag).'(\s*>|\s[^>]*[^/>]>)}is',
141 141
 						$morceau,
142 142
 						$matches,
143 143
 						PREG_SET_ORDER
Please login to merge, or discard this patch.
ecrire/inc/editer.php 1 patch
Spacing   +35 added lines, -36 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$res['message_ok'] = _T('info_modification_enregistree');
101 101
 		if ($retour) {
102 102
 			if (strncmp($retour, 'javascript:', 11) == 0) {
103
-				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>';
103
+				$res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>';
104 104
 				$res['editable'] = true;
105 105
 			} else {
106 106
 				$res['redirect'] = parametre_url($retour, $id_table_objet, $id);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				if (!isset($erreurs[$champ])) {
141 141
 					$erreurs[$champ] = '';
142 142
 				}
143
-				$erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>';
143
+				$erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>';
144 144
 			}
145 145
 		}
146 146
 	}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	if (
217 217
 		$config_fonc
218 218
 		and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config'])
219
-		and $config_fonc !== $table_objet . '_edit_config'
219
+		and $config_fonc !== $table_objet.'_edit_config'
220 220
 	) {
221 221
 		if (
222 222
 			$args = test_formulaire_inclus_par_modele()
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 	// Appel direct dans un squelette
232 232
 	if (!$row) {
233 233
 		if (!$new or $lier_trad) {
234
-			if ($select = charger_fonction('precharger_' . $type, 'inc', true)) {
234
+			if ($select = charger_fonction('precharger_'.$type, 'inc', true)) {
235 235
 				$row = $select($id, $id_parent, $lier_trad);
236 236
 				// si on a une fonction precharger, elle pu faire un reglage de langue
237 237
 				$lang_default = (!empty($row['lang']) ? $row['lang'] : null);
238 238
 			} else {
239
-				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id));
239
+				$row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id));
240 240
 			}
241 241
 			if (!$new) {
242 242
 				$md5 = controles_md5($row);
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	if ($config_fonc) {
287 287
 		$contexte['config'] = $config = $config_fonc($contexte);
288 288
 		if (!$lang_default) {
289
-			$lang_default = $config['langue'] ?? session_get('lang') ;
289
+			$lang_default = $config['langue'] ?? session_get('lang');
290 290
 		}
291 291
 	}
292 292
 	$config = $config + [
@@ -310,13 +310,12 @@  discard block
 block discarded – undo
310 310
 		unset($contexte['lang']);
311 311
 	}
312 312
 
313
-	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" .
314
-		(!$lier_trad ? '' :
315
-			("\n<input type='hidden' name='lier_trad' value='" .
316
-				$lier_trad .
317
-				"' />" .
318
-				"\n<input type='hidden' name='changer_lang' value='" .
319
-				$lang_default .
313
+	$contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n".
314
+		(!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='".
315
+				$lier_trad.
316
+				"' />".
317
+				"\n<input type='hidden' name='changer_lang' value='".
318
+				$lang_default.
320 319
 				"' />"))
321 320
 		. $hidden
322 321
 		. (isset($md5) ? $md5 : '');
@@ -356,14 +355,14 @@  discard block
 block discarded – undo
356 355
 	$aider = charger_fonction('aider', 'inc');
357 356
 	if (strlen($texte) > 28 * 1024) {
358 357
 		$texte = str_replace("\r\n", "\n", $texte);
359
-		$pos = strpos($texte, "\n\n", 28 * 1024);  // coupe para > 28 ko
358
+		$pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko
360 359
 		if ($pos > 0 and $pos < 32 * 1024) {
361
-			$debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n";
360
+			$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
362 361
 			$suite = substr($texte, $pos + 2);
363 362
 		} else {
364
-			$pos = strpos($texte, ' ', 28 * 1024);  // sinon coupe espace
363
+			$pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace
365 364
 			if (!($pos > 0 and $pos < 32 * 1024)) {
366
-				$pos = 28 * 1024;  // au pire (pas d'espace trouv'e)
365
+				$pos = 28 * 1024; // au pire (pas d'espace trouv'e)
367 366
 				$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
368 367
 			} else {
369 368
 				$decalage = 1;
@@ -394,13 +393,13 @@  discard block
 block discarded – undo
394 393
 	}
395 394
 
396 395
 	include_spip('inc/barre');
397
-	$textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n";
396
+	$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
398 397
 	$nombre = 0;
399 398
 
400 399
 	while (strlen($texte) > 29 * 1024) {
401 400
 		$nombre++;
402 401
 		list($texte1, $texte) = coupe_trop_long($texte);
403
-		$textes_supplement .= '<br />' .
402
+		$textes_supplement .= '<br />'.
404 403
 			"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
405 404
 	}
406 405
 
@@ -488,7 +487,7 @@  discard block
 block discarded – undo
488 487
 	$ctr = [];
489 488
 	foreach ($data as $key => $val) {
490 489
 		$m = md5($val);
491
-		$k = $prefixe . $key;
490
+		$k = $prefixe.$key;
492 491
 
493 492
 		switch ($format) {
494 493
 			case 'html':
@@ -501,7 +500,7 @@  discard block
 block discarded – undo
501 500
 	}
502 501
 
503 502
 	if ($format == 'html') {
504
-		return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n";
503
+		return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n";
505 504
 	} else {
506 505
 		return $ctr;
507 506
 	}
@@ -652,7 +651,7 @@  discard block
 block discarded – undo
652 651
 	// On elimine les donnees non modifiees par le formulaire (mais
653 652
 	// potentiellement modifiees entre temps par un autre utilisateur)
654 653
 	foreach ($champs as $key => $val) {
655
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
654
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
656 655
 			if (is_scalar($val) and $m == md5($val)) {
657 656
 				unset($champs[$key]);
658 657
 			}
@@ -681,7 +680,7 @@  discard block
 block discarded – undo
681 680
 	// de conflit.
682 681
 	$ctrh = $ctrq = $conflits = [];
683 682
 	foreach (array_keys($champs) as $key) {
684
-		if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) {
683
+		if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) {
685 684
 			$ctrh[$key] = $m;
686 685
 			$ctrq[] = $key;
687 686
 		}
@@ -715,9 +714,9 @@  discard block
 block discarded – undo
715 714
  */
716 715
 function display_conflit_champ($x) {
717 716
 	if (strstr($x, "\n") or strlen($x) > 80) {
718
-		return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n";
717
+		return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n";
719 718
 	} else {
720
-		return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n";
719
+		return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n";
721 720
 	}
722 721
 }
723 722
 
@@ -757,11 +756,11 @@  discard block
 block discarded – undo
757 756
 		) : $champ;
758 757
 
759 758
 		$diffs[] = "<h2>$titre</h2>\n"
760
-			. '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n"
761
-			. "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n"
762
-			. '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>'
759
+			. '<h3>'._T('info_conflit_edition_differences')."</h3>\n"
760
+			. "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n"
761
+			. '<h4>'._T('info_conflit_edition_votre_version').'</h4>'
763 762
 			. display_conflit_champ($a['post'])
764
-			. '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>'
763
+			. '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>'
765 764
 			. display_conflit_champ($base);
766 765
 	}
767 766
 
@@ -769,16 +768,16 @@  discard block
 block discarded – undo
769 768
 		$id = uniqid(rand());
770 769
 		$redirect = "<form action='$redirect' method='get'
771 770
 			id='$id'
772
-			style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n"
771
+			style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n"
773 772
 			. form_hidden($redirect)
774
-			. "<input type='submit' value='" . _T('icone_retour') . "' />
773
+			. "<input type='submit' value='"._T('icone_retour')."' />
775 774
 		</form>\n";
776 775
 
777 776
 		// pour les documents, on est probablement en ajax : il faut ajaxer
778 777
 		if (_AJAX) {
779 778
 			$redirect .= '<script type="text/javascript">'
780
-				. 'setTimeout(function(){$("#' . $id . '")
781
-			.ajaxForm({target:$("#' . $id . '").parent()});
779
+				. 'setTimeout(function(){$("#'.$id.'")
780
+			.ajaxForm({target:$("#' . $id.'").parent()});
782 781
 			}, 200);'
783 782
 				. "</script>\n";
784 783
 		}
@@ -797,9 +796,9 @@  discard block
 block discarded – undo
797 796
 .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; }
798 797
 .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; }
799 798
 </style>'
800
-		. '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>'
801
-		. '<p>' . _T('texte_conflit_edition_correction') . '</p>'
802
-		. "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>"
799
+		. '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>'
800
+		. '<p>'._T('texte_conflit_edition_correction').'</p>'
801
+		. "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>"
803 802
 		. join("\n", $diffs)
804 803
 		. "</div>\n"
805 804
 
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 	// celle du texte) et public (spip_lang est la langue du texte)
45 45
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
46 46
 
47
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
47
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
48 48
 	if ($dir == 'rtl') {
49 49
 		$p .= '_rtl';
50 50
 	}
51 51
 
52 52
 	if (!isset($GLOBALS[$p])) {
53
-		$GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>';
53
+		$GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>';
54 54
 	}
55 55
 
56 56
 	return $GLOBALS[$p];
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 
70 70
 if (!defined('_BALISES_BLOCS_REGEXP')) {
71
-	define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
71
+	define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
72 72
 }
73 73
 
74 74
 //
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 	// Tester si on echappe en span ou en div
88 88
 	if (is_null($mode) or !in_array($mode, ['div', 'span'])) {
89
-		$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span';
89
+		$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span';
90 90
 	}
91 91
 
92 92
 	// Decouper en morceaux, base64 a des probleme selon la taille de la pile
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	) {
123 123
 		foreach ($matches as $m) {
124 124
 			if ($m[1] === 'code') {
125
-				$code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>';
125
+				$code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>';
126 126
 				$pre = str_replace($m[0], $code, $pre);
127 127
 			}
128 128
 		}
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 // Echapper les <code>...</ code>
134 134
 // https://code.spip.net/@traiter_echap_code_dist
135 135
 function traiter_echap_code_dist($regs) {
136
-	list(, , $att, $corps) = $regs;
136
+	list(,, $att, $corps) = $regs;
137 137
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
138 138
 
139 139
 	// ne pas mettre le <div...> s'il n'y a qu'une ligne
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 		$echap = nl2br($echap);
145 145
 		$echap = "<div style='text-align: left;' "
146 146
 			. "class='spip_code' dir='ltr'><code$att>"
147
-			. $echap . '</code></div>';
147
+			. $echap.'</code></div>';
148 148
 	} else {
149
-		$echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>';
149
+		$echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>';
150 150
 	}
151 151
 
152 152
 	$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 			} // sinon les traiter selon le cas
238 238
 			else {
239 239
 				if (
240
-					function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1]))
241
-					or function_exists($f = $f . '_dist')
240
+					function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1]))
241
+					or function_exists($f = $f.'_dist')
242 242
 				) {
243 243
 					$echap = $f($regs);
244 244
 				}
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	// dans une callback autonommee
260 260
 	if (strpos($preg ? $preg : _PROTEGE_BLOCS, 'script') !== false) {
261 261
 		if (
262
-			strpos($letexte, '<' . '?') !== false and preg_match_all(
262
+			strpos($letexte, '<'.'?') !== false and preg_match_all(
263 263
 				',<[?].*($|[?]>),UisS',
264 264
 				$letexte,
265 265
 				$matches,
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			strpos($letexte, '<') !== false
293 293
 			and
294 294
 			preg_match_all(
295
-				',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS',
295
+				',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS',
296 296
 				$letexte,
297 297
 				$regs,
298 298
 				PREG_SET_ORDER
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 					}
310 310
 				}
311 311
 				if ($at) {
312
-					$rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>';
312
+					$rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>';
313 313
 					foreach ($at as $attr => $a) {
314 314
 						$rempl = inserer_attribut($rempl, $attr, $a);
315 315
 					}
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
 	$texte = nettoyer_raccourcis_typo($texte);
392 392
 
393 393
 	// balises de sauts de ligne et paragraphe
394
-	$texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte);
395
-	$texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte);
394
+	$texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte);
395
+	$texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte);
396 396
 
397 397
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
398 398
 	$texte = str_replace("\n\n", "\r", $texte);
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	// supprimer les tags
401 401
 	$texte = supprimer_tags($texte);
402 402
 	$texte = trim(str_replace("\n", ' ', $texte));
403
-	$texte .= "\n";  // marquer la fin
403
+	$texte .= "\n"; // marquer la fin
404 404
 
405 405
 	// corriger la longueur de coupe
406 406
 	// en fonction de la presence de caracteres utf
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	// couper au mot precedent
416 416
 	$long = spip_substr($texte, 0, max($taille - 4, 1));
417 417
 	$u = $GLOBALS['meta']['pcre_u'];
418
-	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
418
+	$court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
419 419
 	if (is_null($suite)) {
420 420
 		$suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : '&nbsp;(...)');
421 421
 	}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	if (spip_strlen($court) < max(0.75 * $taille, 2)) {
426 426
 		$points = '';
427 427
 		$long = spip_substr($texte, 0, $taille);
428
-		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long);
428
+		$texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long);
429 429
 		// encore trop court ? couper au caractere
430 430
 		if (spip_strlen($texte) < 0.75 * $taille) {
431 431
 			$texte = $long;
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 	// supprimer l'eventuelle entite finale mal coupee
445 445
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
446 446
 
447
-	return quote_amp(trim($texte)) . $points;
447
+	return quote_amp(trim($texte)).$points;
448 448
 }
449 449
 
450 450
 
@@ -457,16 +457,16 @@  discard block
 block discarded – undo
457 457
 				define('_PROTEGE_JS_MODELES', creer_uniqid());
458 458
 			}
459 459
 			foreach ($r as $regs) {
460
-				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
460
+				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t);
461 461
 			}
462 462
 		}
463
-		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
463
+		if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) {
464 464
 			if (!defined('_PROTEGE_PHP_MODELES')) {
465 465
 				include_spip('inc/acces');
466 466
 				define('_PROTEGE_PHP_MODELES', creer_uniqid());
467 467
 			}
468 468
 			foreach ($r as $regs) {
469
-				$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t);
469
+				$t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t);
470 470
 			}
471 471
 		}
472 472
 	}
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		if (!function_exists('attribut_html')) {
540 540
 			include_spip('inc/filtres');
541 541
 		}
542
-		$texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte;
542
+		$texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte;
543 543
 	}
544 544
 
545 545
 	return $texte;
@@ -609,11 +609,11 @@  discard block
 block discarded – undo
609 609
  **/
610 610
 function supprime_img($letexte, $message = null) {
611 611
 	if ($message === null) {
612
-		$message = '(' . _T('img_indisponible') . ')';
612
+		$message = '('._T('img_indisponible').')';
613 613
 	}
614 614
 
615 615
 	return preg_replace(
616
-		',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
616
+		',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
617 617
 		$message,
618 618
 		$letexte
619 619
 	);
Please login to merge, or discard this patch.