Completed
Pull Request — master (#39)
by
unknown
09:06
created
ecrire/install/etape_ldap5.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,29 +52,28 @@  discard block
 block discarded – undo
52 52
 	$conn = "\$GLOBALS['ldap_base'] = '$base_ldap';\n"
53 53
 		. "\$GLOBALS['ldap_link'] = @ldap_connect('$adresse_ldap','$port_ldap');\n"
54 54
 		. "@ldap_set_option(\$GLOBALS['ldap_link'],LDAP_OPT_PROTOCOL_VERSION,'$protocole_ldap');\n"
55
-		. (($tls_ldap != 'oui') ? '' :
56
-			"@ldap_start_tls(\$GLOBALS['ldap_link']);\n")
55
+		. (($tls_ldap != 'oui') ? '' : "@ldap_start_tls(\$GLOBALS['ldap_link']);\n")
57 56
 		. "@ldap_bind(\$GLOBALS['ldap_link'],'$login_ldap','$pass_ldap');\n";
58 57
 
59 58
 	$champs = is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : array();
60 59
 	$res = '';
61 60
 	foreach ($champs as $champ => $v) {
62
-		$nom = 'ldap_' . $champ;
61
+		$nom = 'ldap_'.$champ;
63 62
 		$val = trim(_request($nom));
64 63
 		if (preg_match('/^\w*$/', $val)) {
65 64
 			if ($val) {
66 65
 				$val = _q($val);
67 66
 			}
68 67
 		} else {
69
-			$val = 'array(' . _q(preg_split('/\W+/', $val)) . ')';
68
+			$val = 'array('._q(preg_split('/\W+/', $val)).')';
70 69
 		};
71 70
 		if ($val) {
72
-			$res .= "'$champ' => " . $val . ',';
71
+			$res .= "'$champ' => ".$val.',';
73 72
 		}
74 73
 	}
75 74
 	$conn .= "\$GLOBALS['ldap_champs'] = array($res);\n";
76 75
 
77
-	install_fichier_connexion(_DIR_CONNECT . _FILE_LDAP, $conn);
76
+	install_fichier_connexion(_DIR_CONNECT._FILE_LDAP, $conn);
78 77
 }
79 78
 
80 79
 function etape_ldap5_suite() {
@@ -87,7 +86,7 @@  discard block
 block discarded – undo
87 86
 	);
88 87
 
89 88
 	echo generer_form_ecrire('install', (
90
-		"<input type='hidden' name='etape' value='3' />" .
89
+		"<input type='hidden' name='etape' value='3' />".
91 90
 		"<input type='hidden' name='ldap_present' value='true' />"
92 91
 		. bouton_suivant()));
93 92
 
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
 		echo minipres('AUTO', $res);
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
ecrire/install/etape_ldap4.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	if ($fail) {
41 41
 		echo info_etape(_T('info_chemin_acces_annuaire')),
42 42
 		info_progression_etape(3, 'etape_ldap', 'install/', true),
43
-			"<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'),
44
-			' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>';
43
+			"<div class='error'><p><b>"._T('avis_operation_echec').'</b></p><p>'._T('avis_chemin_invalide_1'),
44
+			' (<tt>'.spip_htmlspecialchars($base_ldap).'</tt>) '._T('avis_chemin_invalide_2').'</p></div>';
45 45
 	} else {
46 46
 		info_etape(_T('info_reglage_ldap'));
47 47
 		echo info_progression_etape(4, 'etape_ldap', 'install/');
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 		$res = install_propager(array('adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap'))
56 56
 			. "<input type='hidden' name='etape' value='ldap5' />"
57
-			. "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />"
57
+			. "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />"
58 58
 			. fieldset(
59 59
 				_T('info_statut_utilisateurs_1'),
60 60
 				array(
61 61
 					'statut_ldap' => array(
62
-						'label' => _T('info_statut_utilisateurs_2') . '<br />',
62
+						'label' => _T('info_statut_utilisateurs_2').'<br />',
63 63
 						'valeur' => $statut_ldap,
64 64
 						'alternatives' => $statuts
65 65
 					)
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 // http://code.spip.net/@liste_statuts_ldap
78 78
 function liste_statuts_ldap() {
79 79
 	$recom = array(
80
-		'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'),
81
-		'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'),
82
-		'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />')
80
+		'info_administrateurs' => ('<b>'._T('info_administrateur_1').'</b> '._T('info_administrateur_2').'<br />'),
81
+		'info_redacteurs' => ('<b>'._T('info_redacteur_1').'</b> '._T('info_redacteur_2').'<br />'),
82
+		'info_visiteurs' => ('<b>'._T('info_visiteur_1').'</b> '._T('info_visiteur_2').'<br />')
83 83
 	);
84 84
 
85 85
 	$res = array();
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
 function install_ldap_correspondances() {
96 96
 	$champs = array();
97 97
 	foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : array() as $champ => $v) {
98
-		$nom = 'ldap_' . $champ;
98
+		$nom = 'ldap_'.$champ;
99 99
 		$val = is_array($v) ? join(',', $v) : strval($v);
100 100
 		$champs[$nom] = array(
101
-			'label' => _T('ldap_correspondance', array('champ' => "<tt>$champ</tt>")) . '<br />',
101
+			'label' => _T('ldap_correspondance', array('champ' => "<tt>$champ</tt>")).'<br />',
102 102
 			'valeur' => $val
103 103
 		);
104 104
 	}
105 105
 
106 106
 	return !$champs ?
107
-		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />');
107
+		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />');
108 108
 }
Please login to merge, or discard this patch.
ecrire/public.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	// Faut-il initialiser SPIP ? (oui dans le cas general)
33 33
 	if (!defined('_DIR_RESTREINT_ABS')) {
34 34
 		if (defined('_DIR_RESTREINT')
35
-			and @file_exists(_ROOT_RESTREINT . 'inc_version.php')
35
+			and @file_exists(_ROOT_RESTREINT.'inc_version.php')
36 36
 		) {
37
-			include_once _ROOT_RESTREINT . 'inc_version.php';
37
+			include_once _ROOT_RESTREINT.'inc_version.php';
38 38
 		} else {
39 39
 			die('inc_version absent ?');
40 40
 		}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		} // fond demande dans l'url par page=xxxx ?
46 46
 		else {
47 47
 			if (isset($_GET[_SPIP_PAGE])) {
48
-				$fond = (string)$_GET[_SPIP_PAGE];
48
+				$fond = (string) $_GET[_SPIP_PAGE];
49 49
 
50 50
 				// Securite
51 51
 				if (strstr($fond, '/')
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			// lancer les taches sur affichage final, comme le cron
108 108
 			// mais sans rien afficher
109 109
 			$GLOBALS['html'] = false; // ne rien afficher
110
-			pipeline('affichage_final' . _PIPELINE_SUFFIX, '');
110
+			pipeline('affichage_final'._PIPELINE_SUFFIX, '');
111 111
 			exit; // le hit est fini !
112 112
 		}
113 113
 	}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	// Content-Type ?
125 125
 	if (!isset($page['entetes']['Content-Type'])) {
126 126
 		$charset = isset($GLOBALS['meta']['charset']) ? $GLOBALS['meta']['charset'] : "utf-8";
127
-		$page['entetes']['Content-Type'] = 'text/html; charset=' . $charset;
127
+		$page['entetes']['Content-Type'] = 'text/html; charset='.$charset;
128 128
 		$html = true;
129 129
 	} else {
130 130
 		$html = preg_match(',^\s*text/html,', $page['entetes']['Content-Type']);
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 
151 151
 	// traitements sur les entetes avant envoi
152 152
 	// peut servir pour le plugin de stats
153
-	$page['entetes'] = pipeline('affichage_entetes_final' . _PIPELINE_SUFFIX, $page['entetes']);
153
+	$page['entetes'] = pipeline('affichage_entetes_final'._PIPELINE_SUFFIX, $page['entetes']);
154 154
 
155 155
 
156 156
 	// eval $page et affecte $res
157
-	include _ROOT_RESTREINT . "public/evaluer_page.php";
157
+	include _ROOT_RESTREINT."public/evaluer_page.php";
158 158
 	envoyer_entetes($page['entetes']);
159 159
 	if ($res === false) {
160 160
 		include_spip('inc/autoriser');
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	//
174 174
 	// (c'est ici qu'on fait var_recherche, validation, boutons d'admin,
175 175
 	// cf. public/assembler.php)
176
-	echo pipeline('affichage_final' . _PIPELINE_SUFFIX, $page['texte']);
176
+	echo pipeline('affichage_final'._PIPELINE_SUFFIX, $page['texte']);
177 177
 
178 178
 	if ($lang) {
179 179
 		lang_select();
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		if ($html and ($affiche_boutons_admin or $debug)) {
190 190
 			$var_mode_affiche = _request('var_mode_affiche');
191 191
 			$var_mode_objet = _request('var_mode_objet');
192
-			$GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet . 'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : "");
192
+			$GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet.'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : "");
193 193
 			echo erreur_squelette(false);
194 194
 		}
195 195
 	} else {
Please login to merge, or discard this patch.
ecrire/genie/maintenance.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,8 @@
 block discarded – undo
107 107
 function message_crash_tables() {
108 108
 	if ($crash = verifier_crash_tables()) {
109 109
 		return
110
-			'<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
-			. ' <tt>' . join(', ', $crash) . '</tt><br />'
110
+			'<strong>'._T('texte_recuperer_base').'</strong><br />'
111
+			. ' <tt>'.join(', ', $crash).'</tt><br />'
112 112
 			. generer_form_ecrire('base_repair',
113 113
 				_T('texte_crash_base'), '',
114 114
 				_T('bouton_tenter_recuperation'));
Please login to merge, or discard this patch.
ecrire/genie/mise_a_jour.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 function genie_mise_a_jour_dist($t) {
30 30
 	include_spip('inc/meta');
31 31
 	$maj = info_maj('spip', 'SPIP', $GLOBALS['spip_version_branche']);
32
-	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : "", 'non');
32
+	ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche']."|$maj") : "", 'non');
33 33
 
34 34
 	mise_a_jour_ecran_securite();
35 35
 
36
-	spip_log("Verification version SPIP : " . ($maj ? $maj : "version a jour"), "verifie_maj");
36
+	spip_log("Verification version SPIP : ".($maj ? $maj : "version a jour"), "verifie_maj");
37 37
 
38 38
 	return 1;
39 39
 }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	// si l'ecran n'est pas deja present ou pas updatable, sortir
59 59
 	if (!_URL_ECRAN_SECURITE
60
-		or !file_exists($filename = _DIR_ETC . "ecran_securite.php")
60
+		or !file_exists($filename = _DIR_ETC."ecran_securite.php")
61 61
 		or !is_writable($filename)
62 62
 		or !$last_modified = filemtime($filename)
63 63
 		or !$md5 = md5_file($filename)
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	include_spip('inc/distant');
69
-	$tmp_file = _DIR_TMP . "ecran_securite.php";
69
+	$tmp_file = _DIR_TMP."ecran_securite.php";
70 70
 	$url = parametre_url(_URL_ECRAN_SECURITE, "md5", $md5);
71 71
 	$url = parametre_url($url, "vspip", $GLOBALS['spip_version_branche']);
72 72
 	$res = recuperer_url($url, array(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			include_once $tmp_file;
86 86
 			// ok, on le copie a la place de l'ecran existant
87 87
 			// en backupant l'ecran avant, au cas ou
88
-			@copy($filename, $filename . "-bck-" . date('Y-m-d-His', $last_modified));
88
+			@copy($filename, $filename."-bck-".date('Y-m-d-His', $last_modified));
89 89
 			@rename($tmp_file, $filename);
90 90
 		} else {
91 91
 			@unlink($tmp_file);
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 
113 113
 	list($maj, $min, $rev) = preg_split('/\D+/', $version);
114 114
 
115
-	$nom = _DIR_CACHE_XML . _VERSIONS_LISTE;
115
+	$nom = _DIR_CACHE_XML._VERSIONS_LISTE;
116 116
 	$page = !file_exists($nom) ? '' : file_get_contents($nom);
117 117
 	$page = info_maj_cache($nom, $dir, $page);
118 118
 
119 119
 	// reperer toutes les versions de numero majeur superieur ou egal
120 120
 	// (a revoir quand on arrivera a SPIP V10 ...)
121 121
 	$p = substr("0123456789", intval($maj));
122
-	$p = ',/' . $file . '\D+([' . $p . ']+)\D+(\d+)(\D+(\d+))?.*?[.]zip",i';
122
+	$p = ',/'.$file.'\D+(['.$p.']+)\D+(\d+)(\D+(\d+))?.*?[.]zip",i';
123 123
 	preg_match_all($p, $page, $m, PREG_SET_ORDER);
124 124
 	$page = $page_majeure = '';
125 125
 
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 
129 129
 	foreach ($m as $v) {
130 130
 		$v = array_pad($v, 5, 0);
131
-		list(, $maj2, $min2, , $rev2) = $v;
132
-		$branche_maj = $maj2 . '.' . $min2;
133
-		$version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
131
+		list(, $maj2, $min2,, $rev2) = $v;
132
+		$branche_maj = $maj2.'.'.$min2;
133
+		$version_maj = $maj2.'.'.$min2.'.'.$rev2;
134 134
 		// d'abord les mises à jour de la même branche
135 135
 		if ((spip_version_compare($version, $version_maj, '<'))
136 136
 			and (spip_version_compare($page, $version_maj, '<'))
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 		return "";
151 151
 	}
152 152
 
153
-	$message = $page ? _T('nouvelle_version_spip', array('version' => $page)) . ($page_majeure ? ' | ' : '') : '';
153
+	$message = $page ? _T('nouvelle_version_spip', array('version' => $page)).($page_majeure ? ' | ' : '') : '';
154 154
 	$message .= $page_majeure ? _T('nouvelle_version_spip_majeure', array('version' => $page_majeure)) : '';
155 155
 
156
-	return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$page'>" . $message . '</a>';
156
+	return "<a class='info_maj_spip' href='https://www.spip.net/fr_update' title='$page'>".$message.'</a>';
157 157
 }
158 158
 
159 159
 /**
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 function info_maj_cache($nom, $dir, $page = '') {
177 177
 	include_spip('inc/acces');
178 178
 	$alea_ephemere = charger_aleas();
179
-	$re = '<archives id="a' . $alea_ephemere . '">';
179
+	$re = '<archives id="a'.$alea_ephemere.'">';
180 180
 	if (preg_match("/$re/", $page)) {
181 181
 		return $page;
182 182
 	}
183 183
 
184
-	$url = _VERSIONS_SERVEUR . $dir . '/' . _VERSIONS_LISTE;
184
+	$url = _VERSIONS_SERVEUR.$dir.'/'._VERSIONS_LISTE;
185 185
 	$a = file_exists($nom) ? filemtime($nom) : '';
186 186
 	include_spip('inc/distant');
187 187
 	$res = recuperer_url_cache($url, array('if_modified_since' => $a));
Please login to merge, or discard this patch.
ecrire/genie/optimiser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	sql_free($sel);
128 128
 
129 129
 	if ($in) {
130
-		sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : ''));
131
-		spip_log("Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)));
130
+		sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : ''));
131
+		spip_log("Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)));
132 132
 	}
133 133
 
134 134
 	return count($in);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
 	# supprimer les auteurs 'nouveau' qui n'ont jamais donne suite
202 202
 	# au mail de confirmation (45 jours pour repondre, ca devrait suffire)
203
-	sql_delete("spip_auteurs", "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - 45 * 24 * 3600)));
203
+	sql_delete("spip_auteurs", "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - 45 * 24 * 3600)));
204 204
 
205 205
 	/**
206 206
 	 * Permet aux plugins de compléter l'optimisation suite aux éléments disparus
Please login to merge, or discard this patch.
ecrire/genie/mail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 		$headers = "";
49 49
 		if (isset($page['entetes']) and count($page['entetes'])) {
50 50
 			foreach ($page['entetes'] as $k => $v) {
51
-				$headers .= (strlen($v) ? "$k: $v" : $k) . "\n";
51
+				$headers .= (strlen($v) ? "$k: $v" : $k)."\n";
52 52
 			}
53 53
 		}
54 54
 
Please login to merge, or discard this patch.
ecrire/typographie/fr.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
 	$cherche2 = array(
72 72
 		'/([^-\n]|^)--([^-]|$)/S',
73
-		',(' . _PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S',
73
+		',('._PROTOCOLES_STD.')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S',
74 74
 		'/~/'
75 75
 	);
76 76
 	$remplace2 = array(
Please login to merge, or discard this patch.