Completed
Push — master ( f512ef...722af0 )
by cam
01:03
created
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	];
44 44
 	$options = array_merge($defaut, $options);
45 45
 	if (is_numeric($options['expires']) and $options['expires'] > 0) {
46
-		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT';
46
+		$options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT';
47 47
 	}
48 48
 
49 49
 	if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) {
73 73
 	// toujours envoyer un content type, meme vide !
74 74
 	header('Accept-Ranges: bytes');
75
-	header('Content-Type: ' . $content_type);
75
+	header('Content-Type: '.$content_type);
76 76
 
77 77
 	if ($attachment) {
78 78
 		$f = basename($fichier);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	else {
91 91
 		$f = basename($fichier);
92 92
 		header("Content-Disposition: inline; filename=\"$f\";");
93
-		header('Expires: ' . $expires); // set expiration time
93
+		header('Expires: '.$expires); // set expiration time
94 94
 	}
95 95
 }
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
143 143
 	if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
144 144
 		### Offset signifies where we should begin to read the file
145
-		$byteOffset = (int)$match[1];
145
+		$byteOffset = (int) $match[1];
146 146
 
147 147
 
148 148
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
149 149
 		if (isset($match[2])) {
150
-			$finishBytes = (int)$match[2];
150
+			$finishBytes = (int) $match[2];
151 151
 			$byteLength = $finishBytes + 1;
152 152
 		} else {
153 153
 			$finishBytes = $fileSize - 1;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 	// partial content
170 170
 	header('HTTP/1.1 206 Partial content');
171
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
171
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
172 172
 
173 173
 
174 174
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.
ecrire/action/editer_logo.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	if ($logo) {
41 41
 		# TODO : deprecated, a supprimer -> anciens logos IMG/artonxx.png pas en base
42 42
 		if ((is_countable($logo) ? count($logo) : 0) < 6) {
43
-			spip_log("Supprimer ancien logo " . json_encode($logo, JSON_THROW_ON_ERROR), 'logo');
43
+			spip_log("Supprimer ancien logo ".json_encode($logo, JSON_THROW_ON_ERROR), 'logo');
44 44
 			spip_unlink($logo[0]);
45 45
 		}
46 46
 		elseif (
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		return $erreur;
90 90
 	}
91 91
 	// chercher dans la base
92
-	$mode_document = 'logo' . $mode;
92
+	$mode_document = 'logo'.$mode;
93 93
 
94 94
 	include_spip('inc/documents');
95 95
 	$erreur = '';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$tmp_name = false;
107 107
 		if (file_exists($source)) {
108 108
 			$tmp_name = $source;
109
-		} elseif (file_exists($f = determine_upload() . $source)) {
109
+		} elseif (file_exists($f = determine_upload().$source)) {
110 110
 			$tmp_name = $f;
111 111
 		}
112 112
 		if (!$tmp_name) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 	if (!is_numeric($id_document)) {
144 144
 		$erreur = ($id_document ?: 'Erreur inconnue');
145
-		spip_log("Erreur ajout logo : $erreur pour source=" . json_encode($source, JSON_THROW_ON_ERROR), 'logo');
145
+		spip_log("Erreur ajout logo : $erreur pour source=".json_encode($source, JSON_THROW_ON_ERROR), 'logo');
146 146
 		return $erreur;
147 147
 	}
148 148
 
@@ -175,23 +175,23 @@  discard block
 block discarded – undo
175 175
 	$GLOBALS['meta']['articles_modif'] = 'non';
176 176
 
177 177
 	foreach (['on', 'off'] as $mode) {
178
-		$nom_base = $type . $mode;
178
+		$nom_base = $type.$mode;
179 179
 		$dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG);
180 180
 
181
-		$files = glob($dir . $nom_base . '*');
181
+		$files = glob($dir.$nom_base.'*');
182 182
 		// est-ce que c'est une nouvelle tentative de migration ?
183 183
 		// dans ce cas les logos sont deja dans IMG/logo/
184 184
 		if (!(is_countable($files) ? count($files) : 0)) {
185
-			$files = glob($dir_logos . $nom_base . '*');
185
+			$files = glob($dir_logos.$nom_base.'*');
186 186
 			if (is_countable($files) ? count($files) : 0) {
187 187
 				// mais il faut verifier si ils ont pas deja ete migres pour tout ou partie
188 188
 				$filescheck = [];
189 189
 				foreach ($files as $file) {
190
-					$short = basename(dirname($file)) . DIRECTORY_SEPARATOR . basename($file);
190
+					$short = basename(dirname($file)).DIRECTORY_SEPARATOR.basename($file);
191 191
 					$filescheck[$short] = $file;
192 192
 				}
193 193
 				// trouver ceux deja migres
194
-				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck)) . " AND mode LIKE 'logo%'");
194
+				$deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck))." AND mode LIKE 'logo%'");
195 195
 				if (is_countable($deja) ? count($deja) : 0) {
196 196
 					$deja = array_column($deja, 'fichier');
197 197
 					$restant = array_diff(array_keys($filescheck), $deja);
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
 			}
211 211
 		}
212 212
 
213
-		spip_log("logo_migrer_en_base $objet $mode : " . (is_countable($files) ? count($files) : 0) . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE);
213
+		spip_log("logo_migrer_en_base $objet $mode : ".(is_countable($files) ? count($files) : 0).' logos restant', 'maj'._LOG_INFO_IMPORTANTE);
214 214
 
215 215
 		$deja = [];
216 216
 		foreach ($files as $file) {
217
-			$logo = substr($file, strlen($dir . $nom_base));
217
+			$logo = substr($file, strlen($dir.$nom_base));
218 218
 			$logo = explode('.', $logo);
219 219
 			if (
220 220
 				is_numeric($logo[0])
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
 					// if no logo in base
226 226
 					if (!$logo or (is_countable($logo) ? count($logo) : 0) < 6) {
227 227
 						foreach ($formats_logos as $format) {
228
-							if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) {
228
+							if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) {
229 229
 								if (isset($desc['field']['date_modif'])) {
230 230
 									$date_modif = sql_getfetsel('date_modif', $table, "$_id_objet=$id_objet");
231 231
 								} else {
232 232
 									$date_modif = null;
233 233
 								}
234 234
 								// logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre
235
-								@rename($d, $dir_logos . $nom);
235
+								@rename($d, $dir_logos.$nom);
236 236
 								// et on le declare comme nouveau logo
237
-								logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom);
237
+								logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom);
238 238
 								if ($date_modif) {
239 239
 									sql_updateq($table, ['date_modif' => $date_modif], "$_id_objet=$id_objet");
240 240
 								}
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			// si le fichier est encore la on le move : rien a faire ici
249 249
 			// (sauf si c'est une re-migration : il est deja dans logo/ donc il bouge pas)
250 250
 			if ($dir !== $dir_logos and file_exists($file)) {
251
-				@rename($file, $dir_logos_erreurs . basename($file));
251
+				@rename($file, $dir_logos_erreurs.basename($file));
252 252
 			}
253 253
 
254 254
 			if ($time_limit and time() > $time_limit) {
Please login to merge, or discard this patch.
prive/objets/liste/auteurs_fonctions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 				and (
104 104
 					$newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur'])
105 105
 				));
106
-			$res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . "</li>";
106
+			$res[] = "<li class='pagination-item'>".lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination')."</li>";
107 107
 		}
108 108
 		if ($initiale) {
109 109
 			$memo = [
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 	if (!$initiale and !$url) {
118 118
 		if ((is_countable($res) ? count($res) : 0) > 1) {
119
-			$out = "<ul class='pagination-items'>" . implode(' ', $res) . "</ul>";
119
+			$out = "<ul class='pagination-items'>".implode(' ', $res)."</ul>";
120 120
 		}
121 121
 		$memo = null;
122 122
 		$res = [];
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	) {
158 158
 		return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self());
159 159
 	} elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) {
160
-		return 'mailto:' . $email;
160
+		return 'mailto:'.$email;
161 161
 	} else {
162 162
 		return '';
163 163
 	}
Please login to merge, or discard this patch.