Completed
Push — master ( c3f20e...6d7580 )
by cam
01:15
created
ecrire/base/trouver_table.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	// de connexion, et tout risque d'ambiguite
91 91
 	if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) {
92 92
 		$nom_cache_desc_sql[$serveur][$objets_sql] =
93
-			_DIR_CACHE . 'sql_desc_'
93
+			_DIR_CACHE.'sql_desc_'
94 94
 			. ($serveur ? "{$serveur}_" : '')
95
-			. substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8)
95
+			. substr(md5($connexion['db'].':'.$connexion['prefixe'].":$objets_sql"), 0, 8)
96 96
 			. '.txt';
97 97
 		// nouveau nom de cache = nouvelle version en memoire
98 98
 		unset($connexion['tables']);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	if ($connexion['spip_connect_version']) {
121 121
 		if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) {
122 122
 			$nom = $GLOBALS['table_des_tables'][$nom];
123
-			$nom_sql = 'spip_' . $nom;
123
+			$nom_sql = 'spip_'.$nom;
124 124
 		}
125 125
 	}
126 126
 
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
 		// meme si pas d'abreviation declaree, trouver la table spip_$nom
148 148
 		// si c'est une table principale,
149 149
 		// puisqu'on le fait aussi pour les tables auxiliaires
150
-		elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) {
151
-			$nom_sql = 'spip_' . $nom;
150
+		elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_'.$nom])) {
151
+			$nom_sql = 'spip_'.$nom;
152 152
 			$fdesc = &$GLOBALS['tables_principales'][$nom_sql];
153 153
 		} elseif (
154 154
 			isset($GLOBALS['tables_auxiliaires'][$n = $nom])
155
-			or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom])
155
+			or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_'.$nom])
156 156
 		) {
157 157
 			$nom_sql = $n;
158 158
 			$fdesc = &$GLOBALS['tables_auxiliaires'][$n];
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		) {
169 169
 			if (!$fdesc) {
170 170
 				$log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG;
171
-				spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level);
171
+				spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base'.$log_level);
172 172
 
173 173
 				return null;
174 174
 			}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			$desc['exist'] = true;
181 181
 			// gerer le cas des cles vides (echec de l'analyse sur une vue par exemple)
182 182
 			// pour recuperer la declaration de lister_tables_objets_sql() si il y en a une
183
-			if (! $desc['key']) {
183
+			if (!$desc['key']) {
184 184
 				spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base');
185 185
 				unset($desc['key']);
186 186
 			}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		if (!isset($desc['key']) && !empty($fdesc['key'])) {
198 198
 			$desc['key'] = $fdesc['key'];
199 199
 		}
200
-		if (! isset($desc['key'])) {
200
+		if (!isset($desc['key'])) {
201 201
 			$desc['key'] = [];
202 202
 		}
203 203
 
Please login to merge, or discard this patch.
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	];
44 44
 	$options = array_merge($defaut, $options);
45 45
 	if (is_numeric($options['expire']) and $options['expire'] > 0) {
46
-		$options['expire'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT';
46
+		$options['expire'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT';
47 47
 	}
48 48
 
49 49
 	if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) {
73 73
 	// toujours envoyer un content type, meme vide !
74 74
 	header('Accept-Ranges: bytes');
75
-	header('Content-Type: ' . $content_type);
75
+	header('Content-Type: '.$content_type);
76 76
 
77 77
 	if ($attachment) {
78 78
 		$f = basename($fichier);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	else {
91 91
 		$f = basename($fichier);
92 92
 		header("Content-Disposition: inline; filename=\"$f\";");
93
-		header('Expires: ' . $expires); // set expiration time
93
+		header('Expires: '.$expires); // set expiration time
94 94
 	}
95 95
 }
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
143 143
 	if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
144 144
 		### Offset signifies where we should begin to read the file
145
-		$byteOffset = (int)$match[1];
145
+		$byteOffset = (int) $match[1];
146 146
 
147 147
 
148 148
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
149 149
 		if (isset($match[2])) {
150
-			$finishBytes = (int)$match[2];
150
+			$finishBytes = (int) $match[2];
151 151
 			$byteLength = $finishBytes + 1;
152 152
 		} else {
153 153
 			$finishBytes = $fileSize - 1;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 	// partial content
170 170
 	header('HTTP/1.1 206 Partial content');
171
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
171
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
172 172
 
173 173
 
174 174
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.
ecrire/balise/formulaire_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		// donc si on est dans le public avec un cache on va perdre le dynamisme
148 148
 		// et on risque de mettre en cache les valeurs pre-remplies du formulaire
149 149
 		// on injecte donc le PHP qui va appeler la fonction pour generer le formulaire au lieu de directement la fonction
150
-		$p->code = "'<'.'?php echo (" . texte_script($p->code) . "); ?'.'>'";
150
+		$p->code = "'<'.'?php echo (".texte_script($p->code)."); ?'.'>'";
151 151
 		// dans l'espace prive on a pas de cache, donc pas de soucis (et un leak serait moins grave)
152 152
 	}
153 153
 	return $p;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			foreach ($erreurs as $k => $v) {
328 328
 				if (is_string($v) and strlen(trim($v)) and strpos($k, '_') !== 0) {
329 329
 					// on encapsule dans un span car ces messages sont en general simple, juste du texte, et deja dans un span dans le form
330
-					$valeurs['erreurs'][$k] = "<span role='alert'>" . $erreurs[$k] . '</span>';
330
+					$valeurs['erreurs'][$k] = "<span role='alert'>".$erreurs[$k].'</span>';
331 331
 				}
332 332
 			}
333 333
 		}
Please login to merge, or discard this patch.
ecrire/public/interfaces.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -975,9 +975,9 @@
 block discarded – undo
975 975
 	if (!defined('_TRAITEMENT_TYPO_SANS_NUMERO')) {
976 976
 		define('_TRAITEMENT_TYPO_SANS_NUMERO', 'supprimer_numero(typo(%s, "TYPO", $connect, $Pile[0]))');
977 977
 	}
978
-	$GLOBALS['table_des_traitements']['BIO'][] = 'safehtml(' . _TRAITEMENT_RACCOURCIS . ')';
978
+	$GLOBALS['table_des_traitements']['BIO'][] = 'safehtml('._TRAITEMENT_RACCOURCIS.')';
979 979
 	$GLOBALS['table_des_traitements']['NOM_SITE']['spip_auteurs'] = 'entites_html(%s)';
980
-	$GLOBALS['table_des_traitements']['NOM']['spip_auteurs'] = 'safehtml(' . _TRAITEMENT_TYPO_SANS_NUMERO . ')';
980
+	$GLOBALS['table_des_traitements']['NOM']['spip_auteurs'] = 'safehtml('._TRAITEMENT_TYPO_SANS_NUMERO.')';
981 981
 	$GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS;
982 982
 	$GLOBALS['table_des_traitements']['DATE'][] = 'normaliser_date(%s)';
983 983
 	$GLOBALS['table_des_traitements']['DATE_REDAC'][] = 'normaliser_date(%s)';
Please login to merge, or discard this patch.
ecrire/req/sqlite_generique.php 1 patch
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -64,27 +64,27 @@  discard block
 block discarded – undo
64 64
 	// determiner le dossier de la base : $addr ou _DIR_DB
65 65
 	$f = _DIR_DB;
66 66
 	if ($addr and strpos($addr, '/') !== false) {
67
-		$f = rtrim($addr, '/') . '/';
67
+		$f = rtrim($addr, '/').'/';
68 68
 	}
69 69
 
70 70
 	// un nom de base demande et impossible d'obtenir la base, on s'en va :
71 71
 	// il faut que la base existe ou que le repertoire parent soit writable
72
-	if ($db and !is_file($f .= $db . '.sqlite') and !is_writable(dirname($f))) {
73
-		spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.' . _LOG_HS);
72
+	if ($db and !is_file($f .= $db.'.sqlite') and !is_writable(dirname($f))) {
73
+		spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.'._LOG_HS);
74 74
 
75 75
 		return false;
76 76
 	}
77 77
 
78 78
 	// charger les modules sqlite au besoin
79 79
 	if (!_sqlite_charger_version($sqlite_version)) {
80
-		spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.' . _LOG_HS);
80
+		spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.'._LOG_HS);
81 81
 
82 82
 		return false;
83 83
 	}
84 84
 
85 85
 	// chargement des constantes
86 86
 	// il ne faut pas definir les constantes avant d'avoir charge les modules sqlite
87
-	$define = 'spip_sqlite' . $sqlite_version . '_constantes';
87
+	$define = 'spip_sqlite'.$sqlite_version.'_constantes';
88 88
 	$define();
89 89
 
90 90
 	$ok = false;
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 		// si pas de db ->
93 93
 		// base temporaire tant qu'on ne connait pas son vrai nom
94 94
 		// pour tester la connexion
95
-		$db = '_sqlite' . $sqlite_version . '_install';
96
-		$tmp = _DIR_DB . $db . '.sqlite';
95
+		$db = '_sqlite'.$sqlite_version.'_install';
96
+		$tmp = _DIR_DB.$db.'.sqlite';
97 97
 		$ok = $link = new \PDO("sqlite:$tmp");
98 98
 	} else {
99 99
 		// Ouvrir (eventuellement creer la base)
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 	if (!$ok) {
104 104
 		$e = _sqlite_last_error_from_link($link);
105
-		spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.' . _LOG_HS);
105
+		spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.'._LOG_HS);
106 106
 
107 107
 		return false;
108 108
 	}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$table = $regs[3];
189 189
 		$suite = $regs[4];
190 190
 	} else {
191
-		spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.' . _LOG_ERREUR);
191
+		spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.'._LOG_ERREUR);
192 192
 
193 193
 		return false;
194 194
 	}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	$i = 0;
206 206
 	$ouverte = false;
207 207
 	while ($do = array_shift($todo)) {
208
-		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do;
208
+		$todo2[$i] = isset($todo2[$i]) ? $todo2[$i].','.$do : $do;
209 209
 		$o = (false !== strpos($do, '('));
210 210
 		$f = (false !== strpos($do, ')'));
211 211
 		if ($o and !$f) {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		) {
232 232
 			spip_log(
233 233
 				"SQLite : Probleme de ALTER TABLE, utilisation non reconnue dans : $do \n(requete d'origine : $query)",
234
-				'sqlite.' . _LOG_ERREUR
234
+				'sqlite.'._LOG_ERREUR
235 235
 			);
236 236
 
237 237
 			return false;
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 
328 328
 			// pas geres en sqlite2
329 329
 			case 'RENAME':
330
-				$do = 'RENAME TO' . substr($do, 6);
330
+				$do = 'RENAME TO'.substr($do, 6);
331 331
 			case 'RENAME TO':
332 332
 				if (!spip_sqlite::executer_requete("$debut $do", $serveur)) {
333
-					spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.' . _LOG_ERREUR);
333
+					spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.'._LOG_ERREUR);
334 334
 
335 335
 					return false;
336 336
 				}
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 						$colonnes = substr($colonne_origine, 1, -1);
374 374
 						if (false !== strpos(',', $colonnes)) {
375 375
 							spip_log('SQLite : Erreur, impossible de creer un index sur plusieurs colonnes'
376
-								. " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.' . _LOG_ERREUR);
376
+								. " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.'._LOG_ERREUR);
377 377
 							break;
378 378
 						} else {
379 379
 							$nom_index = $colonnes;
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 
389 389
 			// pas geres en sqlite2
390 390
 			case 'ADD COLUMN':
391
-				$do = 'ADD' . substr($do, 10);
391
+				$do = 'ADD'.substr($do, 10);
392 392
 			case 'ADD':
393 393
 			default:
394 394
 				if (!preg_match(',primary\s+key,i', $do)) {
395 395
 					if (!spip_sqlite::executer_requete("$debut $do", $serveur)) {
396
-						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
396
+						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.'._LOG_ERREUR);
397 397
 
398 398
 						return false;
399 399
 					}
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 					}
414 414
 					$opts['field'] = [$colonne_ajoutee => $def];
415 415
 					if (!_sqlite_modifier_table($table, [$colonne_ajoutee], $opts, $serveur)) {
416
-						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR);
416
+						spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.'._LOG_ERREUR);
417 417
 
418 418
 						return false;
419 419
 					}
@@ -421,10 +421,10 @@  discard block
 block discarded – undo
421 421
 				break;
422 422
 		}
423 423
 		// tout est bon, ouf !
424
-		spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.' . _LOG_INFO);
424
+		spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.'._LOG_INFO);
425 425
 	}
426 426
 
427
-	spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.' . _LOG_INFO);
427
+	spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.'._LOG_INFO);
428 428
 
429 429
 	return true;
430 430
 }
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
  * @return bool true si la base est créee.
494 494
  **/
495 495
 function spip_sqlite_create_base($nom, $serveur = '', $option = true) {
496
-	$f = $nom . '.sqlite';
496
+	$f = $nom.'.sqlite';
497 497
 	if (strpos($nom, '/') === false) {
498
-		$f = _DIR_DB . $f;
498
+		$f = _DIR_DB.$f;
499 499
 	}
500 500
 
501 501
 	$ok = new \PDO("sqlite:$f");
@@ -535,13 +535,13 @@  discard block
 block discarded – undo
535 535
 	if (sql_showtable($nom, false, $serveur)) {
536 536
 		spip_log(
537 537
 			"Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)",
538
-			'sqlite.' . _LOG_ERREUR
538
+			'sqlite.'._LOG_ERREUR
539 539
 		);
540 540
 
541 541
 		return false;
542 542
 	}
543 543
 
544
-	$query = "CREATE VIEW $nom AS " . $query_select;
544
+	$query = "CREATE VIEW $nom AS ".$query_select;
545 545
 
546 546
 	return spip_sqlite_query($query, $serveur, $requeter);
547 547
 }
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
 function spip_sqlite_create_index($nom, $table, $champs, $unique = '', $serveur = '', $requeter = true) {
568 568
 	if (!($nom or $table or $champs)) {
569 569
 		spip_log(
570
-			"Champ manquant pour creer un index sqlite ($nom, $table, (" . join(',', $champs) . '))',
571
-			'sqlite.' . _LOG_ERREUR
570
+			"Champ manquant pour creer un index sqlite ($nom, $table, (".join(',', $champs).'))',
571
+			'sqlite.'._LOG_ERREUR
572 572
 		);
573 573
 
574 574
 		return false;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
 	// SQLite ne differentie pas noms des index en fonction des tables
578 578
 	// il faut donc creer des noms uniques d'index pour une base sqlite
579
-	$nom = $table . '_' . $nom;
579
+	$nom = $table.'_'.$nom;
580 580
 	// enlever d'eventuelles parentheses deja presentes sur champs
581 581
 	if (!is_array($champs)) {
582 582
 		if ($champs[0] == '(') {
@@ -598,12 +598,12 @@  discard block
 block discarded – undo
598 598
 	} else {
599 599
 		/* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
600 600
 		$a = spip_sqlite_showtable($table, $serveur);
601
-		if (isset($a['key']['KEY ' . $nom])) {
601
+		if (isset($a['key']['KEY '.$nom])) {
602 602
 			return true;
603 603
 		}
604 604
 	}
605 605
 
606
-	$query = 'CREATE ' . ($unique ? 'UNIQUE ' : '') . "INDEX$ifnotexists $nom ON $table (" . join(',', $champs) . ')';
606
+	$query = 'CREATE '.($unique ? 'UNIQUE ' : '')."INDEX$ifnotexists $nom ON $table (".join(',', $champs).')';
607 607
 	$res = spip_sqlite_query($query, $serveur, $requeter);
608 608
 	if (!$requeter) {
609 609
 		return $res;
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 	$serveur = '',
680 680
 	$requeter = true
681 681
 ) {
682
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
682
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
683 683
 	$r = spip_sqlite_select(
684 684
 		"COUNT($c)",
685 685
 		$from,
@@ -788,14 +788,14 @@  discard block
 block discarded – undo
788 788
  */
789 789
 function spip_sqlite_drop_index($nom, $table, $serveur = '', $requeter = true) {
790 790
 	if (!($nom or $table)) {
791
-		spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.' . _LOG_ERREUR);
791
+		spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.'._LOG_ERREUR);
792 792
 
793 793
 		return false;
794 794
 	}
795 795
 
796 796
 	// SQLite ne differentie pas noms des index en fonction des tables
797 797
 	// il faut donc creer des noms uniques d'index pour une base sqlite
798
-	$index = $table . '_' . $nom;
798
+	$index = $table.'_'.$nom;
799 799
 	$exist = ' IF EXISTS';
800 800
 
801 801
 	$query = "DROP INDEX$exist $index";
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 	if ($s) {
828 828
 		$trace = debug_backtrace();
829 829
 		if ($trace[0]['function'] != 'spip_sqlite_error') {
830
-			spip_log("$s - $query - " . sql_error_backtrace(), 'sqlite.' . _LOG_ERREUR);
830
+			spip_log("$s - $query - ".sql_error_backtrace(), 'sqlite.'._LOG_ERREUR);
831 831
 		}
832 832
 	}
833 833
 
@@ -874,14 +874,14 @@  discard block
 block discarded – undo
874 874
 		$t = $link->errorInfo();
875 875
 		$s = ltrim($t[0], '0'); // 00000 si pas d'erreur
876 876
 		if ($s) {
877
-			$s .= ' / ' . $t[1];
877
+			$s .= ' / '.$t[1];
878 878
 		} // ajoute l'erreur du moteur SQLite
879 879
 	} else {
880 880
 		$s = ': aucune ressource sqlite (link)';
881 881
 	}
882 882
 
883 883
 	if ($s) {
884
-		spip_log("Erreur sqlite $s", 'sqlite.' . _LOG_ERREUR);
884
+		spip_log("Erreur sqlite $s", 'sqlite.'._LOG_ERREUR);
885 885
 	}
886 886
 
887 887
 	return $s ? $s : 0;
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 	}
906 906
 
907 907
 	$query = spip_sqlite::traduire_requete($query, $serveur);
908
-	$query = 'EXPLAIN ' . $query;
908
+	$query = 'EXPLAIN '.$query;
909 909
 	if (!$requeter) {
910 910
 		return $query;
911 911
 	}
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
  **/
1067 1067
 function spip_sqlite_insert($table, $champs, $valeurs, $desc = [], $serveur = '', $requeter = true) {
1068 1068
 
1069
-	$query = "INSERT INTO $table " . ($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES');
1069
+	$query = "INSERT INTO $table ".($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES');
1070 1070
 	if ($r = spip_sqlite_query($query, $serveur, $requeter)) {
1071 1071
 		if (!$requeter) {
1072 1072
 			return $r;
@@ -1121,8 +1121,8 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
 	$cles = $valeurs = '';
1123 1123
 	if (count($couples)) {
1124
-		$cles = '(' . join(',', array_keys($couples)) . ')';
1125
-		$valeurs = '(' . join(',', $couples) . ')';
1124
+		$cles = '('.join(',', array_keys($couples)).')';
1125
+		$valeurs = '('.join(',', $couples).')';
1126 1126
 	}
1127 1127
 
1128 1128
 	return spip_sqlite_insert($table, $cles, $valeurs, $desc, $serveur, $requeter);
@@ -1182,11 +1182,11 @@  discard block
 block discarded – undo
1182 1182
 
1183 1183
 		$champs = $valeurs = '';
1184 1184
 		if (count($couples)) {
1185
-			$champs = '(' . join(',', array_keys($couples)) . ')';
1186
-			$valeurs = '(' . join(',', $couples) . ')';
1187
-			$query = $query_start . "$champs VALUES $valeurs";
1185
+			$champs = '('.join(',', array_keys($couples)).')';
1186
+			$valeurs = '('.join(',', $couples).')';
1187
+			$query = $query_start."$champs VALUES $valeurs";
1188 1188
 		} else {
1189
-			$query = $query_start . 'DEFAULT VALUES';
1189
+			$query = $query_start.'DEFAULT VALUES';
1190 1190
 		}
1191 1191
 
1192 1192
 		if ($requeter) {
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
  * @return string       Texte de sélection pour la requête
1319 1319
  */
1320 1320
 function spip_sqlite_multi($objet, $lang) {
1321
-	$r = 'EXTRAIRE_MULTI(' . $objet . ", '" . $lang . "') AS multi";
1321
+	$r = 'EXTRAIRE_MULTI('.$objet.", '".$lang."') AS multi";
1322 1322
 
1323 1323
 	return $r;
1324 1324
 }
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 function spip_sqlite_date_proche($champ, $interval, $unite) {
1390 1390
 	$op = (($interval <= 0) ? '>' : '<');
1391 1391
 
1392
-	return "($champ $op datetime('" . date('Y-m-d H:i:s') . "', '$interval $unite'))";
1392
+	return "($champ $op datetime('".date('Y-m-d H:i:s')."', '$interval $unite'))";
1393 1393
 }
1394 1394
 
1395 1395
 
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
 				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1422 1422
 			) {
1423 1423
 				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT ''", $serveur);
1424
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1424
+				spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE);
1425 1425
 			}
1426 1426
 			if (
1427 1427
 				preg_match(',^(INTEGER),i', $d)
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
 				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1432 1432
 			) {
1433 1433
 				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0'", $serveur);
1434
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1434
+				spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE);
1435 1435
 			}
1436 1436
 			if (
1437 1437
 				preg_match(',^(datetime),i', $d)
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
 				and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c)
1442 1442
 			) {
1443 1443
 				spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0000-00-00 00:00:00'", $serveur);
1444
-				spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE);
1444
+				spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE);
1445 1445
 			}
1446 1446
 		}
1447 1447
 
@@ -1492,10 +1492,10 @@  discard block
 block discarded – undo
1492 1492
 	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
1493 1493
 	$couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur);
1494 1494
 
1495
-	return spip_sqlite_query("REPLACE INTO $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1495
+	return spip_sqlite_query("REPLACE INTO $table (".join(',', array_keys($couples)).') VALUES ('.join(
1496 1496
 		',',
1497 1497
 		$couples
1498
-	) . ')', $serveur);
1498
+	).')', $serveur);
1499 1499
 }
1500 1500
 
1501 1501
 
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
 		. _sqlite_calculer_expression('WHERE', $where)
1582 1582
 		. _sqlite_calculer_expression('GROUP BY', $groupby, ',')
1583 1583
 		. _sqlite_calculer_expression('HAVING', $having)
1584
-		. ($orderby ? ("\nORDER BY " . _sqlite_calculer_order($orderby)) : '')
1584
+		. ($orderby ? ("\nORDER BY "._sqlite_calculer_order($orderby)) : '')
1585 1585
 		. ($limit ? "\nLIMIT $limit" : '');
1586 1586
 
1587 1587
 	// dans un select, on doit renvoyer la requête en cas d'erreur
@@ -1619,10 +1619,10 @@  discard block
 block discarded – undo
1619 1619
 	// interdire la creation d'une nouvelle base,
1620 1620
 	// sauf si on est dans l'installation
1621 1621
 	if (
1622
-		!is_file($f = _DIR_DB . $db . '.sqlite')
1622
+		!is_file($f = _DIR_DB.$db.'.sqlite')
1623 1623
 		&& (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)
1624 1624
 	) {
1625
-		spip_log("Il est interdit de creer la base $db", 'sqlite.' . _LOG_HS);
1625
+		spip_log("Il est interdit de creer la base $db", 'sqlite.'._LOG_HS);
1626 1626
 
1627 1627
 		return false;
1628 1628
 	}
@@ -1631,12 +1631,12 @@  discard block
 block discarded – undo
1631 1631
 	// avec les identifiants connus
1632 1632
 	$index = $serveur ? $serveur : 0;
1633 1633
 
1634
-	if ($link = spip_connect_db('', '', '', '', '@selectdb@' . $db, $serveur, '', '')) {
1634
+	if ($link = spip_connect_db('', '', '', '', '@selectdb@'.$db, $serveur, '', '')) {
1635 1635
 		if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) {
1636 1636
 			return $db;
1637 1637
 		}
1638 1638
 	} else {
1639
-		spip_log("Impossible de selectionner la base $db", 'sqlite.' . _LOG_HS);
1639
+		spip_log("Impossible de selectionner la base $db", 'sqlite.'._LOG_HS);
1640 1640
 
1641 1641
 		return false;
1642 1642
 	}
@@ -1687,7 +1687,7 @@  discard block
 block discarded – undo
1687 1687
 	$match = "^$match$";
1688 1688
 
1689 1689
 	return spip_sqlite_query(
1690
-		"SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP " . _q($match),
1690
+		"SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP "._q($match),
1691 1691
 		$serveur,
1692 1692
 		$requeter
1693 1693
 	);
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
 	$r = spip_sqlite_query(
1711 1711
 		'SELECT name FROM sqlite_master WHERE'
1712 1712
 		. ' type=\'table\''
1713
-		. ' AND name=' . spip_sqlite_quote($table, 'string')
1713
+		. ' AND name='.spip_sqlite_quote($table, 'string')
1714 1714
 		. ' AND name NOT LIKE \'sqlite_%\'',
1715 1715
 		$serveur,
1716 1716
 		$requeter
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 				// s'il y a une parenthèse fermante dans la clé
1808 1808
 				// ou dans la définition sans qu'il n'y ait une ouverture avant
1809 1809
 				if (false !== strpos($k, ')') or preg_match('/^[^\(]*\)/', $def)) {
1810
-					$fields[$k_precedent] .= ',' . $k . ' ' . $def;
1810
+					$fields[$k_precedent] .= ','.$k.' '.$def;
1811 1811
 					continue;
1812 1812
 				}
1813 1813
 
@@ -1842,13 +1842,13 @@  discard block
 block discarded – undo
1842 1842
 				. 'ORDER BY substr(type,2,1), name';
1843 1843
 			$a = spip_sqlite_query($query, $serveur, $requeter);
1844 1844
 			while ($r = spip_sqlite_fetch($a, null, $serveur)) {
1845
-				$key = str_replace($nom_table . '_', '', $r['name']); // enlever le nom de la table ajoute a l'index
1845
+				$key = str_replace($nom_table.'_', '', $r['name']); // enlever le nom de la table ajoute a l'index
1846 1846
 				$keytype = 'KEY';
1847 1847
 				if (strpos($r['sql'], 'UNIQUE INDEX') !== false) {
1848 1848
 					$keytype = 'UNIQUE KEY';
1849 1849
 				}
1850 1850
 				$colonnes = preg_replace(',.*\((.*)\).*,', '$1', $r['sql']);
1851
-				$keys[$keytype . ' ' . $key] = $colonnes;
1851
+				$keys[$keytype.' '.$key] = $colonnes;
1852 1852
 			}
1853 1853
 		}
1854 1854
 	} // c'est une vue, on liste les champs disponibles simplement
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
 
1896 1896
 	$set = [];
1897 1897
 	foreach ($champs as $champ => $val) {
1898
-		$set[] = $champ . "=$val";
1898
+		$set[] = $champ."=$val";
1899 1899
 	}
1900 1900
 	if (!empty($set)) {
1901 1901
 		return spip_sqlite_query(
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 
1949 1949
 	$set = [];
1950 1950
 	foreach ($champs as $champ => $val) {
1951
-		$set[$champ] = $champ . '=' . _sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : '');
1951
+		$set[$champ] = $champ.'='._sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : '');
1952 1952
 	}
1953 1953
 
1954 1954
 	// recherche de champs 'timestamp' pour mise a jour auto de ceux-ci
@@ -1956,7 +1956,7 @@  discard block
 block discarded – undo
1956 1956
 	$maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur);
1957 1957
 	foreach ($maj as $champ => $val) {
1958 1958
 		if (!isset($set[$champ])) {
1959
-			$set[$champ] = $champ . '=' . $val;
1959
+			$set[$champ] = $champ.'='.$val;
1960 1960
 		}
1961 1961
 	}
1962 1962
 
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
  */
1986 1986
 function _sqlite_init() {
1987 1987
 	if (!defined('_DIR_DB')) {
1988
-		define('_DIR_DB', _DIR_ETC . 'bases/');
1988
+		define('_DIR_DB', _DIR_ETC.'bases/');
1989 1989
 	}
1990 1990
 	if (!defined('_SQLITE_CHMOD')) {
1991 1991
 		define('_SQLITE_CHMOD', _SPIP_CHMOD);
@@ -2092,9 +2092,9 @@  discard block
 block discarded – undo
2092 2092
 	}
2093 2093
 
2094 2094
 	// echapper les ' en ''
2095
-	spip_log('Pas de methode ->quote pour echapper', 'sqlite.' . _LOG_INFO_IMPORTANTE);
2095
+	spip_log('Pas de methode ->quote pour echapper', 'sqlite.'._LOG_INFO_IMPORTANTE);
2096 2096
 
2097
-	return ("'" . str_replace("'", "''", $v) . "'");
2097
+	return ("'".str_replace("'", "''", $v)."'");
2098 2098
 }
2099 2099
 
2100 2100
 
@@ -2117,12 +2117,12 @@  discard block
 block discarded – undo
2117 2117
 	$exp = "\n$expression ";
2118 2118
 
2119 2119
 	if (!is_array($v)) {
2120
-		return $exp . $v;
2120
+		return $exp.$v;
2121 2121
 	} else {
2122 2122
 		if (strtoupper($join) === 'AND') {
2123
-			return $exp . join("\n\t$join ", array_map('_sqlite_calculer_where', $v));
2123
+			return $exp.join("\n\t$join ", array_map('_sqlite_calculer_where', $v));
2124 2124
 		} else {
2125
-			return $exp . join($join, $v);
2125
+			return $exp.join($join, $v);
2126 2126
 		}
2127 2127
 	}
2128 2128
 }
@@ -2156,17 +2156,17 @@  discard block
 block discarded – undo
2156 2156
 		if (substr($k, -1) == '@') {
2157 2157
 			// c'est une jointure qui se refere au from precedent
2158 2158
 			// pas de virgule
2159
-			$res .= '  ' . $v;
2159
+			$res .= '  '.$v;
2160 2160
 		} else {
2161 2161
 			if (!is_numeric($k)) {
2162 2162
 				$p = strpos($v, ' ');
2163 2163
 				if ($p) {
2164
-					$v = substr($v, 0, $p) . " AS '$k'" . substr($v, $p);
2164
+					$v = substr($v, 0, $p)." AS '$k'".substr($v, $p);
2165 2165
 				} else {
2166 2166
 					$v .= " AS '$k'";
2167 2167
 				}
2168 2168
 			}
2169
-			$res .= ', ' . $v;
2169
+			$res .= ', '.$v;
2170 2170
 		}
2171 2171
 	}
2172 2172
 
@@ -2304,13 +2304,13 @@  discard block
 block discarded – undo
2304 2304
 
2305 2305
 	$def_origine = sql_showtable($table_origine, false, $serveur);
2306 2306
 	if (!$def_origine or !isset($def_origine['field'])) {
2307
-		spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite' . _LOG_ERREUR);
2307
+		spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite'._LOG_ERREUR);
2308 2308
 
2309 2309
 		return false;
2310 2310
 	}
2311 2311
 
2312 2312
 
2313
-	$table_tmp = $table_origine . '_tmp';
2313
+	$table_tmp = $table_origine.'_tmp';
2314 2314
 
2315 2315
 	// 1) creer une table temporaire avec les modifications
2316 2316
 	// - DROP : suppression de la colonne
@@ -2397,7 +2397,7 @@  discard block
 block discarded – undo
2397 2397
 		} else {
2398 2398
 			// enlever KEY
2399 2399
 			$k = substr($k, 4);
2400
-			$queries[] = "CREATE INDEX $table_destination" . "_$k ON $table_destination ($v)";
2400
+			$queries[] = "CREATE INDEX $table_destination"."_$k ON $table_destination ($v)";
2401 2401
 		}
2402 2402
 	}
2403 2403
 
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
 		foreach ($queries as $q) {
2409 2409
 			if (!spip_sqlite::executer_requete($q, $serveur)) {
2410 2410
 				spip_log('SQLite : ALTER TABLE table :'
2411
-					. " Erreur a l'execution de la requete : $q", 'sqlite.' . _LOG_ERREUR);
2411
+					. " Erreur a l'execution de la requete : $q", 'sqlite.'._LOG_ERREUR);
2412 2412
 				spip_sqlite::annuler_transaction($serveur);
2413 2413
 
2414 2414
 				return false;
@@ -2498,27 +2498,27 @@  discard block
 block discarded – undo
2498 2498
 	$enum = '(\s*\([^\)]*\))?';
2499 2499
 
2500 2500
 	$remplace = [
2501
-		'/enum' . $enum . '/is' => 'VARCHAR(255)',
2501
+		'/enum'.$enum.'/is' => 'VARCHAR(255)',
2502 2502
 		'/COLLATE \w+_bin/is' => 'COLLATE BINARY',
2503 2503
 		'/COLLATE \w+_ci/is' => 'COLLATE NOCASE',
2504 2504
 		'/auto_increment/is' => '',
2505 2505
 		'/current_timestamp\(\)/is' => 'CURRENT_TIMESTAMP', // Fix export depuis mariaDB #4374
2506 2506
 		'/(timestamp .* )ON .*$/is' => '\\1',
2507 2507
 		'/character set \w+/is' => '',
2508
-		'/((big|small|medium|tiny)?int(eger)?)' . $num . '\s*unsigned/is' => '\\1 UNSIGNED',
2508
+		'/((big|small|medium|tiny)?int(eger)?)'.$num.'\s*unsigned/is' => '\\1 UNSIGNED',
2509 2509
 		'/(text\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2510
-		'/((char|varchar)' . $num . '\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2510
+		'/((char|varchar)'.$num.'\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''",
2511 2511
 		'/(datetime\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00 00:00:00'",
2512 2512
 		'/(date\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00'",
2513 2513
 	];
2514 2514
 
2515 2515
 	// pour l'autoincrement, il faut des INTEGER NOT NULL PRIMARY KEY
2516 2516
 	$remplace_autocinc = [
2517
-		'/(big|small|medium|tiny)?int(eger)?' . $num . '/is' => 'INTEGER'
2517
+		'/(big|small|medium|tiny)?int(eger)?'.$num.'/is' => 'INTEGER'
2518 2518
 	];
2519 2519
 	// pour les int non autoincrement, il faut un DEFAULT
2520 2520
 	$remplace_nonautocinc = [
2521
-		'/((big|small|medium|tiny)?int(eger)?' . $num . '\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0",
2521
+		'/((big|small|medium|tiny)?int(eger)?'.$num.'\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0",
2522 2522
 	];
2523 2523
 
2524 2524
 	if (is_string($query)) {
@@ -2560,7 +2560,7 @@  discard block
 block discarded – undo
2560 2560
 		return str_ireplace('BINARY', 'COLLATE BINARY', $champ);
2561 2561
 	}
2562 2562
 	if (preg_match(',^(char|varchar|(long|small|medium|tiny)?text),i', $champ)) {
2563
-		return $champ . ' COLLATE NOCASE';
2563
+		return $champ.' COLLATE NOCASE';
2564 2564
 	}
2565 2565
 
2566 2566
 	return $champ;
@@ -2650,14 +2650,14 @@  discard block
 block discarded – undo
2650 2650
 		} else {
2651 2651
 			/* simuler le IF EXISTS - version 2 et sqlite < 3.3a */
2652 2652
 			$a = spip_sqlite_showtable($nom, $serveur);
2653
-			if (isset($a['key']['KEY ' . $nom])) {
2653
+			if (isset($a['key']['KEY '.$nom])) {
2654 2654
 				return true;
2655 2655
 			}
2656 2656
 		}
2657 2657
 	}
2658 2658
 
2659 2659
 	$temporary = $temporary ? ' TEMPORARY' : '';
2660
-	$q = "CREATE$temporary TABLE$ifnotexists $nom ($query" . ($keys ? ",$keys" : '') . ")\n";
2660
+	$q = "CREATE$temporary TABLE$ifnotexists $nom ($query".($keys ? ",$keys" : '').")\n";
2661 2661
 
2662 2662
 	return $q;
2663 2663
 }
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
 		$this->serveur = strtolower($serveur);
2879 2879
 
2880 2880
 		if (!($this->link = _sqlite_link($this->serveur)) && (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)) {
2881
-			spip_log('Aucune connexion sqlite (link)', 'sqlite.' . _LOG_ERREUR);
2881
+			spip_log('Aucune connexion sqlite (link)', 'sqlite.'._LOG_ERREUR);
2882 2882
 
2883 2883
 			return false;
2884 2884
 		}
@@ -2924,7 +2924,7 @@  discard block
 block discarded – undo
2924 2924
 			try {
2925 2925
 				$r = $this->link->query($query);
2926 2926
 			} catch (\PDOException $e) {
2927
-				spip_log('PDOException: ' . $e->getMessage(), 'sqlite.' . _LOG_DEBUG);
2927
+				spip_log('PDOException: '.$e->getMessage(), 'sqlite.'._LOG_DEBUG);
2928 2928
 				$r = false;
2929 2929
 			}
2930 2930
 			// sauvegarde de la requete (elle y est deja dans $r->queryString)
@@ -2945,11 +2945,11 @@  discard block
 block discarded – undo
2945 2945
 
2946 2946
 			// loger les warnings/erreurs eventuels de sqlite remontant dans PHP
2947 2947
 			if ($e and $e instanceof \PDOException) {
2948
-				$err = strip_tags($e->getMessage()) . ' in ' . $e->getFile() . ' line ' . $e->getLine();
2949
-				spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR);
2948
+				$err = strip_tags($e->getMessage()).' in '.$e->getFile().' line '.$e->getLine();
2949
+				spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR);
2950 2950
 			} elseif ($err = (function_exists('error_get_last') ? error_get_last() : '') and $err != $last_error) {
2951
-				$err = strip_tags($err['message']) . ' in ' . $err['file'] . ' line ' . $err['line'];
2952
-				spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR);
2951
+				$err = strip_tags($err['message']).' in '.$err['file'].' line '.$err['line'];
2952
+				spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR);
2953 2953
 			} else {
2954 2954
 				$err = '';
2955 2955
 			}
@@ -3027,15 +3027,15 @@  discard block
 block discarded – undo
3027 3027
 		// Correction Create Database
3028 3028
 		// Create Database -> requete ignoree
3029 3029
 		if (strpos($this->query, 'CREATE DATABASE') === 0) {
3030
-			spip_log("Sqlite : requete non executee -> $this->query", 'sqlite.' . _LOG_AVERTISSEMENT);
3030
+			spip_log("Sqlite : requete non executee -> $this->query", 'sqlite.'._LOG_AVERTISSEMENT);
3031 3031
 			$this->query = 'SELECT 1';
3032 3032
 		}
3033 3033
 
3034 3034
 		// Correction Insert Ignore
3035 3035
 		// INSERT IGNORE -> insert (tout court et pas 'insert or replace')
3036 3036
 		if (strpos($this->query, 'INSERT IGNORE') === 0) {
3037
-			spip_log("Sqlite : requete transformee -> $this->query", 'sqlite.' . _LOG_DEBUG);
3038
-			$this->query = 'INSERT ' . substr($this->query, '13');
3037
+			spip_log("Sqlite : requete transformee -> $this->query", 'sqlite.'._LOG_DEBUG);
3038
+			$this->query = 'INSERT '.substr($this->query, '13');
3039 3039
 		}
3040 3040
 
3041 3041
 		// Correction des dates avec INTERVAL
@@ -3063,7 +3063,7 @@  discard block
 block discarded – undo
3063 3063
 		if (($this->sqlite_version == 2) && (strpos($this->query, 'USING') !== false)) {
3064 3064
 			spip_log(
3065 3065
 				"'USING (champ)' n'est pas reconnu en SQLite 2. Utilisez 'ON table1.champ = table2.champ'",
3066
-				'sqlite.' . _LOG_ERREUR
3066
+				'sqlite.'._LOG_ERREUR
3067 3067
 			);
3068 3068
 			$this->query = preg_replace('/USING\s*\([^\)]*\)/', '', $this->query);
3069 3069
 		}
@@ -3086,8 +3086,8 @@  discard block
 block discarded – undo
3086 3086
 		} else {
3087 3087
 			$suite = '';
3088 3088
 		}
3089
-		$pref = ($this->prefixe) ? $this->prefixe . '_' : '';
3090
-		$this->query = preg_replace('/([,\s])spip_/S', '\1' . $pref, $this->query) . $suite;
3089
+		$pref = ($this->prefixe) ? $this->prefixe.'_' : '';
3090
+		$this->query = preg_replace('/([,\s])spip_/S', '\1'.$pref, $this->query).$suite;
3091 3091
 
3092 3092
 		// Correction zero AS x
3093 3093
 		// pg n'aime pas 0+x AS alias, sqlite, dans le meme style,
Please login to merge, or discard this patch.
ecrire/action/editer_article.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	);
107 107
 
108 108
 	// Si l'article est publie, invalider les caches et demander sa reindexation
109
-	$t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article));
109
+	$t = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id_article));
110 110
 	$invalideur = $indexation = false;
111 111
 	if ($t == 'publie') {
112 112
 		$invalideur = "id='article/$id_article'";
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			$id_article,
120 120
 			[
121 121
 			'data' => $set,
122
-			'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article],
122
+			'nonvide' => ['titre' => _T('info_nouvel_article').' '._T('info_numero_abbreviation').$id_article],
123 123
 			'invalideur' => $invalideur,
124 124
 			'indexation' => $indexation,
125 125
 			'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		} elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') {
310 310
 			$statut = $champs['statut'] = $s;
311 311
 		} else {
312
-			spip_log("editer_article $id_article refus " . join(' ', $c));
312
+			spip_log("editer_article $id_article refus ".join(' ', $c));
313 313
 		}
314 314
 
315 315
 		// En cas de publication, fixer la date a "maintenant"
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		isset($c['id_parent'])
335 335
 		and $id_parent = $c['id_parent']
336 336
 		and $id_parent != $id_rubrique
337
-		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent)))
337
+		and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent)))
338 338
 	) {
339 339
 		$champs['id_rubrique'] = $id_parent;
340 340
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	// Si on deplace l'article
436 436
 	//  changer aussi son secteur et sa langue (si heritee)
437 437
 	if (isset($champs['id_rubrique'])) {
438
-		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique']));
438
+		$row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique']));
439 439
 
440 440
 		$langue = $row_rub['lang'];
441 441
 		$champs['id_secteur'] = $row_rub['id_secteur'];
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 			sql_fetsel(
444 444
 				'1',
445 445
 				'spip_articles',
446
-				'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue)
446
+				'id_article='.intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue)
447 447
 			)
448 448
 		) {
449 449
 			$champs['lang'] = $langue;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		return;
455 455
 	}
456 456
 
457
-	sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article));
457
+	sql_updateq('spip_articles', $champs, 'id_article='.intval($id_article));
458 458
 
459 459
 	// Changer le statut des rubriques concernees
460 460
 
@@ -475,6 +475,6 @@  discard block
 block discarded – undo
475 475
 		foreach ($plus as $n => $t) {
476 476
 			$plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t);
477 477
 		}
478
-		set_request('texte', join('', $plus) . _request('texte'));
478
+		set_request('texte', join('', $plus)._request('texte'));
479 479
 	}
480 480
 }
Please login to merge, or discard this patch.
ecrire/auth/ldap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	$credentials_ldap = ['ldap_dn' => $dn, 'ldap_password' => $pass];
69 69
 
70 70
 	// Si l'utilisateur figure deja dans la base, y recuperer les infos
71
-	$r = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login) . " AND source='ldap'", '', '', '', '', $serveur);
71
+	$r = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login)." AND source='ldap'", '', '', '', '', $serveur);
72 72
 
73 73
 	if ($r) {
74 74
 		return array_merge($r, $credentials_ldap);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	if ($r) {
93 93
 		return array_merge(
94 94
 			$credentials_ldap,
95
-			sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($r), '', '', '', '', $serveur)
95
+			sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($r), '', '', '', '', $serveur)
96 96
 		);
97 97
 	}
98 98
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	$connexion = spip_connect($serveur);
122 122
 	if (!is_array($connexion['ldap'])) {
123 123
 		if ($connexion['authentification']['ldap']) {
124
-			$f = _DIR_CONNECT . $connexion['authentification']['ldap'];
124
+			$f = _DIR_CONNECT.$connexion['authentification']['ldap'];
125 125
 			unset($GLOBALS['ldap_link']);
126 126
 			if (is_readable($f)) {
127 127
 				include_once($f);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 	if (!ldap_bind($link, $dn, session_get('ldap_password'))) {
335 335
 		return false;
336 336
 	}
337
-	$encoded_pass = '{MD5}' . base64_encode(pack('H*', md5($new_pass)));
337
+	$encoded_pass = '{MD5}'.base64_encode(pack('H*', md5($new_pass)));
338 338
 	$success = ldap_mod_replace($link, $dn, ['userPassword' => $encoded_pass]);
339 339
 
340 340
 	return $success;
Please login to merge, or discard this patch.
ecrire/inc/commencer_page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	$titre = '['
91 91
 		. $nom_site_spip
92 92
 		. ']'
93
-		. ($titre ? ' ' . textebrut(typo($titre)) : '');
93
+		. ($titre ? ' '.textebrut(typo($titre)) : '');
94 94
 
95 95
 	return _DOCTYPE_ECRIRE
96 96
 	. html_lang_attributes()
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) {
134 134
 
135 135
 	$res = pipeline('body_prive', "<body class='"
136
-		. init_body_class() . ' ' . _request('exec') . "'"
136
+		. init_body_class().' '._request('exec')."'"
137 137
 		. ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '')
138 138
 		. '>');
139 139
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
 	$couleur = intval($prefs['couleur'] ?? 2);
176 176
 
177
-	$classes = $GLOBALS['spip_ecran'] . " spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils " . $display_class[$GLOBALS['spip_display']];
177
+	$classes = $GLOBALS['spip_ecran']." spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils ".$display_class[$GLOBALS['spip_display']];
178 178
 	return spip_sanitize_classname($classes);
179 179
 }
180 180
 
Please login to merge, or discard this patch.
ecrire/inc/documents.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) {
65
-		$fichier = _DIR_IMG . $fichier;
65
+		$fichier = _DIR_IMG.$fichier;
66 66
 	}
67 67
 
68 68
 	// fichier normal
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
 			or !$r = verifier_upload_autorise($dest)
159 159
 			or $r['autozip']
160 160
 		) {
161
-			$dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1];
161
+			$dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1];
162 162
 			break;
163 163
 		}
164 164
 		else {
165 165
 			$dest = substr($dest, 0, -strlen($m[0]));
166
-			$ext = $m[1] . '.' . $ext;
166
+			$ext = $m[1].'.'.$ext;
167 167
 		}
168 168
 	}
169 169
 
170 170
 	// Si le document "source" est deja au bon endroit, ne rien faire
171
-	if ($source == ($dir . $dest . '.' . $ext)) {
171
+	if ($source == ($dir.$dest.'.'.$ext)) {
172 172
 		return $source;
173 173
 	}
174 174
 
175 175
 	// sinon tourner jusqu'a trouver un numero correct
176 176
 	$n = 0;
177
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
177
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
178 178
 		;
179 179
 	}
180 180
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 function deplacer_fichier_upload($source, $dest, $move = false) {
236 236
 	// Securite
237 237
 	if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) {
238
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
238
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
239 239
 	} else {
240 240
 		$dest = preg_replace(',\.\.+,', '.', $dest);
241 241
 	}
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 
318 318
 		default: /* autre */
319 319
 			if (!$msg) {
320
-				$msg = _T('pass_erreur') . ' ' . $error
321
-					. '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
320
+				$msg = _T('pass_erreur').' '.$error
321
+					. '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
322 322
 			}
323 323
 			break;
324 324
 	}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	include_spip('inc/minipres');
337 337
 	echo minipres(
338 338
 		$msg,
339
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>'
339
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>'
340 340
 	);
341 341
 	exit;
342 342
 }
Please login to merge, or discard this patch.