Completed
Push — master ( 4183f3...a5d8c6 )
by cam
01:16
created
ecrire/public/evaluer_page.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 	ob_start();
46 46
 	if (strpos($page['texte'], '?xml') !== false) {
47
-		$page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']);
47
+		$page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']);
48 48
 	}
49 49
 
50 50
 	try {
51
-		$res = eval('?' . '>' . $page['texte']);
51
+		$res = eval('?'.'>'.$page['texte']);
52 52
 		// error catching 5.2<=PHP<7
53 53
 		if (
54 54
 			$res === false
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 			if (!function_exists('numerote_ligne_php')) {
61 61
 				function numerote_ligne_php($match) {
62 62
 					$GLOBALS['numero_ligne_php']++;
63
-					return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/';
63
+					return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/';
64 64
 				}
65 65
 			}
66
-			$code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
66
+			$code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
67 67
 			$code = trim(highlight_string($code, true));
68
-			erreur_squelette('L' . $erreur['line'] . ': ' . $erreur['message'] . '<br />' . $code, [$page['source'],'',$erreur['file'],'',$GLOBALS['spip_lang']]);
68
+			erreur_squelette('L'.$erreur['line'].': '.$erreur['message'].'<br />'.$code, [$page['source'], '', $erreur['file'], '', $GLOBALS['spip_lang']]);
69 69
 			$page['texte'] = '<!-- Erreur -->';
70 70
 		}
71 71
 		else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 		if (!function_exists('numerote_ligne_php')) {
79 79
 			function numerote_ligne_php($match) {
80 80
 				$GLOBALS['numero_ligne_php']++;
81
-				return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/';
81
+				return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/';
82 82
 			}
83 83
 		}
84
-		$code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
84
+		$code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code);
85 85
 		$code = trim(highlight_string($code, true));
86
-		erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]);
86
+		erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]);
87 87
 		$page['texte'] = '<!-- Erreur -->';
88 88
 	}
89 89
 	ob_end_clean();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	$page['process_ins'] = 'html';
92 92
 
93 93
 	if (strpos($page['texte'], '?xml') !== false) {
94
-		$page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']);
94
+		$page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']);
95 95
 	}
96 96
 }
97 97
 
Please login to merge, or discard this patch.
ecrire/public/balises.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
  */
365 365
 function balise_DOSSIER_SQUELETTE_dist($p) {
366 366
 	$code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE));
367
-	$p->code = "_DIR_RACINE . '$code'" .
367
+	$p->code = "_DIR_RACINE . '$code'".
368 368
 		$p->interdire_scripts = false;
369 369
 
370 370
 	return $p;
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
  */
384 384
 function balise_SQUELETTE_dist($p) {
385 385
 	$code = addslashes($p->descr['sourcefile']);
386
-	$p->code = "'$code'" .
386
+	$p->code = "'$code'".
387 387
 		$p->interdire_scripts = false;
388 388
 
389 389
 	return $p;
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
  **/
436 436
 function balise_NOM_SITE_dist($p) {
437 437
 	if (!$p->etoile) {
438
-		$p->code = 'supprimer_numero(calculer_url(' .
439
-			champ_sql('url_site', $p) . ',' .
440
-			champ_sql('nom_site', $p) .
438
+		$p->code = 'supprimer_numero(calculer_url('.
439
+			champ_sql('url_site', $p).','.
440
+			champ_sql('nom_site', $p).
441 441
 			", 'titre', \$connect, false))";
442 442
 	} else {
443 443
 		$p->code = champ_sql('nom_site', $p);
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
  *     Pile complétée par le code à générer
589 589
  **/
590 590
 function balise_POPULARITE_ABSOLUE_dist($p) {
591
-	$p->code = 'ceil(' .
592
-		champ_sql('popularite', $p) .
591
+	$p->code = 'ceil('.
592
+		champ_sql('popularite', $p).
593 593
 		')';
594 594
 	$p->interdire_scripts = false;
595 595
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	$p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b);
671 671
 ;
672 672
 	if (($v = interprete_argument_balise(1, $p)) !== null) {
673
-		$p->code = 'table_valeur(' . $p->code . ', ' . $v . ')';
673
+		$p->code = 'table_valeur('.$p->code.', '.$v.')';
674 674
 	}
675 675
 	$p->interdire_scripts = true;
676 676
 
@@ -809,16 +809,16 @@  discard block
 block discarded – undo
809 809
 	$trouver_table = charger_fonction('trouver_table', 'base');
810 810
 	if ($desc = $trouver_table(table_objet_sql($type_objet))) {
811 811
 		if (isset($desc['field']['descriptif'])) {
812
-			$_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ',';
812
+			$_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).',';
813 813
 		}
814 814
 		if (isset($desc['field']['texte'])) {
815
-			$_ligne .= "'texte' => " . champ_sql('texte', $p) . ',';
815
+			$_ligne .= "'texte' => ".champ_sql('texte', $p).',';
816 816
 		}
817 817
 		if (isset($desc['field']['chapo'])) {
818
-			$_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ',';
818
+			$_ligne .= "'chapo' => ".champ_sql('chapo', $p).',';
819 819
 		}
820 820
 		if (isset($desc['introduction_longueur'])) {
821
-			$_introduction_longueur = "'" . $desc['introduction_longueur'] . "'";
821
+			$_introduction_longueur = "'".$desc['introduction_longueur']."'";
822 822
 		}
823 823
 	}
824 824
 	$_ligne .= ')';
@@ -917,10 +917,10 @@  discard block
 block discarded – undo
917 917
 		$p->code = sprintf(
918 918
 			CODE_RECUPERER_FOND,
919 919
 			"'modeles/lesauteurs'",
920
-			"array('objet'=>'" . $objet .
921
-			"','id_objet' => " . champ_sql($id_table_objet, $p) .
922
-			",'$id_table_objet' => " . champ_sql($id_table_objet, $p) .
923
-			($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) .
920
+			"array('objet'=>'".$objet.
921
+			"','id_objet' => ".champ_sql($id_table_objet, $p).
922
+			",'$id_table_objet' => ".champ_sql($id_table_objet, $p).
923
+			($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)).
924 924
 			')',
925 925
 			"'trim'=>true, 'compil'=>array($c)",
926 926
 			_q($connect)
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 					$m = trim($m);
990 990
 					if ($m != "''") {
991 991
 						if (!preg_match(',\W,', $m)) {
992
-							$m = $boucle->id_table . ".$m";
992
+							$m = $boucle->id_table.".$m";
993 993
 						}
994 994
 
995 995
 						$m .= ' AS titre_rang';
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 	$f_pagination = chercher_filtre('pagination');
1151 1151
 	$type = $p->boucles[$b]->modificateur['debut_nom'];
1152 1152
 	$modif = ($type[0] !== "'") ? "'debut'.$type"
1153
-		: ("'debut" . substr($type, 1));
1153
+		: ("'debut".substr($type, 1));
1154 1154
 
1155 1155
 	$p->code = sprintf(
1156 1156
 		CODE_PAGINATION,
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']];
1295 1295
 		erreur_squelette($msg, $p);
1296 1296
 	} else {
1297
-		$p->code = 'find_in_path(' . $arg . ')';
1297
+		$p->code = 'find_in_path('.$arg.')';
1298 1298
 	}
1299 1299
 
1300 1300
 	$p->interdire_scripts = false;
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']];
1330 1330
 		erreur_squelette($msg, $p);
1331 1331
 	} else {
1332
-		$p->code = 'chemin_image(' . $arg . ')';
1332
+		$p->code = 'chemin_image('.$arg.')';
1333 1333
 	}
1334 1334
 
1335 1335
 	$p->interdire_scripts = false;
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 		// cas de #ENV sans argument : on retourne le serialize() du tableau
1384 1384
 		// une belle fonction [(#ENV|affiche_env)] serait pratique
1385 1385
 		if ($src) {
1386
-			$p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")';
1386
+			$p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")';
1387 1387
 		} else {
1388 1388
 			$p->code = 'serialize($Pile[0]??[])';
1389 1389
 		}
@@ -1436,8 +1436,8 @@  discard block
 block discarded – undo
1436 1436
 	$_sinon = interprete_argument_balise(2, $p);
1437 1437
 	$_unserialize = sinon(interprete_argument_balise(3, $p), 'false');
1438 1438
 
1439
-	$p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' .
1440
-		($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')";
1439
+	$p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','.
1440
+		($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')";
1441 1441
 
1442 1442
 	return $p;
1443 1443
 }
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
 		$err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']];
1531 1531
 		erreur_squelette($err_b_s_a, $p);
1532 1532
 	} else {
1533
-		$p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))';
1533
+		$p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))';
1534 1534
 	}
1535 1535
 
1536 1536
 	$p->interdire_scripts = false;
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
 			)
1579 1579
 		) {
1580 1580
 			$p->code = /* $r[1]. */
1581
-				'(' . $r[2] . ')';
1581
+				'('.$r[2].')';
1582 1582
 		} else {
1583 1583
 			$p->code = "eval('return '.$php.';')";
1584 1584
 		}
@@ -1822,9 +1822,9 @@  discard block
 block discarded – undo
1822 1822
 
1823 1823
 		// noter la duree du cache dans un entete proprietaire
1824 1824
 
1825
-		$code = "'<'.'" . '?php header("X-Spip-Cache: '
1825
+		$code = "'<'.'".'?php header("X-Spip-Cache: '
1826 1826
 			. $duree
1827
-			. '"); ?' . "'.'>'";
1827
+			. '"); ?'."'.'>'";
1828 1828
 
1829 1829
 		// Remplir le header Cache-Control
1830 1830
 		// cas #CACHE{0}
@@ -1845,9 +1845,9 @@  discard block
 block discarded – undo
1845 1845
 				$pa == 'cache-client'
1846 1846
 				and $duree > 0
1847 1847
 			) {
1848
-				$code .= ".'<'.'" . '?php header("Cache-Control: max-age='
1848
+				$code .= ".'<'.'".'?php header("Cache-Control: max-age='
1849 1849
 					. $duree
1850
-					. '"); ?' . "'.'>'";
1850
+					. '"); ?'."'.'>'";
1851 1851
 				// il semble logique, si on cache-client, de ne pas invalider
1852 1852
 				$pa = 'statique';
1853 1853
 			}
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
 				$pa == 'statique'
1857 1857
 				and $duree > 0
1858 1858
 			) {
1859
-				$code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'";
1859
+				$code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'";
1860 1860
 			}
1861 1861
 		}
1862 1862
 	} else {
@@ -2020,9 +2020,9 @@  discard block
 block discarded – undo
2020 2020
 		if ($p->etoile) {
2021 2021
 			$_options[] = "'etoile'=>true";
2022 2022
 		}
2023
-		$_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')';
2023
+		$_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')';
2024 2024
 
2025
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2025
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2026 2026
 		if ($flag_env) {
2027 2027
 			$_l = "array_merge(\$Pile[0],$_l)";
2028 2028
 		}
@@ -2032,7 +2032,7 @@  discard block
 block discarded – undo
2032 2032
 		$msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']];
2033 2033
 		erreur_squelette($msg, $p);
2034 2034
 	} else {
2035
-		$p->code = 'charge_scripts(' . $_contexte[1] . ',false)';
2035
+		$p->code = 'charge_scripts('.$_contexte[1].',false)';
2036 2036
 	}
2037 2037
 
2038 2038
 	$p->interdire_scripts = false; // la securite est assuree par recuperer_fond
@@ -2080,7 +2080,7 @@  discard block
 block discarded – undo
2080 2080
 		unset($_contexte[1]);
2081 2081
 
2082 2082
 		if (preg_match("/^\s*'[^']*'/s", $nom)) {
2083
-			$nom = "'modeles/" . substr($nom, 1);
2083
+			$nom = "'modeles/".substr($nom, 1);
2084 2084
 		} else {
2085 2085
 			$nom = "'modeles/' . $nom";
2086 2086
 		}
@@ -2097,8 +2097,8 @@  discard block
 block discarded – undo
2097 2097
 			$primary = $p->boucles[$p->id_boucle]->primary;
2098 2098
 			if (!strpos($primary, ',')) {
2099 2099
 				$id = champ_sql($primary, $p);
2100
-				$_contexte[] = "'$primary'=>" . $id;
2101
-				$_contexte[] = "'id'=>" . $id;
2100
+				$_contexte[] = "'$primary'=>".$id;
2101
+				$_contexte[] = "'id'=>".$id;
2102 2102
 			}
2103 2103
 		}
2104 2104
 		$_contexte[] = "'recurs'=>(++\$recurs)";
@@ -2110,11 +2110,11 @@  discard block
 block discarded – undo
2110 2110
 		$_options = memoriser_contexte_compil($p);
2111 2111
 		$_options = "'compil'=>array($_options), 'trim'=>true";
2112 2112
 		if (isset($_contexte['ajax'])) {
2113
-			$_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2113
+			$_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']);
2114 2114
 			unset($_contexte['ajax']);
2115 2115
 		}
2116 2116
 
2117
-		$_l = 'array(' . join(",\n\t", $_contexte) . ')';
2117
+		$_l = 'array('.join(",\n\t", $_contexte).')';
2118 2118
 		if ($flag_env) {
2119 2119
 			$_l = "array_merge(\$Pile[0],$_l)";
2120 2120
 		}
@@ -2224,12 +2224,12 @@  discard block
 block discarded – undo
2224 2224
 function balise_DOUBLONS_dist($p) {
2225 2225
 	if ($type = interprete_argument_balise(1, $p)) {
2226 2226
 		if ($famille = interprete_argument_balise(2, $p)) {
2227
-			$type .= '.' . $famille;
2227
+			$type .= '.'.$famille;
2228 2228
 		}
2229
-		$p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")';
2229
+		$p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")';
2230 2230
 		if (!$p->etoile) {
2231 2231
 			$p->code = 'array_filter(array_map("intval",explode(",",'
2232
-				. $p->code . ')))';
2232
+				. $p->code.')))';
2233 2233
 		}
2234 2234
 	} else {
2235 2235
 		$p->code = '$doublons';
@@ -2358,7 +2358,7 @@  discard block
 block discarded – undo
2358 2358
 			$_code[] = "$_key => $_val";
2359 2359
 		}
2360 2360
 	} while ($_key && $_val);
2361
-	$p->code = 'array(' . join(', ', $_code) . ')';
2361
+	$p->code = 'array('.join(', ', $_code).')';
2362 2362
 	$p->interdire_scripts = false;
2363 2363
 
2364 2364
 	return $p;
@@ -2385,7 +2385,7 @@  discard block
 block discarded – undo
2385 2385
 	while ($_val = interprete_argument_balise($n++, $p)) {
2386 2386
 		$_code[] = $_val;
2387 2387
 	}
2388
-	$p->code = 'array(' . join(', ', $_code) . ')';
2388
+	$p->code = 'array('.join(', ', $_code).')';
2389 2389
 	$p->interdire_scripts = false;
2390 2390
 
2391 2391
 	return $p;
@@ -2430,10 +2430,10 @@  discard block
 block discarded – undo
2430 2430
 		$_code[] = $_v;
2431 2431
 	}
2432 2432
 
2433
-	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join(
2433
+	$p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join(
2434 2434
 		', ',
2435 2435
 		$_code
2436
-	) . ')?" ":"")';
2436
+	).')?" ":"")';
2437 2437
 	$p->interdire_scripts = false;
2438 2438
 
2439 2439
 	return $p;
@@ -2466,7 +2466,7 @@  discard block
 block discarded – undo
2466 2466
 	$type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"';
2467 2467
 
2468 2468
 	$f = chercher_filtre('info_plugin');
2469
-	$p->code = $f . '(' . $plugin . ', ' . $type_info . ')';
2469
+	$p->code = $f.'('.$plugin.', '.$type_info.')';
2470 2470
 
2471 2471
 	return $p;
2472 2472
 }
@@ -2716,12 +2716,12 @@  discard block
 block discarded – undo
2716 2716
 	$_issens = "in_array($_champ,array('>','<'))";
2717 2717
 	$_sens = "(strpos('< >',$_champ)-1)";
2718 2718
 
2719
-	$_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom'];
2719
+	$_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom'];
2720 2720
 	$_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)";
2721
-	$_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')";
2722
-	$_on = '$s?(' . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)";
2721
+	$_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')";
2722
+	$_on = '$s?('.$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)";
2723 2723
 
2724
-	$p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : '') . ')';
2724
+	$p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : '').')';
2725 2725
 	//$p->code = "''";
2726 2726
 	$p->interdire_scripts = false;
2727 2727
 
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
 		$connect = $p->boucles[$p->id_boucle]->sql_serveur;
2796 2796
 	}
2797 2797
 
2798
-	$p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')";
2798
+	$p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')";
2799 2799
 	$p->interdire_scripts = false;
2800 2800
 
2801 2801
 	return $p;
Please login to merge, or discard this patch.
ecrire/public/fonctions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$texte = $intro;
85 85
 	} else {
86 86
 		if (
87
-			strpos("\n" . $texte, "\n|") === false
87
+			strpos("\n".$texte, "\n|") === false
88 88
 			and strlen($texte) > 2.5 * $longueur
89 89
 		) {
90 90
 			if (strpos($texte, '<multi') !== false) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	if ($pas < 1) {
169 169
 		return '';
170 170
 	}
171
-	$ancre = 'pagination' . $nom; // #pagination_articles
172
-	$debut = 'debut' . $nom; // 'debut_articles'
171
+	$ancre = 'pagination'.$nom; // #pagination_articles
172
+	$debut = 'debut'.$nom; // 'debut_articles'
173 173
 
174 174
 	// n'afficher l'ancre qu'une fois
175 175
 	if (!isset($ancres[$ancre])) {
176
-		$bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>";
176
+		$bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>";
177 177
 	} else {
178 178
 		$bloc_ancre = '';
179 179
 	}
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 
206 206
 	if ($modele) {
207 207
 		$pagination['type_pagination'] = $modele;
208
-		if (trouver_fond('pagination_' . $modele, 'modeles')) {
209
-			$modele = '_' . $modele;
208
+		if (trouver_fond('pagination_'.$modele, 'modeles')) {
209
+			$modele = '_'.$modele;
210 210
 		}
211 211
 		else {
212 212
 			$modele = '';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 function lister_objets_avec_logos($type) {
292 292
 
293 293
 	$objet = objet_type($type);
294
-	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet));
294
+	$ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet));
295 295
 	if ($ids) {
296 296
 		$ids = array_column($ids, 'id_objet');
297 297
 		return implode(',', $ids);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 		case 'sinum ':
466 466
 			return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}";
467 467
 		default:
468
-			return $champ . $senstri;
468
+			return $champ.$senstri;
469 469
 	}
470 470
 }
471 471
 
Please login to merge, or discard this patch.
ecrire/public/assembler.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 	$GLOBALS['contexte'] = calculer_contexte();
39 39
 	$page = ['contexte_implicite' => calculer_contexte_implicite()];
40
-	$page['contexte_implicite']['cache'] = $fond . preg_replace(
40
+	$page['contexte_implicite']['cache'] = $fond.preg_replace(
41 41
 		',\.[a-zA-Z0-9]*$,',
42 42
 		'',
43 43
 		preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI'])
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			if ($page === '') {
139 139
 				$erreur = _T(
140 140
 					'info_erreur_squelette2',
141
-					['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES]
141
+					['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES]
142 142
 				);
143 143
 				erreur_squelette($erreur);
144 144
 				// eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		and !isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
184 184
 		and !isset($page['entetes']['Last-Modified'])
185 185
 	) {
186
-		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT';
186
+		$page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT';
187 187
 	}
188 188
 
189 189
 	// fermer la connexion apres les headers si requete HEAD
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		'spip_version_code' => $GLOBALS['spip_version_code'],
249 249
 	];
250 250
 	if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
251
-		$contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST'];
251
+		$contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST'];
252 252
 	}
253 253
 
254 254
 	return $contexte_implicite;
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 			}
580 580
 		}
581 581
 		if (is_null($id)) {
582
-			$msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
582
+			$msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]);
583 583
 			erreur_squelette($msg);
584 584
 			// on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant
585 585
 			$id = 0;
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		}
627 627
 
628 628
 		if (preg_match(',^[a-z0-9_]+$,', $soustype)) {
629
-			if (!trouve_modele($fond = ($type . '_' . $soustype))) {
629
+			if (!trouve_modele($fond = ($type.'_'.$soustype))) {
630 630
 				$fond = '';
631 631
 				$class = $soustype;
632 632
 			}
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 
642 642
 		return false;
643 643
 	}
644
-	$fond = 'modeles/' . $fond;
644
+	$fond = 'modeles/'.$fond;
645 645
 	// Creer le contexte
646 646
 	$contexte = $env;
647 647
 	$contexte['dir_racine'] = _DIR_RACINE; # eviter de mixer un cache racine et un cache ecrire (meme si pour l'instant les modeles ne sont pas caches, le resultat etant different il faut que le contexte en tienne compte
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	// sinon, s'il y a un lien, on l'ajoute classiquement
683 683
 	if (
684 684
 		strstr(
685
-			' ' . ($classes = extraire_attribut($retour, 'class')) . ' ',
685
+			' '.($classes = extraire_attribut($retour, 'class')).' ',
686 686
 			'spip_lien_ok'
687 687
 		)
688 688
 	) {
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 		);
694 694
 	} else {
695 695
 		if ($lien) {
696
-			$retour = "<a href='" . $lien['href'] . "' class='" . $lien['class'] . "'>" . $retour . '</a>';
696
+			$retour = "<a href='".$lien['href']."' class='".$lien['class']."'>".$retour.'</a>';
697 697
 		}
698 698
 	}
699 699
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 		return $page;
718 718
 	}
719 719
 	// eval $page et affecte $res
720
-	include _ROOT_RESTREINT . 'public/evaluer_page.php';
720
+	include _ROOT_RESTREINT.'public/evaluer_page.php';
721 721
 
722 722
 	// Lever un drapeau (global) si le fond utilise #SESSION
723 723
 	// a destination de public/parametrer
@@ -785,16 +785,16 @@  discard block
 block discarded – undo
785 785
 			if (($pos = strpos($head, '<head>')) !== false) {
786 786
 				$head = substr_replace($head, $base, $pos + 6, 0);
787 787
 			} elseif (preg_match(',<head[^>]*>,i', $head, $r)) {
788
-				$head = str_replace($r[0], $r[0] . $base, $head);
788
+				$head = str_replace($r[0], $r[0].$base, $head);
789 789
 			}
790
-			$texte = $head . substr($texte, $poshead);
790
+			$texte = $head.substr($texte, $poshead);
791 791
 		}
792 792
 		if ($href_base) {
793 793
 			// gerer les ancres
794 794
 			$base = $_SERVER['REQUEST_URI'];
795 795
 			// pas de guillemets ni < dans l'URL qu'on insere dans le HTML
796 796
 			if (strpos($base, "'") or strpos($base, '"') or strpos($base, '<')) {
797
-				$base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base);
797
+				$base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base);
798 798
 			}
799 799
 			if (strpos($texte, "href='#") !== false) {
800 800
 				$texte = str_replace("href='#", "href='$base#", $texte);
Please login to merge, or discard this patch.
ecrire/public/composer.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$GLOBALS['debug_objets']['courant'] = $nom;
55 55
 	}
56 56
 
57
-	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php';
57
+	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php';
58 58
 
59 59
 	// si squelette est deja compile et perenne, le charger
60 60
 	if (!squelette_obsolete($phpfile, $source)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		#}
68 68
 	}
69 69
 
70
-	if (file_exists($lib = $squelette . '_fonctions' . '.php')) {
70
+	if (file_exists($lib = $squelette.'_fonctions'.'.php')) {
71 71
 		include_once $lib;
72 72
 	}
73 73
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			eval("return true; $f ;");
96 96
 		} catch (\ParseError $e) {
97 97
 			// Code syntaxiquement faux (critere etc mal programme')
98
-			$msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage();
98
+			$msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage();
99 99
 			erreur_squelette($msg, $boucle);
100 100
 			// continuer pour trouver d'autres fautes eventuelles
101 101
 			// mais prevenir que c'est mort
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 	if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
125 125
 		// Tracer ce qui vient d'etre compile
126
-		$GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code;
126
+		$GLOBALS['debug_objets']['code'][$nom.'tout'] = $code;
127 127
 
128 128
 		// si c'est ce que demande le debusqueur, lui passer la main
129 129
 		if (
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 		$code = "
147 147
 /*
148 148
  * Squelette : $sourcefile
149
- * Date :      " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT
150
- * Compile :   ' . gmdate('D, d M Y H:i:s', time()) . ' GMT
151
- * ' . (!$boucles ? 'Pas de boucle' : ('Boucles :   ' . $noms)) . '
149
+ * Date :      ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT
150
+ * Compile :   ' . gmdate('D, d M Y H:i:s', time()).' GMT
151
+ * ' . (!$boucles ? 'Pas de boucle' : ('Boucles :   '.$noms)).'
152 152
  */ ';
153 153
 	}
154 154
 
155
-	$code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>';
155
+	$code = '<'."?php\n".$code.join('', $boucles)."\n?".'>';
156 156
 	if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) {
157 157
 		ecrire_fichier($phpfile, $code);
158 158
 	}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			$j = join('-', array_map('ucwords', explode('-', strtolower($r[2]))));
217 217
 
218 218
 			if ($j == 'X-Spip-Filtre' and isset($headers[$j])) {
219
-				$headers[$j] .= '|' . $r[3];
219
+				$headers[$j] .= '|'.$r[3];
220 220
 			} else {
221 221
 				$headers[$j] = $r[3];
222 222
 			}
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 	}
225 225
 	// S'agit-il d'un resultat constant ou contenant du code php
226 226
 	$process_ins = (
227
-		strpos($corps, '<' . '?') === false
227
+		strpos($corps, '<'.'?') === false
228 228
 		or
229
-		(strpos($corps, '<' . '?xml') !== false and
230
-			strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
229
+		(strpos($corps, '<'.'?xml') !== false and
230
+			strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
231 231
 	)
232 232
 		? 'html'
233 233
 		: 'php';
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 		if ($process_ins == 'html') {
258 258
 			$skel['process_ins'] = (
259
-				strpos($corps, '<' . '?') === false
259
+				strpos($corps, '<'.'?') === false
260 260
 				or
261
-				(strpos($corps, '<' . '?xml') !== false and
262
-					strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
261
+				(strpos($corps, '<'.'?xml') !== false and
262
+					strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
263 263
 			)
264 264
 				? 'html'
265 265
 				: 'php';
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 //
278 278
 
279 279
 /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */
280
-define('CODE_INCLURE_BALISE', '<' . '?php 
280
+define('CODE_INCLURE_BALISE', '<'.'?php 
281 281
 include_once("%s");
282 282
 if ($lang_select = "%s") $lang_select = lang_select($lang_select);
283 283
 inserer_balise_dynamique(balise_%s_dyn(%s), array(%s));
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		// pas de lien symbolique sous Windows
309 309
 		and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false)
310 310
 	) {
311
-		$file = './" . _DIR_RACINE . "' . $file;
311
+		$file = './" . _DIR_RACINE . "'.$file;
312 312
 	}
313 313
 
314 314
 	$lang = $context_compil[4];
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 	$args = array_map('argumenter_squelette', $args);
320 320
 	if (!empty($context_compil['appel_php_depuis_modele'])) {
321
-		$args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')';
321
+		$args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')';
322 322
 	}
323 323
 	$args = join(', ', $args);
324 324
 
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
 	if (is_object($v)) {
353 353
 		return var_export($v, true);
354 354
 	} elseif (!is_array($v)) {
355
-		return "'" . texte_script($v) . "'";
355
+		return "'".texte_script($v)."'";
356 356
 	} else {
357 357
 		$out = [];
358 358
 		foreach ($v as $k => $val) {
359
-			$out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val);
359
+			$out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val);
360 360
 		}
361 361
 
362
-		return 'array(' . join(', ', $out) . ')';
362
+		return 'array('.join(', ', $out).')';
363 363
 	}
364 364
 }
365 365
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	}
438 438
 
439 439
 	// Y a-t-il une fonction de traitement des arguments ?
440
-	$f = 'balise_' . $nom_balise . '_stat';
440
+	$f = 'balise_'.$nom_balise.'_stat';
441 441
 
442 442
 	$r = !function_exists($f) ? $args : $f($args, $context_compil);
443 443
 
@@ -447,18 +447,18 @@  discard block
 block discarded – undo
447 447
 
448 448
 	// verifier que la fonction dyn est la,
449 449
 	// sinon se replier sur la generique si elle existe
450
-	if (!function_exists('balise_' . $nom_balise . '_dyn')) {
450
+	if (!function_exists('balise_'.$nom_balise.'_dyn')) {
451 451
 		if (
452 452
 			$balise_generique = chercher_balise_generique($nom)
453 453
 			and $nom_balise_generique = $balise_generique['nom_generique']
454
-			and $file = include_spip('balise/' . strtolower($nom_balise_generique))
455
-			and function_exists('balise_' . $nom_balise_generique . '_dyn')
454
+			and $file = include_spip('balise/'.strtolower($nom_balise_generique))
455
+			and function_exists('balise_'.$nom_balise_generique.'_dyn')
456 456
 		) {
457 457
 			// et lui injecter en premier arg le nom de la balise
458 458
 			array_unshift($r, $nom);
459 459
 			$nom_balise = $nom_balise_generique;
460 460
 			if (!_DIR_RESTREINT) {
461
-				$file = _DIR_RESTREINT_ABS . $file;
461
+				$file = _DIR_RESTREINT_ABS.$file;
462 462
 			}
463 463
 		} else {
464 464
 			$msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]];
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		$n = '';
561 561
 		foreach (explode(',', $liste) as $val) {
562 562
 			if ($a = intval($val) and $val === strval($a)) {
563
-				$n .= ',' . $val;
563
+				$n .= ','.$val;
564 564
 			}
565 565
 		}
566 566
 		if (strlen($n)) {
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
 			// on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction
740 740
 			$i = 0;
741 741
 			do {
742
-				$where[$k] = remplace_sous_requete($w, '(' . calculer_select(
743
-					[$sous[1] . ' AS id'],
742
+				$where[$k] = remplace_sous_requete($w, '('.calculer_select(
743
+					[$sous[1].' AS id'],
744 744
 					$from,
745 745
 					$from_type,
746 746
 					$wheresub,
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 					$id,
754 754
 					$serveur,
755 755
 					false
756
-				) . ')');
756
+				).')');
757 757
 				if (!$i) {
758 758
 					$i = 1;
759 759
 					$wherestring = calculer_where_to_string($where[$k]);
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 		if ($sous[0] == 'SUBSELECT') {
774 774
 			// c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having)
775 775
 			array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ?
776
-			$where[$k] = remplace_sous_requete($w, '(' . calculer_select(
776
+			$where[$k] = remplace_sous_requete($w, '('.calculer_select(
777 777
 				$sous[1], # select
778 778
 				$sous[2], #from
779 779
 				[], #from_type
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 				$id,
789 789
 				$serveur,
790 790
 				false
791
-			) . ')');
791
+			).')');
792 792
 		}
793 793
 		array_pop($where_simples);
794 794
 	}
@@ -851,15 +851,15 @@  discard block
 block discarded – undo
851 851
 			// sans recours a preg_match
852 852
 			// un implode(' ',..) est fait dans reinjecte_joint un peu plus bas
853 853
 			$afrom[$t][$cle] = [
854
-				"\n" .
855
-				(isset($from_type[$cle]) ? $from_type[$cle] : 'INNER') . ' JOIN',
854
+				"\n".
855
+				(isset($from_type[$cle]) ? $from_type[$cle] : 'INNER').' JOIN',
856 856
 				$from[$cle],
857 857
 				"AS $cle",
858 858
 				'ON (',
859 859
 				"$cle.$c",
860 860
 				'=',
861 861
 				"$t.$carr",
862
-				($and ? 'AND ' . $and : '') .
862
+				($and ? 'AND '.$and : '').
863 863
 				')'
864 864
 			];
865 865
 			if (isset($afrom[$cle])) {
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 		$t = key($from);
898 898
 		$c = current($from);
899 899
 		reset($from);
900
-		$e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/';
900
+		$e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/';
901 901
 		if (
902 902
 			!(strpos($t, ' ') or // jointure des le depart cf boucle_doc
903 903
 				calculer_jointnul($t, $select, $e) or
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 			unset($afrom[$t][$nt]);
916 916
 			$afrom[$nt] = $afrom[$t];
917 917
 			unset($afrom[$t]);
918
-			$e = '/\b' . preg_quote($nfrom[6]) . '\b/';
918
+			$e = '/\b'.preg_quote($nfrom[6]).'\b/';
919 919
 			$t = $nfrom[4];
920 920
 			$alias = '';
921 921
 			// verifier que les deux cles sont homonymes, sinon installer un alias dans le select
@@ -926,14 +926,14 @@  discard block
 block discarded – undo
926 926
 			if ($newcle != $oldcle) {
927 927
 				// si l'ancienne cle etait deja dans le select avec un AS
928 928
 				// reprendre simplement ce AS
929
-				$as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/';
929
+				$as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/';
930 930
 				if (preg_match($as, implode(',', $select), $m)) {
931 931
 					$alias = '';
932 932
 				} else {
933
-					$alias = ', ' . $nfrom[4] . " AS $oldcle";
933
+					$alias = ', '.$nfrom[4]." AS $oldcle";
934 934
 				}
935 935
 			}
936
-			$select = remplacer_jointnul($t . $alias, $select, $e);
936
+			$select = remplacer_jointnul($t.$alias, $select, $e);
937 937
 			$join = remplacer_jointnul($t, $join, $e);
938 938
 			$where = remplacer_jointnul($t, $where, $e);
939 939
 			$having = remplacer_jointnul($t, $having, $e);
@@ -983,9 +983,9 @@  discard block
 block discarded – undo
983 983
 	} else {
984 984
 		$exp = '';
985 985
 		if (strtoupper($join) === 'AND') {
986
-			return $exp . join(" $join ", array_map('calculer_where_to_string', $v));
986
+			return $exp.join(" $join ", array_map('calculer_where_to_string', $v));
987 987
 		} else {
988
-			return $exp . join($join, $v);
988
+			return $exp.join($join, $v);
989 989
 		}
990 990
 	}
991 991
 }
@@ -1051,6 +1051,6 @@  discard block
 block discarded – undo
1051 1051
 	}
1052 1052
 
1053 1053
 	return $mime_type
1054
-	. (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_'
1055
-	. md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : ''));
1054
+	. (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_'
1055
+	. md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : ''));
1056 1056
 }
Please login to merge, or discard this patch.
ecrire/public/boucles.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
  **/
83 83
 function boucle_HIERARCHIE_dist($id_boucle, &$boucles) {
84 84
 	$boucle = &$boucles[$id_boucle];
85
-	$id_table = $boucle->id_table . '.id_rubrique';
85
+	$id_table = $boucle->id_table.'.id_rubrique';
86 86
 
87 87
 	// Si la boucle mere est une boucle RUBRIQUES il faut ignorer la feuille
88 88
 	// sauf en presence du critere {tout} (vu par phraser_html)
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		. '$hierarchie = calcul_hierarchie_in($id_rubrique,'
96 96
 		. (isset($boucle->modificateur['tout']) ? 'true' : 'false')
97 97
 		. ");\n\t"
98
-		. 'if (!$hierarchie) return "";' . "\n\t";
98
+		. 'if (!$hierarchie) return "";'."\n\t";
99 99
 
100 100
 	$boucle->where[] = ["'IN'", "'$id_table'", '"($hierarchie)"'];
101 101
 
Please login to merge, or discard this patch.
ecrire/maj/2021.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
 }
24 24
 
25 25
 $GLOBALS['maj'][2021021800] = [
26
-	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ],
27
-	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ],
26
+	['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"],
27
+	['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"],
28 28
 ];
Please login to merge, or discard this patch.
ecrire/maj/legacy/v31.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
  */
34 34
 function ranger_cache_gd2() {
35 35
 	spip_log('ranger_cache_gd2');
36
-	$base = _DIR_VAR . 'cache-gd2/';
36
+	$base = _DIR_VAR.'cache-gd2/';
37 37
 	if (is_dir($base) and is_readable($base)) {
38 38
 		if ($dir = opendir($base)) {
39 39
 			while (($f = readdir($dir)) !== false) {
40 40
 				if (
41
-					!is_dir($base . $f) and strncmp($f, '.', 1) !== 0
41
+					!is_dir($base.$f) and strncmp($f, '.', 1) !== 0
42 42
 					and preg_match(',[0-9a-f]{32}\.\w+,', $f)
43 43
 				) {
44 44
 					$sub = substr($f, 0, 2);
45 45
 					$sub = sous_repertoire($base, $sub);
46
-					@rename($base . $f, $sub . substr($f, 2));
47
-					@unlink($base . $f); // au cas ou le rename a foire (collision)
46
+					@rename($base.$f, $sub.substr($f, 2));
47
+					@unlink($base.$f); // au cas ou le rename a foire (collision)
48 48
 				}
49 49
 				if (time() >= _TIME_OUT) {
50 50
 					return;
Please login to merge, or discard this patch.
ecrire/maj/legacy/v30.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	$exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic'];
61 61
 
62 62
 	$pivot = preg_replace(',[^\w],', '', $pivot); // securite
63
-	$pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot . 's');
64
-	$liens = 'spip_' . $pivots . '_liens';
65
-	$id_pivot = 'id_' . $pivot;
63
+	$pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot.'s');
64
+	$liens = 'spip_'.$pivots.'_liens';
65
+	$id_pivot = 'id_'.$pivot;
66 66
 	// Creer spip_auteurs_liens
67 67
 	global $tables_auxiliaires;
68 68
 	if (!$l) {
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 		$l = preg_replace(',[^\w],', '', $l); // securite
75 75
 		$primary = "id_$l";
76 76
 		$objet = ($l == 'syndic' ? 'site' : $l);
77
-		$ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l . 's');
78
-		$ancienne_table = 'spip_' . $pivots . '_' . $ls;
77
+		$ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l.'s');
78
+		$ancienne_table = 'spip_'.$pivots.'_'.$ls;
79 79
 		$pool = 400;
80 80
 
81 81
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) {
112 112
 			$insert = [];
113 113
 			foreach ($ids as $id) {
114
-				$n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id));
115
-				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) {
114
+				$n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id));
115
+				while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) {
116 116
 					$n += count($t);
117 117
 					// empiler en s'assurant a minima de l'unicite
118 118
 					while ($r = array_shift($t)) {
119
-						$insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r;
119
+						$insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
120 120
 					}
121 121
 					if (count($insert) >= $sub_pool) {
122 122
 						maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]);
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 
268 268
 	// cas particulier spip_auteurs : retablir le collate binary sur le login
269 269
 	$desc = $trouver_table('spip_auteurs');
270
-	spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
270
+	spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
271 271
 	if (stripos($desc['field']['login'], 'BINARY') === false) {
272 272
 		spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj');
273 273
 		sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY');
274 274
 		$trouver_table('');
275 275
 		$new_desc = $trouver_table('spip_auteurs');
276
-		spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE);
276
+		spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE);
277 277
 	}
278 278
 
279 279
 	foreach ($tables as $table) {
@@ -292,27 +292,27 @@  discard block
 block discarded – undo
292 292
 					$data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC');
293 293
 					$urls = [];
294 294
 					foreach ($data as $d) {
295
-						$key = $d['id_parent'] . '::' . strtolower($d['url']);
295
+						$key = $d['id_parent'].'::'.strtolower($d['url']);
296 296
 						if (!isset($urls[$key])) {
297 297
 							$urls[$key] = true;
298 298
 						} else {
299 299
 							spip_log(
300
-								'Suppression doublon dans spip_urls avant conversion : ' . serialize($d),
301
-								'maj.' . _LOG_INFO_IMPORTANTE
300
+								'Suppression doublon dans spip_urls avant conversion : '.serialize($d),
301
+								'maj.'._LOG_INFO_IMPORTANTE
302 302
 							);
303
-							sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url']));
303
+							sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url']));
304 304
 						}
305 305
 					}
306 306
 				}
307 307
 				foreach ($desc['field'] as $field => $type) {
308 308
 					if ($desc['field'][$field] !== $desc_collate[$field]) {
309
-						spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE);
310
-						sql_alter("table $table change $field $field " . $desc_collate[$field]);
309
+						spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE);
310
+						sql_alter("table $table change $field $field ".$desc_collate[$field]);
311 311
 						$trouver_table('');
312 312
 						$new_desc = $trouver_table($table);
313 313
 						spip_log(
314
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
315
-							'maj.' . _LOG_INFO_IMPORTANTE
314
+							"Apres conversion $table : ".var_export($new_desc['field'], true),
315
+							'maj.'._LOG_INFO_IMPORTANTE
316 316
 						);
317 317
 						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
318 318
 					}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 $GLOBALS['maj'][19236] = [
330 330
 	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale
331
-	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"],  // version base plugins
331
+	['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins
332 332
 	['maj_collation_sqlite'],
333 333
 ];
334 334
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	spip_log('supprimer sessions auteur');
346 346
 	if ($dir = opendir(_DIR_SESSIONS)) {
347 347
 		while (($f = readdir($dir)) !== false) {
348
-			spip_unlink(_DIR_SESSIONS . $f);
348
+			spip_unlink(_DIR_SESSIONS.$f);
349 349
 			if (time() >= _TIME_OUT) {
350 350
 				return;
351 351
 			}
Please login to merge, or discard this patch.