Completed
Push — master ( 1dde8c...5a052b )
by cam
01:06
created
ecrire/inc/lister_objets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	$fond = "prive/objets/liste/$vue";
48
-	if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) {
48
+	if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) {
49 49
 		// traiter les cas particuliers
50 50
 		include_spip('base/connect_sql');
51 51
 		$vue = table_objet($vue);
52 52
 		$fond = "prive/objets/liste/$vue";
53
-		if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) {
53
+		if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) {
54 54
 			return _L("vue $vue introuvable pour lister les objets");
55 55
 		}
56 56
 	}
Please login to merge, or discard this patch.
ecrire/base/connect_sql.php 1 patch
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19 19
 	return;
20 20
 }
21
-require_once _ROOT_RESTREINT . 'base/objets.php';
21
+require_once _ROOT_RESTREINT.'base/objets.php';
22 22
 
23 23
 
24 24
 /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$f = (!preg_match('/^[\w\.]*$/', $serveur))
60 60
 			? '' // nom de serveur mal ecrit
61 61
 			: ($serveur ?
62
-				(_DIR_CONNECT . $serveur . '.php') // serveur externe
62
+				(_DIR_CONNECT.$serveur.'.php') // serveur externe
63 63
 				: (_FILE_CONNECT ? _FILE_CONNECT // serveur principal ok
64 64
 					: ($install ? _FILE_CONNECT_TMP // init du serveur principal
65 65
 						: ''))); // installation pas faite
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	// chargement de la version du jeu de fonctions
103 103
 	// si pas dans le fichier par defaut
104 104
 	$type = $GLOBALS['db_ok']['type'];
105
-	$jeu = 'spip_' . $type . '_functions_' . $version;
105
+	$jeu = 'spip_'.$type.'_functions_'.$version;
106 106
 	if (!isset($GLOBALS[$jeu])) {
107
-		if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) {
107
+		if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) {
108 108
 			spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS);
109 109
 
110 110
 			// ne plus reessayer
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 	$connexion = spip_connect($serveur);
166 166
 	$e = sql_errno($serveur);
167 167
 	$t = (isset($connexion['type']) ? $connexion['type'] : 'sql');
168
-	$m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']);
169
-	$f = $t . $serveur;
170
-	spip_log($m, $f . '.' . _LOG_ERREUR);
168
+	$m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']);
169
+	$f = $t.$serveur;
170
+	spip_log($m, $f.'.'._LOG_ERREUR);
171 171
 }
172 172
 
173 173
 /**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	// si en cours d'installation ou si db=@test@ on ne pose rien
250 250
 	// car c'est un test de connexion
251 251
 	if (!defined('_ECRIRE_INSTALL') and $db !== "@test@") {
252
-		$f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out';
252
+		$f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out';
253 253
 	} elseif ($db == '@test@') {
254 254
 		$db = '';
255 255
 	}
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	// En cas d'indisponibilite du serveur, eviter de le bombarder
290 290
 	if ($f) {
291 291
 		@touch($f);
292
-		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS);
292
+		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS);
293 293
 	}
294 294
 }
295 295
 
@@ -379,8 +379,7 @@  discard block
 block discarded – undo
379 379
  * @return string Valeur échappée.
380 380
  **/
381 381
 function _q($a) {
382
-	return (is_numeric($a)) ? strval($a) :
383
-		(!is_array($a) ? ("'" . addslashes($a) . "'")
382
+	return (is_numeric($a)) ? strval($a) : (!is_array($a) ? ("'".addslashes($a)."'")
384 383
 			: join(",", array_map('_q', $a)));
385 384
 }
386 385
 
@@ -452,7 +451,7 @@  discard block
 block discarded – undo
452 451
 				break;
453 452
 			default:
454 453
 				$replace = range(1, count($textes));
455
-				$replace = '%' . implode('$s,%', $replace) . '$s';
454
+				$replace = '%'.implode('$s,%', $replace).'$s';
456 455
 				$replace = explode(',', $replace);
457 456
 				break;
458 457
 		}
Please login to merge, or discard this patch.
ecrire/base/delete_all.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,5 +51,5 @@
 block discarded – undo
51 51
 	}
52 52
 	$d = count($delete);
53 53
 	$r = count($res);
54
-	spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE);
54
+	spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE);
55 55
 }
Please login to merge, or discard this patch.
ecrire/inc/documents.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 	$dest = preg_replace(',-r(90|180|270)$,', '', $dest);
141 141
 
142 142
 	// Si le document "source" est deja au bon endroit, ne rien faire
143
-	if ($source == ($dir . $dest . '.' . $ext)) {
143
+	if ($source == ($dir.$dest.'.'.$ext)) {
144 144
 		return $source;
145 145
 	}
146 146
 
147 147
 	// sinon tourner jusqu'a trouver un numero correct
148 148
 	$n = 0;
149
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
149
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
150 150
 		;
151 151
 	}
152 152
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 function deplacer_fichier_upload($source, $dest, $move = false) {
208 208
 	// Securite
209 209
 	if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) {
210
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
210
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
211 211
 	} else {
212 212
 		$dest = preg_replace(',\.\.+,', '.', $dest);
213 213
 	}
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 
285 285
 		default: /* autre */
286 286
 			if (!$msg) {
287
-				$msg = _T('pass_erreur') . ' ' . $error
288
-					. '<br />' . propre("[->http://php.net/manual/fr/features.file-upload.errors.php]");
287
+				$msg = _T('pass_erreur').' '.$error
288
+					. '<br />'.propre("[->http://php.net/manual/fr/features.file-upload.errors.php]");
289 289
 			}
290 290
 			break;
291 291
 	}
@@ -302,6 +302,6 @@  discard block
 block discarded – undo
302 302
 
303 303
 	include_spip('inc/minipres');
304 304
 	echo minipres($msg,
305
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . "</button></a></div>");
305
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant')."</button></a></div>");
306 306
 	exit;
307 307
 }
Please login to merge, or discard this patch.
ecrire/inc/actions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
  *     Code HTML du formulaire
79 79
  */
80 80
 function redirige_action_auteur($action, $arg, $ret, $gra = '', $mode = false, $atts = '', $public = false) {
81
-	$r = ($public ? _DIR_RESTREINT_ABS : _DIR_RESTREINT) . generer_url_ecrire($ret, $gra, true, true);
81
+	$r = ($public ? _DIR_RESTREINT_ABS : _DIR_RESTREINT).generer_url_ecrire($ret, $gra, true, true);
82 82
 
83 83
 	return generer_action_auteur($action, $arg, $r, $mode, $atts, $public);
84 84
 }
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
  *     URL, code HTML du formulaire ou tableau (action, arg, hash)
106 106
  */
107 107
 function redirige_action_post($action, $arg, $ret, $gra, $corps, $att = '') {
108
-	$r = _DIR_RESTREINT . generer_url_ecrire($ret, $gra, false, true);
108
+	$r = _DIR_RESTREINT.generer_url_ecrire($ret, $gra, false, true);
109 109
 
110
-	return generer_action_auteur($action, $arg, $r, $corps, $att . " method='post'");
110
+	return generer_action_auteur($action, $arg, $r, $corps, $att." method='post'");
111 111
 }
112 112
 
113 113
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	$c = $GLOBALS['meta']['charset'];
141
-	header('Content-Type: ' . $content_type . '; charset=' . $c);
142
-	$debut = (($xml and strlen(trim($corps))) ? '<' . "?xml version='1.0' encoding='" . $c . "'?" . ">\n" : '');
141
+	header('Content-Type: '.$content_type.'; charset='.$c);
142
+	$debut = (($xml and strlen(trim($corps))) ? '<'."?xml version='1.0' encoding='".$c."'?".">\n" : '');
143 143
 	$fin = '';
144 144
 
145 145
 	echo $debut, $corps, $fin, $e;
Please login to merge, or discard this patch.
ecrire/inc/invalideur.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	$t = 0;
83 83
 	$n = 0;
84 84
 	$time = isset($GLOBALS['meta']['cache_mark']) ? $GLOBALS['meta']['cache_mark'] : 0;
85
-	for ($i=0; $i < 256; $i++) {
85
+	for ($i = 0; $i < 256; $i++) {
86 86
 		$dir = _DIR_CACHE.sprintf('%02s', dechex($i));
87 87
 		if (@is_dir($dir) and is_readable($dir) and $d = opendir($dir)) {
88 88
 			while (($f = readdir($d)) !== false) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 					$n++;
91 91
 					if ($a['mtime'] >= $time) {
92 92
 						if ($a['blocks'] > 0) {
93
-							$t += 512*$a['blocks'];
93
+							$t += 512 * $a['blocks'];
94 94
 						} else {
95 95
 							$t += $a['size'];
96 96
 						}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 			}
100 100
 		}
101 101
 		if ($n > 500) {
102
-			return intval(256*$t/(1+$i));
102
+			return intval(256 * $t / (1 + $i));
103 103
 		}
104 104
 	}
105 105
 	return $t;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 	// stocker la date_modif_$objet (ne sert a rien pour le moment)
142 142
 	if (isset($objet)) {
143
-		ecrire_meta('derniere_modif_' . $objet, time());
143
+		ecrire_meta('derniere_modif_'.$objet, time());
144 144
 	}
145 145
 
146 146
 	// si $derniere_modif_invalide est un array('article', 'rubrique')
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		$cache
237 237
 	)) {
238 238
 		// supprimer le fichier (de facon propre)
239
-		supprimer_fichier(_DIR_CACHE . $cache);
239
+		supprimer_fichier(_DIR_CACHE.$cache);
240 240
 	} else {
241 241
 		spip_log("Nom de fichier cache incorrect : $cache");
242 242
 	}
Please login to merge, or discard this patch.
prive/formulaires/dater.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 
93 93
 
94
-	$row = sql_fetsel($select, $desc['table'], "$_id_objet=" . intval($id_objet));
94
+	$row = sql_fetsel($select, $desc['table'], "$_id_objet=".intval($id_objet));
95 95
 	$statut = isset($row['statut']) ? $row['statut'] : 'publie'; // pas de statut => publie
96 96
 
97 97
 	$valeurs['editable'] = autoriser('dater', $objet, $id_objet, null, array('statut' => $statut));
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
 
248 248
 	if (_request('changer')) {
249 249
 		foreach (array('date', 'date_redac') as $k) {
250
-			if ($v = _request($k . '_jour') and !dater_recuperer_date_saisie($v, $k)) {
250
+			if ($v = _request($k.'_jour') and !dater_recuperer_date_saisie($v, $k)) {
251 251
 				$erreurs[$k] = _T('format_date_incorrecte');
252
-			} elseif ($v = _request($k . '_heure') and !dater_recuperer_heure_saisie($v)) {
252
+			} elseif ($v = _request($k.'_heure') and !dater_recuperer_heure_saisie($v)) {
253 253
 				$erreurs[$k] = _T('format_heure_incorrecte');
254 254
 			}
255 255
 		}
Please login to merge, or discard this patch.
ecrire/inc/csv.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 	// si une seule colonne, en faire le titre
78 78
 	if (preg_match("/^([^$sep]+)$sep+\$/", $entete, $l)) {
79
-		$caption = "\n||" . $l[1] . "|";
79
+		$caption = "\n||".$l[1]."|";
80 80
 		list($entete, $corps) = explode("\n", $corps, 2);
81 81
 	}
82 82
 	// si premiere colonne vide, le raccourci doit quand meme produire <th...
83 83
 	if ($entete[0] == $sep) {
84
-		$entete = ' ' . $entete;
84
+		$entete = ' '.$entete;
85 85
 	}
86 86
 
87 87
 	$lignes = explode("\n", $corps);
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 	}
129 129
 	
130 130
 	foreach ($lignes as &$l) {
131
-		$l = str_replace('&#34#','"',$l);
132
-		$l = str_replace('``**``',"\n",$l);
131
+		$l = str_replace('&#34#', '"', $l);
132
+		$l = str_replace('``**``', "\n", $l);
133 133
 		$l = explode($sep, $l);
134 134
 	}
135 135
 	
Please login to merge, or discard this patch.
ecrire/install/etape_chmod.php 1 patch
Spacing   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			$test_dir .= '/';
82 82
 		}
83 83
 		if (!in_array($test_dir, $GLOBALS['test_dirs'])) {
84
-			$GLOBALS['test_dirs'][] = _DIR_RACINE . $test_dir;
84
+			$GLOBALS['test_dirs'][] = _DIR_RACINE.$test_dir;
85 85
 		}
86 86
 	} else {
87 87
 		if (!_FILE_CONNECT) {
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 	foreach ($GLOBALS['test_dirs'] as $i => $my_dir) {
97 97
 		$test = test_ecrire($my_dir);
98 98
 		if (!$test) {
99
-			$m = preg_replace(',^' . _DIR_RACINE . ',', '', $my_dir);
99
+			$m = preg_replace(',^'._DIR_RACINE.',', '', $my_dir);
100 100
 			if (@file_exists($my_dir)) {
101
-				$bad_dirs['<li>' . $m . '</li>'] = 1;
101
+				$bad_dirs['<li>'.$m.'</li>'] = 1;
102 102
 			} else {
103
-				$absent_dirs['<li>' . $m . '</li>'] = 1;
103
+				$absent_dirs['<li>'.$m.'</li>'] = 1;
104 104
 			}
105 105
 		} else {
106 106
 			$chmod = max($chmod, $test);
@@ -110,21 +110,21 @@  discard block
 block discarded – undo
110 110
 	if ($bad_dirs or $absent_dirs) {
111 111
 		if (!_FILE_CONNECT) {
112 112
 			$titre = _T('dirs_preliminaire');
113
-			$continuer = ' ' . _T('dirs_commencer') . '.';
113
+			$continuer = ' '._T('dirs_commencer').'.';
114 114
 		} else {
115 115
 			$titre = _T('dirs_probleme_droits');
116 116
 		}
117 117
 
118 118
 
119
-		$res = "<div align='right'>" . menu_langues('var_lang_ecrire') . "</div>\n";
119
+		$res = "<div align='right'>".menu_langues('var_lang_ecrire')."</div>\n";
120 120
 
121 121
 		if ($bad_dirs) {
122 122
 			$res .=
123 123
 				_T(
124 124
 					'dirs_repertoires_suivants',
125 125
 					array('bad_dirs' => join("\n", array_keys($bad_dirs)))
126
-				) .
127
-				'<b>' . _T('login_recharger') . '</b>.';
126
+				).
127
+				'<b>'._T('login_recharger').'</b>.';
128 128
 		}
129 129
 
130 130
 		if ($absent_dirs) {
@@ -132,22 +132,21 @@  discard block
 block discarded – undo
132 132
 				_T(
133 133
 					'dirs_repertoires_absents',
134 134
 					array('bad_dirs' => join("\n", array_keys($absent_dirs)))
135
-				) .
136
-				'<b>' . _T('login_recharger') . '</b>.';
135
+				).
136
+				'<b>'._T('login_recharger').'</b>.';
137 137
 		}
138
-		$res = '<p>' . $continuer . $res . aider('install0', true) . '</p>';
138
+		$res = '<p>'.$continuer.$res.aider('install0', true).'</p>';
139 139
 
140 140
 		$t = _T('login_recharger');
141
-		$t = (!$test_dir ? '' :
142
-				"<input type='hidden' name='test_dir' value='" . spip_htmlspecialchars($test_dir, ENT_QUOTES) . "' />")
141
+		$t = (!$test_dir ? '' : "<input type='hidden' name='test_dir' value='".spip_htmlspecialchars($test_dir, ENT_QUOTES)."' />")
143 142
 			. "<input type='hidden' name='etape' value='chmod' />"
144
-			. "<div style='text-align: right'><input type='submit' value='" . attribut_html($t) . "' /></div>";
143
+			. "<div style='text-align: right'><input type='submit' value='".attribut_html($t)."' /></div>";
145 144
 
146
-		echo minipres($titre, $res . generer_form_ecrire('install', $t));
145
+		echo minipres($titre, $res.generer_form_ecrire('install', $t));
147 146
 	} else {
148 147
 		$deja = (_FILE_CONNECT and analyse_fichier_connection(_FILE_CONNECT));
149 148
 		if (!$deja) {
150
-			redirige_url_ecrire('install', 'etape=1&chmod=' . $chmod);
149
+			redirige_url_ecrire('install', 'etape=1&chmod='.$chmod);
151 150
 		} else {
152 151
 			redirige_url_ecrire();
153 152
 		}
Please login to merge, or discard this patch.