Completed
Push — master ( a89a62...abdc2a )
by cam
01:31
created
ecrire/inc/distant.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	define('_INC_DISTANT_CONTENT_ENCODING', 'gzip');
29 29
 }
30 30
 if (!defined('_INC_DISTANT_USER_AGENT')) {
31
-	define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')');
31
+	define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')');
32 32
 }
33 33
 if (!defined('_INC_DISTANT_MAX_SIZE')) {
34 34
 	define('_INC_DISTANT_MAX_SIZE', 2_097_152);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	define('_INC_DISTANT_CONNECT_TIMEOUT', 10);
38 38
 }
39 39
 
40
-define('_REGEXP_COPIE_LOCALE', ',' 	.
40
+define('_REGEXP_COPIE_LOCALE', ','.
41 41
 	preg_replace(
42 42
 		'@^https?:@',
43 43
 		'https?:',
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 	// si c'est la protection de soi-meme, retourner le path
76 76
 	if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) {
77
-		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]);
77
+		$source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]);
78 78
 
79 79
 		return @file_exists($source) ? $source : false;
80 80
 	}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		return false;
95 95
 	}
96 96
 
97
-	$localrac = _DIR_RACINE . $local;
97
+	$localrac = _DIR_RACINE.$local;
98 98
 	$t = ($mode === 'force') ? false : @file_exists($localrac);
99 99
 
100 100
 	// test d'existence du fichier
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 		if (!$taille_max) {
115 115
 			$taille_max = _COPIE_LOCALE_MAX_SIZE;
116 116
 		}
117
-		$localrac_tmp = $localrac . '.tmp';
117
+		$localrac_tmp = $localrac.'.tmp';
118 118
 		$res = recuperer_url(
119 119
 			$source,
120 120
 			['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '']
121 121
 		);
122 122
 
123 123
 		if (!$res or (!$res['length'] and $res['status'] != 304)) {
124
-			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE);
124
+			spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE);
125 125
 			@unlink($localrac_tmp);
126 126
 		}
127 127
 		else {
128
-			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant');
128
+			spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant');
129 129
 		}
130 130
 		if (!$res or !$res['length']) {
131 131
 			// si $t c'est sans doute juste un not-modified-since
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			and is_callable($callback_valider_url)
139 139
 			and !$callback_valider_url($res['url'])
140 140
 		) {
141
-			spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE);
141
+			spip_log('copie_locale : url finale '.$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE);
142 142
 			@unlink($localrac_tmp);
143 143
 			return $t ? $local : false;
144 144
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 	if (!$is_known_host) {
231 231
 		$host = trim($parsed_url['host'], '.');
232
-		if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) {
232
+		if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) {
233 233
 			$ip = gethostbyname($host);
234 234
 			if ($ip === $host) {
235 235
 				// Error condition for gethostbyname()
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			}
251 251
 		}
252 252
 		if ($ip) {
253
-			if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
253
+			if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
254 254
 				return false;
255 255
 			}
256 256
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	}
262 262
 
263 263
 	$port = $parsed_url['port'];
264
-	if ($port === 80  or $port === 443  or $port === 8080) {
264
+	if ($port === 80 or $port === 443 or $port === 8080) {
265 265
 		return $url;
266 266
 	}
267 267
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 				}
332 332
 			}
333 333
 			if ($taille > 500) {
334
-				$boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8);
334
+				$boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8);
335 335
 			}
336 336
 		}
337 337
 
@@ -359,16 +359,16 @@  discard block
 block discarded – undo
359 359
 			}
360 360
 		} else {
361 361
 			// fabrique une chaine HTTP simple pour un POST
362
-			$entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
362
+			$entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n";
363 363
 			$chaine = [];
364 364
 			if (is_array($donnees)) {
365 365
 				foreach ($donnees as $cle => $valeur) {
366 366
 					if (is_array($valeur)) {
367 367
 						foreach ($valeur as $val2) {
368
-							$chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2);
368
+							$chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2);
369 369
 						}
370 370
 					} else {
371
-						$chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur);
371
+						$chaine[] = rawurlencode($cle).'='.rawurlencode($valeur);
372 372
 					}
373 373
 				}
374 374
 				$chaine = implode('&', $chaine);
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
 		$options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE;
470 470
 	}
471 471
 
472
-	spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
472
+	spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
473 473
 
474 474
 	// Ajout des en-têtes spécifiques si besoin
475 475
 	$formatted_data = '';
476 476
 	if (!empty($options['headers'])) {
477 477
 		foreach ($options['headers'] as $champ => $valeur) {
478
-			$formatted_data .= $champ . ': ' . $valeur . "\r\n";
478
+			$formatted_data .= $champ.': '.$valeur."\r\n";
479 479
 		}
480 480
 	}
481 481
 
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
 		[$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']);
484 484
 		$head .= $formatted_data;
485 485
 		if (stripos($head, 'Content-Length:') === false) {
486
-			$head .= 'Content-Length: ' . strlen($postdata) . "\r\n";
486
+			$head .= 'Content-Length: '.strlen($postdata)."\r\n";
487 487
 		}
488
-		$formatted_data = $head . "\r\n" . $postdata;
488
+		$formatted_data = $head."\r\n".$postdata;
489 489
 		if (
490 490
 			strlen($postdata)
491 491
 			and !$methode_demandee
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	// Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole
500 500
 	$url = preg_replace(',^feed://,i', 'http://', $url);
501 501
 	if (!tester_url_absolue($url)) {
502
-		$url = 'http://' . $url;
502
+		$url = 'http://'.$url;
503 503
 	} elseif (strncmp($url, '//', 2) == 0) {
504
-		$url = 'http:' . $url;
504
+		$url = 'http:'.$url;
505 505
 	}
506 506
 
507 507
 	$url = url_to_ascii($url);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 		$options['if_modified_since']
531 531
 	);
532 532
 	if (!$handle) {
533
-		spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR);
533
+		spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR);
534 534
 
535 535
 		return false;
536 536
 	}
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 					'status' => 200,
561 561
 				];
562 562
 			} else {
563
-				spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR);
563
+				spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR);
564 564
 				return false;
565 565
 			}
566 566
 		} elseif ($res['location'] and $options['follow_location']) {
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 					$options['datas'] = '';
577 577
 				}
578 578
 			}
579
-			spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG);
579
+			spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG);
580 580
 
581 581
 			return recuperer_url($url, $options);
582 582
 		} elseif ($res['status'] !== 200) {
583
-			spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant');
583
+			spip_log('HTTP status '.$res['status']." pour $url", 'distant');
584 584
 		}
585 585
 		$result['status'] = $res['status'];
586 586
 		if (isset($res['headers'])) {
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 	// on ne veut que les entetes
598 598
 	if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') {
599
-		spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG);
599
+		spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG);
600 600
 		return $result;
601 601
 	}
602 602
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 	$gz = false;
608 608
 	if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) {
609
-		$gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz');
609
+		$gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz');
610 610
 	}
611 611
 
612 612
 	// si on a pas deja recuperer le contenu par une methode detournee
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 
643 643
 	$trace = json_decode(json_encode($result), true);
644 644
 	$trace['page'] = '...';
645
-	spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG);
645
+	spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG);
646 646
 
647 647
 	return $result;
648 648
 }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	$sig['url'] = $url;
697 697
 
698 698
 	$dir = sous_repertoire(_DIR_CACHE, 'curl');
699
-	$cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80);
699
+	$cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80);
700 700
 	$sub = sous_repertoire($dir, substr($cache, 0, 2));
701 701
 	$cache = "$sub$cache";
702 702
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	$fp = false;
751 751
 	if ($fichier) {
752 752
 		include_spip('inc/acces');
753
-		$tmpfile = "$fichier." . creer_uniqid() . '.tmp';
753
+		$tmpfile = "$fichier.".creer_uniqid().'.tmp';
754 754
 		$fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX);
755 755
 		if (!$fp and file_exists($fichier)) {
756 756
 			return filesize($fichier);
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	}
810 810
 	$result['status'] = intval($r[1]);
811 811
 	while ($s = trim(fgets($handle, 16384))) {
812
-		$result['headers'][] = $s . "\n";
812
+		$result['headers'][] = $s."\n";
813 813
 		preg_match(',^([^:]*): *(.*)$,i', $s, $r);
814 814
 		[, $d, $v] = $r;
815 815
 		if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) {
@@ -858,13 +858,13 @@  discard block
 block discarded – undo
858 858
 
859 859
 	// on se place tout le temps comme si on etait a la racine
860 860
 	if (_DIR_RACINE) {
861
-		$d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d);
861
+		$d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d);
862 862
 	}
863 863
 
864 864
 	$m = md5($source);
865 865
 
866 866
 	return $d
867
-	. substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12)
867
+	. substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12)
868 868
 	. substr($m, 0, 4)
869 869
 	. ".$extension";
870 870
 }
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 	// Si c'est deja local pas de souci
889 889
 	if (!tester_url_absolue($source)) {
890 890
 		if (_DIR_RACINE) {
891
-			$source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source);
891
+			$source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source);
892 892
 		}
893 893
 
894 894
 		return $source;
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 		$ext
907 907
 		and preg_match(',^\w+$,', $ext) // pas de php?truc=1&...
908 908
 		and $f = nom_fichier_copie_locale($source, $ext)
909
-		and file_exists(_DIR_RACINE . $f)
909
+		and file_exists(_DIR_RACINE.$f)
910 910
 	) {
911 911
 		return $f;
912 912
 	}
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 
915 915
 	// Si c'est deja dans la table des documents,
916 916
 	// ramener le nom de sa copie potentielle
917
-	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''");
917
+	$ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''");
918 918
 
919 919
 	if ($ext) {
920 920
 		return nom_fichier_copie_locale($source, $ext);
@@ -925,9 +925,9 @@  discard block
 block discarded – undo
925 925
 
926 926
 	$ext = $path_parts ? $path_parts['extension'] : '';
927 927
 
928
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
928
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
929 929
 		$f = nom_fichier_copie_locale($source, $ext);
930
-		if (file_exists(_DIR_RACINE . $f)) {
930
+		if (file_exists(_DIR_RACINE.$f)) {
931 931
 			return $f;
932 932
 		}
933 933
 	}
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	// Ping  pour voir si son extension est connue et autorisee
936 936
 	// avec mise en cache du resultat du ping
937 937
 
938
-	$cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source);
938
+	$cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source);
939 939
 	if (
940 940
 		!@file_exists($cache)
941 941
 		or !$path_parts = @unserialize(spip_file_get_contents($cache))
@@ -945,11 +945,11 @@  discard block
 block discarded – undo
945 945
 		ecrire_fichier($cache, serialize($path_parts));
946 946
 	}
947 947
 	$ext = !empty($path_parts['extension']) ? $path_parts['extension'] : '';
948
-	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) {
948
+	if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) {
949 949
 		return nom_fichier_copie_locale($source, $ext);
950 950
 	}
951 951
 
952
-	spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR);
952
+	spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR);
953 953
 	return null;
954 954
 }
955 955
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 		} else {
1049 1049
 			if ($a['body']) {
1050 1050
 				$a['extension'] = $extension;
1051
-				$a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension);
1051
+				$a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension);
1052 1052
 				ecrire_fichier($a['fichier'], $a['body']);
1053 1053
 				$size_image = @spip_getimagesize($a['fichier']);
1054 1054
 				$a['largeur'] = intval($size_image[0]);
@@ -1116,20 +1116,20 @@  discard block
 block discarded – undo
1116 1116
 			!$t
1117 1117
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1118 1118
 		) {
1119
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1119
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1120 1120
 		}
1121 1121
 		if (
1122 1122
 			!$t
1123 1123
 			and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m)
1124 1124
 			and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext)
1125 1125
 		) {
1126
-			$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1126
+			$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1127 1127
 		}
1128 1128
 	}
1129 1129
 
1130 1130
 	// Autre mime/type (ou text/plain avec fichier d'extension inconnue)
1131 1131
 	if (!$t) {
1132
-		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type));
1132
+		$t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type));
1133 1133
 	}
1134 1134
 
1135 1135
 	// Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg)
@@ -1140,11 +1140,11 @@  discard block
 block discarded – undo
1140 1140
 		and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext)
1141 1141
 	) {
1142 1142
 		# eviter xxx.3 => 3gp (> SPIP 3)
1143
-		$t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text'));
1143
+		$t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text'));
1144 1144
 	}
1145 1145
 
1146 1146
 	if ($t) {
1147
-		spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant');
1147
+		spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant');
1148 1148
 		return $t['extension'];
1149 1149
 	} else {
1150 1150
 		# par defaut on retombe sur '.bin' si c'est autorise
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 		}
1248 1248
 	} else {
1249 1249
 		$scheme = $t['scheme'];
1250
-		$noproxy = $scheme . '://';
1250
+		$noproxy = $scheme.'://';
1251 1251
 	}
1252 1252
 	if (isset($t['user'])) {
1253 1253
 		$user = [$t['user'], $t['pass']];
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 	}
1262 1262
 
1263 1263
 	if (!empty($t['query'])) {
1264
-		$path .= '?' . $t['query'];
1264
+		$path .= '?'.$t['query'];
1265 1265
 	}
1266 1266
 
1267 1267
 	$f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date);
@@ -1335,29 +1335,29 @@  discard block
 block discarded – undo
1335 1335
 	$proxy_user = '';
1336 1336
 	$http_proxy = need_proxy($host);
1337 1337
 	if ($user) {
1338
-		$user = urlencode($user[0]) . ':' . urlencode($user[1]);
1338
+		$user = urlencode($user[0]).':'.urlencode($user[1]);
1339 1339
 	}
1340 1340
 
1341 1341
 	$connect = '';
1342 1342
 	if ($http_proxy) {
1343
-		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) {
1344
-			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
1345
-			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
1343
+		if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) {
1344
+			$path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : '');
1345
+			$connect = 'CONNECT '.$path_host." $vers\r\n"
1346 1346
 				. "Host: $path_host\r\n"
1347 1347
 				. "Proxy-Connection: Keep-Alive\r\n";
1348 1348
 		} else {
1349
-			$path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://")
1349
+			$path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://")
1350 1350
 				. (!$user ? '' : "$user@")
1351
-				. "$host" . (($port != 80) ? ":$port" : '') . $path;
1351
+				. "$host".(($port != 80) ? ":$port" : '').$path;
1352 1352
 		}
1353 1353
 		$t2 = @parse_url($http_proxy);
1354 1354
 		$first_host = $t2['host'];
1355 1355
 		$port = ($t2['port'] ?? null) ?: 80;
1356 1356
 		if ($t2['user'] ?? null) {
1357
-			$proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']);
1357
+			$proxy_user = base64_encode($t2['user'].':'.$t2['pass']);
1358 1358
 		}
1359 1359
 	} else {
1360
-		$first_host = $noproxy . $host;
1360
+		$first_host = $noproxy.$host;
1361 1361
 	}
1362 1362
 
1363 1363
 	if ($connect) {
@@ -1379,7 +1379,7 @@  discard block
 block discarded – undo
1379 1379
 		);
1380 1380
 		spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect');
1381 1381
 		if (!$f) {
1382
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1382
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1383 1383
 			return $errno;
1384 1384
 		}
1385 1385
 		stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT);
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 			or !count($res = explode(' ', $res))
1393 1393
 			or $res[1] !== '200'
1394 1394
 		) {
1395
-			spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE);
1395
+			spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE);
1396 1396
 			fclose($f);
1397 1397
 
1398 1398
 			return false;
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 		} while (!$f and $ntry-- and $errno !== 110 and sleep(1));
1410 1410
 		spip_log("Recuperer $path sur $first_host:$port par $f");
1411 1411
 		if (!$f) {
1412
-			spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR);
1412
+			spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR);
1413 1413
 
1414 1414
 			return $errno;
1415 1415
 		}
@@ -1419,16 +1419,16 @@  discard block
 block discarded – undo
1419 1419
 	$site = $GLOBALS['meta']['adresse_site'] ?? '';
1420 1420
 
1421 1421
 	$host_port = $host;
1422
-	if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) {
1422
+	if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) {
1423 1423
 		$host_port .= ":$port";
1424 1424
 	}
1425 1425
 	$req = "$method $path $vers\r\n"
1426 1426
 		. "Host: $host_port\r\n"
1427
-		. 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n"
1428
-		. ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n"))
1427
+		. 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n"
1428
+		. ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n"))
1429 1429
 		. (!$site ? '' : "Referer: $site/$referer\r\n")
1430
-		. (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n"))
1431
-		. (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n"))
1430
+		. (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n"))
1431
+		. (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n"))
1432 1432
 		. (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n")
1433 1433
 		. (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n");
1434 1434
 
Please login to merge, or discard this patch.
ecrire/inc/filtres_ecrire.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		// confirmation du deplacement
118 118
 		if (
119 119
 			sql_table_exists('spip_breves')
120
-			and ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . intval($id_objet)))
120
+			and ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.intval($id_objet)))
121 121
 			and ($contient_breves > 0)
122 122
 		) {
123 123
 			// FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 			);
132 132
 			$confirm .= "\n<div class='confirmer_deplacement verdana2'>"
133 133
 				. "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>"
134
-				. $scb .
134
+				. $scb.
135 135
 				"</label></div></div>\n";
136 136
 		} else {
137 137
 			$confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n";
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 	$form .= $confirm;
141 141
 	if ($actionable) {
142 142
 		if (strpos($form, '<select') !== false) {
143
-			$form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>"
144
-				. '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>'
143
+			$form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>"
144
+				. '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>'
145 145
 				. '</div>';
146 146
 		}
147
-		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form;
147
+		$form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form;
148 148
 		if ($action = charger_fonction("editer_$objet", 'action', true)) {
149 149
 			$form = generer_action_auteur(
150 150
 				"editer_$objet",
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 	include_spip('inc/presentation');
172 172
 
173
-	return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur();
173
+	return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur();
174 174
 }
175 175
 
176 176
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	if ($statut == 'nouveau') {
247 247
 		if ($attente) {
248 248
 			$statut = $attente;
249
-			$plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')';
249
+			$plus = ' ('._T('info_statut_auteur_a_confirmer').')';
250 250
 		} else {
251 251
 			return _T('info_statut_auteur_a_confirmer');
252 252
 		}
@@ -259,16 +259,16 @@  discard block
 block discarded – undo
259 259
 		'5poubelle' => _T('texte_statut_poubelle'), // bouh
260 260
 	];
261 261
 	if (isset($recom[$statut])) {
262
-		return $recom[$statut] . $plus;
262
+		return $recom[$statut].$plus;
263 263
 	}
264 264
 
265 265
 	// retrouver directement par le statut sinon
266 266
 	if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) {
267 267
 		if (isset($recom[$t])) {
268
-			return $recom[$t] . $plus;
268
+			return $recom[$t].$plus;
269 269
 		}
270 270
 
271
-		return _T($t) . $plus;
271
+		return _T($t).$plus;
272 272
 	}
273 273
 
274 274
 	// si on a pas reussi a le traduire, retournons la chaine telle quelle
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	if (!$id_rubrique and defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') and _CHOIX_RUBRIQUE_PAR_DEFAUT) {
390 390
 		$in = !(is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0)
391 391
 			? ''
392
-			: (' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']));
392
+			: (' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']));
393 393
 
394 394
 		// on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement
395 395
 		if ($objet == 'rubrique') {
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 		return '';
424 424
 	}
425 425
 
426
-	return propre('[->' . $virtuel . ']');
426
+	return propre('[->'.$virtuel.']');
427 427
 }
428 428
 
429 429
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 	$clic = http_img_pack('rss-16.png', 'RSS', '', $title);
451 451
 
452 452
 	$url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true);
453
-	return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>";
453
+	return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>";
454 454
 }
455 455
 
456 456
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 	);
527 527
 
528 528
 	if ($alertes = array_filter($alertes)) {
529
-		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" .
529
+		return "<div class='wrap-messages-alertes'><div class='messages-alertes'>".
530 530
 		join(' | ', $alertes)
531 531
 		. '</div></div>';
532 532
 	}
@@ -562,13 +562,13 @@  discard block
 block discarded – undo
562 562
  */
563 563
 function afficher_plus_info($lien, $titre = '+', $titre_lien = '') {
564 564
 	$titre = attribut_html($titre);
565
-	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>" .
566
-		http_img_pack('information-16.png', $titre) . '</a>';
565
+	$icone = "\n<a href='$lien' title='$titre' class='plus_info'>".
566
+		http_img_pack('information-16.png', $titre).'</a>';
567 567
 
568 568
 	if (!$titre_lien) {
569 569
 		return $icone;
570 570
 	} else {
571
-		return $icone . "\n<a href='$lien'>$titre_lien</a>";
571
+		return $icone."\n<a href='$lien'>$titre_lien</a>";
572 572
 	}
573 573
 }
574 574
 
Please login to merge, or discard this patch.
ecrire/inc/documents.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) {
65
-		$fichier = _DIR_IMG . $fichier;
65
+		$fichier = _DIR_IMG.$fichier;
66 66
 	}
67 67
 
68 68
 	// fichier normal
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
 			or !$r = verifier_upload_autorise($dest)
159 159
 			or (!empty($r['autozip']))
160 160
 		) {
161
-			$dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1];
161
+			$dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1];
162 162
 			break;
163 163
 		}
164 164
 		else {
165 165
 			$dest = substr($dest, 0, -strlen($m[0]));
166
-			$ext = $m[1] . '.' . $ext;
166
+			$ext = $m[1].'.'.$ext;
167 167
 		}
168 168
 	}
169 169
 
170 170
 	// Si le document "source" est deja au bon endroit, ne rien faire
171
-	if ($source == ($dir . $dest . '.' . $ext)) {
171
+	if ($source == ($dir.$dest.'.'.$ext)) {
172 172
 		return $source;
173 173
 	}
174 174
 
175 175
 	// sinon tourner jusqu'a trouver un numero correct
176 176
 	$n = 0;
177
-	while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) {
177
+	while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) {
178 178
 		;
179 179
 	}
180 180
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 function deplacer_fichier_upload($source, $dest, $move = false) {
236 236
 	// Securite
237 237
 	if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) {
238
-		$dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
238
+		$dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE)));
239 239
 	} else {
240 240
 		$dest = preg_replace(',\.\.+,', '.', $dest);
241 241
 	}
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 
318 318
 		default: /* autre */
319 319
 			if (!$msg) {
320
-				$msg = _T('pass_erreur') . ' ' . $error
321
-					. '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
320
+				$msg = _T('pass_erreur').' '.$error
321
+					. '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]');
322 322
 			}
323 323
 			break;
324 324
 	}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	include_spip('inc/minipres');
337 337
 	echo minipres(
338 338
 		$msg,
339
-		"<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>'
339
+		"<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>'
340 340
 	);
341 341
 	exit;
342 342
 }
Please login to merge, or discard this patch.
ecrire/genie/optimiser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function optimiser_caches_contextes() {
53 53
 	sous_repertoire(_DIR_CACHE, 'contextes');
54
-	if (is_dir($d = _DIR_CACHE . 'contextes')) {
54
+	if (is_dir($d = _DIR_CACHE.'contextes')) {
55 55
 		include_spip('inc/invalideur');
56 56
 		purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]);
57 57
 	}
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
 		$tables[] = array_shift($row);
97 97
 	}
98 98
 
99
-	spip_log('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG);
99
+	spip_log('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG);
100 100
 	if ($tables) {
101 101
 		$table_op = intval(lire_config('optimiser_table', 0) + 1) % sizeof($tables);
102 102
 		ecrire_config('optimiser_table', $table_op);
103 103
 		$q = $tables[$table_op];
104
-		spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie' . _LOG_DEBUG);
104
+		spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie'._LOG_DEBUG);
105 105
 		if (sql_optimize($q)) {
106
-			spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie' . _LOG_DEBUG);
106
+			spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie'._LOG_DEBUG);
107 107
 		} else {
108
-			spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie' . _LOG_DEBUG);
108
+			spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie'._LOG_DEBUG);
109 109
 		}
110 110
 	}
111 111
 }
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 	sql_free($sel);
141 141
 
142 142
 	if ($in) {
143
-		sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : ''));
144
-		spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)), 'genie' . _LOG_DEBUG);
143
+		sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : ''));
144
+		spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)), 'genie'._LOG_DEBUG);
145 145
 	}
146 146
 
147 147
 	return count($in);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) {
222 222
 		define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600);
223 223
 	}
224
-	sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - intval(_AUTEURS_DELAI_REJET_NOUVEAU))));
224
+	sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - intval(_AUTEURS_DELAI_REJET_NOUVEAU))));
225 225
 
226 226
 	/**
227 227
 	 * Permet aux plugins de compléter l'optimisation suite aux éléments disparus
@@ -242,5 +242,5 @@  discard block
 block discarded – undo
242 242
 	]);
243 243
 
244 244
 
245
-	spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie' . _LOG_DEBUG);
245
+	spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie'._LOG_DEBUG);
246 246
 }
Please login to merge, or discard this patch.
prive/formulaires/editer_logo.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
 		}
77 77
 		switch ($objet) {
78 78
 			case 'article':
79
-				$libelle .= ' ' . aider('logoart');
79
+				$libelle .= ' '.aider('logoart');
80 80
 				break;
81 81
 			case 'breve':
82
-				$libelle .= ' ' . aider('breveslogo');
82
+				$libelle .= ' '.aider('breveslogo');
83 83
 				break;
84 84
 			case 'rubrique':
85
-				$libelle .= ' ' . aider('rublogo');
85
+				$libelle .= ' '.aider('rublogo');
86 86
 				break;
87 87
 			default:
88 88
 				break;
89 89
 		}
90 90
 
91
-		$options['titre'] = $img . $libelle;
91
+		$options['titre'] = $img.$libelle;
92 92
 	}
93 93
 	if (!isset($options['editable'])) {
94 94
 		include_spip('inc/autoriser');
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	foreach ($etats as $etat) {
114 114
 		$logo = $chercher_logo($id_objet, $_id_objet, $etat);
115 115
 		if ($logo) {
116
-			$res['logo_' . $etat] = $logo[0];
117
-			$res['logo_id_' . $etat] = $logo[5]['id_document'] ?? '';
116
+			$res['logo_'.$etat] = $logo[0];
117
+			$res['logo_id_'.$etat] = $logo[5]['id_document'] ?? '';
118 118
 		}
119 119
 	}
120 120
 	// pas de logo_on -> pas de formulaire pour le survol
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 					$extensions_possibles
181 181
 				)
182 182
 			) {
183
-				$erreurs['logo_' . $etat] = _L('Extension non reconnue');
183
+				$erreurs['logo_'.$etat] = _L('Extension non reconnue');
184 184
 			}
185 185
 		} elseif ($file and $file['error'] != 0 and isset($file['msg'])) {
186 186
 			$erreurs['message_erreur'] = $file['msg'];
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	include_spip('inc/documents');
266 266
 	$sources = [];
267 267
 	foreach (['on', 'off'] as $etat) {
268
-		$logo = 'logo_' . $etat;
268
+		$logo = 'logo_'.$etat;
269 269
 		if (isset($_FILES[$logo])) {
270 270
 			if ($_FILES[$logo]['error'] == 0) {
271 271
 				$sources[$etat] = $_FILES[$logo];
Please login to merge, or discard this patch.
ecrire/public/quete.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	return sql_getfetsel(
37 37
 		'virtuel',
38 38
 		'spip_articles',
39
-		['id_article=' . intval($id_article), "statut='publie'"],
39
+		['id_article='.intval($id_article), "statut='publie'"],
40 40
 		'',
41 41
 		'',
42 42
 		'',
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			$cache_quete[$connect][$table][$id] = sql_fetsel(
82 82
 				$cache_quete[$connect][$table]['_select'],
83 83
 				$table,
84
-				$cache_quete[$connect][$table]['_id'] . '=' . intval($id),
84
+				$cache_quete[$connect][$table]['_id'].'='.intval($id),
85 85
 				'',
86 86
 				'',
87 87
 				'',
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	return
174 174
 		(isset($GLOBALS['meta']['date_prochain_postdate'])
175 175
 			and $GLOBALS['meta']['date_prochain_postdate'] > time())
176
-			? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur)
176
+			? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur)
177 177
 			: '1=1';
178 178
 }
179 179
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 				and $id_table = reset($objet)
233 233
 				and $objet = objet_type($id_table)
234 234
 			) {
235
-				$w = "$mstatut<>" . sql_quote($v);
235
+				$w = "$mstatut<>".sql_quote($v);
236 236
 
237 237
 				// retrouver l’id_auteur qui a filé un lien de prévisu éventuellement,
238 238
 				// sinon l’auteur en session
@@ -246,22 +246,22 @@  discard block
 block discarded – undo
246 246
 				}
247 247
 
248 248
 				// dans ce cas (admin en general), pas de filtrage sur ce statut
249
-				if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) {
249
+				if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) {
250 250
 					// si pas d'auteur identifie pas de sous-requete car pas d'article qui matche
251 251
 					if (!$id_auteur) {
252 252
 						$where[] = $w;
253 253
 					} else {
254 254
 						$primary = id_table_objet($objet);
255
-						$where[] = "($w OR $id_table.$primary IN (" . sql_get_select(
255
+						$where[] = "($w OR $id_table.$primary IN (".sql_get_select(
256 256
 							'ssss.id_objet',
257 257
 							'spip_auteurs_liens AS ssss',
258
-							'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur),
258
+							'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.intval($id_auteur),
259 259
 							'',
260 260
 							'',
261 261
 							'',
262 262
 							'',
263 263
 							$serveur
264
-						) . '))';
264
+						).'))';
265 265
 					}
266 266
 				}
267 267
 			} // ignorer ce statut si on ne sait pas comment le filtrer
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
  * @return array|bool|null
300 300
  */
301 301
 function quete_fichier($id_document, $serveur = '') {
302
-	return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur);
302
+	return sql_getfetsel('fichier', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur);
303 303
 }
304 304
 
305 305
 /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
  * @return array|bool
311 311
  */
312 312
 function quete_document($id_document, $serveur = '') {
313
-	return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur);
313
+	return sql_fetsel('*', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur);
314 314
 }
315 315
 
316 316
 /**
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
  * @return array|bool|null
322 322
  */
323 323
 function quete_meta($nom, $serveur) {
324
-	return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur);
324
+	return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur);
325 325
 }
326 326
 
327 327
 /**
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
 				// qui permet de distinguer le changement de logo
378 378
 				// et placer un expire sur le dossier IMG/
379 379
 				$res = [
380
-					$on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''),
381
-					($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''),
382
-					(!$taille ? '' : (' ' . $taille[3]))
380
+					$on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''),
381
+					($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''),
382
+					(!$taille ? '' : (' '.$taille[3]))
383 383
 				];
384 384
 				$res['src'] = $res[0];
385 385
 				$res['logo_on'] = $res[0];
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	if (
490 490
 		strcmp($logo, _DIR_PLUGINS) == 0
491 491
 		or strcmp($logo, _DIR_PLUGINS_DIST) == 0
492
-		or strcmp($logo, _DIR_RACINE . 'prive/') == 0
492
+		or strcmp($logo, _DIR_RACINE.'prive/') == 0
493 493
 	) {
494 494
 		return $logo;
495 495
 	}
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 
561 561
 	foreach (['titre', 'descriptif', 'credits', 'alt'] as $champ) {
562 562
 		if (!empty($contexte[$champ])) {
563
-			$contexte[$champ] = appliquer_traitement_champ($contexte[$champ] , $champ, 'document');
563
+			$contexte[$champ] = appliquer_traitement_champ($contexte[$champ], $champ, 'document');
564 564
 		}
565 565
 	}
566 566
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 				$exposer[$m][$type][$principal] = true;
668 668
 				if ($type == 'id_mot') {
669 669
 					if (!$parent) {
670
-						$parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect);
670
+						$parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.intval($principal), '', '', '', '', $connect);
671 671
 					}
672 672
 					if ($parent) {
673 673
 						$exposer[$m]['id_groupe'][$parent] = true;
Please login to merge, or discard this patch.
ecrire/balise/id_logo_.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,5 +132,5 @@
 block discarded – undo
132 132
 
133 133
 	$align = preg_replace(',\W,', '', $align);
134 134
 
135
-	return "quete_html_logo($code, '$align', " . ($_lien ?: "''") . ')';
135
+	return "quete_html_logo($code, '$align', ".($_lien ?: "''").')';
136 136
 }
Please login to merge, or discard this patch.
ecrire/balise/logo_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		if ($fichier) {
111 111
 			$code = "quete_logo_file($doc, $qconnect)";
112 112
 		} else {
113
-			$code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
113
+			$code = "quete_logo_document($doc, ".($lien ?: "''").", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
114 114
 		}
115 115
 		// (x=non-faux ? y : '') pour affecter x en retournant y
116 116
 		if ($p->descr['documents']) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
 	// demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
135 135
 	if ($coord_x or $coord_y) {
136
-		$code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
136
+		$code = "filtrer('image_graver',filtrer('image_reduire',".$code.", '$coord_x', '$coord_y'))";
137 137
 	}
138 138
 
139 139
 	$p->code = $code;
Please login to merge, or discard this patch.
ecrire/inc/livrer_fichier.php 1 patch
Spacing   +7 added lines, -7 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,12 +72,12 @@  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 ($fs = stat($fichier)
78 78
 	  and !empty($fs['size'])
79 79
 	  and !empty($fs['mtime'])) {
80
-		header("Last-Modified: " . gmdate("D, d M Y H:i:s", $fs['mtime']) . " GMT");
80
+		header("Last-Modified: ".gmdate("D, d M Y H:i:s", $fs['mtime'])." GMT");
81 81
 		header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, "0")));
82 82
 	}
83 83
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	else {
98 98
 		$f = basename($fichier);
99 99
 		header("Content-Disposition: inline; filename=\"$f\";");
100
-		header('Expires: ' . $expires); // set expiration time
100
+		header('Expires: '.$expires); // set expiration time
101 101
 	}
102 102
 }
103 103
 
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
 	// Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451"
150 150
 	if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) {
151 151
 		### Offset signifies where we should begin to read the file
152
-		$byteOffset = (int)$match[1];
152
+		$byteOffset = (int) $match[1];
153 153
 
154 154
 
155 155
 		### Length is for how long we should read the file according to the browser, and can never go beyond the file size
156 156
 		if (isset($match[2])) {
157
-			$finishBytes = (int)$match[2];
157
+			$finishBytes = (int) $match[2];
158 158
 			$byteLength = $finishBytes + 1;
159 159
 		} else {
160 160
 			$finishBytes = $fileSize - 1;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 	// partial content
177 177
 	header('HTTP/1.1 206 Partial content');
178
-	header($cr_header);  ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
178
+	header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
179 179
 
180 180
 
181 181
 	$byteRange = $byteLength - $byteOffset;
Please login to merge, or discard this patch.