Completed
Push — master ( 2056af...6c9939 )
by cam
01:09
created
ecrire/inc/admin.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		if ($res) {
56 56
 			return $res;
57 57
 		}
58
-		spip_log("meta: $script " . print_r($_POST, true));
58
+		spip_log("meta: $script ".print_r($_POST, true));
59 59
 		ecrire_meta($script, serialize($_POST));
60 60
 	}
61 61
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	}
125 125
 	// on pourrait statuer automatiquement les webmestres a l'init d'une action auth par ftp ... ?
126 126
 
127
-	spip_log("admin $pref" . ($valeur ? ' (reprise)' : ' (init)'), $journal);
127
+	spip_log("admin $pref".($valeur ? ' (reprise)' : ' (init)'), $journal);
128 128
 
129 129
 	return '';
130 130
 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (autoriser('configurer')) {
143 143
 		return _DIR_TMP;
144 144
 	} else {
145
-		return _DIR_TRANSFERT . $GLOBALS['visiteur_session']['login'] . '/';
145
+		return _DIR_TRANSFERT.$GLOBALS['visiteur_session']['login'].'/';
146 146
 	}
147 147
 }
148 148
 
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
  *     Nom du fichier
161 161
  **/
162 162
 function fichier_admin($action, $pref = 'admin_') {
163
-	return $pref .
164
-	substr(md5($action . (time() & ~2047) . $GLOBALS['visiteur_session']['login']), 0, 10);
163
+	return $pref.
164
+	substr(md5($action.(time() & ~2047).$GLOBALS['visiteur_session']['login']), 0, 10);
165 165
 }
166 166
 
167 167
 /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	} else {
195 195
 		$dir = dir_admin();
196 196
 		$signal = fichier_admin($script);
197
-		if (@file_exists($dir . $signal)) {
197
+		if (@file_exists($dir.$signal)) {
198 198
 			spip_log("Action admin: $action");
199 199
 
200 200
 			return '';
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 				return '';
214 214
 			}
215
-			$corps .= '<input type="hidden" name="validation_admin" value="' . $signal . '" />';
215
+			$corps .= '<input type="hidden" name="validation_admin" value="'.$signal.'" />';
216 216
 			$suivant = _T('bouton_valider');
217 217
 			$js = '';
218 218
 		} else {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				. "</legend>\n<label for='fichier'>"
228 228
 				. _T('info_creer_repertoire')
229 229
 				. "</label>\n"
230
-				. "<span id='signal' class='formo'>" . $signal . '</span>'
230
+				. "<span id='signal' class='formo'>".$signal.'</span>'
231 231
 				. "<input type='hidden' id='fichier' name='fichier' value='"
232 232
 				. $signal
233 233
 				. "' />"
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
  *     Nom de l'action (en base) qui a été exécutée
265 265
  **/
266 266
 function fin_admin($action) {
267
-	$signal = dir_admin() . fichier_admin($action);
267
+	$signal = dir_admin().fichier_admin($action);
268 268
 	spip_unlink($signal);
269 269
 	if ($action != 'delete_all') {
270 270
 		effacer_meta($action);
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 	include_spip('inc/filtres');
293 293
 	foreach (array_merge($_POST, $_GET) as $n => $c) {
294 294
 		if (!in_array($n, ['fichier', 'exec', 'validation_admin']) and !is_array($c)) {
295
-			$suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" .
296
-				entites_html($c) .
295
+			$suite .= "\n<input type='hidden' name='".spip_htmlspecialchars($n)."' value='".
296
+				entites_html($c).
297 297
 				"'  />";
298 298
 		}
299 299
 	}
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$contenu = @gzfile($fichier);
123 123
 	}
124 124
 
125
-	return is_array($contenu) ? join('', $contenu) : (string)$contenu;
125
+	return is_array($contenu) ? join('', $contenu) : (string) $contenu;
126 126
 }
127 127
 
128 128
 
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
  */
316 316
 function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) {
317 317
 	if (substr($fichier, -4) !== '.php') {
318
-		spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
318
+		spip_log('Erreur de programmation: '.$fichier.' doit finir par .php');
319 319
 	}
320
-	$contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
320
+	$contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu;
321 321
 
322 322
 	return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
323 323
 }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
  * @return bool
331 331
  */
332 332
 function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) {
333
-	$fichier_tmp = $fichier . '.last';
333
+	$fichier_tmp = $fichier.'.last';
334 334
 	if (!ecrire_fichier($fichier_tmp, $contenu, true)) {
335 335
 		return false;
336 336
 	}
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
  */
371 371
 function lire_fichier_securise($fichier, &$contenu, $options = []) {
372 372
 	if ($res = lire_fichier($fichier, $contenu, $options)) {
373
-		$contenu = substr($contenu, strlen('<' . "?php die ('Acces interdit'); ?" . ">\n"));
373
+		$contenu = substr($contenu, strlen('<'."?php die ('Acces interdit'); ?".">\n"));
374 374
 	}
375 375
 
376 376
 	return $res;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 				$wait = 0;
541 541
 			}
542 542
 		}
543
-		spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE);
543
+		spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
544 544
 		if ($wait) {
545 545
 			sleep($duree + 1);
546 546
 		}
@@ -568,9 +568,9 @@  discard block
 block discarded – undo
568 568
 		if ($item == '.' || $item == '..') {
569 569
 			continue;
570 570
 		}
571
-		if (!supprimer_repertoire($dir . '/' . $item)) {
572
-			@chmod($dir . '/' . $item, 0777);
573
-			if (!supprimer_repertoire($dir . '/' . $item)) {
571
+		if (!supprimer_repertoire($dir.'/'.$item)) {
572
+			@chmod($dir.'/'.$item, 0777);
573
+			if (!supprimer_repertoire($dir.'/'.$item)) {
574 574
 				return false;
575 575
 			}
576 576
 		};
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	if (!strlen($subdir)) {
616 616
 		$n = strrpos($base, '/');
617 617
 		if ($n === false) {
618
-			return $nobase ? '' : ($base . '/');
618
+			return $nobase ? '' : ($base.'/');
619 619
 		}
620 620
 		$subdir = substr($base, $n + 1);
621 621
 		$base = substr($base, 0, $n + 1);
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
 	}
626 626
 
627 627
 	$baseaff = $nobase ? '' : $base;
628
-	if (isset($dirs[$base . $subdir])) {
629
-		return $baseaff . $dirs[$base . $subdir];
628
+	if (isset($dirs[$base.$subdir])) {
629
+		return $baseaff.$dirs[$base.$subdir];
630 630
 	}
631 631
 
632
-	$path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
632
+	$path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
633 633
 
634 634
 	if (file_exists("$path/.ok")) {
635
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
635
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
636 636
 	}
637 637
 
638 638
 	@mkdir($path, _SPIP_CHMOD);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 		@touch("$path/.ok");
643 643
 		spip_log("creation $base$subdir/");
644 644
 
645
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
645
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
646 646
 	}
647 647
 
648 648
 	// en cas d'echec c'est peut etre tout simplement que le disque est plein :
@@ -652,10 +652,10 @@  discard block
 block discarded – undo
652 652
 		return '';
653 653
 	}
654 654
 	if (!_DIR_RESTREINT) {
655
-		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
655
+		$base = preg_replace(',^'._DIR_RACINE.',', '', $base);
656 656
 	}
657 657
 	$base .= $subdir;
658
-	raler_fichier($base . '/.ok');
658
+	raler_fichier($base.'/.ok');
659 659
 }
660 660
 
661 661
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 								$maxfiles - $nbfiles,
729 729
 								$recurs
730 730
 							);
731
-							$fichiers = array_merge((array)$beginning, (array)$end);
731
+							$fichiers = array_merge((array) $beginning, (array) $end);
732 732
 							$nbfiles = count($fichiers);
733 733
 						}
734 734
 					}
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	srand($seed);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 			if (!$s) {
44 44
 				$s = rand();
45 45
 			}
46
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
46
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
47 47
 		}
48
-		$r = unpack('Cr', pack('H2', $s . $s));
48
+		$r = unpack('Cr', pack('H2', $s.$s));
49 49
 		$x = $r['r'] & 63;
50 50
 		if ($x < 10) {
51 51
 			$x = chr($x + 48);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	static $seeded;
84 84
 
85 85
 	if (!$seeded) {
86
-		$seed = (int)round(((float)microtime() + 1) * time());
86
+		$seed = (int) round(((float) microtime() + 1) * time());
87 87
 		mt_srand($seed);
88 88
 		srand($seed);
89 89
 		$seeded = true;
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
171 171
 		}
172 172
 	} else {
173
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur));
173
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur));
174 174
 		if (!$low_sec) {
175 175
 			$low_sec = creer_pass_aleatoire();
176
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur));
176
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur));
177 177
 		}
178 178
 	}
179 179
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 	foreach ($args as $val => $var) {
198 198
 		if ($var) {
199 199
 			if ($val <> 'statut') {
200
-				$a .= ':' . $val . '-' . $var;
200
+				$a .= ':'.$val.'-'.$var;
201 201
 			}
202
-			$b .= $val . '=' . $var . '&';
202
+			$b .= $val.'='.$var.'&';
203 203
 		}
204 204
 	}
205 205
 	$a = substr($a, 1);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
  *     Clé
230 230
  **/
231 231
 function afficher_low_sec($id_auteur, $action = '') {
232
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
232
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
233 233
 }
234 234
 
235 235
 /**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	if (!$id_auteur = intval($id_auteur)) {
261 261
 		return;
262 262
 	} // jamais trop prudent ;)
263
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur));
263
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur));
264 264
 }
265 265
 
266 266
 /**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 function initialiser_sel() {
272 272
 	if (!isset($GLOBALS['htsalt'])) {
273 273
 		if (CRYPT_MD5) {
274
-			$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
274
+			$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
275 275
 		} else {
276 276
 			$GLOBALS['htsalt'] = '';
277 277
 		}
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
  *     - void sinon.
294 294
  **/
295 295
 function ecrire_acces() {
296
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
297
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
296
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
297
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
298 298
 
299 299
 	// Cette variable de configuration peut etre posee par un plugin
300 300
 	// par exemple acces_restreint ;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		and !@file_exists($htaccess)
306 306
 	) {
307 307
 		spip_unlink($htpasswd);
308
-		spip_unlink($htpasswd . '-admin');
308
+		spip_unlink($htpasswd.'-admin');
309 309
 		return;
310 310
 	}
311 311
 
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
 	$pwd_all = ''; // login:htpass pour tous
335 335
 	$pwd_admin = ''; // login:htpass pour les admins
336 336
 
337
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
337
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
338 338
 	while ($row = sql_fetch($res)) {
339 339
 		if (strlen($row['login']) and strlen($row['htpass'])) {
340
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
340
+			$ligne = $row['login'].':'.$row['htpass']."\n";
341 341
 			$pwd_all .= $ligne;
342 342
 			if ($row['statut'] == '0minirezo') {
343 343
 				$pwd_admin .= $ligne;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
  * @return boolean
383 383
  */
384 384
 function verifier_htaccess($rep, $force = false) {
385
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
385
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
386 386
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
387 387
 		return true;
388 388
 	}
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 		fputs($ht, $deny);
412 412
 		fclose($ht);
413 413
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
414
-		$t = rtrim($rep, '/') . '/.ok';
414
+		$t = rtrim($rep, '/').'/.ok';
415 415
 		if ($ht = @fopen($t, 'w')) {
416 416
 			@fclose($ht);
417 417
 			include_spip('inc/distant');
418 418
 			$t = substr($t, strlen(_DIR_RACINE));
419
-			$t = url_de_base() . $t;
419
+			$t = url_de_base().$t;
420 420
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
421 421
 			$ht = ($ht['status'] ?? null) === 403;
422 422
 		}
423 423
 	}
424
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
424
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
425 425
 
426 426
 	return $ht;
427 427
 }
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
448 448
 	$dirs[] = ['extension' => 'distant'];
449 449
 	foreach ($dirs as $e) {
450
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
450
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
451 451
 			if ($f) {
452 452
 				verifier_htaccess($dir);
453 453
 			} else {
454
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
454
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
455 455
 			}
456 456
 		}
457 457
 	}
Please login to merge, or discard this patch.
ecrire/inc/couleurs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,17 +70,17 @@
 block discarded – undo
70 70
 		// compat < SPIP 3.3
71 71
 		include_spip('inc/filtres_images_mini');
72 72
 		$c['couleur_foncee'] = $c['couleur_theme'];
73
-		$c['couleur_claire'] = '#' . couleur_eclaircir($c['couleur_theme'], .5);
73
+		$c['couleur_claire'] = '#'.couleur_eclaircir($c['couleur_theme'], .5);
74 74
 
75 75
 		return
76
-			'couleur_theme=' . substr($c['couleur_theme'], 1)
76
+			'couleur_theme='.substr($c['couleur_theme'], 1)
77 77
 			// compat < SPIP 3.3
78
-			. '&couleur_claire=' . substr($c['couleur_claire'], 1)
79
-			. '&couleur_foncee=' . substr($c['couleur_foncee'], 1);
78
+			. '&couleur_claire='.substr($c['couleur_claire'], 1)
79
+			. '&couleur_foncee='.substr($c['couleur_foncee'], 1);
80 80
 	} else {
81 81
 		if (is_array($choix)) {
82 82
 			// compat < SPIP 3.3
83
-			$compat_spip_33 = function ($c) {
83
+			$compat_spip_33 = function($c) {
84 84
 				if (!isset($c['couleur_theme'])) {
85 85
 					$c['couleur_theme'] = $c['couleur_foncee'];
86 86
 					unset($c['couleur_foncee']);
Please login to merge, or discard this patch.
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.