Completed
Push — master ( 8ce9c8...350a8b )
by cam
01:02
created
ecrire/inc/notifications.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	if ($notification = charger_fonction($quoi, 'notifications', true)) {
41 41
 		spip_log("$notification($quoi,$id"
42
-			. ($options ? ',' . serialize($options) : '')
42
+			. ($options ? ','.serialize($options) : '')
43 43
 			. ')', 'notifications');
44 44
 		$notification($quoi, $id, $options);
45 45
 	}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 		job_queue_add(
159 159
 			'envoyer_mail',
160
-			">$email : " . $envoi['sujet'],
160
+			">$email : ".$envoi['sujet'],
161 161
 			[$email, $envoi['sujet'], $envoi['texte'], $envoi['from'], $envoi['headers']],
162 162
 			'inc/'
163 163
 		);
Please login to merge, or discard this patch.
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Notifications
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function inc_notifications_dist($quoi, $id = 0, $options = []) {
35 35
 
36
-	// charger les fichiers qui veulent ajouter des definitions
37
-	// ou faire des trucs aussi dans le pipeline, ca fait deux api pour le prix d'une ...
38
-	pipeline('notifications', ['args' => ['quoi' => $quoi, 'id' => $id, 'options' => $options]]);
36
+    // charger les fichiers qui veulent ajouter des definitions
37
+    // ou faire des trucs aussi dans le pipeline, ca fait deux api pour le prix d'une ...
38
+    pipeline('notifications', ['args' => ['quoi' => $quoi, 'id' => $id, 'options' => $options]]);
39 39
 
40
-	if ($notification = charger_fonction($quoi, 'notifications', true)) {
41
-		spip_log("$notification($quoi,$id"
42
-			. ($options ? ',' . serialize($options) : '')
43
-			. ')', 'notifications');
44
-		$notification($quoi, $id, $options);
45
-	}
40
+    if ($notification = charger_fonction($quoi, 'notifications', true)) {
41
+        spip_log("$notification($quoi,$id"
42
+            . ($options ? ',' . serialize($options) : '')
43
+            . ')', 'notifications');
44
+        $notification($quoi, $id, $options);
45
+    }
46 46
 }
47 47
 
48 48
 /**
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
  * @param array $exclure
57 57
  */
58 58
 function notifications_nettoyer_emails(&$emails, $exclure = []) {
59
-	// filtrer et unifier
60
-	include_spip('inc/filtres');
61
-	$emails = array_unique(array_filter(array_map('email_valide', array_map('trim', $emails))));
62
-	if ($exclure and count($exclure)) {
63
-		// nettoyer les exclusions d'abord
64
-		notifications_nettoyer_emails($exclure);
65
-		// faire un diff
66
-		$emails = array_diff($emails, $exclure);
67
-	}
59
+    // filtrer et unifier
60
+    include_spip('inc/filtres');
61
+    $emails = array_unique(array_filter(array_map('email_valide', array_map('trim', $emails))));
62
+    if ($exclure and count($exclure)) {
63
+        // nettoyer les exclusions d'abord
64
+        notifications_nettoyer_emails($exclure);
65
+        // faire un diff
66
+        $emails = array_diff($emails, $exclure);
67
+    }
68 68
 }
69 69
 
70 70
 /**
@@ -79,90 +79,90 @@  discard block
 block discarded – undo
79 79
  * @param string $headers
80 80
  */
81 81
 function notifications_envoyer_mails($emails, $texte, $sujet = '', $from = '', $headers = '') {
82
-	// rien a faire si pas de texte !
83
-	if (!strlen($texte)) {
84
-		return;
85
-	}
86
-
87
-	// si on ne specifie qu'un email, le mettre dans un tableau
88
-	if (!is_array($emails)) {
89
-		$emails = explode(',', $emails);
90
-	}
91
-
92
-	notifications_nettoyer_emails($emails);
93
-
94
-	// tester si le mail est deja en html
95
-	if (
96
-		strpos($texte, '<') !== false // eviter les tests suivants si possible
97
-		and $ttrim = trim($texte)
98
-		and substr($ttrim, 0, 1) == '<'
99
-		and substr($ttrim, -1, 1) == '>'
100
-		and stripos($ttrim, '</html>') !== false
101
-	) {
102
-		if (!strlen($sujet)) {
103
-			// dans ce cas on ruse un peu : extraire le sujet du title
104
-			if (preg_match(',<title>(.*)</title>,Uims', $texte, $m)) {
105
-				$sujet = $m[1];
106
-			} else {
107
-				// fallback, on prend le body si on le trouve
108
-				if (preg_match(',<body[^>]*>(.*)</body>,Uims', $texte, $m)) {
109
-					$ttrim = $m[1];
110
-				}
111
-
112
-				// et on extrait la premiere ligne de vrai texte...
113
-				// nettoyer le html et les retours chariots
114
-				$ttrim = textebrut($ttrim);
115
-				$ttrim = str_replace("\r\n", "\r", $ttrim);
116
-				$ttrim = str_replace("\r", "\n", $ttrim);
117
-				// decouper
118
-				$ttrim = explode("\n", trim($ttrim));
119
-				// extraire la premiere ligne de texte brut
120
-				$sujet = array_shift($ttrim);
121
-			}
122
-		}
123
-
124
-		// si besoin on ajoute le content-type dans les headers
125
-		if (stripos($headers, 'Content-Type') === false) {
126
-			$headers .= "Content-Type: text/html\n";
127
-		}
128
-	}
129
-
130
-	// si le sujet est vide, extraire la premiere ligne du corps
131
-	// du mail qui est donc du texte
132
-	if (!strlen($sujet)) {
133
-		// nettoyer un peu les retours chariots
134
-		$texte = str_replace("\r\n", "\r", $texte);
135
-		$texte = str_replace("\r", "\n", $texte);
136
-		// decouper
137
-		$texte = explode("\n", trim($texte));
138
-		// extraire la premiere ligne
139
-		$sujet = array_shift($texte);
140
-		$texte = trim(implode("\n", $texte));
141
-	}
142
-
143
-	$envoyer_mail = charger_fonction('envoyer_mail', 'inc');
144
-	foreach ($emails as $email) {
145
-		// passer dans un pipeline qui permet un ajout eventuel
146
-		// (url de suivi des notifications par exemple)
147
-		$envoi = pipeline(
148
-			'notifications_envoyer_mails',
149
-			[
150
-				'email' => $email,
151
-				'sujet' => $sujet,
152
-				'texte' => $texte,
153
-				'from' => $from,
154
-				'headers' => $headers,
155
-			]
156
-		);
157
-		$email = $envoi['email'];
158
-
159
-		job_queue_add(
160
-			'envoyer_mail',
161
-			">$email : " . $envoi['sujet'],
162
-			[$email, $envoi['sujet'], $envoi['texte'], $envoi['from'], $envoi['headers']],
163
-			'inc/'
164
-		);
165
-	}
82
+    // rien a faire si pas de texte !
83
+    if (!strlen($texte)) {
84
+        return;
85
+    }
86
+
87
+    // si on ne specifie qu'un email, le mettre dans un tableau
88
+    if (!is_array($emails)) {
89
+        $emails = explode(',', $emails);
90
+    }
91
+
92
+    notifications_nettoyer_emails($emails);
93
+
94
+    // tester si le mail est deja en html
95
+    if (
96
+        strpos($texte, '<') !== false // eviter les tests suivants si possible
97
+        and $ttrim = trim($texte)
98
+        and substr($ttrim, 0, 1) == '<'
99
+        and substr($ttrim, -1, 1) == '>'
100
+        and stripos($ttrim, '</html>') !== false
101
+    ) {
102
+        if (!strlen($sujet)) {
103
+            // dans ce cas on ruse un peu : extraire le sujet du title
104
+            if (preg_match(',<title>(.*)</title>,Uims', $texte, $m)) {
105
+                $sujet = $m[1];
106
+            } else {
107
+                // fallback, on prend le body si on le trouve
108
+                if (preg_match(',<body[^>]*>(.*)</body>,Uims', $texte, $m)) {
109
+                    $ttrim = $m[1];
110
+                }
111
+
112
+                // et on extrait la premiere ligne de vrai texte...
113
+                // nettoyer le html et les retours chariots
114
+                $ttrim = textebrut($ttrim);
115
+                $ttrim = str_replace("\r\n", "\r", $ttrim);
116
+                $ttrim = str_replace("\r", "\n", $ttrim);
117
+                // decouper
118
+                $ttrim = explode("\n", trim($ttrim));
119
+                // extraire la premiere ligne de texte brut
120
+                $sujet = array_shift($ttrim);
121
+            }
122
+        }
123
+
124
+        // si besoin on ajoute le content-type dans les headers
125
+        if (stripos($headers, 'Content-Type') === false) {
126
+            $headers .= "Content-Type: text/html\n";
127
+        }
128
+    }
129
+
130
+    // si le sujet est vide, extraire la premiere ligne du corps
131
+    // du mail qui est donc du texte
132
+    if (!strlen($sujet)) {
133
+        // nettoyer un peu les retours chariots
134
+        $texte = str_replace("\r\n", "\r", $texte);
135
+        $texte = str_replace("\r", "\n", $texte);
136
+        // decouper
137
+        $texte = explode("\n", trim($texte));
138
+        // extraire la premiere ligne
139
+        $sujet = array_shift($texte);
140
+        $texte = trim(implode("\n", $texte));
141
+    }
142
+
143
+    $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
144
+    foreach ($emails as $email) {
145
+        // passer dans un pipeline qui permet un ajout eventuel
146
+        // (url de suivi des notifications par exemple)
147
+        $envoi = pipeline(
148
+            'notifications_envoyer_mails',
149
+            [
150
+                'email' => $email,
151
+                'sujet' => $sujet,
152
+                'texte' => $texte,
153
+                'from' => $from,
154
+                'headers' => $headers,
155
+            ]
156
+        );
157
+        $email = $envoi['email'];
158
+
159
+        job_queue_add(
160
+            'envoyer_mail',
161
+            ">$email : " . $envoi['sujet'],
162
+            [$email, $envoi['sujet'], $envoi['texte'], $envoi['from'], $envoi['headers']],
163
+            'inc/'
164
+        );
165
+    }
166 166
 }
167 167
 
168 168
 /**
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
  * @return string
179 179
  */
180 180
 function email_notification_objet($id_objet, $type_objet, $modele) {
181
-	$envoyer_mail = charger_fonction('envoyer_mail', 'inc'); // pour nettoyer_titre_email
182
-	$id_type = id_table_objet($type_objet);
181
+    $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); // pour nettoyer_titre_email
182
+    $id_type = id_table_objet($type_objet);
183 183
 
184
-	return recuperer_fond($modele, [$id_type => $id_objet, 'id' => $id_objet]);
184
+    return recuperer_fond($modele, [$id_type => $id_objet, 'id' => $id_objet]);
185 185
 }
186 186
 
187 187
 /**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
  * @return string
197 197
  */
198 198
 function email_notification_article($id_article, $modele) {
199
-	$envoyer_mail = charger_fonction('envoyer_mail', 'inc'); // pour nettoyer_titre_email
199
+    $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); // pour nettoyer_titre_email
200 200
 
201
-	return recuperer_fond($modele, ['id_article' => $id_article]);
201
+    return recuperer_fond($modele, ['id_article' => $id_article]);
202 202
 }
Please login to merge, or discard this patch.
ecrire/inc/email_valide.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Mail
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
  *      - la normalisation de la dernière adresse donnée sinon
32 32
  **/
33 33
 function inc_email_valide_dist($adresses) {
34
-	// eviter d'injecter n'importe quoi dans preg_match
35
-	if (!is_string($adresses)) {
36
-		return false;
37
-	}
38
-
39
-	// Si c'est un spammeur autant arreter tout de suite
40
-	if (preg_match(",[\n\r].*(MIME|multipart|Content-),i", $adresses)) {
41
-		spip_log("Tentative d'injection de mail : $adresses");
42
-
43
-		return false;
44
-	}
45
-
46
-	foreach (explode(',', $adresses) as $v) {
47
-		// nettoyer certains formats
48
-		// "Marie Toto <[email protected]>"
49
-		$adresse = trim(preg_replace(',^[^<>"]*<([^<>"]+)>$,i', "\\1", $v));
50
-		// RFC 822
51
-		if (!preg_match('#^[^()<>@,;:\\"/[:space:]]+(@([-_0-9a-z]+\.)*[-_0-9a-z]+)$#i', $adresse)) {
52
-			return false;
53
-		}
54
-	}
55
-
56
-	return $adresse;
34
+    // eviter d'injecter n'importe quoi dans preg_match
35
+    if (!is_string($adresses)) {
36
+        return false;
37
+    }
38
+
39
+    // Si c'est un spammeur autant arreter tout de suite
40
+    if (preg_match(",[\n\r].*(MIME|multipart|Content-),i", $adresses)) {
41
+        spip_log("Tentative d'injection de mail : $adresses");
42
+
43
+        return false;
44
+    }
45
+
46
+    foreach (explode(',', $adresses) as $v) {
47
+        // nettoyer certains formats
48
+        // "Marie Toto <[email protected]>"
49
+        $adresse = trim(preg_replace(',^[^<>"]*<([^<>"]+)>$,i', "\\1", $v));
50
+        // RFC 822
51
+        if (!preg_match('#^[^()<>@,;:\\"/[:space:]]+(@([-_0-9a-z]+\.)*[-_0-9a-z]+)$#i', $adresse)) {
52
+            return false;
53
+        }
54
+    }
55
+
56
+    return $adresse;
57 57
 }
Please login to merge, or discard this patch.
ecrire/inc/chercher_logo.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 	$mode = preg_replace(',\W,', '', $mode);
41 41
 	if ($mode) {
42 42
 		// chercher dans la base
43
-		$mode_document = 'logo' . $mode;
43
+		$mode_document = 'logo'.$mode;
44 44
 		$objet = objet_type($_id_objet);
45
-		$doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote($mode_document) . ' AND L.objet=' . sql_quote($objet) . ' AND id_objet=' . intval($id));
45
+		$doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote($mode_document).' AND L.objet='.sql_quote($objet).' AND id_objet='.intval($id));
46 46
 		if ($doc) {
47 47
 			include_spip('inc/documents');
48 48
 			$d = get_spip_doc($doc['fichier']);
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 		if ($compat_old_logos) {
54 54
 			# attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
55 55
 			$type = type_du_logo($_id_objet);
56
-			$nom = $type . $mode . intval($id);
56
+			$nom = $type.$mode.intval($id);
57 57
 
58 58
 			foreach ($GLOBALS['formats_logos'] as $format) {
59
-				if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
59
+				if (@file_exists($d = (_DIR_LOGOS.$nom.'.'.$format))) {
60 60
 					return [$d, _DIR_LOGOS, $nom, $format, @filemtime($d)];
61 61
 				}
62 62
 			}
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Logos
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -37,34 +37,34 @@  discard block
 block discarded – undo
37 37
  **/
38 38
 function inc_chercher_logo_dist($id, $_id_objet, $mode = 'on', $compat_old_logos = true) {
39 39
 
40
-	$mode = preg_replace(',\W,', '', $mode);
41
-	if ($mode) {
42
-		// chercher dans la base
43
-		$mode_document = 'logo' . $mode;
44
-		$objet = objet_type($_id_objet);
45
-		$doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote($mode_document) . ' AND L.objet=' . sql_quote($objet) . ' AND id_objet=' . intval($id));
46
-		if ($doc) {
47
-			include_spip('inc/documents');
48
-			$d = get_spip_doc($doc['fichier']);
49
-			return [$d, _DIR_IMG, basename($d), $doc['extension'], @filemtime($d), $doc];
50
-		}
40
+    $mode = preg_replace(',\W,', '', $mode);
41
+    if ($mode) {
42
+        // chercher dans la base
43
+        $mode_document = 'logo' . $mode;
44
+        $objet = objet_type($_id_objet);
45
+        $doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote($mode_document) . ' AND L.objet=' . sql_quote($objet) . ' AND id_objet=' . intval($id));
46
+        if ($doc) {
47
+            include_spip('inc/documents');
48
+            $d = get_spip_doc($doc['fichier']);
49
+            return [$d, _DIR_IMG, basename($d), $doc['extension'], @filemtime($d), $doc];
50
+        }
51 51
 
52
-		# deprecated TODO remove
53
-		if ($compat_old_logos) {
54
-			# attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
55
-			$type = type_du_logo($_id_objet);
56
-			$nom = $type . $mode . intval($id);
52
+        # deprecated TODO remove
53
+        if ($compat_old_logos) {
54
+            # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
55
+            $type = type_du_logo($_id_objet);
56
+            $nom = $type . $mode . intval($id);
57 57
 
58
-			foreach ($GLOBALS['formats_logos'] as $format) {
59
-				if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
60
-					return [$d, _DIR_LOGOS, $nom, $format, @filemtime($d)];
61
-				}
62
-			}
63
-		}
64
-	}
58
+            foreach ($GLOBALS['formats_logos'] as $format) {
59
+                if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
60
+                    return [$d, _DIR_LOGOS, $nom, $format, @filemtime($d)];
61
+                }
62
+            }
63
+        }
64
+    }
65 65
 
66
-	# coherence de type pour servir comme filtre (formulaire_login)
67
-	return [];
66
+    # coherence de type pour servir comme filtre (formulaire_login)
67
+    return [];
68 68
 }
69 69
 
70 70
 /**
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
  * @deprecated 4.0 MAIS NE PAS SUPPRIMER CAR SERT POUR L'UPGRADE des logos et leur mise en base
84 84
  **/
85 85
 function type_du_logo($_id_objet) {
86
-	return $GLOBALS['table_logos'][$_id_objet] ?? objet_type(preg_replace(',^id_,', '', $_id_objet));
86
+    return $GLOBALS['table_logos'][$_id_objet] ?? objet_type(preg_replace(',^id_,', '', $_id_objet));
87 87
 }
88 88
 
89 89
 // Exceptions standards (historique)
90 90
 $GLOBALS['table_logos'] = [
91
-	'id_article' => 'art',
92
-	'id_auteur' => 'aut',
93
-	'id_rubrique' => 'rub',
94
-	'id_groupe' => 'groupe',
91
+    'id_article' => 'art',
92
+    'id_auteur' => 'aut',
93
+    'id_rubrique' => 'rub',
94
+    'id_groupe' => 'groupe',
95 95
 ];
Please login to merge, or discard this patch.
ecrire/inc/meta.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			renouvelle_alea();
66 66
 			$new = false;
67 67
 		} else {
68
-			spip_log("impossible d'ecrire dans " . $cache);
68
+			spip_log("impossible d'ecrire dans ".$cache);
69 69
 		}
70 70
 	}
71 71
 	// et refaire le cache si on a du lire en base
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	if (!isset($touch[$table])) {
167 167
 		touch_meta($antidate, $table);
168 168
 	}
169
-	sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
169
+	sql_delete('spip_'.$table, "nom='$nom'", '', 'continue');
170 170
 	unset($GLOBALS[$table][$nom]);
171 171
 	if (!isset($touch[$table])) {
172 172
 		touch_meta($antidate, $table);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		return;
198 198
 	}
199 199
 	include_spip('base/abstract_sql');
200
-	$res = sql_select('*', 'spip_' . $table, 'nom=' . sql_quote($nom), '', '', '', '', '', 'continue');
200
+	$res = sql_select('*', 'spip_'.$table, 'nom='.sql_quote($nom), '', '', '', '', '', 'continue');
201 201
 	// table pas encore installee, travailler en php seulement
202 202
 	if (!$res) {
203 203
 		$GLOBALS[$table][$nom] = $valeur;
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 		$r['impt'] = sql_quote($importable, '', 'text');
232 232
 	}
233 233
 	if ($row) {
234
-		sql_update('spip_' . $table, $r, 'nom=' . sql_quote($nom));
234
+		sql_update('spip_'.$table, $r, 'nom='.sql_quote($nom));
235 235
 	} else {
236
-		sql_insert('spip_' . $table, '(' . join(',', array_keys($r)) . ')', '(' . join(',', array_values($r)) . ')');
236
+		sql_insert('spip_'.$table, '('.join(',', array_keys($r)).')', '('.join(',', array_values($r)).')');
237 237
 	}
238 238
 	if (!isset($touch[$table])) {
239 239
 		touch_meta($antidate, $table);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
  *     Nom du fichier cache
251 251
  **/
252 252
 function cache_meta($table = 'meta') {
253
-	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
253
+	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE.$table.'.php');
254 254
 }
255 255
 
256 256
 /**
Please login to merge, or discard this patch.
Indentation   +197 added lines, -197 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
 // Les parametres generaux du site sont dans une table SQL;
@@ -27,51 +27,51 @@  discard block
 block discarded – undo
27 27
 define('_META_CACHE_TIME', 1 << 24);
28 28
 
29 29
 function inc_meta_dist($table = 'meta') {
30
-	$new = null;
31
-	// Lire les meta, en cache si present, valide et lisible
32
-	// en cas d'install ne pas faire confiance au meta_cache eventuel
33
-	$cache = cache_meta($table);
30
+    $new = null;
31
+    // Lire les meta, en cache si present, valide et lisible
32
+    // en cas d'install ne pas faire confiance au meta_cache eventuel
33
+    $cache = cache_meta($table);
34 34
 
35
-	if (
36
-		(!$exec = _request('exec') or !autoriser_sans_cookie($exec))
37
-		and $new = jeune_fichier($cache, _META_CACHE_TIME)
38
-		and lire_fichier_securise($cache, $meta)
39
-		and $meta = @unserialize($meta)
40
-	) {
41
-		$GLOBALS[$table] = $meta;
42
-	}
35
+    if (
36
+        (!$exec = _request('exec') or !autoriser_sans_cookie($exec))
37
+        and $new = jeune_fichier($cache, _META_CACHE_TIME)
38
+        and lire_fichier_securise($cache, $meta)
39
+        and $meta = @unserialize($meta)
40
+    ) {
41
+        $GLOBALS[$table] = $meta;
42
+    }
43 43
 
44
-	if (
45
-		isset($GLOBALS[$table]['touch'])
46
-		and ($GLOBALS[$table]['touch'] < time() - _META_CACHE_TIME)
47
-	) {
48
-		$GLOBALS[$table] = [];
49
-	}
50
-	// sinon lire en base
51
-	if (!$GLOBALS[$table]) {
52
-		$new = !lire_metas($table);
53
-	}
44
+    if (
45
+        isset($GLOBALS[$table]['touch'])
46
+        and ($GLOBALS[$table]['touch'] < time() - _META_CACHE_TIME)
47
+    ) {
48
+        $GLOBALS[$table] = [];
49
+    }
50
+    // sinon lire en base
51
+    if (!$GLOBALS[$table]) {
52
+        $new = !lire_metas($table);
53
+    }
54 54
 
55
-	// renouveller l'alea general si trop vieux ou sur demande explicite
56
-	if (
57
-		(test_espace_prive() || isset($_GET['renouvelle_alea']))
58
-		and $GLOBALS[$table]
59
-		and (time() > _RENOUVELLE_ALEA + ($GLOBALS['meta']['alea_ephemere_date'] ?? 0))
60
-	) {
61
-		// si on n'a pas l'acces en ecriture sur le cache,
62
-		// ne pas renouveller l'alea sinon le cache devient faux
63
-		if (supprimer_fichier($cache)) {
64
-			include_spip('inc/acces');
65
-			renouvelle_alea();
66
-			$new = false;
67
-		} else {
68
-			spip_log("impossible d'ecrire dans " . $cache);
69
-		}
70
-	}
71
-	// et refaire le cache si on a du lire en base
72
-	if (!$new) {
73
-		touch_meta(false, $table);
74
-	}
55
+    // renouveller l'alea general si trop vieux ou sur demande explicite
56
+    if (
57
+        (test_espace_prive() || isset($_GET['renouvelle_alea']))
58
+        and $GLOBALS[$table]
59
+        and (time() > _RENOUVELLE_ALEA + ($GLOBALS['meta']['alea_ephemere_date'] ?? 0))
60
+    ) {
61
+        // si on n'a pas l'acces en ecriture sur le cache,
62
+        // ne pas renouveller l'alea sinon le cache devient faux
63
+        if (supprimer_fichier($cache)) {
64
+            include_spip('inc/acces');
65
+            renouvelle_alea();
66
+            $new = false;
67
+        } else {
68
+            spip_log("impossible d'ecrire dans " . $cache);
69
+        }
70
+    }
71
+    // et refaire le cache si on a du lire en base
72
+    if (!$new) {
73
+        touch_meta(false, $table);
74
+    }
75 75
 }
76 76
 
77 77
 // fonctions aussi appelees a l'install ==> spip_query en premiere requete
@@ -79,39 +79,39 @@  discard block
 block discarded – undo
79 79
 
80 80
 function lire_metas($table = 'meta') {
81 81
 
82
-	if ($result = spip_query("SELECT nom,valeur FROM spip_$table")) {
83
-		include_spip('base/abstract_sql');
84
-		$GLOBALS[$table] = [];
85
-		while ($row = sql_fetch($result)) {
86
-			$GLOBALS[$table][$row['nom']] = $row['valeur'];
87
-		}
88
-		sql_free($result);
82
+    if ($result = spip_query("SELECT nom,valeur FROM spip_$table")) {
83
+        include_spip('base/abstract_sql');
84
+        $GLOBALS[$table] = [];
85
+        while ($row = sql_fetch($result)) {
86
+            $GLOBALS[$table][$row['nom']] = $row['valeur'];
87
+        }
88
+        sql_free($result);
89 89
 
90
-		if (
91
-			!isset($GLOBALS[$table]['charset'])
92
-			or !$GLOBALS[$table]['charset']
93
-			or $GLOBALS[$table]['charset'] == '_DEFAULT_CHARSET' // hum, correction d'un bug ayant abime quelques install
94
-		) {
95
-			ecrire_meta('charset', _DEFAULT_CHARSET, null, $table);
96
-		}
90
+        if (
91
+            !isset($GLOBALS[$table]['charset'])
92
+            or !$GLOBALS[$table]['charset']
93
+            or $GLOBALS[$table]['charset'] == '_DEFAULT_CHARSET' // hum, correction d'un bug ayant abime quelques install
94
+        ) {
95
+            ecrire_meta('charset', _DEFAULT_CHARSET, null, $table);
96
+        }
97 97
 
98
-		// noter cette table de configuration dans les meta de SPIP
99
-		if ($table !== 'meta') {
100
-			$liste = [];
101
-			if (isset($GLOBALS['meta']['tables_config'])) {
102
-				$liste = unserialize($GLOBALS['meta']['tables_config']);
103
-			}
104
-			if (!$liste) {
105
-				$liste = [];
106
-			}
107
-			if (!in_array($table, $liste)) {
108
-				$liste[] = $table;
109
-				ecrire_meta('tables_config', serialize($liste));
110
-			}
111
-		}
112
-	}
98
+        // noter cette table de configuration dans les meta de SPIP
99
+        if ($table !== 'meta') {
100
+            $liste = [];
101
+            if (isset($GLOBALS['meta']['tables_config'])) {
102
+                $liste = unserialize($GLOBALS['meta']['tables_config']);
103
+            }
104
+            if (!$liste) {
105
+                $liste = [];
106
+            }
107
+            if (!in_array($table, $liste)) {
108
+                $liste[] = $table;
109
+                ecrire_meta('tables_config', serialize($liste));
110
+            }
111
+        }
112
+    }
113 113
 
114
-	return $GLOBALS[$table] ?? null;
114
+    return $GLOBALS[$table] ?? null;
115 115
 }
116 116
 
117 117
 
@@ -125,22 +125,22 @@  discard block
 block discarded – undo
125 125
  *      Table SQL d'enregistrement des meta.
126 126
  **/
127 127
 function touch_meta($antidate = false, $table = 'meta') {
128
-	$file = cache_meta($table);
129
-	if (!$antidate or !@touch($file, $antidate)) {
130
-		$r = $GLOBALS[$table] ?? [];
131
-		if ($table == 'meta') {
132
-			unset($r['alea_ephemere']);
133
-			unset($r['alea_ephemere_ancien']);
134
-			// le secret du site est utilise pour encoder les contextes ajax que l'on considere fiables
135
-			// mais le sortir deu cache meta implique une requete sql des qu'on a un form dynamique
136
-			// meme si son squelette est en cache
137
-			//unset($r['secret_du_site']);
138
-			if ($antidate) {
139
-				$r['touch'] = $antidate;
140
-			}
141
-		}
142
-		ecrire_fichier_securise($file, serialize($r));
143
-	}
128
+    $file = cache_meta($table);
129
+    if (!$antidate or !@touch($file, $antidate)) {
130
+        $r = $GLOBALS[$table] ?? [];
131
+        if ($table == 'meta') {
132
+            unset($r['alea_ephemere']);
133
+            unset($r['alea_ephemere_ancien']);
134
+            // le secret du site est utilise pour encoder les contextes ajax que l'on considere fiables
135
+            // mais le sortir deu cache meta implique une requete sql des qu'on a un form dynamique
136
+            // meme si son squelette est en cache
137
+            //unset($r['secret_du_site']);
138
+            if ($antidate) {
139
+                $r['touch'] = $antidate;
140
+            }
141
+        }
142
+        ecrire_fichier_securise($file, serialize($r));
143
+    }
144 144
 }
145 145
 
146 146
 /**
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
  *     Table SQL d'enregistrement de la meta.
157 157
  **/
158 158
 function effacer_meta($nom, $table = 'meta') {
159
-	// section critique sur le cache:
160
-	// l'invalider avant et apres la MAJ de la BD
161
-	// c'est un peu moins bien qu'un vrai verrou mais ca suffira
162
-	// et utiliser une statique pour eviter des acces disques a repetition
163
-	static $touch = [];
164
-	$antidate = time() - (_META_CACHE_TIME << 4);
165
-	if (!isset($touch[$table])) {
166
-		touch_meta($antidate, $table);
167
-	}
168
-	sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
169
-	unset($GLOBALS[$table][$nom]);
170
-	if (!isset($touch[$table])) {
171
-		touch_meta($antidate, $table);
172
-		$touch[$table] = false;
173
-	}
159
+    // section critique sur le cache:
160
+    // l'invalider avant et apres la MAJ de la BD
161
+    // c'est un peu moins bien qu'un vrai verrou mais ca suffira
162
+    // et utiliser une statique pour eviter des acces disques a repetition
163
+    static $touch = [];
164
+    $antidate = time() - (_META_CACHE_TIME << 4);
165
+    if (!isset($touch[$table])) {
166
+        touch_meta($antidate, $table);
167
+    }
168
+    sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
169
+    unset($GLOBALS[$table][$nom]);
170
+    if (!isset($touch[$table])) {
171
+        touch_meta($antidate, $table);
172
+        $touch[$table] = false;
173
+    }
174 174
 }
175 175
 
176 176
 /**
@@ -191,53 +191,53 @@  discard block
 block discarded – undo
191 191
  **/
192 192
 function ecrire_meta($nom, $valeur, $importable = null, $table = 'meta') {
193 193
 
194
-	static $touch = [];
195
-	if (!$nom) {
196
-		return;
197
-	}
198
-	include_spip('base/abstract_sql');
199
-	$res = sql_select('*', 'spip_' . $table, 'nom=' . sql_quote($nom), '', '', '', '', '', 'continue');
200
-	// table pas encore installee, travailler en php seulement
201
-	if (!$res) {
202
-		$GLOBALS[$table][$nom] = $valeur;
194
+    static $touch = [];
195
+    if (!$nom) {
196
+        return;
197
+    }
198
+    include_spip('base/abstract_sql');
199
+    $res = sql_select('*', 'spip_' . $table, 'nom=' . sql_quote($nom), '', '', '', '', '', 'continue');
200
+    // table pas encore installee, travailler en php seulement
201
+    if (!$res) {
202
+        $GLOBALS[$table][$nom] = $valeur;
203 203
 
204
-		return;
205
-	}
206
-	$row = sql_fetch($res);
207
-	sql_free($res);
204
+        return;
205
+    }
206
+    $row = sql_fetch($res);
207
+    sql_free($res);
208 208
 
209
-	// ne pas invalider le cache si affectation a l'identique
210
-	// (tant pis si impt aurait du changer)
211
-	if (
212
-		$row and $valeur == $row['valeur']
213
-		and isset($GLOBALS[$table][$nom])
214
-		and $GLOBALS[$table][$nom] == $valeur
215
-	) {
216
-		return;
217
-	}
209
+    // ne pas invalider le cache si affectation a l'identique
210
+    // (tant pis si impt aurait du changer)
211
+    if (
212
+        $row and $valeur == $row['valeur']
213
+        and isset($GLOBALS[$table][$nom])
214
+        and $GLOBALS[$table][$nom] == $valeur
215
+    ) {
216
+        return;
217
+    }
218 218
 
219
-	$GLOBALS[$table][$nom] = $valeur;
220
-	// cf effacer pour comprendre le double touch
221
-	$antidate = time() - (_META_CACHE_TIME << 1);
222
-	if (!isset($touch[$table])) {
223
-		touch_meta($antidate, $table);
224
-	}
225
-	$r = ['nom' => sql_quote($nom, '', 'text'), 'valeur' => sql_quote($valeur, '', 'text')];
226
-	// Gaffe aux tables sans impt (vieilles versions de SPIP notamment)
227
-	// ici on utilise pas sql_updateq et sql_insertq pour ne pas provoquer trop tot
228
-	// de lecture des descriptions des tables
229
-	if ($importable and isset($row['impt'])) {
230
-		$r['impt'] = sql_quote($importable, '', 'text');
231
-	}
232
-	if ($row) {
233
-		sql_update('spip_' . $table, $r, 'nom=' . sql_quote($nom));
234
-	} else {
235
-		sql_insert('spip_' . $table, '(' . join(',', array_keys($r)) . ')', '(' . join(',', array_values($r)) . ')');
236
-	}
237
-	if (!isset($touch[$table])) {
238
-		touch_meta($antidate, $table);
239
-		$touch[$table] = false;
240
-	}
219
+    $GLOBALS[$table][$nom] = $valeur;
220
+    // cf effacer pour comprendre le double touch
221
+    $antidate = time() - (_META_CACHE_TIME << 1);
222
+    if (!isset($touch[$table])) {
223
+        touch_meta($antidate, $table);
224
+    }
225
+    $r = ['nom' => sql_quote($nom, '', 'text'), 'valeur' => sql_quote($valeur, '', 'text')];
226
+    // Gaffe aux tables sans impt (vieilles versions de SPIP notamment)
227
+    // ici on utilise pas sql_updateq et sql_insertq pour ne pas provoquer trop tot
228
+    // de lecture des descriptions des tables
229
+    if ($importable and isset($row['impt'])) {
230
+        $r['impt'] = sql_quote($importable, '', 'text');
231
+    }
232
+    if ($row) {
233
+        sql_update('spip_' . $table, $r, 'nom=' . sql_quote($nom));
234
+    } else {
235
+        sql_insert('spip_' . $table, '(' . join(',', array_keys($r)) . ')', '(' . join(',', array_values($r)) . ')');
236
+    }
237
+    if (!isset($touch[$table])) {
238
+        touch_meta($antidate, $table);
239
+        $touch[$table] = false;
240
+    }
241 241
 }
242 242
 
243 243
 /**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
  *     Nom du fichier cache
250 250
  **/
251 251
 function cache_meta($table = 'meta') {
252
-	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
252
+    return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
253 253
 }
254 254
 
255 255
 /**
@@ -258,14 +258,14 @@  discard block
 block discarded – undo
258 258
  * @param string $table
259 259
  */
260 260
 function installer_table_meta($table) {
261
-	$trouver_table = charger_fonction('trouver_table', 'base');
262
-	if (!$trouver_table("spip_$table")) {
263
-		include_spip('base/auxiliaires');
264
-		include_spip('base/create');
265
-		creer_ou_upgrader_table("spip_$table", $GLOBALS['tables_auxiliaires']['spip_meta'], false, false);
266
-		$trouver_table('');
267
-	}
268
-	lire_metas($table);
261
+    $trouver_table = charger_fonction('trouver_table', 'base');
262
+    if (!$trouver_table("spip_$table")) {
263
+        include_spip('base/auxiliaires');
264
+        include_spip('base/create');
265
+        creer_ou_upgrader_table("spip_$table", $GLOBALS['tables_auxiliaires']['spip_meta'], false, false);
266
+        $trouver_table('');
267
+    }
268
+    lire_metas($table);
269 269
 }
270 270
 
271 271
 /**
@@ -277,47 +277,47 @@  discard block
 block discarded – undo
277 277
  * @param bool $force
278 278
  */
279 279
 function supprimer_table_meta($table, $force = false) {
280
-	if ($table !== 'meta') {
281
-		// Vérifier le contenu restant de la table
282
-		$nb_variables = sql_countsel("spip_$table");
280
+    if ($table !== 'meta') {
281
+        // Vérifier le contenu restant de la table
282
+        $nb_variables = sql_countsel("spip_$table");
283 283
 
284
-		// Supprimer si :
285
-		// - la table est vide
286
-		// - ou limitée à la variable charset
287
-		// - ou qu'on force la suppression
288
-		if (
289
-			$force
290
-			or !$nb_variables
291
-			or (
292
-				($nb_variables == 1)
293
-				and isset($GLOBALS[$table]['charset'])
294
-			)
295
-		) {
296
-			// Supprimer la table des globaleset de la base
297
-			unset($GLOBALS[$table]);
298
-			sql_drop_table("spip_$table");
299
-			// Supprimer le fichier cache
300
-			include_spip('inc/flock');
301
-			$cache = cache_meta($table);
302
-			supprimer_fichier($cache);
284
+        // Supprimer si :
285
+        // - la table est vide
286
+        // - ou limitée à la variable charset
287
+        // - ou qu'on force la suppression
288
+        if (
289
+            $force
290
+            or !$nb_variables
291
+            or (
292
+                ($nb_variables == 1)
293
+                and isset($GLOBALS[$table]['charset'])
294
+            )
295
+        ) {
296
+            // Supprimer la table des globaleset de la base
297
+            unset($GLOBALS[$table]);
298
+            sql_drop_table("spip_$table");
299
+            // Supprimer le fichier cache
300
+            include_spip('inc/flock');
301
+            $cache = cache_meta($table);
302
+            supprimer_fichier($cache);
303 303
 
304
-			// vider le cache des tables
305
-			$trouver_table = charger_fonction('trouver_table', 'base');
306
-			$trouver_table('');
304
+            // vider le cache des tables
305
+            $trouver_table = charger_fonction('trouver_table', 'base');
306
+            $trouver_table('');
307 307
 
308
-			// Supprimer la table de la liste des tables de configuration autres que spip_meta
309
-			if (isset($GLOBALS['meta']['tables_config'])) {
310
-				$liste = unserialize($GLOBALS['meta']['tables_config']);
311
-				$cle = array_search($table, $liste);
312
-				if ($cle !== false) {
313
-					unset($liste[$cle]);
314
-					if ($liste) {
315
-						ecrire_meta('tables_config', serialize($liste));
316
-					} else {
317
-						effacer_meta('tables_config');
318
-					}
319
-				}
320
-			}
321
-		}
322
-	}
308
+            // Supprimer la table de la liste des tables de configuration autres que spip_meta
309
+            if (isset($GLOBALS['meta']['tables_config'])) {
310
+                $liste = unserialize($GLOBALS['meta']['tables_config']);
311
+                $cle = array_search($table, $liste);
312
+                if ($cle !== false) {
313
+                    unset($liste[$cle]);
314
+                    if ($liste) {
315
+                        ecrire_meta('tables_config', serialize($liste));
316
+                    } else {
317
+                        effacer_meta('tables_config');
318
+                    }
319
+                }
320
+            }
321
+        }
322
+    }
323 323
 }
Please login to merge, or discard this patch.
ecrire/balise/url_.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 function generer_generer_url_arg($type, $p, $_id) {
76 76
 	if ($s = trouver_nom_serveur_distant($p)) {
77 77
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
78
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
78
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
79 79
 			return $f($type, $_id, $s);
80 80
 		}
81 81
 		if (!$GLOBALS['connexions'][strtolower($s)]['spip_connect_version']) {
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 		# exception des urls de documents sur un serveur distant...
86 86
 		if ($type == 'document') {
87 87
 			return
88
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
89
-				"quete_meta('dir_img', $s) . \n\t" .
88
+				"quete_meta('adresse_site', $s) . '/' .\n\t".
89
+				"quete_meta('dir_img', $s) . \n\t".
90 90
 				"quete_fichier($_id,$s)";
91 91
 		}
92 92
 		$s = ", '', '', $s, quete_meta('type_urls', $s)";
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
  */
231 231
 function balise_URL_SITE_SPIP_dist($p) {
232 232
 	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
233
-	$p->code = 'spip_htmlspecialchars(' . $p->code . ')';
233
+	$p->code = 'spip_htmlspecialchars('.$p->code.')';
234 234
 	$p->interdire_scripts = false;
235 235
 
236 236
 	return $p;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	if ($s = trouver_nom_serveur_distant($p)) {
272 272
 		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
273 273
 		// elle devra aussi traiter le cas derogatoire type=page
274
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
274
+		if (function_exists($f = 'generer_generer_url_'.$s)) {
275 275
 			if ($args and $args !== "''") {
276 276
 				$code .= ", $args";
277 277
 			}
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			$p->code = $code;
280 280
 			return $p;
281 281
 		}
282
-		$s = 'connect=' . addslashes($s);
282
+		$s = 'connect='.addslashes($s);
283 283
 		$args = (($args and $args !== "''") ? "$args . '&$s'" : "'$s'");
284 284
 	}
285 285
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		$code = "generer_url_public($code, $args$noentities)";
295 295
 	}
296 296
 	$p->code = $code;
297
-	spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
297
+	spip_log("Calcul url page : connect vaut $s ca donne :".$p->code." args $args", _LOG_INFO);
298 298
 
299 299
 	#$p->interdire_scripts = true;
300 300
 	return $p;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			$fonc .= ",$args$noentities";
339 339
 		}
340 340
 	}
341
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
341
+	$p->code = 'generer_url_ecrire('.$fonc.')';
342 342
 	$p->interdire_scripts = false;
343 343
 
344 344
 	return $p;
@@ -373,17 +373,17 @@  discard block
 block discarded – undo
373 373
 
374 374
 	$args = interprete_argument_balise(2, $p);
375 375
 	if ($args != "''" && $args !== null) {
376
-		$p->code .= ',' . $args;
376
+		$p->code .= ','.$args;
377 377
 	}
378 378
 	$redirect = interprete_argument_balise(3, $p);
379 379
 	if ($redirect != "''" && $redirect !== null) {
380 380
 		if ($args == "''" || $args === null) {
381 381
 			$p->code .= ",''";
382 382
 		}
383
-		$p->code .= ',' . $redirect;
383
+		$p->code .= ','.$redirect;
384 384
 	}
385 385
 
386
-	$p->code = 'generer_action_auteur(' . $p->code . ')';
386
+	$p->code = 'generer_action_auteur('.$p->code.')';
387 387
 	$p->interdire_scripts = false;
388 388
 
389 389
 	return $p;
Please login to merge, or discard this patch.
Indentation   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  **/
20 20
 
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 /**
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
  *     Code compilé
38 38
  **/
39 39
 function generer_generer_url($type, $p) {
40
-	$_id = interprete_argument_balise(1, $p);
40
+    $_id = interprete_argument_balise(1, $p);
41 41
 
42
-	if (!$_id) {
43
-		$primary = id_table_objet($type);
44
-		$_id = champ_sql($primary, $p);
45
-	}
42
+    if (!$_id) {
43
+        $primary = id_table_objet($type);
44
+        $_id = champ_sql($primary, $p);
45
+    }
46 46
 
47
-	return generer_generer_url_arg($type, $p, $_id);
47
+    return generer_generer_url_arg($type, $p, $_id);
48 48
 }
49 49
 
50 50
 /**
@@ -73,28 +73,28 @@  discard block
 block discarded – undo
73 73
  *     Code compilé
74 74
  **/
75 75
 function generer_generer_url_arg($type, $p, $_id) {
76
-	if ($s = trouver_nom_serveur_distant($p)) {
77
-		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
78
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
79
-			return $f($type, $_id, $s);
80
-		}
81
-		if (!$GLOBALS['connexions'][strtolower($s)]['spip_connect_version']) {
82
-			return null;
83
-		}
84
-		$s = _q($s);
85
-		# exception des urls de documents sur un serveur distant...
86
-		if ($type == 'document') {
87
-			return
88
-				"quete_meta('adresse_site', $s) . '/' .\n\t" .
89
-				"quete_meta('dir_img', $s) . \n\t" .
90
-				"quete_fichier($_id,$s)";
91
-		}
92
-		$s = ", '', '', $s, quete_meta('type_urls', $s)";
93
-	} else {
94
-		$s = ", '', '', true";
95
-	}
96
-
97
-	return "urlencode_1738(generer_objet_url($_id, '$type'$s))";
76
+    if ($s = trouver_nom_serveur_distant($p)) {
77
+        // si une fonction de generation des url a ete definie pour ce connect l'utiliser
78
+        if (function_exists($f = 'generer_generer_url_' . $s)) {
79
+            return $f($type, $_id, $s);
80
+        }
81
+        if (!$GLOBALS['connexions'][strtolower($s)]['spip_connect_version']) {
82
+            return null;
83
+        }
84
+        $s = _q($s);
85
+        # exception des urls de documents sur un serveur distant...
86
+        if ($type == 'document') {
87
+            return
88
+                "quete_meta('adresse_site', $s) . '/' .\n\t" .
89
+                "quete_meta('dir_img', $s) . \n\t" .
90
+                "quete_fichier($_id,$s)";
91
+        }
92
+        $s = ", '', '', $s, quete_meta('type_urls', $s)";
93
+    } else {
94
+        $s = ", '', '', true";
95
+    }
96
+
97
+    return "urlencode_1738(generer_objet_url($_id, '$type'$s))";
98 98
 }
99 99
 
100 100
 
@@ -119,27 +119,27 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function balise_URL__dist($p) {
121 121
 
122
-	$nom = $p->nom_champ;
123
-	if ($nom === 'URL_') {
124
-		$msg = ['zbug_balise_sans_argument', ['balise' => ' URL_']];
125
-		erreur_squelette($msg, $p);
126
-		$p->interdire_scripts = false;
127
-
128
-		return $p;
129
-	} elseif ($f = charger_fonction($nom, 'balise', true)) {
130
-		return $f($p);
131
-	} else {
132
-		$nom = strtolower($nom);
133
-		$code = generer_generer_url(substr($nom, 4), $p);
134
-		$code = champ_sql($nom, $p, $code);
135
-		$p->code = $code;
136
-		if (!$p->etoile) {
137
-			$p->code = "vider_url($code)";
138
-		}
139
-		$p->interdire_scripts = false;
140
-
141
-		return $p;
142
-	}
122
+    $nom = $p->nom_champ;
123
+    if ($nom === 'URL_') {
124
+        $msg = ['zbug_balise_sans_argument', ['balise' => ' URL_']];
125
+        erreur_squelette($msg, $p);
126
+        $p->interdire_scripts = false;
127
+
128
+        return $p;
129
+    } elseif ($f = charger_fonction($nom, 'balise', true)) {
130
+        return $f($p);
131
+    } else {
132
+        $nom = strtolower($nom);
133
+        $code = generer_generer_url(substr($nom, 4), $p);
134
+        $code = champ_sql($nom, $p, $code);
135
+        $p->code = $code;
136
+        if (!$p->etoile) {
137
+            $p->code = "vider_url($code)";
138
+        }
139
+        $p->interdire_scripts = false;
140
+
141
+        return $p;
142
+    }
143 143
 }
144 144
 
145 145
 /**
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
  */
164 164
 function balise_URL_ARTICLE_dist($p) {
165 165
 
166
-	// Cas particulier des boucles (SYNDIC_ARTICLES)
167
-	if ($p->type_requete == 'syndic_articles') {
168
-		$code = champ_sql('url', $p);
169
-	} else {
170
-		$code = generer_generer_url('article', $p);
171
-	}
166
+    // Cas particulier des boucles (SYNDIC_ARTICLES)
167
+    if ($p->type_requete == 'syndic_articles') {
168
+        $code = champ_sql('url', $p);
169
+    } else {
170
+        $code = generer_generer_url('article', $p);
171
+    }
172 172
 
173
-	$p->code = $code;
174
-	if (!$p->etoile) {
175
-		$p->code = "vider_url($code)";
176
-	}
177
-	$p->interdire_scripts = false;
173
+    $p->code = $code;
174
+    if (!$p->etoile) {
175
+        $p->code = "vider_url($code)";
176
+    }
177
+    $p->interdire_scripts = false;
178 178
 
179
-	return $p;
179
+    return $p;
180 180
 }
181 181
 
182 182
 /**
@@ -196,21 +196,21 @@  discard block
 block discarded – undo
196 196
  *     Pile complétée par le code à générer
197 197
  */
198 198
 function balise_URL_SITE_dist($p) {
199
-	$code = champ_sql('url_site', $p, '');
200
-	if (!$code) {
201
-		$code = generer_generer_url('site', $p);
202
-		if ($code === null) {
203
-			return null;
204
-		}
205
-	} else {
206
-		if (!$p->etoile) {
207
-			$code = "calculer_url($code,'','url', \$connect)";
208
-		}
209
-	}
210
-	$p->code = $code;
211
-	$p->interdire_scripts = false;
212
-
213
-	return $p;
199
+    $code = champ_sql('url_site', $p, '');
200
+    if (!$code) {
201
+        $code = generer_generer_url('site', $p);
202
+        if ($code === null) {
203
+            return null;
204
+        }
205
+    } else {
206
+        if (!$p->etoile) {
207
+            $code = "calculer_url($code,'','url', \$connect)";
208
+        }
209
+    }
210
+    $p->code = $code;
211
+    $p->interdire_scripts = false;
212
+
213
+    return $p;
214 214
 }
215 215
 
216 216
 // Autres balises URL_*, qui ne concernent pas une table
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
  *     Pile complétée par le code à générer
230 230
  */
231 231
 function balise_URL_SITE_SPIP_dist($p) {
232
-	$p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
233
-	$p->code = 'spip_htmlspecialchars(' . $p->code . ')';
234
-	$p->interdire_scripts = false;
232
+    $p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')";
233
+    $p->code = 'spip_htmlspecialchars(' . $p->code . ')';
234
+    $p->interdire_scripts = false;
235 235
 
236
-	return $p;
236
+    return $p;
237 237
 }
238 238
 
239 239
 
@@ -262,42 +262,42 @@  discard block
 block discarded – undo
262 262
  */
263 263
 function balise_URL_PAGE_dist($p) {
264 264
 
265
-	$code = interprete_argument_balise(1, $p);
266
-	$args = interprete_argument_balise(2, $p);
267
-	if ($args == null) {
268
-		$args = "''";
269
-	}
270
-
271
-	if ($s = trouver_nom_serveur_distant($p)) {
272
-		// si une fonction de generation des url a ete definie pour ce connect l'utiliser
273
-		// elle devra aussi traiter le cas derogatoire type=page
274
-		if (function_exists($f = 'generer_generer_url_' . $s)) {
275
-			if ($args and $args !== "''") {
276
-				$code .= ", $args";
277
-			}
278
-			$code = $f('page', $code, $s);
279
-			$p->code = $code;
280
-			return $p;
281
-		}
282
-		$s = 'connect=' . addslashes($s);
283
-		$args = (($args and $args !== "''") ? "$args . '&$s'" : "'$s'");
284
-	}
285
-
286
-	if (!$code) {
287
-		$noentities = $p->etoile ? "'&'" : '';
288
-		$code = "url_de_base() . preg_replace(',^./,', '', self($noentities))";
289
-	} else {
290
-		if (!$args) {
291
-			$args = "''";
292
-		}
293
-		$noentities = $p->etoile ? ', true' : '';
294
-		$code = "generer_url_public($code, $args$noentities)";
295
-	}
296
-	$p->code = $code;
297
-	spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
298
-
299
-	#$p->interdire_scripts = true;
300
-	return $p;
265
+    $code = interprete_argument_balise(1, $p);
266
+    $args = interprete_argument_balise(2, $p);
267
+    if ($args == null) {
268
+        $args = "''";
269
+    }
270
+
271
+    if ($s = trouver_nom_serveur_distant($p)) {
272
+        // si une fonction de generation des url a ete definie pour ce connect l'utiliser
273
+        // elle devra aussi traiter le cas derogatoire type=page
274
+        if (function_exists($f = 'generer_generer_url_' . $s)) {
275
+            if ($args and $args !== "''") {
276
+                $code .= ", $args";
277
+            }
278
+            $code = $f('page', $code, $s);
279
+            $p->code = $code;
280
+            return $p;
281
+        }
282
+        $s = 'connect=' . addslashes($s);
283
+        $args = (($args and $args !== "''") ? "$args . '&$s'" : "'$s'");
284
+    }
285
+
286
+    if (!$code) {
287
+        $noentities = $p->etoile ? "'&'" : '';
288
+        $code = "url_de_base() . preg_replace(',^./,', '', self($noentities))";
289
+    } else {
290
+        if (!$args) {
291
+            $args = "''";
292
+        }
293
+        $noentities = $p->etoile ? ', true' : '';
294
+        $code = "generer_url_public($code, $args$noentities)";
295
+    }
296
+    $p->code = $code;
297
+    spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO);
298
+
299
+    #$p->interdire_scripts = true;
300
+    return $p;
301 301
 }
302 302
 
303 303
 
@@ -324,24 +324,24 @@  discard block
 block discarded – undo
324 324
  */
325 325
 function balise_URL_ECRIRE_dist($p) {
326 326
 
327
-	$code = interprete_argument_balise(1, $p);
328
-	if (!$code) {
329
-		$fonc = "''";
330
-	} else {
331
-		$fonc = $code;
332
-		$args = interprete_argument_balise(2, $p);
333
-		if ($args === null) {
334
-			$args = "''";
335
-		}
336
-		$noentities = $p->etoile ? ', true' : '';
337
-		if (($args != "''") or $noentities) {
338
-			$fonc .= ",$args$noentities";
339
-		}
340
-	}
341
-	$p->code = 'generer_url_ecrire(' . $fonc . ')';
342
-	$p->interdire_scripts = false;
343
-
344
-	return $p;
327
+    $code = interprete_argument_balise(1, $p);
328
+    if (!$code) {
329
+        $fonc = "''";
330
+    } else {
331
+        $fonc = $code;
332
+        $args = interprete_argument_balise(2, $p);
333
+        if ($args === null) {
334
+            $args = "''";
335
+        }
336
+        $noentities = $p->etoile ? ', true' : '';
337
+        if (($args != "''") or $noentities) {
338
+            $fonc .= ",$args$noentities";
339
+        }
340
+    }
341
+    $p->code = 'generer_url_ecrire(' . $fonc . ')';
342
+    $p->interdire_scripts = false;
343
+
344
+    return $p;
345 345
 }
346 346
 
347 347
 
@@ -367,24 +367,24 @@  discard block
 block discarded – undo
367 367
  *     Pile complétée par le code à générer
368 368
  */
369 369
 function balise_URL_ACTION_AUTEUR_dist($p) {
370
-	$p->descr['session'] = true;
371
-
372
-	$p->code = interprete_argument_balise(1, $p);
373
-
374
-	$args = interprete_argument_balise(2, $p);
375
-	if ($args != "''" && $args !== null) {
376
-		$p->code .= ',' . $args;
377
-	}
378
-	$redirect = interprete_argument_balise(3, $p);
379
-	if ($redirect != "''" && $redirect !== null) {
380
-		if ($args == "''" || $args === null) {
381
-			$p->code .= ",''";
382
-		}
383
-		$p->code .= ',' . $redirect;
384
-	}
385
-
386
-	$p->code = 'generer_action_auteur(' . $p->code . ')';
387
-	$p->interdire_scripts = false;
388
-
389
-	return $p;
370
+    $p->descr['session'] = true;
371
+
372
+    $p->code = interprete_argument_balise(1, $p);
373
+
374
+    $args = interprete_argument_balise(2, $p);
375
+    if ($args != "''" && $args !== null) {
376
+        $p->code .= ',' . $args;
377
+    }
378
+    $redirect = interprete_argument_balise(3, $p);
379
+    if ($redirect != "''" && $redirect !== null) {
380
+        if ($args == "''" || $args === null) {
381
+            $p->code .= ",''";
382
+        }
383
+        $p->code .= ',' . $redirect;
384
+    }
385
+
386
+    $p->code = 'generer_action_auteur(' . $p->code . ')';
387
+    $p->interdire_scripts = false;
388
+
389
+    return $p;
390 390
 }
Please login to merge, or discard this patch.
ecrire/balise/formulaire_ecrire_auteur.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 		);
87 87
 		foreach ($s as $row) {
88 88
 			if (email_valide($row['email'])) {
89
-				$r .= ', ' . $row['email'];
89
+				$r .= ', '.$row['email'];
90 90
 			}
91 91
 		}
92 92
 		$args[2] = substr($r, 2);
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  **/
17 17
 
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 include_spip('base/abstract_sql');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  *     Pile complétée du code compilé
41 41
  **/
42 42
 function balise_FORMULAIRE_ECRIRE_AUTEUR($p) {
43
-	return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', ['id_auteur', 'id_article', 'email']);
43
+    return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', ['id_auteur', 'id_article', 'email']);
44 44
 }
45 45
 
46 46
 /**
@@ -58,44 +58,44 @@  discard block
 block discarded – undo
58 58
  *   - chaîne vide sinon (erreur ou non affichage).
59 59
  */
60 60
 function balise_FORMULAIRE_ECRIRE_AUTEUR_stat($args, $context_compil) {
61
-	include_spip('inc/filtres');
62
-	// Pas d'id_auteur ni d'id_article ? Erreur de contexte
63
-	$id = (int) $args[1];
64
-	if (!$args[0] && !$id) {
65
-		$msg = [
66
-			'zbug_champ_hors_motif',
67
-			[
68
-				'champ' => 'FORMULAIRE_ECRIRE_AUTEUR',
69
-				'motif' => 'AUTEURS/ARTICLES'
70
-			]
71
-		];
61
+    include_spip('inc/filtres');
62
+    // Pas d'id_auteur ni d'id_article ? Erreur de contexte
63
+    $id = (int) $args[1];
64
+    if (!$args[0] && !$id) {
65
+        $msg = [
66
+            'zbug_champ_hors_motif',
67
+            [
68
+                'champ' => 'FORMULAIRE_ECRIRE_AUTEUR',
69
+                'motif' => 'AUTEURS/ARTICLES'
70
+            ]
71
+        ];
72 72
 
73
-		erreur_squelette($msg, $context_compil);
73
+        erreur_squelette($msg, $context_compil);
74 74
 
75
-		return '';
76
-	}
77
-	// Si on est dans un contexte article,
78
-	// sortir tous les mails des auteurs de l'article
79
-	if (!$args[0] && $id) {
80
-		$r = '';
81
-		$s = sql_allfetsel(
82
-			'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
-		);
86
-		foreach ($s as $row) {
87
-			if (email_valide($row['email'])) {
88
-				$r .= ', ' . $row['email'];
89
-			}
90
-		}
91
-		$args[2] = substr($r, 2);
92
-	}
75
+        return '';
76
+    }
77
+    // Si on est dans un contexte article,
78
+    // sortir tous les mails des auteurs de l'article
79
+    if (!$args[0] && $id) {
80
+        $r = '';
81
+        $s = sql_allfetsel(
82
+            '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
+        );
86
+        foreach ($s as $row) {
87
+            if (email_valide($row['email'])) {
88
+                $r .= ', ' . $row['email'];
89
+            }
90
+        }
91
+        $args[2] = substr($r, 2);
92
+    }
93 93
 
94
-	// On ne peut pas ecrire a un auteur dont le mail n'est pas valide
95
-	if (!$args[2] || !email_valide($args[2])) {
96
-		return '';
97
-	}
94
+    // On ne peut pas ecrire a un auteur dont le mail n'est pas valide
95
+    if (!$args[2] || !email_valide($args[2])) {
96
+        return '';
97
+    }
98 98
 
99
-	// OK
100
-	return $args;
99
+    // OK
100
+    return $args;
101 101
 }
Please login to merge, or discard this patch.
ecrire/charsets/iso-8859-1.php 1 patch
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -11,134 +11,134 @@
 block discarded – undo
11 11
 // plage invalide en iso-8859-1 mais souvent utilisee quand meme (windows)
12 12
 // cf. http://openweb.eu.org/articles/caracteres_illegaux/
13 13
 // voir aussi copie de ces valeurs dans inc/charsets.php
14
-	128 => 8364,
15
-	129 => 129 /* ?? */,
16
-	130 => 8218,
17
-	131 => 402,
18
-	132 => 8222,
19
-	133 => 8230,
20
-	134 => 8224,
21
-	135 => 8225,
22
-	136 => 710,
23
-	137 => 8240,
24
-	138 => 352,
25
-	139 => 8249,
26
-	140 => 338,
27
-	141 => 141 /* ?? */,
28
-	142 => 381,
29
-	143 => 143 /* ?? */,
30
-	144 => 144 /* ?? */,
31
-	145 => 8216,
32
-	146 => 8217,
33
-	147 => 8220,
34
-	148 => 8221,
35
-	149 => 8226,
36
-	150 => 8211,
37
-	151 => 8212,
38
-	152 => 732,
39
-	153 => 8482,
40
-	154 => 353,
41
-	155 => 8250,
42
-	156 => 339,
43
-	157 => 157 /* ?? */,
44
-	158 => 382,
45
-	159 => 376,
14
+    128 => 8364,
15
+    129 => 129 /* ?? */,
16
+    130 => 8218,
17
+    131 => 402,
18
+    132 => 8222,
19
+    133 => 8230,
20
+    134 => 8224,
21
+    135 => 8225,
22
+    136 => 710,
23
+    137 => 8240,
24
+    138 => 352,
25
+    139 => 8249,
26
+    140 => 338,
27
+    141 => 141 /* ?? */,
28
+    142 => 381,
29
+    143 => 143 /* ?? */,
30
+    144 => 144 /* ?? */,
31
+    145 => 8216,
32
+    146 => 8217,
33
+    147 => 8220,
34
+    148 => 8221,
35
+    149 => 8226,
36
+    150 => 8211,
37
+    151 => 8212,
38
+    152 => 732,
39
+    153 => 8482,
40
+    154 => 353,
41
+    155 => 8250,
42
+    156 => 339,
43
+    157 => 157 /* ?? */,
44
+    158 => 382,
45
+    159 => 376,
46 46
 
47
-	160 => 160,
48
-	161 => 161,
49
-	162 => 162,
50
-	163 => 163,
51
-	164 => 164,
52
-	165 => 165,
53
-	166 => 166,
54
-	167 => 167,
55
-	168 => 168,
56
-	169 => 169,
57
-	170 => 170,
58
-	171 => 171,
59
-	172 => 172,
60
-	173 => 173,
61
-	174 => 174,
62
-	175 => 175,
63
-	176 => 176,
64
-	177 => 177,
65
-	178 => 178,
66
-	179 => 179,
67
-	180 => 180,
68
-	181 => 181,
69
-	182 => 182,
70
-	183 => 183,
71
-	184 => 184,
72
-	185 => 185,
73
-	186 => 186,
74
-	187 => 187,
75
-	188 => 188,
76
-	189 => 189,
77
-	190 => 190,
78
-	191 => 191,
79
-	192 => 192,
80
-	193 => 193,
81
-	194 => 194,
82
-	195 => 195,
83
-	196 => 196,
84
-	197 => 197,
85
-	198 => 198,
86
-	199 => 199,
87
-	200 => 200,
88
-	201 => 201,
89
-	202 => 202,
90
-	203 => 203,
91
-	204 => 204,
92
-	205 => 205,
93
-	206 => 206,
94
-	207 => 207,
95
-	208 => 208,
96
-	209 => 209,
97
-	210 => 210,
98
-	211 => 211,
99
-	212 => 212,
100
-	213 => 213,
101
-	214 => 214,
102
-	215 => 215,
103
-	216 => 216,
104
-	217 => 217,
105
-	218 => 218,
106
-	219 => 219,
107
-	220 => 220,
108
-	221 => 221,
109
-	222 => 222,
110
-	223 => 223,
111
-	224 => 224,
112
-	225 => 225,
113
-	226 => 226,
114
-	227 => 227,
115
-	228 => 228,
116
-	229 => 229,
117
-	230 => 230,
118
-	231 => 231,
119
-	232 => 232,
120
-	233 => 233,
121
-	234 => 234,
122
-	235 => 235,
123
-	236 => 236,
124
-	237 => 237,
125
-	238 => 238,
126
-	239 => 239,
127
-	240 => 240,
128
-	241 => 241,
129
-	242 => 242,
130
-	243 => 243,
131
-	244 => 244,
132
-	245 => 245,
133
-	246 => 246,
134
-	247 => 247,
135
-	248 => 248,
136
-	249 => 249,
137
-	250 => 250,
138
-	251 => 251,
139
-	252 => 252,
140
-	253 => 253,
141
-	254 => 254,
142
-	255 => 255
47
+    160 => 160,
48
+    161 => 161,
49
+    162 => 162,
50
+    163 => 163,
51
+    164 => 164,
52
+    165 => 165,
53
+    166 => 166,
54
+    167 => 167,
55
+    168 => 168,
56
+    169 => 169,
57
+    170 => 170,
58
+    171 => 171,
59
+    172 => 172,
60
+    173 => 173,
61
+    174 => 174,
62
+    175 => 175,
63
+    176 => 176,
64
+    177 => 177,
65
+    178 => 178,
66
+    179 => 179,
67
+    180 => 180,
68
+    181 => 181,
69
+    182 => 182,
70
+    183 => 183,
71
+    184 => 184,
72
+    185 => 185,
73
+    186 => 186,
74
+    187 => 187,
75
+    188 => 188,
76
+    189 => 189,
77
+    190 => 190,
78
+    191 => 191,
79
+    192 => 192,
80
+    193 => 193,
81
+    194 => 194,
82
+    195 => 195,
83
+    196 => 196,
84
+    197 => 197,
85
+    198 => 198,
86
+    199 => 199,
87
+    200 => 200,
88
+    201 => 201,
89
+    202 => 202,
90
+    203 => 203,
91
+    204 => 204,
92
+    205 => 205,
93
+    206 => 206,
94
+    207 => 207,
95
+    208 => 208,
96
+    209 => 209,
97
+    210 => 210,
98
+    211 => 211,
99
+    212 => 212,
100
+    213 => 213,
101
+    214 => 214,
102
+    215 => 215,
103
+    216 => 216,
104
+    217 => 217,
105
+    218 => 218,
106
+    219 => 219,
107
+    220 => 220,
108
+    221 => 221,
109
+    222 => 222,
110
+    223 => 223,
111
+    224 => 224,
112
+    225 => 225,
113
+    226 => 226,
114
+    227 => 227,
115
+    228 => 228,
116
+    229 => 229,
117
+    230 => 230,
118
+    231 => 231,
119
+    232 => 232,
120
+    233 => 233,
121
+    234 => 234,
122
+    235 => 235,
123
+    236 => 236,
124
+    237 => 237,
125
+    238 => 238,
126
+    239 => 239,
127
+    240 => 240,
128
+    241 => 241,
129
+    242 => 242,
130
+    243 => 243,
131
+    244 => 244,
132
+    245 => 245,
133
+    246 => 246,
134
+    247 => 247,
135
+    248 => 248,
136
+    249 => 249,
137
+    250 => 250,
138
+    251 => 251,
139
+    252 => 252,
140
+    253 => 253,
141
+    254 => 254,
142
+    255 => 255
143 143
 
144 144
 ];
Please login to merge, or discard this patch.
ecrire/charsets/iso-8859-6.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  **/
20 20
 
21 21
 if (!defined('_ECRIRE_INC_VERSION')) {
22
-	return;
22
+    return;
23 23
 }
24 24
 
25 25
 load_charset('iso-8859-1');
@@ -27,61 +27,61 @@  discard block
 block discarded – undo
27 27
 $trans = $GLOBALS['CHARSET']['iso-8859-1'];
28 28
 
29 29
 $mod = [
30
-	0xA0 => 0x00A0,
31
-	0xA4 => 0x00A4,
32
-	0xAC => 0x060C,
33
-	0xAD => 0x00AD,
34
-	0xBB => 0x061B,
35
-	0xBF => 0x061F,
36
-	0xC1 => 0x0621,
37
-	0xC2 => 0x0622,
38
-	0xC3 => 0x0623,
39
-	0xC4 => 0x0624,
40
-	0xC5 => 0x0625,
41
-	0xC6 => 0x0626,
42
-	0xC7 => 0x0627,
43
-	0xC8 => 0x0628,
44
-	0xC9 => 0x0629,
45
-	0xCA => 0x062A,
46
-	0xCB => 0x062B,
47
-	0xCC => 0x062C,
48
-	0xCD => 0x062D,
49
-	0xCE => 0x062E,
50
-	0xCF => 0x062F,
51
-	0xD0 => 0x0630,
52
-	0xD1 => 0x0631,
53
-	0xD2 => 0x0632,
54
-	0xD3 => 0x0633,
55
-	0xD4 => 0x0634,
56
-	0xD5 => 0x0635,
57
-	0xD6 => 0x0636,
58
-	0xD7 => 0x0637,
59
-	0xD8 => 0x0638,
60
-	0xD9 => 0x0639,
61
-	0xDA => 0x063A,
62
-	0xE0 => 0x0640,
63
-	0xE1 => 0x0641,
64
-	0xE2 => 0x0642,
65
-	0xE3 => 0x0643,
66
-	0xE4 => 0x0644,
67
-	0xE5 => 0x0645,
68
-	0xE6 => 0x0646,
69
-	0xE7 => 0x0647,
70
-	0xE8 => 0x0648,
71
-	0xE9 => 0x0649,
72
-	0xEA => 0x064A,
73
-	0xEB => 0x064B,
74
-	0xEC => 0x064C,
75
-	0xED => 0x064D,
76
-	0xEE => 0x064E,
77
-	0xEF => 0x064F,
78
-	0xF0 => 0x0650,
79
-	0xF1 => 0x0651,
80
-	0xF2 => 0x0652
30
+    0xA0 => 0x00A0,
31
+    0xA4 => 0x00A4,
32
+    0xAC => 0x060C,
33
+    0xAD => 0x00AD,
34
+    0xBB => 0x061B,
35
+    0xBF => 0x061F,
36
+    0xC1 => 0x0621,
37
+    0xC2 => 0x0622,
38
+    0xC3 => 0x0623,
39
+    0xC4 => 0x0624,
40
+    0xC5 => 0x0625,
41
+    0xC6 => 0x0626,
42
+    0xC7 => 0x0627,
43
+    0xC8 => 0x0628,
44
+    0xC9 => 0x0629,
45
+    0xCA => 0x062A,
46
+    0xCB => 0x062B,
47
+    0xCC => 0x062C,
48
+    0xCD => 0x062D,
49
+    0xCE => 0x062E,
50
+    0xCF => 0x062F,
51
+    0xD0 => 0x0630,
52
+    0xD1 => 0x0631,
53
+    0xD2 => 0x0632,
54
+    0xD3 => 0x0633,
55
+    0xD4 => 0x0634,
56
+    0xD5 => 0x0635,
57
+    0xD6 => 0x0636,
58
+    0xD7 => 0x0637,
59
+    0xD8 => 0x0638,
60
+    0xD9 => 0x0639,
61
+    0xDA => 0x063A,
62
+    0xE0 => 0x0640,
63
+    0xE1 => 0x0641,
64
+    0xE2 => 0x0642,
65
+    0xE3 => 0x0643,
66
+    0xE4 => 0x0644,
67
+    0xE5 => 0x0645,
68
+    0xE6 => 0x0646,
69
+    0xE7 => 0x0647,
70
+    0xE8 => 0x0648,
71
+    0xE9 => 0x0649,
72
+    0xEA => 0x064A,
73
+    0xEB => 0x064B,
74
+    0xEC => 0x064C,
75
+    0xED => 0x064D,
76
+    0xEE => 0x064E,
77
+    0xEF => 0x064F,
78
+    0xF0 => 0x0650,
79
+    0xF1 => 0x0651,
80
+    0xF2 => 0x0652
81 81
 ];
82 82
 
83 83
 foreach ($mod as $num => $val) {
84
-	$trans[$num] = $val;
84
+    $trans[$num] = $val;
85 85
 }
86 86
 
87 87
 $GLOBALS['CHARSET']['iso-8859-6'] = $trans;
Please login to merge, or discard this patch.
ecrire/charsets/translitcomplexe.php 1 patch
Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  **/
21 21
 
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 load_charset('translit');
@@ -28,151 +28,151 @@  discard block
 block discarded – undo
28 28
 
29 29
 $translit_c = [
30 30
 // vietnamien
31
-	225 => "a'",
32
-	224 => 'a`',
33
-	7843 => 'a?',
34
-	227 => 'a~',
35
-	7841 => 'a.',
36
-	226 => 'a^',
37
-	7845 => "a^'",
38
-	7847 => 'a^`',
39
-	7849 => 'a^?',
40
-	7851 => 'a^~',
41
-	7853 => 'a^.',
42
-	259 => 'a(',
43
-	7855 => "a('",
44
-	7857 => 'a(`',
45
-	7859 => 'a(?',
46
-	7861 => 'a(~',
47
-	7863 => 'a(.',
48
-	193 => "A'",
49
-	192 => 'A`',
50
-	7842 => 'A?',
51
-	195 => 'A~',
52
-	7840 => 'A.',
53
-	194 => 'A^',
54
-	7844 => "A^'",
55
-	7846 => 'A^`',
56
-	7848 => 'A^?',
57
-	7850 => 'A^~',
58
-	7852 => 'A^.',
59
-	258 => 'A(',
60
-	7854 => "A('",
61
-	7856 => 'A(`',
62
-	7858 => 'A(?',
63
-	7860 => 'A(~',
64
-	7862 => 'A(.',
65
-	233 => "e'",
66
-	232 => 'e`',
67
-	7867 => 'e?',
68
-	7869 => 'e~',
69
-	7865 => 'e.',
70
-	234 => 'e^',
71
-	7871 => "e^'",
72
-	7873 => 'e^`',
73
-	7875 => 'e^?',
74
-	7877 => 'e^~',
75
-	7879 => 'e^.',
76
-	201 => "E'",
77
-	200 => 'E`',
78
-	7866 => 'E?',
79
-	7868 => 'E~',
80
-	7864 => 'E.',
81
-	202 => 'E^',
82
-	7870 => "E^'",
83
-	7872 => 'E^`',
84
-	7874 => 'E^?',
85
-	7876 => 'E^~',
86
-	7878 => 'E^.',
87
-	237 => "i'",
88
-	236 => 'i`',
89
-	7881 => 'i?',
90
-	297 => 'i~',
91
-	7883 => 'i.',
92
-	205 => "I'",
93
-	204 => 'I`',
94
-	7880 => 'I?',
95
-	296 => 'I~',
96
-	7882 => 'I.',
97
-	243 => "o'",
98
-	242 => 'o`',
99
-	7887 => 'o?',
100
-	245 => 'o~',
101
-	7885 => 'o.',
102
-	244 => 'o^',
103
-	7889 => "o^'",
104
-	7891 => 'o^`',
105
-	7893 => 'o^?',
106
-	7895 => 'o^~',
107
-	7897 => 'o^.',
108
-	417 => 'o+',
109
-	7899 => "o+'",
110
-	7901 => 'o+`',
111
-	7903 => 'o+?',
112
-	7905 => 'o+~',
113
-	7907 => 'o+.',
114
-	211 => "O'",
115
-	210 => 'O`',
116
-	7886 => 'O?',
117
-	213 => 'O~',
118
-	7884 => 'O.',
119
-	212 => 'O^',
120
-	7888 => "O^'",
121
-	7890 => 'O^`',
122
-	7892 => 'O^?',
123
-	7894 => 'O^~',
124
-	7896 => 'O^.',
125
-	416 => 'O+',
126
-	7898 => "O+'",
127
-	7900 => 'O+`',
128
-	7902 => 'O+?',
129
-	7904 => 'O+~',
130
-	7906 => 'O+.',
131
-	250 => "u'",
132
-	249 => 'u`',
133
-	7911 => 'u?',
134
-	361 => 'u~',
135
-	7909 => 'u.',
136
-	432 => 'u+',
137
-	7913 => "u+'",
138
-	7915 => 'u+`',
139
-	7917 => 'u+?',
140
-	7919 => 'u+~',
141
-	7921 => 'u+.',
142
-	218 => "U'",
143
-	217 => 'U`',
144
-	7910 => 'U?',
145
-	360 => 'U~',
146
-	7908 => 'U.',
147
-	431 => 'U+',
148
-	7912 => "U+'",
149
-	7914 => 'U+`',
150
-	7916 => 'U+?',
151
-	7918 => 'U+~',
152
-	7920 => 'U+.',
153
-	253 => "y'",
154
-	7923 => 'y`',
155
-	7927 => 'y?',
156
-	7929 => 'y~',
157
-	7925 => 'y.',
158
-	221 => "Y'",
159
-	7922 => 'Y`',
160
-	7926 => 'Y?',
161
-	7928 => 'Y~',
162
-	7924 => 'Y.',
163
-	273 => 'd-',
164
-	208 => 'D-',
31
+    225 => "a'",
32
+    224 => 'a`',
33
+    7843 => 'a?',
34
+    227 => 'a~',
35
+    7841 => 'a.',
36
+    226 => 'a^',
37
+    7845 => "a^'",
38
+    7847 => 'a^`',
39
+    7849 => 'a^?',
40
+    7851 => 'a^~',
41
+    7853 => 'a^.',
42
+    259 => 'a(',
43
+    7855 => "a('",
44
+    7857 => 'a(`',
45
+    7859 => 'a(?',
46
+    7861 => 'a(~',
47
+    7863 => 'a(.',
48
+    193 => "A'",
49
+    192 => 'A`',
50
+    7842 => 'A?',
51
+    195 => 'A~',
52
+    7840 => 'A.',
53
+    194 => 'A^',
54
+    7844 => "A^'",
55
+    7846 => 'A^`',
56
+    7848 => 'A^?',
57
+    7850 => 'A^~',
58
+    7852 => 'A^.',
59
+    258 => 'A(',
60
+    7854 => "A('",
61
+    7856 => 'A(`',
62
+    7858 => 'A(?',
63
+    7860 => 'A(~',
64
+    7862 => 'A(.',
65
+    233 => "e'",
66
+    232 => 'e`',
67
+    7867 => 'e?',
68
+    7869 => 'e~',
69
+    7865 => 'e.',
70
+    234 => 'e^',
71
+    7871 => "e^'",
72
+    7873 => 'e^`',
73
+    7875 => 'e^?',
74
+    7877 => 'e^~',
75
+    7879 => 'e^.',
76
+    201 => "E'",
77
+    200 => 'E`',
78
+    7866 => 'E?',
79
+    7868 => 'E~',
80
+    7864 => 'E.',
81
+    202 => 'E^',
82
+    7870 => "E^'",
83
+    7872 => 'E^`',
84
+    7874 => 'E^?',
85
+    7876 => 'E^~',
86
+    7878 => 'E^.',
87
+    237 => "i'",
88
+    236 => 'i`',
89
+    7881 => 'i?',
90
+    297 => 'i~',
91
+    7883 => 'i.',
92
+    205 => "I'",
93
+    204 => 'I`',
94
+    7880 => 'I?',
95
+    296 => 'I~',
96
+    7882 => 'I.',
97
+    243 => "o'",
98
+    242 => 'o`',
99
+    7887 => 'o?',
100
+    245 => 'o~',
101
+    7885 => 'o.',
102
+    244 => 'o^',
103
+    7889 => "o^'",
104
+    7891 => 'o^`',
105
+    7893 => 'o^?',
106
+    7895 => 'o^~',
107
+    7897 => 'o^.',
108
+    417 => 'o+',
109
+    7899 => "o+'",
110
+    7901 => 'o+`',
111
+    7903 => 'o+?',
112
+    7905 => 'o+~',
113
+    7907 => 'o+.',
114
+    211 => "O'",
115
+    210 => 'O`',
116
+    7886 => 'O?',
117
+    213 => 'O~',
118
+    7884 => 'O.',
119
+    212 => 'O^',
120
+    7888 => "O^'",
121
+    7890 => 'O^`',
122
+    7892 => 'O^?',
123
+    7894 => 'O^~',
124
+    7896 => 'O^.',
125
+    416 => 'O+',
126
+    7898 => "O+'",
127
+    7900 => 'O+`',
128
+    7902 => 'O+?',
129
+    7904 => 'O+~',
130
+    7906 => 'O+.',
131
+    250 => "u'",
132
+    249 => 'u`',
133
+    7911 => 'u?',
134
+    361 => 'u~',
135
+    7909 => 'u.',
136
+    432 => 'u+',
137
+    7913 => "u+'",
138
+    7915 => 'u+`',
139
+    7917 => 'u+?',
140
+    7919 => 'u+~',
141
+    7921 => 'u+.',
142
+    218 => "U'",
143
+    217 => 'U`',
144
+    7910 => 'U?',
145
+    360 => 'U~',
146
+    7908 => 'U.',
147
+    431 => 'U+',
148
+    7912 => "U+'",
149
+    7914 => 'U+`',
150
+    7916 => 'U+?',
151
+    7918 => 'U+~',
152
+    7920 => 'U+.',
153
+    253 => "y'",
154
+    7923 => 'y`',
155
+    7927 => 'y?',
156
+    7929 => 'y~',
157
+    7925 => 'y.',
158
+    221 => "Y'",
159
+    7922 => 'Y`',
160
+    7926 => 'Y?',
161
+    7928 => 'Y~',
162
+    7924 => 'Y.',
163
+    273 => 'd-',
164
+    208 => 'D-',
165 165
 
166 166
 // allemand
167
-	228 => 'ae',
168
-	246 => 'oe',
169
-	252 => 'ue',
170
-	196 => 'Ae',
171
-	214 => 'Oe',
172
-	220 => 'Ue'
167
+    228 => 'ae',
168
+    246 => 'oe',
169
+    252 => 'ue',
170
+    196 => 'Ae',
171
+    214 => 'Oe',
172
+    220 => 'Ue'
173 173
 ];
174 174
 
175 175
 foreach ($translit_c as $u => $t) {
176
-	$trans[$u] = $t;
176
+    $trans[$u] = $t;
177 177
 }
178 178
 $GLOBALS['CHARSET']['translitcomplexe'] = $trans;
Please login to merge, or discard this patch.