Completed
Push — master ( a2bcf3...4c74fa )
by cam
05:07
created
ecrire/public/balises.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
  */
363 363
 function balise_DOSSIER_SQUELETTE_dist($p) {
364 364
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
365
-	$p->code = "_DIR_RACINE . '$code'" .
365
+	$p->code = "_DIR_RACINE . '$code'".
366 366
 		$p->interdire_scripts = false;
367 367
 
368 368
 	return $p;
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
  */
382 382
 function balise_SQUELETTE_dist($p) {
383 383
 	$code = addslashes($p->descr['sourcefile']);
384
-	$p->code = "'$code'" .
384
+	$p->code = "'$code'".
385 385
 		$p->interdire_scripts = false;
386 386
 
387 387
 	return $p;
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
  **/
434 434
 function balise_NOM_SITE_dist($p) {
435 435
 	if (!$p->etoile) {
436
-		$p->code = "supprimer_numero(calculer_url(" .
437
-			champ_sql('url_site', $p) . "," .
438
-			champ_sql('nom_site', $p) .
436
+		$p->code = "supprimer_numero(calculer_url(".
437
+			champ_sql('url_site', $p).",".
438
+			champ_sql('nom_site', $p).
439 439
 			", 'titre', \$connect, false))";
440 440
 	} else {
441 441
 		$p->code = champ_sql('nom_site', $p);
@@ -586,8 +586,8 @@  discard block
 block discarded – undo
586 586
  *     Pile complétée par le code à générer
587 587
  **/
588 588
 function balise_POPULARITE_ABSOLUE_dist($p) {
589
-	$p->code = 'ceil(' .
590
-		champ_sql('popularite', $p) .
589
+	$p->code = 'ceil('.
590
+		champ_sql('popularite', $p).
591 591
 		')';
592 592
 	$p->interdire_scripts = false;
593 593
 
@@ -665,9 +665,9 @@  discard block
 block discarded – undo
665 665
  **/
666 666
 function balise_VALEUR_dist($p) {
667 667
 	$b = $p->nom_boucle ? $p->nom_boucle : $p->id_boucle;
668
-	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);;
668
+	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); ;
669 669
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
670
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
670
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
671 671
 	}
672 672
 	$p->interdire_scripts = true;
673 673
 
@@ -808,16 +808,16 @@  discard block
 block discarded – undo
808 808
 	$trouver_table = charger_fonction('trouver_table', 'base');
809 809
 	if ($desc = $trouver_table(table_objet_sql($type_objet))) {
810 810
 		if (isset($desc['field']['descriptif'])) {
811
-			$_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ',';
811
+			$_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).',';
812 812
 		}
813 813
 		if (isset($desc['field']['texte'])) {
814
-			$_ligne .= "'texte' => " . champ_sql('texte', $p) . ',';
814
+			$_ligne .= "'texte' => ".champ_sql('texte', $p).',';
815 815
 		}
816 816
 		if (isset($desc['field']['chapo'])) {
817
-			$_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ',';
817
+			$_ligne .= "'chapo' => ".champ_sql('chapo', $p).',';
818 818
 		}
819 819
 		if (isset($desc['introduction_longueur'])) {
820
-			$_introduction_longueur = "'" . $desc['introduction_longueur'] . "'";
820
+			$_introduction_longueur = "'".$desc['introduction_longueur']."'";
821 821
 		}
822 822
 	}
823 823
 	$_ligne .= ')';
@@ -913,10 +913,10 @@  discard block
 block discarded – undo
913 913
 		$c = memoriser_contexte_compil($p);
914 914
 
915 915
 		$p->code = sprintf(CODE_RECUPERER_FOND, "'modeles/lesauteurs'",
916
-			"array('objet'=>'" . $objet .
917
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
918
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
919
-			($objet == 'article' ? "" : ",'id_article' => " . champ_sql('id_article', $p)) .
916
+			"array('objet'=>'".$objet.
917
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
918
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
919
+			($objet == 'article' ? "" : ",'id_article' => ".champ_sql('id_article', $p)).
920 920
 			")",
921 921
 			"'trim'=>true, 'compil'=>array($c)",
922 922
 			_q($connect));
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 					$m = trim($m);
985 985
 					if ($m != "''") {
986 986
 						if (!preg_match(",\W,", $m)) {
987
-							$m = $boucle->id_table . ".$m";
987
+							$m = $boucle->id_table.".$m";
988 988
 						}
989 989
 						
990 990
 						$m .= " AS titre_rang";
@@ -1008,8 +1008,8 @@  discard block
 block discarded – undo
1008 1008
 			$_primary = champ_sql($id_table_objet, $p, '', false);
1009 1009
 			$_env = '$Pile[0]';
1010 1010
 
1011
-			if (!$_titre) {$_titre = "''";}
1012
-			if (!$_primary) {$_primary = "''";}
1011
+			if (!$_titre) {$_titre = "''"; }
1012
+			if (!$_primary) {$_primary = "''"; }
1013 1013
 			$_rang = "calculer_rang_smart($_titre, '$objet', $_primary, $_env)";
1014 1014
 
1015 1015
 		}
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 	$f_pagination = chercher_filtre('pagination');
1143 1143
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1144 1144
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1145
-		: ("'debut" . substr($type, 1));
1145
+		: ("'debut".substr($type, 1));
1146 1146
 
1147 1147
 	$p->code = sprintf(CODE_PAGINATION, $f_pagination, $b, $type, $modif, $pas, $liste,
1148 1148
 		((isset($__modele) and $__modele) ? $__modele : "''"), _q($connect), $code_contexte);
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' CHEMIN'));
1277 1277
 		erreur_squelette($msg, $p);
1278 1278
 	} else {
1279
-		$p->code = 'find_in_path(' . $arg . ')';
1279
+		$p->code = 'find_in_path('.$arg.')';
1280 1280
 	}
1281 1281
 
1282 1282
 	$p->interdire_scripts = false;
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' CHEMIN_IMAGE'));
1312 1312
 		erreur_squelette($msg, $p);
1313 1313
 	} else {
1314
-		$p->code = 'chemin_image(' . $arg . ')';
1314
+		$p->code = 'chemin_image('.$arg.')';
1315 1315
 	}
1316 1316
 
1317 1317
 	$p->interdire_scripts = false;
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1366 1366
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1367 1367
 		if ($src) {
1368
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1368
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1369 1369
 		} else {
1370 1370
 			$p->code = '@serialize($Pile[0])';
1371 1371
 		}
@@ -1418,8 +1418,8 @@  discard block
 block discarded – undo
1418 1418
 	$_sinon = interprete_argument_balise(2, $p);
1419 1419
 	$_unserialize = sinon(interprete_argument_balise(3, $p), "false");
1420 1420
 
1421
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1422
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1421
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1422
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1423 1423
 
1424 1424
 	return $p;
1425 1425
 }
@@ -1512,7 +1512,7 @@  discard block
 block discarded – undo
1512 1512
 		$err_b_s_a = array('zbug_balise_sans_argument', array('balise' => 'SESSION_SET'));
1513 1513
 		erreur_squelette($err_b_s_a, $p);
1514 1514
 	} else {
1515
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1515
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1516 1516
 	}
1517 1517
 
1518 1518
 	$p->interdire_scripts = false;
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 		if (preg_match(",^([[:space:]]*//[^\n]*\n)'([^']+)'$,ms",
1556 1556
 			$php, $r)) {
1557 1557
 			$p->code = /* $r[1]. */
1558
-				'(' . $r[2] . ')';
1558
+				'('.$r[2].')';
1559 1559
 		} else {
1560 1560
 			$p->code = "eval('return '.$php.';')";
1561 1561
 		}
@@ -1798,9 +1798,9 @@  discard block
 block discarded – undo
1798 1798
 
1799 1799
 		// noter la duree du cache dans un entete proprietaire
1800 1800
 
1801
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1801
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1802 1802
 			. $duree
1803
-			. '"); ?' . "'.'>'";
1803
+			. '"); ?'."'.'>'";
1804 1804
 
1805 1805
 		// Remplir le header Cache-Control
1806 1806
 		// cas #CACHE{0}
@@ -1820,9 +1820,9 @@  discard block
 block discarded – undo
1820 1820
 			if ($pa == 'cache-client'
1821 1821
 				and $duree > 0
1822 1822
 			) {
1823
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1823
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1824 1824
 					. $duree
1825
-					. '"); ?' . "'.'>'";
1825
+					. '"); ?'."'.'>'";
1826 1826
 				// il semble logique, si on cache-client, de ne pas invalider
1827 1827
 				$pa = 'statique';
1828 1828
 			}
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
 			if ($pa == 'statique'
1831 1831
 				and $duree > 0
1832 1832
 			) {
1833
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1833
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1834 1834
 			}
1835 1835
 		}
1836 1836
 	} else {
@@ -1995,9 +1995,9 @@  discard block
 block discarded – undo
1995 1995
 		if ($p->etoile) {
1996 1996
 			$_options[] = "'etoile'=>true";
1997 1997
 		}
1998
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ")";
1998
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).")";
1999 1999
 
2000
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2000
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2001 2001
 		if ($flag_env) {
2002 2002
 			$_l = "array_merge(\$Pile[0],$_l)";
2003 2003
 		}
@@ -2008,7 +2008,7 @@  discard block
 block discarded – undo
2008 2008
 		$msg = array('zbug_balise_sans_argument', array('balise' => ' INCLURE'));
2009 2009
 		erreur_squelette($msg, $p);
2010 2010
 	} else {
2011
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2011
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2012 2012
 	}
2013 2013
 
2014 2014
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 		unset($_contexte[1]);
2057 2057
 
2058 2058
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2059
-			$nom = "'modeles/" . substr($nom, 1);
2059
+			$nom = "'modeles/".substr($nom, 1);
2060 2060
 		} else {
2061 2061
 			$nom = "'modeles/' . $nom";
2062 2062
 		}
@@ -2073,8 +2073,8 @@  discard block
 block discarded – undo
2073 2073
 			$primary = $p->boucles[$p->id_boucle]->primary;
2074 2074
 			if (!strpos($primary, ',')) {
2075 2075
 				$id = champ_sql($primary, $p);
2076
-				$_contexte[] = "'$primary'=>" . $id;
2077
-				$_contexte[] = "'id'=>" . $id;
2076
+				$_contexte[] = "'$primary'=>".$id;
2077
+				$_contexte[] = "'id'=>".$id;
2078 2078
 			}
2079 2079
 		}
2080 2080
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2086,11 +2086,11 @@  discard block
 block discarded – undo
2086 2086
 		$_options = memoriser_contexte_compil($p);
2087 2087
 		$_options = "'compil'=>array($_options), 'trim'=>true";
2088 2088
 		if (isset($_contexte['ajax'])) {
2089
-			$_options .= ", " . preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2089
+			$_options .= ", ".preg_replace(",=>(.*)$,ims", '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2090 2090
 			unset($_contexte['ajax']);
2091 2091
 		}
2092 2092
 
2093
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2093
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2094 2094
 		if ($flag_env) {
2095 2095
 			$_l = "array_merge(\$Pile[0],$_l)";
2096 2096
 		}
@@ -2200,12 +2200,12 @@  discard block
 block discarded – undo
2200 2200
 function balise_DOUBLONS_dist($p) {
2201 2201
 	if ($type = interprete_argument_balise(1, $p)) {
2202 2202
 		if ($famille = interprete_argument_balise(2, $p)) {
2203
-			$type .= '.' . $famille;
2203
+			$type .= '.'.$famille;
2204 2204
 		}
2205
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2205
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2206 2206
 		if (!$p->etoile) {
2207 2207
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2208
-				. $p->code . ')))';
2208
+				. $p->code.')))';
2209 2209
 		}
2210 2210
 	} else {
2211 2211
 		$p->code = '$doublons';
@@ -2334,7 +2334,7 @@  discard block
 block discarded – undo
2334 2334
 			$_code[] = "$_key => $_val";
2335 2335
 		}
2336 2336
 	} while ($_key && $_val);
2337
-	$p->code = 'array(' . join(', ', $_code) . ')';
2337
+	$p->code = 'array('.join(', ', $_code).')';
2338 2338
 	$p->interdire_scripts = false;
2339 2339
 
2340 2340
 	return $p;
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 	while ($_val = interprete_argument_balise($n++, $p)) {
2362 2362
 		$_code[] = $_val;
2363 2363
 	}
2364
-	$p->code = 'array(' . join(', ', $_code) . ')';
2364
+	$p->code = 'array('.join(', ', $_code).')';
2365 2365
 	$p->interdire_scripts = false;
2366 2366
 
2367 2367
 	return $p;
@@ -2406,8 +2406,8 @@  discard block
 block discarded – undo
2406 2406
 		$_code[] = $_v;
2407 2407
 	}
2408 2408
 
2409
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(', ',
2410
-			$_code) . ')?" ":"")';
2409
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(', ',
2410
+			$_code).')?" ":"")';
2411 2411
 	$p->interdire_scripts = false;
2412 2412
 
2413 2413
 	return $p;
@@ -2440,7 +2440,7 @@  discard block
 block discarded – undo
2440 2440
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2441 2441
 
2442 2442
 	$f = chercher_filtre('info_plugin');
2443
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2443
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2444 2444
 
2445 2445
 	return $p;
2446 2446
 }
@@ -2690,12 +2690,12 @@  discard block
 block discarded – undo
2690 2690
 	$_issens = "in_array($_champ,array('>','<'))";
2691 2691
 	$_sens = "(strpos('< >',$_champ)-1)";
2692 2692
 
2693
-	$_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom'];
2693
+	$_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom'];
2694 2694
 	$_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)";
2695
-	$_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')";
2696
-	$_on = "\$s?(" . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)";
2695
+	$_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')";
2696
+	$_on = "\$s?(".$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)";
2697 2697
 
2698
-	$p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : "") . ")";
2698
+	$p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : "").")";
2699 2699
 	//$p->code = "''";
2700 2700
 	$p->interdire_scripts = false;
2701 2701
 
@@ -2769,7 +2769,7 @@  discard block
 block discarded – undo
2769 2769
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2770 2770
 	}
2771 2771
 
2772
-	$p->code = "(objet_test_si_publie(" . $_type . ",intval(" . $_id . ")," . _q($connect) . ")?' ':'')";
2772
+	$p->code = "(objet_test_si_publie(".$_type.",intval(".$_id."),"._q($connect).")?' ':'')";
2773 2773
 	$p->interdire_scripts = false;
2774 2774
 
2775 2775
 	return $p;
Please login to merge, or discard this patch.
ecrire/balise/info_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,12 +55,12 @@
 block discarded – undo
55 55
 		$_params = '[';
56 56
 		$nb_params = count($p->param[0]); // 1ère valeur vide donc 1 en plus
57 57
 		for ($i = 3; $i < $nb_params; $i++) {
58
-			$_params .= interprete_argument_balise($i, $p) . ',';
58
+			$_params .= interprete_argument_balise($i, $p).',';
59 59
 		}
60 60
 		$_params .= ']';
61 61
 
62 62
 		$info_sql = strtolower(substr($info, 5));
63
-		$code = "generer_info_entite($id_objet, $type_objet, '$info_sql', " . ($p->etoile ? _q($p->etoile) : "''") . ", $_params)";
63
+		$code = "generer_info_entite($id_objet, $type_objet, '$info_sql', ".($p->etoile ? _q($p->etoile) : "''").", $_params)";
64 64
 		$p->code = champ_sql($info, $p, $code);
65 65
 		$p->interdire_scripts = true;
66 66
 
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Spacing   +168 added lines, -169 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	}
95 95
 
96 96
 	include_fichiers_fonctions();
97
-	foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) {
97
+	foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) {
98 98
 		trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels
99 99
 		// fonction ou name\space\fonction
100 100
 		if (is_callable($f)) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	// affichage "GIT [master: abcdef]"
222 222
 	$commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit'];
223 223
 	if ($desc['branch']) {
224
-		$commit = $desc['branch'] . ': ' . $commit;
224
+		$commit = $desc['branch'].': '.$commit;
225 225
 	}
226 226
 	return "{$desc['vcs']} [$commit]";
227 227
 }
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 	}
241 241
 
242 242
 	// version installee par GIT
243
-	if (lire_fichier($dir . '/.git/HEAD', $c)) {
243
+	if (lire_fichier($dir.'/.git/HEAD', $c)) {
244 244
 		$currentHead = trim(substr($c, 4));
245
-		if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) {
245
+		if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) {
246 246
 			return [
247 247
 				'vcs' => 'GIT',
248 248
 				'branch' => basename($currentHead),
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 		$dir = '.';
270 270
 	}
271 271
 	// version installee par SVN
272
-	if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) {
273
-		$db = new SQLite3($dir . '/.svn/wc.db');
272
+	if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) {
273
+		$db = new SQLite3($dir.'/.svn/wc.db');
274 274
 		$result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1');
275 275
 		if ($result) {
276 276
 			$row = $result->fetchArray();
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
 
289 289
 // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images
290 290
 // et laisser passer les fonctions personnelles baptisees image_...
291
-$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php';
292
-$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php';
293
-$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php';
294
-$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php';
295
-$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php';
296
-$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php';
291
+$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php';
292
+$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php';
293
+$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php';
294
+$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php';
295
+$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php';
296
+$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php';
297 297
 
298 298
 $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php';
299 299
 $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php';
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function filtre_debug($val, $key = null) {
454 454
 	$debug = (
455
-		is_null($key) ? '' : (var_export($key, true) . " = ")
456
-		) . var_export($val, true);
455
+		is_null($key) ? '' : (var_export($key, true)." = ")
456
+		).var_export($val, true);
457 457
 
458 458
 	include_spip('inc/autoriser');
459 459
 	if (autoriser('webmestre')) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 						if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) {
553 553
 							$srcover = $match[1];
554 554
 							array_shift($args);
555
-							array_unshift($args, "<img src='" . $match[1] . "' />");
555
+							array_unshift($args, "<img src='".$match[1]."' />");
556 556
 							$srcover_filter = call_user_func_array($filtre, $args);
557 557
 							$srcover_filter = extraire_attribut($srcover_filter, 'src');
558 558
 							$reduit = str_replace($srcover, $srcover_filter, $reduit);
@@ -623,14 +623,14 @@  discard block
 block discarded – undo
623 623
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
624 624
 			}
625 625
 		}
626
-		elseif(strpos($src, "<svg") !== false) {
626
+		elseif (strpos($src, "<svg") !== false) {
627 627
 			include_spip('inc/svg');
628
-			if ($attrs = svg_lire_attributs($src)){
628
+			if ($attrs = svg_lire_attributs($src)) {
629 629
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
630
-				if (!$srcWidth){
630
+				if (!$srcWidth) {
631 631
 					$largeur_img[$src] = $srcWidth = $width;
632 632
 				}
633
-				if (!$srcHeight){
633
+				if (!$srcHeight) {
634 634
 					$hauteur_img[$src] = $srcHeight = $height;
635 635
 				}
636 636
 			}
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	// " -> &quot; et tout ce genre de choses
915 915
 	$u = $GLOBALS['meta']['pcre_u'];
916 916
 	$texte = str_replace("&nbsp;", " ", $texte);
917
-	$texte = preg_replace('/\s{2,}/S' . $u, " ", $texte);
917
+	$texte = preg_replace('/\s{2,}/S'.$u, " ", $texte);
918 918
 	// ne pas echapper les sinqle quotes car certains outils de syndication gerent mal
919 919
 	$texte = entites_html($texte, false, false);
920 920
 	// mais bien echapper les double quotes !
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  **/
975 975
 function supprimer_numero($texte) {
976 976
 	return preg_replace(
977
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
977
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
978 978
 		"", $texte);
979 979
 }
980 980
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
  **/
1000 1000
 function recuperer_numero($texte) {
1001 1001
 	if (preg_match(
1002
-		",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S",
1002
+		",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S",
1003 1003
 		$texte, $regs)) {
1004 1004
 		return strval($regs[1]);
1005 1005
 	} else {
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
  **/
1085 1085
 function textebrut($texte) {
1086 1086
 	$u = $GLOBALS['meta']['pcre_u'];
1087
-	$texte = preg_replace('/\s+/S' . $u, " ", $texte);
1088
-	$texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte);
1087
+	$texte = preg_replace('/\s+/S'.$u, " ", $texte);
1088
+	$texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte);
1089 1089
 	$texte = preg_replace("/^\n+/", "", $texte);
1090 1090
 	$texte = preg_replace("/\n+$/", "", $texte);
1091 1091
 	$texte = preg_replace("/\n +/", "\n", $texte);
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 	if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS",
1114 1114
 		$texte, $liens, PREG_PATTERN_ORDER)) {
1115 1115
 		foreach ($liens[0] as $a) {
1116
-			$rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel');
1116
+			$rel = 'noopener noreferrer '.extraire_attribut($a, 'rel');
1117 1117
 			$ablank = inserer_attribut($a, 'rel', $rel);
1118 1118
 			$ablank = inserer_attribut($ablank, 'target', '_blank');
1119 1119
 			$texte = str_replace($a, $ablank, $texte);
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 		foreach ($regs[0] as $a) {
1139 1139
 			$rel = extraire_attribut($a, "rel");
1140 1140
 			if (strpos($rel, "nofollow") === false) {
1141
-				$rel = "nofollow" . ($rel ? " $rel" : "");
1141
+				$rel = "nofollow".($rel ? " $rel" : "");
1142 1142
 				$anofollow = inserer_attribut($a, "rel", $rel);
1143 1143
 				$texte = str_replace($a, $anofollow, $texte);
1144 1144
 			}
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 	$u = $GLOBALS['meta']['pcre_u'];
1168 1168
 	$texte = preg_replace("@</p>@iS", "\n", $texte);
1169 1169
 	$texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte);
1170
-	$texte = preg_replace("@^\s*<br />@S" . $u, "", $texte);
1170
+	$texte = preg_replace("@^\s*<br />@S".$u, "", $texte);
1171 1171
 
1172 1172
 	return $texte;
1173 1173
 }
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		return $texte;
1199 1199
 	}
1200 1200
 	include_spip('inc/texte');
1201
-	$tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ?
1201
+	$tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ?
1202 1202
 		'div' : 'span';
1203 1203
 
1204 1204
 	return "<$tag style='word-wrap:break-word;'>$texte</$tag>";
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 function attribut_html($texte, $textebrut = true) {
1308 1308
 	$u = $GLOBALS['meta']['pcre_u'];
1309 1309
 	if ($textebrut) {
1310
-		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte));
1310
+		$texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte));
1311 1311
 	}
1312 1312
 	$texte = texte_backend($texte);
1313 1313
 	$texte = str_replace(array("'", '"'), array('&#039;', '&#034;'), $texte);
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 	# un message pour abs_url
1337 1337
 	$GLOBALS['mode_abs_url'] = 'url';
1338 1338
 	$url = trim($url);
1339
-	$r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS';
1339
+	$r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS';
1340 1340
 
1341 1341
 	return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url);
1342 1342
 }
@@ -1538,14 +1538,14 @@  discard block
 block discarded – undo
1538 1538
 	if (strpos($texte, "<") !== false) {
1539 1539
 		include_spip('inc/lien');
1540 1540
 		if (defined('_PREG_MODELE')) {
1541
-			$preg_modeles = "@" . _PREG_MODELE . "@imsS";
1541
+			$preg_modeles = "@"._PREG_MODELE."@imsS";
1542 1542
 			$texte = echappe_html($texte, '', true, $preg_modeles);
1543 1543
 		}
1544 1544
 	}
1545 1545
 
1546 1546
 	$debut = '';
1547 1547
 	$suite = $texte;
1548
-	while ($t = strpos('-' . $suite, "\n", 1)) {
1548
+	while ($t = strpos('-'.$suite, "\n", 1)) {
1549 1549
 		$debut .= substr($suite, 0, $t - 1);
1550 1550
 		$suite = substr($suite, $t);
1551 1551
 		$car = substr($suite, 0, 1);
@@ -1562,11 +1562,11 @@  discard block
 block discarded – undo
1562 1562
 			$suite = substr($suite, strlen($regs[0]));
1563 1563
 		}
1564 1564
 	}
1565
-	$texte = $debut . $suite;
1565
+	$texte = $debut.$suite;
1566 1566
 
1567 1567
 	$texte = echappe_retour($texte);
1568 1568
 
1569
-	return $texte . $fin;
1569
+	return $texte.$fin;
1570 1570
 }
1571 1571
 
1572 1572
 
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 		}
1628 1628
 
1629 1629
 		foreach ($regs as $reg) {
1630
-			$cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2];
1630
+			$cle = ($reg[1] ? $reg[1].':' : '').$reg[2];
1631 1631
 			$desc = $traduire($cle, $lang, true);
1632 1632
 			$l = $desc->langue;
1633 1633
 			// si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte.
@@ -1740,9 +1740,9 @@  discard block
 block discarded – undo
1740 1740
 					// il ne faut pas echapper en div si propre produit un seul paragraphe
1741 1741
 					include_spip('inc/texte');
1742 1742
 					$trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad));
1743
-					$mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1743
+					$mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span';
1744 1744
 					if ($mode === 'div') {
1745
-						$trad = rtrim($trad) . "\n\n";
1745
+						$trad = rtrim($trad)."\n\n";
1746 1746
 					}
1747 1747
 					$trad = code_echappement($trad, 'multi', false, $mode);
1748 1748
 					$trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l));
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
 	if (is_array($balise)) {
1937 1937
 		array_walk(
1938 1938
 			$balise,
1939
-			function(&$a, $key, $t){
1939
+			function(&$a, $key, $t) {
1940 1940
 				$a = extraire_attribut($a, $t);
1941 1941
 			},
1942 1942
 			$attribut
@@ -2023,14 +2023,14 @@  discard block
 block discarded – undo
2023 2023
 
2024 2024
 	if ($old !== null) {
2025 2025
 		// Remplacer l'ancien attribut du meme nom
2026
-		$balise = $r[1] . $insert . $r[5];
2026
+		$balise = $r[1].$insert.$r[5];
2027 2027
 	} else {
2028 2028
 		// preferer une balise " />" (comme <img />)
2029 2029
 		if (preg_match(',/>,', $balise)) {
2030
-			$balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1);
2030
+			$balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1);
2031 2031
 		} // sinon une balise <a ...> ... </a>
2032 2032
 		else {
2033
-			$balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1);
2033
+			$balise = preg_replace(",\s?>,S", $insert.">", $balise, 1);
2034 2034
 		}
2035 2035
 	}
2036 2036
 
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
  * @param string $operation
2064 2064
  * @return string
2065 2065
  */
2066
-function modifier_class($balise, $class, $operation='ajouter') {
2066
+function modifier_class($balise, $class, $operation = 'ajouter') {
2067 2067
 	if (is_string($class)) {
2068 2068
 		$class = explode(' ', trim($class));
2069 2069
 	}
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 				}
2089 2089
 				if (in_array($operation, ['ajouter', 'commuter'])
2090 2090
 					and !$is_class_presente) {
2091
-					$class_new = rtrim($class_new) . " " . $c;
2091
+					$class_new = rtrim($class_new)." ".$c;
2092 2092
 				}
2093 2093
 				elseif (in_array($operation, ['supprimer', 'commuter'])
2094 2094
 					and $is_class_presente) {
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
  * @param string|array $class
2117 2117
  * @return string
2118 2118
  */
2119
-function ajouter_class($balise, $class){
2119
+function ajouter_class($balise, $class) {
2120 2120
 	return modifier_class($balise, $class, 'ajouter');
2121 2121
 }
2122 2122
 
@@ -2126,7 +2126,7 @@  discard block
 block discarded – undo
2126 2126
  * @param string|array $class
2127 2127
  * @return string
2128 2128
  */
2129
-function supprimer_class($balise, $class){
2129
+function supprimer_class($balise, $class) {
2130 2130
 	return modifier_class($balise, $class, 'supprimer');
2131 2131
 }
2132 2132
 
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
  * @param string|array $class
2138 2138
  * @return string
2139 2139
  */
2140
-function commuter_class($balise, $class){
2140
+function commuter_class($balise, $class) {
2141 2141
 	return modifier_class($balise, $class, 'commuter');
2142 2142
 }
2143 2143
 
@@ -2157,8 +2157,8 @@  discard block
 block discarded – undo
2157 2157
 //
2158 2158
 // Quelques fonctions de calcul arithmetique
2159 2159
 //
2160
-function floatstr($a) { return str_replace(',','.',(string)floatval($a)); }
2161
-function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); }
2160
+function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); }
2161
+function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); }
2162 2162
 
2163 2163
 /**
2164 2164
  * Additionne 2 nombres
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
 function plus($a, $b) {
2179 2179
 	return $a + $b;
2180 2180
 }
2181
-function strplus($a, $b) {return strize('plus', $a, $b);}
2181
+function strplus($a, $b) {return strize('plus', $a, $b); }
2182 2182
 /**
2183 2183
  * Soustrait 2 nombres
2184 2184
  *
@@ -2197,7 +2197,7 @@  discard block
 block discarded – undo
2197 2197
 function moins($a, $b) {
2198 2198
 	return $a - $b;
2199 2199
 }
2200
-function strmoins($a, $b) {return strize('moins', $a, $b);}
2200
+function strmoins($a, $b) {return strize('moins', $a, $b); }
2201 2201
 
2202 2202
 /**
2203 2203
  * Multiplie 2 nombres
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
 function mult($a, $b) {
2219 2219
 	return $a * $b;
2220 2220
 }
2221
-function strmult($a, $b) {return strize('mult', $a, $b);}
2221
+function strmult($a, $b) {return strize('mult', $a, $b); }
2222 2222
 
2223 2223
 /**
2224 2224
  * Divise 2 nombres
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
 function div($a, $b) {
2240 2240
 	return $b ? $a / $b : 0;
2241 2241
 }
2242
-function strdiv($a, $b) {return strize('div', $a, $b);}
2242
+function strdiv($a, $b) {return strize('div', $a, $b); }
2243 2243
 
2244 2244
 /**
2245 2245
  * Retourne le modulo 2 nombres
@@ -2280,13 +2280,13 @@  discard block
 block discarded – undo
2280 2280
 	if (!defined('_TAGS_NOM_AUTEUR')) {
2281 2281
 		define('_TAGS_NOM_AUTEUR', '');
2282 2282
 	}
2283
-	$tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR));
2283
+	$tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR));
2284 2284
 	foreach ($tags_acceptes as $tag) {
2285 2285
 		if (strlen($tag)) {
2286
-			$remp1[] = '<' . trim($tag) . '>';
2287
-			$remp1[] = '</' . trim($tag) . '>';
2288
-			$remp2[] = '\x60' . trim($tag) . '\x61';
2289
-			$remp2[] = '\x60/' . trim($tag) . '\x61';
2286
+			$remp1[] = '<'.trim($tag).'>';
2287
+			$remp1[] = '</'.trim($tag).'>';
2288
+			$remp2[] = '\x60'.trim($tag).'\x61';
2289
+			$remp2[] = '\x60/'.trim($tag).'\x61';
2290 2290
 		}
2291 2291
 	}
2292 2292
 	$v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom)));
@@ -2336,7 +2336,7 @@  discard block
 block discarded – undo
2336 2336
 			$s[] = preg_replace(',>[^<]+</a>,S',
2337 2337
 				'>'
2338 2338
 				. http_img_pack('attachment-16.png', $t,
2339
-					'title="' . attribut_html($t) . '"')
2339
+					'title="'.attribut_html($t).'"')
2340 2340
 				. '</a>', $tag);
2341 2341
 		}
2342 2342
 	}
@@ -2397,10 +2397,10 @@  discard block
 block discarded – undo
2397 2397
 	$fichier = basename($url);
2398 2398
 
2399 2399
 	return '<a rel="enclosure"'
2400
-	. ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '')
2401
-	. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2402
-	. ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '')
2403
-	. '>' . $fichier . '</a>';
2400
+	. ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '')
2401
+	. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2402
+	. ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '')
2403
+	. '>'.$fichier.'</a>';
2404 2404
 }
2405 2405
 
2406 2406
 /**
@@ -2428,9 +2428,9 @@  discard block
 block discarded – undo
2428 2428
 			} # vieux data
2429 2429
 			$fichier = basename($url);
2430 2430
 			$enclosures[] = '<enclosure'
2431
-				. ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '')
2432
-				. ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '')
2433
-				. ($length ? ' length="' . $length . '"' : '')
2431
+				. ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '')
2432
+				. ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '')
2433
+				. ($length ? ' length="'.$length.'"' : '')
2434 2434
 				. ' />';
2435 2435
 		}
2436 2436
 	}
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 		if (extraire_attribut($e, 'rel') == 'tag') {
2457 2457
 			$subjects .= '<dc:subject>'
2458 2458
 				. texte_backend(textebrut($e))
2459
-				. '</dc:subject>' . "\n";
2459
+				. '</dc:subject>'."\n";
2460 2460
 		}
2461 2461
 	}
2462 2462
 
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
 	if (is_array($texte)) {
2493 2493
 		array_walk(
2494 2494
 			$texte,
2495
-			function(&$a, $key, $t){
2495
+			function(&$a, $key, $t) {
2496 2496
 				$a = extraire_balise($a, $t);
2497 2497
 			},
2498 2498
 			$tag
@@ -2536,7 +2536,7 @@  discard block
 block discarded – undo
2536 2536
 	if (is_array($texte)) {
2537 2537
 		array_walk(
2538 2538
 			$texte,
2539
-			function(&$a, $key, $t){
2539
+			function(&$a, $key, $t) {
2540 2540
 				$a = extraire_balises($a, $t);
2541 2541
 			},
2542 2542
 			$tag
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 		if ($fond != '404') {
2663 2663
 			$contexte = array_shift($p);
2664 2664
 			$contexte['page'] = $fond;
2665
-			$action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
2665
+			$action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action);
2666 2666
 		}
2667 2667
 	}
2668 2668
 	// defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
@@ -2717,9 +2717,9 @@  discard block
 block discarded – undo
2717 2717
 			. '"'
2718 2718
 			. (is_null($val)
2719 2719
 				? ''
2720
-				: ' value="' . entites_html($val) . '"'
2720
+				: ' value="'.entites_html($val).'"'
2721 2721
 			)
2722
-			. ' type="hidden"' . "\n/>";
2722
+			. ' type="hidden"'."\n/>";
2723 2723
 	}
2724 2724
 
2725 2725
 	return join("", $hidden);
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 	return preg_replace_callback(
2831 2831
 		",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims",
2832 2832
 		function($x) use ($path) {
2833
-			return "url('" . suivre_lien($path, $x[1]) . "')";
2833
+			return "url('".suivre_lien($path, $x[1])."')";
2834 2834
 		},
2835 2835
 		$contenu
2836 2836
 	);
@@ -2892,14 +2892,14 @@  discard block
 block discarded – undo
2892 2892
 	) {
2893 2893
 		$distant = true;
2894 2894
 		$cssf = parse_url($css);
2895
-		$cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : "");
2895
+		$cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : "");
2896 2896
 		$cssf = preg_replace(',[?:&=],', "_", $cssf);
2897 2897
 	} else {
2898 2898
 		$distant = false;
2899 2899
 		$cssf = $css;
2900 2900
 		// 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi
2901 2901
 		//propose (rien a faire dans ce cas)
2902
-		$f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css);
2902
+		$f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css);
2903 2903
 		if (@file_exists($f)) {
2904 2904
 			return $f;
2905 2905
 		}
@@ -2909,7 +2909,7 @@  discard block
 block discarded – undo
2909 2909
 	$dir_var = sous_repertoire(_DIR_VAR, 'cache-css');
2910 2910
 	$f = $dir_var
2911 2911
 		. preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf)
2912
-		. '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css';
2912
+		. '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css';
2913 2913
 
2914 2914
 	// la css peut etre distante (url absolue !)
2915 2915
 	if ($distant) {
@@ -2954,8 +2954,8 @@  discard block
 block discarded – undo
2954 2954
 		} // si la css_direction commence par $dir_var on la fait passer pour une absolue
2955 2955
 		elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) {
2956 2956
 			$css_direction = substr($css_direction, strlen($dir_var));
2957
-			$src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction;
2958
-			$css_direction = "/@@@@@@/" . $css_direction;
2957
+			$src_faux_abs["/@@@@@@/".$css_direction] = $css_direction;
2958
+			$css_direction = "/@@@@@@/".$css_direction;
2959 2959
 		}
2960 2960
 		$src[] = $regs[0][$k];
2961 2961
 		$src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]);
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
 
3005 3005
 	$f = basename($css, '.css');
3006 3006
 	$f = sous_repertoire(_DIR_VAR, 'cache-css')
3007
-		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f)
3007
+		. preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f)
3008 3008
 		. '.css';
3009 3009
 
3010 3010
 	if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) {
@@ -3013,7 +3013,7 @@  discard block
 block discarded – undo
3013 3013
 
3014 3014
 	if ($url_absolue_css == $css) {
3015 3015
 		if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0
3016
-			or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu)
3016
+			or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu)
3017 3017
 		) {
3018 3018
 			include_spip('inc/distant');
3019 3019
 			$contenu = recuperer_url($css);
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
 	$expression = str_replace("\/", "/", $expression);
3126 3126
 	$expression = str_replace("/", "\/", $expression);
3127 3127
 
3128
-	if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) {
3128
+	if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) {
3129 3129
 		if (isset($r[$capte])) {
3130 3130
 			return $r[$capte];
3131 3131
 		} else {
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 	$expression = str_replace("\/", "/", $expression);
3164 3164
 	$expression = str_replace("/", "\/", $expression);
3165 3165
 
3166
-	return preg_replace('/' . $expression . '/' . $modif, $replace, $texte);
3166
+	return preg_replace('/'.$expression.'/'.$modif, $replace, $texte);
3167 3167
 }
3168 3168
 
3169 3169
 
@@ -3182,7 +3182,7 @@  discard block
 block discarded – undo
3182 3182
 function traiter_doublons_documents(&$doublons, $letexte) {
3183 3183
 
3184 3184
 	// Verifier dans le texte & les notes (pas beau, helas)
3185
-	$t = $letexte . $GLOBALS['les_notes'];
3185
+	$t = $letexte.$GLOBALS['les_notes'];
3186 3186
 
3187 3187
 	if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile
3188 3188
 		and preg_match_all(
@@ -3192,7 +3192,7 @@  discard block
 block discarded – undo
3192 3192
 		if (!isset($doublons['documents'])) {
3193 3193
 			$doublons['documents'] = "";
3194 3194
 		}
3195
-		$doublons['documents'] .= "," . join(',', $matches[1]);
3195
+		$doublons['documents'] .= ",".join(',', $matches[1]);
3196 3196
 	}
3197 3197
 
3198 3198
 	return $letexte;
@@ -3249,7 +3249,7 @@  discard block
 block discarded – undo
3249 3249
 	if ($env) {
3250 3250
 		foreach ($env as $i => $j) {
3251 3251
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3252
-				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3252
+				$texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />";
3253 3253
 			}
3254 3254
 		}
3255 3255
 	}
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
 	if ($env) {
3289 3289
 		foreach ($env as $i => $j) {
3290 3290
 			if (is_string($j) and !in_array($i, $ignore_params)) {
3291
-				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3291
+				$texte .= attribut_html($i)."='".attribut_html($j)."' ";
3292 3292
 			}
3293 3293
 		}
3294 3294
 	}
@@ -3371,19 +3371,19 @@  discard block
 block discarded – undo
3371 3371
 
3372 3372
 	$img_file = $img;
3373 3373
 	if ($p = strpos($img_file, '?')) {
3374
-		$img_file = substr($img_file,0, $p);
3374
+		$img_file = substr($img_file, 0, $p);
3375 3375
 	}
3376 3376
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3377 3377
 		$img_file = chemin_image($img);
3378 3378
 	}
3379 3379
 	else {
3380
-		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3380
+		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) {
3381 3381
 			// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3382 3382
 			// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
3383 3383
 			if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m)
3384
-			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg"
3384
+			  and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg"
3385 3385
 			  and file_exists($variante_svg_generique)) {
3386
-				if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3386
+				if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) {
3387 3387
 					$img_file = $variante_svg_size;
3388 3388
 				}
3389 3389
 				else {
@@ -3408,7 +3408,7 @@  discard block
 block discarded – undo
3408 3408
 				return "";
3409 3409
 			}
3410 3410
 		}
3411
-		$atts .= " width='" . $largeur . "' height='" . $hauteur . "'";
3411
+		$atts .= " width='".$largeur."' height='".$hauteur."'";
3412 3412
 	}
3413 3413
 
3414 3414
 	if (file_exists($img_file)) {
@@ -3417,15 +3417,15 @@  discard block
 block discarded – undo
3417 3417
 	if ($alt === false) {
3418 3418
 		$alt = '';
3419 3419
 	}
3420
-	elseif($alt or $alt==='') {
3420
+	elseif ($alt or $alt === '') {
3421 3421
 		$alt = " alt='".attribut_html($alt)."'";
3422 3422
 	}
3423 3423
 	else {
3424 3424
 		$alt = " alt='".attribut_html($title)."'";
3425 3425
 	}
3426 3426
 	return "<img src='$img_file'$alt"
3427
-	. ($title ? ' title="' . attribut_html($title) . '"' : '')
3428
-	. " " . ltrim($atts)
3427
+	. ($title ? ' title="'.attribut_html($title).'"' : '')
3428
+	. " ".ltrim($atts)
3429 3429
 	. " />";
3430 3430
 }
3431 3431
 
@@ -3437,12 +3437,12 @@  discard block
 block discarded – undo
3437 3437
  * @param string $size
3438 3438
  * @return string
3439 3439
  */
3440
-function http_style_background($img, $att = '', $size=null) {
3441
-	if ($size and is_numeric($size)){
3442
-		$size = trim($size) . "px";
3440
+function http_style_background($img, $att = '', $size = null) {
3441
+	if ($size and is_numeric($size)) {
3442
+		$size = trim($size)."px";
3443 3443
 	}
3444
-	return " style='background" .
3445
-		($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";"
3444
+	return " style='background".
3445
+		($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";"
3446 3446
 		. ($size ? "background-size:{$size};" : '')
3447 3447
 		. "'";
3448 3448
 }
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
 			$args[] = $maybe_size;
3469 3469
 			$maybe_size = null;
3470 3470
 		}
3471
-		while (count($args)<2) {
3471
+		while (count($args) < 2) {
3472 3472
 			$args[] = null; // default alt or class
3473 3473
 		}
3474 3474
 		$args[] = $maybe_size;
@@ -3478,7 +3478,7 @@  discard block
 block discarded – undo
3478 3478
 
3479 3479
 function helper_filtre_balise_img_svg_size($img, $size) {
3480 3480
 	// si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite
3481
-	if (strpos($size, '@') === 0 and substr($size,-1) === 'x') {
3481
+	if (strpos($size, '@') === 0 and substr($size, -1) === 'x') {
3482 3482
 		$coef = floatval(substr($size, 1, -1));
3483 3483
 		list($h, $w) = taille_image($img);
3484 3484
 		$height = intval(round($h / $coef));
@@ -3533,7 +3533,7 @@  discard block
 block discarded – undo
3533 3533
  * @return string
3534 3534
  *     Code HTML de la balise IMG
3535 3535
  */
3536
-function filtre_balise_img_dist($img, $alt = '', $class = null, $size=null) {
3536
+function filtre_balise_img_dist($img, $alt = '', $class = null, $size = null) {
3537 3537
 
3538 3538
 	list($alt, $class, $size) = helper_filtre_balise_img_svg_arguments($alt, $class, $size);
3539 3539
 
@@ -3552,7 +3552,7 @@  discard block
 block discarded – undo
3552 3552
 		}
3553 3553
 	}
3554 3554
 	else {
3555
-		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3555
+		$img = http_img_pack($img, $alt, $class ? " class='".attribut_html($class)."'" : '', '',
3556 3556
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3557 3557
 		if (is_null($alt)) {
3558 3558
 			$img = vider_attribut($img, 'alt');
@@ -3598,16 +3598,16 @@  discard block
 block discarded – undo
3598 3598
  * @return string
3599 3599
  *     Code HTML de la balise SVG
3600 3600
  */
3601
-function filtre_balise_svg_dist($img, $alt = '', $class = null, $size=null) {
3601
+function filtre_balise_svg_dist($img, $alt = '', $class = null, $size = null) {
3602 3602
 
3603 3603
 	$img = trim($img);
3604 3604
 	$img_file = $img;
3605
-	if (strpos($img, '<svg') === false){
3606
-		if ($p = strpos($img_file, '?')){
3605
+	if (strpos($img, '<svg') === false) {
3606
+		if ($p = strpos($img_file, '?')) {
3607 3607
 			$img_file = substr($img_file, 0, $p);
3608 3608
 		}
3609 3609
 
3610
-		if (!$img_file or !$svg = file_get_contents($img_file)){
3610
+		if (!$img_file or !$svg = file_get_contents($img_file)) {
3611 3611
 			return '';
3612 3612
 		}
3613 3613
 	}
@@ -3622,7 +3622,7 @@  discard block
 block discarded – undo
3622 3622
 	$balise_svg_source = $balise_svg;
3623 3623
 
3624 3624
 	// entete XML à supprimer
3625
-	$svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg);
3625
+	$svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg);
3626 3626
 
3627 3627
 	// IE est toujours mon ami
3628 3628
 	$balise_svg = inserer_attribut($balise_svg, 'focusable', 'false');
@@ -3638,11 +3638,11 @@  discard block
 block discarded – undo
3638 3638
 	}
3639 3639
 
3640 3640
 	// regler le alt
3641
-	if ($alt){
3641
+	if ($alt) {
3642 3642
 		$balise_svg = inserer_attribut($balise_svg, 'role', 'img');
3643
-		$id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4);
3643
+		$id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4);
3644 3644
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3645
-		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3645
+		$title = "<title id=\"$id\">".entites_html($alt)."</title>\n";
3646 3646
 		$balise_svg .= $title;
3647 3647
 	}
3648 3648
 	else {
@@ -3689,7 +3689,7 @@  discard block
 block discarded – undo
3689 3689
 	$texte = '';
3690 3690
 	if (is_array($tableau)) {
3691 3691
 		foreach ($tableau as $k => $v) {
3692
-			$res = recuperer_fond('modeles/' . $modele,
3692
+			$res = recuperer_fond('modeles/'.$modele,
3693 3693
 				array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v)))
3694 3694
 			);
3695 3695
 			$texte .= $res;
@@ -3866,7 +3866,7 @@  discard block
 block discarded – undo
3866 3866
 	}
3867 3867
 
3868 3868
 	$c = serialize($c);
3869
-	$cle = calculer_cle_action($form . $c);
3869
+	$cle = calculer_cle_action($form.$c);
3870 3870
 	$c = "$cle:$c";
3871 3871
 
3872 3872
 	// on ne stocke pas les contextes dans des fichiers en cache
@@ -3923,15 +3923,15 @@  discard block
 block discarded – undo
3923 3923
 	}
3924 3924
 	// toujours encoder l'url source dans le bloc ajax
3925 3925
 	$r = self();
3926
-	$r = ' data-origin="' . $r . '"';
3926
+	$r = ' data-origin="'.$r.'"';
3927 3927
 	$class = 'ajaxbloc';
3928 3928
 	if ($ajaxid and is_string($ajaxid)) {
3929 3929
 		// ajaxid est normalement conforme a un nom de classe css
3930 3930
 		// on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution
3931
-		$class .= ' ajax-id-' . entites_html($ajaxid);
3931
+		$class .= ' ajax-id-'.entites_html($ajaxid);
3932 3932
 	}
3933 3933
 
3934
-	return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3934
+	return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n";
3935 3935
 }
3936 3936
 
3937 3937
 /**
@@ -3970,11 +3970,11 @@  discard block
 block discarded – undo
3970 3970
 	// extraire la signature en debut de contexte
3971 3971
 	// et la verifier avant de deserializer
3972 3972
 	// format : signature:donneesserializees
3973
-	if ($p = strpos($c,":")){
3974
-		$cle = substr($c,0,$p);
3975
-		$c = substr($c,$p+1);
3973
+	if ($p = strpos($c, ":")) {
3974
+		$cle = substr($c, 0, $p);
3975
+		$c = substr($c, $p + 1);
3976 3976
 
3977
-		if ($cle == calculer_cle_action($form . $c)) {
3977
+		if ($cle == calculer_cle_action($form.$c)) {
3978 3978
 			$env = @unserialize($c);
3979 3979
 			return $env;
3980 3980
 		}
@@ -4080,24 +4080,24 @@  discard block
 block discarded – undo
4080 4080
 		$att = "";
4081 4081
 		// si $on passe la balise et optionnelement une ou ++classe
4082 4082
 		// a.active span.selected.active etc....
4083
-		if (is_string($on) and (strncmp($on, 'a', 1)==0 or strncmp($on, 'span', 4)==0 or strncmp($on, 'strong', 6)==0)){
4083
+		if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) {
4084 4084
 			$on = explode(".", $on);
4085 4085
 			// on verifie que c'est exactement une des 3 balises a, span ou strong
4086
-			if (in_array(reset($on), array('a', 'span', 'strong'))){
4086
+			if (in_array(reset($on), array('a', 'span', 'strong'))) {
4087 4087
 				$bal = array_shift($on);
4088 4088
 				$class = implode(" ", $on);
4089
-				if ($bal=="a"){
4089
+				if ($bal == "a") {
4090 4090
 					$att = 'href="#" ';
4091 4091
 				}
4092 4092
 			}
4093 4093
 		}
4094
-		$att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"';
4094
+		$att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"';
4095 4095
 	} else {
4096 4096
 		$bal = 'a';
4097 4097
 		$att = "href='$url'"
4098
-			. ($title ? " title='" . attribut_html($title) . "'" : '')
4099
-			. ($class ? " class='" . attribut_html($class) . "'" : '')
4100
-			. ($rel ? " rel='" . attribut_html($rel) . "'" : '')
4098
+			. ($title ? " title='".attribut_html($title)."'" : '')
4099
+			. ($class ? " class='".attribut_html($class)."'" : '')
4100
+			. ($rel ? " rel='".attribut_html($rel)."'" : '')
4101 4101
 			. $evt;
4102 4102
 	}
4103 4103
 	if ($libelle === null) {
@@ -4232,7 +4232,7 @@  discard block
 block discarded – undo
4232 4232
 
4233 4233
 	// Icône
4234 4234
 	$icone = http_img_pack($fond, $alt, "width='$size' height='$size'");
4235
-	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>";
4235
+	$icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>";
4236 4236
 
4237 4237
 	// Markup final
4238 4238
 	if ($type == 'lien') {
@@ -4467,7 +4467,7 @@  discard block
 block discarded – undo
4467 4467
 		if (is_array($detail->sousmenu)) {
4468 4468
 			foreach ($detail->sousmenu as $souspage => $sousdetail) {
4469 4469
 				if ($sousdetail->icone and strlen(trim($sousdetail->icone))) {
4470
-					$res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}";
4470
+					$res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}";
4471 4471
 				}
4472 4472
 			}
4473 4473
 		}
@@ -4504,20 +4504,20 @@  discard block
 block discarded – undo
4504 4504
 		$class_form = 'ajax';
4505 4505
 		$class = str_replace('ajax', '', $class);
4506 4506
 	}
4507
-	$class_btn = 'submit ' . trim($class);
4507
+	$class_btn = 'submit '.trim($class);
4508 4508
 
4509 4509
 	if ($confirm) {
4510
-		$confirm = "confirm(\"" . attribut_html($confirm) . "\")";
4510
+		$confirm = "confirm(\"".attribut_html($confirm)."\")";
4511 4511
 		if ($callback) {
4512 4512
 			$callback = "$confirm?($callback):false";
4513 4513
 		} else {
4514 4514
 			$callback = $confirm;
4515 4515
 		}
4516 4516
 	}
4517
-	$onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : "";
4517
+	$onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : "";
4518 4518
 	$title = $title ? " title='$title'" : '';
4519 4519
 
4520
-	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url)
4520
+	return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url)
4521 4521
 	. "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>";
4522 4522
 }
4523 4523
 
@@ -4581,14 +4581,14 @@  discard block
 block discarded – undo
4581 4581
 		$champ_titre = "";
4582 4582
 		if ($demande_titre) {
4583 4583
 			// si pas de titre declare mais champ titre, il sera peuple par le select *
4584
-			$champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : '';
4584
+			$champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : '';
4585 4585
 		}
4586 4586
 		include_spip('base/abstract_sql');
4587 4587
 		include_spip('base/connect_sql');
4588 4588
 		$objets[$type_objet][$id_objet] = sql_fetsel(
4589
-			'*' . $champ_titre,
4589
+			'*'.$champ_titre,
4590 4590
 			$desc['table_sql'],
4591
-			id_table_objet($type_objet) . ' = ' . intval($id_objet)
4591
+			id_table_objet($type_objet).' = '.intval($id_objet)
4592 4592
 		);
4593 4593
 
4594 4594
 		// Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci
@@ -4662,8 +4662,7 @@  discard block
 block discarded – undo
4662 4662
 	if (isset($ligne_sql['chapo'])) {
4663 4663
 		$chapo = $ligne_sql['chapo'];
4664 4664
 		$texte = strlen($descriptif) ?
4665
-			'' :
4666
-			"$chapo \n\n $texte";
4665
+			'' : "$chapo \n\n $texte";
4667 4666
 	}
4668 4667
 
4669 4668
 	// Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur
@@ -4730,7 +4729,7 @@  discard block
 block discarded – undo
4730 4729
 		return $texte;
4731 4730
 	}
4732 4731
 
4733
-	$traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement);
4732
+	$traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement);
4734 4733
 
4735 4734
 	// Fournir $connect et $Pile[0] au traitement si besoin
4736 4735
 	$Pile = array(0 => $env);
@@ -4764,7 +4763,7 @@  discard block
 block discarded – undo
4764 4763
 	}
4765 4764
 	$url = generer_url_entite($id_objet, $objet, '', '', $connect);
4766 4765
 
4767
-	return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>";
4766
+	return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>";
4768 4767
 }
4769 4768
 
4770 4769
 
@@ -4783,10 +4782,10 @@  discard block
 block discarded – undo
4783 4782
 function wrap($texte, $wrap) {
4784 4783
 	$balises = extraire_balises($wrap);
4785 4784
 	if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) {
4786
-		$texte = $wrap . $texte;
4785
+		$texte = $wrap.$texte;
4787 4786
 		$regs = array_reverse($regs[1]);
4788
-		$wrap = "</" . implode("></", $regs) . ">";
4789
-		$texte = $texte . $wrap;
4787
+		$wrap = "</".implode("></", $regs).">";
4788
+		$texte = $texte.$wrap;
4790 4789
 	}
4791 4790
 
4792 4791
 	return $texte;
@@ -4817,7 +4816,7 @@  discard block
 block discarded – undo
4817 4816
 
4818 4817
 	// caster $u en array si besoin
4819 4818
 	if (is_object($u)) {
4820
-		$u = (array)$u;
4819
+		$u = (array) $u;
4821 4820
 	}
4822 4821
 
4823 4822
 	if (is_array($u)) {
@@ -4838,7 +4837,7 @@  discard block
 block discarded – undo
4838 4837
 		// sinon on passe a la ligne et on indente
4839 4838
 		$i_str = str_pad("", $indent, " ");
4840 4839
 		foreach ($u as $k => $v) {
4841
-			$out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2);
4840
+			$out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2);
4842 4841
 		}
4843 4842
 
4844 4843
 		return $out;
@@ -4891,8 +4890,8 @@  discard block
 block discarded – undo
4891 4890
  * @param string $class
4892 4891
  * @return string
4893 4892
  */
4894
-function objet_icone($objet, $taille = 24, $class='') {
4895
-	$icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png";
4893
+function objet_icone($objet, $taille = 24, $class = '') {
4894
+	$icone = objet_info($objet, 'icone_objet')."-".$taille.".png";
4896 4895
 	$icone = chemin_image($icone);
4897 4896
 	$balise_img = charger_filtre('balise_img');
4898 4897
 
@@ -4916,12 +4915,12 @@  discard block
 block discarded – undo
4916 4915
  * @param array $options
4917 4916
  * @return string
4918 4917
  */
4919
-function objet_T($objet, $chaine, $args = array(), $options = array()){
4920
-	$chaine = explode(':',$chaine);
4921
-	if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) {
4918
+function objet_T($objet, $chaine, $args = array(), $options = array()) {
4919
+	$chaine = explode(':', $chaine);
4920
+	if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) {
4922 4921
 		return $t;
4923 4922
 	}
4924
-	$chaine = implode(':',$chaine);
4923
+	$chaine = implode(':', $chaine);
4925 4924
 	return _T($chaine, $args, $options);
4926 4925
 }
4927 4926
 
@@ -4981,7 +4980,7 @@  discard block
 block discarded – undo
4981 4980
 	$cache = recuperer_fond($fond, $contexte, $options, $connect);
4982 4981
 
4983 4982
 	// calculer le nom de la css
4984
-	$dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension);
4983
+	$dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension);
4985 4984
 	$nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond));
4986 4985
 	$contexte_implicite = calculer_contexte_implicite();
4987 4986
 
@@ -4989,22 +4988,22 @@  discard block
 block discarded – undo
4989 4988
 	// mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu
4990 4989
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
4991 4990
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
4992
-		$hash = md5($contexte_implicite['host'] . '::'. $cache);
4991
+		$hash = md5($contexte_implicite['host'].'::'.$cache);
4993 4992
 	}
4994 4993
 	else {
4995 4994
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
4996 4995
 		ksort($contexte);
4997
-		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
4996
+		$hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect);
4998 4997
 	}
4999
-	$filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension";
4998
+	$filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension";
5000 4999
 
5001 5000
 	// mettre a jour le fichier si il n'existe pas
5002 5001
 	// ou trop ancien
5003 5002
 	// le dernier fichier produit est toujours suffixe par .last
5004 5003
 	// et recopie sur le fichier cible uniquement si il change
5005 5004
 	if (!file_exists($filename)
5006
-		or !file_exists($filename . ".last")
5007
-		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified'])
5005
+		or !file_exists($filename.".last")
5006
+		or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified'])
5008 5007
 		or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
5009 5008
 	) {
5010 5009
 		$contenu = $cache['texte'];
@@ -5023,10 +5022,10 @@  discard block
 block discarded – undo
5023 5022
 			}
5024 5023
 			// pas de date dans le commentaire car sinon ca invalide le md5 et force la maj
5025 5024
 			// mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non
5026
-			$comment .= "}\n   md5:" . md5($contenu) . " */\n";
5025
+			$comment .= "}\n   md5:".md5($contenu)." */\n";
5027 5026
 		}
5028 5027
 		// et ecrire le fichier si il change
5029
-		ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true);
5028
+		ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true);
5030 5029
 	}
5031 5030
 
5032 5031
 	return timestamp($filename);
@@ -5221,11 +5220,11 @@  discard block
 block discarded – undo
5221 5220
 function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) {
5222 5221
 	$l = strlen($passe);
5223 5222
 
5224
-	if ($l<=8 or !$afficher_partiellement){
5223
+	if ($l <= 8 or !$afficher_partiellement) {
5225 5224
 		if (!$l) {
5226 5225
 			return ''; // montrer qu'il y a pas de mot de passe si il y en a pas
5227 5226
 		}
5228
-		return str_pad('',$afficher_partiellement ? $l : 16,'*');
5227
+		return str_pad('', $afficher_partiellement ? $l : 16, '*');
5229 5228
 	}
5230 5229
 
5231 5230
 	if (is_null($portion_pourcent)) {
@@ -5239,11 +5238,11 @@  discard block
 block discarded – undo
5239 5238
 	}
5240 5239
 	$e = intval(ceil($l * $portion_pourcent / 100 / 2));
5241 5240
 	$e = max($e, 0);
5242
-	$mid = str_pad('',$l-2*$e,'*');
5243
-	if ($e>0 and strlen($mid)>8){
5241
+	$mid = str_pad('', $l - 2 * $e, '*');
5242
+	if ($e > 0 and strlen($mid) > 8) {
5244 5243
 		$mid = '***...***';
5245 5244
 	}
5246
-	return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : '');
5245
+	return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : '');
5247 5246
 }
5248 5247
 
5249 5248
 
@@ -5265,9 +5264,9 @@  discard block
 block discarded – undo
5265 5264
 function identifiant_slug($texte, $type = '', $options = array()) {
5266 5265
 
5267 5266
 	$original = $texte;
5268
-	$separateur = (isset($options['separateur'])?$options['separateur']:'_');
5269
-	$longueur_maxi = (isset($options['longueur_maxi'])?$options['longueur_maxi']:60);
5270
-	$longueur_mini = (isset($options['longueur_mini'])?$options['longueur_mini']:0);
5267
+	$separateur = (isset($options['separateur']) ? $options['separateur'] : '_');
5268
+	$longueur_maxi = (isset($options['longueur_maxi']) ? $options['longueur_maxi'] : 60);
5269
+	$longueur_mini = (isset($options['longueur_mini']) ? $options['longueur_mini'] : 0);
5271 5270
 
5272 5271
 	if (!function_exists('translitteration')) {
5273 5272
 		include_spip('inc/charsets');
@@ -5309,15 +5308,15 @@  discard block
 block discarded – undo
5309 5308
 			}
5310 5309
 	}
5311 5310
 
5312
-	if (strlen($texte)>$longueur_maxi) {
5311
+	if (strlen($texte) > $longueur_maxi) {
5313 5312
 		$texte = substr($texte, 0, $longueur_maxi);
5314 5313
 	}
5315 5314
 
5316 5315
 	if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) {
5317 5316
 		if (preg_match(',^\d,', $texte)) {
5318
-			$texte = ($type ? substr($type,0,1) : "s") . $texte;
5317
+			$texte = ($type ? substr($type, 0, 1) : "s").$texte;
5319 5318
 		}
5320
-		$texte .= $separateur . md5($original);
5319
+		$texte .= $separateur.md5($original);
5321 5320
 		$texte = substr($texte, 0, $longueur_mini);
5322 5321
 	}
5323 5322
 
Please login to merge, or discard this patch.