Completed
Push — master ( 342b7b...105b81 )
by cam
01:15
created
ecrire/auth/spip.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$row = sql_fetsel(
50 50
 			'*',
51 51
 			'spip_auteurs',
52
-			'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'",
52
+			'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'",
53 53
 			'',
54 54
 			'',
55 55
 			'',
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
 		// legacy = md5 ou sha256
78 78
 		case 32:
79 79
 			// tres anciens mots de passe encodes en md5(alea.pass)
80
-			$hash = md5($row['alea_actuel'] . $pass);
80
+			$hash = md5($row['alea_actuel'].$pass);
81 81
 			$methode = 'md5';
82 82
 		case 64:
83 83
 			if (empty($hash)) {
84 84
 				// anciens mots de passe encodes en sha256(alea.pass)
85 85
 				include_spip('auth/sha256.inc');
86
-				$hash = spip_sha256($row['alea_actuel'] . $pass);
86
+				$hash = spip_sha256($row['alea_actuel'].$pass);
87 87
 				$methode = 'sha256';
88 88
 			}
89 89
 			if ($row['pass'] === $hash) {
90
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via $methode", 'auth' . _LOG_DEBUG);
90
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG);
91 91
 				// ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth
92 92
 				if (!empty($row['backup_cles'])) {
93
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
93
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
94 94
 				}
95 95
 				break;
96 96
 			}
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 				and !empty($row['backup_cles'])
109 109
 			) {
110 110
 				if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) {
111
-					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE);
111
+					spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE);
112 112
 					if ($cles->save()) {
113 113
 						$secret = $cles->getSecretAuth();
114 114
 					}
115 115
 					else {
116
-						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
116
+						spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
117 117
 						// et on echoue car on ne veut pas que la situation reste telle quelle
118
-						raler_fichier(_DIR_ETC . 'cles.php');
118
+						raler_fichier(_DIR_ETC.'cles.php');
119 119
 					}
120 120
 				}
121 121
 				else {
122
-					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR);
123
-					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur']));
122
+					spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR);
123
+					sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur']));
124 124
 				}
125 125
 			}
126 126
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				unset($row);
129 129
 			}
130 130
 			else {
131
-				spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG);
131
+				spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG);
132 132
 			}
133 133
 			break;
134 134
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			@sql_update(
176 176
 				'spip_auteurs',
177 177
 				$set,
178
-				'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote(
178
+				'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote(
179 179
 					$row['pass'],
180 180
 					$serveur,
181 181
 					'text'
@@ -223,24 +223,24 @@  discard block
 block discarded – undo
223 223
 
224 224
 	// si force, on ne verifie pas la presence d'un backup chez un webmestre
225 225
 	if ($force) {
226
-		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE);
226
+		spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE);
227 227
 		$secret = $cles->getSecretAuth(true);
228 228
 		return true;
229 229
 	}
230 230
 
231
-	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''");
231
+	$has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''");
232 232
 	$has_backup = array_column($has_backup, 'id_auteur');
233 233
 	if (empty($has_backup)) {
234
-		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE);
234
+		spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE);
235 235
 		if ($secret = $cles->getSecretAuth(true)) {
236 236
 			return true;
237 237
 		}
238
-		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR);
238
+		spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR);
239 239
 		// et on echoue car on ne veut pas que la situation reste telle quelle
240
-		raler_fichier(_DIR_ETC . 'cles.php');
240
+		raler_fichier(_DIR_ETC.'cles.php');
241 241
 	}
242 242
 	else {
243
-		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR);
243
+		spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR);
244 244
 	}
245 245
 	return false;
246 246
 }
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	$flux['data'] .=
258 258
 		  '<script type="text/javascript">/*<![CDATA[*/'
259 259
 		. "$js\n"
260
-		. "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "',"
261
-		. "'page_auteur': '" . generer_url_public('informer_auteur') . "',"
260
+		. "var login_info={'login':'".$flux['args']['contexte']['var_login']."',"
261
+		. "'page_auteur': '".generer_url_public('informer_auteur')."',"
262 262
 		. "'informe_auteur_en_cours':false,"
263 263
 		. "'attente_informe':0};"
264 264
 		. "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});"
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		} else {
302 302
 			$n = sql_countsel(
303 303
 				'spip_auteurs',
304
-				'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'",
304
+				'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'",
305 305
 				'',
306 306
 				'',
307 307
 				$serveur
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	}
330 330
 	if (
331 331
 		!$id_auteur = intval($id_auteur)
332
-		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
332
+		or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
333 333
 	) {
334 334
 		return false;
335 335
 	}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		$anciens = sql_allfetsel(
345 345
 			'id_auteur',
346 346
 			'spip_auteurs',
347
-			'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'",
347
+			'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'",
348 348
 			'',
349 349
 			'',
350 350
 			'',
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 		$r = sql_getfetsel(
379 379
 			'login',
380 380
 			'spip_auteurs',
381
-			"statut<>'5poubelle'" .
382
-			' AND (length(pass)>0)' .
381
+			"statut<>'5poubelle'".
382
+			' AND (length(pass)>0)'.
383 383
 			" AND (login=$l)",
384 384
 			'',
385 385
 			'',
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 		return sql_getfetsel(
399 399
 			'login',
400 400
 			'spip_auteurs',
401
-			"statut<>'5poubelle'" .
402
-			' AND (length(pass)>0)' .
401
+			"statut<>'5poubelle'".
402
+			' AND (length(pass)>0)'.
403 403
 			" AND (login<>'' AND (nom=$l OR email=$l))",
404 404
 			'',
405 405
 			'',
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
 	if (
470 470
 		!$id_auteur = intval($id_auteur)
471
-		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur)
471
+		or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur)
472 472
 	) {
473 473
 		return false;
474 474
 	}
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 		or isset($champs['statut'])
530 530
 		or (isset($options['all']) and $options['all'])
531 531
 	) {
532
-		$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
533
-		$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
532
+		$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
533
+		$htpasswd = _DIR_TMP._AUTH_USER_FILE;
534 534
 
535 535
 		// Cette variable de configuration peut etre posee par un plugin
536 536
 		// par exemple acces_restreint ;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			and !@file_exists($htaccess)
541 541
 		) {
542 542
 			spip_unlink($htpasswd);
543
-			spip_unlink($htpasswd . '-admin');
543
+			spip_unlink($htpasswd.'-admin');
544 544
 
545 545
 			return;
546 546
 		}
@@ -558,16 +558,16 @@  discard block
 block discarded – undo
558 558
 		);
559 559
 		while ($t = sql_fetch($s)) {
560 560
 			if (strlen($t['login']) and strlen($t['htpass'])) {
561
-				$p1 .= $t['login'] . ':' . $t['htpass'] . "\n";
561
+				$p1 .= $t['login'].':'.$t['htpass']."\n";
562 562
 				if ($t['statut'] == '0minirezo') {
563
-					$p2 .= $t['login'] . ':' . $t['htpass'] . "\n";
563
+					$p2 .= $t['login'].':'.$t['htpass']."\n";
564 564
 				}
565 565
 			}
566 566
 		}
567 567
 		sql_free($s);
568 568
 		if ($p1) {
569 569
 			ecrire_fichier($htpasswd, $p1);
570
-			ecrire_fichier($htpasswd . '-admin', $p2);
570
+			ecrire_fichier($htpasswd.'-admin', $p2);
571 571
 			spip_log("Ecriture de $htpasswd et $htpasswd-admin");
572 572
 		}
573 573
 	}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 // mais apres la fonction autoriser()
121 121
 if ($f = find_in_path('mes_fonctions.php')) {
122 122
 	global $dossier_squelettes;
123
-	include_once(_ROOT_CWD . $f);
123
+	include_once(_ROOT_CWD.$f);
124 124
 }
125 125
 
126 126
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$qui = $GLOBALS['visiteur_session'] ?: [];
163 163
 		$qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui);
164 164
 	} elseif (is_numeric($qui)) {
165
-		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui);
165
+		$qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui);
166 166
 		if (!$qui) {
167 167
 			return false;
168 168
 		}
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	}
176 176
 
177 177
 	spip_log(
178
-		"autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?',
179
-		'autoriser' . _LOG_DEBUG
178
+		"autoriser $faire $type $id (".($qui['nom'] ?? '').') ?',
179
+		'autoriser'._LOG_DEBUG
180 180
 	);
181 181
 
182 182
 	// passer par objet_type pour avoir les alias
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		(isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier'))
193 193
 		or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier'))
194 194
 	) {
195
-		spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG);
195
+		spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG);
196 196
 		return true;
197 197
 	}
198 198
 
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 	// autoriser_faire[_dist], autoriser_defaut[_dist]
202 202
 	$fonctions = $type
203 203
 		? [
204
-			'autoriser_' . $type . '_' . $faire,
205
-			'autoriser_' . $type . '_' . $faire . '_dist',
206
-			'autoriser_' . $type,
207
-			'autoriser_' . $type . '_dist',
208
-			'autoriser_' . $faire,
209
-			'autoriser_' . $faire . '_dist',
204
+			'autoriser_'.$type.'_'.$faire,
205
+			'autoriser_'.$type.'_'.$faire.'_dist',
206
+			'autoriser_'.$type,
207
+			'autoriser_'.$type.'_dist',
208
+			'autoriser_'.$faire,
209
+			'autoriser_'.$faire.'_dist',
210 210
 			'autoriser_defaut',
211 211
 			'autoriser_defaut_dist'
212 212
 		]
213 213
 		: [
214
-			'autoriser_' . $faire,
215
-			'autoriser_' . $faire . '_dist',
214
+			'autoriser_'.$faire,
215
+			'autoriser_'.$faire.'_dist',
216 216
 			'autoriser_defaut',
217 217
 			'autoriser_defaut_dist'
218 218
 		];
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 	}
226 226
 
227 227
 	spip_log(
228
-		"$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'),
229
-		'autoriser' . _LOG_DEBUG
228
+		"$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'),
229
+		'autoriser'._LOG_DEBUG
230 230
 	);
231 231
 
232 232
 	return $a;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
376 376
 
377 377
 	// Le visiteur a-t-il un statut prevu par la config ?
378
-	if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) {
378
+	if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) {
379 379
 		return test_previsualiser_objet_champ($type, $id, $qui, $opt);
380 380
 	}
381 381
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 				} // pas de champ passe a la demande => NIET
434 434
 				$previsu = explode(',', $c['previsu']);
435 435
 				// regarder si ce statut est autorise pour l'auteur
436
-				if (in_array($opt[$champ] . '/auteur', $previsu)) {
436
+				if (in_array($opt[$champ].'/auteur', $previsu)) {
437 437
 					// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
438 438
 					// sinon l’auteur en session
439 439
 					include_spip('inc/securiser_action');
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 
448 448
 					if (!$id_auteur) {
449 449
 						return false;
450
-					} elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) {
450
+					} elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) {
451 451
 						// dans ce cas (admin en general), pas de filtrage sur ce statut
452 452
 					} elseif (
453 453
 						!sql_countsel(
454 454
 							'spip_auteurs_liens',
455
-							'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id)
455
+							'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id)
456 456
 						)
457 457
 					) {
458 458
 						return false;
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
 			// multilinguisme par secteur et objet rattaché à une rubrique
498 498
 			$primary = id_table_objet($type);
499 499
 			if ($table != 'spip_rubriques') {
500
-				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id));
500
+				$id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id));
501 501
 			} else {
502 502
 				$id_rubrique = $id;
503 503
 			}
504
-			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
504
+			$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
505 505
 			if (!$id_secteur > 0) {
506 506
 				$id_secteur = $id_rubrique;
507 507
 			}
508
-			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur));
509
-			$langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id));
508
+			$langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur));
509
+			$langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id));
510 510
 			if ($langue_secteur != $langue_objet) {
511 511
 				// configuration incohérente, on laisse l'utilisateur corriger la situation
512 512
 				return true;
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 			if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques
515 515
 				return false;
516 516
 			} else {
517
-				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id));
517
+				$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id));
518 518
 				if ($id_parent != 0) {
519 519
 					// sous-rubriques : pas de choix de langue
520 520
 					return false;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 
567 567
 	if (!isset($opt['statut'])) {
568 568
 		if (isset($desc['field']['statut'])) {
569
-			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id));
569
+			$statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id));
570 570
 		} else {
571 571
 			$statut = 'publie';
572 572
 		} // pas de statut => publie
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 		return false;
741 741
 	}
742 742
 
743
-	if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) {
743
+	if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) {
744 744
 		return false;
745 745
 	}
746 746
 
747
-	if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) {
747
+	if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) {
748 748
 		return false;
749 749
 	}
750 750
 
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 	if (!$id) {
782 782
 		return false;
783 783
 	}
784
-	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id));
784
+	$r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id));
785 785
 
786 786
 	return
787 787
 		$r
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 				(!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true))
793 793
 				and in_array($qui['statut'], ['0minirezo', '1comite'])
794 794
 				and in_array($r['statut'], ['prop', 'prepa', 'poubelle'])
795
-				and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])
795
+				and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])
796 796
 			)
797 797
 		);
798 798
 }
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 		if (!$id) {
851 851
 			return false;
852 852
 		}
853
-		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id));
853
+		$statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id));
854 854
 	}
855 855
 
856 856
 	return
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 		or
862 862
 		($id
863 863
 			and $qui['id_auteur']
864
-			and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']));
864
+			and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']));
865 865
 }
866 866
 
867 867
 
@@ -882,8 +882,8 @@  discard block
 block discarded – undo
882 882
 function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
883 883
 	# securite, mais on aurait pas du arriver ici !
884 884
 	if (
885
-		function_exists($f = 'autoriser_' . $type . '_voir')
886
-		or function_exists($f = 'autoriser_' . $type . '_voir_dist')
885
+		function_exists($f = 'autoriser_'.$type.'_voir')
886
+		or function_exists($f = 'autoriser_'.$type.'_voir_dist')
887 887
 	) {
888 888
 		return $f($faire, $type, $id, $qui, $opt);
889 889
 	}
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 	$n = sql_fetsel(
1015 1015
 		'A.id_article',
1016 1016
 		'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)',
1017
-		"A.statut='publie' AND L.id_auteur=" . sql_quote($id)
1017
+		"A.statut='publie' AND L.id_auteur=".sql_quote($id)
1018 1018
 	);
1019 1019
 
1020 1020
 	return $n ? true : false;
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		and $r = sql_allfetsel(
1227 1227
 			'id_objet',
1228 1228
 			'spip_auteurs_liens',
1229
-			'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0"
1229
+			'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0"
1230 1230
 		)
1231 1231
 		and is_countable($r) ? count($r) : 0
1232 1232
 	) {
@@ -1911,8 +1911,8 @@  discard block
 block discarded – undo
1911 1911
 function auteurs_objet($objet, $id_objet, $cond = '') {
1912 1912
 	$objet = objet_type($objet);
1913 1913
 	$where = [
1914
-		'objet=' . sql_quote($objet),
1915
-		'id_objet=' . intval($id_objet)
1914
+		'objet='.sql_quote($objet),
1915
+		'id_objet='.intval($id_objet)
1916 1916
 	];
1917 1917
 	if (!empty($cond)) {
1918 1918
 		if (is_array($cond)) {
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 	return sql_allfetsel(
1948 1948
 		'id_auteur',
1949 1949
 		'spip_auteurs_liens',
1950
-		"objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '')
1950
+		"objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '')
1951 1951
 	);
1952 1952
 }
1953 1953
 
Please login to merge, or discard this patch.
ecrire/inc/informer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	include_spip('inc/texte');
21 21
 	$titre = $descriptif = '';
22 22
 	if ($type === 'rubrique') {
23
-		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id));
23
+		$row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id));
24 24
 		if ($row) {
25 25
 			$titre = typo($row['titre']);
26 26
 			$descriptif = propre($row['descriptif']);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				include_spip('inc/filtres_images_mini');
43 43
 				$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
44 44
 				if ($res) {
45
-					$res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>";
45
+					$res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
46 46
 				}
47 47
 			}
48 48
 		}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 		'  '
65 65
 	);
66 66
 
67
-	$js_func = $do . '_selection_titre';
67
+	$js_func = $do.'_selection_titre';
68 68
 
69 69
 	return "<div style='display: none;'>"
70
-	. "<input type='text' id='" . $rac . "_sel' value='$id' />"
71
-	. "<input type='text' id='" . $rac . "_sel2' value=\""
70
+	. "<input type='text' id='".$rac."_sel' value='$id' />"
71
+	. "<input type='text' id='".$rac."_sel2' value=\""
72 72
 	. entites_html($titre)
73 73
 	. '" />'
74 74
 	. '</div>'
75 75
 	. "<div class='informer' style='padding: 5px; border-top: 0px;'>"
76 76
 	. '<div class="informer__item">'
77 77
 	. (!$res ? '' : $res)
78
-	. "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>'
79
-	. (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>')
78
+	. "<p class='informer__titre'><b>".safehtml($titre).'</b></p>'
79
+	. (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>')
80 80
 	. '</div>'
81
-	. "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
81
+	. "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>"
82 82
 	. "<input type='submit' class='fondo btn submit' value='"
83 83
 	. _T('bouton_choisir')
84 84
 	. "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
Please login to merge, or discard this patch.
ecrire/inc/commencer_page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$titre = '['
91 91
 		. $nom_site_spip
92 92
 		. ']'
93
-		. ($titre ? ' ' . textebrut(typo($titre)) : '');
93
+		. ($titre ? ' '.textebrut(typo($titre)) : '');
94 94
 
95 95
 	return _DOCTYPE_ECRIRE
96 96
 	. html_lang_attributes()
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) {
134 134
 
135 135
 	$res = pipeline('body_prive', "<body class='"
136
-		. init_body_class() . ' ' . _request('exec') . "'"
136
+		. init_body_class().' '._request('exec')."'"
137 137
 		. ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '')
138 138
 		. '>');
139 139
 
Please login to merge, or discard this patch.
ecrire/action/editer_objet.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function objet_modifier($objet, $id, $set = null) {
78 78
 	if (($t = objet_type($objet)) !== $objet) {
79
-		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
79
+		spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
80 80
 		$objet = $t;
81 81
 	}
82 82
 	if (
83
-		include_spip('action/editer_' . $objet)
84
-		and function_exists($modifier = $objet . '_modifier')
83
+		include_spip('action/editer_'.$objet)
84
+		and function_exists($modifier = $objet.'_modifier')
85 85
 	) {
86 86
 		return $modifier($id, $set);
87 87
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$trouver_table = charger_fonction('trouver_table', 'base');
91 91
 	$desc = $trouver_table($table_sql);
92 92
 	if (!$desc or !isset($desc['field'])) {
93
-		spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR);
93
+		spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR);
94 94
 
95 95
 		return _L("Erreur objet $objet inconnu");
96 96
 	}
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 function objet_inserer($objet, $id_parent = null, $set = null) {
171 171
 	$d = null;
172 172
 	if (($t = objet_type($objet)) !== $objet) {
173
-		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
173
+		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
174 174
 		$objet = $t;
175 175
 	}
176 176
 	if (
177
-		include_spip('action/editer_' . $objet)
178
-		and function_exists($inserer = $objet . '_inserer')
177
+		include_spip('action/editer_'.$objet)
178
+		and function_exists($inserer = $objet.'_inserer')
179 179
 	) {
180 180
 		return $inserer($id_parent, $set);
181 181
 	}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			$row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1');
197 197
 			$id_rubrique = $row['id_rubrique'];
198 198
 		} else {
199
-			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
199
+			$row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
200 200
 		}
201 201
 
202 202
 		$champs['id_rubrique'] = $id_rubrique;
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
  */
315 315
 function objet_instituer($objet, $id, $c, $calcul_rub = true) {
316 316
 	if (($t = objet_type($objet)) !== $objet) {
317
-		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
317
+		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
318 318
 		$objet = $t;
319 319
 	}
320 320
 	if (
321
-		include_spip('action/editer_' . $objet)
322
-		and function_exists($instituer = $objet . '_instituer')
321
+		include_spip('action/editer_'.$objet)
322
+		and function_exists($instituer = $objet.'_instituer')
323 323
 	) {
324 324
 		return $instituer($id, $c, $calcul_rub);
325 325
 	}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	$sel[] = ($champ_date ? "$champ_date as date" : "'' as date");
349 349
 	$sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique');
350 350
 
351
-	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id));
351
+	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id));
352 352
 
353 353
 	$id_rubrique = $row['id_rubrique'];
354 354
 	$statut_ancien = $statut = $row['statut'];
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			if ($s != 'publie' and autoriser('modifier', $objet, $id)) {
372 372
 				$statut = $champs['statut'] = $s;
373 373
 			} else {
374
-				spip_log("editer_objet $objet #$id refus " . json_encode($c, JSON_THROW_ON_ERROR), 'editer' . _LOG_INFO_IMPORTANTE);
374
+				spip_log("editer_objet $objet #$id refus ".json_encode($c, JSON_THROW_ON_ERROR), 'editer'._LOG_INFO_IMPORTANTE);
375 375
 			}
376 376
 		}
377 377
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		and isset($c['id_parent'])
402 402
 		and $id_parent = $c['id_parent']
403 403
 		and $id_parent != $id_rubrique
404
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
404
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
405 405
 	) {
406 406
 		$champs['id_rubrique'] = $id_parent;
407 407
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	// Si on deplace l'objet
501 501
 	// changer aussi son secteur et sa langue (si heritee)
502 502
 	if (isset($champs['id_rubrique'])) {
503
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
503
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
504 504
 		$langue = $row_rub['lang'];
505 505
 
506 506
 		if (isset($desc['field']['id_secteur'])) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 				sql_fetsel(
513 513
 					'1',
514 514
 					$table_sql,
515
-					id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
515
+					id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
516 516
 				)
517 517
 			) {
518 518
 				$champs['lang'] = $langue;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 	if (!$champs) {
524 524
 		return;
525 525
 	}
526
-	sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id));
526
+	sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id));
527 527
 
528 528
 	// Changer le statut des rubriques concernees
529 529
 	if ($cond) {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
  */
568 568
 function objet_lire($objet, $valeur_id, $options = []) {
569 569
 	if (($t = objet_type($objet)) !== $objet) {
570
-		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE);
570
+		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE);
571 571
 		$objet = $t;
572 572
 	}
573 573
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 	) {
590 590
 		// Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet.
591 591
 		if (
592
-			include_spip('action/editer_' . $objet)
592
+			include_spip('action/editer_'.$objet)
593 593
 			and function_exists($lire = "{$objet}_lire_champs")
594 594
 		) {
595 595
 			$valeurs = $lire($objet, $valeur_id, $champ_id);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 			// La condition est appliquée sur le champ désigné par l'utilisateur.
601 601
 			$where = [
602
-				$champ_id . '=' . sql_quote($valeur_id)
602
+				$champ_id.'='.sql_quote($valeur_id)
603 603
 			];
604 604
 
605 605
 			// Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide.
Please login to merge, or discard this patch.
ecrire/inc/bandeau.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			$_id = $e['id_table_objet'];
51 51
 			if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) {
52 52
 				$table = $e['table_objet_sql'];
53
-				$row = sql_fetsel('*', $table, "$_id=" . intval($id));
53
+				$row = sql_fetsel('*', $table, "$_id=".intval($id));
54 54
 				if (isset($row['id_rubrique'])) {
55 55
 					$contexte['id_rubrique'] = $row['id_rubrique'];
56 56
 					if (isset($row['id_secteur'])) {
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
115 115
 					+ [
116 116
 						$id => new Bouton(
117
-							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
118
-							$infos['titre'],  // titre
117
+							($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
118
+							$infos['titre'], // titre
119 119
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
120 120
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
121 121
 						)
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
133 133
 					+ [
134 134
 						$id => new Bouton(
135
-							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
136
-							$infos['titre'],  // titre
135
+							($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
136
+							$infos['titre'], // titre
137 137
 							(isset($infos['action']) and $infos['action']) ? $infos['action'] : null,
138 138
 							(isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null
139 139
 						)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		$url = str_replace('&amp;', '&', $url);
221 221
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
222 222
 			if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) {
223
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique']));
223
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique']));
224 224
 			}
225 225
 			$val = _request($matches[2], $contexte);
226 226
 			$url = parametre_url($url, $matches[1], $val ?: '', '&');
Please login to merge, or discard this patch.
ecrire/inc/lang.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 function changer_langue($lang, $liste_langues = null) {
41 41
 
42 42
 	if (is_null($liste_langues)) {
43
-		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? '');
43
+		$liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? '');
44 44
 	} else {
45 45
 		if (is_array($liste_langues)) {
46 46
 			$liste_langues = implode(',', $liste_langues);
47 47
 		}
48 48
 	}
49
-	$liste_langues = ',' . $liste_langues . ',';
49
+	$liste_langues = ','.$liste_langues.',';
50 50
 
51 51
 	// Si la langue demandee n'existe pas, on essaie d'autres variantes
52 52
 	// Exemple : 'pt-br' => 'pt_br' => 'pt'
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	}
193 193
 	foreach ($langues as $l) {
194 194
 		$selected = ($l == $default) ? ' selected=\'selected\'' : '';
195
-		$ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n";
195
+		$ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n";
196 196
 	}
197 197
 
198 198
 	if (!test_espace_prive()) {
@@ -210,23 +210,21 @@  discard block
 block discarded – undo
210 210
 		$base,
211 211
 		$cible,
212 212
 		(select_langues($nom_select, $change, $ret)
213
-			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"),
213
+			. "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"),
214 214
 		" method='post'"
215 215
 	);
216 216
 }
217 217
 
218 218
 function select_langues($nom_select, $change, $options, $label = '') {
219 219
 	static $cpt = 0;
220
-	$id = 'menu_langues' . $cpt++;
220
+	$id = 'menu_langues'.$cpt++;
221 221
 
222 222
 	return
223
-		"<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' .
223
+		"<label for='$id'>".($label ?: _T('info_langues')).'</label> '.
224 224
 		"<select name='$nom_select' id='$id' "
225 225
 		. ((!test_espace_prive()) ?
226
-			("class='forml menu_langues'") :
227
-			(($nom_select == 'var_lang_ecrire') ?
228
-				("class='lang_ecrire'") :
229
-				"class='fondl'"))
226
+			("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ?
227
+				("class='lang_ecrire'") : "class='fondl'"))
230 228
 		. $change
231 229
 		. ">\n"
232 230
 		. $options
@@ -352,7 +350,7 @@  discard block
 block discarded – undo
352 350
 		and (!isset($GLOBALS['spip_lang'])
353 351
 			or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
354 352
 	) {
355
-		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install
353
+		return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install
356 354
 	}
357 355
 	// en theorie là, la globale est définie, sinon c'est un problème.
358 356
 	if (!isset($GLOBALS['spip_lang'])) {
@@ -455,7 +453,7 @@  discard block
 block discarded – undo
455 453
 	if (!isset($GLOBALS['meta']['langue_site'])) {
456 454
 		// Initialisation : le francais si dispo, sinon la premiere langue trouvee
457 455
 		$GLOBALS['meta']['langue_site'] = $tout =
458
-			(!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false))
456
+			(!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false))
459 457
 				? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ','));
460 458
 		ecrire_meta('langue_site', $tout);
461 459
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	$blue = dechex($blue);
44 44
 
45 45
 	if (strlen($red) == 1) {
46
-		$red = '0' . $red;
46
+		$red = '0'.$red;
47 47
 	}
48 48
 	if (strlen($green) == 1) {
49
-		$green = '0' . $green;
49
+		$green = '0'.$green;
50 50
 	}
51 51
 	if (strlen($blue) == 1) {
52
-		$blue = '0' . $blue;
52
+		$blue = '0'.$blue;
53 53
 	}
54 54
 
55 55
 	return "$red$green$blue";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	$couleur = couleur_html_to_hex($couleur);
68 68
 	$couleur = ltrim($couleur, '#');
69 69
 	if (strlen($couleur) === 3) {
70
-		$couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2];
70
+		$couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2];
71 71
 	}
72 72
 	$retour = [];
73 73
 	$retour['red'] = hexdec(substr($couleur, 0, 2));
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	$var_G = ($G / 255);
126 126
 	$var_B = ($B / 255);
127 127
 
128
-	$var_Min = min($var_R, $var_G, $var_B);   //Min. value of RGB
129
-	$var_Max = max($var_R, $var_G, $var_B);   //Max. value of RGB
130
-	$del_Max = $var_Max - $var_Min;           //Delta RGB value
128
+	$var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB
129
+	$var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB
130
+	$del_Max = $var_Max - $var_Min; //Delta RGB value
131 131
 
132 132
 	$L = ($var_Max + $var_Min) / 2;
133 133
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
  */
190 190
 function _couleur_hsl_to_rgb($H, $S, $L) {
191 191
 	// helper
192
-	$hue_2_rgb = function ($v1, $v2, $vH) {
192
+	$hue_2_rgb = function($v1, $v2, $vH) {
193 193
 		if ($vH < 0) {
194 194
 			$vH += 1;
195 195
 		}
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 		$img = "<img src='$source' />";
322 322
 	} elseif (
323 323
 		preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs)
324
-		and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1])
324
+		and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1])
325 325
 		and in_array($extension, _image_extensions_acceptees_en_entree())
326 326
 	) {
327 327
 		# gerer img src="data:....base64"
328
-		$local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension);
328
+		$local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension);
329 329
 		if (!file_exists($local)) {
330 330
 			ecrire_fichier($local, base64_decode($regs[2]));
331 331
 		}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	// les protocoles web prennent au moins 3 lettres
343 343
 	if (tester_url_absolue($source)) {
344 344
 		include_spip('inc/distant');
345
-		$fichier = _DIR_RACINE . copie_locale($source);
345
+		$fichier = _DIR_RACINE.copie_locale($source);
346 346
 		if (!$fichier) {
347 347
 			return '';
348 348
 		}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 			// on garde la terminaison initiale car image simplement copiee
441 441
 			// et on postfixe son nom avec un md5 du path
442 442
 			$terminaison_dest = $terminaison;
443
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
443
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
444 444
 		} else {
445
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
445
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
446 446
 		}
447 447
 		$cache = sous_repertoire(_DIR_VAR, $cache);
448 448
 		$cache = sous_repertoire($cache, $effet);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$fichier_dest = substr($fichier_dest, 2);
454 454
 	}
455 455
 
456
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
456
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
457 457
 
458 458
 	$GLOBALS['images_calculees'][] = $fichier_dest;
459 459
 
@@ -491,15 +491,15 @@  discard block
 block discarded – undo
491 491
 
492 492
 	if ($creer) {
493 493
 		spip_log(
494
-			'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
495
-			'images' . _LOG_DEBUG
494
+			'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
495
+			'images'._LOG_DEBUG
496 496
 		);
497 497
 	}
498 498
 
499 499
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
500
-	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction;
500
+	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction;
501 501
 	$ret['fichier'] = $fichier;
502
-	$ret['fonction_image'] = '_image_image' . $terminaison_dest;
502
+	$ret['fonction_image'] = '_image_image'.$terminaison_dest;
503 503
 	$ret['fichier_dest'] = $fichier_dest;
504 504
 	$ret['format_source'] = _image_extension_normalisee($terminaison);
505 505
 	$ret['format_dest'] = $terminaison_dest;
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 
650 650
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
651 651
 	if ($_terminaison and $_terminaison !== $terminaison) {
652
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
652
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
653 653
 		$terminaison = $_terminaison;
654 654
 	}
655 655
 	return $terminaison;
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 	if (!function_exists('imagepng')) {
807 807
 		return false;
808 808
 	}
809
-	$tmp = $fichier . '.tmp';
809
+	$tmp = $fichier.'.tmp';
810 810
 	$ret = imagepng($img, $tmp);
811 811
 	if (file_exists($tmp)) {
812 812
 		$taille_test = getimagesize($tmp);
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 	if (!function_exists('imagegif')) {
842 842
 		return false;
843 843
 	}
844
-	$tmp = $fichier . '.tmp';
844
+	$tmp = $fichier.'.tmp';
845 845
 	$ret = imagegif($img, $tmp);
846 846
 	if (file_exists($tmp)) {
847 847
 		$taille_test = getimagesize($tmp);
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 	if (!function_exists('imagejpeg')) {
882 882
 		return false;
883 883
 	}
884
-	$tmp = $fichier . '.tmp';
884
+	$tmp = $fichier.'.tmp';
885 885
 
886 886
 	// Enable interlancing
887 887
 	imageinterlace($img, true);
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 	if (!function_exists('imagewebp')) {
943 943
 		return false;
944 944
 	}
945
-	$tmp = $fichier . '.tmp';
945
+	$tmp = $fichier.'.tmp';
946 946
 	$ret = imagewebp($img, $tmp, $qualite);
947 947
 	if (file_exists($tmp)) {
948 948
 		$taille_test = getimagesize($tmp);
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
  */
977 977
 function _image_imagesvg($img, $fichier) {
978 978
 
979
-	$tmp = $fichier . '.tmp';
979
+	$tmp = $fichier.'.tmp';
980 980
 	if (strpos($img, '<') === false) {
981 981
 		$img = supprimer_timestamp($img);
982 982
 		if (!file_exists($img)) {
@@ -1033,13 +1033,13 @@  discard block
 block discarded – undo
1033 1033
  */
1034 1034
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1035 1035
 	if (is_null($fonction)) {
1036
-		$fonction = '_image_image' . $valeurs['format_dest'];
1036
+		$fonction = '_image_image'.$valeurs['format_dest'];
1037 1037
 	}
1038 1038
 	$ret = false;
1039 1039
 	#un flag pour reperer les images gravees
1040 1040
 	$lock = (
1041 1041
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1042
-		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'))
1042
+		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'))
1043 1043
 	);
1044 1044
 	if (
1045 1045
 		function_exists($fonction)
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
 			// dans tous les cas mettre a jour la taille de l'image finale
1052 1052
 			[$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']);
1053 1053
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1054
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1054
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1055 1055
 		}
1056 1056
 	}
1057 1057
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 
1227 1227
 	// attributs deprecies. Transformer en CSS
1228 1228
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1229
-		$style = "margin:{$espace}px;" . $style;
1229
+		$style = "margin:{$espace}px;".$style;
1230 1230
 		$tag = inserer_attribut($tag, 'hspace', '');
1231 1231
 	}
1232 1232
 
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
 	$image = $valeurs['fichier'];
1354 1354
 	$format = $valeurs['format_source'];
1355 1355
 	$destdir = dirname($valeurs['fichier_dest']);
1356
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1356
+	$destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1357 1357
 
1358 1358
 	$format_sortie = $valeurs['format_dest'];
1359 1359
 
@@ -1385,14 +1385,14 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1387 1387
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1388
-		$vignette = $destination . '.' . $format;
1388
+		$vignette = $destination.'.'.$format;
1389 1389
 		@copy($image, $vignette);
1390 1390
 	}
1391 1391
 
1392 1392
 	elseif ($valeurs['format_source'] === 'svg') {
1393 1393
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1394 1394
 			$format_sortie = 'svg';
1395
-			$vignette = $destination . '.' . $format_sortie;
1395
+			$vignette = $destination.'.'.$format_sortie;
1396 1396
 			$valeurs['fichier_dest'] = $vignette;
1397 1397
 			_image_gd_output($svg, $valeurs);
1398 1398
 		}
@@ -1404,9 +1404,9 @@  discard block
 block discarded – undo
1404 1404
 			define('_CONVERT_COMMAND', 'convert');
1405 1405
 		} // Securite : mes_options.php peut preciser le chemin absolu
1406 1406
 		if (!defined('_RESIZE_COMMAND')) {
1407
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest');
1407
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest');
1408 1408
 		}
1409
-		$vignette = $destination . '.' . $format_sortie;
1409
+		$vignette = $destination.'.'.$format_sortie;
1410 1410
 		$commande = str_replace(
1411 1411
 			['%x', '%y', '%src', '%dest'],
1412 1412
 			[
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 		if (!@file_exists($vignette)) {
1423 1423
 			spip_log("echec convert sur $vignette");
1424 1424
 
1425
-			return;  // echec commande
1425
+			return; // echec commande
1426 1426
 		}
1427 1427
 	}
1428 1428
 
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
 		if (!$output) {
1440 1440
 			return;
1441 1441
 		}
1442
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1442
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1443 1443
 
1444 1444
 		$imagick = new Imagick();
1445 1445
 		$imagick->readImage(realpath($image));
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 			$destHeight,
1449 1449
 			Imagick::FILTER_LANCZOS,
1450 1450
 			1
1451
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1451
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1452 1452
 		$imagick->writeImage($vignette);
1453 1453
 
1454 1454
 		if (!@file_exists($vignette)) {
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 			return;
1458 1458
 		}
1459 1459
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1460
-		$vignette = $destination . '.' . $format_sortie;
1460
+		$vignette = $destination.'.'.$format_sortie;
1461 1461
 	}
1462 1462
 
1463 1463
 	// netpbm
@@ -1468,11 +1468,11 @@  discard block
 block discarded – undo
1468 1468
 		if (_PNMSCALE_COMMAND == '') {
1469 1469
 			return;
1470 1470
 		}
1471
-		$vignette = $destination . '.' . $format_sortie;
1471
+		$vignette = $destination.'.'.$format_sortie;
1472 1472
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1473 1473
 		if ($format == 'jpg') {
1474 1474
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1475
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1475
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1476 1476
 			if (!($s = @filesize($vignette))) {
1477 1477
 				spip_unlink($vignette);
1478 1478
 			}
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
 		} else {
1485 1485
 			if ($format == 'gif') {
1486 1486
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1487
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1487
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1488 1488
 				if (!($s = @filesize($vignette))) {
1489 1489
 					spip_unlink($vignette);
1490 1490
 				}
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
 			} else {
1497 1497
 				if ($format == 'png') {
1498 1498
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1499
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1499
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1500 1500
 					if (!($s = @filesize($vignette))) {
1501 1501
 						spip_unlink($vignette);
1502 1502
 					}
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
 			return;
1519 1519
 		}
1520 1520
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1521
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1521
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1522 1522
 
1523 1523
 			return;
1524 1524
 		}
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 		// de l'image, de facon a tromper le cache du navigateur
1829 1829
 		// quand on fait supprimer/reuploader un logo
1830 1830
 		// (pas de filemtime si SAFE MODE)
1831
-		$date = test_espace_prive() ? ('?' . $date) : '';
1831
+		$date = test_espace_prive() ? ('?'.$date) : '';
1832 1832
 
1833 1833
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1834 1834
 	}
@@ -1874,7 +1874,7 @@  discard block
 block discarded – undo
1874 1874
 	public static function LittleEndian2String($number, $minbytes = 1) {
1875 1875
 		$intstring = '';
1876 1876
 		while ($number > 0) {
1877
-			$intstring = $intstring . chr($number & 255);
1877
+			$intstring = $intstring.chr($number & 255);
1878 1878
 			$number >>= 8;
1879 1879
 		}
1880 1880
 
@@ -1906,9 +1906,9 @@  discard block
 block discarded – undo
1906 1906
 					$b = $argb['blue'];
1907 1907
 
1908 1908
 					if ($bpp[$key] == 32) {
1909
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1909
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1910 1910
 					} elseif ($bpp[$key] == 24) {
1911
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1911
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1912 1912
 					}
1913 1913
 
1914 1914
 					if ($a < 128) {
@@ -1935,48 +1935,48 @@  discard block
 block discarded – undo
1935 1935
 
1936 1936
 			// BITMAPINFOHEADER - 40 bytes
1937 1937
 			$BitmapInfoHeader[$key] = '';
1938
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1939
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1938
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1939
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1940 1940
 			// The biHeight member specifies the combined
1941 1941
 			// height of the XOR and AND masks.
1942 1942
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1943
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1944
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1945
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1946
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1947
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1948
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1949
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1950
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1943
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1944
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1945
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1946
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1947
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1948
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1949
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1950
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1951 1951
 		}
1952 1952
 
1953 1953
 
1954
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1955
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1956
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1954
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1955
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1956
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1957 1957
 
1958 1958
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1959 1959
 		foreach ($gd_image_array as $key => $gd_image) {
1960 1960
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1961 1961
 
1962
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1963
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1964
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1965
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1962
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1963
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1964
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1965
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1966 1966
 
1967
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1968
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1967
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1968
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1969 1969
 
1970 1970
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1971 1971
 			$icondata .= phpthumb_functions::LittleEndian2String(
1972 1972
 				$dwBytesInRes,
1973 1973
 				4
1974
-			);     // dwBytesInRes;	// How many bytes in this resource?
1974
+			); // dwBytesInRes;	// How many bytes in this resource?
1975 1975
 
1976 1976
 			$icondata .= phpthumb_functions::LittleEndian2String(
1977 1977
 				$dwImageOffset,
1978 1978
 				4
1979
-			);    // dwImageOffset;   // Where in the file is this image?
1979
+			); // dwImageOffset;   // Where in the file is this image?
1980 1980
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1981 1981
 			$dwImageOffset += strlen($icXOR[$key]);
1982 1982
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		$infos['url_voir'] = $infos['type'];
707 707
 	}
708 708
 	if (!isset($infos['url_edit'])) {
709
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
709
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
710 710
 	}
711 711
 	if (!isset($infos['icone_objet'])) {
712 712
 		$infos['icone_objet'] = $infos['type'];
@@ -718,48 +718,48 @@  discard block
 block discarded – undo
718 718
 		$infos['texte_retour'] = 'icone_retour';
719 719
 	}
720 720
 	if (!isset($infos['texte_modifier'])) {
721
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
721
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer'])) {
724
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
724
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_creer_associer'])) {
727
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
727
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
728 728
 	}
729 729
 	if (!isset($infos['texte_ajouter'])) {
730 730
 		// Ajouter un X
731
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
731
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objets'])) {
734
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
734
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
735 735
 	}
736 736
 	if (!isset($infos['texte_objet'])) {
737
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
737
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
738 738
 	}
739 739
 	if (!isset($infos['texte_logo_objet'])) {
740 740
 		// objet:titre_logo_objet "Logo de ce X"
741
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
741
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
742 742
 	}
743 743
 	if (!isset($infos['texte_langue_objet'])) {
744 744
 		// objet:texte_langue_objet "Langue de ce X"
745
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
745
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
746 746
 	}
747 747
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
748 748
 		// "Ce X est une traduction du X numéro :"
749
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
749
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
750 750
 	}
751 751
 
752 752
 	// objet:info_aucun_objet
753 753
 	if (!isset($infos['info_aucun_objet'])) {
754
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
754
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
755 755
 	}
756 756
 	// objet:info_1_objet
757 757
 	if (!isset($infos['info_1_objet'])) {
758
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
758
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
759 759
 	}
760 760
 	// objet:info_nb_objets
761 761
 	if (!isset($infos['info_nb_objets'])) {
762
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
762
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
763 763
 	}
764 764
 
765 765
 	if (!isset($infos['champs_editables'])) {
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 		}
960 960
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
961 961
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
962
-		$spip = $connexion['prefixe'] . '_';
962
+		$spip = $connexion['prefixe'].'_';
963 963
 		foreach ($ts as $t) {
964 964
 			$t = substr($t, strlen($spip));
965 965
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1028,10 +1028,10 @@  discard block
 block discarded – undo
1028 1028
 	if ($serveur !== false) {
1029 1029
 		$t = lister_tables_spip($serveur);
1030 1030
 		$trouver_table = charger_fonction('trouver_table', 'base');
1031
-		$typetrim = rtrim($type, 's') . 's';
1031
+		$typetrim = rtrim($type, 's').'s';
1032 1032
 		if (
1033 1033
 			(isset($t[$typetrim]) or in_array($typetrim, $t))
1034
-			and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1034
+			and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1035 1035
 		) {
1036 1036
 			return $desc['id_table'];
1037 1037
 		} elseif (
@@ -1041,11 +1041,11 @@  discard block
 block discarded – undo
1041 1041
 			return $desc['id_table'];
1042 1042
 		}
1043 1043
 
1044
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1044
+		spip_log('table_objet('.$type.') calculee sans verification');
1045 1045
 		#spip_log(debug_backtrace(),'db');
1046 1046
 	}
1047 1047
 
1048
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1048
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1049 1049
 }
1050 1050
 
1051 1051
 /**
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1230 1230
 	// voir si une fonction est definie pour faire le boulot
1231 1231
 	// elle a la priorite dans ce cas
1232
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1232
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1233 1233
 		return $f($objet, $id_objet, $serveur);
1234 1234
 	}
1235 1235
 
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 		$boucle->sql_serveur = $serveur;
1252 1252
 		$boucle->select[] = $id_table_objet;
1253 1253
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1254
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet);
1254
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet);
1255 1255
 
1256 1256
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1257 1257
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 						? "{$parent_methode['source_champ']} = $id_objet"
1379 1379
 						: "$cle_objet = $id_objet";
1380 1380
 					if (isset($parent_methode['source_champ_type'])) {
1381
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1381
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1382 1382
 					}
1383 1383
 					// -- Condition supplémentaire sur la détection du parent
1384 1384
 					if (isset($parent_methode['table_condition'])) {
@@ -1502,11 +1502,11 @@  discard block
 block discarded – undo
1502 1502
 			$where = [];
1503 1503
 			// -- L'identifiant du parent
1504 1504
 			if (isset($_methode_parent['champ'])) {
1505
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1505
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1506 1506
 			}
1507 1507
 			// -- Si le parent est variable
1508 1508
 			if (isset($_methode_parent['champ_type'])) {
1509
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1509
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1510 1510
 			}
1511 1511
 
1512 1512
 			// 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.