Completed
Push — master ( 267cf1...68e811 )
by cam
01:09
created
ecrire/inc/acces.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  *     Mot de passe
31 31
  **/
32 32
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
33
-	$seed = (int)round(((float)microtime() + 1) * time());
33
+	$seed = (int) round(((float) microtime() + 1) * time());
34 34
 
35 35
 	mt_srand($seed);
36 36
 	$s = '';
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 			if (!$s) {
42 42
 				$s = random_int(0, mt_getrandmax());
43 43
 			}
44
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
44
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
45 45
 		}
46
-		$r = unpack('Cr', pack('H2', $s . $s));
46
+		$r = unpack('Cr', pack('H2', $s.$s));
47 47
 		$x = $r['r'] & 63;
48 48
 		if ($x < 10) {
49 49
 			$x = chr($x + 48);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	static $seeded;
77 77
 
78 78
 	if (!$seeded) {
79
-		$seed = (int)round(((float)microtime() + 1) * time());
79
+		$seed = (int) round(((float) microtime() + 1) * time());
80 80
 		mt_srand($seed);
81 81
 		$seeded = true;
82 82
 	}
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 			ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire());
163 163
 		}
164 164
 	} else {
165
-		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . (int) $id_auteur);
165
+		$low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.(int) $id_auteur);
166 166
 		if (!$low_sec) {
167 167
 			$low_sec = creer_pass_aleatoire();
168
-			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . (int) $id_auteur);
168
+			sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.(int) $id_auteur);
169 169
 		}
170 170
 	}
171 171
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) {
217 217
 	$id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0;
218 218
 	$cle = afficher_low_sec($id_auteur, "$script/$format $fond $args");
219
-	$path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : '');
219
+	$path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : '');
220 220
 
221 221
 	return generer_url_api($script, $path, $args, $no_entities, $public);
222 222
 }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
  *     Clé
235 235
  **/
236 236
 function afficher_low_sec($id_auteur, $action = '') {
237
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
237
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
238 238
 }
239 239
 
240 240
 /**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	if (!$id_auteur = (int) $id_auteur) {
266 266
 		return;
267 267
 	} // jamais trop prudent ;)
268
-	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . (int) $id_auteur);
268
+	sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.(int) $id_auteur);
269 269
 }
270 270
 
271 271
 
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
  *     - void sinon.
284 284
  **/
285 285
 function ecrire_acces() {
286
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
287
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
286
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
287
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
288 288
 
289 289
 	// Cette variable de configuration peut etre posee par un plugin
290 290
 	// par exemple acces_restreint ;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		(!isset($GLOBALS['meta']['creer_htpasswd']) || $GLOBALS['meta']['creer_htpasswd'] != 'oui') && !@file_exists($htaccess)
294 294
 	) {
295 295
 		spip_unlink($htpasswd);
296
-		spip_unlink($htpasswd . '-admin');
296
+		spip_unlink($htpasswd.'-admin');
297 297
 		return;
298 298
 	}
299 299
 
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
 	$pwd_all = ''; // login:htpass pour tous
322 322
 	$pwd_admin = ''; // login:htpass pour les admins
323 323
 
324
-	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
324
+	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
325 325
 	while ($row = sql_fetch($res)) {
326 326
 		if (strlen((string) $row['login']) && strlen((string) $row['htpass'])) {
327
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
327
+			$ligne = $row['login'].':'.$row['htpass']."\n";
328 328
 			$pwd_all .= $ligne;
329 329
 			if ($row['statut'] == '0minirezo') {
330 330
 				$pwd_admin .= $ligne;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
  * @return boolean
368 368
  */
369 369
 function verifier_htaccess($rep, $force = false) {
370
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
370
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
371 371
 	if ((@file_exists($htaccess) || defined('_TEST_DIRS')) && !$force) {
372 372
 		return true;
373 373
 	}
@@ -394,17 +394,17 @@  discard block
 block discarded – undo
394 394
 		fwrite($ht, $deny);
395 395
 		fclose($ht);
396 396
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
397
-		$t = rtrim($rep, '/') . '/.ok';
397
+		$t = rtrim($rep, '/').'/.ok';
398 398
 		if ($ht = @fopen($t, 'w')) {
399 399
 			@fclose($ht);
400 400
 			include_spip('inc/distant');
401 401
 			$t = substr($t, strlen(_DIR_RACINE));
402
-			$t = url_de_base() . $t;
402
+			$t = url_de_base().$t;
403 403
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
404 404
 			$ht = ($ht['status'] ?? null) === 403;
405 405
 		}
406 406
 	}
407
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
407
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
408 408
 
409 409
 	return $ht;
410 410
 }
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
431 431
 	$dirs[] = ['extension' => 'distant'];
432 432
 	foreach ($dirs as $e) {
433
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
433
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
434 434
 			if ($f) {
435 435
 				verifier_htaccess($dir);
436 436
 			} else {
437
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
437
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
438 438
 			}
439 439
 		}
440 440
 	}
Please login to merge, or discard this patch.
ecrire/inc/urls.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	) {
193 193
 		$r = nettoyer_url_page($url, $contexte);
194 194
 		if ($r) {
195
-			[$contexte, $type, , , $suite] = $r;
195
+			[$contexte, $type,,, $suite] = $r;
196 196
 			$_id = id_table_objet($type);
197 197
 			$id_objet = $contexte[$_id];
198 198
 			$url_propre = generer_objet_url($id_objet, $type);
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
  */
264 264
 function nettoyer_url_page($url, $contexte = []) {
265 265
 	$url_objets = urls_liste_objets();
266
-	$raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,';
267
-	$raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
-	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,';
266
+	$raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,';
267
+	$raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,';
268
+	$raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,';
269 269
 
270 270
 	if (
271 271
 		preg_match($raccourci_url_page_html, $url, $regs)
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	$id = intval($id);
304 304
 	if (!isset($furls[$objet])) {
305 305
 		if (
306
-			function_exists($f = 'generer_' . $objet . '_url_ecrire')
306
+			function_exists($f = 'generer_'.$objet.'_url_ecrire')
307 307
 			|| ($f = charger_fonction($f, 'urls', true))
308
-			|| function_exists($f = 'generer_url_ecrire_' . $objet) // deprecated
308
+			|| function_exists($f = 'generer_url_ecrire_'.$objet) // deprecated
309 309
 			|| ($f = charger_fonction($f, 'urls', true)) // deprecated
310 310
 		) {
311 311
 			$furls[$objet] = $f;
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 	if ($public || $connect) {
325 325
 		return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect);
326 326
 	}
327
-	$a = id_table_objet($objet) . '=' . intval($id);
327
+	$a = id_table_objet($objet).'='.intval($id);
328 328
 	if (!function_exists('objet_info')) {
329 329
 		include_spip('inc/filtres');
330 330
 	}
331 331
 
332
-	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : '');
332
+	return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : '');
333 333
 }
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 		sql_updateq(
136 136
 			'spip_rubriques',
137 137
 			['statut' => 'publie', 'date' => date('Y-m-d H:i:s')],
138
-			'id_rubrique=' . intval($id_rubrique)
138
+			'id_rubrique='.intval($id_rubrique)
139 139
 		);
140
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique));
140
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique));
141 141
 		if (!$id_parent) {
142 142
 			break;
143 143
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return $id_pred != $id_rubrique;
173 173
 		}
174 174
 		// passer au parent si on a depublie
175
-		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred));
175
+		$r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred));
176 176
 		$id_pred = $r['id_parent'];
177 177
 	}
178 178
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 		$date = date('Y-m-d H:i:s');
198 198
 	}
199 199
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
200
-		' AND date <= ' . sql_quote($date) : '';
200
+		' AND date <= '.sql_quote($date) : '';
201 201
 
202 202
 	if (!$id_rubrique = intval($id_rubrique)) {
203 203
 		return false;
204 204
 	}
205 205
 
206 206
 	// verifier qu'elle existe et est bien publiee
207
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
207
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
208 208
 	if (!$r || $r['statut'] !== 'publie') {
209 209
 		return false;
210 210
 	}
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
 	$compte = [
215 215
 		'articles' => sql_countsel(
216 216
 			'spip_articles',
217
-			'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates"
217
+			'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates"
218 218
 		),
219
-		'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"),
219
+		'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"),
220 220
 		'documents' => sql_countsel(
221 221
 			'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document',
222
-			'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
222
+			'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') "
223 223
 		)
224 224
 	];
225 225
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 		}
245 245
 	}
246 246
 
247
-	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique));
247
+	sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique));
248 248
 
249 249
 #		spip_log("depublier_rubrique $id_pred");
250 250
 	return true;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 	// Afficher les articles post-dates ?
309 309
 	$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
310
-		'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
310
+		'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
311 311
 
312 312
 	$r = sql_select(
313 313
 		'R.id_rubrique AS id, max(A.date) AS date_h',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		sql_updateq(
320 320
 			'spip_rubriques',
321 321
 			['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
322
-			'id_rubrique=' . intval($row['id'])
322
+			'id_rubrique='.intval($row['id'])
323 323
 		);
324 324
 	}
325 325
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			sql_updateq(
346 346
 				'spip_rubriques',
347 347
 				['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']],
348
-				'id_rubrique=' . intval($row['id'])
348
+				'id_rubrique='.intval($row['id'])
349 349
 			);
350 350
 			$continuer = true;
351 351
 		}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			&& ($rows = sql_allfetsel(
399 399
 				'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur',
400 400
 				'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique',
401
-				'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
401
+				'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)',
402 402
 				'',
403 403
 				'R.id_secteur',
404 404
 				'0,100'
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 			&& ($rows = sql_allfetsel(
438 438
 				'id_rubrique as id',
439 439
 				'spip_rubriques',
440
-				'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select(
440
+				'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select(
441 441
 					'zzz.id_rubrique',
442 442
 					'spip_rubriques AS zzz',
443
-					'zzz.profondeur=' . intval($prof)
444
-				) . ')',
443
+					'zzz.profondeur='.intval($prof)
444
+				).')',
445 445
 				'',
446 446
 				'',
447 447
 				'0,100'
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
456 456
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
457 457
 		// on arrete les frais
458
-		if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) {
458
+		if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) {
459 459
 			$prof++;
460 460
 			$continuer = true;
461 461
 		}
@@ -463,12 +463,12 @@  discard block
 block discarded – undo
463 463
 
464 464
 	// loger si la table des rubriques semble foireuse
465 465
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
466
-	if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) {
466
+	if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) {
467 467
 		spip_log(
468
-			'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)',
468
+			'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)',
469 469
 			_LOG_CRITIQUE
470 470
 		);
471
-		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1));
471
+		sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1));
472 472
 	}
473 473
 
474 474
 	// reparer les articles
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 	);
480 480
 
481 481
 	while ($row = sql_fetch($r)) {
482
-		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id']));
482
+		sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id']));
483 483
 	}
484 484
 
485 485
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$t = sql_updateq(
511 511
 			'spip_rubriques',
512 512
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
513
-			'id_rubrique=' . intval($id_rubrique)
513
+			'id_rubrique='.intval($id_rubrique)
514 514
 		);
515 515
 	}
516 516
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		sql_updateq(
556 556
 			'spip_articles',
557 557
 			['lang' => $row['lang'], 'langue_choisie' => 'non'],
558
-			'id_article=' . intval($id_article)
558
+			'id_article='.intval($id_article)
559 559
 		);
560 560
 	}
561 561
 
@@ -630,11 +630,11 @@  discard block
 block discarded – undo
630 630
 				];
631 631
 				// generer un nom de fonction "anonyme" unique
632 632
 				do {
633
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax());
633
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax());
634 634
 				} while (function_exists($functionname));
635 635
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
636
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
637
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
636
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
637
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
638 638
 				$res = '';
639 639
 				eval($code);
640 640
 				$res = explode(',', $res);
@@ -736,11 +736,11 @@  discard block
 block discarded – undo
736 736
 		$maxiter-- && ($filles = sql_allfetsel(
737 737
 			'id_rubrique',
738 738
 			'spip_rubriques',
739
-			sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT')
739
+			sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT')
740 740
 		))
741 741
 	) {
742 742
 		$r = join(',', array_column($filles, 'id_rubrique'));
743
-		$branche .= ',' . $r;
743
+		$branche .= ','.$r;
744 744
 	}
745 745
 
746 746
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
 	if (isset($b[$id])) {
782 782
 		// Notre branche commence par la rubrique de depart si $tout=true
783
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
783
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
784 784
 	}
785 785
 
786 786
 	$hier = '';
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
 		$maxiter-- && ($parents = sql_allfetsel(
794 794
 			'id_parent',
795 795
 			'spip_rubriques',
796
-			sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT')
796
+			sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT')
797 797
 		))
798 798
 	) {
799 799
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
800
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
800
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
801 801
 	}
802 802
 
803 803
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	include_spip('base/abstract_sql');
830 830
 	if ($check) {
831 831
 		$postdates = ($GLOBALS['meta']['post_dates'] == 'non') ?
832
-			'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : '';
832
+			'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : '';
833 833
 
834 834
 		$r = sql_select(
835 835
 			'DISTINCT A.id_rubrique AS id',
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 	$t = sql_fetsel(
847 847
 		'date',
848 848
 		'spip_articles',
849
-		"statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')),
849
+		"statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')),
850 850
 		'',
851 851
 		'date',
852 852
 		'1'
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		$r = sql_getfetsel(
903 903
 			'id_rubrique',
904 904
 			'spip_rubriques',
905
-			'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent),
905
+			'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent),
906 906
 			$groupby = [],
907 907
 			$orderby = [],
908 908
 			$limit = '',
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 			sql_updateq(
939 939
 				'spip_rubriques',
940 940
 				['id_secteur' => $id_secteur, 'lang' => $lang],
941
-				'id_rubrique=' . intval($id_rubrique),
941
+				'id_rubrique='.intval($id_rubrique),
942 942
 				[],
943 943
 				$serveur
944 944
 			);
Please login to merge, or discard this patch.
ecrire/inc/texte_mini.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	// celle du texte) et public (spip_lang est la langue du texte)
50 50
 	$dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']);
51 51
 
52
-	$p = 'puce' . (test_espace_prive() ? '_prive' : '');
52
+	$p = 'puce'.(test_espace_prive() ? '_prive' : '');
53 53
 	if ($dir == 'rtl') {
54 54
 		$p .= '_rtl';
55 55
 	}
56 56
 
57 57
 	if (!isset($GLOBALS[$p])) {
58
-		$GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>';
58
+		$GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>';
59 59
 	}
60 60
 
61 61
 	return $GLOBALS[$p];
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 function spip_balisage_code(string $corps, bool $bloc = false, string $attributs = '', string $langage = ''): string {
68 68
 
69 69
 	$echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code !
70
-	$class = 'spip_code ' . ($bloc ? 'spip_code_block' : 'spip_code_inline');
70
+	$class = 'spip_code '.($bloc ? 'spip_code_block' : 'spip_code_inline');
71 71
 	if ($attributs) {
72
-		$attributs = ' ' . trim($attributs);
72
+		$attributs = ' '.trim($attributs);
73 73
 	}
74 74
 	if ($langage) {
75 75
 		$class .= " language-$langage";
76
-		$attributs .= ' data-language="' . $langage . '"';
76
+		$attributs .= ' data-language="'.$langage.'"';
77 77
 	}
78 78
 	if ($bloc) {
79 79
 		$html = '<div class="precode">'
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	} else {
87 87
 		$echap = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $echap);
88 88
 		$echap = str_replace('  ', ' &nbsp;', $echap);
89
-		$html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>';
89
+		$html = "<code class=\"$class\" dir=\"ltr\"$attributs>".$echap.'</code>';
90 90
 	}
91 91
 
92 92
 	return $html;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 // XHTML - Preserver les balises-bloc : on liste ici tous les elements
97 97
 // dont on souhaite qu'ils provoquent un saut de paragraphe
98 98
 defined('_BALISES_BLOCS') || define('_BALISES_BLOCS', implode('|', CollecteurHtmlTag::$listeBalisesBloc));
99
-defined('_BALISES_BLOCS_REGEXP') || define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS');
99
+defined('_BALISES_BLOCS_REGEXP') || define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS');
100 100
 
101 101
 /**
102 102
  * Echapper les elements perilleux en les passant en base64
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		return '';
117 117
 	}
118 118
 
119
-	return CollecteurHtmlTag::echappementHtmlBase64((string)$rempl, (string)$source, in_array($mode, ['div', 'span']) ? $mode === 'div' : null);
119
+	return CollecteurHtmlTag::echappementHtmlBase64((string) $rempl, (string) $source, in_array($mode, ['div', 'span']) ? $mode === 'div' : null);
120 120
 }
121 121
 
122 122
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		$collections = $collecteurCode->collecter($pre);
137 137
 		$collections = array_reverse($collections);
138 138
 		foreach ($collections as $c) {
139
-			$code = $c['opening'] . spip_htmlspecialchars($c['innerHtml']) . $c['closing'];
139
+			$code = $c['opening'].spip_htmlspecialchars($c['innerHtml']).$c['closing'];
140 140
 			$pre = substr_replace($pre, $code, $c['pos'], $c['length']);
141 141
 		}
142 142
 	}
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	return $regs['raw'];
192 192
 }
193 193
 
194
-defined('_PROTEGE_BLOCS') || define('_PROTEGE_BLOCS', ',<(' . implode('|', CollecteurHtmlTag::$listeBalisesAProteger) . ')(\b[^>]*)?>(.*)</\1>,UimsS');
194
+defined('_PROTEGE_BLOCS') || define('_PROTEGE_BLOCS', ',<('.implode('|', CollecteurHtmlTag::$listeBalisesAProteger).')(\b[^>]*)?>(.*)</\1>,UimsS');
195 195
 
196 196
 /**
197 197
  * pour $source voir commentaire infra (echappe_retour)
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 		$callback_secure_prefix = ($callback_options['secure_prefix'] ?? '');
243 243
 		foreach ($html_tags ?: CollecteurHtmlTag::$listeBalisesAProteger as $tag) {
244 244
 			if (
245
-				function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . $tag)
246
-				|| function_exists($f = $f . '_dist')
245
+				function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.$tag)
246
+				|| function_exists($f = $f.'_dist')
247 247
 				|| $callback_secure_prefix && (
248
-					function_exists($f = $callback_prefix . 'traiter_echap_' . $tag)
249
-					|| function_exists($f = $f . '_dist')
248
+					function_exists($f = $callback_prefix.'traiter_echap_'.$tag)
249
+					|| function_exists($f = $f.'_dist')
250 250
 				)
251 251
 			) {
252 252
 				$callbacks[$tag] = $f;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	if (!is_string($letexte) || !strlen($letexte)) {
287 287
 		return $letexte;
288 288
 	}
289
-	return CollecteurHtmlTag::retablir_depuisHtmlBase64((string)$letexte, (string)$source, (string)$filtre);
289
+	return CollecteurHtmlTag::retablir_depuisHtmlBase64((string) $letexte, (string) $source, (string) $filtre);
290 290
 }
291 291
 
292 292
 // Reinserer le javascript de confiance (venant des modeles)
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	if (!is_string($letexte) || !strlen($letexte)) {
296 296
 		return $letexte;
297 297
 	}
298
-	$letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64((string)$letexte);
298
+	$letexte = CollecteurHtmlTag::retablir_depuisHtmlBase64((string) $letexte);
299 299
 
300 300
 	// Dans les appels directs hors squelette, securiser aussi ici
301 301
 	// c'est interdire_scripts() qui rétablit les scripts des modeles echappés avec _PROTEGE_JS_MODELES et _PROTEGE_PHP_MODELES
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 	$texte = nettoyer_raccourcis_typo($texte);
365 365
 
366 366
 	// balises de sauts de ligne et paragraphe
367
-	$texte = preg_replace('/<p( [^>]*)?' . '>/', "\r\r", $texte);
368
-	$texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte);
367
+	$texte = preg_replace('/<p( [^>]*)?'.'>/', "\r\r", $texte);
368
+	$texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte);
369 369
 
370 370
 	// on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier
371 371
 	$texte = str_replace("\n\n", "\r\r", $texte);
@@ -390,15 +390,15 @@  discard block
 block discarded – undo
390 390
 		// excédentaire est ensuite supprimé par l'appel à preg_replace()
391 391
 		$long = spip_substr($texte, 0, max($taille + 1 - $taille_suite, 1));
392 392
 		$u = $GLOBALS['meta']['pcre_u'];
393
-		$court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long);
393
+		$court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long);
394 394
 		$points = $suite;
395 395
 
396 396
 		// trop court ? ne pas faire de (...)
397 397
 		if (spip_strlen($court) < max(0.75 * $taille, 2)) {
398 398
 			$points = '';
399 399
 			$long = spip_substr($texte, 0, $taille + 1);
400
-			preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, $long, $m);
401
-			$texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long);
400
+			preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, $long, $m);
401
+			$texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long);
402 402
 			// encore trop court ? couper au caractere
403 403
 			if (spip_strlen($texte) < 0.75 * $taille) {
404 404
 				$texte = spip_substr($long, 0, $taille);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	// supprimer l'eventuelle entite finale mal coupee
415 415
 	$texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte);
416 416
 
417
-	return quote_amp(trim($texte)) . $points;
417
+	return quote_amp(trim($texte)).$points;
418 418
 }
419 419
 
420 420
 
@@ -422,16 +422,16 @@  discard block
 block discarded – undo
422 422
 	if (isset($GLOBALS['visiteur_session']) && str_contains($texte, '<')) {
423 423
 		$tags = [
424 424
 			'javascript' => ['tag' => 'script', 'preg' => ',<script.*?($|</script.),isS', 'c' => '_PROTEGE_JS_MODELES'],
425
-			'php' => ['tag' => '?php', 'preg' => ',<\?php.*?($|\?' . '>),isS', 'c' => '_PROTEGE_PHP_MODELES'],
425
+			'php' => ['tag' => '?php', 'preg' => ',<\?php.*?($|\?'.'>),isS', 'c' => '_PROTEGE_PHP_MODELES'],
426 426
 		];
427 427
 		foreach ($tags as $k => $t) {
428
-			if (stripos($texte, '<' . $t['tag']) !== false) {
428
+			if (stripos($texte, '<'.$t['tag']) !== false) {
429 429
 				if (!defined($t['c'])) {
430 430
 					include_spip('inc/acces');
431 431
 					define($t['c'], creer_uniqid());
432 432
 				}
433 433
 				$collecteurHtmlTag = new CollecteurHtmlTag($t['tag'], $t['preg'], '');
434
-				$texte = $collecteurHtmlTag->echapper_enHtmlBase64($texte, $k . constant($t['c']));
434
+				$texte = $collecteurHtmlTag->echapper_enHtmlBase64($texte, $k.constant($t['c']));
435 435
 			}
436 436
 		}
437 437
 	}
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 			if (!empty($options['wrap_suspect'])) {
545 545
 				$texte = wrap($texte, $options['wrap_suspect']);
546 546
 			}
547
-			$texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte;
547
+			$texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte;
548 548
 		}
549 549
 
550 550
 		$texte = $collecteurModeles->retablir($texte);
@@ -687,11 +687,11 @@  discard block
 block discarded – undo
687 687
  **/
688 688
 function supprime_img($letexte, $message = null) {
689 689
 	if ($message === null) {
690
-		$message = '(' . _T('img_indisponible') . ')';
690
+		$message = '('._T('img_indisponible').')';
691 691
 	}
692 692
 
693 693
 	return preg_replace(
694
-		',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i',
694
+		',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i',
695 695
 		$message,
696 696
 		$letexte
697 697
 	);
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$infos['url_voir'] = $infos['type'];
704 704
 	}
705 705
 	if (!isset($infos['url_edit'])) {
706
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
706
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
707 707
 	}
708 708
 	if (!isset($infos['icone_objet'])) {
709 709
 		$infos['icone_objet'] = $infos['type'];
@@ -715,48 +715,48 @@  discard block
 block discarded – undo
715 715
 		$infos['texte_retour'] = 'icone_retour';
716 716
 	}
717 717
 	if (!isset($infos['texte_modifier'])) {
718
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
718
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
719 719
 	}
720 720
 	if (!isset($infos['texte_creer'])) {
721
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
721
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer_associer'])) {
724
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
724
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_ajouter'])) {
727 727
 		// Ajouter un X
728
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
728
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
729 729
 	}
730 730
 	if (!isset($infos['texte_objets'])) {
731
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
731
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objet'])) {
734
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
734
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
735 735
 	}
736 736
 	if (!isset($infos['texte_logo_objet'])) {
737 737
 		// objet:titre_logo_objet "Logo de ce X"
738
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
738
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
739 739
 	}
740 740
 	if (!isset($infos['texte_langue_objet'])) {
741 741
 		// objet:texte_langue_objet "Langue de ce X"
742
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
742
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
743 743
 	}
744 744
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
745 745
 		// "Ce X est une traduction du X numéro :"
746
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
746
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
747 747
 	}
748 748
 
749 749
 	// objet:info_aucun_objet
750 750
 	if (!isset($infos['info_aucun_objet'])) {
751
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
751
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
752 752
 	}
753 753
 	// objet:info_1_objet
754 754
 	if (!isset($infos['info_1_objet'])) {
755
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
755
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
756 756
 	}
757 757
 	// objet:info_nb_objets
758 758
 	if (!isset($infos['info_nb_objets'])) {
759
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
759
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
760 760
 	}
761 761
 
762 762
 	if (!isset($infos['champs_editables'])) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 		}
955 955
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
956 956
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
957
-		$spip = $connexion['prefixe'] . '_';
957
+		$spip = $connexion['prefixe'].'_';
958 958
 		foreach ($ts as $t) {
959 959
 			$t = substr((string) $t, strlen($spip));
960 960
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
  * @return string
1008 1008
  *     Nom de l'objet
1009 1009
  **/
1010
-function table_objet(string $type, string|false $serveur = ''): string {
1010
+function table_objet(string $type, string | false $serveur = ''): string {
1011 1011
 
1012 1012
 	if ($type) {
1013 1013
 		$type = preg_replace(',^spip_|^id_|s$,', '', $type);
@@ -1024,9 +1024,9 @@  discard block
 block discarded – undo
1024 1024
 	if ($serveur !== false) {
1025 1025
 		$t = lister_tables_spip($serveur);
1026 1026
 		$trouver_table = charger_fonction('trouver_table', 'base');
1027
-		$typetrim = rtrim($type, 's') . 's';
1027
+		$typetrim = rtrim($type, 's').'s';
1028 1028
 		if (
1029
-			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1029
+			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1030 1030
 		) {
1031 1031
 			return $desc['id_table'];
1032 1032
 		} elseif (
@@ -1035,11 +1035,11 @@  discard block
 block discarded – undo
1035 1035
 			return $desc['id_table'];
1036 1036
 		}
1037 1037
 
1038
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1038
+		spip_log('table_objet('.$type.') calculee sans verification');
1039 1039
 		#spip_log(debug_backtrace(),'db');
1040 1040
 	}
1041 1041
 
1042
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1042
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1043 1043
 }
1044 1044
 
1045 1045
 /**
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
  * @return string
1060 1060
  *     Nom de la table SQL
1061 1061
  **/
1062
-function table_objet_sql(string $type, string|false $serveur = ''): string {
1062
+function table_objet_sql(string $type, string | false $serveur = ''): string {
1063 1063
 	$nom = table_objet($type, $serveur);
1064 1064
 	if (!strlen($nom)) {
1065 1065
 		return '';
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
  * @return string|null
1152 1152
  *     Type de l'objet
1153 1153
  **/
1154
-function objet_type(string $table_objet, string|false $serveur = ''): ?string {
1154
+function objet_type(string $table_objet, string | false $serveur = ''): ?string {
1155 1155
 	if (!$table_objet) {
1156 1156
 		return null;
1157 1157
 	}
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1224 1224
 	// voir si une fonction est definie pour faire le boulot
1225 1225
 	// elle a la priorite dans ce cas
1226
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1226
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1227 1227
 		return $f($objet, $id_objet, $serveur);
1228 1228
 	}
1229 1229
 
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 		$boucle->sql_serveur = $serveur;
1246 1246
 		$boucle->select[] = $id_table_objet;
1247 1247
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1248
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . (int) $id_objet;
1248
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.(int) $id_objet;
1249 1249
 
1250 1250
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1251 1251
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 						? "{$parent_methode['source_champ']} = $id_objet"
1369 1369
 						: "$cle_objet = $id_objet";
1370 1370
 					if (isset($parent_methode['source_champ_type'])) {
1371
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1371
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1372 1372
 					}
1373 1373
 					// -- Condition supplémentaire sur la détection du parent
1374 1374
 					if (isset($parent_methode['table_condition'])) {
@@ -1492,11 +1492,11 @@  discard block
 block discarded – undo
1492 1492
 			$where = [];
1493 1493
 			// -- L'identifiant du parent
1494 1494
 			if (isset($_methode_parent['champ'])) {
1495
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1495
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1496 1496
 			}
1497 1497
 			// -- Si le parent est variable
1498 1498
 			if (isset($_methode_parent['champ_type'])) {
1499
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1499
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1500 1500
 			}
1501 1501
 
1502 1502
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.
ecrire/plugins/afficher_nom_plugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	// numerotons les occurences d'un meme prefix
37 37
 	$versions[$info['prefix']] ??= 0;
38 38
 	$versions[$info['prefix']]++;
39
-	$id = $info['prefix'] . $versions[$info['prefix']];
39
+	$id = $info['prefix'].$versions[$info['prefix']];
40 40
 
41 41
 	$class = $class_li;
42 42
 	$class .= $actif ? ' actif' : '';
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 
50 50
 	// Cartouche Resume
51 51
 	$s .= "<div class='resume'>";
52
-	$s .= "<strong class='nom'>" . typo($info['nom']) . '</strong>';
53
-	$s .= " <span class='version'>" . $info['version'] . '</span>';
54
-	$s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . '</span>';
52
+	$s .= "<strong class='nom'>".typo($info['nom']).'</strong>';
53
+	$s .= " <span class='version'>".$info['version'].'</span>';
54
+	$s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat']).'</span>';
55 55
 	$s .= '</div>';
56 56
 
57 57
 	if ($erreur) {
58
-		$s .= "<div class='erreur'>" . implode('<br >', $info['erreur']) . '</div>';
58
+		$s .= "<div class='erreur'>".implode('<br >', $info['erreur']).'</div>';
59 59
 	}
60 60
 
61
-	return $s . '</li>';
61
+	return $s.'</li>';
62 62
 }
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +34 added lines, -35 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 			" class='picto_err'",
63 63
 			_T('plugin_info_erreur_xml')
64 64
 		)
65
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . '</div>';
65
+			. "<div class='erreur'>".join('<br >', $info['erreur']).'</div>';
66 66
 		$checkable = false;
67
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
67
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
68 68
 		$class_li .= ' error';
69 69
 		$erreur = http_img_pack(
70 70
 			'plugin-err-32.png',
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 			" class='picto_err'",
73 73
 			_T('plugin_impossible_activer', ['plugin' => $nom])
74 74
 		)
75
-			. "<div class='erreur'>" . implode(
75
+			. "<div class='erreur'>".implode(
76 76
 				'<br />',
77
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]
78
-			) . '</div>';
77
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file]
78
+			).'</div>';
79 79
 	} else {
80 80
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : '';
81 81
 		if (defined('_DEV_VERSION_SPIP_COMPAT') && !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 	// numerotons les occurrences d'un meme prefix
93 93
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
94 94
 
95
-	$class_li .= ($actif ? ' actif' : '') . ($expose ? ' on' : '');
95
+	$class_li .= ($actif ? ' actif' : '').($expose ? ' on' : '');
96 96
 
97 97
 	return "<li id='$prefix$id' class='$class_li'>"
98 98
 	. ((!$checkable && !$checked)
99
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
99
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
100 100
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
101 101
 	. $cfg
102 102
 	. $erreur
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 	// si paquet.xml fournit un squelette, le prendre
116 116
 	if (isset($infos['config']) && $infos['config']) {
117 117
 		return recuperer_fond(
118
-			"$dir$nom/" . $infos['config'],
118
+			"$dir$nom/".$infos['config'],
119 119
 			[
120
-				'script' => 'configurer_' . $prefix,
120
+				'script' => 'configurer_'.$prefix,
121 121
 				'nom' => $nom
122 122
 			]
123 123
 		);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	return recuperer_fond(
128 128
 		'prive/squelettes/inclure/cfg',
129 129
 		[
130
-			'script' => 'configurer_' . $prefix,
130
+			'script' => 'configurer_'.$prefix,
131 131
 			'nom' => $nom
132 132
 		]
133 133
 	);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
144 144
 	. ($actif ? " checked='checked'" : '')
145 145
 	. " class='checkbox'  value='O' />"
146
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . '</label>'
146
+	. "\n<label for='label_$id_input'>"._T('activer_plugin').'</label>'
147 147
 	. '</div>';
148 148
 }
149 149
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	. "<h3><a href='$url' rel='info'>"
199 199
 	. $nom
200 200
 	. '</a></h3>'
201
-	. " <span class='version'>" . $info['version'] . '</span>'
201
+	. " <span class='version'>".$info['version'].'</span>'
202 202
 	. " <span class='etat'> - "
203 203
 	. plugin_etat_en_clair($info['etat'])
204 204
 	. '</span>'
205
-	. "<div class='short'>" . $slogan . '</div>'
205
+	. "<div class='short'>".$slogan.'</div>'
206 206
 	. $i
207 207
 	. '</div>';
208 208
 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	$text2 = _T('info_desinstaller_plugin');
218 218
 	$file = basename($plug_file);
219 219
 
220
-	return "<div class='actions'>[" .
220
+	return "<div class='actions'>[".
221 221
 	"<a href='$action'
222 222
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
223 223
 	. $text
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$etat = 'developpement';
240 240
 	}
241 241
 
242
-	return _T('plugin_etat_' . $etat);
242
+	return _T('plugin_etat_'.$etat);
243 243
 }
244 244
 
245 245
 function plugin_propre($texte, $module = '', $propre = 'propre') {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		$module = substr($module, strlen(_DIR_RACINE));
249 249
 	}
250 250
 	if (preg_match('|^\w+_[\w_]+$|', $texte)) {
251
-		$texte = _T(($module ? "$module:" : '') . $texte, [], ['force' => false]);
251
+		$texte = _T(($module ? "$module:" : '').$texte, [], ['force' => false]);
252 252
 	}
253 253
 
254 254
 	return $propre($texte);
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 	if (
281 281
 		isset($info['documentation']) && ($lien = $info['documentation'])
282 282
 	) {
283
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
283
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
284 284
 	}
285
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
285
+	$s .= "<dd class='desc'>".$description."</dd>\n";
286 286
 
287 287
 	if (isset($info['auteur'])) {
288 288
 		if (is_array($info['auteur'])) {
@@ -292,19 +292,19 @@  discard block
 block discarded – undo
292 292
 			$a = trim($info['auteur']);
293 293
 		}
294 294
 		if ($a) {
295
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre(
295
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre(
296 296
 				$a,
297 297
 				$dir
298
-			)) . "</dd>\n";
298
+			))."</dd>\n";
299 299
 		}
300 300
 	}
301 301
 
302 302
 	if (isset($info['credit'])) {
303 303
 		if ($a = formater_credits($info['credit'], ', ')) {
304
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre(
304
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre(
305 305
 				$a,
306 306
 				$dir
307
-			)) . "</dd>\n";
307
+			))."</dd>\n";
308 308
 		}
309 309
 	}
310 310
 
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 			$a = trim($info['licence']);
317 317
 		}
318 318
 		if ($a) {
319
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre(
319
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre(
320 320
 				$a,
321 321
 				$dir
322
-			)) . "</dd>\n";
322
+			))."</dd>\n";
323 323
 		}
324 324
 	}
325 325
 
@@ -330,24 +330,23 @@  discard block
 block discarded – undo
330 330
 	//
331 331
 	$infotech = [];
332 332
 
333
-	$version = '<dt>' . _T('version') . '</dt><dd>' . $info['version'];
333
+	$version = '<dt>'._T('version').'</dt><dd>'.$info['version'];
334 334
 	// Version VCS
335
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
336
-		$version .= ' ' . $vcs;
335
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
336
+		$version .= ' '.$vcs;
337 337
 	}
338 338
 	$version .= '</dd>';
339 339
 	$infotech[] = $version;
340
-	$infotech[] = '<dt>' . _T('repertoire_plugins') . '</dt><dd>' . joli_repertoire("$dir_plugins$plug_file") . '</dd>';
340
+	$infotech[] = '<dt>'._T('repertoire_plugins').'</dt><dd>'.joli_repertoire("$dir_plugins$plug_file").'</dd>';
341 341
 	// source zip le cas echeant
342
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . '</dd>'
342
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1]).'</dd>'
344 344
 		: '';
345 345
 
346
-	$infotech[] = !$info['necessite'] ? '' :
347
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(
346
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(
348 347
 			' ',
349 348
 			array_map('array_shift', $info['necessite'])
350
-		) . '</dd>');
349
+		).'</dd>');
351 350
 
352 351
 	$s .= "<dl class='tech'>"
353 352
 		. join('', $infotech)
@@ -368,8 +367,8 @@  discard block
 block discarded – undo
368 367
 		$texte .=
369 368
 			(!is_array($_credit))
370 369
 				? PtoBR(propre($_credit))
371
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
372
-				$_credit['nom'] .
370
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
371
+				$_credit['nom'].
373 372
 				($_credit['url'] ? '</a>' : '');
374 373
 	}
375 374
 
Please login to merge, or discard this patch.
ecrire/install/etape_fin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	// creer le repertoire cache, qui sert partout !
40 40
 	// deja fait en etape 4 en principe, on garde au cas ou
41 41
 	if (!@file_exists(_DIR_CACHE)) {
42
-		$rep = preg_replace(',' . _DIR_TMP . ',', '', (string) _DIR_CACHE);
42
+		$rep = preg_replace(','._DIR_TMP.',', '', (string) _DIR_CACHE);
43 43
 		$rep = sous_repertoire(_DIR_TMP, $rep, true, true);
44 44
 	}
45 45
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$cible = _T('public:accueil_site');
51 51
 		$cible = generer_form_ecrire('accueil', '', '', $cible);
52 52
 		$minipage = new Installation();
53
-		echo $minipage->page($msg . $cible);
53
+		echo $minipage->page($msg.$cible);
54 54
 		// ok, deboucher dans l'espace prive
55 55
 	} else {
56 56
 		redirige_url_ecrire('accueil');
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 	$averti = _T(
72 72
 		'htaccess_a_simuler',
73 73
 		[
74
-			'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>',
74
+			'htaccess' => '<tt>'._ACCESS_FILE_NAME.'</tt>',
75 75
 			'constantes' => '<tt>_DIR_TMP &amp; _DIR_CONNECT</tt>',
76
-			'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>'
76
+			'document_root' => '<tt>'.$_SERVER['DOCUMENT_ROOT'].'</tt>'
77 77
 		]
78 78
 	);
79 79
 
Please login to merge, or discard this patch.
ecrire/install/etape_.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 	} else {
35 35
 		include_spip('inc/presentation'); // pour info_copyright
36 36
 
37
-		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
38
-			"<p class='small'>" . info_copyright() . "</p></div>\n" .
39
-			'<p>' . _T('install_select_langue') . '</p>' .
40
-			'<div>' . $menu_langues . "</div>\n" .
41
-			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
37
+		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='".chemin_image('logo-spip.png')."' />\n".
38
+			"<p class='small'>".info_copyright()."</p></div>\n".
39
+			'<p>'._T('install_select_langue').'</p>'.
40
+			'<div>'.$menu_langues."</div>\n".
41
+			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />".bouton_suivant());
42 42
 
43 43
 		$minipage = new Installation();
44 44
 		echo $minipage->page($res);
Please login to merge, or discard this patch.