Completed
Push — spip-3.0 ( fca166...29aaca )
by cam
07:01
created
ecrire/maj/v011.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 	if (upgrade_vers(1.1, $version_installee, $version_cible)) {
20 20
 		spip_query("DROP TABLE spip_petition");
21 21
 		spip_query("DROP TABLE spip_signatures_petition");
22
-		maj_version (1.1);
22
+		maj_version(1.1);
23 23
 	}
24 24
 }
25 25
 
Please login to merge, or discard this patch.
ecrire/maj/v012.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		spip_query("ALTER TABLE spip_auteurs ADD en_ligne datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
23 23
 		spip_query("ALTER TABLE spip_auteurs ADD imessage VARCHAR(3) not null");
24 24
 		spip_query("ALTER TABLE spip_auteurs ADD messagerie VARCHAR(3) not null");
25
-		maj_version (1.204);
25
+		maj_version(1.204);
26 26
 	}
27 27
 
28 28
 	if (upgrade_vers(1.207, $version_installee, $version_cible)) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		// Declencher le calcul des rubriques publiques
33 33
 		include_spip('inc/rubriques');
34 34
 		calculer_rubriques();
35
-		maj_version (1.207);
35
+		maj_version(1.207);
36 36
 	}
37 37
 
38 38
 	if (upgrade_vers(1.208, $version_installee, $version_cible)) {
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
 		}
51 51
 
52 52
 		spip_query("ALTER TABLE spip_auteurs_messages DROP statut");
53
-		maj_version (1.208);
53
+		maj_version(1.208);
54 54
 	}
55 55
 
56 56
 	if (upgrade_vers(1.209, $version_installee, $version_cible)) {
57 57
 		spip_query("ALTER TABLE spip_syndic ADD maj TIMESTAMP");
58 58
 		spip_query("ALTER TABLE spip_syndic_articles ADD maj TIMESTAMP");
59 59
 		spip_query("ALTER TABLE spip_messages ADD maj TIMESTAMP");
60
-		maj_version (1.209);
60
+		maj_version(1.209);
61 61
 	}
62 62
 
63 63
 	if (upgrade_vers(1.210, $version_installee, $version_cible)) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		stripslashes_base('spip_signatures', array('nom_email', 'nom_site', 'message'));
75 75
 		stripslashes_base('spip_syndic', array('nom_site', 'descriptif'));
76 76
 		stripslashes_base('spip_syndic_articles', array('titre', 'lesauteurs'));
77
-		maj_version (1.210);
77
+		maj_version(1.210);
78 78
 	}
79 79
 }
80 80
 
Please login to merge, or discard this patch.
ecrire/maj/v009.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		spip_query("ALTER TABLE spip_forum ADD maj TIMESTAMP");
43 43
 		spip_query("ALTER TABLE spip_forum DROP INDEX id_forum");
44 44
 		spip_query("ALTER TABLE spip_forum ADD INDEX id_parent (id_parent), ADD INDEX id_rubrique (id_rubrique), ADD INDEX id_article(id_article), ADD INDEX id_breve(id_breve)");
45
-		maj_version (0.98);
45
+		maj_version(0.98);
46 46
 	}
47 47
 
48 48
 	if (upgrade_vers(0.99, $version_installee, $version_cible)) {
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 			spip_query("UPDATE spip_forum SET id_rubrique=$id_rubrique WHERE id_forum IN ($forums_rubrique)");
103 103
 
104 104
 		}
105
-		maj_version (0.99);
105
+		maj_version(0.99);
106 106
 	}
107 107
 
108 108
 	if (upgrade_vers(0.997, $version_installee, $version_cible)) {
109 109
 		spip_query("DROP TABLE spip_index");
110
-		maj_version (0.997);
110
+		maj_version(0.997);
111 111
 	}
112 112
 
113 113
 	if (upgrade_vers(0.999, $version_installee, $version_cible)) {
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 		spip_query("ALTER TABLE spip_auteurs ADD htpass tinyblob NOT NULL");
117 117
 		$result = spip_query("SELECT id_auteur, pass FROM spip_auteurs WHERE pass!=''");
118 118
 
119
-		while ($r= sql_fetch($result)) {
119
+		while ($r = sql_fetch($result)) {
120 120
 			$htpass = generer_htpass($r['pass']);
121 121
 			$pass = md5($pass);
122
-			spip_query("UPDATE spip_auteurs SET pass='$pass', htpass='$htpass' WHERE id_auteur=" . $r['id_auteur']);
122
+			spip_query("UPDATE spip_auteurs SET pass='$pass', htpass='$htpass' WHERE id_auteur=".$r['id_auteur']);
123 123
 		}
124
-		maj_version (0.999);
124
+		maj_version(0.999);
125 125
 	}
126 126
 }
127 127
 
Please login to merge, or discard this patch.
ecrire/maj/v014.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		spip_query("UPDATE spip_mots SET type='Mots sans groupe...' WHERE type=''");
21 21
 
22 22
 		$result = spip_query("SELECT * FROM spip_mots GROUP BY type");
23
-		while($row = sql_fetch($result)) {
23
+		while ($row = sql_fetch($result)) {
24 24
 				$type = addslashes($row['type']);
25 25
 				// Old style, doit echouer
26 26
 				spip_log('ne pas tenir compte de l erreur spip_groupes_mots ci-dessous:', 'mysql');
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
 				spip_query("INSERT INTO spip_groupes_mots 					(titre, unseul, obligatoire, articles, breves, rubriques, syndic, minirezo, comite, forum)					VALUES (\"$type\", 'non', 'non', 'oui', 'oui', 'non', 'oui', 'oui', 'oui', 'non')");
30 30
 		}
31 31
 		sql_delete("spip_mots", "titre='kawax'");
32
-		maj_version (1.404);
32
+		maj_version(1.404);
33 33
 	}
34 34
 
35 35
 	if (upgrade_vers(1.405, $version_installee, $version_cible)) {
36 36
 		spip_query("ALTER TABLE spip_mots ADD id_groupe bigint(21) NOT NULL");
37 37
 	
38 38
 		$result = spip_query("SELECT * FROM spip_groupes_mots");
39
-		while($row = sql_fetch($result)) {
39
+		while ($row = sql_fetch($result)) {
40 40
 				$id_groupe = addslashes($row['id_groupe']);
41 41
 				$type = addslashes($row['titre']);
42 42
 				spip_query("UPDATE spip_mots SET id_groupe = '$id_groupe' WHERE type='$type'");
43 43
 		}
44
-		maj_version (1.405);
44
+		maj_version(1.405);
45 45
 	}
46 46
 
47 47
 	if (upgrade_vers(1.408, $version_installee, $version_cible)) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 				preg_match(",-([0-9]+)\.(gif|jpg|png)$,i", $fichier, $match);
66 66
 				$id_type = intval($types[$match[2]]);
67 67
 				$num_img = $match[1];
68
-				$fichier = _DIR_IMG . $fichier;
68
+				$fichier = _DIR_IMG.$fichier;
69 69
 				$taille = @filesize($fichier);
70 70
 				// ici on n'a pas les fonctions absctract !
71 71
 				$s = spip_query("INSERT INTO spip_documents (titre, id_type, fichier, mode, largeur, hauteur, taille) VALUES ('image $largeur x $hauteur', $id_type, '$fichier', 'vignette', '$largeur', '$hauteur', '$taille')");
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 
88 88
 		}
89 89
 		spip_query("ALTER TABLE spip_articles DROP images");
90
-		maj_version (1.408);
90
+		maj_version(1.408);
91 91
 	}
92 92
 
93 93
 	if (upgrade_vers(1.414, $version_installee, $version_cible)) {
94 94
 		// Forum par defaut "en dur" dans les spip_articles
95 95
 		// -> non, prio (priori), pos (posteriori), abo (abonnement)
96
-		$accepter_forum = substr($GLOBALS['meta']["forums_publics"],0,3) ;
96
+		$accepter_forum = substr($GLOBALS['meta']["forums_publics"], 0, 3);
97 97
 		$result = spip_query("ALTER TABLE spip_articles CHANGE accepter_forum accepter_forum CHAR(3) NOT NULL");
98 98
 
99 99
 		$result = spip_query("UPDATE spip_articles SET accepter_forum='$accepter_forum' WHERE accepter_forum != 'non'");
100 100
 
101
-		maj_version (1.414);
101
+		maj_version(1.414);
102 102
 	}
103 103
 
104 104
 	/*
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	if (upgrade_vers(1.417, $version_installee, $version_cible)) {
112 112
 		spip_query("ALTER TABLE spip_syndic_articles DROP date_index");
113
-		maj_version (1.417);
113
+		maj_version(1.417);
114 114
 	}
115 115
 
116 116
 	if (upgrade_vers(1.418, $version_installee, $version_cible)) {
@@ -119,49 +119,49 @@  discard block
 block discarded – undo
119 119
 		if ($webmaster = sql_fetch($result)) {
120 120
 			ecrire_meta('email_webmaster', $webmaster['email']);
121 121
 		}
122
-		maj_version (1.418);
122
+		maj_version(1.418);
123 123
 	}
124 124
 
125 125
 	if (upgrade_vers(1.419, $version_installee, $version_cible)) {
126 126
 		spip_query("ALTER TABLE spip_auteurs ADD alea_actuel TINYTEXT DEFAULT ''");
127 127
 		spip_query("ALTER TABLE spip_auteurs ADD alea_futur TINYTEXT DEFAULT ''");
128 128
 		spip_query("UPDATE spip_auteurs SET alea_futur = FLOOR(32000*RAND())");
129
-		maj_version (1.419);
129
+		maj_version(1.419);
130 130
 	}
131 131
 
132 132
 	if (upgrade_vers(1.420, $version_installee, $version_cible)) {
133 133
 		spip_query("UPDATE spip_auteurs SET alea_actuel='' WHERE statut='nouveau'");
134
-		maj_version (1.420);
134
+		maj_version(1.420);
135 135
 	}
136 136
 	
137 137
 	if (upgrade_vers(1.421, $version_installee, $version_cible)) {
138 138
 		spip_query("ALTER TABLE spip_articles ADD auteur_modif bigint(21) DEFAULT '0' NOT NULL");
139 139
 		spip_query("ALTER TABLE spip_articles ADD date_modif datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
140
-		maj_version (1.421);
140
+		maj_version(1.421);
141 141
 	}
142 142
 
143 143
 	if (upgrade_vers(1.432, $version_installee, $version_cible)) {
144 144
 		spip_query("ALTER TABLE spip_articles DROP referers");
145 145
 		spip_query("ALTER TABLE spip_articles ADD referers INTEGER DEFAULT '0' NOT NULL");
146 146
 		spip_query("ALTER TABLE spip_articles ADD popularite INTEGER DEFAULT '0' NOT NULL");
147
-		maj_version (1.432);
147
+		maj_version(1.432);
148 148
 	}
149 149
 
150 150
 	if (upgrade_vers(1.436, $version_installee, $version_cible)) {
151 151
 		spip_query("ALTER TABLE spip_documents ADD date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
152
-		maj_version (1.436);
152
+		maj_version(1.436);
153 153
 	}
154 154
 
155 155
 	if (upgrade_vers(1.437, $version_installee, $version_cible)) {
156 156
 		spip_query("ALTER TABLE spip_visites ADD maj TIMESTAMP");
157 157
 		spip_query("ALTER TABLE spip_visites_referers ADD maj TIMESTAMP");
158
-		maj_version (1.437);
158
+		maj_version(1.437);
159 159
 	}
160 160
 
161 161
 	if (upgrade_vers(1.438, $version_installee, $version_cible)) {
162 162
 		spip_query("ALTER TABLE spip_articles ADD INDEX id_secteur (id_secteur)");
163 163
 		spip_query("ALTER TABLE spip_articles ADD INDEX statut (statut, date)");
164
-		maj_version (1.438);
164
+		maj_version(1.438);
165 165
 	}
166 166
 
167 167
 	if (upgrade_vers(1.439, $version_installee, $version_cible)) {
@@ -169,24 +169,24 @@  discard block
 block discarded – undo
169 169
 		spip_query("ALTER TABLE spip_syndic_articles ADD INDEX statut (statut)");
170 170
 		spip_query("ALTER TABLE spip_syndic_articles CHANGE url url VARCHAR(255) NOT NULL");
171 171
 		spip_query("ALTER TABLE spip_syndic_articles ADD INDEX url (url)");
172
-		maj_version (1.439);
172
+		maj_version(1.439);
173 173
 	}
174 174
 
175 175
 	if (upgrade_vers(1.440, $version_installee, $version_cible)) {
176 176
 		spip_query("ALTER TABLE spip_visites_temp CHANGE ip ip INTEGER UNSIGNED NOT NULL");
177
-		maj_version (1.440);
177
+		maj_version(1.440);
178 178
 	}
179 179
 
180 180
 	if (upgrade_vers(1.441, $version_installee, $version_cible)) {
181 181
 		spip_query("ALTER TABLE spip_visites_temp CHANGE date date DATE NOT NULL");
182 182
 		spip_query("ALTER TABLE spip_visites CHANGE date date DATE NOT NULL");
183 183
 		spip_query("ALTER TABLE spip_visites_referers CHANGE date date DATE NOT NULL");
184
-		maj_version (1.441);
184
+		maj_version(1.441);
185 185
 	}
186 186
 
187 187
 	if (upgrade_vers(1.442, $version_installee, $version_cible)) {
188 188
 		spip_query("ALTER TABLE spip_auteurs ADD prefs TINYTEXT NOT NULL");
189
-		maj_version (1.442);
189
+		maj_version(1.442);
190 190
 	}
191 191
 
192 192
 	if (upgrade_vers(1.443, $version_installee, $version_cible)) {
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 		spip_query("ALTER TABLE spip_auteurs CHANGE statut statut VARCHAR(255) NOT NULL");
195 195
 		spip_query("ALTER TABLE spip_auteurs ADD INDEX login (login)");
196 196
 		spip_query("ALTER TABLE spip_auteurs ADD INDEX statut (statut)");
197
-		maj_version (1.443);
197
+		maj_version(1.443);
198 198
 	}
199 199
 
200 200
 	if (upgrade_vers(1.444, $version_installee, $version_cible)) {
201 201
 		spip_query("ALTER TABLE spip_syndic ADD moderation VARCHAR(3) NOT NULL");
202
-		maj_version (1.444);
202
+		maj_version(1.444);
203 203
 	}
204 204
 
205 205
 	if (upgrade_vers(1.457, $version_installee, $version_cible)) {
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
 		spip_query("DROP TABLE spip_visites_temp");
208 208
 		spip_query("DROP TABLE spip_visites_referers");
209 209
 		creer_base(); // crade, a ameliorer :-((
210
-		maj_version (1.457);
210
+		maj_version(1.457);
211 211
 	}
212 212
 
213 213
 	if (upgrade_vers(1.458, $version_installee, $version_cible)) {
214 214
 		spip_query("ALTER TABLE spip_auteurs ADD cookie_oubli TINYTEXT NOT NULL");
215
-		maj_version (1.458);
215
+		maj_version(1.458);
216 216
 	}
217 217
 
218 218
 	if (upgrade_vers(1.459, $version_installee, $version_cible)) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			}
228 228
 		}
229 229
 		spip_query("UPDATE spip_articles SET popularite=0");
230
-		maj_version (1.459);
230
+		maj_version(1.459);
231 231
 	}
232 232
 
233 233
 	if (upgrade_vers(1.460, $version_installee, $version_cible)) {
@@ -237,26 +237,26 @@  discard block
 block discarded – undo
237 237
 		$result = spip_query("SELECT * FROM spip_groupes_mots ORDER BY id_groupe");
238 238
 		while ($row = sql_fetch($result)) {
239 239
 			$titre = addslashes($row['titre']);
240
-			if (! $vu[$titre] ) {
240
+			if (!$vu[$titre]) {
241 241
 				$vu[$titre] = true;
242 242
 				$id_groupe = $row['id_groupe'];
243 243
 				spip_query("UPDATE spip_mots SET id_groupe=$id_groupe WHERE type='$titre'");
244 244
 				sql_delete("spip_groupes_mots", "titre='$titre' AND id_groupe<>$id_groupe");
245 245
 			}
246 246
 		}
247
-		maj_version (1.460);
247
+		maj_version(1.460);
248 248
 	}
249 249
 
250 250
 	if (upgrade_vers(1.462, $version_installee, $version_cible)) {
251 251
 		spip_query("UPDATE spip_types_documents SET inclus='embed' WHERE inclus!='non' AND extension IN ('aiff', 'asf', 'avi', 'mid', 'mov', 'mp3', 'mpg', 'ogg', 'qt', 'ra', 'ram', 'rm', 'swf', 'wav', 'wmv')");
252
-		maj_version (1.462);
252
+		maj_version(1.462);
253 253
 	}
254 254
 
255 255
 	if (upgrade_vers(1.463, $version_installee, $version_cible)) {
256 256
 		spip_query("ALTER TABLE spip_articles CHANGE popularite popularite DOUBLE");
257 257
 		spip_query("ALTER TABLE spip_visites_temp ADD maj TIMESTAMP");
258 258
 		spip_query("ALTER TABLE spip_referers_temp ADD maj TIMESTAMP");
259
-		maj_version (1.463);
259
+		maj_version(1.463);
260 260
 	}
261 261
 
262 262
 	// l'upgrade < 1.462 ci-dessus etait fausse, d'ou correctif
@@ -267,23 +267,23 @@  discard block
 block discarded – undo
267 267
 			$id_type = $row['id_type'];
268 268
 			spip_query("UPDATE spip_documents SET id_type=$id_type	WHERE fichier like '%.$extension'");
269 269
 		}
270
-		maj_version (1.464);
270
+		maj_version(1.464);
271 271
 	}
272 272
 
273 273
 	if (upgrade_vers(1.465, $version_installee, $version_cible)) {
274 274
 		spip_query("ALTER TABLE spip_articles CHANGE popularite popularite DOUBLE NOT NULL");
275
-		maj_version (1.465);
275
+		maj_version(1.465);
276 276
 	}
277 277
 
278 278
 	if (upgrade_vers(1.466, $version_installee, $version_cible)) {
279 279
 		spip_query("ALTER TABLE spip_auteurs ADD source VARCHAR(10) DEFAULT 'spip' NOT NULL");
280
-		maj_version (1.466);
280
+		maj_version(1.466);
281 281
 	}
282 282
 
283 283
 	if (upgrade_vers(1.468, $version_installee, $version_cible)) {
284 284
 		spip_query("ALTER TABLE spip_auteurs ADD INDEX en_ligne (en_ligne)");
285 285
 		spip_query("ALTER TABLE spip_forum ADD INDEX statut (statut, date_heure)");
286
-		maj_version (1.468);
286
+		maj_version(1.468);
287 287
 	}
288 288
 
289 289
 	if (upgrade_vers(1.470, $version_installee, $version_cible)) {
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			spip_query("ALTER TABLE spip_auteurs DROP abonne");
293 293
 			spip_query("ALTER TABLE spip_auteurs DROP abonne_pass");
294 294
 		}
295
-		maj_version (1.470);
295
+		maj_version(1.470);
296 296
 	}
297 297
 
298 298
 	if (upgrade_vers(1.471, $version_installee, $version_cible)) {
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 			spip_query("ALTER TABLE spip_mots_syndic DROP maj TIMESTAMP");
310 310
 			spip_query("ALTER TABLE spip_mots_forum DROP maj TIMESTAMP");
311 311
 		}
312
-		maj_version (1.471);
312
+		maj_version(1.471);
313 313
 	}
314 314
 
315 315
 	if (upgrade_vers(1.472, $version_installee, $version_cible)) {
316 316
 		spip_query("ALTER TABLE spip_referers ADD visites_jour INTEGER UNSIGNED NOT NULL");
317
-		maj_version (1.472);
317
+		maj_version(1.472);
318 318
 	}
319 319
 
320 320
 	if (upgrade_vers(1.473, $version_installee, $version_cible)) {
321 321
 		spip_query("UPDATE spip_syndic_articles SET url = REPLACE(url, '&amp;', '&')");
322 322
 		spip_query("UPDATE spip_syndic SET url_site = REPLACE(url_site, '&amp;', '&')");
323
-		maj_version (1.473);
323
+		maj_version(1.473);
324 324
 	}
325 325
 }
326 326
 
Please login to merge, or discard this patch.
ecrire/maj/v019_pre193.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 		spip_query("ALTER TABLE spip_meta CHANGE `valeur` `valeur` TEXT");
56 56
 		// table des correspondances table->id_table
57 57
 		$liste_tables = array();
58
-		$liste_tables[1]='spip_articles';
59
-		$liste_tables[2]='spip_auteurs';
60
-		$liste_tables[3]='spip_breves';
61
-		$liste_tables[4]='spip_documents';
62
-		$liste_tables[5]='spip_forum';
63
-		$liste_tables[6]='spip_mots';
64
-		$liste_tables[7]='spip_rubriques';
65
-		$liste_tables[8]='spip_signatures';
66
-		$liste_tables[9]='spip_syndic';
58
+		$liste_tables[1] = 'spip_articles';
59
+		$liste_tables[2] = 'spip_auteurs';
60
+		$liste_tables[3] = 'spip_breves';
61
+		$liste_tables[4] = 'spip_documents';
62
+		$liste_tables[5] = 'spip_forum';
63
+		$liste_tables[6] = 'spip_mots';
64
+		$liste_tables[7] = 'spip_rubriques';
65
+		$liste_tables[8] = 'spip_signatures';
66
+		$liste_tables[9] = 'spip_syndic';
67 67
 
68 68
 		ecrire_meta('index_table', serialize($liste_tables));
69 69
 
@@ -220,18 +220,18 @@  discard block
 block discarded – undo
220 220
 	}
221 221
 	if (upgrade_vers(1.922, $version_installee, $version_cible)) {
222 222
 		spip_query("ALTER TABLE spip_meta ADD `impt` ENUM('non', 'oui') DEFAULT 'oui' NOT NULL AFTER `valeur`");
223
-		$meta_serveur = array('version_installee','adresse_site','alea_ephemere_ancien','alea_ephemere','alea_ephemere_date','langue_site','langues_proposees','date_calcul_rubriques','derniere_modif','optimiser_table','drapeau_edition','creer_preview','taille_preview','creer_htpasswd','creer_htaccess','gd_formats_read','gd_formats',
224
-		'netpbm_formats','formats_graphiques','image_process','plugin_header','plugin');
225
-		foreach($meta_serveur as $nom)
223
+		$meta_serveur = array('version_installee', 'adresse_site', 'alea_ephemere_ancien', 'alea_ephemere', 'alea_ephemere_date', 'langue_site', 'langues_proposees', 'date_calcul_rubriques', 'derniere_modif', 'optimiser_table', 'drapeau_edition', 'creer_preview', 'taille_preview', 'creer_htpasswd', 'creer_htaccess', 'gd_formats_read', 'gd_formats',
224
+		'netpbm_formats', 'formats_graphiques', 'image_process', 'plugin_header', 'plugin');
225
+		foreach ($meta_serveur as $nom)
226 226
 			spip_query("UPDATE spip_meta SET `impt`='non' WHERE `nom`="._q($nom));
227 227
 		maj_version('1.922');
228 228
 	}
229 229
 	if (upgrade_vers(1.923, $version_installee, $version_cible)) {
230
-		if (isset($GLOBALS['meta']['IMPORT_tables_noimport'])){
230
+		if (isset($GLOBALS['meta']['IMPORT_tables_noimport'])) {
231 231
 			$IMPORT_tables_noimport = unserialize($GLOBALS['meta']['IMPORT_tables_noimport']);
232 232
 			foreach ($IMPORT_tables_noimport as $key=>$table)
233
-				if ($table=='spip_meta') unset($IMPORT_tables_noimport[$key]);
234
-			ecrire_meta('IMPORT_tables_noimport',serialize($IMPORT_tables_noimport),'non');
233
+				if ($table == 'spip_meta') unset($IMPORT_tables_noimport[$key]);
234
+			ecrire_meta('IMPORT_tables_noimport', serialize($IMPORT_tables_noimport), 'non');
235 235
 		}
236 236
 		maj_version('1.923');
237 237
 	}
@@ -246,47 +246,47 @@  discard block
 block discarded – undo
246 246
 		/* deplacement des sessions */
247 247
 		$f_session = preg_files('data', 'session_');
248 248
 		$repertoire = _DIR_SESSIONS;
249
-		if(!@file_exists($repertoire)) {
249
+		if (!@file_exists($repertoire)) {
250 250
 			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
251 251
 			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
252 252
 		}
253
-		foreach($f_session as $f) {
253
+		foreach ($f_session as $f) {
254 254
 			$d = basename($f);
255 255
 			@copy($f, $repertoire.$d);
256 256
 		}
257 257
 		/* deplacement des visites */
258 258
 		$f_visites = preg_files('data/visites');
259 259
 		$repertoire = sous_repertoire(_DIR_TMP, 'visites');
260
-		foreach($f_visites as $f) {
260
+		foreach ($f_visites as $f) {
261 261
 			$d = basename($f);
262 262
 			@copy($f, $repertoire.$d);
263 263
 		}
264 264
 		/* deplacement des upload */
265 265
 		$auteurs = array();
266 266
 		$req = spip_query("SELECT `login` FROM spip_auteurs WHERE `statut` = '0minirezo'");
267
-		while($row = sql_fetch($req))
267
+		while ($row = sql_fetch($req))
268 268
 			$auteurs[] = $row['login']; 
269 269
 		$f_upload = preg_files('upload', -1, 10000, $auteurs);
270 270
 		$repertoire = _DIR_TRANSFERT;
271
-		if(!@file_exists($repertoire)) {
271
+		if (!@file_exists($repertoire)) {
272 272
 			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
273 273
 			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
274 274
 		}
275
-		foreach($auteurs as $login) {
276
-			if(is_dir('upload/'.$login))
275
+		foreach ($auteurs as $login) {
276
+			if (is_dir('upload/'.$login))
277 277
 				$sous_repertoire = sous_repertoire(_DIR_TRANSFERT, $login);
278 278
 		}
279
-		foreach($f_upload as $f) {
279
+		foreach ($f_upload as $f) {
280 280
 			@copy($f, _DIR_TMP.$f);
281 281
 		}
282 282
 		/* deplacement des dumps */
283 283
 		$f_session = preg_files('data', 'dump');
284 284
 		$repertoire = _DIR_DUMP;
285
-		if(!@file_exists($repertoire)) {
285
+		if (!@file_exists($repertoire)) {
286 286
 			$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
287 287
 			$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
288 288
 		}
289
-		foreach($f_session as $f) {
289
+		foreach ($f_session as $f) {
290 290
 			$d = basename($f);
291 291
 			@copy($f, $repertoire.$d);
292 292
 		}
Please login to merge, or discard this patch.
ecrire/maj/v018.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,10 +65,10 @@
 block discarded – undo
65 65
 		do {
66 66
 			$discussion = "0";
67 67
 			$precedent = 0;
68
-			$r = sql_select("fille.id_forum AS id,	maman.id_thread AS thread", 'spip_forum AS fille, spip_forum AS maman', "fille.id_parent = maman.id_forum AND fille.id_thread <> maman.id_thread",'', "thread");
68
+			$r = sql_select("fille.id_forum AS id,	maman.id_thread AS thread", 'spip_forum AS fille, spip_forum AS maman', "fille.id_parent = maman.id_forum AND fille.id_thread <> maman.id_thread", '', "thread");
69 69
 			while ($row = sql_fetch($r)) {
70 70
 				if ($row['thread'] == $precedent)
71
-					$discussion .= "," . $row['id'];
71
+					$discussion .= ",".$row['id'];
72 72
 				else {
73 73
 					if ($precedent)
74 74
 						sql_updateq("spip_forum", array("id_thread" => $precedent), "id_forum IN ($discussion)");
Please login to merge, or discard this patch.
ecrire/maj/v010.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,28 +17,28 @@
 block discarded – undo
17 17
 	
18 18
 	if (upgrade_vers(1.01, $version_installee, $version_cible)) {
19 19
 		spip_query("UPDATE spip_forum SET statut='publie' WHERE statut=''");
20
-		maj_version (1.01);
20
+		maj_version(1.01);
21 21
 	}
22 22
 	
23 23
 	if (upgrade_vers(1.02, $version_installee, $version_cible)) {
24 24
 		spip_query("ALTER TABLE spip_forum ADD id_auteur BIGINT DEFAULT '0' NOT NULL");
25
-		maj_version (1.02);
25
+		maj_version(1.02);
26 26
 	}
27 27
 
28 28
 	if (upgrade_vers(1.03, $version_installee, $version_cible)) {
29 29
 		spip_query("DROP TABLE spip_maj");
30
-		maj_version (1.03);
30
+		maj_version(1.03);
31 31
 	}
32 32
 
33 33
 	if (upgrade_vers(1.04, $version_installee, $version_cible)) {
34 34
 		spip_query("ALTER TABLE spip_articles ADD accepter_forum VARCHAR(3)");
35
-		maj_version (1.04);
35
+		maj_version(1.04);
36 36
 	}
37 37
 
38 38
 	if (upgrade_vers(1.05, $version_installee, $version_cible)) {
39 39
 		spip_query("DROP TABLE spip_petition");
40 40
 		spip_query("DROP TABLE spip_signatures_petition");
41
-		maj_version (1.05);
41
+		maj_version(1.05);
42 42
 	}
43 43
 }
44 44
 
Please login to merge, or discard this patch.
ecrire/auth/sha256.inc.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                            : ((defined('_NANO_SHA2_UPPER')) ? true : false);
84 84
 
85 85
             // Deteremine if the system is 32 or 64 bit.
86
-            $tmpInt = (int)4294967295;
86
+            $tmpInt = (int) 4294967295;
87 87
             $this->platform = ($tmpInt > 0) ? 64 : 32;
88 88
         }
89 89
 
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 
95 95
             if ($x < 0) {
96 96
                 $x &= 0x7FFFFFFF;
97
-                $x = (float)$x + $mask;
97
+                $x = (float) $x + $mask;
98 98
             }
99 99
 
100 100
             if ($y < 0) {
101 101
                 $y &= 0x7FFFFFFF;
102
-                $y = (float)$y + $mask;
102
+                $y = (float) $y + $mask;
103 103
             }
104 104
 
105 105
             $r = $x + $y;
@@ -110,52 +110,52 @@  discard block
 block discarded – undo
110 110
                 }
111 111
             }
112 112
 
113
-            return (int)$r;
113
+            return (int) $r;
114 114
         }
115 115
 
116 116
         // Logical bitwise right shift (PHP default is arithmetic shift)
117 117
         function SHR($x, $n)        // x >> n
118 118
         {
119 119
             if ($n >= 32) {      // impose some limits to keep it 32-bit
120
-                return (int)0;
120
+                return (int) 0;
121 121
             }
122 122
 
123 123
             if ($n <= 0) {
124
-                return (int)$x;
124
+                return (int) $x;
125 125
             }
126 126
 
127 127
             $mask = 0x40000000;
128 128
 
129 129
             if ($x < 0) {
130 130
                 $x &= 0x7FFFFFFF;
131
-                $mask = $mask >> ($n-1);
131
+                $mask = $mask >> ($n - 1);
132 132
                 return ($x >> $n) | $mask;
133 133
             }
134 134
 
135
-            return (int)$x >> (int)$n;
135
+            return (int) $x >> (int) $n;
136 136
         }
137 137
 
138
-        function ROTR($x, $n) { return (int)(($this->SHR($x, $n) | ($x << (32-$n)) & 0xFFFFFFFF)); }
138
+        function ROTR($x, $n) { return (int) (($this->SHR($x, $n) | ($x << (32 - $n)) & 0xFFFFFFFF)); }
139 139
         function Ch($x, $y, $z) { return ($x & $y) ^ ((~$x) & $z); }
140 140
         function Maj($x, $y, $z) { return ($x & $y) ^ ($x & $z) ^ ($y & $z); }
141
-        function Sigma0($x) { return (int) ($this->ROTR($x, 2)^$this->ROTR($x, 13)^$this->ROTR($x, 22)); }
142
-        function Sigma1($x) { return (int) ($this->ROTR($x, 6)^$this->ROTR($x, 11)^$this->ROTR($x, 25)); }
143
-        function sigma_0($x) { return (int) ($this->ROTR($x, 7)^$this->ROTR($x, 18)^$this->SHR($x, 3)); }
144
-        function sigma_1($x) { return (int) ($this->ROTR($x, 17)^$this->ROTR($x, 19)^$this->SHR($x, 10)); }
141
+        function Sigma0($x) { return (int) ($this->ROTR($x, 2) ^ $this->ROTR($x, 13) ^ $this->ROTR($x, 22)); }
142
+        function Sigma1($x) { return (int) ($this->ROTR($x, 6) ^ $this->ROTR($x, 11) ^ $this->ROTR($x, 25)); }
143
+        function sigma_0($x) { return (int) ($this->ROTR($x, 7) ^ $this->ROTR($x, 18) ^ $this->SHR($x, 3)); }
144
+        function sigma_1($x) { return (int) ($this->ROTR($x, 17) ^ $this->ROTR($x, 19) ^ $this->SHR($x, 10)); }
145 145
 
146 146
 
147
-				function string2ordUTF8($s,&$byteSize){
147
+				function string2ordUTF8($s, &$byteSize) {
148 148
 					$chars = array();
149 149
 					// par defaut sur 8bits
150 150
 					$byteSize = 8;
151 151
 					$i = 0;
152
-					while ($i<strlen($s)){
152
+					while ($i < strlen($s)) {
153 153
 						$chars[] = $this->ordUTF8($s, $i, $bytes);
154
-						$i+=$bytes;
154
+						$i += $bytes;
155 155
 						// mais si un char necessite 16bits, on passe tout sur 16
156 156
 						// sinon on ne concorde pas avec le lecture de la chaine en js
157 157
 						// et le sha256 js
158
-						if ($bytes>1) $byteSize = 16;
158
+						if ($bytes > 1) $byteSize = 16;
159 159
 					}
160 160
 					return $chars;
161 161
 				}
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
 						$bytes = 1;
175 175
 						return $h;
176 176
 					}
177
-					else if ($h < 0xC2){
177
+					else if ($h < 0xC2) {
178 178
 						// pas utf mais renvoyer quand meme ce qu'on a
179 179
 						$bytes = 1;
180 180
 						return $h;
181 181
 					}
182 182
 					else if ($h <= 0xDF && $index < $len - 1) {
183 183
 						$bytes = 2;
184
-						return ($h & 0x1F) <<  6 | (ord($c{$index + 1}) & 0x3F);
184
+						return ($h & 0x1F) << 6 | (ord($c{$index + 1}) & 0x3F);
185 185
 					}
186 186
 					else if ($h <= 0xEF && $index < $len - 2) {
187 187
 						$bytes = 3;
@@ -201,33 +201,33 @@  discard block
 block discarded – undo
201 201
 					}
202 202
 				}
203 203
 
204
-				function string2binint ($str,$npad=512) {
204
+				function string2binint($str, $npad = 512) {
205 205
 					$bin = array();
206
-					$ords = $this->string2ordUTF8($str,$this->bytesString);
207
-					$npad = $npad/$this->bytesString;
206
+					$ords = $this->string2ordUTF8($str, $this->bytesString);
207
+					$npad = $npad / $this->bytesString;
208 208
 					$length = count($ords);
209 209
 					$ords[] = 0x80; // append the "1" bit followed by 7 0's
210
-					$pad = ceil(($length+1+32/$this->bytesString)/$npad)*$npad-32/$this->bytesString;
211
-					$ords = array_pad($ords,$pad,0);
210
+					$pad = ceil(($length + 1 + 32 / $this->bytesString) / $npad) * $npad - 32 / $this->bytesString;
211
+					$ords = array_pad($ords, $pad, 0);
212 212
 					$mask = (1 << $this->bytesString) - 1;
213
-					for($i = 0; $i < count($ords) * $this->bytesString; $i += $this->bytesString) {
214
-						if (!isset($bin[$i>>5])) { $bin[$i>>5] = 0; } // pour eviter des notices.
215
-						$bin[$i>>5] |= ($ords[$i / $this->bytesString] & $mask) << (24 - $i%32);
213
+					for ($i = 0; $i < count($ords) * $this->bytesString; $i += $this->bytesString) {
214
+						if (!isset($bin[$i >> 5])) { $bin[$i >> 5] = 0; } // pour eviter des notices.
215
+						$bin[$i >> 5] |= ($ords[$i / $this->bytesString] & $mask) << (24 - $i % 32);
216 216
 					}
217
-					$bin[] = $length*$this->bytesString;
217
+					$bin[] = $length * $this->bytesString;
218 218
 					return $bin;
219 219
 				}
220 220
 
221 221
 				function array_split($a, $n) {
222 222
 					$split = array();
223
-					while (count($a)>$n) {
223
+					while (count($a) > $n) {
224 224
 						$s = array();
225
-						for($i = 0;$i<$n;$i++)
225
+						for ($i = 0; $i < $n; $i++)
226 226
 							$s[] = array_shift($a);
227 227
 						$split[] = $s;
228 228
 					}
229
-					if (count($a)){
230
-						$a = array_pad($a,$n,0);
229
+					if (count($a)) {
230
+						$a = array_pad($a, $n, 0);
231 231
 						$split[] = $a;
232 232
 					}
233 233
 					return $split;
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
          */
243 243
         function hash($str, $ig_func = true)
244 244
         {
245
-            unset($binStr);     // binary representation of input string
246
-            unset($hexStr);     // 256-bit message digest in readable hex format
245
+            unset($binStr); // binary representation of input string
246
+            unset($hexStr); // 256-bit message digest in readable hex format
247 247
 
248 248
             // check for php's internal sha256 function, ignore if ig_func==true
249 249
             if ($ig_func == false) {
250
-                if (version_compare(PHP_VERSION,'5.1.2','>=') AND !defined('_NO_HASH_DEFINED')) {
250
+                if (version_compare(PHP_VERSION, '5.1.2', '>=') AND !defined('_NO_HASH_DEFINED')) {
251 251
                     return hash("sha256", $str, false);
252 252
                 } else if (function_exists('mhash') && defined('MHASH_SHA256')) {
253 253
                     return base64_encode(bin2hex(mhash(MHASH_SHA256, $str)));
@@ -260,44 +260,44 @@  discard block
 block discarded – undo
260 260
              *  first thirty-two bits of the fractional parts of the cube roots
261 261
              *  of the first sixtyfour prime numbers.
262 262
              */
263
-            $K = array((int)0x428a2f98, (int)0x71374491, (int)0xb5c0fbcf,
264
-                       (int)0xe9b5dba5, (int)0x3956c25b, (int)0x59f111f1,
265
-                       (int)0x923f82a4, (int)0xab1c5ed5, (int)0xd807aa98,
266
-                       (int)0x12835b01, (int)0x243185be, (int)0x550c7dc3,
267
-                       (int)0x72be5d74, (int)0x80deb1fe, (int)0x9bdc06a7,
268
-                       (int)0xc19bf174, (int)0xe49b69c1, (int)0xefbe4786,
269
-                       (int)0x0fc19dc6, (int)0x240ca1cc, (int)0x2de92c6f,
270
-                       (int)0x4a7484aa, (int)0x5cb0a9dc, (int)0x76f988da,
271
-                       (int)0x983e5152, (int)0xa831c66d, (int)0xb00327c8,
272
-                       (int)0xbf597fc7, (int)0xc6e00bf3, (int)0xd5a79147,
273
-                       (int)0x06ca6351, (int)0x14292967, (int)0x27b70a85,
274
-                       (int)0x2e1b2138, (int)0x4d2c6dfc, (int)0x53380d13,
275
-                       (int)0x650a7354, (int)0x766a0abb, (int)0x81c2c92e,
276
-                       (int)0x92722c85, (int)0xa2bfe8a1, (int)0xa81a664b,
277
-                       (int)0xc24b8b70, (int)0xc76c51a3, (int)0xd192e819,
278
-                       (int)0xd6990624, (int)0xf40e3585, (int)0x106aa070,
279
-                       (int)0x19a4c116, (int)0x1e376c08, (int)0x2748774c,
280
-                       (int)0x34b0bcb5, (int)0x391c0cb3, (int)0x4ed8aa4a,
281
-                       (int)0x5b9cca4f, (int)0x682e6ff3, (int)0x748f82ee,
282
-                       (int)0x78a5636f, (int)0x84c87814, (int)0x8cc70208,
283
-                       (int)0x90befffa, (int)0xa4506ceb, (int)0xbef9a3f7,
284
-                       (int)0xc67178f2);
263
+            $K = array((int) 0x428a2f98, (int) 0x71374491, (int) 0xb5c0fbcf,
264
+                       (int) 0xe9b5dba5, (int) 0x3956c25b, (int) 0x59f111f1,
265
+                       (int) 0x923f82a4, (int) 0xab1c5ed5, (int) 0xd807aa98,
266
+                       (int) 0x12835b01, (int) 0x243185be, (int) 0x550c7dc3,
267
+                       (int) 0x72be5d74, (int) 0x80deb1fe, (int) 0x9bdc06a7,
268
+                       (int) 0xc19bf174, (int) 0xe49b69c1, (int) 0xefbe4786,
269
+                       (int) 0x0fc19dc6, (int) 0x240ca1cc, (int) 0x2de92c6f,
270
+                       (int) 0x4a7484aa, (int) 0x5cb0a9dc, (int) 0x76f988da,
271
+                       (int) 0x983e5152, (int) 0xa831c66d, (int) 0xb00327c8,
272
+                       (int) 0xbf597fc7, (int) 0xc6e00bf3, (int) 0xd5a79147,
273
+                       (int) 0x06ca6351, (int) 0x14292967, (int) 0x27b70a85,
274
+                       (int) 0x2e1b2138, (int) 0x4d2c6dfc, (int) 0x53380d13,
275
+                       (int) 0x650a7354, (int) 0x766a0abb, (int) 0x81c2c92e,
276
+                       (int) 0x92722c85, (int) 0xa2bfe8a1, (int) 0xa81a664b,
277
+                       (int) 0xc24b8b70, (int) 0xc76c51a3, (int) 0xd192e819,
278
+                       (int) 0xd6990624, (int) 0xf40e3585, (int) 0x106aa070,
279
+                       (int) 0x19a4c116, (int) 0x1e376c08, (int) 0x2748774c,
280
+                       (int) 0x34b0bcb5, (int) 0x391c0cb3, (int) 0x4ed8aa4a,
281
+                       (int) 0x5b9cca4f, (int) 0x682e6ff3, (int) 0x748f82ee,
282
+                       (int) 0x78a5636f, (int) 0x84c87814, (int) 0x8cc70208,
283
+                       (int) 0x90befffa, (int) 0xa4506ceb, (int) 0xbef9a3f7,
284
+                       (int) 0xc67178f2);
285 285
 
286 286
             // Pre-processing: Padding the string
287
-            $binStr = $this->string2binint($str,512);
287
+            $binStr = $this->string2binint($str, 512);
288 288
 
289 289
             // Parsing the Padded Message (Break into N 512-bit blocks)
290 290
             $M = $this->array_split($binStr, 16);
291 291
 
292 292
             // Set the initial hash values
293
-            $h[0] = (int)0x6a09e667;
294
-            $h[1] = (int)0xbb67ae85;
295
-            $h[2] = (int)0x3c6ef372;
296
-            $h[3] = (int)0xa54ff53a;
297
-            $h[4] = (int)0x510e527f;
298
-            $h[5] = (int)0x9b05688c;
299
-            $h[6] = (int)0x1f83d9ab;
300
-            $h[7] = (int)0x5be0cd19;
293
+            $h[0] = (int) 0x6a09e667;
294
+            $h[1] = (int) 0xbb67ae85;
295
+            $h[2] = (int) 0x3c6ef372;
296
+            $h[3] = (int) 0xa54ff53a;
297
+            $h[4] = (int) 0x510e527f;
298
+            $h[5] = (int) 0x9b05688c;
299
+            $h[6] = (int) 0x1f83d9ab;
300
+            $h[7] = (int) 0x5be0cd19;
301 301
 
302 302
             // loop through message blocks and compute hash. ( For i=1 to N : )
303 303
             $N = count($M);
@@ -307,14 +307,14 @@  discard block
 block discarded – undo
307 307
                 $MI = $M[$i];
308 308
 
309 309
                 // Initialize working variables
310
-                $_a = (int)$h[0];
311
-                $_b = (int)$h[1];
312
-                $_c = (int)$h[2];
313
-                $_d = (int)$h[3];
314
-                $_e = (int)$h[4];
315
-                $_f = (int)$h[5];
316
-                $_g = (int)$h[6];
317
-                $_h = (int)$h[7];
310
+                $_a = (int) $h[0];
311
+                $_b = (int) $h[1];
312
+                $_c = (int) $h[2];
313
+                $_d = (int) $h[3];
314
+                $_e = (int) $h[4];
315
+                $_f = (int) $h[5];
316
+                $_g = (int) $h[6];
317
+                $_h = (int) $h[7];
318 318
                 unset($_s0);
319 319
                 unset($_s1);
320 320
                 unset($_T1);
@@ -339,15 +339,15 @@  discard block
 block discarded – undo
339 339
                 for (; $t < 64; $t++)
340 340
                 {
341 341
                     // Continue building the message schedule as we loop
342
-                    $_s0 = $W[($t+1)&0x0F];
342
+                    $_s0 = $W[($t + 1) & 0x0F];
343 343
                     $_s0 = $this->sigma_0($_s0);
344
-                    $_s1 = $W[($t+14)&0x0F];
344
+                    $_s1 = $W[($t + 14) & 0x0F];
345 345
                     $_s1 = $this->sigma_1($_s1);
346 346
 
347
-                    $W[$t&0xF] = $this->addmod2n($this->addmod2n($this->addmod2n($W[$t&0xF], $_s0), $_s1), $W[($t+9)&0x0F]);
347
+                    $W[$t & 0xF] = $this->addmod2n($this->addmod2n($this->addmod2n($W[$t & 0xF], $_s0), $_s1), $W[($t + 9) & 0x0F]);
348 348
 
349 349
                     // Compute hash
350
-                    $_T1 = $this->addmod2n($this->addmod2n($this->addmod2n($this->addmod2n($_h, $this->Sigma1($_e)), $this->Ch($_e, $_f, $_g)), $K[$t]), $W[$t&0xF]);
350
+                    $_T1 = $this->addmod2n($this->addmod2n($this->addmod2n($this->addmod2n($_h, $this->Sigma1($_e)), $this->Ch($_e, $_f, $_g)), $K[$t]), $W[$t & 0xF]);
351 351
                     $_T2 = $this->addmod2n($this->Sigma0($_a), $this->Maj($_a, $_b, $_c));
352 352
 
353 353
                     // Update working variables
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
             for ($i = 0; $i < $strlen; $i++)
398 398
             {
399 399
                 $i = (($sign < 0) ? $i + $length : $i);
400
-                $result[] = substr($string, $sign*$i, $length);
400
+                $result[] = substr($string, $sign * $i, $length);
401 401
                 $i--;
402 402
                 $i = (($sign < 0) ? $i : $i + $length);
403 403
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 // support to give php4 the hash() routine which abstracts this code.
435 435
 if (!function_exists('hash'))
436 436
 {
437
-    define('_NO_HASH_DEFINED',true);
437
+    define('_NO_HASH_DEFINED', true);
438 438
     function hash($algo, $data)
439 439
     {
440 440
         if (empty($algo) || !is_string($algo) || !is_string($data)) {
Please login to merge, or discard this patch.
ecrire/auth/spip.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * @param bool $phpauth
23 23
  * @return array|bool
24 24
  */
25
-function auth_spip_dist ($login, $pass, $serveur='', $phpauth=false) {
25
+function auth_spip_dist($login, $pass, $serveur = '', $phpauth = false) {
26 26
 
27 27
 	// retrouver le login
28 28
 	$login = auth_spip_retrouver_login($login);
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	$md5pass = "";
33 33
 	$shapass = $shanext = "";
34 34
 
35
-	if (preg_match(",^\{([0-9a-f]{64});([0-9a-f]{64})\}$,i",$pass,$regs)){
35
+	if (preg_match(",^\{([0-9a-f]{64});([0-9a-f]{64})\}$,i", $pass, $regs)) {
36 36
 		$shapass = $regs[1];
37 37
 		$shanext = $regs[2];
38 38
 	}
39 39
 	// compat avec une base mixte md5/sha256 : le js a envoye les 2 hash
40
-	elseif (preg_match(",^\{([0-9a-f]{64});([0-9a-f]{64});([0-9a-f]{32});([0-9a-f]{32})\}$,i",$pass,$regs)){
40
+	elseif (preg_match(",^\{([0-9a-f]{64});([0-9a-f]{64});([0-9a-f]{32});([0-9a-f]{32})\}$,i", $pass, $regs)) {
41 41
 		$shapass = $regs[1];
42 42
 		$shanext = $regs[2];
43 43
 		$md5pass = $regs[3];
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 
47 47
 	// si envoi non crypte, crypter maintenant
48 48
 	elseif ($pass) {
49
-		$row = sql_fetsel("alea_actuel, alea_futur", "spip_auteurs", "login=" . sql_quote($login,$serveur,'text'),'','','','',$serveur);
49
+		$row = sql_fetsel("alea_actuel, alea_futur", "spip_auteurs", "login=".sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur);
50 50
 
51 51
 		if ($row) {
52 52
 			include_spip('auth/sha256.inc');
53
-			$shapass = _nano_sha256($row['alea_actuel'] . $pass);
54
-			$shanext = _nano_sha256($row['alea_futur'] . $pass);
55
-			$md5pass = md5($row['alea_actuel'] . $pass);
53
+			$shapass = _nano_sha256($row['alea_actuel'].$pass);
54
+			$shanext = _nano_sha256($row['alea_futur'].$pass);
55
+			$md5pass = md5($row['alea_actuel'].$pass);
56 56
 		}
57 57
 	}
58 58
 
59 59
 	// login inexistant ou mot de passe vide
60 60
 	if (!$shapass AND !$md5pass) return array();
61 61
 
62
-	$row = sql_fetsel("*", "spip_auteurs", "login=" . sql_quote($login,$serveur,'text') . " AND pass=" . sql_quote($shapass,$serveur,'text') . " AND statut<>'5poubelle'",'','','','',$serveur);
62
+	$row = sql_fetsel("*", "spip_auteurs", "login=".sql_quote($login, $serveur, 'text')." AND pass=".sql_quote($shapass, $serveur, 'text')." AND statut<>'5poubelle'", '', '', '', '', $serveur);
63 63
 
64 64
 	// compat avec les anciennes bases en md5
65 65
 	if (!$row AND $md5pass)
66
-		$row = sql_fetsel("*", "spip_auteurs", "login=" . sql_quote($login,$serveur,'text') . " AND pass=" . sql_quote($md5pass,$serveur,'text') . " AND statut<>'5poubelle'",'','','','',$serveur);
66
+		$row = sql_fetsel("*", "spip_auteurs", "login=".sql_quote($login, $serveur, 'text')." AND pass=".sql_quote($md5pass, $serveur, 'text')." AND statut<>'5poubelle'", '', '', '', '', $serveur);
67 67
 
68 68
 	// login/mot de passe incorrect
69 69
 	if (!$row) return array();
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	if ($shanext AND !$phpauth) {
74 74
 
75 75
 		include_spip('inc/acces'); // pour creer_uniqid
76
-		@sql_update('spip_auteurs', array('alea_actuel' => 'alea_futur', 'pass' => sql_quote($shanext,$serveur,'text'), 'alea_futur' => sql_quote(creer_uniqid(),$serveur,'text')), "id_auteur=" . $row['id_auteur'].' AND pass IN ('.sql_quote($shapass,$serveur,'text').', '.sql_quote($md5pass,$serveur,'text').')','',$serveur);
76
+		@sql_update('spip_auteurs', array('alea_actuel' => 'alea_futur', 'pass' => sql_quote($shanext, $serveur, 'text'), 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text')), "id_auteur=".$row['id_auteur'].' AND pass IN ('.sql_quote($shapass, $serveur, 'text').', '.sql_quote($md5pass, $serveur, 'text').')', '', $serveur);
77 77
 		// En profiter pour verifier la securite de tmp/
78 78
 		// Si elle ne fonctionne pas a l'installation, prevenir
79 79
 		if (!verifier_htaccess(_DIR_TMP) AND defined('_ECRIRE_INSTALL'))
@@ -88,22 +88,22 @@  discard block
 block discarded – undo
88 88
  * @param array $flux
89 89
  * @return array
90 90
  */
91
-function auth_spip_formulaire_login($flux){
91
+function auth_spip_formulaire_login($flux) {
92 92
 	// faut il encore envoyer md5 ?
93 93
 	// on regarde si il reste des pass md5 en base pour des auteurs en statut pas poubelle
94 94
 	// les hash md5 ont une longueur 32, les sha 64
95 95
 	// en evitant une requete sql a chaque affichage du formulaire login sans session
96 96
 	// (perf issue pour les sites qui mettent le formulaire de login sur la home)
97 97
 	$compat_md5 = false;
98
-	if (!isset($GLOBALS['meta']['sha_256_only']) OR _request('var_mode')){
98
+	if (!isset($GLOBALS['meta']['sha_256_only']) OR _request('var_mode')) {
99 99
 		$compat_md5 = sql_countsel("spip_auteurs", "length(pass)=32 AND statut<>'poubelle'");
100 100
 		if ($compat_md5 AND isset($GLOBALS['meta']['sha_256_only'])) effacer_meta('sha_256_only');
101
-		if (!$compat_md5) ecrire_meta('sha_256_only','oui');
101
+		if (!$compat_md5) ecrire_meta('sha_256_only', 'oui');
102 102
 	}
103 103
 
104 104
 	// javascript qui gere la securite du login en evitant de faire circuler le pass en clair
105
-	$flux['data'].=
106
-	  ($compat_md5?'<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>':'')
105
+	$flux['data'] .=
106
+	  ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '')
107 107
 		.'<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>'
108 108
 		.'<script type="text/javascript">/*<![CDATA[*/'
109 109
 		."var alea_actuel='".$flux['args']['contexte']['_alea_actuel']."';"
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 		."var page_auteur = '".generer_url_public('informer_auteur')."';"
113 113
 		."var informe_auteur_en_cours = false;"
114 114
 		."var attente_informe = 0;"
115
-		."var compat_md5 = ".($compat_md5?"true;":"false;")
115
+		."var compat_md5 = ".($compat_md5 ? "true;" : "false;")
116 116
 		."jQuery(function(){
117 117
 		jQuery('#password')
118
-			.after(\"<em id='pass_securise'><img src='".chemin_image('cadenas-16.png')."' width='16' height='16' alt='" . attribut_html(_T('login_securise')) . "' title='" . attribut_html(_T('login_securise')) . "' \/><\/em>\");
118
+			.after(\"<em id='pass_securise'><img src='".chemin_image('cadenas-16.png')."' width='16' height='16' alt='".attribut_html(_T('login_securise'))."' title='".attribut_html(_T('login_securise'))."' \/><\/em>\");
119 119
 		affiche_login_secure();
120 120
 		jQuery('#var_login').change(actualise_auteur);
121 121
 		jQuery('form#formulaire_login').submit(login_submit);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
  * @return bool
133 133
  *	 toujours true pour un auteur cree dans SPIP
134 134
  */
135
-function auth_spip_autoriser_modifier_login($serveur=''){
135
+function auth_spip_autoriser_modifier_login($serveur = '') {
136 136
 	if (strlen($serveur))
137 137
 		return false; // les fonctions d'ecriture sur base distante sont encore incompletes
138 138
 	return true;
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
  * @return string
149 149
  *	message d'erreur si login non valide, chaine vide sinon
150 150
  */
151
-function auth_spip_verifier_login($new_login, $id_auteur=0, $serveur=''){
151
+function auth_spip_verifier_login($new_login, $id_auteur = 0, $serveur = '') {
152 152
 	// login et mot de passe
153
-	if (strlen($new_login)){
153
+	if (strlen($new_login)) {
154 154
 		if (strlen($new_login) < _LOGIN_TROP_COURT)
155
-			return _T('info_login_trop_court_car_pluriel',array('nb'=>_LOGIN_TROP_COURT));
155
+			return _T('info_login_trop_court_car_pluriel', array('nb'=>_LOGIN_TROP_COURT));
156 156
 		else {
157
-			$n = sql_countsel('spip_auteurs', "login=" . sql_quote($new_login) . " AND id_auteur!=".intval($id_auteur)." AND statut!='5poubelle'",'','',$serveur);
157
+			$n = sql_countsel('spip_auteurs', "login=".sql_quote($new_login)." AND id_auteur!=".intval($id_auteur)." AND statut!='5poubelle'", '', '', $serveur);
158 158
 			if ($n)
159 159
 				return _T('info_login_existant');
160 160
 		}
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
  * @param string $serveur
171 171
  * @return bool
172 172
  */
173
-function auth_spip_modifier_login($new_login, $id_auteur, $serveur=''){
174
-	if (is_null($new_login) OR auth_spip_verifier_login($new_login,$id_auteur,$serveur)!='')
173
+function auth_spip_modifier_login($new_login, $id_auteur, $serveur = '') {
174
+	if (is_null($new_login) OR auth_spip_verifier_login($new_login, $id_auteur, $serveur) != '')
175 175
 		return false;
176 176
 	if (!$id_auteur = intval($id_auteur)
177
-		OR !$auteur = sql_fetsel('login','spip_auteurs','id_auteur='.intval($id_auteur),'','','','',$serveur))
177
+		OR !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur))
178 178
 		return false;
179 179
 	if ($new_login == $auteur['login'])
180 180
 		return true; // on a rien fait mais c'est bon !
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 	include_spip('action/editer_auteur');
183 183
 
184 184
 	// vider le login des auteurs a la poubelle qui avaient ce meme login
185
-	if (strlen($new_login)){
186
-		$anciens = sql_allfetsel('id_auteur','spip_auteurs','login='.sql_quote($new_login,$serveur,'text')." AND statut='5poubelle'",'','','','',$serveur);
187
-		while ($row = array_pop($anciens)){
185
+	if (strlen($new_login)) {
186
+		$anciens = sql_allfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", '', '', '', '', $serveur);
187
+		while ($row = array_pop($anciens)) {
188 188
 			auteur_modifier($row['id_auteur'], array('login'=>''), true); // manque la gestion de $serveur
189 189
 		}
190 190
 	}
@@ -202,22 +202,22 @@  discard block
 block discarded – undo
202 202
  * @param string $serveur
203 203
  * @return string
204 204
  */
205
-function auth_spip_retrouver_login($login, $serveur=''){
205
+function auth_spip_retrouver_login($login, $serveur = '') {
206 206
 	if (!strlen($login)) return null; // pas la peine de requeter
207
-	$l = sql_quote($login,$serveur,'text');
207
+	$l = sql_quote($login, $serveur, 'text');
208 208
 	if ($r = sql_getfetsel('login', 'spip_auteurs',
209
-			"statut<>'5poubelle'" .
210
-			" AND (length(pass)>0)" .
211
-			" AND (login=$l)",'','','','',$serveur))
209
+			"statut<>'5poubelle'".
210
+			" AND (length(pass)>0)".
211
+			" AND (login=$l)", '', '', '', '', $serveur))
212 212
 		return $r;
213 213
 	// Si pas d'auteur avec ce login
214 214
 	// regarder s'il a saisi son nom ou son mail.
215 215
 	// Ne pas fusionner avec la requete precedente
216 216
 	// car un nom peut etre homonyme d'un autre login
217 217
 	else return sql_getfetsel('login', 'spip_auteurs',
218
-			"statut<>'5poubelle'" .
219
-			" AND (length(pass)>0)" .
220
-			" AND (login<>'' AND (nom=$l OR email=$l))",'','','','',$serveur);
218
+			"statut<>'5poubelle'".
219
+			" AND (length(pass)>0)".
220
+			" AND (login<>'' AND (nom=$l OR email=$l))", '', '', '', '', $serveur);
221 221
 }
222 222
 
223 223
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
  * @param string $serveur
234 234
  * @return array
235 235
  */
236
-function auth_spip_informer_login($infos, $row, $serveur=''){
236
+function auth_spip_informer_login($infos, $row, $serveur = '') {
237 237
 
238 238
 	// pour la methode SPIP on a besoin des alea en plus pour encoder le pass avec
239 239
 	$infos['alea_actuel'] = $row['alea_actuel'];
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
  * @return bool
249 249
  *	toujours true pour un auteur cree dans SPIP
250 250
  */
251
-function auth_spip_autoriser_modifier_pass($serveur=''){
251
+function auth_spip_autoriser_modifier_pass($serveur = '') {
252 252
 	if (strlen($serveur))
253 253
 		return false; // les fonctions d'ecriture sur base distante sont encore incompletes
254 254
 	return true;
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
  * @return string
272 272
  *	message d'erreur si login non valide, chaine vide sinon
273 273
  */
274
-function auth_spip_verifier_pass($login, $new_pass, $id_auteur=0, $serveur=''){
274
+function auth_spip_verifier_pass($login, $new_pass, $id_auteur = 0, $serveur = '') {
275 275
 	// login et mot de passe
276 276
 	if (strlen($new_pass) < _PASS_LONGUEUR_MINI)
277
-		return _T('info_passe_trop_court_car_pluriel',array('nb'=>_PASS_LONGUEUR_MINI));
277
+		return _T('info_passe_trop_court_car_pluriel', array('nb'=>_PASS_LONGUEUR_MINI));
278 278
 
279 279
 	return '';
280 280
 }
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
  * @param string $serveur
289 289
  * @return bool
290 290
  */
291
-function auth_spip_modifier_pass($login, $new_pass, $id_auteur, $serveur=''){
292
-	if (is_null($new_pass) OR auth_spip_verifier_pass($login, $new_pass,$id_auteur,$serveur)!='')
291
+function auth_spip_modifier_pass($login, $new_pass, $id_auteur, $serveur = '') {
292
+	if (is_null($new_pass) OR auth_spip_verifier_pass($login, $new_pass, $id_auteur, $serveur) != '')
293 293
 		return false;
294 294
 
295 295
 	if (!$id_auteur = intval($id_auteur)
296
-		OR !sql_fetsel('login','spip_auteurs','id_auteur='.intval($id_auteur),'','','','',$serveur))
296
+		OR !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur))
297 297
 		return false;
298 298
 
299 299
 	$c = array();
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  * @param string $serveur
326 326
  * @return void
327 327
  */
328
-function auth_spip_synchroniser_distant($id_auteur, $champs, $options = array(), $serveur=''){
328
+function auth_spip_synchroniser_distant($id_auteur, $champs, $options = array(), $serveur = '') {
329 329
 	// ne rien faire pour une base distante : on ne sait pas regenerer les htaccess
330 330
 	if (strlen($serveur))
331 331
 		return;
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 		OR (isset($options['all']) AND $options['all'])
338 338
 	) {
339 339
 
340
-		$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
341
-		$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
340
+		$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
341
+		$htpasswd = _DIR_TMP._AUTH_USER_FILE;
342 342
 
343 343
 		// Cette variable de configuration peut etre posee par un plugin
344 344
 		// par exemple acces_restreint ;
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$p1 = ''; // login:htpass pour tous
358 358
 		$p2 = ''; // login:htpass pour les admins
359
-		$s = sql_select("login, htpass, statut", "spip_auteurs", sql_in("statut",  array('1comite','0minirezo','nouveau')));
359
+		$s = sql_select("login, htpass, statut", "spip_auteurs", sql_in("statut", array('1comite', '0minirezo', 'nouveau')));
360 360
 		while ($t = sql_fetch($s)) {
361 361
 			if (strlen($t['login']) AND strlen($t['htpass'])) {
362 362
 				$p1 .= $t['login'].':'.$t['htpass']."\n";
Please login to merge, or discard this patch.