Completed
Push — master ( 410b54...85a1b0 )
by cam
01:12
created
ecrire/install/etape_.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 /**
@@ -27,18 +27,18 @@  discard block
 block discarded – undo
27 27
  * @uses info_copyright()
28 28
  **/
29 29
 function install_etape__dist() {
30
-	utiliser_langue_visiteur();
31
-	$menu_langues = menu_langues('var_lang_ecrire');
32
-	if (!$menu_langues) {
33
-		redirige_url_ecrire('install', 'etape=chmod');
34
-	} else {
35
-		include_spip('inc/presentation'); // pour info_copyright
30
+    utiliser_langue_visiteur();
31
+    $menu_langues = menu_langues('var_lang_ecrire');
32
+    if (!$menu_langues) {
33
+        redirige_url_ecrire('install', 'etape=chmod');
34
+    } else {
35
+        include_spip('inc/presentation'); // pour info_copyright
36 36
 
37
-		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
38
-			"<p class='small'>" . info_copyright() . "</p></div>\n" .
39
-			'<p>' . _T('install_select_langue') . '</p>' .
40
-			'<div>' . $menu_langues . "</div>\n" .
41
-			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
42
-		echo minipres('AUTO', $res);
43
-	}
37
+        $res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
38
+            "<p class='small'>" . info_copyright() . "</p></div>\n" .
39
+            '<p>' . _T('install_select_langue') . '</p>' .
40
+            '<div>' . $menu_langues . "</div>\n" .
41
+            generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
42
+        echo minipres('AUTO', $res);
43
+    }
44 44
 }
Please login to merge, or discard this patch.
ecrire/public.php 1 patch
Indentation   +185 added lines, -185 removed lines patch added patch discarded remove patch
@@ -22,192 +22,192 @@
 block discarded – undo
22 22
 
23 23
 if (isset($GLOBALS['_INC_PUBLIC']) and $GLOBALS['_INC_PUBLIC']) {
24 24
 
25
-	echo recuperer_fond($fond, $contexte_inclus, array(), _request('connect'));
25
+    echo recuperer_fond($fond, $contexte_inclus, array(), _request('connect'));
26 26
 
27 27
 } else {
28 28
 
29
-	$GLOBALS['_INC_PUBLIC'] = 1;
30
-	define('_PIPELINE_SUFFIX', test_espace_prive() ? '_prive' : '');
31
-
32
-	// Faut-il initialiser SPIP ? (oui dans le cas general)
33
-	if (!defined('_DIR_RESTREINT_ABS')) {
34
-		if (defined('_DIR_RESTREINT')
35
-			and @file_exists(_ROOT_RESTREINT . 'inc_version.php')
36
-		) {
37
-			include_once _ROOT_RESTREINT . 'inc_version.php';
38
-		} else {
39
-			die('inc_version absent ?');
40
-		}
41
-	} // $fond defini dans le fichier d'appel ?
42
-
43
-	else {
44
-		if (isset($fond) and !_request('fond')) {
45
-		} // fond demande dans l'url par page=xxxx ?
46
-		else {
47
-			if (isset($_GET[_SPIP_PAGE])) {
48
-				$fond = (string)$_GET[_SPIP_PAGE];
49
-
50
-				// Securite
51
-				if (strstr($fond, '/')
52
-					and !(
53
-						isset($GLOBALS['visiteur_session']) // pour eviter d'evaluer la suite pour les anonymes
54
-						and include_spip('inc/autoriser')
55
-						and autoriser('webmestre'))
56
-				) {
57
-					include_spip('inc/minipres');
58
-					echo minipres();
59
-					exit;
60
-				}
61
-				// l'argument Page a priorite sur l'argument action
62
-				// le cas se presente a cause des RewriteRule d'Apache
63
-				// qui permettent d'ajouter un argument dans la QueryString
64
-				// mais pas d'en retirer un en conservant les autres.
65
-				if (isset($_GET['action']) and $_GET['action'] === $fond) {
66
-					unset($_GET['action']);
67
-				}
68
-				# sinon, fond par defaut
69
-			} else {
70
-				// sinon fond par defaut (cf. assembler.php)
71
-				$fond = pipeline('detecter_fond_par_defaut', '');
72
-			}
73
-		}
74
-	}
75
-
76
-	$tableau_des_temps = array();
77
-
78
-	// Particularites de certains squelettes
79
-	if ($fond == 'login') {
80
-		$forcer_lang = true;
81
-	}
82
-
83
-	if (isset($forcer_lang) and $forcer_lang and ($forcer_lang !== 'non')
84
-		and !_request('action')
85
-		and $_SERVER['REQUEST_METHOD'] != 'POST'
86
-	) {
87
-		include_spip('inc/lang');
88
-		verifier_lang_url();
89
-	}
90
-
91
-	$lang = !isset($_GET['lang']) ? '' : lang_select($_GET['lang']);
92
-
93
-	// Charger l'aiguilleur des traitements derogatoires
94
-	// (action en base SQL, formulaires CVT, AJax)
95
-	if (_request('action') or _request('var_ajax') or _request('formulaire_action')) {
96
-		include_spip('public/aiguiller');
97
-		if (
98
-			// cas des appels actions ?action=xxx
99
-			traiter_appels_actions()
100
-			or
101
-			// cas des hits ajax sur les inclusions ajax
102
-			traiter_appels_inclusions_ajax()
103
-			or
104
-			// cas des formulaires charger/verifier/traiter
105
-			traiter_formulaires_dynamiques()
106
-		) {
107
-			// lancer les taches sur affichage final, comme le cron
108
-			// mais sans rien afficher
109
-			$GLOBALS['html'] = false; // ne rien afficher
110
-			pipeline('affichage_final' . _PIPELINE_SUFFIX, '');
111
-			exit; // le hit est fini !
112
-		}
113
-	}
114
-
115
-	// Il y a du texte a produire, charger le metteur en page
116
-	include_spip('public/assembler');
117
-	$page = assembler($fond, _request('connect'));
118
-
119
-	if (isset($page['status'])) {
120
-		include_spip('inc/headers');
121
-		http_status($page['status']);
122
-	}
123
-
124
-	// Content-Type ?
125
-	if (!isset($page['entetes']['Content-Type'])) {
126
-		$charset = isset($GLOBALS['meta']['charset']) ? $GLOBALS['meta']['charset'] : "utf-8";
127
-		$page['entetes']['Content-Type'] = 'text/html; charset=' . $charset;
128
-		$html = true;
129
-	} else {
130
-		$html = preg_match(',^\s*text/html,', $page['entetes']['Content-Type']);
131
-	}
132
-
133
-	// Tester si on est admin et il y a des choses supplementaires a dire
134
-	// type tableau pour y mettre des choses au besoin.
135
-	$debug = ((_request('var_mode') == 'debug') or $tableau_des_temps) ? array(1) : array();
136
-
137
-	// affiche-t-on les boutons d'administration ? voir f_admin() 
138
-	$affiche_boutons_admin = ($html and (
139
-			(isset($_COOKIE['spip_admin']) and (!isset($flag_preserver) or !$flag_preserver))
140
-			or ($debug and include_spip('inc/autoriser') and autoriser('debug'))
141
-			or (defined('_VAR_PREVIEW') and _VAR_PREVIEW)
142
-		));
143
-
144
-	if ($affiche_boutons_admin) {
145
-		include_spip('balise/formulaire_admin');
146
-	}
147
-
148
-
149
-	// Execution de la page calculee
150
-
151
-	// traitements sur les entetes avant envoi
152
-	// peut servir pour le plugin de stats
153
-	$page['entetes'] = pipeline('affichage_entetes_final' . _PIPELINE_SUFFIX, $page['entetes']);
154
-
155
-
156
-	// eval $page et affecte $res
157
-	include _ROOT_RESTREINT . "public/evaluer_page.php";
158
-	envoyer_entetes($page['entetes']);
159
-	if ($res === false) {
160
-		include_spip('inc/autoriser');
161
-		$err = _T('zbug_erreur_execution_page');
162
-		if (autoriser('webmestre')) {
163
-			$err .= "\n<hr />\n"
164
-				. highlight_string($page['codephp'], true)
165
-				. "\n<hr />\n";
166
-		}
167
-		$msg = array($err);
168
-		erreur_squelette($msg);
169
-	}
170
-
171
-	//
172
-	// Envoyer le resultat apres post-traitements
173
-	//
174
-	// (c'est ici qu'on fait var_recherche, validation, boutons d'admin,
175
-	// cf. public/assembler.php)
176
-	echo pipeline('affichage_final' . _PIPELINE_SUFFIX, $page['texte']);
177
-
178
-	if ($lang) {
179
-		lang_select();
180
-	}
181
-	// l'affichage de la page a pu lever des erreurs (inclusion manquante)
182
-	// il faut tester a nouveau
183
-	$debug = ((_request('var_mode') == 'debug') or $tableau_des_temps) ? array(1) : array();
184
-
185
-	// Appel au debusqueur en cas d'erreurs ou de demande de trace
186
-	// at last
187
-	if ($debug) {
188
-		// en cas d'erreur, retester l'affichage
189
-		if ($html and ($affiche_boutons_admin or $debug)) {
190
-			$var_mode_affiche = _request('var_mode_affiche');
191
-			$var_mode_objet = _request('var_mode_objet');
192
-			$GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet . 'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : "");
193
-			echo erreur_squelette(false);
194
-		}
195
-	} else {
196
-
197
-		if (isset($GLOBALS['meta']['date_prochain_postdate'])
198
-			and $GLOBALS['meta']['date_prochain_postdate'] <= time()
199
-		) {
200
-			include_spip('inc/rubriques');
201
-			calculer_prochain_postdate(true);
202
-		}
203
-
204
-		// Effectuer une tache de fond ?
205
-		// si _DIRECT_CRON_FORCE est present, on force l'appel
206
-		if (defined('_DIRECT_CRON_FORCE')) {
207
-			cron();
208
-		}
209
-
210
-		// sauver le cache chemin si necessaire
211
-		save_path_cache();
212
-	}
29
+    $GLOBALS['_INC_PUBLIC'] = 1;
30
+    define('_PIPELINE_SUFFIX', test_espace_prive() ? '_prive' : '');
31
+
32
+    // Faut-il initialiser SPIP ? (oui dans le cas general)
33
+    if (!defined('_DIR_RESTREINT_ABS')) {
34
+        if (defined('_DIR_RESTREINT')
35
+            and @file_exists(_ROOT_RESTREINT . 'inc_version.php')
36
+        ) {
37
+            include_once _ROOT_RESTREINT . 'inc_version.php';
38
+        } else {
39
+            die('inc_version absent ?');
40
+        }
41
+    } // $fond defini dans le fichier d'appel ?
42
+
43
+    else {
44
+        if (isset($fond) and !_request('fond')) {
45
+        } // fond demande dans l'url par page=xxxx ?
46
+        else {
47
+            if (isset($_GET[_SPIP_PAGE])) {
48
+                $fond = (string)$_GET[_SPIP_PAGE];
49
+
50
+                // Securite
51
+                if (strstr($fond, '/')
52
+                    and !(
53
+                        isset($GLOBALS['visiteur_session']) // pour eviter d'evaluer la suite pour les anonymes
54
+                        and include_spip('inc/autoriser')
55
+                        and autoriser('webmestre'))
56
+                ) {
57
+                    include_spip('inc/minipres');
58
+                    echo minipres();
59
+                    exit;
60
+                }
61
+                // l'argument Page a priorite sur l'argument action
62
+                // le cas se presente a cause des RewriteRule d'Apache
63
+                // qui permettent d'ajouter un argument dans la QueryString
64
+                // mais pas d'en retirer un en conservant les autres.
65
+                if (isset($_GET['action']) and $_GET['action'] === $fond) {
66
+                    unset($_GET['action']);
67
+                }
68
+                # sinon, fond par defaut
69
+            } else {
70
+                // sinon fond par defaut (cf. assembler.php)
71
+                $fond = pipeline('detecter_fond_par_defaut', '');
72
+            }
73
+        }
74
+    }
75
+
76
+    $tableau_des_temps = array();
77
+
78
+    // Particularites de certains squelettes
79
+    if ($fond == 'login') {
80
+        $forcer_lang = true;
81
+    }
82
+
83
+    if (isset($forcer_lang) and $forcer_lang and ($forcer_lang !== 'non')
84
+        and !_request('action')
85
+        and $_SERVER['REQUEST_METHOD'] != 'POST'
86
+    ) {
87
+        include_spip('inc/lang');
88
+        verifier_lang_url();
89
+    }
90
+
91
+    $lang = !isset($_GET['lang']) ? '' : lang_select($_GET['lang']);
92
+
93
+    // Charger l'aiguilleur des traitements derogatoires
94
+    // (action en base SQL, formulaires CVT, AJax)
95
+    if (_request('action') or _request('var_ajax') or _request('formulaire_action')) {
96
+        include_spip('public/aiguiller');
97
+        if (
98
+            // cas des appels actions ?action=xxx
99
+            traiter_appels_actions()
100
+            or
101
+            // cas des hits ajax sur les inclusions ajax
102
+            traiter_appels_inclusions_ajax()
103
+            or
104
+            // cas des formulaires charger/verifier/traiter
105
+            traiter_formulaires_dynamiques()
106
+        ) {
107
+            // lancer les taches sur affichage final, comme le cron
108
+            // mais sans rien afficher
109
+            $GLOBALS['html'] = false; // ne rien afficher
110
+            pipeline('affichage_final' . _PIPELINE_SUFFIX, '');
111
+            exit; // le hit est fini !
112
+        }
113
+    }
114
+
115
+    // Il y a du texte a produire, charger le metteur en page
116
+    include_spip('public/assembler');
117
+    $page = assembler($fond, _request('connect'));
118
+
119
+    if (isset($page['status'])) {
120
+        include_spip('inc/headers');
121
+        http_status($page['status']);
122
+    }
123
+
124
+    // Content-Type ?
125
+    if (!isset($page['entetes']['Content-Type'])) {
126
+        $charset = isset($GLOBALS['meta']['charset']) ? $GLOBALS['meta']['charset'] : "utf-8";
127
+        $page['entetes']['Content-Type'] = 'text/html; charset=' . $charset;
128
+        $html = true;
129
+    } else {
130
+        $html = preg_match(',^\s*text/html,', $page['entetes']['Content-Type']);
131
+    }
132
+
133
+    // Tester si on est admin et il y a des choses supplementaires a dire
134
+    // type tableau pour y mettre des choses au besoin.
135
+    $debug = ((_request('var_mode') == 'debug') or $tableau_des_temps) ? array(1) : array();
136
+
137
+    // affiche-t-on les boutons d'administration ? voir f_admin() 
138
+    $affiche_boutons_admin = ($html and (
139
+            (isset($_COOKIE['spip_admin']) and (!isset($flag_preserver) or !$flag_preserver))
140
+            or ($debug and include_spip('inc/autoriser') and autoriser('debug'))
141
+            or (defined('_VAR_PREVIEW') and _VAR_PREVIEW)
142
+        ));
143
+
144
+    if ($affiche_boutons_admin) {
145
+        include_spip('balise/formulaire_admin');
146
+    }
147
+
148
+
149
+    // Execution de la page calculee
150
+
151
+    // traitements sur les entetes avant envoi
152
+    // peut servir pour le plugin de stats
153
+    $page['entetes'] = pipeline('affichage_entetes_final' . _PIPELINE_SUFFIX, $page['entetes']);
154
+
155
+
156
+    // eval $page et affecte $res
157
+    include _ROOT_RESTREINT . "public/evaluer_page.php";
158
+    envoyer_entetes($page['entetes']);
159
+    if ($res === false) {
160
+        include_spip('inc/autoriser');
161
+        $err = _T('zbug_erreur_execution_page');
162
+        if (autoriser('webmestre')) {
163
+            $err .= "\n<hr />\n"
164
+                . highlight_string($page['codephp'], true)
165
+                . "\n<hr />\n";
166
+        }
167
+        $msg = array($err);
168
+        erreur_squelette($msg);
169
+    }
170
+
171
+    //
172
+    // Envoyer le resultat apres post-traitements
173
+    //
174
+    // (c'est ici qu'on fait var_recherche, validation, boutons d'admin,
175
+    // cf. public/assembler.php)
176
+    echo pipeline('affichage_final' . _PIPELINE_SUFFIX, $page['texte']);
177
+
178
+    if ($lang) {
179
+        lang_select();
180
+    }
181
+    // l'affichage de la page a pu lever des erreurs (inclusion manquante)
182
+    // il faut tester a nouveau
183
+    $debug = ((_request('var_mode') == 'debug') or $tableau_des_temps) ? array(1) : array();
184
+
185
+    // Appel au debusqueur en cas d'erreurs ou de demande de trace
186
+    // at last
187
+    if ($debug) {
188
+        // en cas d'erreur, retester l'affichage
189
+        if ($html and ($affiche_boutons_admin or $debug)) {
190
+            $var_mode_affiche = _request('var_mode_affiche');
191
+            $var_mode_objet = _request('var_mode_objet');
192
+            $GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet . 'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : "");
193
+            echo erreur_squelette(false);
194
+        }
195
+    } else {
196
+
197
+        if (isset($GLOBALS['meta']['date_prochain_postdate'])
198
+            and $GLOBALS['meta']['date_prochain_postdate'] <= time()
199
+        ) {
200
+            include_spip('inc/rubriques');
201
+            calculer_prochain_postdate(true);
202
+        }
203
+
204
+        // Effectuer une tache de fond ?
205
+        // si _DIRECT_CRON_FORCE est present, on force l'appel
206
+        if (defined('_DIRECT_CRON_FORCE')) {
207
+            cron();
208
+        }
209
+
210
+        // sauver le cache chemin si necessaire
211
+        save_path_cache();
212
+    }
213 213
 }
Please login to merge, or discard this patch.
ecrire/genie/maintenance.php 1 patch
Indentation   +44 added lines, -44 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
 /**
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function genie_maintenance_dist($t) {
37 37
 
38
-	// (re)mettre .htaccess avec deny from all
39
-	// dans les deux repertoires dits inaccessibles par http
40
-	include_spip('inc/acces');
41
-	verifier_htaccess(_DIR_ETC);
42
-	verifier_htaccess(_DIR_TMP);
38
+    // (re)mettre .htaccess avec deny from all
39
+    // dans les deux repertoires dits inaccessibles par http
40
+    include_spip('inc/acces');
41
+    verifier_htaccess(_DIR_ETC);
42
+    verifier_htaccess(_DIR_TMP);
43 43
 
44
-	// Verifier qu'aucune table n'est crashee
45
-	if (!_request('reinstall')) {
46
-		verifier_crash_tables();
47
-	}
44
+    // Verifier qu'aucune table n'est crashee
45
+    if (!_request('reinstall')) {
46
+        verifier_crash_tables();
47
+    }
48 48
 
49
-	return 1;
49
+    return 1;
50 50
 }
51 51
 
52 52
 
@@ -63,33 +63,33 @@  discard block
 block discarded – undo
63 63
  *     des tables qui ont crashé.
64 64
  */
65 65
 function verifier_crash_tables() {
66
-	if (spip_connect()) {
67
-		include_spip('base/serial');
68
-		include_spip('base/auxiliaires');
69
-		$crash = array();
70
-		foreach (array('tables_principales', 'tables_auxiliaires') as $com) {
71
-			foreach ($GLOBALS[$com] as $table => $desc) {
72
-				if (!sql_select('*', $table, '', '', '', 1)
73
-					and !defined('spip_interdire_cache')
74
-				) # cas "LOST CONNECTION"
75
-				{
76
-					$crash[] = $table;
77
-				}
78
-			}
79
-		}
80
-		#$crash[] = 'test';
81
-		if ($crash) {
82
-			ecrire_meta('message_crash_tables', serialize($crash));
83
-			spip_log('crash des tables', 'err');
84
-			spip_log($crash, 'err');
85
-		} else {
86
-			effacer_meta('message_crash_tables');
87
-		}
66
+    if (spip_connect()) {
67
+        include_spip('base/serial');
68
+        include_spip('base/auxiliaires');
69
+        $crash = array();
70
+        foreach (array('tables_principales', 'tables_auxiliaires') as $com) {
71
+            foreach ($GLOBALS[$com] as $table => $desc) {
72
+                if (!sql_select('*', $table, '', '', '', 1)
73
+                    and !defined('spip_interdire_cache')
74
+                ) # cas "LOST CONNECTION"
75
+                {
76
+                    $crash[] = $table;
77
+                }
78
+            }
79
+        }
80
+        #$crash[] = 'test';
81
+        if ($crash) {
82
+            ecrire_meta('message_crash_tables', serialize($crash));
83
+            spip_log('crash des tables', 'err');
84
+            spip_log($crash, 'err');
85
+        } else {
86
+            effacer_meta('message_crash_tables');
87
+        }
88 88
 
89
-		return $crash;
90
-	}
89
+        return $crash;
90
+    }
91 91
 
92
-	return false;
92
+    return false;
93 93
 }
94 94
 
95 95
 /**
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
  * @return string
106 106
  */
107 107
 function message_crash_tables() {
108
-	if ($crash = verifier_crash_tables()) {
109
-		return
110
-			'<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
-			. ' <tt>' . join(', ', $crash) . '</tt><br />'
112
-			. generer_form_ecrire('base_repair',
113
-				_T('texte_crash_base'), '',
114
-				_T('bouton_tenter_recuperation'));
115
-	}
108
+    if ($crash = verifier_crash_tables()) {
109
+        return
110
+            '<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
+            . ' <tt>' . join(', ', $crash) . '</tt><br />'
112
+            . generer_form_ecrire('base_repair',
113
+                _T('texte_crash_base'), '',
114
+                _T('bouton_tenter_recuperation'));
115
+    }
116 116
 }
Please login to merge, or discard this patch.
ecrire/genie/mise_a_jour.php 1 patch
Indentation   +113 added lines, -113 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
 /**
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
  * @return int
28 28
  */
29 29
 function genie_mise_a_jour_dist($t) {
30
-	include_spip('inc/meta');
31
-	$maj = info_maj('spip', 'SPIP', $GLOBALS['spip_version_branche']);
32
-	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : "", 'non');
30
+    include_spip('inc/meta');
31
+    $maj = info_maj('spip', 'SPIP', $GLOBALS['spip_version_branche']);
32
+    ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : "", 'non');
33 33
 
34
-	mise_a_jour_ecran_securite();
34
+    mise_a_jour_ecran_securite();
35 35
 
36
-	spip_log("Verification version SPIP : " . ($maj ? $maj : "version a jour"), "verifie_maj");
36
+    spip_log("Verification version SPIP : " . ($maj ? $maj : "version a jour"), "verifie_maj");
37 37
 
38
-	return 1;
38
+    return 1;
39 39
 }
40 40
 
41 41
 // TODO : fournir une URL sur spip.net pour maitriser la diffusion d'une nouvelle version de l'ecran via l'update auto
@@ -52,45 +52,45 @@  discard block
 block discarded – undo
52 52
  * ou de ne repondre une 304 que si le md5 est bon
53 53
  */
54 54
 function mise_a_jour_ecran_securite() {
55
-	// TODO : url https avec verification du certificat
56
-	return;
57
-
58
-	// si l'ecran n'est pas deja present ou pas updatable, sortir
59
-	if (!_URL_ECRAN_SECURITE
60
-		or !file_exists($filename = _DIR_ETC . "ecran_securite.php")
61
-		or !is_writable($filename)
62
-		or !$last_modified = filemtime($filename)
63
-		or !$md5 = md5_file($filename)
64
-	) {
65
-		return false;
66
-	}
67
-
68
-	include_spip('inc/distant');
69
-	$tmp_file = _DIR_TMP . "ecran_securite.php";
70
-	$url = parametre_url(_URL_ECRAN_SECURITE, "md5", $md5);
71
-	$url = parametre_url($url, "vspip", $GLOBALS['spip_version_branche']);
72
-	$res = recuperer_url($url, array(
73
-		'if_modified_since' => $last_modified,
74
-		'file' => $tmp_file
75
-	));
76
-
77
-	// si il y a une version plus recente que l'on a recu correctement
78
-	if ($res['status'] == 200
79
-		and $res['length']
80
-		and $tmp_file = $res['file']
81
-	) {
82
-
83
-		if ($md5 !== md5_file($tmp_file)) {
84
-			// on essaye de l'inclure pour verifier que ca ne fait pas erreur fatale
85
-			include_once $tmp_file;
86
-			// ok, on le copie a la place de l'ecran existant
87
-			// en backupant l'ecran avant, au cas ou
88
-			@copy($filename, $filename . "-bck-" . date('Y-m-d-His', $last_modified));
89
-			@rename($tmp_file, $filename);
90
-		} else {
91
-			@unlink($tmp_file);
92
-		}
93
-	}
55
+    // TODO : url https avec verification du certificat
56
+    return;
57
+
58
+    // si l'ecran n'est pas deja present ou pas updatable, sortir
59
+    if (!_URL_ECRAN_SECURITE
60
+        or !file_exists($filename = _DIR_ETC . "ecran_securite.php")
61
+        or !is_writable($filename)
62
+        or !$last_modified = filemtime($filename)
63
+        or !$md5 = md5_file($filename)
64
+    ) {
65
+        return false;
66
+    }
67
+
68
+    include_spip('inc/distant');
69
+    $tmp_file = _DIR_TMP . "ecran_securite.php";
70
+    $url = parametre_url(_URL_ECRAN_SECURITE, "md5", $md5);
71
+    $url = parametre_url($url, "vspip", $GLOBALS['spip_version_branche']);
72
+    $res = recuperer_url($url, array(
73
+        'if_modified_since' => $last_modified,
74
+        'file' => $tmp_file
75
+    ));
76
+
77
+    // si il y a une version plus recente que l'on a recu correctement
78
+    if ($res['status'] == 200
79
+        and $res['length']
80
+        and $tmp_file = $res['file']
81
+    ) {
82
+
83
+        if ($md5 !== md5_file($tmp_file)) {
84
+            // on essaye de l'inclure pour verifier que ca ne fait pas erreur fatale
85
+            include_once $tmp_file;
86
+            // ok, on le copie a la place de l'ecran existant
87
+            // en backupant l'ecran avant, au cas ou
88
+            @copy($filename, $filename . "-bck-" . date('Y-m-d-His', $last_modified));
89
+            @rename($tmp_file, $filename);
90
+        } else {
91
+            @unlink($tmp_file);
92
+        }
93
+    }
94 94
 }
95 95
 
96 96
 /**
@@ -108,52 +108,52 @@  discard block
 block discarded – undo
108 108
  * @return string
109 109
  */
110 110
 function info_maj($dir, $file, $version) {
111
-	include_spip('inc/plugin');
112
-
113
-	list($maj, $min, $rev) = preg_split('/\D+/', $version);
114
-
115
-	$nom = _DIR_CACHE_XML . _VERSIONS_LISTE;
116
-	$page = !file_exists($nom) ? '' : file_get_contents($nom);
117
-	$page = info_maj_cache($nom, $dir, $page);
118
-
119
-	// reperer toutes les versions de numero majeur superieur ou egal
120
-	// (a revoir quand on arrivera a SPIP V10 ...)
121
-	$p = substr("0123456789", intval($maj));
122
-	$p = ',/' . $file . '\D+([' . $p . ']+)\D+(\d+)(\D+(\d+))?.*?[.]zip",i';
123
-	preg_match_all($p, $page, $m, PREG_SET_ORDER);
124
-	$page = $page_majeure = '';
125
-
126
-	// branche en cours d'utilisation
127
-	$branche = implode('.', array_slice(explode('.', $version, 3), 0, 2));
128
-
129
-	foreach ($m as $v) {
130
-		$v = array_pad($v, 5, 0);
131
-		list(, $maj2, $min2, , $rev2) = $v;
132
-		$branche_maj = $maj2 . '.' . $min2;
133
-		$version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
134
-		// d'abord les mises à jour de la même branche
135
-		if ((spip_version_compare($version, $version_maj, '<'))
136
-			and (spip_version_compare($page, $version_maj, '<'))
137
-			and spip_version_compare($branche, $branche_maj, '=')
138
-		) {
139
-			$page = $version_maj;
140
-		}
141
-		// puis les mises à jours majeures
142
-		if ((spip_version_compare($version, $version_maj, '<'))
143
-			and (spip_version_compare($page, $version_maj, '<'))
144
-			and spip_version_compare($branche, $branche_maj, '<')
145
-		) {
146
-			$page_majeure = $version_maj;
147
-		}
148
-	}
149
-	if (!$page and !$page_majeure) {
150
-		return "";
151
-	}
152
-
153
-	$message = $page ? _T('nouvelle_version_spip', array('version' => $page)) . ($page_majeure ? ' | ' : '') : '';
154
-	$message .= $page_majeure ? _T('nouvelle_version_spip_majeure', array('version' => $page_majeure)) : '';
155
-
156
-	return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$page'>" . $message . '</a>';
111
+    include_spip('inc/plugin');
112
+
113
+    list($maj, $min, $rev) = preg_split('/\D+/', $version);
114
+
115
+    $nom = _DIR_CACHE_XML . _VERSIONS_LISTE;
116
+    $page = !file_exists($nom) ? '' : file_get_contents($nom);
117
+    $page = info_maj_cache($nom, $dir, $page);
118
+
119
+    // reperer toutes les versions de numero majeur superieur ou egal
120
+    // (a revoir quand on arrivera a SPIP V10 ...)
121
+    $p = substr("0123456789", intval($maj));
122
+    $p = ',/' . $file . '\D+([' . $p . ']+)\D+(\d+)(\D+(\d+))?.*?[.]zip",i';
123
+    preg_match_all($p, $page, $m, PREG_SET_ORDER);
124
+    $page = $page_majeure = '';
125
+
126
+    // branche en cours d'utilisation
127
+    $branche = implode('.', array_slice(explode('.', $version, 3), 0, 2));
128
+
129
+    foreach ($m as $v) {
130
+        $v = array_pad($v, 5, 0);
131
+        list(, $maj2, $min2, , $rev2) = $v;
132
+        $branche_maj = $maj2 . '.' . $min2;
133
+        $version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
134
+        // d'abord les mises à jour de la même branche
135
+        if ((spip_version_compare($version, $version_maj, '<'))
136
+            and (spip_version_compare($page, $version_maj, '<'))
137
+            and spip_version_compare($branche, $branche_maj, '=')
138
+        ) {
139
+            $page = $version_maj;
140
+        }
141
+        // puis les mises à jours majeures
142
+        if ((spip_version_compare($version, $version_maj, '<'))
143
+            and (spip_version_compare($page, $version_maj, '<'))
144
+            and spip_version_compare($branche, $branche_maj, '<')
145
+        ) {
146
+            $page_majeure = $version_maj;
147
+        }
148
+    }
149
+    if (!$page and !$page_majeure) {
150
+        return "";
151
+    }
152
+
153
+    $message = $page ? _T('nouvelle_version_spip', array('version' => $page)) . ($page_majeure ? ' | ' : '') : '';
154
+    $message .= $page_majeure ? _T('nouvelle_version_spip_majeure', array('version' => $page_majeure)) : '';
155
+
156
+    return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$page'>" . $message . '</a>';
157 157
 }
158 158
 
159 159
 /**
@@ -174,25 +174,25 @@  discard block
 block discarded – undo
174 174
  *     Contenu du fichier de cache de l'info de maj de SPIP.
175 175
  */
176 176
 function info_maj_cache($nom, $dir, $page = '') {
177
-	include_spip('inc/acces');
178
-	$alea_ephemere = charger_aleas();
179
-	$re = '<archives id="a' . $alea_ephemere . '">';
180
-	if (preg_match("/$re/", $page)) {
181
-		return $page;
182
-	}
183
-
184
-	$url = _VERSIONS_SERVEUR . $dir . '/' . _VERSIONS_LISTE;
185
-	$a = file_exists($nom) ? filemtime($nom) : '';
186
-	include_spip('inc/distant');
187
-	$res = recuperer_url_cache($url, array('if_modified_since' => $a));
188
-	// Si rien de neuf (ou inaccessible), garder l'ancienne
189
-	if ($res) {
190
-		$page = $res['page'] ? $res['page'] : $page;
191
-	}
192
-	// Placer l'indicateur de fraicheur
193
-	$page = preg_replace('/^<archives.*?>/', $re, $page);
194
-	sous_repertoire(_DIR_CACHE_XML);
195
-	ecrire_fichier($nom, $page);
196
-
197
-	return $page;
177
+    include_spip('inc/acces');
178
+    $alea_ephemere = charger_aleas();
179
+    $re = '<archives id="a' . $alea_ephemere . '">';
180
+    if (preg_match("/$re/", $page)) {
181
+        return $page;
182
+    }
183
+
184
+    $url = _VERSIONS_SERVEUR . $dir . '/' . _VERSIONS_LISTE;
185
+    $a = file_exists($nom) ? filemtime($nom) : '';
186
+    include_spip('inc/distant');
187
+    $res = recuperer_url_cache($url, array('if_modified_since' => $a));
188
+    // Si rien de neuf (ou inaccessible), garder l'ancienne
189
+    if ($res) {
190
+        $page = $res['page'] ? $res['page'] : $page;
191
+    }
192
+    // Placer l'indicateur de fraicheur
193
+    $page = preg_replace('/^<archives.*?>/', $re, $page);
194
+    sous_repertoire(_DIR_CACHE_XML);
195
+    ecrire_fichier($nom, $page);
196
+
197
+    return $page;
198 198
 }
Please login to merge, or discard this patch.
ecrire/genie/mail.php 1 patch
Indentation   +29 added lines, -29 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
 /**
@@ -32,32 +32,32 @@  discard block
 block discarded – undo
32 32
  * @return int
33 33
  */
34 34
 function genie_mail_dist($t) {
35
-	$adresse_neuf = $GLOBALS['meta']['adresse_neuf'];
36
-	$jours_neuf = $GLOBALS['meta']['jours_neuf'];
37
-
38
-	$now = time();
39
-	if (!isset($GLOBALS['meta']['dernier_envoi_neuf'])) {
40
-		ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now - (3600 * 24 * $jours_neuf)));
41
-	}
42
-
43
-	$page = recuperer_fond('nouveautes',
44
-		array('date' => $GLOBALS['meta']['dernier_envoi_neuf'], 'jours_neuf' => $jours_neuf), array('raw' => true));
45
-
46
-	if (strlen(trim($page['texte']))) {
47
-		// recuperer les entetes envoyes par #HTTP_HEADER
48
-		$headers = "";
49
-		if (isset($page['entetes']) and count($page['entetes'])) {
50
-			foreach ($page['entetes'] as $k => $v) {
51
-				$headers .= (strlen($v) ? "$k: $v" : $k) . "\n";
52
-			}
53
-		}
54
-
55
-		include_spip("inc/notifications");
56
-		notifications_envoyer_mails($adresse_neuf, $page['texte'], "", "", $headers);
57
-		ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now));
58
-	} else {
59
-		spip_log("mail nouveautes : rien de neuf depuis $jours_neuf jours");
60
-	}
61
-
62
-	return 1;
35
+    $adresse_neuf = $GLOBALS['meta']['adresse_neuf'];
36
+    $jours_neuf = $GLOBALS['meta']['jours_neuf'];
37
+
38
+    $now = time();
39
+    if (!isset($GLOBALS['meta']['dernier_envoi_neuf'])) {
40
+        ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now - (3600 * 24 * $jours_neuf)));
41
+    }
42
+
43
+    $page = recuperer_fond('nouveautes',
44
+        array('date' => $GLOBALS['meta']['dernier_envoi_neuf'], 'jours_neuf' => $jours_neuf), array('raw' => true));
45
+
46
+    if (strlen(trim($page['texte']))) {
47
+        // recuperer les entetes envoyes par #HTTP_HEADER
48
+        $headers = "";
49
+        if (isset($page['entetes']) and count($page['entetes'])) {
50
+            foreach ($page['entetes'] as $k => $v) {
51
+                $headers .= (strlen($v) ? "$k: $v" : $k) . "\n";
52
+            }
53
+        }
54
+
55
+        include_spip("inc/notifications");
56
+        notifications_envoyer_mails($adresse_neuf, $page['texte'], "", "", $headers);
57
+        ecrire_meta('dernier_envoi_neuf', date('Y-m-d H:i:s', $now));
58
+    } else {
59
+        spip_log("mail nouveautes : rien de neuf depuis $jours_neuf jours");
60
+    }
61
+
62
+    return 1;
63 63
 }
Please login to merge, or discard this patch.
ecrire/typographie/fr.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -11,74 +11,74 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 // Correction typographique francaise
18 18
 
19 19
 function typographie_fr_dist($letexte) {
20 20
 
21
-	static $trans;
21
+    static $trans;
22 22
 
23
-	// Nettoyer 160 = nbsp ; 187 = raquo ; 171 = laquo ; 176 = deg ;
24
-	// 147 = ldquo; 148 = rdquo; ' = zouli apostrophe
25
-	if (!$trans) {
26
-		$trans = array(
27
-			"'" => '&#8217;',
28
-			'&nbsp;' => '~',
29
-			'&raquo;' => '&#187;',
30
-			'&laquo;' => '&#171;',
31
-			'&rdquo;' => '&#8221;',
32
-			'&ldquo;' => '&#8220;',
33
-			'&deg;' => '&#176;'
34
-		);
35
-		$chars = array(160 => '~', 187 => '&#187;', 171 => '&#171;', 148 => '&#8221;', 147 => '&#8220;', 176 => '&#176;');
36
-		$chars_trans = array_keys($chars);
37
-		$chars = array_values($chars);
38
-		$chars_trans = implode(' ', array_map('chr', $chars_trans));
39
-		$chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer'));
40
-		$chars_trans = explode(' ', $chars_trans);
41
-		foreach ($chars as $k => $r) {
42
-			$trans[$chars_trans[$k]] = $r;
43
-		}
44
-	}
23
+    // Nettoyer 160 = nbsp ; 187 = raquo ; 171 = laquo ; 176 = deg ;
24
+    // 147 = ldquo; 148 = rdquo; ' = zouli apostrophe
25
+    if (!$trans) {
26
+        $trans = array(
27
+            "'" => '&#8217;',
28
+            '&nbsp;' => '~',
29
+            '&raquo;' => '&#187;',
30
+            '&laquo;' => '&#171;',
31
+            '&rdquo;' => '&#8221;',
32
+            '&ldquo;' => '&#8220;',
33
+            '&deg;' => '&#176;'
34
+        );
35
+        $chars = array(160 => '~', 187 => '&#187;', 171 => '&#171;', 148 => '&#8221;', 147 => '&#8220;', 176 => '&#176;');
36
+        $chars_trans = array_keys($chars);
37
+        $chars = array_values($chars);
38
+        $chars_trans = implode(' ', array_map('chr', $chars_trans));
39
+        $chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer'));
40
+        $chars_trans = explode(' ', $chars_trans);
41
+        foreach ($chars as $k => $r) {
42
+            $trans[$chars_trans[$k]] = $r;
43
+        }
44
+    }
45 45
 
46
-	$letexte = strtr($letexte, $trans);
46
+    $letexte = strtr($letexte, $trans);
47 47
 
48
-	$cherche1 = array(
49
-		/* 1 */
50
-		'/((?:^|[^\#0-9a-zA-Z\&])[\#0-9a-zA-Z]*)\;/S',
51
-		/* 2 */
52
-		'/&#187;| --?,|(?::(?!:)| %)(?:\W|$)/S',
53
-		/* 3 */
54
-		'/([^[<(!?.])([!?][!?\.]*)/iS',
55
-		/* 4 */
56
-		'/&#171;|(?:M(?:M?\.|mes?|r\.?)|[MnN]&#176;) /S'
57
-	);
58
-	$remplace1 = array(
59
-		/* 1 */
60
-		'\1~;',
61
-		/* 2 */
62
-		'~\0',
63
-		/* 3 */
64
-		'\1~\2',
65
-		/* 4 */
66
-		'\0~'
67
-	);
68
-	$letexte = preg_replace($cherche1, $remplace1, $letexte);
69
-	$letexte = preg_replace('/ *~+ */S', '~', $letexte);
48
+    $cherche1 = array(
49
+        /* 1 */
50
+        '/((?:^|[^\#0-9a-zA-Z\&])[\#0-9a-zA-Z]*)\;/S',
51
+        /* 2 */
52
+        '/&#187;| --?,|(?::(?!:)| %)(?:\W|$)/S',
53
+        /* 3 */
54
+        '/([^[<(!?.])([!?][!?\.]*)/iS',
55
+        /* 4 */
56
+        '/&#171;|(?:M(?:M?\.|mes?|r\.?)|[MnN]&#176;) /S'
57
+    );
58
+    $remplace1 = array(
59
+        /* 1 */
60
+        '\1~;',
61
+        /* 2 */
62
+        '~\0',
63
+        /* 3 */
64
+        '\1~\2',
65
+        /* 4 */
66
+        '\0~'
67
+    );
68
+    $letexte = preg_replace($cherche1, $remplace1, $letexte);
69
+    $letexte = preg_replace('/ *~+ */S', '~', $letexte);
70 70
 
71
-	$cherche2 = array(
72
-		'/([^-\n]|^)--([^-]|$)/S',
73
-		',(' . _PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S',
74
-		'/~/'
75
-	);
76
-	$remplace2 = array(
77
-		'\1&mdash;\2',
78
-		'\1\3\4',
79
-		'&nbsp;'
80
-	);
81
-	$letexte = preg_replace($cherche2, $remplace2, $letexte);
71
+    $cherche2 = array(
72
+        '/([^-\n]|^)--([^-]|$)/S',
73
+        ',(' . _PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S',
74
+        '/~/'
75
+    );
76
+    $remplace2 = array(
77
+        '\1&mdash;\2',
78
+        '\1\3\4',
79
+        '&nbsp;'
80
+    );
81
+    $letexte = preg_replace($cherche2, $remplace2, $letexte);
82 82
 
83
-	return $letexte;
83
+    return $letexte;
84 84
 }
Please login to merge, or discard this patch.
ecrire/typographie/en.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -11,37 +11,37 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 // rien sauf les "~" et "-,"
18 18
 
19 19
 function typographie_en_dist($letexte) {
20 20
 
21
-	// zouli apostrophe
22
-	$letexte = str_replace("'", '&#8217;', $letexte);
21
+    // zouli apostrophe
22
+    $letexte = str_replace("'", '&#8217;', $letexte);
23 23
 
24
-	$cherche1 = array(
25
-		'/ --?,/S'
26
-	);
27
-	$remplace1 = array(
28
-		'~\0'
29
-	);
30
-	$letexte = preg_replace($cherche1, $remplace1, $letexte);
24
+    $cherche1 = array(
25
+        '/ --?,/S'
26
+    );
27
+    $remplace1 = array(
28
+        '~\0'
29
+    );
30
+    $letexte = preg_replace($cherche1, $remplace1, $letexte);
31 31
 
32
-	$letexte = str_replace('&nbsp;', '~', $letexte);
33
-	$letexte = preg_replace('/ *~+ */', '~', $letexte);
32
+    $letexte = str_replace('&nbsp;', '~', $letexte);
33
+    $letexte = preg_replace('/ *~+ */', '~', $letexte);
34 34
 
35
-	$cherche2 = array(
36
-		'/([^-\n]|^)--([^-]|$)/',
37
-		'/~/'
38
-	);
39
-	$remplace2 = array(
40
-		'\1&mdash;\2',
41
-		'&nbsp;'
42
-	);
35
+    $cherche2 = array(
36
+        '/([^-\n]|^)--([^-]|$)/',
37
+        '/~/'
38
+    );
39
+    $remplace2 = array(
40
+        '\1&mdash;\2',
41
+        '&nbsp;'
42
+    );
43 43
 
44
-	$letexte = preg_replace($cherche2, $remplace2, $letexte);
44
+    $letexte = preg_replace($cherche2, $remplace2, $letexte);
45 45
 
46
-	return $letexte;
46
+    return $letexte;
47 47
 }
Please login to merge, or discard this patch.
ecrire/balise/menu_lang_ecrire.php 1 patch
Indentation   +31 added lines, -31 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
 /**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
  *     Pile complétée du code compilé
38 38
  **/
39 39
 function balise_MENU_LANG_ECRIRE($p) {
40
-	return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang'));
40
+    return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang'));
41 41
 }
42 42
 
43 43
 /**
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
  *   Liste (lang) des arguments collectés et fournis.
56 56
  */
57 57
 function balise_MENU_LANG_ECRIRE_stat($args, $context_compil) {
58
-	include_spip('inc/lang');
59
-	if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) {
60
-		return '';
61
-	}
58
+    include_spip('inc/lang');
59
+    if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) {
60
+        return '';
61
+    }
62 62
 
63
-	return $args;
63
+    return $args;
64 64
 }
65 65
 
66 66
 /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
  *     Liste : Chemin du squelette, durée du cache, contexte
77 77
  **/
78 78
 function balise_MENU_LANG_ECRIRE_dyn($opt) {
79
-	return menu_lang_pour_tous('var_lang_ecrire', $opt);
79
+    return menu_lang_pour_tous('var_lang_ecrire', $opt);
80 80
 }
81 81
 
82 82
 /**
@@ -96,30 +96,30 @@  discard block
 block discarded – undo
96 96
  *     Liste : Chemin du squelette, durée du cache, contexte
97 97
  **/
98 98
 function menu_lang_pour_tous($nom, $default) {
99
-	include_spip('inc/lang');
99
+    include_spip('inc/lang');
100 100
 
101
-	if ($GLOBALS['spip_lang'] <> $default) {
102
-		$opt = lang_select($default);  # et remplace
103
-		if ($GLOBALS['spip_lang'] <> $default) {
104
-			$default = '';  # annule tout choix par defaut
105
-			if ($opt) {
106
-				lang_select();
107
-			}
108
-		}
109
-	}
101
+    if ($GLOBALS['spip_lang'] <> $default) {
102
+        $opt = lang_select($default);  # et remplace
103
+        if ($GLOBALS['spip_lang'] <> $default) {
104
+            $default = '';  # annule tout choix par defaut
105
+            if ($opt) {
106
+                lang_select();
107
+            }
108
+        }
109
+    }
110 110
 
111
-	# lien a partir de /
112
-	$cible = parametre_url(self(), 'lang', '', '&');
113
-	$post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&');
111
+    # lien a partir de /
112
+    $cible = parametre_url(self(), 'lang', '', '&');
113
+    $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&');
114 114
 
115
-	return array(
116
-		'formulaires/menu_lang',
117
-		3600,
118
-		array(
119
-			'nom' => $nom,
120
-			'url' => $post,
121
-			'name' => $nom,
122
-			'default' => $default,
123
-		)
124
-	);
115
+    return array(
116
+        'formulaires/menu_lang',
117
+        3600,
118
+        array(
119
+            'nom' => $nom,
120
+            'url' => $post,
121
+            'name' => $nom,
122
+            'default' => $default,
123
+        )
124
+    );
125 125
 }
Please login to merge, or discard this patch.
ecrire/balise/formulaire_ecrire_auteur.php 1 patch
Indentation   +36 added lines, -36 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
 include_spip('base/abstract_sql');
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  *     Pile complétée du code compilé
42 42
  **/
43 43
 function balise_FORMULAIRE_ECRIRE_AUTEUR($p) {
44
-	return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email'));
44
+    return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email'));
45 45
 }
46 46
 
47 47
 /**
@@ -59,42 +59,42 @@  discard block
 block discarded – undo
59 59
  *   - chaîne vide sinon (erreur ou non affichage).
60 60
  */
61 61
 function balise_FORMULAIRE_ECRIRE_AUTEUR_stat($args, $context_compil) {
62
-	include_spip('inc/filtres');
63
-	// Pas d'id_auteur ni d'id_article ? Erreur de contexte
64
-	$id = intval($args[1]);
65
-	if (!$args[0] and !$id) {
66
-		$msg = array(
67
-			'zbug_champ_hors_motif',
68
-			array(
69
-				'champ' => 'FORMULAIRE_ECRIRE_AUTEUR',
70
-				'motif' => 'AUTEURS/ARTICLES'
71
-			)
72
-		);
62
+    include_spip('inc/filtres');
63
+    // Pas d'id_auteur ni d'id_article ? Erreur de contexte
64
+    $id = intval($args[1]);
65
+    if (!$args[0] and !$id) {
66
+        $msg = array(
67
+            'zbug_champ_hors_motif',
68
+            array(
69
+                'champ' => 'FORMULAIRE_ECRIRE_AUTEUR',
70
+                'motif' => 'AUTEURS/ARTICLES'
71
+            )
72
+        );
73 73
 
74
-		erreur_squelette($msg, $context_compil);
74
+        erreur_squelette($msg, $context_compil);
75 75
 
76
-		return '';
77
-	}
78
-	// Si on est dans un contexte article,
79
-	// sortir tous les mails des auteurs de l'article
80
-	if (!$args[0] and $id) {
81
-		$r = '';
82
-		$s = sql_allfetsel('email',
83
-			'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')',
84
-			"A.email != '' AND L.id_objet=$id");
85
-		foreach ($s as $row) {
86
-			if (email_valide($row['email'])) {
87
-				$r .= ', ' . $row['email'];
88
-			}
89
-		}
90
-		$args[2] = substr($r, 2);
91
-	}
76
+        return '';
77
+    }
78
+    // Si on est dans un contexte article,
79
+    // sortir tous les mails des auteurs de l'article
80
+    if (!$args[0] and $id) {
81
+        $r = '';
82
+        $s = sql_allfetsel('email',
83
+            'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')',
84
+            "A.email != '' AND L.id_objet=$id");
85
+        foreach ($s as $row) {
86
+            if (email_valide($row['email'])) {
87
+                $r .= ', ' . $row['email'];
88
+            }
89
+        }
90
+        $args[2] = substr($r, 2);
91
+    }
92 92
 
93
-	// On ne peut pas ecrire a un auteur dont le mail n'est pas valide
94
-	if (!$args[2] or !email_valide($args[2])) {
95
-		return '';
96
-	}
93
+    // On ne peut pas ecrire a un auteur dont le mail n'est pas valide
94
+    if (!$args[2] or !email_valide($args[2])) {
95
+        return '';
96
+    }
97 97
 
98
-	// OK
99
-	return $args;
98
+    // OK
99
+    return $args;
100 100
 }
Please login to merge, or discard this patch.