Completed
Push — master ( c2652d...a4fa78 )
by cam
01:40
created
ecrire/base/objets.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 		$infos['url_voir'] = $infos['type'];
704 704
 	}
705 705
 	if (!isset($infos['url_edit'])) {
706
-		$infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : '');
706
+		$infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : '');
707 707
 	}
708 708
 	if (!isset($infos['icone_objet'])) {
709 709
 		$infos['icone_objet'] = $infos['type'];
@@ -715,48 +715,48 @@  discard block
 block discarded – undo
715 715
 		$infos['texte_retour'] = 'icone_retour';
716 716
 	}
717 717
 	if (!isset($infos['texte_modifier'])) {
718
-		$infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type'];
718
+		$infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type'];
719 719
 	}
720 720
 	if (!isset($infos['texte_creer'])) {
721
-		$infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type'];
721
+		$infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type'];
722 722
 	}
723 723
 	if (!isset($infos['texte_creer_associer'])) {
724
-		$infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type'];
724
+		$infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type'];
725 725
 	}
726 726
 	if (!isset($infos['texte_ajouter'])) {
727 727
 		// Ajouter un X
728
-		$infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type'];
728
+		$infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type'];
729 729
 	}
730 730
 	if (!isset($infos['texte_objets'])) {
731
-		$infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet'];
731
+		$infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet'];
732 732
 	}
733 733
 	if (!isset($infos['texte_objet'])) {
734
-		$infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type'];
734
+		$infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type'];
735 735
 	}
736 736
 	if (!isset($infos['texte_logo_objet'])) {
737 737
 		// objet:titre_logo_objet "Logo de ce X"
738
-		$infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type'];
738
+		$infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type'];
739 739
 	}
740 740
 	if (!isset($infos['texte_langue_objet'])) {
741 741
 		// objet:texte_langue_objet "Langue de ce X"
742
-		$infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type'];
742
+		$infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type'];
743 743
 	}
744 744
 	if (!isset($infos['texte_definir_comme_traduction_objet'])) {
745 745
 		// "Ce X est une traduction du X numéro :"
746
-		$infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type'];
746
+		$infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type'];
747 747
 	}
748 748
 
749 749
 	// objet:info_aucun_objet
750 750
 	if (!isset($infos['info_aucun_objet'])) {
751
-		$infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type'];
751
+		$infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type'];
752 752
 	}
753 753
 	// objet:info_1_objet
754 754
 	if (!isset($infos['info_1_objet'])) {
755
-		$infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type'];
755
+		$infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type'];
756 756
 	}
757 757
 	// objet:info_nb_objets
758 758
 	if (!isset($infos['info_nb_objets'])) {
759
-		$infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet'];
759
+		$infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet'];
760 760
 	}
761 761
 
762 762
 	if (!isset($infos['champs_editables'])) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 		}
955 955
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
956 956
 		$connexion = $GLOBALS['connexions'][$serveur ?: 0];
957
-		$spip = $connexion['prefixe'] . '_';
957
+		$spip = $connexion['prefixe'].'_';
958 958
 		foreach ($ts as $t) {
959 959
 			$t = substr((string) $t, strlen($spip));
960 960
 			$tables[$serveur]["spip_$t"] = $t;
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
  * @return string
1008 1008
  *     Nom de l'objet
1009 1009
  **/
1010
-function table_objet(string $type, string|false $serveur = ''): string {
1010
+function table_objet(string $type, string | false $serveur = ''): string {
1011 1011
 
1012 1012
 	if ($type) {
1013 1013
 		$type = preg_replace(',^spip_|^id_|s$,', '', $type);
@@ -1024,9 +1024,9 @@  discard block
 block discarded – undo
1024 1024
 	if ($serveur !== false) {
1025 1025
 		$t = lister_tables_spip($serveur);
1026 1026
 		$trouver_table = charger_fonction('trouver_table', 'base');
1027
-		$typetrim = rtrim($type, 's') . 's';
1027
+		$typetrim = rtrim($type, 's').'s';
1028 1028
 		if (
1029
-			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1029
+			(isset($t[$typetrim]) || in_array($typetrim, $t)) && ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1030 1030
 		) {
1031 1031
 			return $desc['id_table'];
1032 1032
 		} elseif (
@@ -1035,11 +1035,11 @@  discard block
 block discarded – undo
1035 1035
 			return $desc['id_table'];
1036 1036
 		}
1037 1037
 
1038
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1038
+		spip_log('table_objet('.$type.') calculee sans verification');
1039 1039
 		#spip_log(debug_backtrace(),'db');
1040 1040
 	}
1041 1041
 
1042
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1042
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1043 1043
 }
1044 1044
 
1045 1045
 /**
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
  * @return string
1060 1060
  *     Nom de la table SQL
1061 1061
  **/
1062
-function table_objet_sql(string $type, string|false $serveur = ''): string {
1062
+function table_objet_sql(string $type, string | false $serveur = ''): string {
1063 1063
 	$nom = table_objet($type, $serveur);
1064 1064
 	if (!strlen($nom)) {
1065 1065
 		return '';
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
  * @return string|null
1152 1152
  *     Type de l'objet
1153 1153
  **/
1154
-function objet_type(string $table_objet, string|false $serveur = ''): ?string {
1154
+function objet_type(string $table_objet, string | false $serveur = ''): ?string {
1155 1155
 	if (!$table_objet) {
1156 1156
 		return null;
1157 1157
 	}
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1224 1224
 	// voir si une fonction est definie pour faire le boulot
1225 1225
 	// elle a la priorite dans ce cas
1226
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1226
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1227 1227
 		return $f($objet, $id_objet, $serveur);
1228 1228
 	}
1229 1229
 
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 		$boucle->sql_serveur = $serveur;
1246 1246
 		$boucle->select[] = $id_table_objet;
1247 1247
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1248
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . (int) $id_objet;
1248
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.(int) $id_objet;
1249 1249
 
1250 1250
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1251 1251
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 						? "{$parent_methode['source_champ']} = $id_objet"
1369 1369
 						: "$cle_objet = $id_objet";
1370 1370
 					if (isset($parent_methode['source_champ_type'])) {
1371
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1371
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1372 1372
 					}
1373 1373
 					// -- Condition supplémentaire sur la détection du parent
1374 1374
 					if (isset($parent_methode['table_condition'])) {
@@ -1492,11 +1492,11 @@  discard block
 block discarded – undo
1492 1492
 			$where = [];
1493 1493
 			// -- L'identifiant du parent
1494 1494
 			if (isset($_methode_parent['champ'])) {
1495
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1495
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1496 1496
 			}
1497 1497
 			// -- Si le parent est variable
1498 1498
 			if (isset($_methode_parent['champ_type'])) {
1499
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1499
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1500 1500
 			}
1501 1501
 
1502 1502
 			// On détermine la table, le champ id des enfants et on complète éventuellement les conditions
Please login to merge, or discard this patch.
ecrire/plugins/afficher_nom_plugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	// numerotons les occurences d'un meme prefix
37 37
 	$versions[$info['prefix']] ??= 0;
38 38
 	$versions[$info['prefix']]++;
39
-	$id = $info['prefix'] . $versions[$info['prefix']];
39
+	$id = $info['prefix'].$versions[$info['prefix']];
40 40
 
41 41
 	$class = $class_li;
42 42
 	$class .= $actif ? ' actif' : '';
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 
50 50
 	// Cartouche Resume
51 51
 	$s .= "<div class='resume'>";
52
-	$s .= "<strong class='nom'>" . typo($info['nom']) . '</strong>';
53
-	$s .= " <span class='version'>" . $info['version'] . '</span>';
54
-	$s .= " <span class='etat'> - " . plugin_etat_en_clair($info['etat']) . '</span>';
52
+	$s .= "<strong class='nom'>".typo($info['nom']).'</strong>';
53
+	$s .= " <span class='version'>".$info['version'].'</span>';
54
+	$s .= " <span class='etat'> - ".plugin_etat_en_clair($info['etat']).'</span>';
55 55
 	$s .= '</div>';
56 56
 
57 57
 	if ($erreur) {
58
-		$s .= "<div class='erreur'>" . implode('<br >', $info['erreur']) . '</div>';
58
+		$s .= "<div class='erreur'>".implode('<br >', $info['erreur']).'</div>';
59 59
 	}
60 60
 
61
-	return $s . '</li>';
61
+	return $s.'</li>';
62 62
 }
Please login to merge, or discard this patch.
ecrire/plugins/afficher_plugin.php 1 patch
Spacing   +34 added lines, -35 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 			" class='picto_err'",
63 63
 			_T('plugin_info_erreur_xml')
64 64
 		)
65
-			. "<div class='erreur'>" . join('<br >', $info['erreur']) . '</div>';
65
+			. "<div class='erreur'>".join('<br >', $info['erreur']).'</div>';
66 66
 		$checkable = false;
67
-	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
67
+	} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) {
68 68
 		$class_li .= ' error';
69 69
 		$erreur = http_img_pack(
70 70
 			'plugin-err-32.png',
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 			" class='picto_err'",
73 73
 			_T('plugin_impossible_activer', ['plugin' => $nom])
74 74
 		)
75
-			. "<div class='erreur'>" . implode(
75
+			. "<div class='erreur'>".implode(
76 76
 				'<br />',
77
-				$GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]
78
-			) . '</div>';
77
+				$GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file]
78
+			).'</div>';
79 79
 	} else {
80 80
 		$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : '';
81 81
 		if (defined('_DEV_VERSION_SPIP_COMPAT') && !plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'])) {
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 	// numerotons les occurrences d'un meme prefix
93 93
 	$versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : '';
94 94
 
95
-	$class_li .= ($actif ? ' actif' : '') . ($expose ? ' on' : '');
95
+	$class_li .= ($actif ? ' actif' : '').($expose ? ' on' : '');
96 96
 
97 97
 	return "<li id='$prefix$id' class='$class_li'>"
98 98
 	. ((!$checkable && !$checked)
99
-		? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked))
99
+		? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked))
100 100
 	. plugin_resume($info, $dir_plugins, $plug_file, $url_page)
101 101
 	. $cfg
102 102
 	. $erreur
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 	// si paquet.xml fournit un squelette, le prendre
116 116
 	if (isset($infos['config']) && $infos['config']) {
117 117
 		return recuperer_fond(
118
-			"$dir$nom/" . $infos['config'],
118
+			"$dir$nom/".$infos['config'],
119 119
 			[
120
-				'script' => 'configurer_' . $prefix,
120
+				'script' => 'configurer_'.$prefix,
121 121
 				'nom' => $nom
122 122
 			]
123 123
 		);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	return recuperer_fond(
128 128
 		'prive/squelettes/inclure/cfg',
129 129
 		[
130
-			'script' => 'configurer_' . $prefix,
130
+			'script' => 'configurer_'.$prefix,
131 131
 			'nom' => $nom
132 132
 		]
133 133
 	);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	. "<input type='checkbox' name='s$name' id='label_$id_input'"
144 144
 	. ($actif ? " checked='checked'" : '')
145 145
 	. " class='checkbox'  value='O' />"
146
-	. "\n<label for='label_$id_input'>" . _T('activer_plugin') . '</label>'
146
+	. "\n<label for='label_$id_input'>"._T('activer_plugin').'</label>'
147 147
 	. '</div>';
148 148
 }
149 149
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	. "<h3><a href='$url' rel='info'>"
199 199
 	. $nom
200 200
 	. '</a></h3>'
201
-	. " <span class='version'>" . $info['version'] . '</span>'
201
+	. " <span class='version'>".$info['version'].'</span>'
202 202
 	. " <span class='etat'> - "
203 203
 	. plugin_etat_en_clair($info['etat'])
204 204
 	. '</span>'
205
-	. "<div class='short'>" . $slogan . '</div>'
205
+	. "<div class='short'>".$slogan.'</div>'
206 206
 	. $i
207 207
 	. '</div>';
208 208
 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	$text2 = _T('info_desinstaller_plugin');
218 218
 	$file = basename($plug_file);
219 219
 
220
-	return "<div class='actions'>[" .
220
+	return "<div class='actions'>[".
221 221
 	"<a href='$action'
222 222
 		onclick='return confirm(\"$text $nom ?\\n$text2\")'>"
223 223
 	. $text
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$etat = 'developpement';
240 240
 	}
241 241
 
242
-	return _T('plugin_etat_' . $etat);
242
+	return _T('plugin_etat_'.$etat);
243 243
 }
244 244
 
245 245
 function plugin_propre($texte, $module = '', $propre = 'propre') {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		$module = substr($module, strlen(_DIR_RACINE));
249 249
 	}
250 250
 	if (preg_match('|^\w+_[\w_]+$|', $texte)) {
251
-		$texte = _T(($module ? "$module:" : '') . $texte, [], ['force' => false]);
251
+		$texte = _T(($module ? "$module:" : '').$texte, [], ['force' => false]);
252 252
 	}
253 253
 
254 254
 	return $propre($texte);
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 	if (
281 281
 		isset($info['documentation']) && ($lien = $info['documentation'])
282 282
 	) {
283
-		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>';
283
+		$description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>';
284 284
 	}
285
-	$s .= "<dd class='desc'>" . $description . "</dd>\n";
285
+	$s .= "<dd class='desc'>".$description."</dd>\n";
286 286
 
287 287
 	if (isset($info['auteur'])) {
288 288
 		if (is_array($info['auteur'])) {
@@ -292,19 +292,19 @@  discard block
 block discarded – undo
292 292
 			$a = trim($info['auteur']);
293 293
 		}
294 294
 		if ($a) {
295
-			$s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre(
295
+			$s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre(
296 296
 				$a,
297 297
 				$dir
298
-			)) . "</dd>\n";
298
+			))."</dd>\n";
299 299
 		}
300 300
 	}
301 301
 
302 302
 	if (isset($info['credit'])) {
303 303
 		if ($a = formater_credits($info['credit'], ', ')) {
304
-			$s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre(
304
+			$s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre(
305 305
 				$a,
306 306
 				$dir
307
-			)) . "</dd>\n";
307
+			))."</dd>\n";
308 308
 		}
309 309
 	}
310 310
 
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 			$a = trim($info['licence']);
317 317
 		}
318 318
 		if ($a) {
319
-			$s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre(
319
+			$s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre(
320 320
 				$a,
321 321
 				$dir
322
-			)) . "</dd>\n";
322
+			))."</dd>\n";
323 323
 		}
324 324
 	}
325 325
 
@@ -330,24 +330,23 @@  discard block
 block discarded – undo
330 330
 	//
331 331
 	$infotech = [];
332 332
 
333
-	$version = '<dt>' . _T('version') . '</dt><dd>' . $info['version'];
333
+	$version = '<dt>'._T('version').'</dt><dd>'.$info['version'];
334 334
 	// Version VCS
335
-	if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) {
336
-		$version .= ' ' . $vcs;
335
+	if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) {
336
+		$version .= ' '.$vcs;
337 337
 	}
338 338
 	$version .= '</dd>';
339 339
 	$infotech[] = $version;
340
-	$infotech[] = '<dt>' . _T('repertoire_plugins') . '</dt><dd>' . joli_repertoire("$dir_plugins$plug_file") . '</dd>';
340
+	$infotech[] = '<dt>'._T('repertoire_plugins').'</dt><dd>'.joli_repertoire("$dir_plugins$plug_file").'</dd>';
341 341
 	// source zip le cas echeant
342
-	$infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
-		? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . '</dd>'
342
+	$infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log) && preg_match(',^source:(.*)$,m', $log, $r))
343
+		? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1]).'</dd>'
344 344
 		: '';
345 345
 
346
-	$infotech[] = !$info['necessite'] ? '' :
347
-		('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(
346
+	$infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(
348 347
 			' ',
349 348
 			array_map('array_shift', $info['necessite'])
350
-		) . '</dd>');
349
+		).'</dd>');
351 350
 
352 351
 	$s .= "<dl class='tech'>"
353 352
 		. join('', $infotech)
@@ -368,8 +367,8 @@  discard block
 block discarded – undo
368 367
 		$texte .=
369 368
 			(!is_array($_credit))
370 369
 				? PtoBR(propre($_credit))
371
-				: ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') .
372
-				$_credit['nom'] .
370
+				: ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : '').
371
+				$_credit['nom'].
373 372
 				($_credit['url'] ? '</a>' : '');
374 373
 	}
375 374
 
Please login to merge, or discard this patch.
ecrire/install/etape_fin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	// creer le repertoire cache, qui sert partout !
40 40
 	// deja fait en etape 4 en principe, on garde au cas ou
41 41
 	if (!@file_exists(_DIR_CACHE)) {
42
-		$rep = preg_replace(',' . _DIR_TMP . ',', '', (string) _DIR_CACHE);
42
+		$rep = preg_replace(','._DIR_TMP.',', '', (string) _DIR_CACHE);
43 43
 		$rep = sous_repertoire(_DIR_TMP, $rep, true, true);
44 44
 	}
45 45
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$cible = _T('public:accueil_site');
51 51
 		$cible = generer_form_ecrire('accueil', '', '', $cible);
52 52
 		$minipage = new Installation();
53
-		echo $minipage->page($msg . $cible);
53
+		echo $minipage->page($msg.$cible);
54 54
 		// ok, deboucher dans l'espace prive
55 55
 	} else {
56 56
 		redirige_url_ecrire('accueil');
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 	$averti = _T(
72 72
 		'htaccess_a_simuler',
73 73
 		[
74
-			'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>',
74
+			'htaccess' => '<tt>'._ACCESS_FILE_NAME.'</tt>',
75 75
 			'constantes' => '<tt>_DIR_TMP &amp; _DIR_CONNECT</tt>',
76
-			'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>'
76
+			'document_root' => '<tt>'.$_SERVER['DOCUMENT_ROOT'].'</tt>'
77 77
 		]
78 78
 	);
79 79
 
Please login to merge, or discard this patch.
ecrire/install/etape_.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 	} else {
35 35
 		include_spip('inc/presentation'); // pour info_copyright
36 36
 
37
-		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" .
38
-			"<p class='small'>" . info_copyright() . "</p></div>\n" .
39
-			'<p>' . _T('install_select_langue') . '</p>' .
40
-			'<div>' . $menu_langues . "</div>\n" .
41
-			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant());
37
+		$res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='".chemin_image('logo-spip.png')."' />\n".
38
+			"<p class='small'>".info_copyright()."</p></div>\n".
39
+			'<p>'._T('install_select_langue').'</p>'.
40
+			'<div>'.$menu_langues."</div>\n".
41
+			generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />".bouton_suivant());
42 42
 
43 43
 		$minipage = new Installation();
44 44
 		echo $minipage->page($res);
Please login to merge, or discard this patch.
ecrire/install/etape_2.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	$GLOBALS['connexions'][$server_db] = $link;
51 51
 
52 52
 	$GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
53
-		= $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']];
53
+		= $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']];
54 54
 
55 55
 	$minipage = new Installation();
56 56
 	echo $minipage->installDebutPage();
@@ -70,18 +70,18 @@  discard block
 block discarded – undo
70 70
 	//echo "\n-->\n";
71 71
 
72 72
 	if (($db_connect == '0') && $link) {
73
-		echo "<div class='success'><b>" . _T('info_connexion_ok') . '</b></div>';
73
+		echo "<div class='success'><b>"._T('info_connexion_ok').'</b></div>';
74 74
 		echo info_progression_etape(2, 'etape_', 'install/');
75 75
 
76
-		echo info_etape(_T('menu_aide_installation_choix_base') . aider('install2', true));
76
+		echo info_etape(_T('menu_aide_installation_choix_base').aider('install2', true));
77 77
 
78 78
 		echo "\n", '<!-- ', sql_version($server_db), ' -->';
79 79
 		[$checked, $res] = install_etape_2_bases($login_db, $server_db);
80 80
 
81 81
 		$hidden = (defined('_SPIP_CHMOD')
82 82
 				? ''
83
-				: ("\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />"))
84
-			. predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db);
83
+				: ("\n<input type='hidden' name='chmod' value='".spip_htmlspecialchars($chmod)."' />"))
84
+			. predef_ou_cache($adresse_db.($port ? ':'.$port : ''), $login_db, $pass_db, $server_db);
85 85
 
86 86
 		echo install_etape_2_form($hidden, $checked, $res, 3);
87 87
 	} else {
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 
90 90
 		echo "<div class='error'>";
91 91
 		echo info_etape(_T('info_connexion_base'));
92
-		echo '<h3>' . _T('avis_connexion_echec_1') . '</h3>';
93
-		echo '<p>' . _T('avis_connexion_echec_2') . '</p>';
92
+		echo '<h3>'._T('avis_connexion_echec_1').'</h3>';
93
+		echo '<p>'._T('avis_connexion_echec_2').'</p>';
94 94
 
95 95
 		echo "<p style='font-size: small;'>",
96 96
 		_T('avis_connexion_echec_3'),
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 			. ' '
123 123
 		];
124 124
 	}
125
-	$res = '<b>' . _T('avis_lecture_noms_bases_1') . '</b>
126
-		' . _T('avis_lecture_noms_bases_2') . '<p>';
125
+	$res = '<b>'._T('avis_lecture_noms_bases_1').'</b>
126
+		' . _T('avis_lecture_noms_bases_2').'<p>';
127 127
 
128 128
 	$checked = false;
129 129
 	if ($login_db) {
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 		if ($ok) {
141 141
 			$res .= _T('avis_lecture_noms_bases_3')
142 142
 				. '<ul>'
143
-				. '<li><input name="choix_db" value="' . $test_base . "\" type='radio' id='stand' checked='checked' />"
144
-				. "<label for='stand'>" . $test_base . "</label></li>\n"
143
+				. '<li><input name="choix_db" value="'.$test_base."\" type='radio' id='stand' checked='checked' />"
144
+				. "<label for='stand'>".$test_base."</label></li>\n"
145 145
 				. '</ul>'
146
-				. '<p>' . _T('info_ou') . ' ';
146
+				. '<p>'._T('info_ou').' ';
147 147
 			$checked = true;
148 148
 		}
149 149
 	}
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
 		"\n<input type='hidden' name='etape' value='$etape' />"
157 157
 		. $hidden
158 158
 		. (defined('_INSTALL_NAME_DB')
159
-			? '<h3>' . _T('install_nom_base_hebergeur') . ' <tt>' . _INSTALL_NAME_DB . '</tt>' . '</h3>'
160
-			: "\n<fieldset><legend>" . _T('texte_choix_base_1') . "</legend>\n"
159
+			? '<h3>'._T('install_nom_base_hebergeur').' <tt>'._INSTALL_NAME_DB.'</tt>'.'</h3>'
160
+			: "\n<fieldset><legend>"._T('texte_choix_base_1')."</legend>\n"
161 161
 			. $res
162 162
 			. "\n<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'"
163 163
 			. ($checked ? '' : " checked='checked'")
164
-			. " />\n<label for='nou'>" . _T('info_creer_base') . "</label></p>\n<p>"
164
+			. " />\n<label for='nou'>"._T('info_creer_base')."</label></p>\n<p>"
165 165
 			. "\n<input type='text' name='table_new' class='text' value=\"spip\" size='20' /></p></fieldset>\n"
166 166
 		)
167 167
 
168 168
 		. ((defined('_INSTALL_TABLE_PREFIX') || $GLOBALS['table_prefix'] != 'spip')
169
-			? '<h3>' . _T('install_table_prefix_hebergeur') . '  <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>'
170
-			: '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n"
171
-			. "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>'
169
+			? '<h3>'._T('install_table_prefix_hebergeur').'  <tt>'.$GLOBALS['table_prefix'].'</tt>'.'</h3>'
170
+			: '<fieldset><legend>'._T('texte_choix_table_prefix')."</legend>\n"
171
+			. "<p><label for='table_prefix'>"._T('info_table_prefix').'</label></p><p>'
172 172
 			. "\n<input type='text' id='tprefix' name='tprefix' class='text' value='"
173 173
 			. 'spip' # valeur par defaut
174 174
 			. "' size='20' /></p></fieldset>"
Please login to merge, or discard this patch.
ecrire/req/mysql.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 			$link = @mysqli_connect($host, $login, $pass);
59 59
 		}
60 60
 	} catch (\mysqli_sql_exception $e) {
61
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
61
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
62 62
 		$link = false;
63 63
 	}
64 64
 
65 65
 	if (!$link) {
66
-		spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS);
66
+		spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS);
67 67
 
68 68
 		return false;
69 69
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 	spip_log(
85
-		"Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'),
85
+		"Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? 'operationnelle' : 'impossible'),
86 86
 		_LOG_DEBUG
87 87
 	);
88 88
 
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) {
175 175
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
176
-	spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG);
176
+	spip_log('changement de charset sql : '.'SET NAMES '._q($charset), _LOG_DEBUG);
177 177
 
178
-	return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset));
178
+	return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES '._q($charset));
179 179
 }
180 180
 
181 181
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) {
191 191
 	$connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
192 192
 	$connexion['last'] = $c = 'SHOW CHARACTER SET'
193
-		. (!$charset ? '' : (' LIKE ' . _q($charset['charset'])));
193
+		. (!$charset ? '' : (' LIKE '._q($charset['charset'])));
194 194
 
195 195
 	return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur);
196 196
 }
@@ -234,21 +234,21 @@  discard block
 block discarded – undo
234 234
 	$debug = '';
235 235
 	if (defined('_DEBUG_SLOW_QUERIES') && _DEBUG_SLOW_QUERIES) {
236 236
 		if (isset($GLOBALS['debug']['aucasou'])) {
237
-			[, $id, , $infos] = $GLOBALS['debug']['aucasou'];
238
-			$debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | ';
237
+			[, $id,, $infos] = $GLOBALS['debug']['aucasou'];
238
+			$debug .= "BOUCLE$id @ ".($infos[0] ?? '').' | ';
239 239
 		}
240 240
 		if (isset($_SERVER['REQUEST_URI'])) {
241 241
 			$debug .= $_SERVER['REQUEST_URI'];
242 242
 		}
243 243
 		if (!empty($GLOBALS['ip'])) {
244
-			$debug .= ' + ' . $GLOBALS['ip'];
244
+			$debug .= ' + '.$GLOBALS['ip'];
245 245
 		}
246
-		$debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */';
246
+		$debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */';
247 247
 	}
248 248
 	try {
249
-		$r = mysqli_query($link, $query . $debug);
249
+		$r = mysqli_query($link, $query.$debug);
250 250
 	} catch (\mysqli_sql_exception $e) {
251
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
251
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
252 252
 		$r = false;
253 253
 		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
254 254
 		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 			$link = $connexion['link'];
267 267
 			//On retente au cas où
268 268
 			try {
269
-				$r = mysqli_query($link, $query . $debug);
269
+				$r = mysqli_query($link, $query.$debug);
270 270
 			} catch (\mysqli_sql_exception $e) {
271
-				spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
271
+				spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
272 272
 				$r = false;
273 273
 				// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
274 274
 				// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	// d'utiliser ceux-ci, copie-colle de phpmyadmin
302 302
 	$query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query);
303 303
 
304
-	return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille
304
+	return spip_mysql_query('ALTER '.$query, $serveur, $requeter); # i.e. que PG se debrouille
305 305
 }
306 306
 
307 307
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
  * @return bool            Toujours true
315 315
  */
316 316
 function spip_mysql_optimize($table, $serveur = '', $requeter = true) {
317
-	spip_mysql_query('OPTIMIZE TABLE ' . $table);
317
+	spip_mysql_query('OPTIMIZE TABLE '.$table);
318 318
 
319 319
 	return true;
320 320
 }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	$link = $connexion['link'];
338 338
 	$db = $connexion['db'];
339 339
 
340
-	$query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe);
340
+	$query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe);
341 341
 	$r = mysqli_query($link, $query);
342 342
 
343 343
 	return spip_mysql_fetch($r, null, $serveur);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		. calculer_mysql_expression('WHERE', $where)
389 389
 		. calculer_mysql_expression('GROUP BY', $groupby, ',')
390 390
 		. calculer_mysql_expression('HAVING', $having)
391
-		. ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '')
391
+		. ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '')
392 392
 		. ($limit ? "\nLIMIT $limit" : '');
393 393
 
394 394
 	// renvoyer la requete inerte si demandee
@@ -478,12 +478,12 @@  discard block
 block discarded – undo
478 478
 	$exp = "\n$expression ";
479 479
 
480 480
 	if (!is_array($v)) {
481
-		return $exp . $v;
481
+		return $exp.$v;
482 482
 	} else {
483 483
 		if (strtoupper($join) === 'AND') {
484
-			return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v));
484
+			return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v));
485 485
 		} else {
486
-			return $exp . join($join, $v);
486
+			return $exp.join($join, $v);
487 487
 		}
488 488
 	}
489 489
 }
@@ -501,17 +501,17 @@  discard block
 block discarded – undo
501 501
 		if (str_ends_with($k, '@')) {
502 502
 			// c'est une jointure qui se refere au from precedent
503 503
 			// pas de virgule
504
-			$res .= '  ' . $v;
504
+			$res .= '  '.$v;
505 505
 		} else {
506 506
 			if (!is_numeric($k)) {
507 507
 				$p = strpos($v, ' ');
508 508
 				if ($p) {
509
-					$v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p);
509
+					$v = substr($v, 0, $p)." AS `$k`".substr($v, $p);
510 510
 				} else {
511 511
 					$v .= " AS `$k`";
512 512
 				}
513 513
 			}
514
-			$res .= ', ' . $v;
514
+			$res .= ', '.$v;
515 515
 		}
516 516
 	}
517 517
 
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) {
542 542
 
543 543
 	if ($GLOBALS['mysql_rappel_nom_base'] && $db) {
544
-		$pref = '`' . $db . '`.';
544
+		$pref = '`'.$db.'`.';
545 545
 	} else {
546 546
 		$pref = '';
547 547
 	}
548 548
 
549 549
 	if ($prefixe) {
550
-		$pref .= $prefixe . '_';
550
+		$pref .= $prefixe.'_';
551 551
 	}
552 552
 
553 553
 	if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				$suite_echap = $suite;
567 567
 			}
568 568
 			if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) {
569
-				$suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false);
569
+				$suite_echap = $r[1]._mysql_traite_query($r[2], $db, $prefixe, false);
570 570
 				if ($echappe_textes) {
571 571
 					$suite = query_reinjecte_textes($suite_echap, $textes);
572 572
 				}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			}
577 577
 		}
578 578
 	}
579
-	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite;
579
+	$r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite;
580 580
 
581 581
 	// en option, remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
582 582
 	// remplacer les emoji (que mysql ne sait pas gérer) en &#128169;
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$ok = false;
617 617
 	}
618 618
 	if (!$ok) {
619
-		spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE);
619
+		spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE);
620 620
 	}
621 621
 
622 622
 	return $ok;
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 
707 707
 	$character_set = '';
708 708
 	if (@$GLOBALS['meta']['charset_sql_base']) {
709
-		$character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base'];
709
+		$character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base'];
710 710
 	}
711 711
 	if (@$GLOBALS['meta']['charset_collation_sql_base']) {
712
-		$character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base'];
712
+		$character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base'];
713 713
 	}
714 714
 
715 715
 	foreach ($champs as $k => $v) {
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 				preg_match(',(char|text),i', $defs[1])
720 720
 				&& !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
721 721
 			) {
722
-				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
722
+				$v = $defs[1].$character_set.' '.substr($v, strlen($defs[1]));
723 723
 			}
724 724
 		}
725 725
 
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
 		$s = ',';
732 732
 	}
733 733
 	$temporary = $temporary ? 'TEMPORARY' : '';
734
-	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')'
735
-		. (defined('_MYSQL_ENGINE') ? ' ENGINE=' . _MYSQL_ENGINE : '')
734
+	$q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')'
735
+		. (defined('_MYSQL_ENGINE') ? ' ENGINE='._MYSQL_ENGINE : '')
736 736
 		. ($character_set ? " DEFAULT $character_set" : '')
737 737
 		. "\n";
738 738
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		return false;
812 812
 	}
813 813
 
814
-	$query = "CREATE VIEW $nom AS " . $query_select;
814
+	$query = "CREATE VIEW $nom AS ".$query_select;
815 815
 
816 816
 	return spip_mysql_query($query, $serveur, $requeter);
817 817
 }
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
  *     Ressource à utiliser avec sql_fetch()
866 866
  **/
867 867
 function spip_mysql_showbase($match, $serveur = '', $requeter = true) {
868
-	return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter);
868
+	return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter);
869 869
 }
870 870
 
871 871
 /**
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
  *     - true si la requête a réussie, false sinon
882 882
  */
883 883
 function spip_mysql_repair($table, $serveur = '', $requeter = true) {
884
-	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true));
884
+	$table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = '._q($table), $serveur, true));
885 885
 	$engine = $table_status['Engine'];
886 886
 	if ($engine == 'InnoDB') {
887 887
 		if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) {
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	} elseif ($engine == 'MyISAM') {
891 891
 		return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter);
892 892
 	} else {
893
-		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG);
893
+		spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.'._LOG_DEBUG);
894 894
 	}
895 895
 	return false;
896 896
 }
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
  *     - string : requete sql, si $requeter = true
911 911
  **/
912 912
 function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) {
913
-	$r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter);
913
+	$r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter);
914 914
 	if (!$requeter) {
915 915
 		return $r;
916 916
 	}
@@ -992,22 +992,22 @@  discard block
 block discarded – undo
992 992
 			}
993 993
 			if ($val['Default'] === '0' || $val['Default']) {
994 994
 				if (preg_match('/[A-Z_]/', $val['Default'])) {
995
-					$nfields[$val['Field']] .= ' DEFAULT ' . $val['Default'];
995
+					$nfields[$val['Field']] .= ' DEFAULT '.$val['Default'];
996 996
 				} else {
997
-					$nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'";
997
+					$nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'";
998 998
 				}
999 999
 			}
1000 1000
 			if ($val['Extra']) {
1001
-				$nfields[$val['Field']] .= ' ' . $val['Extra'];
1001
+				$nfields[$val['Field']] .= ' '.$val['Extra'];
1002 1002
 			}
1003 1003
 			if ($val['Key'] == 'PRI') {
1004 1004
 				$nkeys['PRIMARY KEY'] = $val['Field'];
1005 1005
 			} else {
1006 1006
 				if ($val['Key'] == 'MUL') {
1007
-					$nkeys['KEY ' . $val['Field']] = $val['Field'];
1007
+					$nkeys['KEY '.$val['Field']] = $val['Field'];
1008 1008
 				} else {
1009 1009
 					if ($val['Key'] == 'UNI') {
1010
-						$nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field'];
1010
+						$nkeys['UNIQUE KEY '.$val['Field']] = $val['Field'];
1011 1011
 					}
1012 1012
 				}
1013 1013
 			}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 	$serveur = '',
1084 1084
 	$requeter = true
1085 1085
 ) {
1086
-	$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
1086
+	$c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby)));
1087 1087
 
1088 1088
 	$r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter);
1089 1089
 	if (!$requeter) {
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 	if ($s) {
1124 1124
 		$trace = debug_backtrace();
1125 1125
 		if ($trace[0]['function'] != 'spip_mysql_error') {
1126
-			spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR);
1126
+			spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR);
1127 1127
 		}
1128 1128
 	}
1129 1129
 
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 	try {
1254 1254
 		$insert = mysqli_query($link, $query);
1255 1255
 	} catch (\mysqli_sql_exception $e) {
1256
-		spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG);
1256
+		spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG);
1257 1257
 		// TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno()
1258 1258
 		// mais il faut pour php < 8.1 forcer les exeptions via mysqli_report().
1259 1259
 	}
@@ -1308,8 +1308,8 @@  discard block
 block discarded – undo
1308 1308
 
1309 1309
 	return spip_mysql_insert(
1310 1310
 		$table,
1311
-		'(' . join(',', array_keys($couples)) . ')',
1312
-		'(' . join(',', $couples) . ')',
1311
+		'('.join(',', array_keys($couples)).')',
1312
+		'('.join(',', $couples).')',
1313 1313
 		$desc,
1314 1314
 		$serveur,
1315 1315
 		$requeter
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 	}
1347 1347
 	$fields = $desc['field'] ?? [];
1348 1348
 
1349
-	$cles = '(' . join(',', array_keys(reset($tab_couples))) . ')';
1349
+	$cles = '('.join(',', array_keys(reset($tab_couples))).')';
1350 1350
 	$valeurs = [];
1351 1351
 	$r = false;
1352 1352
 
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
 		foreach ($couples as $champ => $val) {
1356 1356
 			$couples[$champ] = spip_mysql_cite($val, $fields[$champ]);
1357 1357
 		}
1358
-		$valeurs[] = '(' . join(',', $couples) . ')';
1358
+		$valeurs[] = '('.join(',', $couples).')';
1359 1359
 		if (count($valeurs) >= 100) {
1360 1360
 			$r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter);
1361 1361
 			$valeurs = [];
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) {
1393 1393
 	$set = [];
1394 1394
 	foreach ($champs as $champ => $val) {
1395
-		$set[] = $champ . "=$val";
1395
+		$set[] = $champ."=$val";
1396 1396
 	}
1397 1397
 	if (!empty($set)) {
1398 1398
 		return spip_mysql_query(
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 	}
1450 1450
 	$set = [];
1451 1451
 	foreach ($champs as $champ => $val) {
1452
-		$set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]);
1452
+		$set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]);
1453 1453
 	}
1454 1454
 
1455 1455
 	return spip_mysql_query(
@@ -1518,10 +1518,10 @@  discard block
 block discarded – undo
1518 1518
  *     - false en cas d'erreur.
1519 1519
  **/
1520 1520
 function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) {
1521
-	return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join(
1521
+	return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join(
1522 1522
 		',',
1523 1523
 		array_map('_q', $couples)
1524
-	) . ')', $serveur, $requeter);
1524
+	).')', $serveur, $requeter);
1525 1525
 }
1526 1526
 
1527 1527
 
@@ -1550,10 +1550,10 @@  discard block
 block discarded – undo
1550 1550
  *     - false en cas d'erreur.
1551 1551
  **/
1552 1552
 function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) {
1553
-	$cles = '(' . join(',', array_keys($tab_couples[0])) . ')';
1553
+	$cles = '('.join(',', array_keys($tab_couples[0])).')';
1554 1554
 	$valeurs = [];
1555 1555
 	foreach ($tab_couples as $couples) {
1556
-		$valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')';
1556
+		$valeurs[] = '('.join(',', array_map('_q', $couples)).')';
1557 1557
 	}
1558 1558
 	$valeurs = implode(', ', $valeurs);
1559 1559
 
@@ -1573,28 +1573,28 @@  discard block
 block discarded – undo
1573 1573
  */
1574 1574
 function spip_mysql_multi($objet, $lang) {
1575 1575
 	$lengthlang = strlen("[$lang]");
1576
-	$posmulti = 'INSTR(' . $objet . ", '<multi>')";
1577
-	$posfinmulti = 'INSTR(' . $objet . ", '</multi>')";
1578
-	$debutchaine = 'LEFT(' . $objet . ", $posmulti-1)";
1579
-	$finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))";
1580
-	$chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1581
-	$poslang = "INSTR($chainemulti,'[" . $lang . "]')";
1576
+	$posmulti = 'INSTR('.$objet.", '<multi>')";
1577
+	$posfinmulti = 'INSTR('.$objet.", '</multi>')";
1578
+	$debutchaine = 'LEFT('.$objet.", $posmulti-1)";
1579
+	$finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))";
1580
+	$chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))";
1581
+	$poslang = "INSTR($chainemulti,'[".$lang."]')";
1582 1582
 	$poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)";
1583
-	$chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1584
-	$posfinlang = 'INSTR(' . $chainelang . ", '[')";
1583
+	$chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))";
1584
+	$posfinlang = 'INSTR('.$chainelang.", '[')";
1585 1585
 	$chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)";
1586 1586
 	//$chainelang = "LEFT($chainelang,$posfinlang-1)";
1587
-	$retour = "(TRIM(IF($posmulti = 0 , " .
1588
-		'     TRIM(' . $objet . '), ' .
1589
-		'     CONCAT( ' .
1590
-		"          $debutchaine, " .
1591
-		'          IF( ' .
1592
-		"               $poslang = 0, " .
1593
-		"                     $chainemulti, " .
1594
-		"               $chainelang" .
1595
-		'          ), ' .
1596
-		"          $finchaine" .
1597
-		'     ) ' .
1587
+	$retour = "(TRIM(IF($posmulti = 0 , ".
1588
+		'     TRIM('.$objet.'), '.
1589
+		'     CONCAT( '.
1590
+		"          $debutchaine, ".
1591
+		'          IF( '.
1592
+		"               $poslang = 0, ".
1593
+		"                     $chainemulti, ".
1594
+		"               $chainelang".
1595
+		'          ), '.
1596
+		"          $finchaine".
1597
+		'     ) '.
1598 1598
 		'))) AS multi';
1599 1599
 
1600 1600
 	return $retour;
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
  *     Valeur hexadécimale pour MySQL
1612 1612
  **/
1613 1613
 function spip_mysql_hex($v) {
1614
-	return '0x' . $v;
1614
+	return '0x'.$v;
1615 1615
 }
1616 1616
 
1617 1617
 /**
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
  *     Expression SQL
1652 1652
  **/
1653 1653
 function spip_mysql_date_proche($champ, $interval, $unite) {
1654
-	$use_now = ( ($champ === 'maj' || strpos($champ, '.maj')) ? true : false );
1654
+	$use_now = (($champ === 'maj' || strpos($champ, '.maj')) ? true : false);
1655 1655
 	return '('
1656 1656
 	. $champ
1657 1657
 	. (($interval <= 0) ? '>' : '<')
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
 		} elseif ($v === null) {
1707 1707
 			return "''";
1708 1708
 		}
1709
-		return "'" . addslashes($v) . "'";
1709
+		return "'".addslashes($v)."'";
1710 1710
 	}
1711 1711
 
1712 1712
 	if ($v === null) {
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 		}
1731 1731
 	}
1732 1732
 
1733
-	return ("'" . addslashes($v) . "'");
1733
+	return ("'".addslashes($v)."'");
1734 1734
 }
1735 1735
 
1736 1736
 /**
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
 	} else {
1765 1765
 		$GLOBALS['mysql_rappel_nom_base'] = false;
1766 1766
 
1767
-		return "\$GLOBALS['mysql_rappel_nom_base'] = false; " .
1767
+		return "\$GLOBALS['mysql_rappel_nom_base'] = false; ".
1768 1768
 		"/* echec de test_rappel_nom_base_mysql a l'installation. */\n";
1769 1769
 	}
1770 1770
 }
Please login to merge, or discard this patch.
ecrire/src/Chiffrer/SpipCles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 final class SpipCles {
16 16
 	private static array $instances = [];
17 17
 
18
-	private string $file = _DIR_ETC . 'cles.php';
18
+	private string $file = _DIR_ETC.'cles.php';
19 19
 	private readonly Cles $cles;
20 20
 
21 21
 	public static function instance(string $file = ''): self {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			!empty($cles_potentielles['secret_des_auth'])
115 115
 			&& !Password::verifier($password_clair, $password_hash, $cles_potentielles['secret_des_auth'])
116 116
 		) {
117
-			spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer' . _LOG_INFO_IMPORTANTE);
117
+			spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer'._LOG_INFO_IMPORTANTE);
118 118
 			unset($cles_potentielles['secret_des_auth']);
119 119
 		}
120 120
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		foreach ($cles_potentielles as $name => $key) {
124 124
 			if (!$this->cles->has($name)) {
125 125
 				$this->cles->set($name, $key);
126
-				spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer' . _LOG_INFO_IMPORTANTE);
126
+				spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer'._LOG_INFO_IMPORTANTE);
127 127
 				$restauration = true;
128 128
 			}
129 129
 		}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				return $this->cles->get($name);
142 142
 			}
143 143
 			// sinon loger et annule la cle generee car il ne faut pas l'utiliser
144
-			spip_log('Echec ecriture du fichier cle ' . $this->file . " ; impossible de generer une cle $name", 'chiffrer' . _LOG_ERREUR);
144
+			spip_log('Echec ecriture du fichier cle '.$this->file." ; impossible de generer une cle $name", 'chiffrer'._LOG_ERREUR);
145 145
 			$this->cles->delete($name);
146 146
 		}
147 147
 		return null;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	private function getMetaKey(string $name, bool $autoInit = true): ?string {
151 151
 		if (!isset($GLOBALS['meta'][$name])) {
152 152
 			include_spip('base/abstract_sql');
153
-			$GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = ' . sql_quote($name, '', 'string'));
153
+			$GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = '.sql_quote($name, '', 'string'));
154 154
 		}
155 155
 		$key = base64_decode($GLOBALS['meta'][$name] ?? '');
156 156
 		if (strlen($key) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
Please login to merge, or discard this patch.
ecrire/src/ErrorHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
 		array_shift($backtrace);
28 28
 		do {
29 29
 			$t = array_shift($backtrace);
30
-			$fqdn = ($t['class'] ?? '') . ($t['type'] ?? '') . ($t['function'] ?? '');
30
+			$fqdn = ($t['class'] ?? '').($t['type'] ?? '').($t['function'] ?? '');
31 31
 		} while (in_array($fqdn, ['trigger_error', 'trigger_deprecation']));
32 32
 
33 33
 		$errfile = $t['file'];
34 34
 		$errline = $t['line'];
35 35
 
36
-		spip_log(sprintf('%s in %s on line %s', $errstr, $errfile, $errline), 'deprecated.' . _LOG_INFO);
36
+		spip_log(sprintf('%s in %s on line %s', $errstr, $errfile, $errline), 'deprecated.'._LOG_INFO);
37 37
 		return false;
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.