Completed
Push — master ( 7208c3...09b169 )
by cam
01:22
created
ecrire/balise/formulaire_admin.php 1 patch
Spacing   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 			}
102 102
 			foreach ($debug['sourcefile'] as $k => $v) {
103 103
 				if (strpos($v, 'administration.') !== false) {
104
-					if (isset($debug['resultat'][$k . 'tout'])) {
105
-						return $debug['resultat'][$k . 'tout'];
104
+					if (isset($debug['resultat'][$k.'tout'])) {
105
+						return $debug['resultat'][$k.'tout'];
106 106
 					}
107 107
 				}
108 108
 			}
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
 			and $id = intval($id)
180 180
 			and $desc = $trouver_table(table_objet_sql($type))
181 181
 		) {
182
-			$id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . intval($id));
182
+			$id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id));
183 183
 			if ($id) {
184 184
 				$env[$_id_type] = $id;
185 185
 				$env['objet'] = $type;
186 186
 				$env['id_objet'] = $id;
187
-				$env['voir_' . $obj] =
187
+				$env['voir_'.$obj] =
188 188
 					str_replace('&', '&', generer_url_entite($id, $obj, '', '', false));
189 189
 				if (isset($desc['field']['id_rubrique'])
190 190
 					and $type != 'rubrique'
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
 	$notpub = sql_in("statut", array('prop', 'prive'));
238 238
 
239 239
 	if ($type == 'article' and $GLOBALS['meta']['post_dates'] != 'oui') {
240
-		$notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ")";
240
+		$notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")";
241 241
 	}
242 242
 
243
-	return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . "=" . $id . " AND ($notpub)");
243
+	return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)");
244 244
 }
245 245
 
246 246
 
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 	$alang = '';
255 255
 	if (!empty($_COOKIE['spip_admin'])) {
256 256
 		$email_or_login = preg_replace(',^@,', '', $_COOKIE['spip_admin']);
257
-		$alang = sql_getfetsel('lang', 'spip_auteurs', "email=" . sql_quote($email_or_login));
257
+		$alang = sql_getfetsel('lang', 'spip_auteurs', "email=".sql_quote($email_or_login));
258 258
 		if (!$alang) {
259
-			$alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote($email_or_login));
259
+			$alang = sql_getfetsel('lang', 'spip_auteurs', "login=".sql_quote($email_or_login));
260 260
 		}
261 261
 	}
262 262
 	if (!$alang) {
@@ -281,9 +281,8 @@  discard block
 block discarded – undo
281 281
 
282 282
 	return ((!isset($GLOBALS['xhtml']) or $GLOBALS['xhtml'] !== 'true') ?
283 283
 		(parametre_url(self(), 'var_mode', 'debug', '&')
284
-			. '&var_mode_affiche=validation') :
285
-		('http://validator.w3.org/check?uri='
286
-			. rawurlencode("http://" . $_SERVER['HTTP_HOST'] . nettoyer_uri())));
284
+			. '&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri='
285
+			. rawurlencode("http://".$_SERVER['HTTP_HOST'].nettoyer_uri())));
287 286
 }
288 287
 
289 288
 /**
Please login to merge, or discard this patch.
ecrire/action/editer_objet.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
  * @return mixed|string
76 76
  */
77 77
 function objet_modifier($objet, $id, $set = null) {
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);
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);
80 80
 		$objet = $t;
81 81
 	}
82
-	if (include_spip('action/editer_' . $objet)
83
-		and function_exists($modifier = $objet . "_modifier")
82
+	if (include_spip('action/editer_'.$objet)
83
+		and function_exists($modifier = $objet."_modifier")
84 84
 	) {
85 85
 		return $modifier($id, $set);
86 86
 	}
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
  * @return bool|int
164 164
  */
165 165
 function objet_inserer($objet, $id_parent = null, $set = null) {
166
-	if (($t=objet_type($objet)) !== $objet) {
167
-		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", "editer" . _LOG_INFO_IMPORTANTE);
166
+	if (($t = objet_type($objet)) !== $objet) {
167
+		spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", "editer"._LOG_INFO_IMPORTANTE);
168 168
 		$objet = $t;
169 169
 	}
170
-	if (include_spip('action/editer_' . $objet)
171
-		and function_exists($inserer = $objet . "_inserer")
170
+	if (include_spip('action/editer_'.$objet)
171
+		and function_exists($inserer = $objet."_inserer")
172 172
 	) {
173 173
 		return $inserer($id_parent, $set);
174 174
 	}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			$row = sql_fetsel("id_rubrique, id_secteur, lang", "spip_rubriques", "id_parent=0", '', '0+titre,titre', "1");
190 190
 			$id_rubrique = $row['id_rubrique'];
191 191
 		} else {
192
-			$row = sql_fetsel("lang, id_secteur", "spip_rubriques", "id_rubrique=" . intval($id_rubrique));
192
+			$row = sql_fetsel("lang, id_secteur", "spip_rubriques", "id_rubrique=".intval($id_rubrique));
193 193
 		}
194 194
 
195 195
 		$champs['id_rubrique'] = $id_rubrique;
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
  * @return string
298 298
  */
299 299
 function objet_instituer($objet, $id, $c, $calcul_rub = true) {
300
-	if (($t=objet_type($objet)) !== $objet) {
301
-		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", "editer" . _LOG_INFO_IMPORTANTE);
300
+	if (($t = objet_type($objet)) !== $objet) {
301
+		spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", "editer"._LOG_INFO_IMPORTANTE);
302 302
 		$objet = $t;
303 303
 	}
304
-	if (include_spip('action/editer_' . $objet)
305
-		and function_exists($instituer = $objet . "_instituer")
304
+	if (include_spip('action/editer_'.$objet)
305
+		and function_exists($instituer = $objet."_instituer")
306 306
 	) {
307 307
 		return $instituer($id, $c, $calcul_rub);
308 308
 	}
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	$sel[] = ($champ_date ? "$champ_date as date" : "'' as date");
332 332
 	$sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : "0 as id_rubrique");
333 333
 
334
-	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id));
334
+	$row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id));
335 335
 
336 336
 	$id_rubrique = $row['id_rubrique'];
337 337
 	$statut_ancien = $statut = $row['statut'];
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			if ($s != 'publie' and autoriser('modifier', $objet, $id)) {
354 354
 				$statut = $champs['statut'] = $s;
355 355
 			} else {
356
-				spip_log("editer_objet $id refus " . join(' ', $c));
356
+				spip_log("editer_objet $id refus ".join(' ', $c));
357 357
 			}
358 358
 		}
359 359
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		and isset($c['id_parent'])
382 382
 		and $id_parent = $c['id_parent']
383 383
 		and $id_parent != $id_rubrique
384
-		and (sql_fetsel('1', "spip_rubriques", "id_rubrique=" . intval($id_parent)))
384
+		and (sql_fetsel('1', "spip_rubriques", "id_rubrique=".intval($id_parent)))
385 385
 	) {
386 386
 		$champs['id_rubrique'] = $id_parent;
387 387
 
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 	// changer aussi son secteur et sa langue (si heritee)
477 477
 	if (isset($champs['id_rubrique'])) {
478 478
 
479
-		$row_rub = sql_fetsel("id_secteur, lang", "spip_rubriques", "id_rubrique=" . sql_quote($champs['id_rubrique']));
479
+		$row_rub = sql_fetsel("id_secteur, lang", "spip_rubriques", "id_rubrique=".sql_quote($champs['id_rubrique']));
480 480
 		$langue = $row_rub['lang'];
481 481
 
482 482
 		if (isset($desc['field']['id_secteur'])) {
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
 		if (isset($desc['field']['lang']) and isset($desc['field']['langue_choisie'])) {
487 487
 			if (sql_fetsel('1', $table_sql,
488
-				id_table_objet($objet) . "=" . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue))) {
488
+				id_table_objet($objet)."=".intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue))) {
489 489
 				$champs['lang'] = $langue;
490 490
 			}
491 491
 		}
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	if (!$champs) {
495 495
 		return;
496 496
 	}
497
-	sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id));
497
+	sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id));
498 498
 
499 499
 	// Changer le statut des rubriques concernees
500 500
 	if ($cond) {
@@ -531,8 +531,8 @@  discard block
 block discarded – undo
531 531
  *     string|int : valeur du champ demande pour l'objet demande
532 532
  */
533 533
 function objet_lire($objet, $valeur_id, $options = array()) {
534
-	if (($t=objet_type($objet)) !== $objet) {
535
-		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", "editer" . _LOG_INFO_IMPORTANTE);
534
+	if (($t = objet_type($objet)) !== $objet) {
535
+		spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", "editer"._LOG_INFO_IMPORTANTE);
536 536
 		$objet = $t;
537 537
 	}
538 538
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 	  or (isset($options['force']) and $options['force'])) {
553 553
 		// Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet.
554 554
 		if (
555
-			include_spip('action/editer_' . $objet)
555
+			include_spip('action/editer_'.$objet)
556 556
 			and function_exists($lire = "${objet}_lire_champs")
557 557
 		) {
558 558
 			$valeurs = $lire($objet, $valeur_id, $champ_id);
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 
563 563
 			// La condition est appliquée sur le champ désigné par l'utilisateur.
564 564
 			$where = array(
565
-				"${champ_id}=" . sql_quote($valeur_id)
565
+				"${champ_id}=".sql_quote($valeur_id)
566 566
 			);
567 567
 
568 568
 			// 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.
prive/formulaires/editer_auteur.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		unset($erreurs['new_login']);
168 168
 	}
169 169
 
170
-	$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
170
+	$auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
171 171
 	$auth_methode = ($auth_methode ? $auth_methode : 'spip');
172 172
 	include_spip('inc/auth');
173 173
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		if (!autoriser('modifier', 'auteur', $id_auteur, null, array('email' => '?'))
183 183
 			and $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur
184 184
 			and !strlen(trim($email))
185
-			and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)))
185
+			and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur)))
186 186
 		) {
187 187
 			$erreurs['email'] = (($id_auteur == $GLOBALS['visiteur_session']['id_auteur']) ? _T('form_email_non_valide') : _T('form_prop_indiquer_email'));
188 188
 		} else {
@@ -197,18 +197,18 @@  discard block
 block discarded – undo
197 197
 			#Nouvel auteur
198 198
 			if (intval($id_auteur) == 0) {
199 199
 				#Un auteur existe deja avec cette adresse ?
200
-				if (sql_countsel('spip_auteurs', 'email=' . sql_quote($email)) > 0) {
200
+				if (sql_countsel('spip_auteurs', 'email='.sql_quote($email)) > 0) {
201 201
 					$erreurs['email'] = _T('erreur_email_deja_existant');
202 202
 				}
203 203
 			} else {
204 204
 				#Un auteur existe deja avec cette adresse ? et n'est pas le user courant.
205 205
 				if ((sql_countsel(
206 206
 					'spip_auteurs',
207
-					'email=' . sql_quote($email)
207
+					'email='.sql_quote($email)
208 208
 				) > 0) and ($id_auteur != ($id_auteur_ancien = sql_getfetsel(
209 209
 					'id_auteur',
210 210
 					'spip_auteurs',
211
-					'email=' . sql_quote($email)
211
+					'email='.sql_quote($email)
212 212
 				)))) {
213 213
 					$erreurs['email'] = _T('erreur_email_deja_existant');
214 214
 				}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	// corriger un cas si frequent : www.example.org sans le http:// qui precede
226 226
 	if ($url = _request('url_site') and !tester_url_absolue($url)) {
227 227
 		if (strpos($url, ':') === false and strncasecmp($url, 'www.', 4) === 0) {
228
-			$url = 'http://' . $url;
228
+			$url = 'http://'.$url;
229 229
 			set_request('url_site', $url);
230 230
 		}
231 231
 	}
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
 	$erreurs['message_erreur'] = '';
239 239
 	if (
240 240
 		$login = _request('login') and
241
-		$login !== sql_getfetsel('login','spip_auteurs', 'id_auteur='.intval($id_auteur))
241
+		$login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur))
242 242
 	) {
243 243
 		// on verifie la meme chose que dans auteurs_edit_config()
244
-		if ( ! auth_autoriser_modifier_login($auth_methode)
245
-			or !autoriser('modifier', 'auteur', intval($id_auteur), null, array('email' => true))){
244
+		if (!auth_autoriser_modifier_login($auth_methode)
245
+			or !autoriser('modifier', 'auteur', intval($id_auteur), null, array('email' => true))) {
246 246
 			$erreurs['login'] = _T('info_non_modifiable');
247 247
 		}
248 248
 	}
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 	if ($restreintes = _request('restreintes')) {
322 322
 		foreach ($restreintes as $k => $v) {
323
-			if(strpos($v, 'rubrique|') === 0) {
323
+			if (strpos($v, 'rubrique|') === 0) {
324 324
 				$restreintes[$k] = substr($v, 9);
325 325
 			}
326 326
 		}
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		// et de revenir sur son profil
344 344
 		if ($GLOBALS['visiteur_session']['id_auteur'] == $id_auteur
345 345
 			and $email_nouveau !=
346
-				($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)))
346
+				($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur)))
347 347
 		) {
348 348
 			$envoyer_mail = charger_fonction('envoyer_mail', 'inc');
349 349
 			$texte = _T(
@@ -373,11 +373,11 @@  discard block
 block discarded – undo
373 373
 		$erreurs = auteur_reset_password($res['id_auteur'], $erreurs);
374 374
 		if (isset($erreurs['message_ok'])) {
375 375
 			if (!isset($res['message_ok'])) $res['message_ok'] = '';
376
-			$res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']);
376
+			$res['message_ok'] = trim($res['message_ok'].' '.$erreurs['message_ok']);
377 377
 		}
378 378
 		if (isset($erreurs['message_erreur']) and $erreurs['message_erreur']) {
379 379
 			if (!isset($res['message_erreur'])) $res['message_erreur'] = '';
380
-			$res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']);
380
+			$res['message_erreur'] = trim($res['message_erreur'].' '.$erreurs['message_erreur']);
381 381
 		}
382 382
 	}
383 383
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
 
406 406
 function auteur_reset_password($id_auteur, $erreurs = array()) {
407
-	$auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
407
+	$auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
408 408
 	$config = auteurs_edit_config($auteur);
409 409
 
410 410
 	if ($config['edit_pass']) {
@@ -430,21 +430,21 @@  discard block
 block discarded – undo
430 430
  * @param array $contexte
431 431
  * @return string
432 432
  */
433
-function auteur_regenerer_identifiants($id_auteur, $notifier=true, $contexte = array()) {
434
-	if ($id_auteur){
433
+function auteur_regenerer_identifiants($id_auteur, $notifier = true, $contexte = array()) {
434
+	if ($id_auteur) {
435 435
 		$set = array();
436 436
 		include_spip('inc/access');
437 437
 		$set['pass'] = creer_pass_aleatoire();
438 438
 
439 439
 		include_spip('action/editer_auteur');
440
-		auteur_modifier($id_auteur,$set);
440
+		auteur_modifier($id_auteur, $set);
441 441
 
442
-		$row = sql_fetsel('*','spip_auteurs','id_auteur='.intval($id_auteur));
442
+		$row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
443 443
 		include_spip('inc/filtres');
444 444
 		if ($notifier
445 445
 			and $row['email']
446 446
 			and email_valide($row['email'])
447
-		  and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')){
447
+		  and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')) {
448 448
 			// envoyer l'email avec login/pass
449 449
 			$c = array(
450 450
 				'id_auteur' => $id_auteur,
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 			lang_select($contexte['lang']);
469 469
 			$message = recuperer_fond($fond, $contexte);
470 470
 			include_spip("inc/notifications");
471
-			notifications_envoyer_mails($row['email'],$message);
471
+			notifications_envoyer_mails($row['email'], $message);
472 472
 			lang_select();
473 473
 
474 474
 			return $row['email'];
Please login to merge, or discard this patch.
ecrire/inc/notifications.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	if ($notification = charger_fonction($quoi, 'notifications', true)) {
41 41
 		spip_log("$notification($quoi,$id"
42
-			. ($options ? "," . serialize($options) : "")
42
+			. ($options ? ",".serialize($options) : "")
43 43
 			. ")", 'notifications');
44 44
 		$notification($quoi, $id, $options);
45 45
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		);
156 156
 		$email = $envoi['email'];
157 157
 
158
-		job_queue_add('envoyer_mail', ">$email : " . $envoi['sujet'],
158
+		job_queue_add('envoyer_mail', ">$email : ".$envoi['sujet'],
159 159
 			array($email, $envoi['sujet'], $envoi['texte'], $envoi['from'], $envoi['headers']), 'inc/');
160 160
 	}
161 161
 
Please login to merge, or discard this patch.
ecrire/inc/traduire.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	static $dirs = array();
42 42
 	$liste = array();
43 43
 	foreach (creer_chemin() as $dir) {
44
-		if (!isset($dirs[$a = $dir . $dirname])) {
44
+		if (!isset($dirs[$a = $dir.$dirname])) {
45 45
 			$dirs[$a] = (is_dir($a) || !$a);
46 46
 		}
47 47
 		if ($dirs[$a]) {
@@ -67,20 +67,20 @@  discard block
 block discarded – undo
67 67
  **/
68 68
 function chercher_module_lang($module, $lang = '') {
69 69
 	if ($lang) {
70
-		$lang = '_' . $lang;
70
+		$lang = '_'.$lang;
71 71
 	}
72 72
 
73 73
 	// 1) dans un repertoire nomme lang/ se trouvant sur le chemin
74 74
 	if ($f = ($module == 'local'
75
-		? find_in_path($module . $lang . '.php', 'lang/')
76
-		: find_langs_in_path($module . $lang . '.php', 'lang/'))
75
+		? find_in_path($module.$lang.'.php', 'lang/')
76
+		: find_langs_in_path($module.$lang.'.php', 'lang/'))
77 77
 	) {
78 78
 		return is_array($f) ? $f : array($f);
79 79
 	}
80 80
 
81 81
 	// 2) directement dans le chemin (old style, uniquement pour local)
82 82
 	return (($module == 'local') or strpos($module, '/'))
83
-		? (($f = find_in_path($module . $lang . '.php')) ? array($f) : false)
83
+		? (($f = find_in_path($module.$lang.'.php')) ? array($f) : false)
84 84
 		: false;
85 85
 }
86 86
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  **/
105 105
 function charger_langue($lang, $module = 'spip') {
106 106
 	static $langs = array();
107
-	$var = 'i18n_' . $module . '_' . $lang;
107
+	$var = 'i18n_'.$module.'_'.$lang;
108 108
 	if (!isset($langs[$lang])) {
109 109
 		$langs[$lang] = array();
110 110
 		if ($lang) {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 	foreach ($langs[$lang] as $l) {
121 121
 		if ($fichiers_lang = chercher_module_lang($module, $l)) {
122
-			$GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l;
122
+			$GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l;
123 123
 			include(array_shift($fichiers_lang));
124 124
 			surcharger_langue($fichiers_lang);
125 125
 			if ($l !== $lang) {
126
-				$GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l];
126
+				$GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l];
127 127
 			}
128
-			$GLOBALS['lang_' . $var] = $l;
128
+			$GLOBALS['lang_'.$var] = $l;
129 129
 			#spip_log("module de langue : ${module}_$l.php", 'traduire');
130 130
 			break;
131 131
 		}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	foreach ($fichiers as $fichier) {
164 164
 		if (!isset($surcharges[$fichier])) {
165 165
 			$idx_lang_normal = $GLOBALS['idx_lang'];
166
-			$GLOBALS['idx_lang'] = $GLOBALS['idx_lang'] . '@temporaire';
166
+			$GLOBALS['idx_lang'] = $GLOBALS['idx_lang'].'@temporaire';
167 167
 			include($fichier);
168 168
 			$surcharges[$fichier] = $GLOBALS[$GLOBALS['idx_lang']];
169 169
 			unset($GLOBALS[$GLOBALS['idx_lang']]);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		}
172 172
 		if (is_array($surcharges[$fichier])) {
173 173
 			$GLOBALS[$GLOBALS['idx_lang']] = array_merge(
174
-				(isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array)$GLOBALS[$GLOBALS['idx_lang']] : array()),
174
+				(isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array) $GLOBALS[$GLOBALS['idx_lang']] : array()),
175 175
 				$surcharges[$fichier]
176 176
 			);
177 177
 		}
@@ -249,27 +249,27 @@  discard block
 block discarded – undo
249 249
 	} else {
250 250
 		$modules = array('spip', 'ecrire');
251 251
 		$code = $ori;
252
-		$ori_complet = implode('|', $modules) . ':' . $ori;
252
+		$ori_complet = implode('|', $modules).':'.$ori;
253 253
 	}
254 254
 
255 255
 	$desc = new SPIP_Traductions_Description();
256 256
 
257 257
 	// parcourir tous les modules jusqu'a ce qu'on trouve
258 258
 	foreach ($modules as $module) {
259
-		$var = "i18n_" . $module . "_" . $lang;
259
+		$var = "i18n_".$module."_".$lang;
260 260
 
261 261
 		if (empty($GLOBALS[$var])) {
262 262
 			charger_langue($lang, $module);
263 263
 			// surcharges persos -- on cherche
264 264
 			// (lang/)local_xx.php et/ou (lang/)local.php ...
265
-			if (!isset($local['local_' . $lang])) {
265
+			if (!isset($local['local_'.$lang])) {
266 266
 				// redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer)
267 267
 				$GLOBALS['idx_lang'] = $var;
268 268
 				// ... (lang/)local_xx.php
269
-				$local['local_' . $lang] = chercher_module_lang('local', $lang);
269
+				$local['local_'.$lang] = chercher_module_lang('local', $lang);
270 270
 			}
271
-			if ($local['local_' . $lang]) {
272
-				surcharger_langue($local['local_' . $lang]);
271
+			if ($local['local_'.$lang]) {
272
+				surcharger_langue($local['local_'.$lang]);
273 273
 			}
274 274
 			// ... puis (lang/)local.php
275 275
 			if (!isset($local['local'])) {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		if (isset($GLOBALS[$var][$code])) {
284 284
 			$desc->code = $code;
285 285
 			$desc->module = $module;
286
-			$desc->langue = $GLOBALS['lang_' . $var];
286
+			$desc->langue = $GLOBALS['lang_'.$var];
287 287
 			$desc->texte = $GLOBALS[$var][$code];
288 288
 			break;
289 289
 		}
@@ -337,13 +337,13 @@  discard block
 block discarded – undo
337 337
 	if (!$desc->mode and $desc->texte) {
338 338
 		// ne pas modifier 2 fois l'affichage
339 339
 		$desc->mode = 'traduction';
340
-		$classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : '');
340
+		$classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : '');
341 341
 		$desc->texte = '<span '
342
-			. 'lang=' . $desc->langue
343
-			. ' class=' . $classe
344
-			. ' data-module=' . $desc->module
345
-			. ' data-code=' . $desc->code
346
-			. ' title=' . $modules . '(' . $desc->langue . ')>'
342
+			. 'lang='.$desc->langue
343
+			. ' class='.$classe
344
+			. ' data-module='.$desc->module
345
+			. ' data-code='.$desc->code
346
+			. ' title='.$modules.'('.$desc->langue.')>'
347 347
 			. $desc->texte
348 348
 			. '</span>';
349 349
 		$desc->texte = str_replace(
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function generer_nom_fichier_cache($contexte, $page) {
30 30
 	$u = md5(var_export(array($contexte, $page), true));
31 31
 
32
-	return $u . ".cache";
32
+	return $u.".cache";
33 33
 }
34 34
 
35 35
 /**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 function cache_chemin_fichier($nom_cache, $ecrire = false) {
48 48
 	static $l1, $l2;
49 49
 	if (is_null($l1)) {
50
-		$length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8,max(_CACHE_PROFONDEUR_STOCKAGE,2)) : 4);
50
+		$length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8, max(_CACHE_PROFONDEUR_STOCKAGE, 2)) : 4);
51 51
 		$l1 = intval(floor($length / 2));
52 52
 		$l2 = $length - $l1;
53 53
 	}
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 	else {
63 63
 		// en lecture on essaye pa de creer les repertoires, on va au plus vite
64
-		$rep = _DIR_CACHE . "$d/";
64
+		$rep = _DIR_CACHE."$d/";
65 65
 	}
66 66
 
67
-	return $rep . $u . ".cache";
67
+	return $rep.$u.".cache";
68 68
 }
69 69
 
70 70
 /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			), 'non');
112 112
 	}
113 113
 
114
-	return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']);
114
+	return crc32($GLOBALS['meta']['cache_signature'].$page['texte']);
115 115
 }
116 116
 
117 117
 /**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 		// "cache sessionne" ; sa date indique la date de validite
266 266
 		// des caches sessionnes
267 267
 		if (!$tmp = lire_cache($chemin_cache)) {
268
-			spip_log('Creation cache sessionne ' . $chemin_cache);
268
+			spip_log('Creation cache sessionne '.$chemin_cache);
269 269
 			$tmp = array(
270 270
 				'invalideurs' => array('session' => ''),
271 271
 				'lastmodified' => $_SERVER['REQUEST_TIME']
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 	// l'enregistrer, compresse ou non...
290 290
 	$ok = ecrire_cache($chemin_cache, $pagez);
291 291
 
292
-	spip_log((_IS_BOT ? "Bot:" : "") . "Creation du cache $chemin_cache pour "
293
-		. $page['entetes']['X-Spip-Cache'] . " secondes" . ($ok ? '' : ' (erreur!)'), _LOG_INFO);
292
+	spip_log((_IS_BOT ? "Bot:" : "")."Creation du cache $chemin_cache pour "
293
+		. $page['entetes']['X-Spip-Cache']." secondes".($ok ? '' : ' (erreur!)'), _LOG_INFO);
294 294
 
295 295
 	// Inserer ses invalideurs
296 296
 	include_spip('inc/invalideur');
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 function nettoyer_petit_cache($prefix, $duree = 300) {
313 313
 	// determiner le repertoire a purger : 'tmp/CACHE/rech/'
314 314
 	$dircache = sous_repertoire(_DIR_CACHE, $prefix);
315
-	if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) {
315
+	if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) {
316 316
 		foreach (preg_files($dircache, '[.]txt$') as $f) {
317 317
 			if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) {
318 318
 				spip_unlink($f);
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
 		if (spip_connect()) {
403 403
 			include_spip('inc/invalideur');
404 404
 			retire_caches($chemin_cache); # API invalideur inutile
405
-			supprimer_fichier(_DIR_CACHE . $chemin_cache);
405
+			supprimer_fichier(_DIR_CACHE.$chemin_cache);
406 406
 			if (isset($chemin_cache_session) and $chemin_cache_session) {
407
-				supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
407
+				supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
408 408
 			}
409 409
 		}
410 410
 	}
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
 		$page = array('contexte_implicite' => $contexte_implicite); // ignorer le cache deja lu
420 420
 		include_spip('inc/invalideur');
421 421
 		retire_caches($chemin_cache); # API invalideur inutile
422
-		supprimer_fichier(_DIR_CACHE . $chemin_cache);
422
+		supprimer_fichier(_DIR_CACHE.$chemin_cache);
423 423
 		if (isset($chemin_cache_session) and $chemin_cache_session) {
424
-			supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
424
+			supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
425 425
 		}
426 426
 	}
427 427
 
Please login to merge, or discard this patch.
ecrire/inc/exporter_csv.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	$champ = preg_replace(',[\s]+,ms', ' ', $champ);
39 39
 	$champ = str_replace('"', '""', $champ);
40 40
 
41
-	return '"' . $champ . '"';
41
+	return '"'.$champ.'"';
42 42
 }
43 43
 
44 44
 /**
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
  * @param callable $callback
55 55
  * @return string
56 56
  */
57
-function exporter_csv_ligne_numerotee($nb, $ligne, $delim = ',', $importer_charset = null, $callback=null) {
57
+function exporter_csv_ligne_numerotee($nb, $ligne, $delim = ',', $importer_charset = null, $callback = null) {
58 58
 	if ($callback) {
59 59
 		$ligne = call_user_func($callback, $nb, $ligne, $delim, $importer_charset);
60 60
 	}
61
-	$output = join($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n";
61
+	$output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n";
62 62
 	if ($importer_charset) {
63 63
 		$output = str_replace('’', '\'', $output);
64 64
 		$output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
  * @param null $importer_charset
75 75
  * @return string
76 76
  */
77
-function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null){
77
+function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null) {
78 78
 	return exporter_csv_ligne_numerotee(null, $ligne, $delim, $importer_charset);
79 79
 }
80 80
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$fichier = "php://output";
176 176
 	}
177 177
 	else {
178
-	$fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename;
178
+	$fichier = sous_repertoire(_DIR_CACHE, 'export').$filename;
179 179
 	}
180 180
 
181 181
 	$fp = fopen($fichier, 'w');
Please login to merge, or discard this patch.
ecrire/balise/url_.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	if ($s = trouver_nom_serveur_distant($p)) {
77 77
 
78 78
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
79
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
79
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
80 80
 			return $f($type, $_id, $s);
81 81
 		}
82 82
 		if (!$GLOBALS['connexions'][strtolower($s)]['spip_connect_version']) {
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		# exception des urls de documents sur un serveur distant...
87 87
 		if ($type == 'document') {
88 88
 			return
89
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
90
-				"quete_meta('dir_img', $s) . \n\t" .
89
+				"quete_meta('adresse_site', $s) . '/' .\n\t".
90
+				"quete_meta('dir_img', $s) . \n\t".
91 91
 				"quete_fichier($_id,$s)";
92 92
 		}
93 93
 		$s = ", '', '', $s, quete_meta('type_urls', $s)";
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
  */
232 232
 function balise_URL_SITE_SPIP_dist($p) {
233 233
 	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
234
-	$p->code = "spip_htmlspecialchars(" . $p->code . ")";
234
+	$p->code = "spip_htmlspecialchars(".$p->code.")";
235 235
 	$p->interdire_scripts = false;
236 236
 
237 237
 	return $p;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	if ($s = trouver_nom_serveur_distant($p)) {
273 273
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
274 274
 		// elle devra aussi traiter le cas derogatoire type=page
275
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
275
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
276 276
 			if ($args and $args !== "''") {
277 277
 				$code .= ", $args";
278 278
 			}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			$p->code = $code;
281 281
 			return $p;
282 282
 		}
283
-		$s = 'connect=' . addslashes($s);
283
+		$s = 'connect='.addslashes($s);
284 284
 		$args = (($args and $args !== "''") ? "$args . '&$s'" : "'$s'");
285 285
 	}
286 286
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		$code = "generer_url_public($code, $args$noentities)";
296 296
 	}
297 297
 	$p->code = $code;
298
-	spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
298
+	spip_log("Calcul url page : connect vaut $s ca donne :".$p->code." args $args", _LOG_INFO);
299 299
 
300 300
 	#$p->interdire_scripts = true;
301 301
 	return $p;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			$fonc .= ",$args$noentities";
340 340
 		}
341 341
 	}
342
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
342
+	$p->code = 'generer_url_ecrire('.$fonc.')';
343 343
 	$p->interdire_scripts = false;
344 344
 
345 345
 	return $p;
@@ -374,17 +374,17 @@  discard block
 block discarded – undo
374 374
 
375 375
 	$args = interprete_argument_balise(2, $p);
376 376
 	if ($args != "''" && $args !== null) {
377
-		$p->code .= "," . $args;
377
+		$p->code .= ",".$args;
378 378
 	}
379 379
 	$redirect = interprete_argument_balise(3, $p);
380 380
 	if ($redirect != "''" && $redirect !== null) {
381 381
 		if ($args == "''" || $args === null) {
382 382
 			$p->code .= ",''";
383 383
 		}
384
-		$p->code .= "," . $redirect;
384
+		$p->code .= ",".$redirect;
385 385
 	}
386 386
 
387
-	$p->code = "generer_action_auteur(" . $p->code . ")";
387
+	$p->code = "generer_action_auteur(".$p->code.")";
388 388
 	$p->interdire_scripts = false;
389 389
 
390 390
 	return $p;
Please login to merge, or discard this patch.
prive/formulaires/login.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 	// Si on est connecte, appeler traiter()
136 136
 	// et lancer la redirection si besoin
137
-	if (!$valeurs['editable'] and $loge and _request('formulaire_action')!=='login') {
137
+	if (!$valeurs['editable'] and $loge and _request('formulaire_action') !== 'login') {
138 138
 		$traiter = charger_fonction('traiter', 'formulaires/login');
139 139
 		$res = $traiter($cible, $login, $prive);
140 140
 		$valeurs = array_merge($valeurs, $res);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			# preparer un lien pour quand redirige_formulaire ne fonctionne pas
145 145
 			$m = redirige_formulaire($res['redirect']);
146 146
 			$valeurs['_deja_loge'] = inserer_attribut(
147
-				'<a>' . _T('login_par_ici') . "</a>$m",
147
+				'<a>'._T('login_par_ici')."</a>$m",
148 148
 				'href',
149 149
 				$res['redirect']
150 150
 			);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 function login_autoriser() {
291 291
 	include_spip('inc/autoriser');
292 292
 	if (!autoriser('ecrire')) {
293
-		$h = generer_url_action('logout', 'logout=prive&url=' . urlencode(self()));
293
+		$h = generer_url_action('logout', 'logout=prive&url='.urlencode(self()));
294 294
 
295 295
 		return array(
296 296
 			'message_erreur' => '<h1>'
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 				. '</h1><p>'
299 299
 				. _T('texte_erreur_visiteur')
300 300
 				. "</p><p class='retour'>[<a href='$h'>"
301
-				. _T('icone_deconnecter') . '</a>]</p>'
301
+				. _T('icone_deconnecter').'</a>]</p>'
302 302
 		);
303 303
 	}
304 304
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		// transformer la cible absolue en cible relative
351 351
 		// pour pas echouer quand la meta adresse_site est foireuse
352 352
 		if (strncmp($cible, $u = url_de_base(), strlen($u)) == 0) {
353
-			$cible = './' . substr($cible, strlen($u));
353
+			$cible = './'.substr($cible, strlen($u));
354 354
 		} elseif (tester_url_absolue($cible) and !defined('_AUTORISER_LOGIN_ABS_REDIRECT')) {
355 355
 			// si c'est une url absolue, refuser la redirection
356 356
 			// sauf si cette securite est levee volontairement par le webmestre
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	if ($cible and ($cible != self('&')) and ($cible != self())) {
363 363
 		$res['redirect'] = $cible;
364 364
 		$res['message_ok'] = inserer_attribut(
365
-			'<a>' . _T('login_par_ici') . '</a>',
365
+			'<a>'._T('login_par_ici').'</a>',
366 366
 			'href',
367 367
 			$cible
368 368
 		);
Please login to merge, or discard this patch.