Completed
Push — master ( cf7d21...76fe48 )
by cam
04:09
created
ecrire/public/compiler.php 1 patch
Spacing   +115 added lines, -123 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				preg_match(",^([^=]*)(=?)(.*)$,m", $var->texte, $m);
98 98
 				$m = array_pad($m, 3, null);
99 99
 				$var = $m[1];
100
-				$auto = false;;
100
+				$auto = false; ;
101 101
 				if ($m[2]) {
102 102
 					$v = $m[3];
103 103
 					if (preg_match(',^[\'"](.*)[\'"]$,', $v, $m)) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 						: calculer_liste($val, $p->descr, $boucles, $id_boucle);
122 122
 					if ($var !== 1) {
123 123
 						$val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ")
124
-							. $val . ($echap ? ") . '" : " ");
124
+							. $val.($echap ? ") . '" : " ");
125 125
 					} else {
126 126
 						$val = $echap ? "'.$val.'" : $val;
127 127
 					}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (!$lang) {
143 143
 		$lang = '$GLOBALS["spip_lang"]';
144 144
 	}
145
-	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : " ");
145
+	$l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : " ");
146 146
 
147 147
 	return $l;
148 148
 }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	$_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true);
172 172
 	if (is_string($p->texte)) {
173 173
 		$fichier = $p->texte;
174
-		$code = "\"".str_replace('"','\"',$fichier)."\"";
174
+		$code = "\"".str_replace('"', '\"', $fichier)."\"";
175 175
 
176 176
 	} else {
177 177
 		$code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$trace = $p->fonctions;
186 186
 		while (is_array($trace)
187 187
 		  and $trace = array_filter($trace)
188
-			and count($trace)==1) {
188
+			and count($trace) == 1) {
189 189
 			$trace = reset($trace);
190 190
 		}
191 191
 		$erreur_p_i_i = array(
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		return false;
220 220
 	} // j'aurais voulu toucher le fond ...
221 221
 
222
-	$contexte = 'array(' . $_contexte . ')';
222
+	$contexte = 'array('.$_contexte.')';
223 223
 
224 224
 	if ($env) {
225 225
 		$contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)";
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 			$_options[] = $ajax;
235 235
 		}
236 236
 		$code = " ' . argumenter_squelette($code) . '";
237
-		$code = "echo " . sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
-				"_request(\"connect\")") . ';';
237
+		$code = "echo ".sprintf(CODE_RECUPERER_FOND, $code, $contexte, implode(',', $_options),
238
+				"_request(\"connect\")").';';
239 239
 	}
240 240
 
241
-	return "\n'<'.'" . "?php " . $code . "\n?'." . "'>'";
241
+	return "\n'<'.'"."?php ".$code."\n?'."."'>'";
242 242
 }
243 243
 
244 244
 
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
 					$id = $id_table;
319 319
 					$statut = preg_replace(',\W,', '', $s['champ']); // securite
320 320
 				}
321
-				$mstatut = $id . '.' . $statut;
321
+				$mstatut = $id.'.'.$statut;
322 322
 
323 323
 				$arg_ignore_previsu = ($ignore_previsu ? ",true" : '');
324 324
 				include_spip('public/quete');
325 325
 				if (isset($s['post_date']) and $s['post_date']
326 326
 					and $GLOBALS['meta']["post_dates"] == 'non'
327 327
 				) {
328
-					$date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite
328
+					$date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite
329 329
 					array_unshift($boucle->where,
330 330
 						$echapper ?
331
-							"\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
331
+							"\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)"
332 332
 							:
333 333
 							quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu)
334 334
 					);
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
 				array_unshift($boucle->where,
337 337
 					$echapper ?
338 338
 						"\nquete_condition_statut('$mstatut',"
339
-						. _q($s['previsu']) . ","
340
-						. _q($s['publie']) . ","
341
-						. _q($boucle->sql_serveur) . "$arg_ignore_previsu)"
339
+						. _q($s['previsu']).","
340
+						. _q($s['publie']).","
341
+						. _q($boucle->sql_serveur)."$arg_ignore_previsu)"
342 342
 						:
343 343
 						quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu)
344 344
 				);
@@ -372,14 +372,14 @@  discard block
 block discarded – undo
372 372
 	if (_request('var_mode_affiche') != 'resultat') {
373 373
 		$trace = '';
374 374
 	} else {
375
-		$_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;
375
+		$_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle;
376 376
 		$_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']";
377 377
 		$trace = "
378 378
 		if (empty($_trace)) { 
379 379
 			$_trace = []; 
380 380
 		}
381 381
 		if (count($_trace) < 3) { 
382
-			$_trace" . "[] = \$t0; 
382
+			$_trace"."[] = \$t0; 
383 383
 		}";
384 384
 	}
385 385
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 	return
414 414
 		// Numrows[$nom] peut ne pas être encore defini
415 415
 		"\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());"
416
-		. "\n\t\$t0 = " . $boucles[$id_boucle]->return . ";"
416
+		. "\n\t\$t0 = ".$boucles[$id_boucle]->return.";"
417 417
 		. "\n\t\$Numrows['$nom'] = (\$save_numrows);"
418 418
 		. $trace
419 419
 		. "\n\treturn \$t0;";
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	// faudrait expanser le foreach a la compil, car y en a souvent qu'un 
482 482
 	// et puis faire un [] plutot qu'un "','."
483 483
 	if ($boucle->doublons) {
484
-		$corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' .
484
+		$corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '.
485 485
 			index_pile($id_boucle, $primary, $boucles)
486 486
 			. "; // doublons\n";
487 487
 	}
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
 		$corps .=
509 509
 			"\n\t\tlang_select_public("
510 510
 			. index_pile($id_boucle, 'lang', $boucles)
511
-			. ", '" . $boucle->lang_select . "'"
511
+			. ", '".$boucle->lang_select."'"
512 512
 			. (in_array($type_boucle, array(
513 513
 				'articles',
514 514
 				'rubriques',
515 515
 				'hierarchie',
516 516
 				'breves'
517
-			)) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '')
517
+			)) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '')
518 518
 			. ');';
519 519
 	} else {
520 520
 		$init_lang = '';
@@ -535,26 +535,22 @@  discard block
 block discarded – undo
535 535
 
536 536
 	// gestion optimale des separateurs et des boucles constantes
537 537
 	if (count($boucle->separateur)) {
538
-		$code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'");
538
+		$code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'");
539 539
 	}
540 540
 
541 541
 	$corps .=
542 542
 		((!$boucle->separateur) ?
543
-			(($constant && !$corps && !$flag_cpt) ? $return :
544
-				(($return === "''") ? '' :
545
-					("\n\t\t" . '$t0 .= ' . $return . ";"))) :
546
-			("\n\t\t\$t1 " .
543
+			(($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.";"))) : ("\n\t\t\$t1 ".
547 544
 				((strpos($return, '$t1.') === 0) ?
548
-					(".=" . substr($return, 4)) :
549
-					('= ' . $return)) .
550
-				";\n\t\t" .
551
-				'$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;"));
545
+					(".=".substr($return, 4)) : ('= '.$return)).
546
+				";\n\t\t".
547
+				'$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;"));
552 548
 
553 549
 	// Calculer les invalideurs si c'est une boucle non constante et si on
554 550
 	// souhaite invalider ces elements
555 551
 	if (!$constant and $primary) {
556 552
 		include_spip('inc/invalideur');
557
-		$corps = calcul_invalideurs($corps, $primary,$boucles, $id_boucle);
553
+		$corps = calcul_invalideurs($corps, $primary, $boucles, $id_boucle);
558 554
 	}
559 555
 
560 556
 	// gerer le compteur de boucle 
@@ -629,7 +625,7 @@  discard block
 block discarded – undo
629 625
 		$corps,
630 626
 		$fin_lang,
631 627
 		$trace,
632
-		'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile'])
628
+		'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile'])
633 629
 	);
634 630
 
635 631
 #	var_dump($a);exit;
@@ -650,20 +646,20 @@  discard block
 block discarded – undo
650 646
  **/
651 647
 function calculer_requete_sql($boucle) {
652 648
 	$init = array();
653
-	$init[] = calculer_dec('table', "'" . $boucle->id_table . "'");
654
-	$init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'");
649
+	$init[] = calculer_dec('table', "'".$boucle->id_table."'");
650
+	$init[] = calculer_dec('id', "'".$boucle->id_boucle."'");
655 651
 	# En absence de champ c'est un decompte :
656 652
 	$init[] = calculer_dec('from', calculer_from($boucle));
657 653
 	$init[] = calculer_dec('type', calculer_from_type($boucle));
658 654
 	$init[] = calculer_dec('groupby',
659
-		'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ")");
660
-	$init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . "\")");
661
-	$init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ")");
655
+		'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').")");
656
+	$init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select)."\")");
657
+	$init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).")");
662 658
 	$init[] = calculer_dec('where', calculer_dump_array($boucle->where));
663 659
 	$init[] = calculer_dec('join', calculer_dump_join($boucle->join));
664 660
 	$init[] = calculer_dec('limit',
665 661
 		(strpos($boucle->limit, 'intval') === false ?
666
-			"'" . $boucle->limit . "'"
662
+			"'".$boucle->limit."'"
667 663
 			:
668 664
 			$boucle->limit));
669 665
 	$init[] = calculer_dec('having', calculer_dump_array($boucle->having));
@@ -672,17 +668,17 @@  discard block
 block discarded – undo
672 668
 	// ou recalculée à chaque passage (vide)
673 669
 	foreach ($init as $i) {
674 670
 		if (reset($i)) {
675
-			$s .= "\n\t\t" . end($i);
671
+			$s .= "\n\t\t".end($i);
676 672
 		} # statique
677 673
 		else {
678
-			$d .= "\n\t" . end($i);
674
+			$d .= "\n\t".end($i);
679 675
 		} # dynamique
680 676
 	}
681 677
 
682 678
 	return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '')
683 679
 	. $boucle->in
684 680
 	. $boucle->hash
685
-	. "\n\t" . 'if (!isset($command[\'table\'])) {'
681
+	. "\n\t".'if (!isset($command[\'table\'])) {'
686 682
 	. $s
687 683
 	. "\n\t}"
688 684
 	. $d;
@@ -765,7 +761,7 @@  discard block
 block discarded – undo
765 761
  *    - index 1 : Code de l'affectation
766 762
  **/
767 763
 function calculer_dec($nom, $val) {
768
-	$static = 'if (!isset($command[\'' . $nom . '\'])) ';
764
+	$static = 'if (!isset($command[\''.$nom.'\'])) ';
769 765
 	// si une variable apparait dans le calcul de la clause
770 766
 	// il faut la re-evaluer a chaque passage
771 767
 	if (
@@ -782,7 +778,7 @@  discard block
 block discarded – undo
782 778
 		$static = "";
783 779
 	}
784 780
 
785
-	return array($static, '$command[\'' . $nom . '\'] = ' . $val . ';');
781
+	return array($static, '$command[\''.$nom.'\'] = '.$val.';');
786 782
 }
787 783
 
788 784
 /**
@@ -807,17 +803,17 @@  discard block
 block discarded – undo
807 803
 	}
808 804
 	$res = "";
809 805
 	if ($a and $a[0] == "'?'") {
810
-		return ("(" . calculer_dump_array($a[1]) .
811
-			" ? " . calculer_dump_array($a[2]) .
812
-			" : " . calculer_dump_array($a[3]) .
806
+		return ("(".calculer_dump_array($a[1]).
807
+			" ? ".calculer_dump_array($a[2]).
808
+			" : ".calculer_dump_array($a[3]).
813 809
 			")");
814 810
 	} else {
815 811
 		foreach ($a as $k => $v) {
816
-			$showk = (is_numeric($k) ? '' : sql_quote($k) . ' => ');
817
-			$res .= ", " . $showk . calculer_dump_array($v);
812
+			$showk = (is_numeric($k) ? '' : sql_quote($k).' => ');
813
+			$res .= ", ".$showk.calculer_dump_array($v);
818 814
 		}
819 815
 
820
-		return "\n\t\t\tarray(" . substr($res, 2) . ')';
816
+		return "\n\t\t\tarray(".substr($res, 2).')';
821 817
 	}
822 818
 }
823 819
 
@@ -825,10 +821,10 @@  discard block
 block discarded – undo
825 821
 function calculer_dump_join($a) {
826 822
 	$res = "";
827 823
 	foreach ($a as $k => $v) {
828
-		$res .= ", '$k' => array(" . implode(',', $v) . ")";
824
+		$res .= ", '$k' => array(".implode(',', $v).")";
829 825
 	}
830 826
 
831
-	return 'array(' . substr($res, 2) . ')';
827
+	return 'array('.substr($res, 2).')';
832 828
 }
833 829
 
834 830
 /**
@@ -845,7 +841,7 @@  discard block
 block discarded – undo
845 841
 		$res .= ",'$k' => '$v'";
846 842
 	}
847 843
 
848
-	return 'array(' . substr($res, 1) . ')';
844
+	return 'array('.substr($res, 1).')';
849 845
 }
850 846
 
851 847
 /**
@@ -863,7 +859,7 @@  discard block
 block discarded – undo
863 859
 		$res .= ",'$k' => '$v'";
864 860
 	}
865 861
 
866
-	return 'array(' . substr($res, 1) . ')';
862
+	return 'array('.substr($res, 1).')';
867 863
 }
868 864
 
869 865
 // https://code.spip.net/@calculer_order
@@ -932,17 +928,17 @@  discard block
 block discarded – undo
932 928
 				) {
933 929
 					$res .= " .\n$tab$code";
934 930
 				} else {
935
-					$res = substr($res, 0, -1) . substr($code, 1);
931
+					$res = substr($res, 0, -1).substr($code, 1);
936 932
 				}
937 933
 			}
938 934
 
939
-			return '(' . substr($res, 2 + $descr['niv']) . ')';
935
+			return '('.substr($res, 2 + $descr['niv']).')';
940 936
 		}
941 937
 	} else {
942
-		$nom = $descr['nom'] . $id_boucle . ($descr['niv'] ? $descr['niv'] : '');
938
+		$nom = $descr['nom'].$id_boucle.($descr['niv'] ? $descr['niv'] : '');
943 939
 
944
-		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join(" ,\n$tab",
945
-			$codes) . ")))";
940
+		return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join(" ,\n$tab",
941
+			$codes).")))";
946 942
 	}
947 943
 }
948 944
 
@@ -971,7 +967,7 @@  discard block
 block discarded – undo
971 967
 			// texte seul
972 968
 			case 'texte':
973 969
 				$code = sandbox_composer_texte($p->texte, $p);
974
-				$commentaire = strlen($p->texte) . " signes";
970
+				$commentaire = strlen($p->texte)." signes";
975 971
 				$avant = '';
976 972
 				$apres = '';
977 973
 				$altern = "''";
@@ -980,14 +976,14 @@  discard block
 block discarded – undo
980 976
 			case 'polyglotte':
981 977
 				$code = "";
982 978
 				foreach ($p->traductions as $k => $v) {
983
-					$code .= ",'" .
984
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $k) .
985
-						"' => '" .
986
-						str_replace(array("\\", "'"), array("\\\\", "\\'"), $v) .
979
+					$code .= ",'".
980
+						str_replace(array("\\", "'"), array("\\\\", "\\'"), $k).
981
+						"' => '".
982
+						str_replace(array("\\", "'"), array("\\\\", "\\'"), $v).
987 983
 						"'";
988 984
 				}
989
-				$code = "choisir_traduction(array(" .
990
-					substr($code, 1) .
985
+				$code = "choisir_traduction(array(".
986
+					substr($code, 1).
991 987
 					"))";
992 988
 				$commentaire = '&';
993 989
 				$avant = '';
@@ -1003,7 +999,7 @@  discard block
 block discarded – undo
1003 999
 					$err_e_c = true;
1004 1000
 					$code = "''";
1005 1001
 				} else {
1006
-					$commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>';
1002
+					$commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>';
1007 1003
 					$avant = '';
1008 1004
 					$apres = '';
1009 1005
 					$altern = "''";
@@ -1030,8 +1026,8 @@  discard block
 block discarded – undo
1030 1026
 					$err_e_c = true;
1031 1027
 					$code = "''";
1032 1028
 				} else {
1033
-					$code = 'BOUCLE' .
1034
-						str_replace("-", "_", $nom) . $descr['nom'] .
1029
+					$code = 'BOUCLE'.
1030
+						str_replace("-", "_", $nom).$descr['nom'].
1035 1031
 						'($Cache, $Pile, $doublons, $Numrows, $SP)';
1036 1032
 					$commentaire = "?$nom";
1037 1033
 					if (!$boucles[$nom]->milieu
@@ -1072,24 +1068,22 @@  discard block
 block discarded – undo
1072 1068
 				foreach ($p->arg as $k => $v) {
1073 1069
 					$_v = calculer_liste($v, $descr, $boucles, $id_boucle);
1074 1070
 					if ($k) {
1075
-						$l[] = _q($k) . ' => ' . $_v;
1071
+						$l[] = _q($k).' => '.$_v;
1076 1072
 					} else {
1077 1073
 						$code = $_v;
1078 1074
 					}
1079 1075
 				}
1080 1076
 				// Si le module n'est pas fourni, l'expliciter sauf si calculé
1081 1077
 				if ($p->module) {
1082
-					$m = $p->module . ':' . $p->nom_champ;
1078
+					$m = $p->module.':'.$p->nom_champ;
1083 1079
 				} elseif ($p->nom_champ) {
1084
-					$m = MODULES_IDIOMES . ':' . $p->nom_champ;
1080
+					$m = MODULES_IDIOMES.':'.$p->nom_champ;
1085 1081
 				} else {
1086 1082
 					$m = '';
1087 1083
 				}
1088 1084
 
1089
-				$code = (!$code ? "'$m'" :
1090
-						($m ? "'$m' . $code" :
1091
-							("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))")))
1092
-					. (!$l ? '' : (", array(" . implode(",\n", $l) . ")"));
1085
+				$code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))")))
1086
+					. (!$l ? '' : (", array(".implode(",\n", $l).")"));
1093 1087
 				$code = "_T($code)";
1094 1088
 				if ($p->param) {
1095 1089
 					$p->id_boucle = $id_boucle;
@@ -1112,7 +1106,7 @@  discard block
 block discarded – undo
1112 1106
 				$p->type_requete = $type;
1113 1107
 
1114 1108
 				$code = calculer_champ($p);
1115
-				$commentaire = '#' . $p->nom_champ . $p->etoile;
1109
+				$commentaire = '#'.$p->nom_champ.$p->etoile;
1116 1110
 				$avant = calculer_liste($p->avant,
1117 1111
 					$descr, $boucles, $id_boucle);
1118 1112
 				$apres = calculer_liste($p->apres,
@@ -1143,10 +1137,9 @@  discard block
 block discarded – undo
1143 1137
 		if ($code != "''") {
1144 1138
 			$code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']);
1145 1139
 			$codes[] = (($mode == 'validation') ?
1146
-				"array($code, '$commentaire', " . $p->ligne . ")"
1140
+				"array($code, '$commentaire', ".$p->ligne.")"
1147 1141
 				: (($mode == 'code') ?
1148
-					"\n// $commentaire\n$code" :
1149
-					$code));
1142
+					"\n// $commentaire\n$code" : $code));
1150 1143
 		}
1151 1144
 	} // foreach
1152 1145
 
@@ -1197,28 +1190,28 @@  discard block
 block discarded – undo
1197 1190
 	if ($apres === "''") {
1198 1191
 		$apres = '';
1199 1192
 	}
1200
-	if ($avant or $apres or ($altern !== "''")){
1201
-		if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)){
1193
+	if ($avant or $apres or ($altern !== "''")) {
1194
+		if (preg_match(_REGEXP_CONCAT_NON_VIDE, $code)) {
1202 1195
 			$t = $code;
1203 1196
 			$cond = '';
1204 1197
 		} elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) {
1205 1198
 			$t = $r[2];
1206
-			$cond = '!' . $r[1];
1199
+			$cond = '!'.$r[1];
1207 1200
 		} else {
1208
-			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)){
1201
+			if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) {
1209 1202
 				$t = $r[2];
1210 1203
 				$cond = $r[1];
1211 1204
 			} else {
1212
-				$t = '$t' . $n;
1205
+				$t = '$t'.$n;
1213 1206
 				$cond = "($t = $code)!==''";
1214 1207
 			}
1215 1208
 		}
1216 1209
 
1217
-		$res = (!$avant ? "" : "$avant . ") .
1218
-			$t .
1210
+		$res = (!$avant ? "" : "$avant . ").
1211
+			$t.
1219 1212
 			(!$apres ? "" : " . $apres");
1220 1213
 
1221
-		if ($res!==$t){
1214
+		if ($res !== $t) {
1222 1215
 			$res = "($res)";
1223 1216
 		}
1224 1217
 
@@ -1268,12 +1261,12 @@  discard block
 block discarded – undo
1268 1261
 
1269 1262
 	// rendre inertes les echappements de #[](){}<>
1270 1263
 	$i = 0;
1271
-	while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) {
1264
+	while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) {
1272 1265
 		$i++;
1273 1266
 	}
1274 1267
 	$squelette = preg_replace_callback(',\\\\([#[()\]{}<>]),',
1275 1268
 		function($a) use ($inerte) {
1276
-			return "$inerte-" . ord($a[1]) . '-';
1269
+			return "$inerte-".ord($a[1]).'-';
1277 1270
 		},
1278 1271
 		$squelette,
1279 1272
 		-1,
@@ -1290,7 +1283,7 @@  discard block
 block discarded – undo
1290 1283
 	// Phraser le squelette, selon sa grammaire
1291 1284
 
1292 1285
 	$boucles = array();
1293
-	$f = charger_fonction('phraser_' . $gram, 'public');
1286
+	$f = charger_fonction('phraser_'.$gram, 'public');
1294 1287
 
1295 1288
 	$squelette = $f($squelette, '', $boucles, $descr);
1296 1289
 
@@ -1309,7 +1302,7 @@  discard block
 block discarded – undo
1309 1302
 			$boucles[$i]->descr['squelette'] = preg_replace_callback(
1310 1303
 				",$inerte-(\d+)-,",
1311 1304
 				function($a) {
1312
-					return "\\\\" . chr($a[1]);
1305
+					return "\\\\".chr($a[1]);
1313 1306
 				},
1314 1307
 				$boucle->descr['squelette']
1315 1308
 			);
@@ -1321,19 +1314,19 @@  discard block
 block discarded – undo
1321 1314
 		include_spip('public/decompiler');
1322 1315
 		foreach ($boucles as $id => $boucle) {
1323 1316
 			if ($id) {
1324
-				$decomp = "\n/* BOUCLE " .
1325
-					$boucle->type_requete .
1326
-					" " .
1327
-					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) .
1328
-					($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') .
1317
+				$decomp = "\n/* BOUCLE ".
1318
+					$boucle->type_requete.
1319
+					" ".
1320
+					str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')).
1321
+					($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : '').
1329 1322
 					" */\n";
1330 1323
 			} else {
1331
-				$decomp = ("\n/*\n" .
1324
+				$decomp = ("\n/*\n".
1332 1325
 					str_replace('*/', '* /', public_decompiler($squelette, $gram))
1333 1326
 					. "\n*/");
1334 1327
 			}
1335
-			$boucles[$id]->return = $decomp . $boucle->return;
1336
-			$GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return;
1328
+			$boucles[$id]->return = $decomp.$boucle->return;
1329
+			$GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return;
1337 1330
 		}
1338 1331
 	}
1339 1332
 
@@ -1356,7 +1349,7 @@  discard block
 block discarded – undo
1356 1349
 		}
1357 1350
 	}
1358 1351
 	foreach ($boucles as $id => $boucle) {
1359
-		$GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle;
1352
+		$GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle;
1360 1353
 	}
1361 1354
 	$descr['documents'] = compile_inclure_doublons($squelette);
1362 1355
 
@@ -1440,8 +1433,7 @@  discard block
 block discarded – undo
1440 1433
 						} else {
1441 1434
 							$boucles[$id]->type_requete = false;
1442 1435
 							$boucle = $boucles[$id];
1443
-							$x = (!$boucle->sql_serveur ? '' :
1444
-									($boucle->sql_serveur . ":")) .
1436
+							$x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.":")).
1445 1437
 								$type;
1446 1438
 							$msg = array(
1447 1439
 								'zbug_table_inconnue',
@@ -1527,13 +1519,13 @@  discard block
 block discarded – undo
1527 1519
 			if (
1528 1520
 				// fonction de boucle avec serveur & table
1529 1521
 				(!$serveur or
1530
-					((!function_exists($f = "boucle_" . $serveur . "_" . $table))
1531
-						and (!function_exists($f = $f . "_dist"))
1522
+					((!function_exists($f = "boucle_".$serveur."_".$table))
1523
+						and (!function_exists($f = $f."_dist"))
1532 1524
 					)
1533 1525
 				)
1534 1526
 				// fonction de boucle avec table
1535
-				and (!function_exists($f = "boucle_" . $table))
1536
-				and (!function_exists($f = $f . "_dist"))
1527
+				and (!function_exists($f = "boucle_".$table))
1528
+				and (!function_exists($f = $f."_dist"))
1537 1529
 			) {
1538 1530
 				// fonction de boucle standard 
1539 1531
 				if (!function_exists($f = 'boucle_DEFAUT')) {
@@ -1541,20 +1533,20 @@  discard block
 block discarded – undo
1541 1533
 				}
1542 1534
 			}
1543 1535
 
1544
-			$req = "\n\n\tstatic \$command = array();\n\t" .
1545
-				"static \$connect;\n\t" .
1546
-				"\$command['connect'] = \$connect = " .
1547
-				_q($boucle->sql_serveur) .
1548
-				";" .
1536
+			$req = "\n\n\tstatic \$command = array();\n\t".
1537
+				"static \$connect;\n\t".
1538
+				"\$command['connect'] = \$connect = ".
1539
+				_q($boucle->sql_serveur).
1540
+				";".
1549 1541
 				$f($id, $boucles);
1550 1542
 		} else {
1551 1543
 			$req = ("\n\treturn '';");
1552 1544
 		}
1553 1545
 
1554 1546
 		$boucles[$id]->return =
1555
-			"\n\nfunction BOUCLE" . strtr($id, "-", "_") . $nom .
1556
-			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' .
1557
-			$req .
1547
+			"\n\nfunction BOUCLE".strtr($id, "-", "_").$nom.
1548
+			'(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'.
1549
+			$req.
1558 1550
 			"\n}\n";
1559 1551
 	}
1560 1552
 
@@ -1564,7 +1556,7 @@  discard block
 block discarded – undo
1564 1556
 		return false;
1565 1557
 	}
1566 1558
 
1567
-	$principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1559
+	$principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {
1568 1560
 '
1569 1561
 		// reporter de maniere securisee les doublons inclus
1570 1562
 		. '
@@ -1572,15 +1564,15 @@  discard block
 block discarded – undo
1572 1564
 		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
1573 1565
 
1574 1566
 	$connect = ' .
1575
-		_q($connect) . ';
1567
+		_q($connect).';
1576 1568
 	$page = ' .
1577 1569
 		// ATTENTION, le calcul de l'expression $corps affectera $Cache
1578 1570
 		// c'est pourquoi on l'affecte a la variable auxiliaire $page.
1579 1571
 		// avant de referencer $Cache
1580
-		$corps . ";
1572
+		$corps.";
1581 1573
 
1582 1574
 	return analyse_resultat_skel(" . var_export($nom, true)
1583
-		. ", \$Cache, \$page, " . var_export($sourcefile, true) . ");
1575
+		. ", \$Cache, \$page, ".var_export($sourcefile, true).");
1584 1576
 }";
1585 1577
 
1586 1578
 	$secondes = spip_timer('calcul_skel');
@@ -1594,10 +1586,10 @@  discard block
 block discarded – undo
1594 1586
 	$code->return = '
1595 1587
 //
1596 1588
 // Fonction principale du squelette ' .
1597
-		$sourcefile .
1598
-		($connect ? " pour $connect" : '') .
1599
-		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") .
1600
-		"\n//\n" .
1589
+		$sourcefile.
1590
+		($connect ? " pour $connect" : '').
1591
+		(!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes").
1592
+		"\n//\n".
1601 1593
 		$principal;
1602 1594
 
1603 1595
 	$boucles[''] = $code;
@@ -1649,7 +1641,7 @@  discard block
 block discarded – undo
1649 1641
  **/
1650 1642
 function requeteur_data_dist(&$boucles, &$boucle, &$id) {
1651 1643
 	include_spip('iterateur/data');
1652
-	if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) {
1644
+	if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) {
1653 1645
 		$g = charger_fonction('data', 'iterateur');
1654 1646
 		$boucles[$id] = $g($boucle);
1655 1647
 		// from[0] stocke le type de data (rss, yql, ...)
Please login to merge, or discard this patch.
ecrire/inc/recherche_to_array.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$_id_table = reset($_id_table);
69 69
 	}
70 70
 
71
-	$requete['SELECT'][] = "t." . $_id_table;
71
+	$requete['SELECT'][] = "t.".$_id_table;
72 72
 	$a = array();
73 73
 	// Recherche fulltext
74 74
 	foreach ($champs as $champ => $poids) {
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 				$champ = "t.$champ";
80 80
 			}
81 81
 			$requete['SELECT'][] = $champ;
82
-			$a[] = $champ . ' ' . $methode . ' ' . $q;
82
+			$a[] = $champ.' '.$methode.' '.$q;
83 83
 		}
84 84
 	}
85 85
 	if ($a) {
86 86
 		$requete['WHERE'][] = join(" OR ", $a);
87 87
 	}
88
-	$requete['FROM'][] = table_objet_sql($table) . ' AS t';
88
+	$requete['FROM'][] = table_objet_sql($table).' AS t';
89 89
 
90 90
 	$results = array();
91 91
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 					}
127 127
 					if ($options['score']) {
128 128
 						// compter les points avec un peu de discernement : on pondere par la longueur du match compte en chars
129
-						$score += $poids * strlen(implode('',array_column($regs, 0)));
129
+						$score += $poids * strlen(implode('', array_column($regs, 0)));
130 130
 					}
131 131
 
132 132
 					if ($options['matches']) {
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 					$s = sql_select("$primary as $cle_depart, id_objet as $cle_arrivee", $table_liens,
211 211
 						array("objet='$table_liee'", sql_in('id_objet', array_keys($ids_trouves))), '', '', '', '', $serveur);
212 212
 				} // cas table de liaison generique spip_xxx_yyy
213
-				elseif ($t = $trouver_table($table_arrivee . "_" . $table_depart, $serveur)
214
-					or $t = $trouver_table($table_depart . "_" . $table_arrivee, $serveur)
213
+				elseif ($t = $trouver_table($table_arrivee."_".$table_depart, $serveur)
214
+					or $t = $trouver_table($table_depart."_".$table_arrivee, $serveur)
215 215
 				) {
216 216
 					$s = sql_select("$cle_depart,$cle_arrivee", $t["table_sql"], sql_in($cle_arrivee, array_keys($ids_trouves)),
217 217
 						'', '', '', '', $serveur);
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 				}
239 239
 				if (isset($joint['champs']) and $joint['champs']) {
240 240
 					foreach ($joint['champs'] as $c => $val) {
241
-						$results[$id]['champs'][$table_liee . '.' . $c] = $val;
241
+						$results[$id]['champs'][$table_liee.'.'.$c] = $val;
242 242
 					}
243 243
 				}
244 244
 				if (isset($joint['matches']) and $joint['matches']) {
245 245
 					foreach ($joint['matches'] as $c => $val) {
246
-						$results[$id]['matches'][$table_liee . '.' . $c] = $val;
246
+						$results[$id]['matches'][$table_liee.'.'.$c] = $val;
247 247
 					}
248 248
 				}
249 249
 			}
Please login to merge, or discard this patch.
config/ecran_securite.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
  * Test utilisateur
16 16
  */
17 17
 if (isset($_GET['test_ecran_securite'])) {
18
-	$ecran_securite_raison = 'test ' . _ECRAN_SECURITE;
18
+	$ecran_securite_raison = 'test '._ECRAN_SECURITE;
19 19
 }
20 20
 
21
-if (file_exists($f = __DIR__ . DIRECTORY_SEPARATOR  . 'ecran_securite_options.php')) {
21
+if (file_exists($f = __DIR__.DIRECTORY_SEPARATOR.'ecran_securite_options.php')) {
22 22
 	include ($f);
23 23
 }
24 24
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 						'yats',
227 227
 						'yeti',
228 228
 						'zeerch'
229
-					)) . ',i',
230
-				(string)$_SERVER['HTTP_USER_AGENT']
229
+					)).',i',
230
+				(string) $_SERVER['HTTP_USER_AGENT']
231 231
 			)
232 232
 	);
233 233
 }
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
 		'_IS_BOT_FRIEND',
237 237
 		isset($_SERVER['HTTP_USER_AGENT'])
238 238
 			and preg_match(
239
-				',' . implode('|', array(
239
+				','.implode('|', array(
240 240
 					'facebookexternalhit',
241 241
 					'twitterbot',
242 242
 					'flipboardproxy',
243 243
 					'wordpress'
244
-				)) . ',i',
245
-				(string)$_SERVER['HTTP_USER_AGENT']
244
+				)).',i',
245
+				(string) $_SERVER['HTTP_USER_AGENT']
246 246
 			)
247 247
 	);
248 248
 }
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
  */
292 292
 foreach (array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax_ancre', 'nom_fichier') as $var) {
293 293
 	if (isset($_GET[$var])) {
294
-		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_GET[$var]);
294
+		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_GET[$var]);
295 295
 	}
296 296
 	if (isset($_POST[$var])) {
297
-		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_POST[$var]);
297
+		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_POST[$var]);
298 298
 	}
299 299
 }
300 300
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
  * Filtre l'accès à spip_acces_doc (injection SQL en 1.8.2x)
303 303
  */
304 304
 if (isset($_SERVER['REQUEST_URI'])) {
305
-	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string)$_SERVER['REQUEST_URI'])) {
306
-		$file = addslashes((string)$_GET['file']);
305
+	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string) $_SERVER['REQUEST_URI'])) {
306
+		$file = addslashes((string) $_GET['file']);
307 307
 	}
308 308
 }
309 309
 
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
  */
324 324
 if (
325 325
 	isset($_REQUEST['partie_cal'])
326
-	and $_REQUEST['partie_cal'] !== htmlentities((string)$_REQUEST['partie_cal'])
326
+	and $_REQUEST['partie_cal'] !== htmlentities((string) $_REQUEST['partie_cal'])
327 327
 ) {
328 328
 	$ecran_securite_raison = "partie_cal";
329 329
 }
330 330
 if (
331 331
 	isset($_REQUEST['echelle'])
332
-	and $_REQUEST['echelle'] !== htmlentities((string)$_REQUEST['echelle'])
332
+	and $_REQUEST['echelle'] !== htmlentities((string) $_REQUEST['echelle'])
333 333
 ) {
334 334
 	$ecran_securite_raison = "echelle";
335 335
 }
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
  */
340 340
 if (
341 341
 	isset($_REQUEST['exec'])
342
-	and !preg_match(',^[\w-]+$,', (string)$_REQUEST['exec'])
342
+	and !preg_match(',^[\w-]+$,', (string) $_REQUEST['exec'])
343 343
 ) {
344 344
 	$ecran_securite_raison = "exec";
345 345
 }
346 346
 if (
347 347
 	isset($_REQUEST['cherche_auteur'])
348
-	and preg_match(',[<],', (string)$_REQUEST['cherche_auteur'])
348
+	and preg_match(',[<],', (string) $_REQUEST['cherche_auteur'])
349 349
 ) {
350 350
 	$ecran_securite_raison = "cherche_auteur";
351 351
 }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	isset($_REQUEST['exec'])
354 354
 	and $_REQUEST['exec'] == 'auteurs'
355 355
 	and isset($_REQUEST['recherche'])
356
-	and preg_match(',[<],', (string)$_REQUEST['recherche'])
356
+	and preg_match(',[<],', (string) $_REQUEST['recherche'])
357 357
 ) {
358 358
 	$ecran_securite_raison = "recherche";
359 359
 }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	isset($_REQUEST['exec'])
362 362
 	and $_REQUEST['exec'] == 'info_plugin'
363 363
 	and isset($_REQUEST['plugin'])
364
-	and preg_match(',[<],', (string)$_REQUEST['plugin'])
364
+	and preg_match(',[<],', (string) $_REQUEST['plugin'])
365 365
 ) {
366 366
 	$ecran_securite_raison = "plugin";
367 367
 }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 				echo minipres(_T('info_acces_interdit'));
389 389
 				exit;
390 390
 			}
391
-			require _DIR_RESTREINT . 'action/configurer.php';
391
+			require _DIR_RESTREINT.'action/configurer.php';
392 392
 			action_configurer_dist();
393 393
 		}
394 394
 	}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 if (_IS_BOT) {
441 441
 	if (
442 442
 		(isset($_REQUEST['echelle']) and isset($_REQUEST['partie_cal']) and isset($_REQUEST['type']))
443
-		or (strpos((string)$_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string)$_SERVER['REQUEST_URI']))
444
-		or (isset($_REQUEST['calendrier_annee']) and strpos((string)$_SERVER['REQUEST_URI'], 'debut_'))
445
-		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string)$_SERVER['REQUEST_URI']))
443
+		or (strpos((string) $_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string) $_SERVER['REQUEST_URI']))
444
+		or (isset($_REQUEST['calendrier_annee']) and strpos((string) $_SERVER['REQUEST_URI'], 'debut_'))
445
+		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string) $_SERVER['REQUEST_URI']))
446 446
 	) {
447 447
 		$ecran_securite_raison = "robot agenda/double pagination";
448 448
 	}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	if ($_REQUEST['page'] == 'test_cfg') {
457 457
 		$ecran_securite_raison = "test_cfg";
458 458
 	}
459
-	if ($_REQUEST['page'] !== htmlspecialchars((string)$_REQUEST['page'])) {
459
+	if ($_REQUEST['page'] !== htmlspecialchars((string) $_REQUEST['page'])) {
460 460
 		$ecran_securite_raison = "xsspage";
461 461
 	}
462 462
 	if (
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
  */
473 473
 foreach (array('var_login') as $var) {
474 474
 	if (isset($_REQUEST[$var]) and is_array($_REQUEST[$var])) {
475
-		$ecran_securite_raison = "xss " . $var;
475
+		$ecran_securite_raison = "xss ".$var;
476 476
 	}
477 477
 }
478 478
 
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
  */
521 521
 if (
522 522
 	isset($_REQUEST['nom_sauvegarde'])
523
-	and strstr((string)$_REQUEST['nom_sauvegarde'], '/')
523
+	and strstr((string) $_REQUEST['nom_sauvegarde'], '/')
524 524
 ) {
525 525
 	$ecran_securite_raison = 'nom_sauvegarde manipulee';
526 526
 }
527 527
 if (
528 528
 	isset($_REQUEST['znom_sauvegarde'])
529
-	and strstr((string)$_REQUEST['znom_sauvegarde'], '/')
529
+	and strstr((string) $_REQUEST['znom_sauvegarde'], '/')
530 530
 ) {
531 531
 	$ecran_securite_raison = 'znom_sauvegarde manipulee';
532 532
 }
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			lire_fichier($file, $c);
75 75
 			$css .= $c;
76 76
 		}
77
-		$css = "<style type='text/css'>" . $css . "</style>";
77
+		$css = "<style type='text/css'>".$css."</style>";
78 78
 	} else {
79 79
 		foreach ($files as $name) {
80 80
 			$file = direction_css(find_in_theme($name));
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 		define('_DOCTYPE_ECRIRE', '');
88 88
 	}
89 89
 
90
-	return _DOCTYPE_ECRIRE .
91
-	html_lang_attributes() .
92
-	"<head>\n" .
93
-	"<title>" .
94
-	textebrut($titre) .
95
-	"</title>\n" .
96
-	"<meta name='viewport' content='width=device-width' />\n" .
97
-	$css .
90
+	return _DOCTYPE_ECRIRE.
91
+	html_lang_attributes().
92
+	"<head>\n".
93
+	"<title>".
94
+	textebrut($titre).
95
+	"</title>\n".
96
+	"<meta name='viewport' content='width=device-width' />\n".
97
+	$css.
98 98
 	"</head>
99
-<body" . $onLoad . " class='minipres'>
99
+<body" . $onLoad." class='minipres'>
100 100
 	<div id='minipres'>
101 101
 	<h1>" .
102
-	$titre .
102
+	$titre.
103 103
 	"</h1>
104 104
 	<div>\n";
105 105
 }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 		$titre = ($titre == 'install')
183 183
 			? _T('avis_espace_interdit')
184
-			: $titre . '&nbsp;: ' . _T('info_acces_interdit');
184
+			: $titre.'&nbsp;: '._T('info_acces_interdit');
185 185
 
186 186
 		$statut = isset($GLOBALS['visiteur_session']['statut']) ? $GLOBALS['visiteur_session']['statut'] : '';
187 187
 		$nom = isset($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : '';
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
 		}
192 192
 
193 193
 		if ($statut AND test_espace_prive()) {
194
-			$corps = bouton_action(_T('public:accueil_site'),generer_url_ecrire('accueil'));
194
+			$corps = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil'));
195 195
 		}
196 196
 		elseif (!empty($_COOKIE['spip_admin'])) {
197
-			$corps = bouton_action(_T('public:lien_connecter'),generer_url_public('login'));
197
+			$corps = bouton_action(_T('public:lien_connecter'), generer_url_public('login'));
198 198
 		}
199 199
 		else {
200
-			$corps = bouton_action(_T('public:accueil_site'),$GLOBALS['meta']['adresse_site']);
200
+			$corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']);
201 201
 		}
202 202
 		$corps = "<div class='boutons'>$corps</div>";
203
-		spip_log($nom . " $titre " . $_SERVER['REQUEST_URI']);
203
+		spip_log($nom." $titre ".$_SERVER['REQUEST_URI']);
204 204
 	}
205 205
 
206 206
 	if (!_AJAX) {
@@ -218,6 +218,6 @@  discard block
 block discarded – undo
218 218
 		foreach ($_POST as $v => $c) {
219 219
 			$url = parametre_url($url, $v, $c, '&');
220 220
 		}
221
-		ajax_retour("<div>" . $titre . redirige_formulaire($url) . "</div>", false);
221
+		ajax_retour("<div>".$titre.redirige_formulaire($url)."</div>", false);
222 222
 	}
223 223
 }
Please login to merge, or discard this patch.
ecrire/inc/securiser_action.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
  * @param string|null $url_action
80 80
  * @return bool
81 81
  */
82
-function demander_confirmation_avant_action($titre, $titre_bouton, $url_action=null) {
82
+function demander_confirmation_avant_action($titre, $titre_bouton, $url_action = null) {
83 83
 
84 84
 	if (!$url_action) {
85 85
 		$url_action = self();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	$corps = "<div style='text-align:center;'>$bouton_action</div>";
103 103
 
104 104
 	include_spip("inc/minipres");
105
-	echo minipres($titre,$corps);
105
+	echo minipres($titre, $corps);
106 106
 	exit;
107 107
 }
108 108
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		if ($mode === -1) {
144 144
 			return array('action' => $action, 'arg' => $arg, 'hash' => $hash);
145 145
 		} else {
146
-			return generer_url_action($action, "arg=" . rawurlencode($arg) . "&hash=$hash" . (!$r ? '' : "&redirect=$r"),
146
+			return generer_url_action($action, "arg=".rawurlencode($arg)."&hash=$hash".(!$r ? '' : "&redirect=$r"),
147 147
 				$mode, $public);
148 148
 		}
149 149
 	}
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 	$hash = calculer_action_auteur("$action-$arg");
153 153
 	$att .= " style='margin: 0px; border: 0px'";
154 154
 	if ($redirect) {
155
-		$redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", '&#39;', $redirect) . "' />";
155
+		$redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", '&#39;', $redirect)."' />";
156 156
 	}
157
-	$mode .= $redirect . "
157
+	$mode .= $redirect."
158 158
 <input name='hash' type='hidden' value='$hash' />
159 159
 <input name='arg' type='hidden' value='$arg' />";
160 160
 
@@ -224,12 +224,12 @@  discard block
 block discarded – undo
224 224
  */
225 225
 function _action_auteur($action, $id_auteur, $pass, $alea) {
226 226
 	static $sha = array();
227
-	if (!isset($sha[$id_auteur . $pass . $alea])) {
227
+	if (!isset($sha[$id_auteur.$pass.$alea])) {
228 228
 		if (!isset($GLOBALS['meta'][$alea])) {
229
-			if (!$exec = _request('exec') or !autoriser_sans_cookie($exec)){
229
+			if (!$exec = _request('exec') or !autoriser_sans_cookie($exec)) {
230 230
 				include_spip('inc/acces');
231 231
 				charger_aleas();
232
-				if (empty($GLOBALS['meta'][$alea])){
232
+				if (empty($GLOBALS['meta'][$alea])) {
233 233
 					include_spip('inc/minipres');
234 234
 					echo minipres();
235 235
 					spip_log("$alea indisponible");
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 			}
239 239
 		}
240 240
 		include_spip('auth/sha256.inc');
241
-		$sha[$id_auteur . $pass . $alea] = spip_sha256($id_auteur . $pass . @$GLOBALS['meta'][$alea]);
241
+		$sha[$id_auteur.$pass.$alea] = spip_sha256($id_auteur.$pass.@$GLOBALS['meta'][$alea]);
242 242
 	}
243 243
 	if (function_exists('sha1')) {
244
-		return sha1($action . $sha[$id_auteur . $pass . $alea]);
244
+		return sha1($action.$sha[$id_auteur.$pass.$alea]);
245 245
 	} else {
246
-		return md5($action . $sha[$id_auteur . $pass . $alea]);
246
+		return md5($action.$sha[$id_auteur.$pass.$alea]);
247 247
 	}
248 248
 }
249 249
 
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
  */
324 324
 function calculer_cle_action($action) {
325 325
 	if (function_exists('sha1')) {
326
-		return sha1($action . secret_du_site());
326
+		return sha1($action.secret_du_site());
327 327
 	} else {
328
-		return md5($action . secret_du_site());
328
+		return md5($action.secret_du_site());
329 329
 	}
330 330
 }
331 331
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	// On nettoie l’URL de tous les var_.
366 366
 	$url = nettoyer_uri_var($url);
367 367
 
368
-	$token = _action_auteur('previsualiser-' . $url, $id_auteur, null, $alea);
368
+	$token = _action_auteur('previsualiser-'.$url, $id_auteur, null, $alea);
369 369
 	return "$id_auteur-$token";
370 370
 }
371 371
 
Please login to merge, or discard this patch.
ecrire/inc/headers.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
 	if ((!$equiv and !spip_cookie_envoye()) or (
79 79
 			   (!empty($_SERVER['SERVER_SOFTWARE'])
80 80
 				   and _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE
81
-				   and preg_match("/"._SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE."/i",$_SERVER['SERVER_SOFTWARE']))
81
+				   and preg_match("/"._SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE."/i", $_SERVER['SERVER_SOFTWARE']))
82 82
 			or (!empty($_SERVER['SERVER_SIGNATURE'])
83 83
 				   and _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE
84
-				   and preg_match("/"._SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE."/i",$_SERVER['SERVER_SIGNATURE']))
84
+				   and preg_match("/"._SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE."/i", $_SERVER['SERVER_SIGNATURE']))
85 85
 			or function_exists('apache_getenv')
86 86
 			or defined('_SERVER_APACHE')
87 87
 		)
88 88
 	) {
89
-		@header("Location: " . $url);
89
+		@header("Location: ".$url);
90 90
 		$equiv = "";
91 91
 	} else {
92
-		@header("Refresh: 0; url=" . $url);
92
+		@header("Refresh: 0; url=".$url);
93 93
 		if (isset($GLOBALS['meta']['charset'])) {
94
-			@header("Content-Type: text/html; charset=" . $GLOBALS['meta']['charset']);
94
+			@header("Content-Type: text/html; charset=".$GLOBALS['meta']['charset']);
95 95
 		}
96 96
 		$equiv = "<meta http-equiv='Refresh' content='0; url=$url'>";
97 97
 	}
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 	html_lang_attributes(), '
104 104
 <head>',
105 105
 	$equiv, '
106
-<title>HTTP ' . $status . '</title>
107
-' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset=' . $GLOBALS['meta']['charset'] . '">' : '') . '
106
+<title>HTTP ' . $status.'</title>
107
+' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset='.$GLOBALS['meta']['charset'].'">' : '').'
108 108
 </head>
109 109
 <body>
110
-<h1>HTTP ' . $status . '</h1>
110
+<h1>HTTP ' . $status.'</h1>
111 111
 <a href="',
112 112
 	quote_amp($url),
113 113
 	'">',
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		# en theorie on devrait faire ca tout le temps, mais quand la chaine
143 143
 		# commence par ? c'est imperatif, sinon l'url finale n'est pas la bonne
144 144
 		if ($url[0] == '?') {
145
-			$url = url_de_base() . $url;
145
+			$url = url_de_base().$url;
146 146
 		}
147 147
 		$url = str_replace('&amp;', '&', $url);
148 148
 		spip_log("redirige formulaire ajax: $url");
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 		if ($format == 'ajaxform') {
151 151
 			return array(
152 152
 				// on renvoie un lien masque qui sera traite par ajaxCallback.js
153
-				'<a href="' . quote_amp($url) . '" name="ajax_redirect"  style="display:none;">' . _T('navigateur_pas_redirige') . '</a>',
153
+				'<a href="'.quote_amp($url).'" name="ajax_redirect"  style="display:none;">'._T('navigateur_pas_redirige').'</a>',
154 154
 				// et un message au cas ou
155
-				'<br /><a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>'
155
+				'<br /><a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>'
156 156
 			);
157 157
 		} else // format message texte, tout en js inline
158 158
 		{
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 				"<script type='text/javascript'>if (parent.window){parent.window.document.location.replace(\"$url\");} else {document.location.replace(\"$url\");}</script>"
162 162
 				. http_img_pack('loader.svg', '', " class='loader'")
163 163
 				. '<br />'
164
-				. '<a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>';
164
+				. '<a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>';
165 165
 		}
166 166
 	}
167 167
 }
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 
219 219
 	$php_cgi = ($GLOBALS['flag_sapi_name'] and preg_match(",cgi,i", @php_sapi_name()));
220 220
 	if ($php_cgi) {
221
-		header("Status: " . $status_string[$status]);
221
+		header("Status: ".$status_string[$status]);
222 222
 	} else {
223
-		header("HTTP/1.0 " . $status_string[$status]);
223
+		header("HTTP/1.0 ".$status_string[$status]);
224 224
 	}
225 225
 }
226 226
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 	header("Content-Type: text/html; charset=$charset");
244 244
 	header("Expires: 0");
245
-	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
245
+	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
246 246
 	header("Cache-Control: no-cache, must-revalidate");
247 247
 	header("Pragma: no-cache");
248 248
 }
Please login to merge, or discard this patch.
ecrire/action/inscrire_auteur.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	include_spip('base/abstract_sql');
59
-	$res = sql_select("statut, id_auteur, login, email", "spip_auteurs", "email=" . sql_quote($desc['email']));
59
+	$res = sql_select("statut, id_auteur, login, email", "spip_auteurs", "email=".sql_quote($desc['email']));
60 60
 	// erreur ?
61 61
 	if (!$res) {
62 62
 		return _T('titre_probleme_technique');
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 		if (!sql_countsel('spip_auteurs', "login='$login'")) {
210 210
 			return $login;
211 211
 		}
212
-		$login = $login_base . $i;
212
+		$login = $login_base.$i;
213 213
 	}
214 214
 
215 215
 	return $login;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	}
243 243
 
244 244
 	$modele_mail = 'modeles/mail_inscription';
245
-	if (isset($options['modele_mail']) and $options['modele_mail']){
245
+	if (isset($options['modele_mail']) and $options['modele_mail']) {
246 246
 		$modele_mail = $options['modele_mail'];
247 247
 	}
248 248
 	$message = recuperer_fond($modele_mail, $contexte);
@@ -346,8 +346,8 @@  discard block
 block discarded – undo
346 346
 	// s'assurer de l'unicite du jeton pour le couple (email,cookie)
347 347
 	do {
348 348
 		$jeton = creer_uniqid();
349
-		sql_updateq("spip_auteurs", array("cookie_oubli" => $jeton), "id_auteur=" . intval($id_auteur));
350
-	} while (sql_countsel("spip_auteurs", "cookie_oubli=" . sql_quote($jeton)) > 1);
349
+		sql_updateq("spip_auteurs", array("cookie_oubli" => $jeton), "id_auteur=".intval($id_auteur));
350
+	} while (sql_countsel("spip_auteurs", "cookie_oubli=".sql_quote($jeton)) > 1);
351 351
 
352 352
 	return $jeton;
353 353
 }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	}
366 366
 
367 367
 	// on peut tomber sur un jeton compose uniquement de chiffres, il faut forcer le $type pour sql_quote pour eviter de planter
368
-	$desc = sql_fetsel('*', 'spip_auteurs', "cookie_oubli=" . sql_quote($jeton, '', 'string'));
368
+	$desc = sql_fetsel('*', 'spip_auteurs', "cookie_oubli=".sql_quote($jeton, '', 'string'));
369 369
 
370 370
 	return $desc;
371 371
 }
@@ -377,5 +377,5 @@  discard block
 block discarded – undo
377 377
  * @return bool
378 378
  */
379 379
 function auteur_effacer_jeton($id_auteur) {
380
-	return sql_updateq("spip_auteurs", array("cookie_oubli" => ''), "id_auteur=" . intval($id_auteur));
380
+	return sql_updateq("spip_auteurs", array("cookie_oubli" => ''), "id_auteur=".intval($id_auteur));
381 381
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_preferences.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 	$les_couleurs = $couleurs();
46 46
 	foreach ($les_couleurs as $k => $c) {
47 47
 		$valeurs['_couleurs_url'][$k] = generer_url_public('style_prive.css', 'ltr='
48
-			. $GLOBALS['spip_lang_left'] . '&'
48
+			. $GLOBALS['spip_lang_left'].'&'
49 49
 			. $couleurs($k));
50 50
 		$valeurs['couleurs'][$k] = $c;
51 51
 	}
Please login to merge, or discard this patch.
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 	$blue = dechex($blue);
45 45
 
46 46
 	if (strlen($red) == 1) {
47
-		$red = "0" . $red;
47
+		$red = "0".$red;
48 48
 	}
49 49
 	if (strlen($green) == 1) {
50
-		$green = "0" . $green;
50
+		$green = "0".$green;
51 51
 	}
52 52
 	if (strlen($blue) == 1) {
53
-		$blue = "0" . $blue;
53
+		$blue = "0".$blue;
54 54
 	}
55 55
 
56 56
 	return "$red$green$blue";
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	$couleur = couleur_html_to_hex($couleur);
69 69
 	$couleur = ltrim($couleur, '#');
70 70
 	if (strlen($couleur) === 3) {
71
-		$couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2];
71
+		$couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2];
72 72
 	}
73 73
 	$retour = [];
74 74
 	$retour["red"] = hexdec(substr($couleur, 0, 2));
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	$var_G = ($G / 255);
126 126
 	$var_B = ($B / 255);
127 127
 
128
-	$var_Min = min($var_R, $var_G, $var_B);   //Min. value of RGB
129
-	$var_Max = max($var_R, $var_G, $var_B);   //Max. value of RGB
130
-	$del_Max = $var_Max - $var_Min;           //Delta RGB value
128
+	$var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB
129
+	$var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB
130
+	$del_Max = $var_Max - $var_Min; //Delta RGB value
131 131
 
132 132
 	$L = ($var_Max + $var_Min) / 2;
133 133
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 	  and $extension = _image_trouver_extension_depuis_mime("image/".$regs[1])
322 322
 		and in_array($extension, _image_extensions_acceptees_en_entree())
323 323
 	) {
324
-		$local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension);
324
+		$local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension);
325 325
 		if (!file_exists($local)) {
326 326
 			ecrire_fichier($local, base64_decode($regs[2]));
327 327
 		}
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	// les protocoles web prennent au moins 3 lettres
336 336
 	if (tester_url_absolue($source)) {
337 337
 		include_spip('inc/distant');
338
-		$fichier = _DIR_RACINE . copie_locale($source);
338
+		$fichier = _DIR_RACINE.copie_locale($source);
339 339
 		if (!$fichier) {
340 340
 			return "";
341 341
 		}
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 	if ($forcer_format !== false
362 362
 		// ignorer forcer_format si on a une image svg, que le filtre appelant ne supporte pas SVG, et que le forcage est un autre format image
363
-		and ($terminaison_dest !== 'svg' or $support_svg or !in_array($forcer_format,_image_extensions_acceptees_en_sortie()))) {
363
+		and ($terminaison_dest !== 'svg' or $support_svg or !in_array($forcer_format, _image_extensions_acceptees_en_sortie()))) {
364 364
 		$terminaison_dest = $forcer_format;
365 365
 	}
366 366
 
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 			// on garde la terminaison initiale car image simplement copiee
423 423
 			// et on postfixe son nom avec un md5 du path
424 424
 			$terminaison_dest = $terminaison;
425
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
425
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
426 426
 		} else {
427
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
427
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
428 428
 		}
429 429
 		$cache = sous_repertoire(_DIR_VAR, $cache);
430 430
 		$cache = sous_repertoire($cache, $effet);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		$fichier_dest = substr($fichier_dest, 2);
436 436
 	}
437 437
 
438
-	$fichier_dest = $cache . $fichier_dest . "." . $terminaison_dest;
438
+	$fichier_dest = $cache.$fichier_dest.".".$terminaison_dest;
439 439
 
440 440
 	$GLOBALS["images_calculees"][] = $fichier_dest;
441 441
 
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
 	}
472 472
 
473 473
 	if ($creer) {
474
-		spip_log("filtre image " . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
475
-			"images" . _LOG_DEBUG);
474
+		spip_log("filtre image ".($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
475
+			"images"._LOG_DEBUG);
476 476
 	}
477 477
 
478 478
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
479
-	$ret["fonction_imagecreatefrom"] = "_imagecreatefrom" . $term_fonction;
479
+	$ret["fonction_imagecreatefrom"] = "_imagecreatefrom".$term_fonction;
480 480
 	$ret["fichier"] = $fichier;
481
-	$ret["fonction_image"] = "_image_image" . $terminaison_dest;
481
+	$ret["fonction_image"] = "_image_image".$terminaison_dest;
482 482
 	$ret["fichier_dest"] = $fichier_dest;
483 483
 	$ret["format_source"] = _image_extension_normalisee($terminaison);
484 484
 	$ret["format_dest"] = $terminaison_dest;
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 /**
553 553
  * @return array|string[]|null
554 554
  */
555
-function _image_extensions_acceptees_en_sortie(){
555
+function _image_extensions_acceptees_en_sortie() {
556 556
 	static $extensions = null;
557
-	if (empty($extensions)){
557
+	if (empty($extensions)) {
558 558
 		$extensions = _image_extensions_acceptees_en_entree();
559 559
 		$extensions = array_diff($extensions, ['jpeg']);
560 560
 		if (in_array('gif', $extensions) and !function_exists('imagegif')) {
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 	return $extensions;
569 569
 }
570 570
 
571
-function _image_extension_normalisee($extension){
571
+function _image_extension_normalisee($extension) {
572 572
 	$extension = strtolower($extension);
573 573
 	if ($extension === 'jpeg') {
574 574
 		$extension = 'jpg';
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	return $extension;
577 577
 }
578 578
 
579
-function _image_extensions_conservent_transparence(){
579
+function _image_extensions_conservent_transparence() {
580 580
 	return ['png', 'webp'];
581 581
 }
582 582
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 
627 627
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
628 628
 	if ($_terminaison and $_terminaison !== $terminaison) {
629
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", "images." . _LOG_INFO_IMPORTANTE);
629
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", "images."._LOG_INFO_IMPORTANTE);
630 630
 		$terminaison = $_terminaison;
631 631
 	}
632 632
 	return $terminaison;
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 	if (!function_exists('imagepng')) {
784 784
 		return false;
785 785
 	}
786
-	$tmp = $fichier . ".tmp";
786
+	$tmp = $fichier.".tmp";
787 787
 	$ret = imagepng($img, $tmp);
788 788
 	if (file_exists($tmp)) {
789 789
 		$taille_test = getimagesize($tmp);
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 	if (!function_exists('imagegif')) {
819 819
 		return false;
820 820
 	}
821
-	$tmp = $fichier . ".tmp";
821
+	$tmp = $fichier.".tmp";
822 822
 	$ret = imagegif($img, $tmp);
823 823
 	if (file_exists($tmp)) {
824 824
 		$taille_test = getimagesize($tmp);
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 	if (!function_exists('imagejpeg')) {
859 859
 		return false;
860 860
 	}
861
-	$tmp = $fichier . ".tmp";
861
+	$tmp = $fichier.".tmp";
862 862
 
863 863
 	// Enable interlancing
864 864
 	imageinterlace($img, true);
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 	if (!function_exists('imagewebp')) {
920 920
 		return false;
921 921
 	}
922
-	$tmp = $fichier . ".tmp";
922
+	$tmp = $fichier.".tmp";
923 923
 	$ret = imagewebp($img, $tmp, $qualite);
924 924
 	if (file_exists($tmp)) {
925 925
 		$taille_test = getimagesize($tmp);
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
  */
954 954
 function _image_imagesvg($img, $fichier) {
955 955
 
956
-	$tmp = $fichier . ".tmp";
956
+	$tmp = $fichier.".tmp";
957 957
 	if (strpos($img, "<") === false) {
958 958
 		$img = supprimer_timestamp($img);
959 959
 		if (!file_exists($img)) {
@@ -1010,13 +1010,13 @@  discard block
 block discarded – undo
1010 1010
  */
1011 1011
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1012 1012
 	if (is_null($fonction)) {
1013
-		$fonction = "_image_image" . $valeurs['format_dest'];
1013
+		$fonction = "_image_image".$valeurs['format_dest'];
1014 1014
 	}
1015 1015
 	$ret = false;
1016 1016
 	#un flag pour reperer les images gravees
1017 1017
 	$lock =
1018 1018
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1019
-	or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'));
1019
+	or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'));
1020 1020
 	if (
1021 1021
 		function_exists($fonction)
1022 1022
 		&& ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 			// dans tous les cas mettre a jour la taille de l'image finale
1028 1028
 			list($valeurs["hauteur_dest"], $valeurs["largeur_dest"]) = taille_image($valeurs['fichier_dest']);
1029 1029
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1030
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1030
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1031 1031
 		}
1032 1032
 	}
1033 1033
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 function reconstruire_image_intermediaire($fichier_manquant) {
1047 1047
 	$reconstruire = array();
1048 1048
 	$fichier = $fichier_manquant;
1049
-	while (strpos($fichier,"://")===false
1049
+	while (strpos($fichier, "://") === false
1050 1050
 		and !@file_exists($fichier)
1051 1051
 		and lire_fichier($src = "$fichier.src", $source)
1052 1052
 		and $valeurs = unserialize($source)
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
  *     Chemin du fichier d'image calculé
1084 1084
  **/
1085 1085
 function ramasse_miettes($fichier) {
1086
-	if (strpos($fichier,"://")!==false
1086
+	if (strpos($fichier, "://") !== false
1087 1087
 		or !lire_fichier($src = "$fichier.src", $source)
1088 1088
 		or !$valeurs = unserialize($source)
1089 1089
 	) {
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 	}
1140 1140
 	# si jamais le fichier final n'a pas ete calcule car suppose temporaire
1141 1141
 	# et qu'il ne s'agit pas d'une URL
1142
-	if (strpos($fichier,"://")===false and !@file_exists($fichier)) {
1142
+	if (strpos($fichier, "://") === false and !@file_exists($fichier)) {
1143 1143
 		reconstruire_image_intermediaire($fichier);
1144 1144
 	}
1145 1145
 	ramasse_miettes($fichier);
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 
1237 1237
 	// attributs deprecies. Transformer en CSS
1238 1238
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1239
-		$style = "margin:${espace}px;" . $style;
1239
+		$style = "margin:${espace}px;".$style;
1240 1240
 		$tag = inserer_attribut($tag, 'hspace', '');
1241 1241
 	}
1242 1242
 
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
 	$image = $valeurs['fichier'];
1361 1361
 	$format = $valeurs['format_source'];
1362 1362
 	$destdir = dirname($valeurs['fichier_dest']);
1363
-	$destfile = basename($valeurs['fichier_dest'], "." . $valeurs["format_dest"]);
1363
+	$destfile = basename($valeurs['fichier_dest'], ".".$valeurs["format_dest"]);
1364 1364
 
1365 1365
 	$format_sortie = $valeurs['format_dest'];
1366 1366
 
@@ -1392,14 +1392,14 @@  discard block
 block discarded – undo
1392 1392
 
1393 1393
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1394 1394
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1395
-		$vignette = $destination . '.' . $format;
1395
+		$vignette = $destination.'.'.$format;
1396 1396
 		@copy($image, $vignette);
1397 1397
 	}
1398 1398
 
1399 1399
 	elseif ($valeurs["format_source"] === 'svg') {
1400
-		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)){
1400
+		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1401 1401
 			$format_sortie = 'svg';
1402
-			$vignette = $destination . "." . $format_sortie;
1402
+			$vignette = $destination.".".$format_sortie;
1403 1403
 			$valeurs['fichier_dest'] = $vignette;
1404 1404
 			_image_gd_output($svg, $valeurs);
1405 1405
 		}
@@ -1411,9 +1411,9 @@  discard block
 block discarded – undo
1411 1411
 			define('_CONVERT_COMMAND', 'convert');
1412 1412
 		} // Securite : mes_options.php peut preciser le chemin absolu
1413 1413
 		if (!defined('_RESIZE_COMMAND')) {
1414
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest');
1414
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest');
1415 1415
 		}
1416
-		$vignette = $destination . "." . $format_sortie;
1416
+		$vignette = $destination.".".$format_sortie;
1417 1417
 		$commande = str_replace(
1418 1418
 			array('%x', '%y', '%src', '%dest'),
1419 1419
 			array(
@@ -1428,13 +1428,13 @@  discard block
 block discarded – undo
1428 1428
 		if (!@file_exists($vignette)) {
1429 1429
 			spip_log("echec convert sur $vignette");
1430 1430
 
1431
-			return;  // echec commande
1431
+			return; // echec commande
1432 1432
 		}
1433 1433
 	}
1434 1434
 
1435 1435
 	// php5 imagemagick
1436 1436
 	elseif ($process == 'imagick') {
1437
-		$vignette = "$destination." . $format_sortie;
1437
+		$vignette = "$destination.".$format_sortie;
1438 1438
 
1439 1439
 		if (!class_exists('Imagick')) {
1440 1440
 			spip_log("Classe Imagick absente !", _LOG_ERREUR);
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		$imagick = new Imagick();
1445 1445
 		$imagick->readImage($image);
1446 1446
 		$imagick->resizeImage($destWidth, $destHeight, Imagick::FILTER_LANCZOS,
1447
-			1);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1447
+			1); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1448 1448
 		$imagick->writeImage($vignette);
1449 1449
 
1450 1450
 		if (!@file_exists($vignette)) {
@@ -1462,12 +1462,12 @@  discard block
 block discarded – undo
1462 1462
 		if (_PNMSCALE_COMMAND == '') {
1463 1463
 			return;
1464 1464
 		}
1465
-		$vignette = $destination . "." . $format_sortie;
1465
+		$vignette = $destination.".".$format_sortie;
1466 1466
 		$pnmtojpeg_command = str_replace("pnmscale", "pnmtojpeg", _PNMSCALE_COMMAND);
1467 1467
 		if ($format == "jpg") {
1468 1468
 
1469 1469
 			$jpegtopnm_command = str_replace("pnmscale", "jpegtopnm", _PNMSCALE_COMMAND);
1470
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1470
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1471 1471
 			if (!($s = @filesize($vignette))) {
1472 1472
 				spip_unlink($vignette);
1473 1473
 			}
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 		} else {
1480 1480
 			if ($format == "gif") {
1481 1481
 				$giftopnm_command = str_replace("pnmscale", "giftopnm", _PNMSCALE_COMMAND);
1482
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1482
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1483 1483
 				if (!($s = @filesize($vignette))) {
1484 1484
 					spip_unlink($vignette);
1485 1485
 				}
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 			} else {
1492 1492
 				if ($format == "png") {
1493 1493
 					$pngtopnm_command = str_replace("pnmscale", "pngtopnm", _PNMSCALE_COMMAND);
1494
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1494
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1495 1495
 					if (!($s = @filesize($vignette))) {
1496 1496
 						spip_unlink($vignette);
1497 1497
 					}
@@ -1513,7 +1513,7 @@  discard block
 block discarded – undo
1513 1513
 			return;
1514 1514
 		}
1515 1515
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1516
-			spip_log("vignette gd1/gd2 impossible : " . $srcWidth * $srcHeight . "pixels");
1516
+			spip_log("vignette gd1/gd2 impossible : ".$srcWidth * $srcHeight."pixels");
1517 1517
 
1518 1518
 			return;
1519 1519
 		}
@@ -1818,7 +1818,7 @@  discard block
 block discarded – undo
1818 1818
 		// de l'image, de facon a tromper le cache du navigateur
1819 1819
 		// quand on fait supprimer/reuploader un logo
1820 1820
 		// (pas de filemtime si SAFE MODE)
1821
-		$date = test_espace_prive() ? ('?' . $date) : '';
1821
+		$date = test_espace_prive() ? ('?'.$date) : '';
1822 1822
 
1823 1823
 		return _image_ecrire_tag($image, array('src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight));
1824 1824
 	}
@@ -1865,7 +1865,7 @@  discard block
 block discarded – undo
1865 1865
 	public static function LittleEndian2String($number, $minbytes = 1) {
1866 1866
 		$intstring = '';
1867 1867
 		while ($number > 0) {
1868
-			$intstring = $intstring . chr($number & 255);
1868
+			$intstring = $intstring.chr($number & 255);
1869 1869
 			$number >>= 8;
1870 1870
 		}
1871 1871
 
@@ -1898,9 +1898,9 @@  discard block
 block discarded – undo
1898 1898
 					$b = $argb['blue'];
1899 1899
 
1900 1900
 					if ($bpp[$key] == 32) {
1901
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1901
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1902 1902
 					} elseif ($bpp[$key] == 24) {
1903
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1903
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1904 1904
 					}
1905 1905
 
1906 1906
 					if ($a < 128) {
@@ -1928,44 +1928,44 @@  discard block
 block discarded – undo
1928 1928
 
1929 1929
 			// BITMAPINFOHEADER - 40 bytes
1930 1930
 			$BitmapInfoHeader[$key] = '';
1931
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1932
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1931
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1932
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1933 1933
 			// The biHeight member specifies the combined
1934 1934
 			// height of the XOR and AND masks.
1935 1935
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1936
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1937
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1938
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1939
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1940
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1941
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1942
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1943
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1936
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1937
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1938
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1939
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1940
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1941
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1942
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1943
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1944 1944
 		}
1945 1945
 
1946 1946
 
1947
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1948
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1949
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1947
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1948
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1949
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1950 1950
 
1951 1951
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1952 1952
 		foreach ($gd_image_array as $key => $gd_image) {
1953 1953
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1954 1954
 
1955
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1956
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1957
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1958
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1955
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1956
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1957
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1958
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1959 1959
 
1960
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1961
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1960
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1961
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1962 1962
 
1963 1963
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1964 1964
 			$icondata .= phpthumb_functions::LittleEndian2String($dwBytesInRes,
1965
-				4);     // dwBytesInRes;	// How many bytes in this resource?
1965
+				4); // dwBytesInRes;	// How many bytes in this resource?
1966 1966
 
1967 1967
 			$icondata .= phpthumb_functions::LittleEndian2String($dwImageOffset,
1968
-				4);    // dwImageOffset;   // Where in the file is this image?
1968
+				4); // dwImageOffset;   // Where in the file is this image?
1969 1969
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1970 1970
 			$dwImageOffset += strlen($icXOR[$key]);
1971 1971
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.