Completed
Pull Request — master (#39)
by
unknown
09:06
created
ecrire/inc/lien.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	return $r ? $r : traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo);
103 103
 }
104 104
 
105
-define('_EXTRAIRE_LIEN', ',^\s*(?:' . _PROTOCOLES_STD . '):?/?/?\s*$,iS');
105
+define('_EXTRAIRE_LIEN', ',^\s*(?:'._PROTOCOLES_STD.'):?/?/?\s*$,iS');
106 106
 
107 107
 // http://code.spip.net/@traiter_lien_explicite
108 108
 function traiter_lien_explicite($ref, $texte = '', $pour = 'url', $connect = '', $echappe_typo = true) {
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 		$lien_court = charger_fonction('lien_court', 'inc');
120 120
 		$texte = $lien_court($texte);
121 121
 		if ($echappe_typo) {
122
-			$texte = "<html>" . quote_amp($texte) . "</html>";
122
+			$texte = "<html>".quote_amp($texte)."</html>";
123 123
 		}
124 124
 	}
125 125
 
126 126
 	// petites corrections d'URL
127 127
 	if (preg_match('/^www\.[^@]+$/S', $lien)) {
128
-		$lien = "http://" . $lien;
128
+		$lien = "http://".$lien;
129 129
 	} else {
130 130
 		if (strpos($lien, "@") && email_valide($lien)) {
131 131
 			if (!$texte) {
132 132
 				$texte = $lien;
133 133
 			}
134
-			$lien = "mailto:" . $lien;
134
+			$lien = "mailto:".$lien;
135 135
 		}
136 136
 	}
137 137
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 }
148 148
 
149 149
 function liens_implicite_glose_dist($texte, $id, $type, $args, $ancre, $connect = '') {
150
-	if (function_exists($f = 'glossaire_' . $ancre)) {
150
+	if (function_exists($f = 'glossaire_'.$ancre)) {
151 151
 		$url = $f($texte, $id);
152 152
 	} else {
153 153
 		$url = glossaire_std($texte);
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	if (!($match = typer_raccourci($ref))) {
162 162
 		return false;
163 163
 	}
164
-	@list($type, , $id, , $args, , $ancre) = $match;
164
+	@list($type,, $id,, $args,, $ancre) = $match;
165 165
 	// attention dans le cas des sites le lien doit pointer non pas sur
166 166
 	// la page locale du site, mais directement sur le site lui-meme
167 167
 	if ($f = charger_fonction("implicite_$type", "liens", true)) {
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$r['titre'] = $texte;
189 189
 	}
190 190
 	if (!@$r['titre']) {
191
-		$r['titre'] = _T($type) . " $id";
191
+		$r['titre'] = _T($type)." $id";
192 192
 	}
193 193
 	if ($pour == 'titre') {
194 194
 		return $r['titre'];
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	// dans le cas d'un lien vers un doc, ajouter le type='mime/type'
199 199
 	if ($type == 'document'
200 200
 		and $mime = sql_getfetsel('mime_type', 'spip_types_documents',
201
-			"extension IN (" . sql_get_select("extension", "spip_documents", "id_document=" . sql_quote($id)) . ")",
201
+			"extension IN (".sql_get_select("extension", "spip_documents", "id_document=".sql_quote($id)).")",
202 202
 			'', '', '', '', $connect)
203 203
 	) {
204 204
 		$r['mime'] = $mime;
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
 	'(<([a-z_-]{3,})' # <modele
296 296
 	. '\s*([0-9]*)\s*' # id
297 297
 	. '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>)
298
-	. '\s*/?' . '>)' # fin du modele >
298
+	. '\s*/?'.'>)' # fin du modele >
299 299
 	. '\s*(<\/a>)?' # eventuel </a>
300 300
 );
301 301
 
302
-define('_RACCOURCI_MODELE_DEBUT', '@^' . _RACCOURCI_MODELE . '@isS');
302
+define('_RACCOURCI_MODELE_DEBUT', '@^'._RACCOURCI_MODELE.'@isS');
303 303
 
304 304
 // http://code.spip.net/@traiter_modeles
305 305
 function traiter_modeles($texte, $doublons = false, $echap = '', $connect = '', $liens = null, $env = array()) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 						if (test_espace_prive()) {
372 372
 							$modele = entites_html(substr($texte, $a, $cherche));
373 373
 							if (!is_null($liens)) {
374
-								$modele = "<pre>" . str_replace($liens[0], $liens[1], $modele) . "</pre>";
374
+								$modele = "<pre>".str_replace($liens[0], $liens[1], $modele)."</pre>";
375 375
 							}
376 376
 						}
377 377
 					}
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	// liste des cookies en httponly (a passer en define si besoin)
47 47
 	$httponly = in_array($name, explode(' ', 'spip_session'));
48 48
 
49
-	$name = preg_replace('/^spip_/', $GLOBALS['cookie_prefix'] . '_', $name);
49
+	$name = preg_replace('/^spip_/', $GLOBALS['cookie_prefix'].'_', $name);
50 50
 	if ($path == 'AUTO') {
51 51
 		$path = defined('_COOKIE_PATH') ? _COOKIE_PATH : preg_replace(',^\w+://[^/]*,', '', url_de_base());
52 52
 	}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	}
124 124
 	foreach ($_COOKIE as $name => $value) {
125 125
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
126
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
126
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
127 127
 			$_COOKIE[$spipname] = $value;
128 128
 			$GLOBALS[$spipname] = $value;
129 129
 		}
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			lire_fichier($file, $c);
75 75
 			$css .= $c;
76 76
 		}
77
-		$css = "<style type='text/css'>" . $css . "</style>";
77
+		$css = "<style type='text/css'>".$css."</style>";
78 78
 	} else {
79 79
 		foreach ($files as $name) {
80 80
 			$file = direction_css(find_in_theme($name));
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 		define('_DOCTYPE_ECRIRE', '');
88 88
 	}
89 89
 
90
-	return _DOCTYPE_ECRIRE .
91
-	html_lang_attributes() .
92
-	"<head>\n" .
93
-	"<title>" .
94
-	textebrut($titre) .
95
-	"</title>\n" .
96
-	"<meta name='viewport' content='width=device-width' />\n" .
97
-	$css .
90
+	return _DOCTYPE_ECRIRE.
91
+	html_lang_attributes().
92
+	"<head>\n".
93
+	"<title>".
94
+	textebrut($titre).
95
+	"</title>\n".
96
+	"<meta name='viewport' content='width=device-width' />\n".
97
+	$css.
98 98
 	"</head>
99
-<body" . $onLoad . " class='minipres'>
99
+<body" . $onLoad." class='minipres'>
100 100
 	<div id='minipres'>
101 101
 	<h1>" .
102
-	$titre .
102
+	$titre.
103 103
 	"</h1>
104 104
 	<div>\n";
105 105
 }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 		$titre = ($titre == 'install')
183 183
 			? _T('avis_espace_interdit')
184
-			: $titre . '&nbsp;: ' . _T('info_acces_interdit');
184
+			: $titre.'&nbsp;: '._T('info_acces_interdit');
185 185
 
186 186
 		$statut = isset($GLOBALS['visiteur_session']['statut']) ? $GLOBALS['visiteur_session']['statut'] : '';
187 187
 		$nom = isset($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : '';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$corps = generer_form_ecrire('accueil', '', '',
194 194
 			$statut ? _T('public:accueil_site') : _T('public:lien_connecter')
195 195
 		);
196
-		spip_log($nom . " $titre " . $_SERVER['REQUEST_URI']);
196
+		spip_log($nom." $titre ".$_SERVER['REQUEST_URI']);
197 197
 	}
198 198
 
199 199
 	if (!_AJAX) {
@@ -211,6 +211,6 @@  discard block
 block discarded – undo
211 211
 		foreach ($_POST as $v => $c) {
212 212
 			$url = parametre_url($url, $v, $c, '&');
213 213
 		}
214
-		ajax_retour("<div>" . $titre . redirige_formulaire($url) . "</div>", false);
214
+		ajax_retour("<div>".$titre.redirige_formulaire($url)."</div>", false);
215 215
 	}
216 216
 }
Please login to merge, or discard this patch.
ecrire/inc/chercher_logo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@
 block discarded – undo
39 39
 	# attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval()
40 40
 	
41 41
 	$type = type_du_logo($_id_objet);
42
-	$nom = $type . $mode . intval($id);
42
+	$nom = $type.$mode.intval($id);
43 43
 	
44 44
 	foreach ($GLOBALS['formats_logos'] as $format) {
45
-		if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) {
45
+		if (@file_exists($d = (_DIR_LOGOS.$nom.'.'.$format))) {
46 46
 			return array($d, _DIR_LOGOS, $nom, $format, @filemtime($d));
47 47
 		}
48 48
 	}
Please login to merge, or discard this patch.
ecrire/inc/prepare_recherche.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 
80 80
 	if (!isset($cache[$serveur][$table][$recherche])) {
81 81
 		$hash_serv = ($serveur ? substr(md5($serveur), 0, 16) : '');
82
-		$hash = substr(md5($recherche . $table), 0, 16);
83
-		$where = "(resultats.recherche='$hash' AND resultats.table_objet=" . sql_quote($table) . " AND resultats.serveur='$hash_serv')";
82
+		$hash = substr(md5($recherche.$table), 0, 16);
83
+		$where = "(resultats.recherche='$hash' AND resultats.table_objet=".sql_quote($table)." AND resultats.serveur='$hash_serv')";
84 84
 		$row = sql_fetsel('UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(resultats.maj) AS fraicheur', 'spip_resultats AS resultats',
85 85
 			$where, '', 'fraicheur DESC', '0,1');
86 86
 		if (!$row
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		$whered = str_replace(array("resultats.recherche", "resultats.table_objet", "resultats.serveur"),
124 124
 			array("recherche", "table_objet", "serveur"), $where);
125 125
 		sql_delete('spip_resultats',
126
-			'NOT(' . sql_date_proche('maj', (0 - ($delai_fraicheur + 100)), " SECOND") . ") OR ($whered)");
126
+			'NOT('.sql_date_proche('maj', (0 - ($delai_fraicheur + 100)), " SECOND").") OR ($whered)");
127 127
 
128 128
 		// inserer les resultats dans la table de cache des resultats
129 129
 		if (count($points)) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		}
180 180
 
181 181
 		foreach ($listes_ids as $p => $ids) {
182
-			$select .= "+$p*(" .
182
+			$select .= "+$p*(".
183 183
 				sql_in("$table.$primary", $ids, '', $serveur)
184 184
 				. ") ";
185 185
 		}
Please login to merge, or discard this patch.
ecrire/inc/lang_liste.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	'cpf_dom' => "Krey&ograve;l",
52 52
 	'cpf_hat' => "Krey&ograve;l (Peyi Dayiti)",
53 53
 	'cs' => "&#269;e&#353;tina",
54
-	'cy' => "Cymraeg",  # welsh, gallois
54
+	'cy' => "Cymraeg", # welsh, gallois
55 55
 	'da' => "dansk",
56 56
 	'de' => "Deutsch",
57 57
 	'dz' => "Bhutani",
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	'hi' => "&#2361;&#2367;&#2306;&#2342;&#2368;",
93 93
 	'hr' => "hrvatski",
94 94
 	'hu' => "magyar",
95
-	'hy' => "&#1344;&#1377;&#1397;&#1381;&#1408;&#1381;&#1398;",// Arménien
95
+	'hy' => "&#1344;&#1377;&#1397;&#1381;&#1408;&#1381;&#1398;", // Arménien
96 96
 	'ia' => "Interlingua",
97 97
 	'id' => "Indonesia",
98 98
 	'ie' => "Interlingue",
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	'ka' => "&#4325;&#4304;&#4320;&#4311;&#4323;&#4314;&#4312;",
107 107
 	'kk' => "&#1179;&#1072;&#1079;&#1072;&#1179;&#32;&#1090;&#1110;&#1083;&#1110;", // Kazakh
108 108
 	'kl' => "kalaallisut",
109
-	'km' => "&#6039;&#6070;&#6047;&#6070;&#6017;&#6098;&#6040;&#6082;&#6042;",// Khmer
109
+	'km' => "&#6039;&#6070;&#6047;&#6070;&#6017;&#6098;&#6040;&#6082;&#6042;", // Khmer
110 110
 	'kn' => "Kannada",
111 111
 	'ko' => "&#54620;&#44397;&#50612;",
112 112
 	'kok' => "&#2325;&#2379;&#2306;&#2325;&#2339;&#2368;",
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 	'sh_latn' => 'srpskohrvastski',
177 177
 	'sh_cyrl' => '&#1057;&#1088;&#1087;&#1089;&#1082;&#1086;&#1093;&#1088;&#1074;&#1072;&#1090;&#1089;&#1082;&#1080;',
178 178
 	'si' => "Sinhalese",
179
-	'sk' => "sloven&#269;ina",  // (Slovakia)
180
-	'sl' => "sloven&#353;&#269;ina",  // (Slovenia)
179
+	'sk' => "sloven&#269;ina", // (Slovakia)
180
+	'sl' => "sloven&#353;&#269;ina", // (Slovenia)
181 181
 	'sm' => "Samoan",
182 182
 	'sn' => "Shona",
183 183
 	'so' => "Somali",
Please login to merge, or discard this patch.
ecrire/inc/json.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		case is_null($var):
32 32
 			return 'null';
33 33
 		case is_string($var):
34
-			return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
+			return '"'.addcslashes($var, "\"\\\n\r/").'"';
35 35
 		case is_bool($var):
36 36
 			return $var ? 'true' : 'false';
37 37
 		case is_scalar($var):
38
-			return (string)$var;
38
+			return (string) $var;
39 39
 		case is_object($var):// blam
40 40
 			$var = get_object_vars($var);
41 41
 			$asso = true;
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
 			if ($asso) {
51 51
 				$ret = '{';
52 52
 				foreach ($var as $key => $elt) {
53
-					$ret .= $sep . '"' . $key . '":' . var2js($elt);
53
+					$ret .= $sep.'"'.$key.'":'.var2js($elt);
54 54
 					$sep = ',';
55 55
 				}
56 56
 
57
-				return $ret . '}';
57
+				return $ret.'}';
58 58
 			} else {
59 59
 				$ret = '[';
60 60
 				foreach ($var as $elt) {
61
-					$ret .= $sep . var2js($elt);
61
+					$ret .= $sep.var2js($elt);
62 62
 					$sep = ',';
63 63
 				}
64 64
 
65
-				return $ret . ']';
65
+				return $ret.']';
66 66
 			}
67 67
 	}
68 68
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	// flag indiquant qu'on est en iframe et qu'il faut proteger nos
83 83
 	// donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
84 84
 	if (defined('FILE_UPLOAD')) {
85
-		return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
85
+		return '<textarea>'.spip_htmlspecialchars($var).'</textarea>';
86 86
 	} else {
87 87
 		return $var;
88 88
 	}
Please login to merge, or discard this patch.
ecrire/inc/meta.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			renouvelle_alea();
63 63
 			$new = false;
64 64
 		} else {
65
-			spip_log("impossible d'ecrire dans " . $cache);
65
+			spip_log("impossible d'ecrire dans ".$cache);
66 66
 		}
67 67
 	}
68 68
 	// et refaire le cache si on a du lire en base
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	if (!isset($touch[$table])) {
161 161
 		touch_meta($antidate, $table);
162 162
 	}
163
-	sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
163
+	sql_delete('spip_'.$table, "nom='$nom'", '', 'continue');
164 164
 	unset($GLOBALS[$table][$nom]);
165 165
 	if (!isset($touch[$table])) {
166 166
 		touch_meta($antidate, $table);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		return;
192 192
 	}
193 193
 	include_spip('base/abstract_sql');
194
-	$res = sql_select("*", 'spip_' . $table, "nom=" . sql_quote($nom), '', '', '', '', '', 'continue');
194
+	$res = sql_select("*", 'spip_'.$table, "nom=".sql_quote($nom), '', '', '', '', '', 'continue');
195 195
 	// table pas encore installee, travailler en php seulement
196 196
 	if (!$res) {
197 197
 		$GLOBALS[$table][$nom] = $valeur;
@@ -224,9 +224,9 @@  discard block
 block discarded – undo
224 224
 		$r['impt'] = sql_quote($importable, '', 'text');
225 225
 	}
226 226
 	if ($row) {
227
-		sql_update('spip_' . $table, $r, "nom=" . sql_quote($nom));
227
+		sql_update('spip_'.$table, $r, "nom=".sql_quote($nom));
228 228
 	} else {
229
-		sql_insert('spip_' . $table, "(" . join(',', array_keys($r)) . ")", "(" . join(',', array_values($r)) . ")");
229
+		sql_insert('spip_'.$table, "(".join(',', array_keys($r)).")", "(".join(',', array_values($r)).")");
230 230
 	}
231 231
 	if (!isset($touch[$table])) {
232 232
 		touch_meta($antidate, $table);
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
  *     Nom du fichier cache
244 244
  **/
245 245
 function cache_meta($table = 'meta') {
246
-	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
246
+	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE.$table.'.php');
247 247
 }
248 248
 
249 249
 /**
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
 	$corps = str_replace('&#34#', '&#34;', $corps);
151 151
 	include_spip('inc/texte');
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 		}
187 187
 	}
188 188
 	// Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ?
189
-	$t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t));
189
+	$t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t));
190 190
 
191
-	return (!$style ? '' : "\n<style>" . $style . '</style>') . $t;
191
+	return (!$style ? '' : "\n<style>".$style.'</style>').$t;
192 192
 }
193 193
 
194 194
 /**
Please login to merge, or discard this patch.