Completed
Push — master ( 3ef87c...f501cc )
by cam
07:25
created
ecrire/inc_version.php 2 patches
Indentation   +198 added lines, -198 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
 // *** Parametrage par defaut de SPIP ***
@@ -157,62 +157,62 @@  discard block
 block discarded – undo
157 157
 // Ne pas les rendre indefinies.
158 158
 
159 159
 global
160
-	$nombre_de_logs,
161
-	$taille_des_logs,
162
-	$table_prefix,
163
-	$cookie_prefix,
164
-	$dossier_squelettes,
165
-	$filtrer_javascript,
166
-	$type_urls,
167
-	$debut_date_publication,
168
-	$ip,
169
-	$mysql_rappel_connexion,
170
-	$mysql_rappel_nom_base,
171
-	$test_i18n,
172
-	$ignore_auth_http,
173
-	$ignore_remote_user,
174
-	$derniere_modif_invalide,
175
-	$quota_cache,
176
-	$home_server,
177
-	$help_server,
178
-	$url_glossaire_externe,
179
-	$tex_server,
180
-	$traiter_math,
181
-	$xhtml,
182
-	$xml_indent,
183
-	$source_vignettes,
184
-	$formats_logos,
185
-	$controler_dates_rss,
186
-	$spip_pipeline,
187
-	$spip_matrice,
188
-	$plugins,
189
-	$surcharges,
190
-	$exceptions_des_tables,
191
-	$tables_principales,
192
-	$table_des_tables,
193
-	$tables_auxiliaires,
194
-	$table_primary,
195
-	$table_date,
196
-	$table_titre,
197
-	$tables_jointures,
198
-	$liste_des_statuts,
199
-	$liste_des_etats,
200
-	$liste_des_authentifications,
201
-	$spip_version_branche,
202
-	$spip_version_code,
203
-	$spip_version_base,
204
-	$spip_sql_version,
205
-	$spip_version_affichee,
206
-	$visiteur_session,
207
-	$auteur_session,
208
-	$connect_statut,
209
-	$connect_toutes_rubriques,
210
-	$hash_recherche,
211
-	$hash_recherche_strict,
212
-	$ldap_present,
213
-	$meta,
214
-	$connect_id_rubrique,
215
-	$puce;
160
+    $nombre_de_logs,
161
+    $taille_des_logs,
162
+    $table_prefix,
163
+    $cookie_prefix,
164
+    $dossier_squelettes,
165
+    $filtrer_javascript,
166
+    $type_urls,
167
+    $debut_date_publication,
168
+    $ip,
169
+    $mysql_rappel_connexion,
170
+    $mysql_rappel_nom_base,
171
+    $test_i18n,
172
+    $ignore_auth_http,
173
+    $ignore_remote_user,
174
+    $derniere_modif_invalide,
175
+    $quota_cache,
176
+    $home_server,
177
+    $help_server,
178
+    $url_glossaire_externe,
179
+    $tex_server,
180
+    $traiter_math,
181
+    $xhtml,
182
+    $xml_indent,
183
+    $source_vignettes,
184
+    $formats_logos,
185
+    $controler_dates_rss,
186
+    $spip_pipeline,
187
+    $spip_matrice,
188
+    $plugins,
189
+    $surcharges,
190
+    $exceptions_des_tables,
191
+    $tables_principales,
192
+    $table_des_tables,
193
+    $tables_auxiliaires,
194
+    $table_primary,
195
+    $table_date,
196
+    $table_titre,
197
+    $tables_jointures,
198
+    $liste_des_statuts,
199
+    $liste_des_etats,
200
+    $liste_des_authentifications,
201
+    $spip_version_branche,
202
+    $spip_version_code,
203
+    $spip_version_base,
204
+    $spip_sql_version,
205
+    $spip_version_affichee,
206
+    $visiteur_session,
207
+    $auteur_session,
208
+    $connect_statut,
209
+    $connect_toutes_rubriques,
210
+    $hash_recherche,
211
+    $hash_recherche_strict,
212
+    $ldap_present,
213
+    $meta,
214
+    $connect_id_rubrique,
215
+    $puce;
216 216
 
217 217
 # comment on logge, defaut 4 tmp/spip.log de 100k, 0 ou 0 suppriment le log
218 218
 $nombre_de_logs = 4;
@@ -267,48 +267,48 @@  discard block
 block discarded – undo
267 267
 // Prendre en compte les entetes HTTP_X_FORWARDED_XX
268 268
 //
269 269
 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
270
-	if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
271
-		$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
272
-	}
273
-	if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
274
-		$_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
275
-	}
270
+    if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
271
+        $_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
272
+    }
273
+    if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
274
+        $_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
275
+    }
276 276
 }
277 277
 if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])){
278
-	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
279
-		$_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
280
-		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
281
-			$_SERVER['HTTPS'] = 'on';
282
-			if (isset($_SERVER['REQUEST_SCHEME'])) {
283
-				$_SERVER['REQUEST_SCHEME'] = 'https';
284
-			}
285
-		}
286
-	}
287
-	$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
288
-	if (strpos($host,',')!==false){
289
-		$h = explode(',',$host);
290
-		$host = trim(reset($h));
291
-	}
292
-	// securite sur le contenu de l'entete
293
-	$host = strtr($host, "<>?\"\{\}\$'` \r\n", '____________');
294
-	$_SERVER['HTTP_HOST'] = $host;
278
+    if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
279
+        $_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
280
+        if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
281
+            $_SERVER['HTTPS'] = 'on';
282
+            if (isset($_SERVER['REQUEST_SCHEME'])) {
283
+                $_SERVER['REQUEST_SCHEME'] = 'https';
284
+            }
285
+        }
286
+    }
287
+    $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
288
+    if (strpos($host,',')!==false){
289
+        $h = explode(',',$host);
290
+        $host = trim(reset($h));
291
+    }
292
+    // securite sur le contenu de l'entete
293
+    $host = strtr($host, "<>?\"\{\}\$'` \r\n", '____________');
294
+    $_SERVER['HTTP_HOST'] = $host;
295 295
 }
296 296
 //
297 297
 // On note le numero IP du client dans la variable $ip
298 298
 //
299 299
 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
300
-	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
301
-	if (strpos($ip,',')!==false){
302
-		$ip = explode(',',$ip);
303
-		$ip = reset($ip);
304
-	}
305
-	// ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
306
-	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
307
-		$_SERVER['REMOTE_ADDR'] = $ip;
308
-	}
300
+    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
301
+    if (strpos($ip,',')!==false){
302
+        $ip = explode(',',$ip);
303
+        $ip = reset($ip);
304
+    }
305
+    // ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
306
+    if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
307
+        $_SERVER['REMOTE_ADDR'] = $ip;
308
+    }
309 309
 }
310 310
 if (isset($_SERVER['REMOTE_ADDR'])) {
311
-	$ip = $_SERVER['REMOTE_ADDR'];
311
+    $ip = $_SERVER['REMOTE_ADDR'];
312 312
 }
313 313
 
314 314
 // Pour renforcer la privacy, decommentez la ligne ci-dessous (ou recopiez-la
@@ -393,24 +393,24 @@  discard block
 block discarded – undo
393 393
 
394 394
 // Liste des statuts.
395 395
 $liste_des_statuts = array(
396
-	"info_administrateurs" => '0minirezo',
397
-	"info_redacteurs" => '1comite',
398
-	"info_visiteurs" => '6forum',
399
-	"texte_statut_poubelle" => '5poubelle'
396
+    "info_administrateurs" => '0minirezo',
397
+    "info_redacteurs" => '1comite',
398
+    "info_visiteurs" => '6forum',
399
+    "texte_statut_poubelle" => '5poubelle'
400 400
 );
401 401
 
402 402
 $liste_des_etats = array(
403
-	'texte_statut_en_cours_redaction' => 'prepa',
404
-	'texte_statut_propose_evaluation' => 'prop',
405
-	'texte_statut_publie' => 'publie',
406
-	'texte_statut_poubelle' => 'poubelle',
407
-	'texte_statut_refuse' => 'refuse'
403
+    'texte_statut_en_cours_redaction' => 'prepa',
404
+    'texte_statut_propose_evaluation' => 'prop',
405
+    'texte_statut_publie' => 'publie',
406
+    'texte_statut_poubelle' => 'poubelle',
407
+    'texte_statut_refuse' => 'refuse'
408 408
 );
409 409
 
410 410
 // liste des methodes d'authentifications
411 411
 $liste_des_authentifications = array(
412
-	'spip' => 'spip',
413
-	'ldap' => 'ldap'
412
+    'spip' => 'spip',
413
+    'ldap' => 'ldap'
414 414
 );
415 415
 
416 416
 // Experimental : pour supprimer systematiquement l'affichage des numeros
@@ -457,12 +457,12 @@  discard block
 block discarded – undo
457 457
 // Definition personnelles eventuelles
458 458
 
459 459
 if (_FILE_OPTIONS) {
460
-	include_once _FILE_OPTIONS;
460
+    include_once _FILE_OPTIONS;
461 461
 }
462 462
 
463 463
 if (!defined('SPIP_ERREUR_REPORT')) {
464
-	/** Masquer les warning */
465
-	define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED);
464
+    /** Masquer les warning */
465
+    define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED);
466 466
 }
467 467
 error_reporting(SPIP_ERREUR_REPORT);
468 468
 
@@ -475,10 +475,10 @@  discard block
 block discarded – undo
475 475
 // ===> on execute en neutralisant les messages d'erreur
476 476
 
477 477
 spip_initialisation_core(
478
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
479
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
480
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
481
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
478
+    (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
479
+    (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
480
+    (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
481
+    (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
482 482
 );
483 483
 
484 484
 
@@ -488,69 +488,69 @@  discard block
 block discarded – undo
488 488
 // donc il faut avoir tout fini ici avant de charger les plugins
489 489
 
490 490
 if (@is_readable(_CACHE_PLUGINS_OPT) and @is_readable(_CACHE_PLUGINS_PATH)) {
491
-	// chargement optimise precompile
492
-	include_once(_CACHE_PLUGINS_OPT);
491
+    // chargement optimise precompile
492
+    include_once(_CACHE_PLUGINS_OPT);
493 493
 } else {
494
-	spip_initialisation_suite();
495
-	include_spip('inc/plugin');
496
-	// generer les fichiers php precompiles
497
-	// de chargement des plugins et des pipelines
498
-	actualise_plugins_actifs();
494
+    spip_initialisation_suite();
495
+    include_spip('inc/plugin');
496
+    // generer les fichiers php precompiles
497
+    // de chargement des plugins et des pipelines
498
+    actualise_plugins_actifs();
499 499
 }
500 500
 
501 501
 // Initialisations non critiques surchargeables par les plugins
502 502
 spip_initialisation_suite();
503 503
 
504 504
 if (!defined('_LOG_FILTRE_GRAVITE')) {
505
-	/** niveau maxi d'enregistrement des logs */
506
-	define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE);
505
+    /** niveau maxi d'enregistrement des logs */
506
+    define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE);
507 507
 }
508 508
 
509 509
 if (!defined('_OUTILS_DEVELOPPEURS')) {
510
-	/** Activer des outils pour développeurs ? */
511
-	define('_OUTILS_DEVELOPPEURS', false);
510
+    /** Activer des outils pour développeurs ? */
511
+    define('_OUTILS_DEVELOPPEURS', false);
512 512
 }
513 513
 
514 514
 // charger systematiquement inc/autoriser dans l'espace restreint
515 515
 if (test_espace_prive()) {
516
-	include_spip('inc/autoriser');
516
+    include_spip('inc/autoriser');
517 517
 }
518 518
 //
519 519
 // Installer Spip si pas installe... sauf si justement on est en train
520 520
 //
521 521
 if (!(_FILE_CONNECT
522
-	or autoriser_sans_cookie(_request('exec'))
523
-	or _request('action') == 'cookie'
524
-	or _request('action') == 'converser'
525
-	or _request('action') == 'test_dirs')
522
+    or autoriser_sans_cookie(_request('exec'))
523
+    or _request('action') == 'cookie'
524
+    or _request('action') == 'converser'
525
+    or _request('action') == 'test_dirs')
526 526
 ) {
527 527
 
528
-	// Si on peut installer, on lance illico
529
-	if (test_espace_prive()) {
530
-		include_spip('inc/headers');
531
-		redirige_url_ecrire("install");
532
-	} else {
533
-		// Si on est dans le site public, dire que qq s'en occupe
534
-		include_spip('inc/minipres');
535
-		utiliser_langue_visiteur();
536
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>");
537
-		exit;
538
-	}
539
-	// autrement c'est une install ad hoc (spikini...), on sait pas faire
528
+    // Si on peut installer, on lance illico
529
+    if (test_espace_prive()) {
530
+        include_spip('inc/headers');
531
+        redirige_url_ecrire("install");
532
+    } else {
533
+        // Si on est dans le site public, dire que qq s'en occupe
534
+        include_spip('inc/minipres');
535
+        utiliser_langue_visiteur();
536
+        echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>");
537
+        exit;
538
+    }
539
+    // autrement c'est une install ad hoc (spikini...), on sait pas faire
540 540
 }
541 541
 
542 542
 // memoriser un tri sessionne eventuel
543 543
 if (isset($_REQUEST['var_memotri'])
544
-	and $t = $_REQUEST['var_memotri']
545
-	and (strncmp($t, 'trisession', 10) == 0 or strncmp($t, 'senssession', 11) == 0)
544
+    and $t = $_REQUEST['var_memotri']
545
+    and (strncmp($t, 'trisession', 10) == 0 or strncmp($t, 'senssession', 11) == 0)
546 546
 ) {
547
-	if (!function_exists('session_set')) {
548
-		include_spip('inc/session');
549
-	}
550
-	$t = preg_replace(",\W,","_", $t);
551
-	if ($v = _request($t)) {
552
-		session_set($t, $v);
553
-	}
547
+    if (!function_exists('session_set')) {
548
+        include_spip('inc/session');
549
+    }
550
+    $t = preg_replace(",\W,","_", $t);
551
+    if ($v = _request($t)) {
552
+        session_set($t, $v);
553
+    }
554 554
 }
555 555
 
556 556
 /**
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
  * La globale $spip_header_silencieux permet de rendre le header minimal pour raisons de securite
561 561
  */
562 562
 if (!defined('_HEADER_COMPOSED_BY')) {
563
-	define('_HEADER_COMPOSED_BY', "Composed-By: SPIP");
563
+    define('_HEADER_COMPOSED_BY', "Composed-By: SPIP");
564 564
 }
565 565
 if (!headers_sent() and _HEADER_COMPOSED_BY) {
566
-	if (!defined('_HEADER_VARY')) {
567
-		define('_HEADER_VARY', "Vary: Cookie, Accept-Encoding");
568
-	}
569
-	if (_HEADER_VARY) {
570
-		header(_HEADER_VARY);
571
-	}
572
-	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
573
-		include_spip('inc/filtres_mini');
574
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . "config.txt"));
575
-	} else {
576
-		// header minimal
577
-		header(_HEADER_COMPOSED_BY . " @ www.spip.net");
578
-	}
566
+    if (!defined('_HEADER_VARY')) {
567
+        define('_HEADER_VARY', "Vary: Cookie, Accept-Encoding");
568
+    }
569
+    if (_HEADER_VARY) {
570
+        header(_HEADER_VARY);
571
+    }
572
+    if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
573
+        include_spip('inc/filtres_mini');
574
+        header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . "config.txt"));
575
+    } else {
576
+        // header minimal
577
+        header(_HEADER_COMPOSED_BY . " @ www.spip.net");
578
+    }
579 579
 }
580 580
 
581 581
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
50 50
 
51 51
 /** chemin absolu vers la racine */
52
-define('_ROOT_RACINE', dirname(dirname(__FILE__)) . '/');
52
+define('_ROOT_RACINE', dirname(dirname(__FILE__)).'/');
53 53
 /** chemin absolu vers le repertoire de travail */
54
-define('_ROOT_CWD', getcwd() . '/');
54
+define('_ROOT_CWD', getcwd().'/');
55 55
 /** chemin absolu vers ecrire */
56
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
56
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
57 57
 
58 58
 // Icones
59 59
 if (!defined('_NOM_IMG_PACK')) {
@@ -61,17 +61,17 @@  discard block
 block discarded – undo
61 61
 	define('_NOM_IMG_PACK', 'images/');
62 62
 }
63 63
 /** le chemin http (relatif) vers les images standard */
64
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
64
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
65 65
 
66 66
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
67
-define('_ROOT_IMG_PACK', dirname(dirname(__FILE__)) . '/prive/' . _NOM_IMG_PACK);
67
+define('_ROOT_IMG_PACK', dirname(dirname(__FILE__)).'/prive/'._NOM_IMG_PACK);
68 68
 
69 69
 if (!defined('_JAVASCRIPT')) {
70 70
 	/** Nom du repertoire des  bibliotheques JavaScript */
71 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
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
74
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
75 75
 
76 76
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
77 77
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // Son emplacement absolu si on le trouve
104
-if (@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
105
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
104
+if (@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
105
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
106 106
 ) {
107 107
 	/** Emplacement absolu du fichier d'option */
108 108
 	define('_FILE_OPTIONS', $f);
@@ -125,7 +125,7 @@  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 130
 	include $f;
131 131
 }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			. 'MSIE 6\.0|'
145 145
 			// UA plus cibles
146 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'])
147
+			. ',i', (string) $_SERVER['HTTP_USER_AGENT'])
148 148
 	);
149 149
 }
150 150
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 //
267 267
 // Prendre en compte les entetes HTTP_X_FORWARDED_XX
268 268
 //
269
-if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
269
+if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
270 270
 	if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
271 271
 		$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
272 272
 	}
@@ -274,10 +274,10 @@  discard block
 block discarded – undo
274 274
 		$_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
275 275
 	}
276 276
 }
277
-if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])){
278
-	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
277
+if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
278
+	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])) {
279 279
 		$_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
280
-		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
280
+		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
281 281
 			$_SERVER['HTTPS'] = 'on';
282 282
 			if (isset($_SERVER['REQUEST_SCHEME'])) {
283 283
 				$_SERVER['REQUEST_SCHEME'] = 'https';
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
 		}
286 286
 	}
287 287
 	$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
288
-	if (strpos($host,',')!==false){
289
-		$h = explode(',',$host);
288
+	if (strpos($host, ',') !== false) {
289
+		$h = explode(',', $host);
290 290
 		$host = trim(reset($h));
291 291
 	}
292 292
 	// securite sur le contenu de l'entete
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 //
299 299
 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
300 300
 	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
301
-	if (strpos($ip,',')!==false){
302
-		$ip = explode(',',$ip);
301
+	if (strpos($ip, ',') !== false) {
302
+		$ip = explode(',', $ip);
303 303
 		$ip = reset($ip);
304 304
 	}
305 305
 	// ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
306
-	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
306
+	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] === '127.0.0.1') {
307 307
 		$_SERVER['REMOTE_ADDR'] = $ip;
308 308
 	}
309 309
 }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 # la matrice standard (fichiers definissant les fonctions a inclure)
377 377
 $spip_matrice = array();
378 378
 # les plugins a activer
379
-$plugins = array();  // voir le contenu du repertoire /plugins/
379
+$plugins = array(); // voir le contenu du repertoire /plugins/
380 380
 # les surcharges de include_spip()
381 381
 $surcharges = array(); // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
382 382
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 $spip_version_branche = "3.3.0-dev";
428 428
 // cette version dev accepte tous les plugins compatible avec la version ci-dessous
429 429
 // a supprimer en phase beta/rc/release
430
-define('_DEV_VERSION_SPIP_COMPAT',"3.2.99");
430
+define('_DEV_VERSION_SPIP_COMPAT', "3.2.99");
431 431
 // version des signatures de fonctions PHP
432 432
 // (= numero SVN de leur derniere modif cassant la compatibilite et/ou necessitant un recalcul des squelettes)
433 433
 $spip_version_code = 22653;
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
 //
452 452
 // Charger les fonctions liees aux serveurs Http et Sql.
453 453
 //
454
-require_once _ROOT_RESTREINT . 'inc/utils.php';
455
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
454
+require_once _ROOT_RESTREINT.'inc/utils.php';
455
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
456 456
 
457 457
 // Definition personnelles eventuelles
458 458
 
@@ -475,10 +475,10 @@  discard block
 block discarded – undo
475 475
 // ===> on execute en neutralisant les messages d'erreur
476 476
 
477 477
 spip_initialisation_core(
478
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
479
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
480
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
481
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
478
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
479
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
480
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
481
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
482 482
 );
483 483
 
484 484
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 		// Si on est dans le site public, dire que qq s'en occupe
534 534
 		include_spip('inc/minipres');
535 535
 		utiliser_langue_visiteur();
536
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>");
536
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte')."</p>");
537 537
 		exit;
538 538
 	}
539 539
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 	if (!function_exists('session_set')) {
548 548
 		include_spip('inc/session');
549 549
 	}
550
-	$t = preg_replace(",\W,","_", $t);
550
+	$t = preg_replace(",\W,", "_", $t);
551 551
 	if ($v = _request($t)) {
552 552
 		session_set($t, $v);
553 553
 	}
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 	}
572 572
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
573 573
 		include_spip('inc/filtres_mini');
574
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . "config.txt"));
574
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR."config.txt"));
575 575
 	} else {
576 576
 		// header minimal
577
-		header(_HEADER_COMPOSED_BY . " @ www.spip.net");
577
+		header(_HEADER_COMPOSED_BY." @ www.spip.net");
578 578
 	}
579 579
 }
580 580
 
581 581
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
582
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
582
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.