Completed
Pull Request — master (#39)
by
unknown
09:06
created
ecrire/auth/sha256.inc.php 1 patch
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				: ((defined('_NANO_SHA2_UPPER')) ? true : false);
99 99
 
100 100
 			// Deteremine if the system is 32 or 64 bit.
101
-			$tmpInt = (int)4294967295;
101
+			$tmpInt = (int) 4294967295;
102 102
 			$this->platform = ($tmpInt > 0) ? 64 : 32;
103 103
 		}
104 104
 
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
 
117 117
 			if ($x < 0) {
118 118
 				$x &= 0x7FFFFFFF;
119
-				$x = (float)$x+$mask;
119
+				$x = (float) $x + $mask;
120 120
 			}
121 121
 
122 122
 			if ($y < 0) {
123 123
 				$y &= 0x7FFFFFFF;
124
-				$y = (float)$y+$mask;
124
+				$y = (float) $y + $mask;
125 125
 			}
126 126
 
127
-			$r = $x+$y;
127
+			$r = $x + $y;
128 128
 
129 129
 			if ($r >= $n) {
130 130
 				while ($r >= $n) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				}
133 133
 			}
134 134
 
135
-			return (int)$r;
135
+			return (int) $r;
136 136
 		}
137 137
 
138 138
 		/**
@@ -145,23 +145,23 @@  discard block
 block discarded – undo
145 145
 		function SHR($x, $n)        // x >> n
146 146
 		{
147 147
 			if ($n >= 32) {      // impose some limits to keep it 32-bit
148
-				return (int)0;
148
+				return (int) 0;
149 149
 			}
150 150
 
151 151
 			if ($n <= 0) {
152
-				return (int)$x;
152
+				return (int) $x;
153 153
 			}
154 154
 
155 155
 			$mask = 0x40000000;
156 156
 
157 157
 			if ($x < 0) {
158 158
 				$x &= 0x7FFFFFFF;
159
-				$mask = $mask >> ($n-1);
159
+				$mask = $mask >> ($n - 1);
160 160
 
161 161
 				return ($x >> $n) | $mask;
162 162
 			}
163 163
 
164
-			return (int)$x >> (int)$n;
164
+			return (int) $x >> (int) $n;
165 165
 		}
166 166
 
167 167
 		/** ROTR
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		 * @param int $n
171 171
 		 * @return int
172 172
 		 */
173
-		function ROTR($x, $n) { return (int)(($this->SHR($x, $n) | ($x << (32-$n)) & 0xFFFFFFFF)); }
173
+		function ROTR($x, $n) { return (int) (($this->SHR($x, $n) | ($x << (32 - $n)) & 0xFFFFFFFF)); }
174 174
 
175 175
 		/** Ch
176 176
 		 *
@@ -195,28 +195,28 @@  discard block
 block discarded – undo
195 195
 		 * @param int $x
196 196
 		 * @return int
197 197
 		 */
198
-		function Sigma0($x) { return (int)($this->ROTR($x, 2) ^ $this->ROTR($x, 13) ^ $this->ROTR($x, 22)); }
198
+		function Sigma0($x) { return (int) ($this->ROTR($x, 2) ^ $this->ROTR($x, 13) ^ $this->ROTR($x, 22)); }
199 199
 
200 200
 		/** Sigma1
201 201
 		 *
202 202
 		 * @param int $x
203 203
 		 * @return int
204 204
 		 */
205
-		function Sigma1($x) { return (int)($this->ROTR($x, 6) ^ $this->ROTR($x, 11) ^ $this->ROTR($x, 25)); }
205
+		function Sigma1($x) { return (int) ($this->ROTR($x, 6) ^ $this->ROTR($x, 11) ^ $this->ROTR($x, 25)); }
206 206
 
207 207
 		/** Sigma_0
208 208
 		 *
209 209
 		 * @param int $x
210 210
 		 * @return int
211 211
 		 */
212
-		function sigma_0($x) { return (int)($this->ROTR($x, 7) ^ $this->ROTR($x, 18) ^ $this->SHR($x, 3)); }
212
+		function sigma_0($x) { return (int) ($this->ROTR($x, 7) ^ $this->ROTR($x, 18) ^ $this->SHR($x, 3)); }
213 213
 
214 214
 		/** Sigma_1
215 215
 		 *
216 216
 		 * @param int $x
217 217
 		 * @return int
218 218
 		 */
219
-		function sigma_1($x) { return (int)($this->ROTR($x, 17) ^ $this->ROTR($x, 19) ^ $this->SHR($x, 10)); }
219
+		function sigma_1($x) { return (int) ($this->ROTR($x, 17) ^ $this->ROTR($x, 19) ^ $this->SHR($x, 10)); }
220 220
 
221 221
 		/** String 2 ord UTF8
222 222
 		 *
@@ -271,23 +271,23 @@  discard block
 block discarded – undo
271 271
 
272 272
 					return $h;
273 273
 				} else {
274
-					if ($h <= 0xDF && $index < $len-1) {
274
+					if ($h <= 0xDF && $index < $len - 1) {
275 275
 						$bytes = 2;
276 276
 
277
-						return ($h & 0x1F) << 6 | (ord($c{$index+1}) & 0x3F);
277
+						return ($h & 0x1F) << 6 | (ord($c{$index + 1}) & 0x3F);
278 278
 					} else {
279
-						if ($h <= 0xEF && $index < $len-2) {
279
+						if ($h <= 0xEF && $index < $len - 2) {
280 280
 							$bytes = 3;
281 281
 
282
-							return ($h & 0x0F) << 12 | (ord($c{$index+1}) & 0x3F) << 6
283
-							| (ord($c{$index+2}) & 0x3F);
282
+							return ($h & 0x0F) << 12 | (ord($c{$index + 1}) & 0x3F) << 6
283
+							| (ord($c{$index + 2}) & 0x3F);
284 284
 						} else {
285
-							if ($h <= 0xF4 && $index < $len-3) {
285
+							if ($h <= 0xF4 && $index < $len - 3) {
286 286
 								$bytes = 4;
287 287
 
288
-								return ($h & 0x0F) << 18 | (ord($c{$index+1}) & 0x3F) << 12
289
-								| (ord($c{$index+2}) & 0x3F) << 6
290
-								| (ord($c{$index+3}) & 0x3F);
288
+								return ($h & 0x0F) << 18 | (ord($c{$index + 1}) & 0x3F) << 12
289
+								| (ord($c{$index + 2}) & 0x3F) << 6
290
+								| (ord($c{$index + 3}) & 0x3F);
291 291
 							} else {
292 292
 								// pas utf mais renvoyer quand meme ce qu'on a
293 293
 								$bytes = 1;
@@ -309,19 +309,19 @@  discard block
 block discarded – undo
309 309
 		function string2binint($str, $npad = 512) {
310 310
 			$bin = array();
311 311
 			$ords = $this->string2ordUTF8($str, $this->bytesString);
312
-			$npad = $npad/$this->bytesString;
312
+			$npad = $npad / $this->bytesString;
313 313
 			$length = count($ords);
314 314
 			$ords[] = 0x80; // append the "1" bit followed by 7 0's
315
-			$pad = ceil(($length+1+32/$this->bytesString)/$npad)*$npad-32/$this->bytesString;
315
+			$pad = ceil(($length + 1 + 32 / $this->bytesString) / $npad) * $npad - 32 / $this->bytesString;
316 316
 			$ords = array_pad($ords, $pad, 0);
317
-			$mask = (1 << $this->bytesString)-1;
318
-			for ($i = 0; $i < count($ords)*$this->bytesString; $i += $this->bytesString) {
317
+			$mask = (1 << $this->bytesString) - 1;
318
+			for ($i = 0; $i < count($ords) * $this->bytesString; $i += $this->bytesString) {
319 319
 				if (!isset($bin[$i >> 5])) {
320 320
 					$bin[$i >> 5] = 0;
321 321
 				} // pour eviter des notices.
322
-				$bin[$i >> 5] |= ($ords[$i/$this->bytesString] & $mask) << (24-$i%32);
322
+				$bin[$i >> 5] |= ($ords[$i / $this->bytesString] & $mask) << (24 - $i % 32);
323 323
 			}
324
-			$bin[] = $length*$this->bytesString;
324
+			$bin[] = $length * $this->bytesString;
325 325
 
326 326
 			return $bin;
327 327
 		}
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 		 * @return string Hexadecimal representation of the message digest
358 358
 		 */
359 359
 		function hash($str, $ig_func = true) {
360
-			unset($binStr);     // binary representation of input string
361
-			unset($hexStr);     // 256-bit message digest in readable hex format
360
+			unset($binStr); // binary representation of input string
361
+			unset($hexStr); // 256-bit message digest in readable hex format
362 362
 
363 363
 			// check for php's internal sha256 function, ignore if ig_func==true
364 364
 			if ($ig_func == false) {
@@ -378,70 +378,70 @@  discard block
 block discarded – undo
378 378
 			 *  of the first sixtyfour prime numbers.
379 379
 			 */
380 380
 			$K = array(
381
-				(int)0x428a2f98,
382
-				(int)0x71374491,
383
-				(int)0xb5c0fbcf,
384
-				(int)0xe9b5dba5,
385
-				(int)0x3956c25b,
386
-				(int)0x59f111f1,
387
-				(int)0x923f82a4,
388
-				(int)0xab1c5ed5,
389
-				(int)0xd807aa98,
390
-				(int)0x12835b01,
391
-				(int)0x243185be,
392
-				(int)0x550c7dc3,
393
-				(int)0x72be5d74,
394
-				(int)0x80deb1fe,
395
-				(int)0x9bdc06a7,
396
-				(int)0xc19bf174,
397
-				(int)0xe49b69c1,
398
-				(int)0xefbe4786,
399
-				(int)0x0fc19dc6,
400
-				(int)0x240ca1cc,
401
-				(int)0x2de92c6f,
402
-				(int)0x4a7484aa,
403
-				(int)0x5cb0a9dc,
404
-				(int)0x76f988da,
405
-				(int)0x983e5152,
406
-				(int)0xa831c66d,
407
-				(int)0xb00327c8,
408
-				(int)0xbf597fc7,
409
-				(int)0xc6e00bf3,
410
-				(int)0xd5a79147,
411
-				(int)0x06ca6351,
412
-				(int)0x14292967,
413
-				(int)0x27b70a85,
414
-				(int)0x2e1b2138,
415
-				(int)0x4d2c6dfc,
416
-				(int)0x53380d13,
417
-				(int)0x650a7354,
418
-				(int)0x766a0abb,
419
-				(int)0x81c2c92e,
420
-				(int)0x92722c85,
421
-				(int)0xa2bfe8a1,
422
-				(int)0xa81a664b,
423
-				(int)0xc24b8b70,
424
-				(int)0xc76c51a3,
425
-				(int)0xd192e819,
426
-				(int)0xd6990624,
427
-				(int)0xf40e3585,
428
-				(int)0x106aa070,
429
-				(int)0x19a4c116,
430
-				(int)0x1e376c08,
431
-				(int)0x2748774c,
432
-				(int)0x34b0bcb5,
433
-				(int)0x391c0cb3,
434
-				(int)0x4ed8aa4a,
435
-				(int)0x5b9cca4f,
436
-				(int)0x682e6ff3,
437
-				(int)0x748f82ee,
438
-				(int)0x78a5636f,
439
-				(int)0x84c87814,
440
-				(int)0x8cc70208,
441
-				(int)0x90befffa,
442
-				(int)0xa4506ceb,
443
-				(int)0xbef9a3f7,
444
-				(int)0xc67178f2
381
+				(int) 0x428a2f98,
382
+				(int) 0x71374491,
383
+				(int) 0xb5c0fbcf,
384
+				(int) 0xe9b5dba5,
385
+				(int) 0x3956c25b,
386
+				(int) 0x59f111f1,
387
+				(int) 0x923f82a4,
388
+				(int) 0xab1c5ed5,
389
+				(int) 0xd807aa98,
390
+				(int) 0x12835b01,
391
+				(int) 0x243185be,
392
+				(int) 0x550c7dc3,
393
+				(int) 0x72be5d74,
394
+				(int) 0x80deb1fe,
395
+				(int) 0x9bdc06a7,
396
+				(int) 0xc19bf174,
397
+				(int) 0xe49b69c1,
398
+				(int) 0xefbe4786,
399
+				(int) 0x0fc19dc6,
400
+				(int) 0x240ca1cc,
401
+				(int) 0x2de92c6f,
402
+				(int) 0x4a7484aa,
403
+				(int) 0x5cb0a9dc,
404
+				(int) 0x76f988da,
405
+				(int) 0x983e5152,
406
+				(int) 0xa831c66d,
407
+				(int) 0xb00327c8,
408
+				(int) 0xbf597fc7,
409
+				(int) 0xc6e00bf3,
410
+				(int) 0xd5a79147,
411
+				(int) 0x06ca6351,
412
+				(int) 0x14292967,
413
+				(int) 0x27b70a85,
414
+				(int) 0x2e1b2138,
415
+				(int) 0x4d2c6dfc,
416
+				(int) 0x53380d13,
417
+				(int) 0x650a7354,
418
+				(int) 0x766a0abb,
419
+				(int) 0x81c2c92e,
420
+				(int) 0x92722c85,
421
+				(int) 0xa2bfe8a1,
422
+				(int) 0xa81a664b,
423
+				(int) 0xc24b8b70,
424
+				(int) 0xc76c51a3,
425
+				(int) 0xd192e819,
426
+				(int) 0xd6990624,
427
+				(int) 0xf40e3585,
428
+				(int) 0x106aa070,
429
+				(int) 0x19a4c116,
430
+				(int) 0x1e376c08,
431
+				(int) 0x2748774c,
432
+				(int) 0x34b0bcb5,
433
+				(int) 0x391c0cb3,
434
+				(int) 0x4ed8aa4a,
435
+				(int) 0x5b9cca4f,
436
+				(int) 0x682e6ff3,
437
+				(int) 0x748f82ee,
438
+				(int) 0x78a5636f,
439
+				(int) 0x84c87814,
440
+				(int) 0x8cc70208,
441
+				(int) 0x90befffa,
442
+				(int) 0xa4506ceb,
443
+				(int) 0xbef9a3f7,
444
+				(int) 0xc67178f2
445 445
 			);
446 446
 
447 447
 			// Pre-processing: Padding the string
@@ -451,14 +451,14 @@  discard block
 block discarded – undo
451 451
 			$M = $this->array_split($binStr, 16);
452 452
 
453 453
 			// Set the initial hash values
454
-			$h[0] = (int)0x6a09e667;
455
-			$h[1] = (int)0xbb67ae85;
456
-			$h[2] = (int)0x3c6ef372;
457
-			$h[3] = (int)0xa54ff53a;
458
-			$h[4] = (int)0x510e527f;
459
-			$h[5] = (int)0x9b05688c;
460
-			$h[6] = (int)0x1f83d9ab;
461
-			$h[7] = (int)0x5be0cd19;
454
+			$h[0] = (int) 0x6a09e667;
455
+			$h[1] = (int) 0xbb67ae85;
456
+			$h[2] = (int) 0x3c6ef372;
457
+			$h[3] = (int) 0xa54ff53a;
458
+			$h[4] = (int) 0x510e527f;
459
+			$h[5] = (int) 0x9b05688c;
460
+			$h[6] = (int) 0x1f83d9ab;
461
+			$h[7] = (int) 0x5be0cd19;
462 462
 
463 463
 			// loop through message blocks and compute hash. ( For i=1 to N : )
464 464
 			$N = count($M);
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
 				$MI = $M[$i];
468 468
 
469 469
 				// Initialize working variables
470
-				$_a = (int)$h[0];
471
-				$_b = (int)$h[1];
472
-				$_c = (int)$h[2];
473
-				$_d = (int)$h[3];
474
-				$_e = (int)$h[4];
475
-				$_f = (int)$h[5];
476
-				$_g = (int)$h[6];
477
-				$_h = (int)$h[7];
470
+				$_a = (int) $h[0];
471
+				$_b = (int) $h[1];
472
+				$_c = (int) $h[2];
473
+				$_d = (int) $h[3];
474
+				$_e = (int) $h[4];
475
+				$_f = (int) $h[5];
476
+				$_g = (int) $h[6];
477
+				$_h = (int) $h[7];
478 478
 				unset($_s0);
479 479
 				unset($_s1);
480 480
 				unset($_T1);
@@ -504,12 +504,12 @@  discard block
 block discarded – undo
504 504
 
505 505
 				for (; $t < 64; $t++) {
506 506
 					// Continue building the message schedule as we loop
507
-					$_s0 = $W[($t+1) & 0x0F];
507
+					$_s0 = $W[($t + 1) & 0x0F];
508 508
 					$_s0 = $this->sigma_0($_s0);
509
-					$_s1 = $W[($t+14) & 0x0F];
509
+					$_s1 = $W[($t + 14) & 0x0F];
510 510
 					$_s1 = $this->sigma_1($_s1);
511 511
 
512
-					$W[$t & 0xF] = $this->addmod2n($this->addmod2n($this->addmod2n($W[$t & 0xF], $_s0), $_s1), $W[($t+9) & 0x0F]);
512
+					$W[$t & 0xF] = $this->addmod2n($this->addmod2n($this->addmod2n($W[$t & 0xF], $_s0), $_s1), $W[($t + 9) & 0x0F]);
513 513
 
514 514
 					// Compute hash
515 515
 					$_T1 = $this->addmod2n($this->addmod2n($this->addmod2n($this->addmod2n($_h, $this->Sigma1($_e)),
Please login to merge, or discard this patch.
ecrire/prive.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 		// On reexecute pour deboucher sur le include public.
27 27
 		// autrement on insiste
28 28
 		if (is_array($var_auth)) {
29
-			$var_auth = '../?' . $_SERVER['QUERY_STRING'];
29
+			$var_auth = '../?'.$_SERVER['QUERY_STRING'];
30 30
 			spip_setcookie('spip_session', $_COOKIE['spip_session'], time() + 3600 * 24 * 14);
31 31
 		}
32 32
 		include_spip('inc/headers');
Please login to merge, or discard this patch.
ecrire/plugins/afficher_nom_plugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 	// numerotons les occurences d'un meme prefix
40 40
 	$versions[$info['prefix']] = isset($versions[$info['prefix']]) ? $versions[$info['prefix']] + 1 : '';
41
-	$id = $info['prefix'] . $versions[$info['prefix']];
41
+	$id = $info['prefix'].$versions[$info['prefix']];
42 42
 
43 43
 	$class = $class_li;
44 44
 	$class .= $actif ? " actif" : "";
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 	$prefix = $info['prefix'];
56 56
 	$dir = "$dir_plugins$plug_file/lang/$prefix";
57 57
 	$desc = plugin_propre($info['description'], $dir);
58
-	$url_stat = parametre_url($url_page, "plugin", $dir_plugins . $plug_file);
58
+	$url_stat = parametre_url($url_page, "plugin", $dir_plugins.$plug_file);
59 59
 
60
-	$s .= "<strong class='nom'>" . typo($info['nom']) . "</strong>";
61
-	$s .= " <span class='version'>" . $info['version'] . "</span>";
62
-	$s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . "</span>";
60
+	$s .= "<strong class='nom'>".typo($info['nom'])."</strong>";
61
+	$s .= " <span class='version'>".$info['version']."</span>";
62
+	$s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat'])."</span>";
63 63
 	$s .= "</div>";
64 64
 
65 65
 	if ($erreur) {
66
-		$s .= "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
66
+		$s .= "<div class='erreur'>".join('<br >', $info['erreur'])."</div>";
67 67
 	}
68 68
 
69 69
 	$s .= "</li>";
Please login to merge, or discard this patch.
ecrire/plugins/installer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	}
66 66
 	$dir = constant($dir);
67 67
 	foreach ($infos['install'] as $file) {
68
-		$file = $dir . $plug . "/" . trim($file);
68
+		$file = $dir.$plug."/".trim($file);
69 69
 		if (file_exists($file)) {
70 70
 			include_once($file);
71 71
 		}
72 72
 	}
73 73
 	$version = isset($infos['schema']) ? $infos['schema'] : '';
74 74
 	$arg = $infos;
75
-	$f = $infos['prefix'] . "_install";
75
+	$f = $infos['prefix']."_install";
76 76
 	if (!function_exists($f)) {
77 77
 		$f = isset($infos['schema']) ? 'spip_plugin_install' : '';
78 78
 	} else {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		return true;
95 95
 	}
96 96
 	// Si install et que l'on a la meta d'installation, c'est un upgrade
97
-	if ($action == 'install' && !is_null(lire_meta($infos['prefix'] . '_base_version'))) {
97
+	if ($action == 'install' && !is_null(lire_meta($infos['prefix'].'_base_version'))) {
98 98
 		$infos['upgrade'] = true;
99 99
 	}
100 100
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	if (isset($infos['meta']) and (($table = $infos['meta']) !== 'meta')) {
121 121
 		$nom_meta = "base_version";
122 122
 	} else {
123
-		$nom_meta = $prefix . "_base_version";
123
+		$nom_meta = $prefix."_base_version";
124 124
 		$table = 'meta';
125 125
 	}
126 126
 	switch ($action) {
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 				and spip_version_compare($GLOBALS[$table][$nom_meta], $version_cible, '>='));
131 131
 			break;
132 132
 		case 'install':
133
-			if (function_exists($upgrade = $prefix . "_upgrade")) {
133
+			if (function_exists($upgrade = $prefix."_upgrade")) {
134 134
 				$upgrade($nom_meta, $version_cible, $table);
135 135
 			}
136 136
 			break;
137 137
 		case 'uninstall':
138
-			if (function_exists($vider_tables = $prefix . "_vider_tables")) {
138
+			if (function_exists($vider_tables = $prefix."_vider_tables")) {
139 139
 				$vider_tables($nom_meta, $table);
140 140
 			}
141 141
 			break;
Please login to merge, or discard this patch.
ecrire/plugins/infos_plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 	if (isset($arbre['erreur'])) {
123 123
 		$ret['erreur'] = $arbre['erreur'];
124 124
 		if ($plug) {
125
-			spip_log("infos_plugin $plug " . @join(' ', $arbre['erreur']));
125
+			spip_log("infos_plugin $plug ".@join(' ', $arbre['erreur']));
126 126
 		}
127 127
 	}
128 128
 
Please login to merge, or discard this patch.
ecrire/plugins/get_infos.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	static $filecache = '';
38 38
 
39 39
 	if ($cache === '') {
40
-		$filecache = _DIR_TMP . "plugin_xml_cache.gz";
40
+		$filecache = _DIR_TMP."plugin_xml_cache.gz";
41 41
 		if (is_file($filecache)) {
42 42
 			lire_fichier($filecache, $contenu);
43 43
 			$cache = unserialize($contenu);
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
 
92 92
 function plugins_get_infos_un($plug, $reload, $dir, &$cache) {
93
-	if (!is_readable($file = "$dir$plug/" . ($desc = "paquet") . ".xml")) {
94
-		if (!is_readable($file = "$dir$plug/" . ($desc = "plugin") . ".xml")) {
93
+	if (!is_readable($file = "$dir$plug/".($desc = "paquet").".xml")) {
94
+		if (!is_readable($file = "$dir$plug/".($desc = "plugin").".xml")) {
95 95
 			return false;
96 96
 		}
97 97
 	}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		return false;
119 119
 	}
120 120
 
121
-	$f = charger_fonction('infos_' . $desc, 'plugins');
121
+	$f = charger_fonction('infos_'.$desc, 'plugins');
122 122
 	$ret = $f($texte, $plug, $dir);
123 123
 	$ret['filemtime'] = $time;
124 124
 	$ret['md5_file'] = $md5;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	if (isset($ret['prefix']) and $ret['prefix'] == 'spip') {
129 129
 		$ret['procure']['php'] = array('nom' => 'php', 'version' => phpversion());
130 130
 		foreach (get_loaded_extensions() as $ext) {
131
-			$ret['procure']['php:' . $ext] = array('nom' => 'php:' . $ext, 'version' => phpversion($ext));
131
+			$ret['procure']['php:'.$ext] = array('nom' => 'php:'.$ext, 'version' => phpversion($ext));
132 132
 		}
133 133
 	}
134 134
 	$diff = ($ret != $pcache);
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +33 added lines, -34 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 		$class_li .= " error";
57 57
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'",
58 58
 				_T('plugin_info_erreur_xml'))
59
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
59
+			. "<div class='erreur'>".join('<br >', $info['erreur'])."</div>";
60 60
 		$checkable = false;
61
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
61
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
62 62
 		$class_li .= " error";
63 63
 		$erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)),
64 64
 				" class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom)))
65
-			. "<div class='erreur'>" . implode("<br />",
66
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>";
65
+			. "<div class='erreur'>".implode("<br />",
66
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])."</div>";
67 67
 	} else {
68 68
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : "";
69 69
 	}
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	// numerotons les occurrences d'un meme prefix
72 72
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? $versions[$prefix] + 1 : '';
73 73
 
74
-	$class_li .= ($actif ? " actif" : "") . ($expose ? " on" : "");
74
+	$class_li .= ($actif ? " actif" : "").($expose ? " on" : "");
75 75
 
76 76
 	return "<li id='$prefix$id' class='$class_li'>"
77 77
 	. ((!$checkable and !$checked)
78
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
78
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
79 79
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
80 80
 	. $cfg
81 81
 	. $erreur
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	$prefix = strtolower($infos['prefix']);
94 94
 	// si plugin.xml fournit un squelette, le prendre
95 95
 	if (isset($infos['config']) and $infos['config']) {
96
-		return recuperer_fond("$dir$nom/" . $infos['config'],
96
+		return recuperer_fond("$dir$nom/".$infos['config'],
97 97
 			array(
98
-				'script' => 'configurer_' . $prefix,
98
+				'script' => 'configurer_'.$prefix,
99 99
 				'nom' => $nom
100 100
 			));
101 101
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	// sinon prendre le squelette std sur le nom std
114 114
 	return recuperer_fond("prive/squelettes/inclure/cfg",
115 115
 		array(
116
-			'script' => 'configurer_' . $prefix,
116
+			'script' => 'configurer_'.$prefix,
117 117
 			'nom' => $nom
118 118
 		));
119 119
 }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
129 129
 	. ($actif ? " checked='checked'" : "")
130 130
 	. " class='checkbox'  value='O' />"
131
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . "</label>"
131
+	. "\n<label for='label_$id_input'>"._T('activer_plugin')."</label>"
132 132
 	. "</div>";
133 133
 }
134 134
 
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 	. "<h3><a href='$url' rel='info'>"
177 177
 	. $nom
178 178
 	. "</a></h3>"
179
-	. " <span class='version'>" . $info['version'] . "</span>"
179
+	. " <span class='version'>".$info['version']."</span>"
180 180
 	. " <span class='etat'> - "
181 181
 	. plugin_etat_en_clair($info['etat'])
182 182
 	. "</span>"
183
-	. "<div class='short'>" . $slogan . "</div>"
183
+	. "<div class='short'>".$slogan."</div>"
184 184
 	. $i
185 185
 	. "</div>";
186 186
 }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	$text2 = _T('info_desinstaller_plugin');
196 196
 	$file = basename($plug_file);
197 197
 
198
-	return "<div class='actions'>[" .
198
+	return "<div class='actions'>[".
199 199
 	"<a href='$action'
200 200
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
201 201
 	. $text
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$etat = 'developpement';
218 218
 	}
219 219
 
220
-	return _T('plugin_etat_' . $etat);
220
+	return _T('plugin_etat_'.$etat);
221 221
 }
222 222
 
223 223
 // http://code.spip.net/@plugin_propre
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$module = substr($module, strlen(_DIR_RACINE));
228 228
 	}
229 229
 	if (preg_match("|^\w+_[\w_]+$|", $texte)) {
230
-		$texte = _T(($module ? "$module:" : '') . $texte, array(), array('force' => false));
230
+		$texte = _T(($module ? "$module:" : '').$texte, array(), array('force' => false));
231 231
 	}
232 232
 
233 233
 	return propre($texte);
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 	if (isset($info['documentation'])
255 255
 		and $lien = $info['documentation']
256 256
 	) {
257
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
257
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
258 258
 	}
259
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
259
+	$s .= "<dd class='desc'>".$description."</dd>\n";
260 260
 
261 261
 	if (isset($info['auteur'])) {
262 262
 		if (is_array($info['auteur'])) {
@@ -266,15 +266,15 @@  discard block
 block discarded – undo
266 266
 			$a = trim($info['auteur']);
267 267
 		}
268 268
 		if ($a) {
269
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre($a,
270
-					$dir)) . "</dd>\n";
269
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre($a,
270
+					$dir))."</dd>\n";
271 271
 		}
272 272
 	}
273 273
 
274 274
 	if (isset($info['credit'])) {
275 275
 		if ($a = formater_credits($info['credit'], ', ')) {
276
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre($a,
277
-					$dir)) . "</dd>\n";
276
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre($a,
277
+					$dir))."</dd>\n";
278 278
 		}
279 279
 	}
280 280
 
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
 			$a = trim($info['licence']);
287 287
 		}
288 288
 		if ($a) {
289
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre($a,
290
-					$dir)) . "</dd>\n";
289
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre($a,
290
+					$dir))."</dd>\n";
291 291
 		}
292 292
 	}
293 293
 
@@ -298,23 +298,22 @@  discard block
 block discarded – undo
298 298
 	//
299 299
 	$infotech = array();
300 300
 
301
-	$version = "<dt>" . _T('version') . "</dt><dd>" . $info['version'];
301
+	$version = "<dt>"._T('version')."</dt><dd>".$info['version'];
302 302
 	// Version SVN
303
-	if ($svn_revision = version_svn_courante($dir_plugins . $plug_file)) {
304
-		$version .= ($svn_revision < 0 ? ' SVN' : '') . ' [' . abs($svn_revision) . ']';
303
+	if ($svn_revision = version_svn_courante($dir_plugins.$plug_file)) {
304
+		$version .= ($svn_revision < 0 ? ' SVN' : '').' ['.abs($svn_revision).']';
305 305
 	}
306 306
 	$version .= "</dd>";
307 307
 	$infotech[] = $version;
308
-	$infotech[] = "<dt>" . _T('repertoire_plugins') . "</dt><dd>" . joli_repertoire("$dir_plugins$plug_file") . "</dd>";
308
+	$infotech[] = "<dt>"._T('repertoire_plugins')."</dt><dd>".joli_repertoire("$dir_plugins$plug_file")."</dd>";
309 309
 	// source zip le cas echeant
310
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log)
310
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log)
311 311
 		and preg_match(',^source:(.*)$,m', $log, $r))
312
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . "</dd>"
312
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1])."</dd>"
313 313
 		: '';
314 314
 
315
-	$infotech[] = !$info['necessite'] ? '' :
316
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(' ',
317
-				array_map('array_shift', $info['necessite'])) . '</dd>');
315
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(' ',
316
+				array_map('array_shift', $info['necessite'])).'</dd>');
318 317
 
319 318
 	$s .= "<dl class='tech'>"
320 319
 		. join('', $infotech)
@@ -335,8 +334,8 @@  discard block
 block discarded – undo
335 334
 		$texte .=
336 335
 			(!is_array($_credit))
337 336
 				? PtoBR(propre($_credit))
338
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
339
-				$_credit['nom'] .
337
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
338
+				$_credit['nom'].
340 339
 				($_credit['url'] ? '</a>' : '');
341 340
 	}
342 341
 
Please login to merge, or discard this patch.
ecrire/plugins/verifie_conformite.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		}
48 48
 	}
49 49
 	if (is_null($p)) {
50
-		$arbre = array('erreur' => array(_T('erreur_plugin_tag_plugin_absent') . " : $plug"));
50
+		$arbre = array('erreur' => array(_T('erreur_plugin_tag_plugin_absent')." : $plug"));
51 51
 		$silence = true;
52 52
 	} else {
53 53
 		$arbre = $p;
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 		if (isset($arbre['etat'])) {
83 83
 			$etat = trim(end($arbre['etat']));
84 84
 			if (!in_array($etat, $etats)) {
85
-				$arbre['erreur'][] = _T('erreur_plugin_etat_inconnu') . " : '$etat'";
85
+				$arbre['erreur'][] = _T('erreur_plugin_etat_inconnu')." : '$etat'";
86 86
 			}
87 87
 		}
88 88
 		if (isset($arbre['options'])) {
89 89
 			foreach ($arbre['options'] as $optfile) {
90 90
 				$optfile = trim($optfile);
91
-				if (!@is_readable($dir_plugins . "$plug/$optfile")) {
91
+				if (!@is_readable($dir_plugins."$plug/$optfile")) {
92 92
 					if (!$silence) {
93
-						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $optfile";
93
+						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $optfile";
94 94
 					}
95 95
 				}
96 96
 			}
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 		if (isset($arbre['fonctions'])) {
99 99
 			foreach ($arbre['fonctions'] as $optfile) {
100 100
 				$optfile = trim($optfile);
101
-				if (!@is_readable($dir_plugins . "$plug/$optfile")) {
101
+				if (!@is_readable($dir_plugins."$plug/$optfile")) {
102 102
 					if (!$silence) {
103
-						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $optfile";
103
+						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $optfile";
104 104
 					}
105 105
 				}
106 106
 			}
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 			// verif que la methode a un nom autorise
135 135
 			if (in_array(strtolower($action), $liste_methodes_reservees)) {
136 136
 				if (!$silence) {
137
-					$arbre['erreur'][] = _T("erreur_plugin_nom_fonction_interdit") . " : $action";
137
+					$arbre['erreur'][] = _T("erreur_plugin_nom_fonction_interdit")." : $action";
138 138
 				}
139 139
 			}
140 140
 			if (isset($pipe['inclure'])) {
141
-				$inclure = $dir_plugins . "$plug/" . $pipe['inclure'];
141
+				$inclure = $dir_plugins."$plug/".$pipe['inclure'];
142 142
 				if (!@is_readable($inclure)) {
143 143
 					if (!$silence) {
144
-						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $inclure";
144
+						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $inclure";
145 145
 					}
146 146
 				}
147 147
 			}
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
 			foreach ($arbre['noisette'] as $k => $nut) {
208 208
 				$nut = preg_replace(',[.]html$,uims', '', trim($nut));
209 209
 				$arbre['noisette'][$k] = $nut;
210
-				if (!@is_readable($dir_plugins . "$plug/$nut.html")) {
210
+				if (!@is_readable($dir_plugins."$plug/$nut.html")) {
211 211
 					if (!$silence) {
212
-						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent') . " : $nut";
212
+						$arbre['erreur'][] = _T('erreur_plugin_fichier_absent')." : $nut";
213 213
 					}
214 214
 				}
215 215
 			}
Please login to merge, or discard this patch.
ecrire/plugins/afficher_repertoires.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 				$plug = $liste_plugins[$key];
59 59
 				$actif = @isset($fast_liste_plugins_actifs[$plug]);
60 60
 				$id = substr(md5($plug), 0, 16);
61
-				$res .= $ligne_plug($url_page, str_replace(_DIR_PLUGINS, '', _DIR_RACINE . $plug), $actif,
62
-						'menu-entree') . "\n";
61
+				$res .= $ligne_plug($url_page, str_replace(_DIR_PLUGINS, '', _DIR_RACINE.$plug), $actif,
62
+						'menu-entree')."\n";
63 63
 				unset($liste_plugins[$key]);
64 64
 			}
65 65
 		}
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 	$chemin = "";
103 103
 	if (count($tcom)) {
104
-		$chemin .= implode("/", $tcom) . "/";
104
+		$chemin .= implode("/", $tcom)."/";
105 105
 	}
106 106
 	// ouvrir les repertoires jusqu'a la cible
107 107
 	while ($open = array_shift($ttarg)) {
108
-		$visible = @isset($deplie[$chemin . $open]);
109
-		$chemin .= $open . "/";
108
+		$visible = @isset($deplie[$chemin.$open]);
109
+		$chemin .= $open."/";
110 110
 		$output .= "<li>";
111 111
 		$output .= bouton_block_depliable($chemin, $visible);
112 112
 		$output .= debut_block_depliable($visible);
Please login to merge, or discard this patch.