Completed
Push — master ( 7208c3...09b169 )
by cam
01:22
created
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.
ecrire/inc/texte.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 function echappe_js($t, $class = ' class = "echappe-js"') {
105 105
 	foreach (array('script', 'iframe') as $tag) {
106 106
 		if (stripos($t, "<$tag") !== false
107
-			and preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)
107
+			and preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER)
108 108
 		) {
109 109
 			foreach ($r as $regs) {
110 110
 				$t = str_replace($regs[0],
111
-					"<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>',
111
+					"<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>',
112 112
 					$t);
113 113
 			}
114 114
 		}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
  * @return string
143 143
  *     Code protégé
144 144
  **/
145
-function interdire_scripts($arg, $mode_filtre=null) {
145
+function interdire_scripts($arg, $mode_filtre = null) {
146 146
 	// on memorise le resultat sur les arguments non triviaux
147 147
 	static $dejavu = array();
148 148
 
@@ -160,10 +160,10 @@  discard block
 block discarded – undo
160 160
 	}
161 161
 
162 162
 	// echapper les tags asp/php
163
-	$t = str_replace('<' . '%', '&lt;%', $arg);
163
+	$t = str_replace('<'.'%', '&lt;%', $arg);
164 164
 
165 165
 	// echapper le php
166
-	$t = str_replace('<' . '?', '&lt;?', $t);
166
+	$t = str_replace('<'.'?', '&lt;?', $t);
167 167
 
168 168
 	// echapper le < script language=php >
169 169
 	$t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '&lt;\1', $t);
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 
186 186
 	// Reinserer les echappements des modeles
187 187
 	if (defined('_PROTEGE_JS_MODELES')) {
188
-		$t = echappe_retour($t, "javascript" . _PROTEGE_JS_MODELES);
188
+		$t = echappe_retour($t, "javascript"._PROTEGE_JS_MODELES);
189 189
 	}
190 190
 	if (defined('_PROTEGE_PHP_MODELES')) {
191
-		$t = echappe_retour($t, "php" . _PROTEGE_PHP_MODELES);
191
+		$t = echappe_retour($t, "php"._PROTEGE_PHP_MODELES);
192 192
 	}
193 193
 
194 194
 	return $dejavu[$mode_filtre][$arg] = $t;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	// et aussi dans l'espace public si la globale filtrer_javascript = -1
274 274
 	// https://core.spip.net/issues/4166
275 275
 	if ($GLOBALS['filtrer_javascript'] == -1
276
-	  or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript']<=0)) {
276
+	  or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript'] <= 0)) {
277 277
 		$letexte = echapper_html_suspect($letexte);
278 278
 	}
279 279
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 define('_TYPO_PROTEGER', "!':;?~%-");
285 285
 define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8");
286 286
 
287
-define('_TYPO_BALISE', ",</?[a-z!][^<>]*[" . preg_quote(_TYPO_PROTEGER) . "][^<>]*>,imsS");
287
+define('_TYPO_BALISE', ",</?[a-z!][^<>]*[".preg_quote(_TYPO_PROTEGER)."][^<>]*>,imsS");
288 288
 
289 289
 /**
290 290
  * Corrige la typographie
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 	// https://core.spip.net/issues/4166
434 434
 	if ($interdire_script
435 435
 		or $GLOBALS['filtrer_javascript'] == -1
436
-		or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript']<=0)
437
-		or (isset($env['wysiwyg']) and $env['wysiwyg'] and $GLOBALS['filtrer_javascript']<=0)) {
436
+		or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript'] <= 0)
437
+		or (isset($env['wysiwyg']) and $env['wysiwyg'] and $GLOBALS['filtrer_javascript'] <= 0)) {
438 438
 		$t = echapper_html_suspect($t, false);
439 439
 	}
440 440
 	$t = echappe_html($t);
Please login to merge, or discard this patch.
ecrire/inc/filtres_mini.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	if ($query) {
47
-		$url .= '?' . $query;
47
+		$url .= '?'.$query;
48 48
 	}
49 49
 
50
-	return '/' . preg_replace(',^/,S', '', $url);
50
+	return '/'.preg_replace(',^/,S', '', $url);
51 51
 }
52 52
 
53 53
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) {
75 75
 		$r = array_pad($r, 3, null);
76 76
 
77
-		return $r[1] . resolve_path($r[2]);
77
+		return $r[1].resolve_path($r[2]);
78 78
 	}
79 79
 
80 80
 	# L'url site spip est un lien absolu aussi
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 	switch (substr($lien, 0, 1)) {
95 95
 		case '/':
96
-			return $debut . resolve_path($lien);
96
+			return $debut.resolve_path($lien);
97 97
 		case '#':
98
-			return $debut . resolve_path($dir . $mot . $get . $lien);
98
+			return $debut.resolve_path($dir.$mot.$get.$lien);
99 99
 		case '':
100
-			return $debut . resolve_path($dir . $mot . $get . $hash);
100
+			return $debut.resolve_path($dir.$mot.$get.$hash);
101 101
 		default:
102
-			return $debut . resolve_path($dir . $lien);
102
+			return $debut.resolve_path($dir.$lien);
103 103
 	}
104 104
 }
105 105
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		return '';
128 128
 	}
129 129
 	if (!$base) {
130
-		$base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
130
+		$base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : '');
131 131
 	}
132 132
 
133 133
 	return suivre_lien($base, $url);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
  * @param array $protocoles_autorises
151 151
  * @return bool
152 152
  */
153
-function protocole_verifier($url_absolue, $protocoles_autorises = array('http','https')) {
153
+function protocole_verifier($url_absolue, $protocoles_autorises = array('http', 'https')) {
154 154
 
155 155
 	if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) {
156 156
 		$protocole = $m[1];
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
  */
231 231
 function spip_htmlspecialchars($string, $flags = null, $encoding = 'UTF-8', $double_encode = true) {
232 232
 	if (is_null($flags)) {
233
-		$flags = ENT_COMPAT|ENT_HTML401;
233
+		$flags = ENT_COMPAT | ENT_HTML401;
234 234
 	}
235 235
 
236 236
 	return htmlspecialchars($string, $flags, $encoding, $double_encode);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function spip_htmlentities($string, $flags = null, $encoding = 'UTF-8', $double_encode = true) {
249 249
 	if (is_null($flags)) {
250
-		$flags = ENT_COMPAT|ENT_HTML401;
250
+		$flags = ENT_COMPAT | ENT_HTML401;
251 251
 	}
252 252
 
253 253
 	return htmlentities($string, $flags, $encoding, $double_encode);
Please login to merge, or discard this patch.