Completed
Push — master ( d64163...2218f7 )
by cam
04:20
created
ecrire/inc/roles.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$role = $roles['roles']['defaut'];
150 150
 		}
151 151
 		// where
152
-		$cond = array("$colonne_role=" . sql_quote($role));
152
+		$cond = array("$colonne_role=".sql_quote($role));
153 153
 	}
154 154
 
155 155
 	return array($role, $colonne_role, $cond);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	if ($colonne_role) {
185 185
 		// on ajoute la condition du role aux autres conditions.
186 186
 		if ($role != '*') {
187
-			$cond[] = "$colonne_role=" . sql_quote($role);
187
+			$cond[] = "$colonne_role=".sql_quote($role);
188 188
 		}
189 189
 	}
190 190
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 	$all = sql_allfetsel(
369 369
 		"DISTINCT $colone_role",
370 370
 		$l,
371
-		'objet=' . sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source)
371
+		'objet='.sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source)
372 372
 	);
373 373
 	$done[$hash] = array_map('reset', $all);
374 374
 
Please login to merge, or discard this patch.
ecrire/inc/simplexml_to_array.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 			$namespace[null] = null;
58 58
 		}
59 59
 
60
-		$name = strtolower((string)$obj->getName());
61
-		$text = trim((string)$obj);
60
+		$name = strtolower((string) $obj->getName());
61
+		$text = trim((string) $obj);
62 62
 		if (strlen($text) <= 0) {
63 63
 			$text = null;
64 64
 		}
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 			// attributes
72 72
 			$objAttributes = $obj->attributes($ns, true);
73 73
 			foreach ($objAttributes as $attributeName => $attributeValue) {
74
-				$attribName = strtolower(trim((string)$attributeName));
75
-				$attribVal = trim((string)$attributeValue);
74
+				$attribName = strtolower(trim((string) $attributeName));
75
+				$attribVal = trim((string) $attributeValue);
76 76
 				if (!empty($ns)) {
77
-					$attribName = $ns . ':' . $attribName;
77
+					$attribName = $ns.':'.$attribName;
78 78
 				}
79 79
 				$attributes[$attribName] = $attribVal;
80 80
 			}
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 			// children
83 83
 			$objChildren = $obj->children($ns, true);
84 84
 			foreach ($objChildren as $childName => $child) {
85
-				$childName = strtolower((string)$childName);
85
+				$childName = strtolower((string) $childName);
86 86
 				if (!empty($ns)) {
87
-					$childName = $ns . ':' . $childName;
87
+					$childName = $ns.':'.$childName;
88 88
 				}
89 89
 				$children[$childName][] = xmlObjToArr($child, $namespace);
90 90
 			}
Please login to merge, or discard this patch.
ecrire/inc/cvt_autosave.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 		$je_suis_poste = $flux['args']['je_suis_poste'];
48 48
 
49 49
 		$cle_autosave = serialize($cle_autosave);
50
-		$cle_autosave = $form . "_" . md5($cle_autosave);
50
+		$cle_autosave = $form."_".md5($cle_autosave);
51 51
 
52 52
 		// si on a un backup en session et qu'on est au premier chargement, non poste
53 53
 		// on restitue les donnees
54
-		if (isset($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave])
54
+		if (isset($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave])
55 55
 			and !$je_suis_poste
56 56
 		) {
57
-			parse_str($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave], $vars);
57
+			parse_str($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave], $vars);
58 58
 			foreach ($vars as $key => $val) {
59 59
 				if (isset($flux['data'][$key])) {
60 60
 					$flux['data'][$key] = (is_string($val) ? autosave_clean_value($val) : array_map('autosave_clean_value',
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		 */
69 69
 		$flux['data']['_hidden'] .= "<input type='hidden' name='autosave' class='autosaveactive' value='$cle_autosave' />"
70 70
 			. '<script type="text/javascript">/*<![CDATA[*/if (window.jQuery) jQuery(function(){
71
-		  $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'] . '/"}).addClass("autosaveon");
71
+		  $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'].'/"}).addClass("autosaveon");
72 72
 			});/*]]>*/</script>';
73 73
 
74 74
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	// on elimine les donnees de la session
92 92
 	if ($cle_autosave = _request('autosave')) {
93 93
 		include_spip('inc/session');
94
-		session_set('session_autosave_' . $cle_autosave, null);
94
+		session_set('session_autosave_'.$cle_autosave, null);
95 95
 	}
96 96
 
97 97
 	if (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']) {
Please login to merge, or discard this patch.
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.