Completed
Push — master ( 98daf0...11f960 )
by cam
27:46
created
spip.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 # ou est l'espace prive ?
14 14
 if (!defined('_DIR_RESTREINT_ABS')) {
15
-	define('_DIR_RESTREINT_ABS', 'ecrire/');
15
+    define('_DIR_RESTREINT_ABS', 'ecrire/');
16 16
 }
17 17
 include_once _DIR_RESTREINT_ABS.'inc_version.php';
18 18
 
Please login to merge, or discard this patch.
ecrire/inc_version.php 1 patch
Indentation   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 define('_PHP_MIN', '5.4.0');
37 37
 
38 38
 if (!defined('_DIR_RESTREINT_ABS')) {
39
-	/** le nom du repertoire ecrire/ */
40
-	define('_DIR_RESTREINT_ABS', 'ecrire/');
39
+    /** le nom du repertoire ecrire/ */
40
+    define('_DIR_RESTREINT_ABS', 'ecrire/');
41 41
 }
42 42
 
43 43
 /** Chemin relatif pour aller dans ecrire
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 
58 58
 // Icones
59 59
 if (!defined('_NOM_IMG_PACK')) {
60
-	/** Nom du dossier images */
61
-	define('_NOM_IMG_PACK', 'images/');
60
+    /** Nom du dossier images */
61
+    define('_NOM_IMG_PACK', 'images/');
62 62
 }
63 63
 /** le chemin http (relatif) vers les images standard */
64 64
 define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 define('_ROOT_IMG_PACK', dirname(dirname(__FILE__)) . '/prive/' . _NOM_IMG_PACK);
68 68
 
69 69
 if (!defined('_JAVASCRIPT')) {
70
-	/** Nom du repertoire des  bibliotheques JavaScript */
71
-	define('_JAVASCRIPT', 'javascript/');
70
+    /** Nom du repertoire des  bibliotheques JavaScript */
71
+    define('_JAVASCRIPT', 'javascript/');
72 72
 } // utilisable avec #CHEMIN et find_in_path
73 73
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
74 74
 define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
@@ -78,46 +78,46 @@  discard block
 block discarded – undo
78 78
 # mais on peut les mettre ailleurs et changer completement les noms
79 79
 
80 80
 if (!defined('_NOM_TEMPORAIRES_INACCESSIBLES')) {
81
-	/** Nom du repertoire des fichiers Temporaires Inaccessibles par http:// */
82
-	define('_NOM_TEMPORAIRES_INACCESSIBLES', "tmp/");
81
+    /** Nom du repertoire des fichiers Temporaires Inaccessibles par http:// */
82
+    define('_NOM_TEMPORAIRES_INACCESSIBLES', "tmp/");
83 83
 }
84 84
 if (!defined('_NOM_TEMPORAIRES_ACCESSIBLES')) {
85
-	/** Nom du repertoire des fichiers Temporaires Accessibles par http:// */
86
-	define('_NOM_TEMPORAIRES_ACCESSIBLES', "local/");
85
+    /** Nom du repertoire des fichiers Temporaires Accessibles par http:// */
86
+    define('_NOM_TEMPORAIRES_ACCESSIBLES', "local/");
87 87
 }
88 88
 if (!defined('_NOM_PERMANENTS_INACCESSIBLES')) {
89
-	/** Nom du repertoire des fichiers Permanents Inaccessibles par http:// */
90
-	define('_NOM_PERMANENTS_INACCESSIBLES', "config/");
89
+    /** Nom du repertoire des fichiers Permanents Inaccessibles par http:// */
90
+    define('_NOM_PERMANENTS_INACCESSIBLES', "config/");
91 91
 }
92 92
 if (!defined('_NOM_PERMANENTS_ACCESSIBLES')) {
93
-	/** Nom du repertoire des fichiers Permanents Accessibles par http:// */
94
-	define('_NOM_PERMANENTS_ACCESSIBLES', "IMG/");
93
+    /** Nom du repertoire des fichiers Permanents Accessibles par http:// */
94
+    define('_NOM_PERMANENTS_ACCESSIBLES', "IMG/");
95 95
 }
96 96
 
97 97
 
98 98
 /** Le nom du fichier de personnalisation */
99 99
 if (!defined('_NOM_CONFIG')) {
100
-	define('_NOM_CONFIG', 'mes_options');
100
+    define('_NOM_CONFIG', 'mes_options');
101 101
 }
102 102
 
103 103
 // Son emplacement absolu si on le trouve
104 104
 if (@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
105
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
105
+    or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
106 106
 ) {
107
-	/** Emplacement absolu du fichier d'option */
108
-	define('_FILE_OPTIONS', $f);
107
+    /** Emplacement absolu du fichier d'option */
108
+    define('_FILE_OPTIONS', $f);
109 109
 } else {
110
-	define('_FILE_OPTIONS', '');
110
+    define('_FILE_OPTIONS', '');
111 111
 }
112 112
 
113 113
 if (!defined('MODULES_IDIOMES')) {
114
-	/**
115
-	 * Modules par défaut pour la traduction.
116
-	 *
117
-	 * Constante utilisée par le compilateur et le décompilateur
118
-	 * sa valeur etant traitée par inc_traduire_dist
119
-	 */
120
-	define('MODULES_IDIOMES', 'public|spip|ecrire');
114
+    /**
115
+     * Modules par défaut pour la traduction.
116
+     *
117
+     * Constante utilisée par le compilateur et le décompilateur
118
+     * sa valeur etant traitée par inc_traduire_dist
119
+     */
120
+    define('MODULES_IDIOMES', 'public|spip|ecrire');
121 121
 }
122 122
 
123 123
 // *** Fin des define *** //
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
 // Inclure l'ecran de securite
127 127
 if (!defined('_ECRAN_SECURITE')
128
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
128
+    and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
129 129
 ) {
130
-	include $f;
130
+    include $f;
131 131
 }
132 132
 
133 133
 
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
  * Détecteur de robot d'indexation
136 136
  */
137 137
 if (!defined('_IS_BOT')) {
138
-	define('_IS_BOT',
139
-		isset($_SERVER['HTTP_USER_AGENT'])
140
-		and preg_match(
141
-			// mots generiques
142
-			',bot|slurp|crawler|spider|webvac|yandex|'
143
-			// MSIE 6.0 est un botnet 99,9% du temps, on traite donc ce USER_AGENT comme un bot
144
-			. 'MSIE 6\.0|'
145
-			// UA plus cibles
146
-			. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
147
-			. ',i', (string)$_SERVER['HTTP_USER_AGENT'])
148
-	);
138
+    define('_IS_BOT',
139
+        isset($_SERVER['HTTP_USER_AGENT'])
140
+        and preg_match(
141
+            // mots generiques
142
+            ',bot|slurp|crawler|spider|webvac|yandex|'
143
+            // MSIE 6.0 est un botnet 99,9% du temps, on traite donc ce USER_AGENT comme un bot
144
+            . 'MSIE 6\.0|'
145
+            // UA plus cibles
146
+            . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
147
+            . ',i', (string)$_SERVER['HTTP_USER_AGENT'])
148
+    );
149 149
 }
150 150
 
151 151
 //
@@ -210,48 +210,48 @@  discard block
 block discarded – undo
210 210
 // Prendre en compte les entetes HTTP_X_FORWARDED_XX
211 211
 //
212 212
 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
213
-	if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
214
-		$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
215
-	}
216
-	if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
217
-		$_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
218
-	}
213
+    if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
214
+        $_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
215
+    }
216
+    if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
217
+        $_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
218
+    }
219 219
 }
220 220
 if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])){
221
-	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
222
-		$_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
223
-		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
224
-			$_SERVER['HTTPS'] = 'on';
225
-			if (isset($_SERVER['REQUEST_SCHEME'])) {
226
-				$_SERVER['REQUEST_SCHEME'] = 'https';
227
-			}
228
-		}
229
-	}
230
-	$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
231
-	if (strpos($host,',')!==false){
232
-		$h = explode(',',$host);
233
-		$host = trim(reset($h));
234
-	}
235
-	// securite sur le contenu de l'entete
236
-	$host = strtr($host, "<>?\"\{\}\$'` \r\n", '____________');
237
-	$_SERVER['HTTP_HOST'] = $host;
221
+    if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
222
+        $_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
223
+        if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
224
+            $_SERVER['HTTPS'] = 'on';
225
+            if (isset($_SERVER['REQUEST_SCHEME'])) {
226
+                $_SERVER['REQUEST_SCHEME'] = 'https';
227
+            }
228
+        }
229
+    }
230
+    $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
231
+    if (strpos($host,',')!==false){
232
+        $h = explode(',',$host);
233
+        $host = trim(reset($h));
234
+    }
235
+    // securite sur le contenu de l'entete
236
+    $host = strtr($host, "<>?\"\{\}\$'` \r\n", '____________');
237
+    $_SERVER['HTTP_HOST'] = $host;
238 238
 }
239 239
 //
240 240
 // On note le numero IP du client dans la variable $ip
241 241
 //
242 242
 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
243
-	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
244
-	if (strpos($ip,',')!==false){
245
-		$ip = explode(',',$ip);
246
-		$ip = reset($ip);
247
-	}
248
-	// ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
249
-	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
250
-		$_SERVER['REMOTE_ADDR'] = $ip;
251
-	}
243
+    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
244
+    if (strpos($ip,',')!==false){
245
+        $ip = explode(',',$ip);
246
+        $ip = reset($ip);
247
+    }
248
+    // ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
249
+    if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
250
+        $_SERVER['REMOTE_ADDR'] = $ip;
251
+    }
252 252
 }
253 253
 if (isset($_SERVER['REMOTE_ADDR'])) {
254
-	$ip = $_SERVER['REMOTE_ADDR'];
254
+    $ip = $_SERVER['REMOTE_ADDR'];
255 255
 }
256 256
 
257 257
 // Pour renforcer la privacy, decommentez la ligne ci-dessous (ou recopiez-la
@@ -341,24 +341,24 @@  discard block
 block discarded – undo
341 341
 
342 342
 // Liste des statuts.
343 343
 $liste_des_statuts = array(
344
-	"info_administrateurs" => '0minirezo',
345
-	"info_redacteurs" => '1comite',
346
-	"info_visiteurs" => '6forum',
347
-	"texte_statut_poubelle" => '5poubelle'
344
+    "info_administrateurs" => '0minirezo',
345
+    "info_redacteurs" => '1comite',
346
+    "info_visiteurs" => '6forum',
347
+    "texte_statut_poubelle" => '5poubelle'
348 348
 );
349 349
 
350 350
 $liste_des_etats = array(
351
-	'texte_statut_en_cours_redaction' => 'prepa',
352
-	'texte_statut_propose_evaluation' => 'prop',
353
-	'texte_statut_publie' => 'publie',
354
-	'texte_statut_poubelle' => 'poubelle',
355
-	'texte_statut_refuse' => 'refuse'
351
+    'texte_statut_en_cours_redaction' => 'prepa',
352
+    'texte_statut_propose_evaluation' => 'prop',
353
+    'texte_statut_publie' => 'publie',
354
+    'texte_statut_poubelle' => 'poubelle',
355
+    'texte_statut_refuse' => 'refuse'
356 356
 );
357 357
 
358 358
 // liste des methodes d'authentifications
359 359
 $liste_des_authentifications = array(
360
-	'spip' => 'spip',
361
-	'ldap' => 'ldap'
360
+    'spip' => 'spip',
361
+    'ldap' => 'ldap'
362 362
 );
363 363
 
364 364
 // Experimental : pour supprimer systematiquement l'affichage des numeros
@@ -405,12 +405,12 @@  discard block
 block discarded – undo
405 405
 // Definition personnelles eventuelles
406 406
 
407 407
 if (_FILE_OPTIONS) {
408
-	include_once _FILE_OPTIONS;
408
+    include_once _FILE_OPTIONS;
409 409
 }
410 410
 
411 411
 if (!defined('SPIP_ERREUR_REPORT')) {
412
-	/** Masquer les warning */
413
-	define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED);
412
+    /** Masquer les warning */
413
+    define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED);
414 414
 }
415 415
 error_reporting(SPIP_ERREUR_REPORT);
416 416
 
@@ -423,10 +423,10 @@  discard block
 block discarded – undo
423 423
 // ===> on execute en neutralisant les messages d'erreur
424 424
 
425 425
 spip_initialisation_core(
426
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
427
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
428
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
429
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
426
+    (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
427
+    (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
428
+    (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
429
+    (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
430 430
 );
431 431
 
432 432
 
@@ -436,66 +436,66 @@  discard block
 block discarded – undo
436 436
 // donc il faut avoir tout fini ici avant de charger les plugins
437 437
 
438 438
 if (@is_readable(_CACHE_PLUGINS_OPT) and @is_readable(_CACHE_PLUGINS_PATH)) {
439
-	// chargement optimise precompile
440
-	include_once(_CACHE_PLUGINS_OPT);
439
+    // chargement optimise precompile
440
+    include_once(_CACHE_PLUGINS_OPT);
441 441
 } else {
442
-	spip_initialisation_suite();
443
-	include_spip('inc/plugin');
444
-	// generer les fichiers php precompiles
445
-	// de chargement des plugins et des pipelines
446
-	actualise_plugins_actifs();
442
+    spip_initialisation_suite();
443
+    include_spip('inc/plugin');
444
+    // generer les fichiers php precompiles
445
+    // de chargement des plugins et des pipelines
446
+    actualise_plugins_actifs();
447 447
 }
448 448
 
449 449
 // Initialisations non critiques surchargeables par les plugins
450 450
 spip_initialisation_suite();
451 451
 
452 452
 if (!defined('_LOG_FILTRE_GRAVITE')) {
453
-	/** niveau maxi d'enregistrement des logs */
454
-	define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE);
453
+    /** niveau maxi d'enregistrement des logs */
454
+    define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE);
455 455
 }
456 456
 
457 457
 if (!defined('_OUTILS_DEVELOPPEURS')) {
458
-	/** Activer des outils pour développeurs ? */
459
-	define('_OUTILS_DEVELOPPEURS', false);
458
+    /** Activer des outils pour développeurs ? */
459
+    define('_OUTILS_DEVELOPPEURS', false);
460 460
 }
461 461
 
462 462
 // charger systematiquement inc/autoriser dans l'espace restreint
463 463
 if (test_espace_prive()) {
464
-	include_spip('inc/autoriser');
464
+    include_spip('inc/autoriser');
465 465
 }
466 466
 //
467 467
 // Installer Spip si pas installe... sauf si justement on est en train
468 468
 //
469 469
 if (!(_FILE_CONNECT
470
-	or autoriser_sans_cookie(_request('exec'))
471
-	or _request('action') == 'cookie'
472
-	or _request('action') == 'converser'
473
-	or _request('action') == 'test_dirs')
470
+    or autoriser_sans_cookie(_request('exec'))
471
+    or _request('action') == 'cookie'
472
+    or _request('action') == 'converser'
473
+    or _request('action') == 'test_dirs')
474 474
 ) {
475 475
 
476
-	// Si on peut installer, on lance illico
477
-	if (test_espace_prive()) {
478
-		include_spip('inc/headers');
479
-		redirige_url_ecrire("install");
480
-	} else {
481
-		// Si on est dans le site public, dire que qq s'en occupe
482
-		include_spip('inc/minipres');
483
-		utiliser_langue_visiteur();
484
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>");
485
-		exit;
486
-	}
487
-	// autrement c'est une install ad hoc (spikini...), on sait pas faire
476
+    // Si on peut installer, on lance illico
477
+    if (test_espace_prive()) {
478
+        include_spip('inc/headers');
479
+        redirige_url_ecrire("install");
480
+    } else {
481
+        // Si on est dans le site public, dire que qq s'en occupe
482
+        include_spip('inc/minipres');
483
+        utiliser_langue_visiteur();
484
+        echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>");
485
+        exit;
486
+    }
487
+    // autrement c'est une install ad hoc (spikini...), on sait pas faire
488 488
 }
489 489
 
490 490
 // memoriser un tri sessionne eventuel
491 491
 if (isset($_REQUEST['var_memotri'])
492
-	and $t = $_REQUEST['var_memotri']
493
-	and (strncmp($t, 'trisession', 10) == 0 or strncmp($t, 'senssession', 11) == 0)
492
+    and $t = $_REQUEST['var_memotri']
493
+    and (strncmp($t, 'trisession', 10) == 0 or strncmp($t, 'senssession', 11) == 0)
494 494
 ) {
495
-	if (!function_exists('session_set')) {
496
-		include_spip('inc/session');
497
-	}
498
-	session_set($t, _request($t));
495
+    if (!function_exists('session_set')) {
496
+        include_spip('inc/session');
497
+    }
498
+    session_set($t, _request($t));
499 499
 }
500 500
 
501 501
 /**
@@ -505,16 +505,16 @@  discard block
 block discarded – undo
505 505
  * La globale $spip_header_silencieux permet de rendre le header minimal pour raisons de securite
506 506
  */
507 507
 if (!defined('_HEADER_COMPOSED_BY')) {
508
-	define('_HEADER_COMPOSED_BY', "Composed-By: SPIP");
508
+    define('_HEADER_COMPOSED_BY', "Composed-By: SPIP");
509 509
 }
510 510
 if (!headers_sent()) {
511
-	header("Vary: Cookie, Accept-Encoding");
512
-	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
513
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net" . (isset($GLOBALS['meta']['plugin_header']) ? (" + " . $GLOBALS['meta']['plugin_header']) : ""));
514
-	} else // header minimal
515
-	{
516
-		header(_HEADER_COMPOSED_BY . " @ www.spip.net");
517
-	}
511
+    header("Vary: Cookie, Accept-Encoding");
512
+    if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
513
+        header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net" . (isset($GLOBALS['meta']['plugin_header']) ? (" + " . $GLOBALS['meta']['plugin_header']) : ""));
514
+    } else // header minimal
515
+    {
516
+        header(_HEADER_COMPOSED_BY . " @ www.spip.net");
517
+    }
518 518
 }
519 519
 
520 520
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
Please login to merge, or discard this patch.