Completed
Push — master ( d64163...2218f7 )
by cam
04:20
created
ecrire/install/etape_3b.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 		if ($echec) {
49 49
 			echo minipres(
50 50
 				'AUTO',
51
-				info_progression_etape(3, 'etape_', 'install/', true) .
52
-				"<div class='error'><h3>$echec</h3>\n" .
53
-				'<p>' . _T('avis_connexion_echec_2') . '</p>' .
51
+				info_progression_etape(3, 'etape_', 'install/', true).
52
+				"<div class='error'><h3>$echec</h3>\n".
53
+				'<p>'._T('avis_connexion_echec_2').'</p>'.
54 54
 				'</div>'
55 55
 			);
56 56
 			exit;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		$htpass = generer_htpass($pass);
87 87
 		$alea_actuel = creer_uniqid();
88 88
 		$alea_futur = creer_uniqid();
89
-		$shapass = spip_sha256($alea_actuel . $pass);
89
+		$shapass = spip_sha256($alea_actuel.$pass);
90 90
 		// prelablement, creer le champ webmestre si il n'existe pas (install neuve
91 91
 		// sur une vieille base
92 92
 		$t = sql_showtable('spip_auteurs', true);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			@sql_alter("TABLE spip_auteurs ADD webmestre varchar(3)  DEFAULT 'non' NOT NULL");
95 95
 		}
96 96
 
97
-		$id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login));
97
+		$id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($login));
98 98
 		if ($id_auteur !== null) {
99 99
 			sql_updateq('spip_auteurs', array(
100 100
 				'nom' => $nom,
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		if (!$auteur = auth_identifier_login($login, $pass)
134 134
 			or !auth_loger($auteur, true)
135 135
 		) {
136
-			spip_log("login automatique impossible $auth_spip $session" . count($row));
136
+			spip_log("login automatique impossible $auth_spip $session".count($row));
137 137
 		}
138 138
 	}
139 139
 
Please login to merge, or discard this patch.
ecrire/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 // Determiner l'action demandee
36 36
 //
37 37
 
38
-$exec = (string)_request('exec');
38
+$exec = (string) _request('exec');
39 39
 $reinstall = (!is_null(_request('reinstall'))) ? _request('reinstall') : ($exec == 'install' ? 'oui' : null);
40 40
 //
41 41
 // Les scripts d'insallation n'authentifient pas, forcement,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 if (_request('action') or _request('var_ajax') or _request('formulaire_action')) {
67
-	if (!autoriser_sans_cookie($exec)){
67
+	if (!autoriser_sans_cookie($exec)) {
68 68
 		// Charger l'aiguilleur qui va mettre sur la bonne voie les traitements derogatoires
69 69
 		include_spip('public/aiguiller');
70 70
 		if (
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 			or
77 77
 			// cas des formulaires charger/verifier/traiter
78 78
 			traiter_formulaires_dynamiques()
79
-		){
79
+		) {
80 80
 			exit;
81 81
 		} // le hit est fini !
82 82
 	}
83 83
 }
84 84
 // securiser les redirect du back-office
85 85
 if (_request('redirect')) {
86
-	if (!function_exists('securiser_redirect_action')){
86
+	if (!function_exists('securiser_redirect_action')) {
87 87
 		include_spip('public/aiguiller');
88 88
 	}
89
-	set_request('redirect',securiser_redirect_action(_request('redirect')));
89
+	set_request('redirect', securiser_redirect_action(_request('redirect')));
90 90
 }
91 91
 
92 92
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 			or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo')
120 120
 		)
121 121
 	) {
122
-		spip_log("Quand la meta admin vaut " .
123
-			$GLOBALS['meta']["admin"] .
124
-			" seul un admin peut se connecter et sans AJAX." .
122
+		spip_log("Quand la meta admin vaut ".
123
+			$GLOBALS['meta']["admin"].
124
+			" seul un admin peut se connecter et sans AJAX.".
125 125
 			" En cas de probleme, detruire cette meta.");
126 126
 		die(_T('info_travaux_texte'));
127 127
 	}
Please login to merge, or discard this patch.
ecrire/inc/charsets.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		}
74 74
 	}
75 75
 
76
-	if (find_in_path($charset . '.php', 'charsets/', true)) {
76
+	if (find_in_path($charset.'.php', 'charsets/', true)) {
77 77
 		return $charset;
78 78
 	} else {
79 79
 		spip_log("Erreur: pas de fichier de conversion 'charsets/$charset'");
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	static $pcre_ok = 0;
160 160
 
161 161
 	if (!$pcre_ok) {
162
-		$s = " " . chr(195) . chr(169) . "t" . chr(195) . chr(169) . " ";
162
+		$s = " ".chr(195).chr(169)."t".chr(195).chr(169)." ";
163 163
 		if (preg_match(',\W...\W,u', $s)) {
164 164
 			$pcre_ok = 1;
165 165
 		} else {
@@ -260,38 +260,38 @@  discard block
 block discarded – undo
260 260
 
261 261
 	if (!isset($trans[$charset][$charset_cible])) {
262 262
 		$trans[$charset][$charset_cible] = array(
263
-			$p . chr(128) => "&#8364;",
264
-			$p . chr(129) => ' ', # pas affecte
265
-			$p . chr(130) => "&#8218;",
266
-			$p . chr(131) => "&#402;",
267
-			$p . chr(132) => "&#8222;",
268
-			$p . chr(133) => "&#8230;",
269
-			$p . chr(134) => "&#8224;",
270
-			$p . chr(135) => "&#8225;",
271
-			$p . chr(136) => "&#710;",
272
-			$p . chr(137) => "&#8240;",
273
-			$p . chr(138) => "&#352;",
274
-			$p . chr(139) => "&#8249;",
275
-			$p . chr(140) => "&#338;",
276
-			$p . chr(141) => ' ', # pas affecte
277
-			$p . chr(142) => "&#381;",
278
-			$p . chr(143) => ' ', # pas affecte
279
-			$p . chr(144) => ' ', # pas affecte
280
-			$p . chr(145) => "&#8216;",
281
-			$p . chr(146) => "&#8217;",
282
-			$p . chr(147) => "&#8220;",
283
-			$p . chr(148) => "&#8221;",
284
-			$p . chr(149) => "&#8226;",
285
-			$p . chr(150) => "&#8211;",
286
-			$p . chr(151) => "&#8212;",
287
-			$p . chr(152) => "&#732;",
288
-			$p . chr(153) => "&#8482;",
289
-			$p . chr(154) => "&#353;",
290
-			$p . chr(155) => "&#8250;",
291
-			$p . chr(156) => "&#339;",
292
-			$p . chr(157) => ' ', # pas affecte
293
-			$p . chr(158) => "&#382;",
294
-			$p . chr(159) => "&#376;",
263
+			$p.chr(128) => "&#8364;",
264
+			$p.chr(129) => ' ', # pas affecte
265
+			$p.chr(130) => "&#8218;",
266
+			$p.chr(131) => "&#402;",
267
+			$p.chr(132) => "&#8222;",
268
+			$p.chr(133) => "&#8230;",
269
+			$p.chr(134) => "&#8224;",
270
+			$p.chr(135) => "&#8225;",
271
+			$p.chr(136) => "&#710;",
272
+			$p.chr(137) => "&#8240;",
273
+			$p.chr(138) => "&#352;",
274
+			$p.chr(139) => "&#8249;",
275
+			$p.chr(140) => "&#338;",
276
+			$p.chr(141) => ' ', # pas affecte
277
+			$p.chr(142) => "&#381;",
278
+			$p.chr(143) => ' ', # pas affecte
279
+			$p.chr(144) => ' ', # pas affecte
280
+			$p.chr(145) => "&#8216;",
281
+			$p.chr(146) => "&#8217;",
282
+			$p.chr(147) => "&#8220;",
283
+			$p.chr(148) => "&#8221;",
284
+			$p.chr(149) => "&#8226;",
285
+			$p.chr(150) => "&#8211;",
286
+			$p.chr(151) => "&#8212;",
287
+			$p.chr(152) => "&#732;",
288
+			$p.chr(153) => "&#8482;",
289
+			$p.chr(154) => "&#353;",
290
+			$p.chr(155) => "&#8250;",
291
+			$p.chr(156) => "&#339;",
292
+			$p.chr(157) => ' ', # pas affecte
293
+			$p.chr(158) => "&#382;",
294
+			$p.chr(159) => "&#376;",
295 295
 		);
296 296
 		if ($charset_cible != 'unicode') {
297 297
 			foreach ($trans[$charset][$charset_cible] as $k => $c) {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 					and is_array($GLOBALS['CHARSET'][$cset])
422 422
 				) {
423 423
 					foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) {
424
-						$trans[$charset][chr($key)] = '&#' . $val . ';';
424
+						$trans[$charset][chr($key)] = '&#'.$val.';';
425 425
 					}
426 426
 				}
427 427
 			}
@@ -488,11 +488,11 @@  discard block
 block discarded – undo
488 488
 					$h = dechex($e);
489 489
 					if ($s = isset($CHARSET_REVERSE[$charset][$e])) {
490 490
 						$s = $CHARSET_REVERSE[$charset][$e];
491
-						$t['&#' . $e . ';'] = $t['&#0' . $e . ';'] = $t['&#00' . $e . ';'] = chr($s);
492
-						$t['&#x' . $h . ';'] = $t['&#x0' . $h . ';'] = $t['&#x00' . $h . ';'] = chr($s);
491
+						$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($s);
492
+						$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($s);
493 493
 					} else {
494
-						$t['&#' . $e . ';'] = $t['&#0' . $e . ';'] = $t['&#00' . $e . ';'] = chr($e);
495
-						$t['&#x' . $h . ';'] = $t['&#x0' . $h . ';'] = $t['&#x00' . $h . ';'] = chr($e);
494
+						$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($e);
495
+						$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($e);
496 496
 					}
497 497
 				}
498 498
 			}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 				and is_array($GLOBALS['CHARSET'][$cset])
537 537
 			) {
538 538
 				foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) {
539
-					$trans[$charset][chr($key)] = unicode2charset('&#' . $val . ';');
539
+					$trans[$charset][chr($key)] = unicode2charset('&#'.$val.';');
540 540
 				}
541 541
 			}
542 542
 		}
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 				}
644 644
 				$thisPos++;
645 645
 			}
646
-			$encodedLetter = "&#" . preg_replace('/^0+/', '', $decimalCode) . ';';
646
+			$encodedLetter = "&#".preg_replace('/^0+/', '', $decimalCode).';';
647 647
 			$encodedString .= $encodedLetter;
648 648
 		}
649 649
 	}
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 			} // ignorer le BOM - http://www.unicode.org/faq/utf_bom.html
687 687
 			else {
688 688
 				if ($word != 65279) {
689
-					$texte .= '&#' . $word . ';';
689
+					$texte .= '&#'.$word.';';
690 690
 				}
691 691
 			}
692 692
 		}
@@ -715,13 +715,13 @@  discard block
 block discarded – undo
715 715
 		return chr($num);
716 716
 	}
717 717
 	if ($num < 2048) {
718
-		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
718
+		return chr(($num >> 6) + 192).chr(($num & 63) + 128);
719 719
 	}
720 720
 	if ($num < 65536) {
721
-		return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
721
+		return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
722 722
 	}
723 723
 	if ($num < 1114112) {
724
-		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
724
+		return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
725 725
 	}
726 726
 
727 727
 	return '';
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 	while (preg_match(',&#0*([0-9]+);,S', $texte, $regs) and !isset($vu[$regs[1]])) {
778 778
 		$num = $regs[1];
779 779
 		$vu[$num] = true;
780
-		$s = '\u' . sprintf("%04x", $num);
780
+		$s = '\u'.sprintf("%04x", $num);
781 781
 		$texte = str_replace($regs[0], $s, $texte);
782 782
 	}
783 783
 
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
  **/
795 795
 function javascript_to_unicode($texte) {
796 796
 	while (preg_match(",%u([0-9A-F][0-9A-F][0-9A-F][0-9A-F]),", $texte, $regs)) {
797
-		$texte = str_replace($regs[0], "&#" . hexdec($regs[1]) . ";", $texte);
797
+		$texte = str_replace($regs[0], "&#".hexdec($regs[1]).";", $texte);
798 798
 	}
799 799
 
800 800
 	return $texte;
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 		return $texte;
840 840
 	}
841 841
 
842
-	$table_translit = 'translit' . $complexe;
842
+	$table_translit = 'translit'.$complexe;
843 843
 
844 844
 	// 2. Translitterer grace a la table predefinie
845 845
 	if (!isset($trans[$complexe])) {
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
  *    true s'il a un BOM
931 931
  **/
932 932
 function bom_utf8($texte) {
933
-	return (substr($texte, 0, 3) == chr(0xEF) . chr(0xBB) . chr(0xBF));
933
+	return (substr($texte, 0, 3) == chr(0xEF).chr(0xBB).chr(0xBF));
934 934
 }
935 935
 
936 936
 /**
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		// on prend n fois la longueur desiree, pour etre surs d'avoir tout
1126 1126
 		// (un caractere utf-8 prenant au maximum n bytes)
1127 1127
 		$n = 0;
1128
-		while (preg_match(',[\x80-\xBF]{' . (++$n) . '},', $c)) {
1128
+		while (preg_match(',[\x80-\xBF]{'.(++$n).'},', $c)) {
1129 1129
 			;
1130 1130
 		}
1131 1131
 		$c = substr($c, 0, $n * $length);
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 
1160 1160
 	$lettre1 = mb_strtoupper(spip_substr($c, 0, 1));
1161 1161
 
1162
-	return $lettre1 . spip_substr($c, 1);
1162
+	return $lettre1.spip_substr($c, 1);
1163 1163
 }
1164 1164
 
1165 1165
 /**
Please login to merge, or discard this patch.
ecrire/inc/idna_convert.class.php 1 patch
Spacing   +43 added lines, -46 removed lines patch added patch discarded remove patch
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
     protected $_lcount = 19;
74 74
     protected $_vcount = 21;
75 75
     protected $_tcount = 28;
76
-    protected $_ncount = 588;   // _vcount * _tcount
76
+    protected $_ncount = 588; // _vcount * _tcount
77 77
     protected $_scount = 11172; // _lcount * _tcount * _vcount
78 78
     protected $_error = false;
79 79
     protected static $_mb_string_overload = null;
80 80
     // See {@link set_paramter()} for details of how to change the following
81 81
     // settings from within your script / application
82
-    protected $_api_encoding = 'utf8';   // Default input charset is UTF-8
83
-    protected $_allow_overlong = false;  // Overlong UTF-8 encodings are forbidden
84
-    protected $_strict_mode = false;     // Behave strict or not
85
-    protected $_idn_version = 2003;      // Can be either 2003 (old, default) or 2008
82
+    protected $_api_encoding = 'utf8'; // Default input charset is UTF-8
83
+    protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden
84
+    protected $_strict_mode = false; // Behave strict or not
85
+    protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008
86 86
 
87 87
     /**
88 88
      * the constructor
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                             $this->_api_encoding = $v;
141 141
                             break;
142 142
                         default:
143
-                            $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k);
143
+                            $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
144 144
                             return false;
145 145
                     }
146 146
                     break;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                     if (in_array($v, array('2003', '2008'))) {
155 155
                         $this->_idn_version = $v;
156 156
                     } else {
157
-                        $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k);
157
+                        $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
158 158
                     }
159 159
                     break;
160 160
                 case 'encode_german_sz': // Deprecated
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                     }
166 166
                     break;
167 167
                 default:
168
-                    $this->_error('Set Parameter: Unknown option ' . $k);
168
+                    $this->_error('Set Parameter: Unknown option '.$k);
169 169
                     return false;
170 170
             }
171 171
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 case 'ucs4_array':
189 189
                     break;
190 190
                 default:
191
-                    $this->_error('Unknown encoding ' . $one_time_encoding);
191
+                    $this->_error('Unknown encoding '.$one_time_encoding);
192 192
                     return false;
193 193
             }
194 194
         }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             list ($email_pref, $input) = explode('@', $input, 2);
207 207
             $arr = explode('.', $input);
208 208
             foreach ($arr as $k => $v) {
209
-                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
209
+                if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
210 210
                     $conv = $this->_decode($v);
211 211
                     if ($conv) {
212 212
                         $arr[$k] = $conv;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $input = join('.', $arr);
217 217
             $arr = explode('.', $email_pref);
218 218
             foreach ($arr as $k => $v) {
219
-                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
219
+                if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
220 220
                     $conv = $this->_decode($v);
221 221
                     if ($conv) {
222 222
                         $arr[$k] = $conv;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 }
225 225
             }
226 226
             $email_pref = join('.', $arr);
227
-            $return = $email_pref . '@' . $input;
227
+            $return = $email_pref.'@'.$input;
228 228
         } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
229 229
             // No no in strict mode
230 230
             if ($this->_strict_mode) {
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
                     }
242 242
                 }
243 243
                 $parsed['host'] = join('.', $arr);
244
-                $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')).
245
-                        (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@').
244
+                $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')).
245
+                        (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@').
246 246
                         $parsed['host'].
247
-                        (empty($parsed['port']) ? '' : ':' . $parsed['port']).
247
+                        (empty($parsed['port']) ? '' : ':'.$parsed['port']).
248 248
                         (empty($parsed['path']) ? '' : $parsed['path']).
249
-                        (empty($parsed['query']) ? '' : '?' . $parsed['query']).
250
-                        (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']);
249
+                        (empty($parsed['query']) ? '' : '?'.$parsed['query']).
250
+                        (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
251 251
             } else { // parse_url seems to have failed, try without it
252 252
                 $arr = explode('.', $input);
253 253
                 foreach ($arr as $k => $v) {
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         // The output is UTF-8 by default, other output formats need conversion here
266 266
         // If one time encoding is given, use this, else the objects property
267 267
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
268
-            case 'utf8':        return $return; // break;
269
-            case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));  // break;
268
+            case 'utf8' : return $return; // break;
269
+            case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break;
270 270
             case 'ucs4_array':  return $this->_utf8_to_ucs4($return); // break;
271 271
             default:            $this->_error('Unsupported output format'); return false;
272 272
         }
@@ -283,15 +283,14 @@  discard block
 block discarded – undo
283 283
         // Forcing conversion of input to UCS4 array
284 284
         // If one time encoding is given, use this, else the objects property
285 285
         switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) {
286
-            case 'utf8':
287
-                $decoded = $this->_utf8_to_ucs4($decoded);
286
+            case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded);
288 287
                 break;
289 288
             case 'ucs4_string':
290 289
                 $decoded = $this->_ucs4_string_to_ucs4($decoded);
291 290
             case 'ucs4_array':
292 291
                 break;
293 292
             default:
294
-                $this->_error('Unsupported input format: ' . ($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
293
+                $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
295 294
                 return false;
296 295
         }
297 296
 
@@ -380,13 +379,13 @@  discard block
 block discarded – undo
380 379
             }
381 380
         }
382 381
         $parsed['host'] = join('.', $arr);
383
-        $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')).
384
-                (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@').
382
+        $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')).
383
+                (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@').
385 384
                 $parsed['host'].
386
-                (empty($parsed['port']) ? '' : ':' . $parsed['port']).
385
+                (empty($parsed['port']) ? '' : ':'.$parsed['port']).
387 386
                 (empty($parsed['path']) ? '' : $parsed['path']).
388
-                (empty($parsed['query']) ? '' : '?' . $parsed['query']).
389
-                (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']);
387
+                (empty($parsed['query']) ? '' : '?'.$parsed['query']).
388
+                (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
390 389
         return $return;
391 390
     }
392 391
 
@@ -409,11 +408,11 @@  discard block
 block discarded – undo
409 408
     {
410 409
         $decoded = array();
411 410
         // find the Punycode prefix
412
-        if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) {
411
+        if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) {
413 412
             $this->_error('This is not a punycode string');
414 413
             return false;
415 414
         }
416
-        $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded);
415
+        $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded);
417 416
         // If nothing left after removing the prefix, it is hopeless
418 417
         if (!$encode_test) {
419 418
             $this->_error('The given encoded string was empty');
@@ -439,8 +438,7 @@  discard block
 block discarded – undo
439 438
             for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) {
440 439
                 $digit = $this->_decode_digit($encoded[$enco_idx++]);
441 440
                 $idx += $digit * $w;
442
-                $t = ($k <= $bias) ? $this->_tmin :
443
-                        (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
441
+                $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
444 442
                 if ($digit < $t) {
445 443
                     break;
446 444
                 }
@@ -513,7 +511,7 @@  discard block
 block discarded – undo
513 511
             return $encoded; // All codepoints were basic ones
514 512
         }
515 513
         // Start with the prefix; copy it to output
516
-        $encoded = $this->_punycode_prefix . $encoded;
514
+        $encoded = $this->_punycode_prefix.$encoded;
517 515
         // If we have basic code points in output, add an hyphen to the end
518 516
         if ($codecount) {
519 517
             $encoded .= '-';
@@ -540,8 +538,7 @@  discard block
 block discarded – undo
540 538
                     $delta++;
541 539
                 } elseif ($decoded[$i] == $cur_code) {
542 540
                     for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
543
-                        $t = ($k <= $bias) ? $this->_tmin :
544
-                                (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
541
+                        $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
545 542
                         if ($q < $t) {
546 543
                             break;
547 544
                         }
@@ -628,12 +625,12 @@  discard block
 block discarded – undo
628 625
             }
629 626
             // Try to find prohibited input
630 627
             if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) {
631
-                $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
628
+                $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
632 629
                 return false;
633 630
             }
634 631
             foreach (self::$NP['prohibit_ranges'] as $range) {
635 632
                 if ($range[0] <= $v && $v <= $range[1]) {
636
-                    $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
633
+                    $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
637 634
                     return false;
638 635
                 }
639 636
             }
@@ -869,7 +866,7 @@  discard block
 block discarded – undo
869 866
                 $output[$out_len] = $v;
870 867
                 ++$out_len;
871 868
                 if ('add' == $mode) {
872
-                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
869
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
873 870
                     return false;
874 871
                 }
875 872
                 continue;
@@ -894,7 +891,7 @@  discard block
 block discarded – undo
894 891
                     $next_byte = 4;
895 892
                     $v = ($v - 252) << 30;
896 893
                 } else {
897
-                    $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k);
894
+                    $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k);
898 895
                     return false;
899 896
                 }
900 897
                 if ('add' == $mode) {
@@ -907,7 +904,7 @@  discard block
 block discarded – undo
907 904
                 if (!$this->_allow_overlong && $test == 'range') {
908 905
                     $test = 'none';
909 906
                     if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {
910
-                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k);
907
+                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k);
911 908
                         return false;
912 909
                     }
913 910
                 }
@@ -916,7 +913,7 @@  discard block
 block discarded – undo
916 913
                     $output[($out_len - 1)] += $v;
917 914
                     --$next_byte;
918 915
                 } else {
919
-                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
916
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
920 917
                     return false;
921 918
                 }
922 919
                 if ($next_byte < 0) {
@@ -940,13 +937,13 @@  discard block
 block discarded – undo
940 937
             if ($v < 128) { // 7bit are transferred literally
941 938
                 $output .= chr($v);
942 939
             } elseif ($v < (1 << 11)) { // 2 bytes
943
-                $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
940
+                $output .= chr(192 + ($v >> 6)).chr(128 + ($v & 63));
944 941
             } elseif ($v < (1 << 16)) { // 3 bytes
945
-                $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
942
+                $output .= chr(224 + ($v >> 12)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63));
946 943
             } elseif ($v < (1 << 21)) { // 4 bytes
947
-                $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
944
+                $output .= chr(240 + ($v >> 18)).chr(128 + (($v >> 12) & 63)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63));
948 945
             } else {
949
-                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k);
946
+                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);
950 947
                 return false;
951 948
             }
952 949
         }
@@ -965,7 +962,7 @@  discard block
 block discarded – undo
965 962
         // Take array values and split output to 4 bytes per value
966 963
         // The bit mask is 255, which reads &11111111
967 964
         foreach ($input as $v) {
968
-            $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255);
965
+            $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);
969 966
         }
970 967
         return $output;
971 968
     }
@@ -995,7 +992,7 @@  discard block
 block discarded – undo
995 992
                 $out_len++;
996 993
                 $output[$out_len] = 0;
997 994
             }
998
-            $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
995
+            $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4)));
999 996
         }
1000 997
         return $output;
1001 998
     }
Please login to merge, or discard this patch.
ecrire/action/editer_logo.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 	include_spip('inc/chercher_logo');
82 82
 
83 83
 	$mode = preg_replace(",\W,", '', $etat);
84
-	if (!$mode){
84
+	if (!$mode) {
85 85
 		spip_log("logo_modifier : etat $etat invalide", 'logo');
86 86
 		$erreur = 'etat invalide';
87 87
 
88 88
 		return $erreur;
89 89
 	}
90 90
 	// chercher dans la base
91
-	$mode_document = 'logo' . $mode;
91
+	$mode_document = 'logo'.$mode;
92 92
 
93 93
 	include_spip('inc/documents');
94 94
 	$erreur = '';
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$tmp_name = false;
106 106
 		if (file_exists($source)) {
107 107
 			$tmp_name = $source;
108
-		} elseif (file_exists($f = determine_upload() . $source)) {
108
+		} elseif (file_exists($f = determine_upload().$source)) {
109 109
 			$tmp_name = $f;
110 110
 		}
111 111
 		if (!$tmp_name) {
@@ -162,27 +162,27 @@  discard block
 block discarded – undo
162 162
 	$type = type_du_logo($_id_objet);
163 163
 
164 164
 	foreach (['on', 'off'] as $mode) {
165
-		$nom_base = $type . $mode;
165
+		$nom_base = $type.$mode;
166 166
 		$dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG);
167 167
 
168 168
 		$deja = array();
169
-		$files = glob($dir . $nom_base . "*");
169
+		$files = glob($dir.$nom_base."*");
170 170
 
171 171
 		foreach ($files as $file) {
172
-			$logo = substr($file, strlen($dir . $nom_base));
172
+			$logo = substr($file, strlen($dir.$nom_base));
173 173
 			$logo = explode('.', $logo);
174 174
 			if (is_numeric($logo[0])
175 175
 			  and ($id_objet = intval($logo[0]) or in_array($objet, ['site', 'rubrique']))) {
176 176
 				if (!isset($deja[$id_objet])) {
177 177
 					$logo = $chercher_logo($id_objet, $_id_objet, $mode);
178 178
 					// if no logo in base
179
-					if (!$logo or count($logo)<6) {
179
+					if (!$logo or count($logo) < 6) {
180 180
 						foreach ($formats_logos as $format) {
181
-							if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) {
181
+							if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) {
182 182
 								// logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre
183
-								@rename($d, $dir_logos . $nom);
183
+								@rename($d, $dir_logos.$nom);
184 184
 								// et on le declare comme nouveau logo
185
-								logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom);
185
+								logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom);
186 186
 								break;
187 187
 							}
188 188
 						}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			}
193 193
 			// si le fichier est encore la on le move : rien a faire ici
194 194
 			if (file_exists($file)) {
195
-				@rename($file, $dir_logos_erreurs . basename($file));
195
+				@rename($file, $dir_logos_erreurs.basename($file));
196 196
 			}
197 197
 
198 198
 			if ($time_limit and time() > $time_limit) {
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	$id_pred = $id_rubrique;
106 106
 	while (true) {
107 107
 		sql_updateq('spip_rubriques', array('statut' => 'publie', 'date' => date('Y-m-d H:i:s')),
108
-			"id_rubrique=" . intval($id_rubrique));
109
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=" . intval($id_rubrique));
108
+			"id_rubrique=".intval($id_rubrique));
109
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', "R.id_rubrique=".intval($id_rubrique));
110 110
 		if (!$id_parent) {
111 111
 			break;
112 112
 		}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 			return $id_pred != $id_rubrique;
143 143
 		}
144 144
 		// passer au parent si on a depublie
145
-		$r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=" . intval($id_pred));
145
+		$r = sql_fetsel("id_parent", "spip_rubriques", "id_rubrique=".intval($id_pred));
146 146
 		$id_pred = $r['id_parent'];
147 147
 	}
148 148
 
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 		$date = date('Y-m-d H:i:s');
168 168
 	}
169 169
 	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
170
-		" AND date <= " . sql_quote($date) : '';
170
+		" AND date <= ".sql_quote($date) : '';
171 171
 
172 172
 	if (!$id_rubrique = intval($id_rubrique)) {
173 173
 		return false;
174 174
 	}
175 175
 
176 176
 	// verifier qu'elle existe et est bien publiee
177
-	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=" . intval($id_rubrique));
177
+	$r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', "id_rubrique=".intval($id_rubrique));
178 178
 	if (!$r or $r['statut'] !== 'publie') {
179 179
 		return false;
180 180
 	}
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 	// Le type de l'objet est au pluriel
184 184
 	$compte = array(
185 185
 		'articles' => sql_countsel("spip_articles",
186
-			"id_rubrique=" . intval($id_rubrique) . " AND statut='publie'$postdates"),
187
-		'rubriques' => sql_countsel("spip_rubriques", "id_parent=" . intval($id_rubrique) . " AND statut='publie'"),
186
+			"id_rubrique=".intval($id_rubrique)." AND statut='publie'$postdates"),
187
+		'rubriques' => sql_countsel("spip_rubriques", "id_parent=".intval($id_rubrique)." AND statut='publie'"),
188 188
 		'documents' => sql_countsel(
189 189
 			"spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document", 
190
-			"L.id_objet=" . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
190
+			"L.id_objet=".intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') ")
191 191
 	);
192 192
 
193 193
 	// On passe le tableau des comptes dans un pipeline pour que les plugins puissent ajouter (ou retirer) des enfants
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 	}
212 212
 
213
-	sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=" . intval($id_rubrique));
213
+	sql_updateq("spip_rubriques", array("statut" => 'prepa'), "id_rubrique=".intval($id_rubrique));
214 214
 
215 215
 #		spip_log("depublier_rubrique $id_pred");
216 216
 	return true;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
 	// Afficher les articles post-dates ?
275 275
 	$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
276
-		"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
276
+		"AND A.date <= ".sql_quote(date('Y-m-d H:i:s')) : '';
277 277
 
278 278
 	$r = sql_select(
279 279
 		"R.id_rubrique AS id, max(A.date) AS date_h",
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		"A.date>R.date_tmp AND A.statut='publie' $postdates ", "R.id_rubrique");
282 282
 	while ($row = sql_fetch($r)) {
283 283
 		sql_updateq("spip_rubriques", array("statut_tmp" => 'publie', "date_tmp" => $row['date_h']),
284
-			"id_rubrique=" . intval($row['id']));
284
+			"id_rubrique=".intval($row['id']));
285 285
 	}
286 286
 
287 287
 	// point d'entree pour permettre a des plugins de gerer le statut
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			"(SR.date_tmp>R.date_tmp OR R.statut_tmp<>'publie') AND SR.statut_tmp='publie' ", "R.id_rubrique");
303 303
 		while ($row = sql_fetch($r)) {
304 304
 			sql_updateq('spip_rubriques', array('statut_tmp' => 'publie', 'date_tmp' => $row['date_h']),
305
-				"id_rubrique=" . intval($row['id']));
305
+				"id_rubrique=".intval($row['id']));
306 306
 			$continuer = true;
307 307
 		}
308 308
 	} while ($continuer);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			and $rows = sql_allfetsel(
354 354
 				"A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur",
355 355
 				"spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique",
356
-				"R.profondeur=" . intval($prof) . " AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
356
+				"R.profondeur=".intval($prof)." AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)",
357 357
 				"", "R.id_secteur", "0,100")) {
358 358
 
359 359
 			$id_secteur = null;
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 			and $rows = sql_allfetsel(
383 383
 				"id_rubrique as id",
384 384
 				"spip_rubriques",
385
-				"profondeur=" . intval($prof + 1) . " AND id_parent NOT IN (" . sql_get_select("zzz.id_rubrique",
386
-					"spip_rubriques AS zzz", "zzz.profondeur=" . intval($prof)) . ")", '', '', '0,100')) {
385
+				"profondeur=".intval($prof + 1)." AND id_parent NOT IN (".sql_get_select("zzz.id_rubrique",
386
+					"spip_rubriques AS zzz", "zzz.profondeur=".intval($prof)).")", '', '', '0,100')) {
387 387
 			$rows = array_column($rows, 'id');
388 388
 			sql_updateq("spip_rubriques", array('profondeur' => $prof + 2), sql_in("id_rubrique", $rows));
389 389
 		}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		// si pas de rubrique a profondeur $prof+1 pas la peine de continuer
393 393
 		// si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse)
394 394
 		// on arrete les frais
395
-		if (sql_countsel("spip_rubriques", "profondeur=" . intval($prof + 1))) {
395
+		if (sql_countsel("spip_rubriques", "profondeur=".intval($prof + 1))) {
396 396
 			$prof++;
397 397
 			$continuer = true;
398 398
 		}
@@ -400,10 +400,10 @@  discard block
 block discarded – undo
400 400
 
401 401
 	// loger si la table des rubriques semble foireuse
402 402
 	// et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles
403
-	if (sql_countsel("spip_rubriques", "profondeur>" . intval($prof + 1))) {
404
-		spip_log("Les rubriques de profondeur>" . ($prof + 1) . " semblent suspectes (branches morte ou reference circulaire dans les parents)",
403
+	if (sql_countsel("spip_rubriques", "profondeur>".intval($prof + 1))) {
404
+		spip_log("Les rubriques de profondeur>".($prof + 1)." semblent suspectes (branches morte ou reference circulaire dans les parents)",
405 405
 			_LOG_CRITIQUE);
406
-		sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>" . intval($prof + 1));
406
+		sql_update("spip_rubriques", array('id_secteur' => 0), "profondeur>".intval($prof + 1));
407 407
 	}
408 408
 
409 409
 	// reparer les articles
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		"A.id_rubrique = R.id_rubrique AND A.id_secteur <> R.id_secteur");
412 412
 
413 413
 	while ($row = sql_fetch($r)) {
414
-		sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=" . intval($row['id']));
414
+		sql_update("spip_articles", array("id_secteur" => $row['secteur']), "id_article=".intval($row['id']));
415 415
 	}
416 416
 
417 417
 	// avertir les plugins qui peuvent faire leur mises a jour egalement
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	while ($row = sql_fetch($s)) {
438 438
 		$id_rubrique = $row['id_rubrique'];
439 439
 		$t = sql_updateq('spip_rubriques', array('lang' => $row['lang'], 'langue_choisie' => 'non'),
440
-			"id_rubrique=" . intval($id_rubrique));
440
+			"id_rubrique=".intval($id_rubrique));
441 441
 	}
442 442
 
443 443
 	return $t;
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	while ($row = sql_fetch($s)) {
474 474
 		$id_article = $row['id_article'];
475 475
 		sql_updateq('spip_articles', array("lang" => $row['lang'], 'langue_choisie' => 'non'),
476
-			"id_article=" . intval($id_article));
476
+			"id_article=".intval($id_article));
477 477
 	}
478 478
 
479 479
 	if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 				);
546 546
 				// generer un nom de fonction "anonyme" unique
547 547
 				do {
548
-					$functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand();
548
+					$functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.rand();
549 549
 				} while (function_exists($functionname));
550 550
 				$code = calculer_boucle('calculer_langues_utilisees', $boucles);
551
-				$code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code;
552
-				$code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();';
551
+				$code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code;
552
+				$code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();';
553 553
 				$res = '';
554 554
 				eval($code);
555 555
 				$res = explode(',', $res);
@@ -663,10 +663,10 @@  discard block
 block discarded – undo
663 663
 	while ($maxiter-- and $filles = sql_allfetsel(
664 664
 			'id_rubrique',
665 665
 			'spip_rubriques',
666
-			sql_in('id_parent', $r) . " AND " . sql_in('id_rubrique', $r, 'NOT')
666
+			sql_in('id_parent', $r)." AND ".sql_in('id_rubrique', $r, 'NOT')
667 667
 		)) {
668 668
 		$r = join(',', array_column($filles, 'id_rubrique'));
669
-		$branche .= ',' . $r;
669
+		$branche .= ','.$r;
670 670
 	}
671 671
 
672 672
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 	if (isset($b[$id])) {
708 708
 		// Notre branche commence par la rubrique de depart si $tout=true
709
-		return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id];
709
+		return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id];
710 710
 	}
711 711
 
712 712
 	$hier = "";
@@ -718,10 +718,10 @@  discard block
 block discarded – undo
718 718
 	while ($maxiter-- and $parents = sql_allfetsel(
719 719
 			'id_parent',
720 720
 			'spip_rubriques',
721
-			sql_in('id_rubrique', $ids_nouveaux_parents) . " AND " . sql_in('id_parent', $hier, 'NOT')
721
+			sql_in('id_rubrique', $ids_nouveaux_parents)." AND ".sql_in('id_parent', $hier, 'NOT')
722 722
 		)) {
723 723
 		$ids_nouveaux_parents = join(',', array_column($parents, 'id_parent'));
724
-		$hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : '');
724
+		$hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : '');
725 725
 	}
726 726
 
727 727
 	# securite pour ne pas plomber la conso memoire sur les sites prolifiques
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 	include_spip('base/abstract_sql');
754 754
 	if ($check) {
755 755
 		$postdates = ($GLOBALS['meta']["post_dates"] == "non") ?
756
-			"AND A.date <= " . sql_quote(date('Y-m-d H:i:s')) : '';
756
+			"AND A.date <= ".sql_quote(date('Y-m-d H:i:s')) : '';
757 757
 
758 758
 		$r = sql_select("DISTINCT A.id_rubrique AS id",
759 759
 			"spip_articles AS A LEFT JOIN spip_rubriques AS R ON A.id_rubrique=R.id_rubrique",
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		pipeline('trig_calculer_prochain_postdate', '');
766 766
 	}
767 767
 
768
-	$t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), "", "date",
768
+	$t = sql_fetsel("date", "spip_articles", "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), "", "date",
769 769
 		"1");
770 770
 
771 771
 	if ($t) {
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 		// retablir les </multi> et autres balises fermantes html
816 816
 		$titre = preg_replace(",<@([a-z][^>]*)>,ims", "</\\1>", $titre);
817 817
 		$r = sql_getfetsel("id_rubrique", "spip_rubriques",
818
-			"titre = " . sql_quote($titre) . " AND id_parent=" . intval($id_parent),
818
+			"titre = ".sql_quote($titre)." AND id_parent=".intval($id_parent),
819 819
 			$groupby = array(), $orderby = array(), $limit = '', $having = array(), $serveur);
820 820
 		if ($r !== null) {
821 821
 			$id_parent = $r;
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 			}
837 837
 
838 838
 			sql_updateq('spip_rubriques', array('id_secteur' => $id_secteur, "lang" => $lang),
839
-				"id_rubrique=" . intval($id_rubrique), $desc = '', $serveur);
839
+				"id_rubrique=".intval($id_rubrique), $desc = '', $serveur);
840 840
 
841 841
 			// pour la recursion
842 842
 			$id_parent = $id_rubrique;
Please login to merge, or discard this patch.
ecrire/exec/403.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		$message = _T('avis_acces_interdit_prive', array('exec' => _request('exec')));
38 38
 	}
39 39
 
40
-	$contenu = "<h1 class='grostitre'>" . _T('info_acces_interdit') . '</h1>' . $message;
40
+	$contenu = "<h1 class='grostitre'>"._T('info_acces_interdit').'</h1>'.$message;
41 41
 
42 42
 	if (_request('var_zajax')) {
43 43
 		include_spip('inc/actions');
Please login to merge, or discard this patch.
ecrire/inc/icone_renommer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 
47 47
 	$dir = "images/";
48 48
 	$f = "$type-$size.png";
49
-	if ($icone = find_in_theme($dir . $f)) {
49
+	if ($icone = find_in_theme($dir.$f)) {
50 50
 		$dir = dirname($icone);
51 51
 		$fond = $icone;
52 52
 
53 53
 		if ($rtl
54
-			and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))
54
+			and $fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone))
55 55
 			and file_exists($fr)
56 56
 		) {
57 57
 			$fond = $fr;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		}
68 68
 
69 69
 		$fonction = "";
70
-		if (in_array($action, array('add','del', 'new', 'edit', 'config'))) {
70
+		if (in_array($action, array('add', 'del', 'new', 'edit', 'config'))) {
71 71
 			$fonction = $action;
72 72
 		}
73 73
 
Please login to merge, or discard this patch.
ecrire/action/purger.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			supprime_invalideurs();
62 62
 			@spip_unlink(_CACHE_RUBRIQUES);
63 63
 			@spip_unlink(_CACHE_CHEMIN);
64
-			@spip_unlink(_DIR_TMP . "plugin_xml_cache.gz");
64
+			@spip_unlink(_DIR_TMP."plugin_xml_cache.gz");
65 65
 			// on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3
66 66
 			// _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT
67 67
 			// pour eviter des problemes de concurence
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 			@spip_unlink(_CACHE_PLUGINS_OPT);
73 73
 			purger_repertoire(_DIR_CACHE, array('subdir' => true));
74 74
 			purger_repertoire(_DIR_AIDE);
75
-			purger_repertoire(_DIR_VAR . 'cache-css');
76
-			purger_repertoire(_DIR_VAR . 'cache-js');
75
+			purger_repertoire(_DIR_VAR.'cache-css');
76
+			purger_repertoire(_DIR_VAR.'cache-js');
77 77
 			break;
78 78
 
79 79
 		case 'squelettes':
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 			break;
82 82
 
83 83
 		case 'vignettes':
84
-			purger_repertoire(_DIR_VAR . 'cache-gd2', array('subdir' => true));
85
-			purger_repertoire(_DIR_VAR . 'cache-texte', array('subdir' => true));
86
-			purger_repertoire(_DIR_VAR . 'cache-vignettes', array('subdir' => true));
87
-			purger_repertoire(_DIR_VAR . 'cache-TeX', array('subdir' => true));
84
+			purger_repertoire(_DIR_VAR.'cache-gd2', array('subdir' => true));
85
+			purger_repertoire(_DIR_VAR.'cache-texte', array('subdir' => true));
86
+			purger_repertoire(_DIR_VAR.'cache-vignettes', array('subdir' => true));
87
+			purger_repertoire(_DIR_VAR.'cache-TeX', array('subdir' => true));
88 88
 			supprime_invalideurs();
89 89
 			purger_repertoire(_DIR_CACHE, array('subdir' => true));
90 90
 			break;
Please login to merge, or discard this patch.