Completed
Push — master ( 44448f...9c847e )
by cam
01:17
created
ecrire/inc/chercher_rubrique.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	{
147 147
 		$r = "<option$selected value='$root' class='$class' style='$style'>$espace"
148 148
 			. $data[$root]
149
-			. '</option>' . "\n";
149
+			. '</option>'."\n";
150 150
 	} else {
151 151
 		$r = '';
152 152
 	}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	}
167 167
 
168 168
 	// et voila le travail
169
-	return $r . $sous;
169
+	return $r.$sous;
170 170
 }
171 171
 
172 172
 /**
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 	while ($r = sql_fetch($q)) {
209 209
 		if (autoriser('voir', 'rubrique', $r['id_rubrique'])) {
210 210
 			// titre largeur maxi a 50
211
-			$titre = couper(supprimer_tags(typo($r['titre'])) . " ", 50);
211
+			$titre = couper(supprimer_tags(typo($r['titre']))." ", 50);
212 212
 			if ($GLOBALS['meta']['multi_rubriques'] == 'oui'
213 213
 				and ($r['langue_choisie'] == "oui" or $r['id_parent'] == 0)
214 214
 			) {
215
-				$titre .= ' [' . traduire_nom_langue($r['lang']) . ']';
215
+				$titre .= ' ['.traduire_nom_langue($r['lang']).']';
216 216
 			}
217 217
 			$data[$r['id_rubrique']] = $titre;
218 218
 			$enfants[$r['id_parent']][] = $r['id_rubrique'];
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 	$att = " id='id_parent' name='id_parent'\nclass='selecteur_parent verdana1'";
239 239
 
240 240
 	if (preg_match(',^<option[^<>]*value=.(\d*).[^<>]*>([^<]*)</option>$,', $opt, $r)) {
241
-		$r = "<input$att type='hidden' value='" . $r[1] . "' />" . $r[2];
241
+		$r = "<input$att type='hidden' value='".$r[1]."' />".$r[2];
242 242
 	} else {
243
-		$r = "<select" . $att . " size='1'>\n$opt</select>\n";
243
+		$r = "<select".$att." size='1'>\n$opt</select>\n";
244 244
 	}
245 245
 
246 246
 	# message pour neuneus (a supprimer ?)
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 function selecteur_rubrique_ajax($id_rubrique, $type, $restreint, $idem = 0, $do = 'aff') {
283 283
 
284 284
 	if ($id_rubrique) {
285
-		$titre = sql_getfetsel("titre", "spip_rubriques", "id_rubrique=" . intval($id_rubrique));
285
+		$titre = sql_getfetsel("titre", "spip_rubriques", "id_rubrique=".intval($id_rubrique));
286 286
 	} else {
287 287
 		if ($type == 'auteur') {
288 288
 			$titre = '&nbsp;';
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 	}
293 293
 
294 294
 	$titre = str_replace('&amp;', '&', entites_html(textebrut(typo($titre))));
295
-	$init = " disabled='disabled' type='text' value=\"" . $titre . "\"\nstyle='width:300px;'";
295
+	$init = " disabled='disabled' type='text' value=\"".$titre."\"\nstyle='width:300px;'";
296 296
 
297 297
 	$url = generer_url_ecrire('selectionner', "id=$id_rubrique&type=$type&do=$do"
298 298
 		. (!$idem ? '' : "&exclus=$idem")
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 		. " jQuery(this).toggleClass('toggled'); "
342 342
 		. "return charger_node_url_si_vide('"
343 343
 		. $url
344
-		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='" . attribut_html(_T('titre_image_selecteur')) . "'>"
344
+		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='".attribut_html(_T('titre_image_selecteur'))."'>"
345 345
 		. $img_icone
346 346
 		. "</a><img src='"
347 347
 		. chemin_image('loader.svg')
Please login to merge, or discard this patch.
ecrire/inc/filtres_boites.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
 		$titre = "<h3>$titre</h3>";
136 136
 	}
137 137
 
138
-	return '<div class="' . $class . ($id ? "\" id=\"$id" : '') . '">'
138
+	return '<div class="'.$class.($id ? "\" id=\"$id" : '').'">'
139 139
 	. ($titre ? "<div class=\"$head_class\">$titre<!--/hd--></div>" : '')
140 140
 	. '<div class="box__body clearfix">';
141 141
 }
Please login to merge, or discard this patch.
prive/themes/spip/vars.css_fonctions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	// Typographie
41 41
 	$vars->add('--spip-font-size', $Pile[0]['font-size']);
42
-	$vars->add('--spip-line-height',  $Pile[0]['line-height']);
42
+	$vars->add('--spip-line-height', $Pile[0]['line-height']);
43 43
 	$vars->add('--spip-text-indent', $Pile[0]['text-indent']);
44 44
 	$vars->add('--spip-font-family', $Pile[0]['font-family']);
45 45
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	// Espacements pour le rythme vertical et les gouttières
51 51
 	// Basés sur la hauteur d'une ligne de texte à la racine du document
52
-	$vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
53
-	$vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4) . 'rem');
52
+	$vars->add('--spip-spacing-y', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4).'rem');
53
+	$vars->add('--spip-spacing-x', round(strmult($Pile[0]['font-size'], $Pile[0]['line-height']), 4).'rem');
54 54
 	$vars->add('--spip-margin-bottom', $Pile[0]['margin-bottom']); // À déprécier
55 55
 
56 56
 	// Bordures
@@ -60,20 +60,20 @@  discard block
 block discarded – undo
60 60
 
61 61
 	// Ombres portées
62 62
 	$shadow_mini =
63
-		'0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),' .
64
-		'0 0.1em  0.15em hsla(0, 0%, 0%, 0.05),' .
63
+		'0 0.05em 0.1em hsla(0, 0%, 0%, 0.33),'.
64
+		'0 0.1em  0.15em hsla(0, 0%, 0%, 0.05),'.
65 65
 		'0 0.1em  0.25em  hsla(0, 0%, 0%, 0.05)';
66 66
 	$shadow =
67
-		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),' .
68
-		'0 0.1em  0.25em hsla(0, 0%, 0%, 0.05),' .
67
+		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.33),'.
68
+		'0 0.1em  0.25em hsla(0, 0%, 0%, 0.05),'.
69 69
 		'0 0.1em  0.5em  hsla(0, 0%, 0%, 0.05)';
70 70
 	$shadow_large =
71
-		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),' .
72
-		'0 0.2em  0.5em  hsla(0, 0%, 0%, 0.1),' .
71
+		'0 0.05em 0.15em hsla(0, 0%, 0%, 0.1),'.
72
+		'0 0.2em  0.5em  hsla(0, 0%, 0%, 0.1),'.
73 73
 		'0 0.2em  1em    hsla(0, 0%, 0%, 0.075)';
74 74
 	$shadow_huge =
75
-		'0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),' .
76
-		'0 0.25em  1em  hsla(0, 0%, 0%, 0.1),' .
75
+		'0 0.1em 0.25em hsla(0, 0%, 0%, 0.1),'.
76
+		'0 0.25em  1em  hsla(0, 0%, 0%, 0.1),'.
77 77
 		'0 0.5em  2em    hsla(0, 0%, 0%, 0.075)';
78 78
 	$vars->add('--spip-box-shadow-mini', $shadow_mini);
79 79
 	$vars->add('--spip-box-shadow-mini-hover', $shadow);
Please login to merge, or discard this patch.
ecrire/action/menu_rubriques.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 	// on renvoi un 401 qui fait echouer la requete ajax silencieusement
40 40
 	if (!autoriser('ecrire')) {
41 41
 		$retour =
42
-		'<ul class="deroulant__sous-menu" data-profondeur="1">' .
43
-			'<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' .
44
-				'<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' .
45
-					'<span class="libelle">' . _T('public:lien_connecter') . '</span>' .
46
-				'</a>' .
47
-			'</li>' .
42
+		'<ul class="deroulant__sous-menu" data-profondeur="1">'.
43
+			'<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'.
44
+				'<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'.
45
+					'<span class="libelle">'._T('public:lien_connecter').'</span>'.
46
+				'</a>'.
47
+			'</li>'.
48 48
 		'</ul>';
49 49
 		include_spip('inc/actions');
50 50
 		ajax_retour($retour);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	if ($date = intval(_request('date'))) {
55
-		header("Last-Modified: " . gmdate("D, d M Y H:i:s", $date) . " GMT");
55
+		header("Last-Modified: ".gmdate("D, d M Y H:i:s", $date)." GMT");
56 56
 	}
57 57
 
58 58
 	$r = gen_liste_rubriques();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/')
62 62
 	) {
63 63
 		include_spip('inc/headers');
64
-		header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']);
64
+		header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']);
65 65
 		http_status(304);
66 66
 		exit;
67 67
 	} else {
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
  **/
84 84
 function menu_rubriques($complet = true) {
85 85
 	$ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">'
86
-		. '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">'
87
-		. '<span class="libelle">' . _T('info_tout_site') . '</span>'
86
+		. '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">'
87
+		. '<span class="libelle">'._T('info_tout_site').'</span>'
88 88
 		. '</a>'
89 89
 		. '</li>';
90 90
 
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 	static $zmax = 6;
144 144
 	$profondeur_next = $profondeur + 1;
145 145
 
146
-	$nav = '<a class="deroulant__lien" href="' . generer_url_entite($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">"
147
-		. '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>'
146
+	$nav = '<a class="deroulant__lien" href="'.generer_url_entite($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">"
147
+		. '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>'
148 148
 		. "</a>\n";
149 149
 
150 150
 	// Limiter volontairement le nombre de sous-menus
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Spacing   +29 added lines, -29 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'])) {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 		}
957 957
 		$ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso)
958 958
 		$connexion = $GLOBALS['connexions'][$serveur ? $serveur : 0];
959
-		$spip = $connexion['prefixe'] . '_';
959
+		$spip = $connexion['prefixe'].'_';
960 960
 		foreach ($ts as $t) {
961 961
 			$t = substr($t, strlen($spip));
962 962
 			$tables[$serveur]["spip_$t"] = $t;
@@ -977,14 +977,14 @@  discard block
 block discarded – undo
977 977
  * @return array
978 978
  *     Couples (nom de la table SQL => même nom)
979 979
  **/
980
-function lister_toutes_tables($serveur){
980
+function lister_toutes_tables($serveur) {
981 981
 	static $tables = array();
982
-	if (!isset($tables[$serveur])){
982
+	if (!isset($tables[$serveur])) {
983 983
 		$tables[$serveur] = array();
984 984
 		if (!function_exists("sql_alltable"))
985 985
 			include_spip("base/abstract_sql");
986
-		$ts = sql_alltable('%',$serveur); // toutes les tables
987
-		foreach ($ts as $t){
986
+		$ts = sql_alltable('%', $serveur); // toutes les tables
987
+		foreach ($ts as $t) {
988 988
 			$tables[$serveur][$t] = $t;
989 989
 		}
990 990
 	}
@@ -1020,9 +1020,9 @@  discard block
 block discarded – undo
1020 1020
 	if ($serveur !== false) {
1021 1021
 		$t = lister_tables_spip($serveur);
1022 1022
 		$trouver_table = charger_fonction('trouver_table', 'base');
1023
-		$typetrim = rtrim($type, 's') . 's';
1023
+		$typetrim = rtrim($type, 's').'s';
1024 1024
 		if ((isset($t[$typetrim]) or in_array($typetrim, $t))
1025
-			and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur))
1025
+			and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur))
1026 1026
 		) {
1027 1027
 			return $desc['id_table'];
1028 1028
 		} elseif ((isset($t[$type]) or in_array($type, $t))
@@ -1031,11 +1031,11 @@  discard block
 block discarded – undo
1031 1031
 			return $desc['id_table'];
1032 1032
 		}
1033 1033
 
1034
-		spip_log('table_objet(' . $type . ') calculee sans verification');
1034
+		spip_log('table_objet('.$type.') calculee sans verification');
1035 1035
 		#spip_log(debug_backtrace(),'db');
1036 1036
 	}
1037 1037
 
1038
-	return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false
1038
+	return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false
1039 1039
 }
1040 1040
 
1041 1041
 /**
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 	if (
1113 1113
 		in_array($t, $ts)
1114 1114
 		or in_array($t, lister_toutes_tables($serveur))
1115
-	){
1115
+	) {
1116 1116
 		$desc = $trouver_table($t, $serveur);
1117 1117
 		if (isset($desc['key']['PRIMARY KEY'])) {
1118 1118
 			return $desc['key']['PRIMARY KEY'];
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 function objet_test_si_publie($objet, $id_objet, $serveur = '') {
1216 1216
 	// voir si une fonction est definie pour faire le boulot
1217 1217
 	// elle a la priorite dans ce cas
1218
-	if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) {
1218
+	if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) {
1219 1219
 		return $f($objet, $id_objet, $serveur);
1220 1220
 	}
1221 1221
 
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
 		$boucle->sql_serveur = $serveur;
1236 1236
 		$boucle->select[] = $id_table_objet;
1237 1237
 		$boucle->from[$table_objet] = table_objet_sql($objet, $serveur);
1238
-		$boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet);
1238
+		$boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet);
1239 1239
 
1240 1240
 		$boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php
1241 1241
 		$boucle->descr['sourcefile'] = 'internal';
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 						? "{$parent_methode['source_champ']} = $id_objet"
1364 1364
 						: "${cle_objet} = $id_objet";
1365 1365
 					if (isset($parent_methode['source_champ_type'])) {
1366
-						$where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet);
1366
+						$where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet);
1367 1367
 					}
1368 1368
 					// -- Condition supplémentaire sur la détection du parent
1369 1369
 					if (isset($parent_methode['table_condition'])) {
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 			if (
1378 1378
 				!$condition_objet_invalide
1379 1379
 				and $where
1380
-				and ($lignes = sql_allfetsel( $is_table_lien ? '*' : $select, $table, $where))
1380
+				and ($lignes = sql_allfetsel($is_table_lien ? '*' : $select, $table, $where))
1381 1381
 			) {
1382 1382
 				foreach ($lignes as $ligne) {
1383 1383
 					// Si le type est fixe
@@ -1487,11 +1487,11 @@  discard block
 block discarded – undo
1487 1487
 			$where = array();
1488 1488
 			// -- L'identifiant du parent
1489 1489
 			if (isset($_methode_parent['champ'])) {
1490
-				$where[] = $_methode_parent['champ'] . ' = ' . $id_objet;
1490
+				$where[] = $_methode_parent['champ'].' = '.$id_objet;
1491 1491
 			}
1492 1492
 			// -- Si le parent est variable
1493 1493
 			if (isset($_methode_parent['champ_type'])) {
1494
-				$where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet);
1494
+				$where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet);
1495 1495
 			}
1496 1496
 
1497 1497
 			// 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/inc_version.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
50 50
 
51 51
 /** chemin absolu vers la racine */
52
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
52
+define('_ROOT_RACINE', dirname(__DIR__).'/');
53 53
 /** chemin absolu vers le repertoire de travail */
54
-define('_ROOT_CWD', getcwd() . '/');
54
+define('_ROOT_CWD', getcwd().'/');
55 55
 /** chemin absolu vers ecrire */
56
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
56
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
57 57
 
58 58
 // Icones
59 59
 if (!defined('_NOM_IMG_PACK')) {
@@ -61,17 +61,17 @@  discard block
 block discarded – undo
61 61
 	define('_NOM_IMG_PACK', 'images/');
62 62
 }
63 63
 /** le chemin http (relatif) vers les images standard */
64
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
64
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
65 65
 
66 66
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
67
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
67
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
68 68
 
69 69
 if (!defined('_JAVASCRIPT')) {
70 70
 	/** Nom du repertoire des  bibliotheques JavaScript */
71 71
 	define('_JAVASCRIPT', 'javascript/');
72 72
 } // utilisable avec #CHEMIN et find_in_path
73 73
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
74
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
74
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
75 75
 
76 76
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
77 77
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // Son emplacement absolu si on le trouve
104
-if (@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
105
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
104
+if (@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
105
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
106 106
 ) {
107 107
 	/** Emplacement absolu du fichier d'option */
108 108
 	define('_FILE_OPTIONS', $f);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 // Inclure l'ecran de securite
127 127
 if (!defined('_ECRAN_SECURITE')
128
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
128
+	and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
129 129
 ) {
130 130
 	include $f;
131 131
 }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			. 'MSIE 6\.0|'
145 145
 			// UA plus cibles
146 146
 			. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
147
-			. ',i', (string)$_SERVER['HTTP_USER_AGENT'])
147
+			. ',i', (string) $_SERVER['HTTP_USER_AGENT'])
148 148
 	);
149 149
 }
150 150
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 //
275 275
 // Prendre en compte les entetes HTTP_X_FORWARDED_XX
276 276
 //
277
-if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
277
+if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
278 278
 	if (empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
279 279
 		$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_HOST'];
280 280
 	}
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
 		$_SERVER['HTTP_X_FORWARDED_PORT'] = 443;
283 283
 	}
284 284
 }
285
-if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])){
286
-	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])){
285
+if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
286
+	if (isset($_SERVER['HTTP_X_FORWARDED_PORT']) and is_numeric($_SERVER['HTTP_X_FORWARDED_PORT'])) {
287 287
 		$_SERVER['SERVER_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT'];
288
-		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'){
288
+		if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
289 289
 			$_SERVER['HTTPS'] = 'on';
290 290
 			if (isset($_SERVER['REQUEST_SCHEME'])) {
291 291
 				$_SERVER['REQUEST_SCHEME'] = 'https';
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 		}
294 294
 	}
295 295
 	$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
296
-	if (strpos($host,',')!==false){
297
-		$h = explode(',',$host);
296
+	if (strpos($host, ',') !== false) {
297
+		$h = explode(',', $host);
298 298
 		$host = trim(reset($h));
299 299
 	}
300 300
 	// securite sur le contenu de l'entete
@@ -306,12 +306,12 @@  discard block
 block discarded – undo
306 306
 //
307 307
 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
308 308
 	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
309
-	if (strpos($ip,',')!==false){
310
-		$ip = explode(',',$ip);
309
+	if (strpos($ip, ',') !== false) {
310
+		$ip = explode(',', $ip);
311 311
 		$ip = reset($ip);
312 312
 	}
313 313
 	// ecraser $_SERVER['REMOTE_ADDR'] si elle est en localhost
314
-	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR']==='127.0.0.1'){
314
+	if (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] === '127.0.0.1') {
315 315
 		$_SERVER['REMOTE_ADDR'] = $ip;
316 316
 	}
317 317
 }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 # la matrice standard (fichiers definissant les fonctions a inclure)
385 385
 $spip_matrice = array();
386 386
 # les plugins a activer
387
-$plugins = array();  // voir le contenu du repertoire /plugins/
387
+$plugins = array(); // voir le contenu du repertoire /plugins/
388 388
 # les surcharges de include_spip()
389 389
 $surcharges = array(); // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
390 390
 
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
 //
463 463
 // Charger les fonctions liees aux serveurs Http et Sql.
464 464
 //
465
-require_once _ROOT_RESTREINT . 'inc/utils.php';
466
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
465
+require_once _ROOT_RESTREINT.'inc/utils.php';
466
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
467 467
 
468 468
 // Definition personnelles eventuelles
469 469
 
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 // ===> on execute en neutralisant les messages d'erreur
487 487
 
488 488
 spip_initialisation_core(
489
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
490
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
491
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
492
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
489
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
490
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
491
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
492
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
493 493
 );
494 494
 
495 495
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 		// Si on est dans le site public, dire que qq s'en occupe
545 545
 		include_spip('inc/minipres');
546 546
 		utiliser_langue_visiteur();
547
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . "</p>", array('status' => 503));
547
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte')."</p>", array('status' => 503));
548 548
 		exit;
549 549
 	}
550 550
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 	if (!function_exists('session_set')) {
559 559
 		include_spip('inc/session');
560 560
 	}
561
-	$t = preg_replace(",\W,","_", $t);
561
+	$t = preg_replace(",\W,", "_", $t);
562 562
 	if ($v = _request($t)) {
563 563
 		session_set($t, $v);
564 564
 	}
@@ -582,12 +582,12 @@  discard block
 block discarded – undo
582 582
 	}
583 583
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
584 584
 		include_spip('inc/filtres_mini');
585
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . "config.txt"));
585
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR."config.txt"));
586 586
 	} else {
587 587
 		// header minimal
588
-		header(_HEADER_COMPOSED_BY . " @ www.spip.net");
588
+		header(_HEADER_COMPOSED_BY." @ www.spip.net");
589 589
 	}
590 590
 }
591 591
 
592 592
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
593
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
593
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 /** l'adresse du repertoire de telechargement et de decompactage des plugins */
24 24
 if (!defined('_DIR_PLUGINS_AUTO')) {
25
-	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/');
25
+	define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/');
26 26
 }
27 27
 
28 28
 #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins.
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 				if ($dir) {
371 371
 					$dir .= "/";
372 372
 				}
373
-				$dir .= "procure:" . $procure['nom'];
373
+				$dir .= "procure:".$procure['nom'];
374 374
 
375 375
 				$procure['etat'] = '?';
376 376
 				$procure['dir_type'] = $resume['dir_type'];
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		$plug = $resume['dir'];
552 552
 		$k = $infos[$dir_type][$plug];
553 553
 
554
-		$plug = constant($dir_type) . $plug;
554
+		$plug = constant($dir_type).$plug;
555 555
 		if (!isset($msg[$p])) {
556 556
 			if (isset($resume['erreur']) and $resume['erreur']) {
557 557
 				$msg[$p] = array($resume['erreur']);
@@ -594,10 +594,10 @@  discard block
 block discarded – undo
594 594
 		$list = $raw ? array() : $GLOBALS['meta']['plugin_erreur_activation'];
595 595
 	} elseif (!$raw) {
596 596
 		foreach ($list as $plug => $msg) {
597
-			$list[$plug] = "<li>" . _T('plugin_impossible_activer', array('plugin' => $plug))
598
-				. "<ul><li>" . implode("</li><li>", $msg) . "</li></ul></li>";
597
+			$list[$plug] = "<li>"._T('plugin_impossible_activer', array('plugin' => $plug))
598
+				. "<ul><li>".implode("</li><li>", $msg)."</li></ul></li>";
599 599
 		}
600
-		$list = "<ul>" . join("\n", $list) . "</ul>";
600
+		$list = "<ul>".join("\n", $list)."</ul>";
601 601
 	}
602 602
 	if ($raz) {
603 603
 		effacer_meta('plugin_erreur_activation');
@@ -711,13 +711,13 @@  discard block
 block discarded – undo
711 711
 			if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) {
712 712
 				return _T("plugin_${balise}_${type}", array(
713 713
 					'plugin' => $nom,
714
-					'version' => ' &ge; ' . $minimum
714
+					'version' => ' &ge; '.$minimum
715 715
 				));
716 716
 			}
717 717
 			if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) {
718 718
 				return _T("plugin_${balise}_${type}", array(
719 719
 					'plugin' => $nom,
720
-					'version' => ' &gt; ' . $minimum
720
+					'version' => ' &gt; '.$minimum
721 721
 				));
722 722
 			}
723 723
 		}
@@ -726,13 +726,13 @@  discard block
 block discarded – undo
726 726
 			if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) {
727 727
 				return _T("plugin_${balise}_${type}", array(
728 728
 					'plugin' => $nom,
729
-					'version' => ' &le; ' . $maximum
729
+					'version' => ' &le; '.$maximum
730 730
 				));
731 731
 			}
732 732
 			if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) {
733 733
 				return _T("plugin_${balise}_plugin", array(
734 734
 					'plugin' => $nom,
735
-					'version' => ' &lt; ' . $maximum
735
+					'version' => ' &lt; '.$maximum
736 736
 				));
737 737
 			}
738 738
 		}
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 		include_spip('inc/charger_plugin');
752 752
 		$url = '<br />'	. bouton_telechargement_plugin($url, 'lib');
753 753
 	}*/
754
-	return _T('plugin_necessite_lib', array('lib' => $lib)) . " <a href='$url'>$url</a>";
754
+	return _T('plugin_necessite_lib', array('lib' => $lib))." <a href='$url'>$url</a>";
755 755
 }
756 756
 
757 757
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 	foreach ($plugin_valides as $p => $resume) {
851 851
 		// Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP
852 852
 		if (0 !== strpos($p, 'PHP:') and $p !== 'PHP') {
853
-			$header[] = $p . ($resume['version'] ? "(" . $resume['version'] . ")" : "");
853
+			$header[] = $p.($resume['version'] ? "(".$resume['version'].")" : "");
854 854
 		}
855 855
 		if ($resume['dir']) {
856 856
 			foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) {
@@ -874,10 +874,10 @@  discard block
 block discarded – undo
874 874
 	ecrire_meta('plugin_attente', serialize($liste));
875 875
 	$header = strtolower(implode(",", $header));
876 876
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
877
-		ecrire_fichier(_DIR_VAR . "config.txt",
878
-			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : "Composed-By: SPIP") . ' ' . $GLOBALS['spip_version_affichee'] . " @ www.spip.net + " . $header);
877
+		ecrire_fichier(_DIR_VAR."config.txt",
878
+			(defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : "Composed-By: SPIP").' '.$GLOBALS['spip_version_affichee']." @ www.spip.net + ".$header);
879 879
 	} else {
880
-		@unlink(_DIR_VAR . "config.txt");
880
+		@unlink(_DIR_VAR."config.txt");
881 881
 	}
882 882
 	// generer charger_plugins_chemin.php
883 883
 	plugins_precompile_chemin($plugin_valides, $ordre);
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 			// definir le plugin, donc le path avant l'include du fichier options
932 932
 			// permet de faire des include_spip pour attraper un inc_ du plugin
933 933
 
934
-			$dir = $dir_type . ".'" . $plug . "/'";
934
+			$dir = $dir_type.".'".$plug."/'";
935 935
 
936 936
 			$prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix']));
937 937
 			if (
@@ -942,11 +942,11 @@  discard block
 block discarded – undo
942 942
 				if (!$info['chemin']) {
943 943
 					$chemins['public'][] = "_DIR_PLUGIN_$prefix";
944 944
 					$chemins['prive'][] = "_DIR_PLUGIN_$prefix";
945
-					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
945
+					if (is_dir(constant($dir_type).$plug.'/squelettes/')) {
946 946
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
947 947
 					}
948 948
 				}
949
-				else{
949
+				else {
950 950
 					foreach ($info['chemin'] as $chemin) {
951 951
 						if (!isset($chemin['version']) or plugin_version_compatible($chemin['version'],
952 952
 								$GLOBALS['spip_version_branche'], 'spip')
@@ -959,13 +959,13 @@  discard block
 block discarded – undo
959 959
 								$dir = '';
960 960
 							}
961 961
 							if (strlen($dir)) {
962
-								$dir = rtrim($dir, '/') . '/';
962
+								$dir = rtrim($dir, '/').'/';
963 963
 							}
964 964
 							if (!isset($chemin['type']) or $chemin['type'] == 'public') {
965
-								$chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : "");
965
+								$chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : "");
966 966
 							}
967 967
 							if (!isset($chemin['type']) or $chemin['type'] == 'prive') {
968
-								$chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : "");
968
+								$chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : "");
969 969
 							}
970 970
 						}
971 971
 					}
@@ -974,9 +974,9 @@  discard block
 block discarded – undo
974 974
 		}
975 975
 	}
976 976
 	if (count($chemins['public']) or count($chemins['prive'])) {
977
-		$contenu .= "if (_DIR_RESTREINT) _chemin([" . implode(',',
978
-				array_reverse($chemins['public'])) . "]);\n"
979
-			. "else _chemin([" . implode(',', array_reverse($chemins['prive'])) . "]);\n";
977
+		$contenu .= "if (_DIR_RESTREINT) _chemin([".implode(',',
978
+				array_reverse($chemins['public']))."]);\n"
979
+			. "else _chemin([".implode(',', array_reverse($chemins['prive']))."]);\n";
980 980
 	}
981 981
 
982 982
 	ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu);
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 					and strpos($dir, ":") === false // exclure le cas des procure:
1025 1025
 					and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml
1026 1026
 				) {
1027
-					if (is_readable("$dir$plug/" . ($file = $info['prefix'] . "_" . $charge . ".php"))) {
1027
+					if (is_readable("$dir$plug/".($file = $info['prefix']."_".$charge.".php"))) {
1028 1028
 						$info[$charge] = array($file);
1029 1029
 					}
1030 1030
 				}
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 						) {
1041 1041
 							unset($info[$charge][$k]);
1042 1042
 						} else {
1043
-							$_file = $root_dir_type . ".'$plug/$file'";
1043
+							$_file = $root_dir_type.".'$plug/$file'";
1044 1044
 							$contenu[$charge] .= "include_once_check($_file);\n";
1045 1045
 						}
1046 1046
 					}
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 		}
1051 1051
 	}
1052 1052
 
1053
-	$contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options'];
1053
+	$contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options'];
1054 1054
 	$contenu['fonctions'] .= plugin_ongletbouton("boutons_plugins", $boutons)
1055 1055
 		. plugin_ongletbouton("onglets_plugins", $onglets);
1056 1056
 
@@ -1085,12 +1085,12 @@  discard block
 block discarded – undo
1085 1085
 		define("_UPDATED_$nom", $val);
1086 1086
 		define("_UPDATED_md5_$nom", $md5);
1087 1087
 	}
1088
-	$val = "unserialize('" . str_replace("'", "\'", $val) . "')";
1088
+	$val = "unserialize('".str_replace("'", "\'", $val)."')";
1089 1089
 
1090 1090
 	return
1091 1091
 		"if (!function_exists('$nom')) {\n"
1092 1092
 		. "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n"
1093
-		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n"
1093
+		. "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n"
1094 1094
 		. "}\n";
1095 1095
 }
1096 1096
 
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 	if (@is_readable(_CACHE_PLUGINS_OPT)) {
1114 1114
 		include_once(_CACHE_PLUGINS_OPT);
1115 1115
 	} else {
1116
-		spip_log("pipelines desactives: impossible de produire " . _CACHE_PLUGINS_OPT);
1116
+		spip_log("pipelines desactives: impossible de produire "._CACHE_PLUGINS_OPT);
1117 1117
 	}
1118 1118
 }
1119 1119
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 			$dir_type = $plugin_valides[$p]['dir_type'];
1151 1151
 			$root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type);
1152 1152
 			$plug = $plugin_valides[$p]['dir'];
1153
-			$prefix = (($info['prefix'] == "spip") ? "" : $info['prefix'] . "_");
1153
+			$prefix = (($info['prefix'] == "spip") ? "" : $info['prefix']."_");
1154 1154
 			if (isset($info['pipeline']) and is_array($info['pipeline'])) {
1155 1155
 				foreach ($info['pipeline'] as $pipe) {
1156 1156
 					$nom = $pipe['nom'];
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 						}
1181 1181
 						if (isset($pipe['inclure'])) {
1182 1182
 							$GLOBALS['spip_matrice']["$prefix$action"] =
1183
-								"$root_dir_type:$plug/" . $pipe['inclure'];
1183
+								"$root_dir_type:$plug/".$pipe['inclure'];
1184 1184
 						}
1185 1185
 					}
1186 1186
 				}
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 					$prepend_code['taches_generales_cron'] = "";
1191 1191
 				}
1192 1192
 				foreach ($info['genie'] as $genie) {
1193
-					$nom = $prefix . $genie['nom'];
1193
+					$nom = $prefix.$genie['nom'];
1194 1194
 					$periode = max(60, intval($genie['periode']));
1195 1195
 					if (charger_fonction($nom, "genie", true)) {
1196 1196
 						$prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n";
@@ -1208,13 +1208,13 @@  discard block
 block discarded – undo
1208 1208
 				}
1209 1209
 				foreach ($info['style'] as $style) {
1210 1210
 					if (isset($style['path']) and $style['path']) {
1211
-						$code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) ";
1211
+						$code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) ";
1212 1212
 					} else {
1213
-						$code = "if (\$f='" . addslashes($style['url']) . "') ";
1213
+						$code = "if (\$f='".addslashes($style['url'])."') ";
1214 1214
 					}
1215 1215
 					$code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\"";
1216 1216
 					if (isset($style['media']) and strlen($style['media'])) {
1217
-						$code .= " media=\"" . addslashes($style['media']) . "\"";
1217
+						$code .= " media=\"".addslashes($style['media'])."\"";
1218 1218
 					}
1219 1219
 					$code .= "/>';\n";
1220 1220
 					if ($style['type'] != 'prive') {
@@ -1234,9 +1234,9 @@  discard block
 block discarded – undo
1234 1234
 			if (isset($info['script']) and count($info['script'])) {
1235 1235
 				foreach ($info['script'] as $script) {
1236 1236
 					if (isset($script['path']) and $script['path']) {
1237
-						$code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) ";
1237
+						$code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) ";
1238 1238
 					} else {
1239
-						$code = "if (\$f='" . addslashes($script['url']) . "') ";
1239
+						$code = "if (\$f='".addslashes($script['url'])."') ";
1240 1240
 					}
1241 1241
 					$code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n";
1242 1242
 					if ($script['type'] != 'prive') {
@@ -1299,10 +1299,10 @@  discard block
 block discarded – undo
1299 1299
 		unset($GLOBALS['spip_pipeline']['all']);
1300 1300
 		$all_pipes = trim(array_shift($a));
1301 1301
 		if ($all_pipes) {
1302
-			$all_pipes = '|' . ltrim($all_pipes, '|');
1302
+			$all_pipes = '|'.ltrim($all_pipes, '|');
1303 1303
 		}
1304 1304
 		if (count($a)) {
1305
-			$all_pipes_end = '||' . array_shift($a);
1305
+			$all_pipes_end = '||'.array_shift($a);
1306 1306
 		}
1307 1307
 	}
1308 1308
 	$content = "";
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 		// Eclater le pipeline en filtres et appliquer chaque filtre
1320 1320
 		foreach ($pipe as $fonc) {
1321 1321
 			$fonc = trim($fonc);
1322
-			$s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n";
1322
+			$s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n";
1323 1323
 			if (isset($GLOBALS['spip_matrice'][$fonc])) {
1324 1324
 				$file = $GLOBALS['spip_matrice'][$fonc];
1325 1325
 				$file = "'$file'";
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 					if (defined($root_dir)) {
1331 1331
 						$dir = $root_dir;
1332 1332
 					}
1333
-					$file = str_replace($regs[0], "'." . $dir . ".'", $file);
1333
+					$file = str_replace($regs[0], "'.".$dir.".'", $file);
1334 1334
 					$file = str_replace("''.", "", $file);
1335 1335
 					$file = str_replace(constant($dir), '', $file);
1336 1336
 				}
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 		$content .= "// Pipeline $action \n"
1344 1344
 			. "function execute_pipeline_$action(&\$val){\n"
1345 1345
 			. $s_inc
1346
-			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '')
1346
+			. ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '')
1347 1347
 			. $s_call
1348 1348
 			. "return \$val;\n}\n";
1349 1349
 	}
@@ -1427,18 +1427,18 @@  discard block
 block discarded – undo
1427 1427
 		$GLOBALS['fichier_php_compile_recent'] = 0;
1428 1428
 	}
1429 1429
 
1430
-	$contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>';
1430
+	$contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>';
1431 1431
 	// si un fichier existe deja on verifie que son contenu change avant de l'ecraser
1432 1432
 	// si pas de modif on ne touche pas au fichier initial
1433 1433
 	if (file_exists($nom)) {
1434 1434
 		if (substr($nom, -4) == '.php') {
1435
-			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1435
+			$fichier_tmp = substr($nom, 0, -4).'.tmp.php';
1436 1436
 		}
1437 1437
 		else {
1438
-			$fichier_tmp = $nom . '.tmp';
1438
+			$fichier_tmp = $nom.'.tmp';
1439 1439
 		}
1440 1440
 		file_put_contents($fichier_tmp, $contenu);
1441
-		if(md5_file($nom) == md5_file($fichier_tmp)) {
1441
+		if (md5_file($nom) == md5_file($fichier_tmp)) {
1442 1442
 			$GLOBALS['fichier_php_compile_recent'] = max($GLOBALS['fichier_php_compile_recent'], filemtime($nom));
1443 1443
 			@unlink($fichier_tmp);
1444 1444
 			return;
Please login to merge, or discard this patch.
ecrire/base/abstract_sql.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	if ($compil_info) {
55 55
 		$contexte_compil = array(
56
-			$trace[0]['file'],// sourcefile
56
+			$trace[0]['file'], // sourcefile
57 57
 			'', //nom
58
-			(isset($trace[1]) ? $trace[1]['function'] . "(){\n" : '')
59
-			. $trace[0]['function'] . "();"
58
+			(isset($trace[1]) ? $trace[1]['function']."(){\n" : '')
59
+			. $trace[0]['function']."();"
60 60
 			. (isset($trace[1]) ? "\n}" : ''), //id_boucle
61 61
 			$trace[0]['line'], // ligne
62 62
 			$GLOBALS['spip_lang'], // lang
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		return $contexte_compil;
66 66
 	}
67 67
 
68
-	$message = count($trace) ? $trace[0]['file'] . " L" . $trace[0]['line'] : "";
68
+	$message = count($trace) ? $trace[0]['file']." L".$trace[0]['line'] : "";
69 69
 	$f = array();
70 70
 	while (count($trace) and $t = array_shift($trace)) {
71 71
 		if (in_array($t['function'], array('include_once', 'include_spip', 'find_in_path'))) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$f[] = $t['function'];
75 75
 	}
76 76
 	if (count($f)) {
77
-		$message .= " [" . implode("(),", $f) . "()]";
77
+		$message .= " [".implode("(),", $f)."()]";
78 78
 	}
79 79
 
80 80
 	return $message;
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 		}
256 256
 		// le debug, c'est pour ce qui a ete produit par le compilateur
257 257
 		if (isset($GLOBALS['debug']['aucasou'])) {
258
-			list($table, $id, ) = $GLOBALS['debug']['aucasou'];
259
-			$nom = $GLOBALS['debug_objets']['courant'] . $id;
258
+			list($table, $id,) = $GLOBALS['debug']['aucasou'];
259
+			$nom = $GLOBALS['debug_objets']['courant'].$id;
260 260
 			$GLOBALS['debug_objets']['requete'][$nom] = $query;
261 261
 		}
262 262
 		$res = $f($select, $from, $where, $groupby, $orderby, $limit, $having, $serveur, true);
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 	// la globale n'est remplie qu'apres l'appel de sql_serveur.
1134 1134
 	if ($spip == null) {
1135 1135
 		$connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0];
1136
-		$spip = $connexion['prefixe'] . '\_%';
1136
+		$spip = $connexion['prefixe'].'\_%';
1137 1137
 	}
1138 1138
 
1139 1139
 	return $f($spip, $serveur, $option !== false);
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
 function sql_in($val, $valeurs, $not = '', $serveur = '', $option = true) {
2018 2018
 	if (!is_array($valeurs)) {
2019 2019
 		$valeurs = strval($valeurs);
2020
-		if(isset($valeurs[0]) and $valeurs[0] === ',') {
2020
+		if (isset($valeurs[0]) and $valeurs[0] === ',') {
2021 2021
 			$valeurs = substr($valeurs, 1);
2022 2022
 		}
2023 2023
 		// on explode en tableau pour pouvoir securiser le contenu
@@ -2028,7 +2028,7 @@  discard block
 block discarded – undo
2028 2028
 		return false;
2029 2029
 	}
2030 2030
 	// sql_quote produit une chaine dans tous les cas
2031
-	$valeurs = array_filter($valeurs, function ($v) { return !is_array($v);});
2031
+	$valeurs = array_filter($valeurs, function($v) { return !is_array($v); });
2032 2032
 	$valeurs = array_unique($valeurs);
2033 2033
 	$valeurs = $f($valeurs);
2034 2034
 
@@ -2223,9 +2223,9 @@  discard block
 block discarded – undo
2223 2223
 		$jour = 0;
2224 2224
 	}
2225 2225
 
2226
-	return sprintf("%04u", $annee) . '-' . sprintf("%02u", $mois) . '-'
2227
-	. sprintf("%02u", $jour) . ' ' . sprintf("%02u", $h) . ':'
2228
-	. sprintf("%02u", $m) . ':' . sprintf("%02u", $s);
2226
+	return sprintf("%04u", $annee).'-'.sprintf("%02u", $mois).'-'
2227
+	. sprintf("%02u", $jour).' '.sprintf("%02u", $h).':'
2228
+	. sprintf("%02u", $m).':'.sprintf("%02u", $s);
2229 2229
 }
2230 2230
 
2231 2231
 
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
  */
2288 2288
 function prefixer_table_spip($table, $prefixe) {
2289 2289
 	if ($prefixe) {
2290
-		$table = preg_replace('/^spip_/', $prefixe . '_', $table);
2290
+		$table = preg_replace('/^spip_/', $prefixe.'_', $table);
2291 2291
 	}
2292 2292
 	return $table;
2293 2293
 }
2294 2294
\ No newline at end of file
Please login to merge, or discard this patch.
ecrire/inc/filtres_mime.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	static $t1 = array('&', '<', '>');
121 121
 	static $t2 = array('&amp;', '&lt;', '&gt;');
122 122
 
123
-	return '<pre>' . str_replace($t1, $t2, $t) . '</pre>';
123
+	return '<pre>'.str_replace($t1, $t2, $t).'</pre>';
124 124
 }
125 125
 
126 126
 /**
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
 	foreach ($lignes as &$l) {
141 141
 		$l = join('|', $l);
142 142
 	}
143
-	$corps = join("\n", $lignes) . "\n";
144
-	$corps = $caption .
145
-		"\n|{{" .
146
-		join('}}|{{', $entete) .
147
-		'}}|' .
148
-		"\n|" .
143
+	$corps = join("\n", $lignes)."\n";
144
+	$corps = $caption.
145
+		"\n|{{".
146
+		join('}}|{{', $entete).
147
+		'}}|'.
148
+		"\n|".
149 149
 		str_replace("\n", "|\n|", $corps);
150 150
 	include_spip('inc/texte');
151 151
 
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
 		}
186 186
 	}
187 187
 	// Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ?
188
-	$t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t));
188
+	$t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t));
189 189
 
190
-	return (!$style ? '' : "\n<style>" . $style . '</style>') . $t;
190
+	return (!$style ? '' : "\n<style>".$style.'</style>').$t;
191 191
 }
192 192
 
193 193
 /**
Please login to merge, or discard this patch.