Completed
Pull Request — master (#42)
by
unknown
01:14
created
ecrire/xml/analyser_dtd.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		$grammaire = find_in_path($grammaire);
29 29
 	}
30 30
 
31
-	$file = _DIR_CACHE_XML . preg_replace('/[^\w.]/', '_', $rotlvl) . '.gz';
31
+	$file = _DIR_CACHE_XML.preg_replace('/[^\w.]/', '_', $rotlvl).'.gz';
32 32
 
33 33
 	if (lire_fichier($file, $r)) {
34 34
 		if (!$grammaire) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 				$dtc->peres[$k] = $v;
56 56
 			}
57 57
 
58
-			spip_log("Analyser DTD $avail $grammaire (" . spip_timer('dtd') . ') ' . count($dtc->macros) . ' macros, ' . count($dtc->elements) . ' elements, ' . count($dtc->attributs) . " listes d'attributs, " . count($dtc->entites) . ' entites');
58
+			spip_log("Analyser DTD $avail $grammaire (".spip_timer('dtd').') '.count($dtc->macros).' macros, '.count($dtc->elements).' elements, '.count($dtc->attributs)." listes d'attributs, ".count($dtc->entites).' entites');
59 59
 			#	$r = $dtc->regles; ksort($r);foreach($r as $l => $v) {$t=array_keys($dtc->attributs[$l]);echo "<b>$l</b> '$v' ", count($t), " attributs: ", join (', ',$t);$t=$dtc->peres[$l];echo "<br />",count($t), " peres: ", @join (', ',$t), "<br />\n";}exit;
60 60
 			ecrire_fichier($file, serialize($dtc), true);
61 61
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			}
173 173
 		}
174 174
 		if (!is_string($r)) {
175
-			spip_log("erreur $r dans la DTD  " . substr($dtd, 0, 80) . '.....');
175
+			spip_log("erreur $r dans la DTD  ".substr($dtd, 0, 80).'.....');
176 176
 
177 177
 			return false;
178 178
 		}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			($n[0] == 'PUBLIC')
221 221
 			and !tester_url_absolue($n[1])
222 222
 		) {
223
-			$n[1] = substr($grammaire, 0, strrpos($grammaire, '/') + 1) . $n[1];
223
+			$n[1] = substr($grammaire, 0, strrpos($grammaire, '/') + 1).$n[1];
224 224
 		}
225 225
 		analyser_dtd($n[1], $n[0], $dtc);
226 226
 	}
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	}
249 249
 
250 250
 	if ($dtc->macros[$m[1]] == 'INCLUDE') {
251
-		$retour = $r[1] . substr($m[2], strlen($r[0]));
251
+		$retour = $r[1].substr($m[2], strlen($r[0]));
252 252
 	} else {
253 253
 		$retour = substr($m[2], strlen($r[0]));
254 254
 	}
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		spip_log("redefinition de l'entite $nom");
282 282
 	}
283 283
 	if ($k6) {
284
-		return $k6 . $dtd;
284
+		return $k6.$dtd;
285 285
 	} // cas du synonyme complet
286 286
 	$val = expanserEntite(($k2 ? $k3 : ($k4 ? $k5 : $k6)), $dtc->macros);
287 287
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	if (preg_match_all("/\s*(\S+)\s+(([(][^)]*[)])|(\S+))\s+([^\s']*)(\s*'[^']*')?/", $val, $r2, PREG_SET_ORDER)) {
390 390
 		foreach ($r2 as $m2) {
391 391
 			$v = preg_match('/^\w+$/', $m2[2]) ? $m2[2]
392
-				: ('/^' . preg_replace('/\s+/', '', $m2[2]) . '$/');
392
+				: ('/^'.preg_replace('/\s+/', '', $m2[2]).'$/');
393 393
 			$m21 = expanserEntite($m2[1], $dtc->macros);
394 394
 			$m25 = expanserEntite($m2[5], $dtc->macros);
395 395
 			$dtc->attributs[$nom][$m21] = [$v, $m25];
Please login to merge, or discard this patch.
ecrire/xml/indenter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
 	$f = new IndenteurXML();
64 64
 	$sax($page, $apply, $f);
65 65
 	if (!$f->err) {
66
-		return $f->entete . $f->res;
66
+		return $f->entete.$f->res;
67 67
 	}
68
-	spip_log('indentation impossible ' . count($f->err) . ' erreurs de validation');
68
+	spip_log('indentation impossible '.count($f->err).' erreurs de validation');
69 69
 
70
-	return $f->entete . $f->page;
70
+	return $f->entete.$f->page;
71 71
 }
Please login to merge, or discard this patch.
ecrire/xml/sax.php 1 patch
Spacing   +21 added lines, -22 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	$t = isset($phraseur->ouvrant[$depth]) ? $phraseur->ouvrant[$depth] : ' ';
47 47
 	// espace initial signifie: deja integree au resultat
48 48
 	if ($t[0] != ' ') {
49
-		$phraseur->res .= '<' . $t . '>';
50
-		$phraseur->ouvrant[$depth] = ' ' . $t;
49
+		$phraseur->res .= '<'.$t.'>';
50
+		$phraseur->ouvrant[$depth] = ' '.$t;
51 51
 	}
52 52
 	$t = $phraseur->contenu[$depth];
53 53
 	// n'indenter que s'il y a un separateur avant
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 	foreach ($attrs as $k => $v) {
59 59
 		$delim = strpos($v, "'") === false ? "'" : '"';
60 60
 		$val = xml_entites_html($v);
61
-		$att .= $sep . $k . '=' . $delim
61
+		$att .= $sep.$k.'='.$delim
62 62
 			. ($delim !== '"' ? str_replace('&quot;', '"', $val) : $val)
63 63
 			. $delim;
64 64
 		$sep = "\n $depth";
65 65
 	}
66 66
 	$phraseur->depth .= '  ';
67 67
 	$phraseur->contenu[$phraseur->depth] = '';
68
-	$phraseur->ouvrant[$phraseur->depth] = $name . $att;
68
+	$phraseur->ouvrant[$phraseur->depth] = $name.$att;
69 69
 	$phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax);
70 70
 }
71 71
 
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 	$ouv = $phraseur->ouvrant[$phraseur->depth];
75 75
 
76 76
 	if ($ouv[0] != ' ') {
77
-		$phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv;
77
+		$phraseur->ouvrant[$phraseur->depth] = ' '.$ouv;
78 78
 	} else {
79 79
 		$ouv = '';
80 80
 	}
81 81
 	$t = $phraseur->contenu[$phraseur->depth];
82 82
 	$phraseur->depth = substr($phraseur->depth, 2);
83
-	$t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t);
83
+	$t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t);
84 84
 
85 85
 	// fusion <balise></balise> en <balise />.
86 86
 	// ATTENTION,  certains clients http croient que fusion ==> pas d'atttributs
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	// (param fusion_bal)
90 90
 
91 91
 	if ($t || (($ouv != $name) and !$fusion_bal)) {
92
-		$phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . '</' . $name . '>';
92
+		$phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t.'</'.$name.'>';
93 93
 	} else {
94
-		$phraseur->res .= ($ouv ? ('<' . $ouv . ' />') : ('</' . $name . '>'));
94
+		$phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ('</'.$name.'>'));
95 95
 	}
96 96
 }
97 97
 
@@ -136,16 +136,15 @@  discard block
 block discarded – undo
136 136
 		coordonnees_erreur(
137 137
 			$phraseur,
138 138
 			xml_error_string(xml_get_error_code($phraseur->sax))
139
-			. "<br />\n" .
140
-			(!$phraseur->depth ? '' :
141
-				('(' .
142
-					_T('erreur_balise_non_fermee') .
143
-					' <tt>' .
144
-					$phraseur->ouvrant[$phraseur->depth] .
145
-					'</tt> ' .
146
-					_T('ligne') .
147
-					' ' .
148
-					$phraseur->reperes[$phraseur->depth] .
139
+			. "<br />\n".
140
+			(!$phraseur->depth ? '' : ('('.
141
+					_T('erreur_balise_non_fermee').
142
+					' <tt>'.
143
+					$phraseur->ouvrant[$phraseur->depth].
144
+					'</tt> '.
145
+					_T('ligne').
146
+					' '.
147
+					$phraseur->reperes[$phraseur->depth].
149 148
 			") <br />\n"))
150 149
 		);
151 150
 	}
@@ -188,7 +187,7 @@  discard block
 block discarded – undo
188 187
 	// et escamoter le doctype que sax mange en php5 mais pas en  php4
189 188
 	if (!$doctype) {
190 189
 		if (!$r = analyser_doctype($page)) {
191
-			$page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE
190
+			$page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE
192 191
 				. preg_replace(_REGEXP_DOCTYPE, '', $page);
193 192
 			$r = analyser_doctype($page);
194 193
 		}
@@ -297,18 +296,18 @@  discard block
 block discarded – undo
297 296
 					'rss-0.91.dtd'
298 297
 				];
299 298
 			} else {
300
-				$dtd = $topelement . '.dtd';
299
+				$dtd = $topelement.'.dtd';
301 300
 				$f = find_in_path($dtd);
302 301
 				if (file_exists($f)) {
303 302
 					return [$entete, 'SYSTEM', $f, $dtd];
304 303
 				}
305 304
 			}
306 305
 		}
307
-		spip_log('Dtd pas vu pour ' . substr($data, 0, 100));
306
+		spip_log('Dtd pas vu pour '.substr($data, 0, 100));
308 307
 
309 308
 		return [];
310 309
 	}
311
-	list($entete, , $topelement, $avail, $suite) = $page;
310
+	list($entete,, $topelement, $avail, $suite) = $page;
312 311
 
313 312
 	if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r)) {
314 313
 		if (!preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r)) {
Please login to merge, or discard this patch.
ecrire/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 // Determiner l'action demandee
36 36
 //
37 37
 
38
-$exec = (string)_request('exec');
38
+$exec = (string) _request('exec');
39 39
 $reinstall = (!is_null(_request('reinstall'))) ? _request('reinstall') : ($exec == 'install' ? 'oui' : null);
40 40
 //
41 41
 // Les scripts d'insallation n'authentifient pas, forcement,
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 			or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo')
122 122
 		)
123 123
 	) {
124
-		spip_log('Quand la meta admin vaut ' .
125
-			$GLOBALS['meta']['admin'] .
126
-			' seul un admin peut se connecter et sans AJAX.' .
124
+		spip_log('Quand la meta admin vaut '.
125
+			$GLOBALS['meta']['admin'].
126
+			' seul un admin peut se connecter et sans AJAX.'.
127 127
 			' En cas de probleme, detruire cette meta.');
128 128
 		die(_T('info_travaux_texte'));
129 129
 	}
Please login to merge, or discard this patch.
ecrire/inc_version.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
52 52
 
53 53
 /** chemin absolu vers la racine */
54
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
54
+define('_ROOT_RACINE', dirname(__DIR__).'/');
55 55
 /** chemin absolu vers le repertoire de travail */
56
-define('_ROOT_CWD', getcwd() . '/');
56
+define('_ROOT_CWD', getcwd().'/');
57 57
 /** chemin absolu vers ecrire */
58
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
58
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
59 59
 
60 60
 // Icones
61 61
 if (!defined('_NOM_IMG_PACK')) {
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 	define('_NOM_IMG_PACK', 'images/');
64 64
 }
65 65
 /** le chemin http (relatif) vers les images standard */
66
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
66
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
67 67
 
68 68
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
69
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
69
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
70 70
 
71 71
 if (!defined('_JAVASCRIPT')) {
72 72
 	/** Nom du repertoire des  bibliotheques JavaScript */
73 73
 	define('_JAVASCRIPT', 'javascript/');
74 74
 } // utilisable avec #CHEMIN et find_in_path
75 75
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
76
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
76
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
77 77
 
78 78
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
79 79
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 
105 105
 // Son emplacement absolu si on le trouve
106 106
 if (
107
-	@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')
108
-	or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))
107
+	@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')
108
+	or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php'))
109 109
 ) {
110 110
 	/** Emplacement absolu du fichier d'option */
111 111
 	define('_FILE_OPTIONS', $f);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 // Inclure l'ecran de securite
130 130
 if (
131 131
 	!defined('_ECRAN_SECURITE')
132
-	and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
132
+	and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
133 133
 ) {
134 134
 	include $f;
135 135
 }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			// UA plus cibles
151 151
 			. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
152 152
 			. ',i',
153
-			(string)$_SERVER['HTTP_USER_AGENT']
153
+			(string) $_SERVER['HTTP_USER_AGENT']
154 154
 		)
155 155
 	);
156 156
 }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 # la matrice standard (fichiers definissant les fonctions a inclure)
393 393
 $spip_matrice = [];
394 394
 # les plugins a activer
395
-$plugins = [];  // voir le contenu du repertoire /plugins/
395
+$plugins = []; // voir le contenu du repertoire /plugins/
396 396
 # les surcharges de include_spip()
397 397
 $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
398 398
 
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
 //
471 471
 // Charger les fonctions liees aux serveurs Http et Sql.
472 472
 //
473
-require_once _ROOT_RESTREINT . 'inc/utils.php';
474
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
473
+require_once _ROOT_RESTREINT.'inc/utils.php';
474
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
475 475
 
476 476
 // Definition personnelles eventuelles
477 477
 
@@ -494,10 +494,10 @@  discard block
 block discarded – undo
494 494
 // ===> on execute en neutralisant les messages d'erreur
495 495
 
496 496
 spip_initialisation_core(
497
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
498
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
499
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
500
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
497
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
498
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
499
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
500
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
501 501
 );
502 502
 
503 503
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 		// Si on est dans le site public, dire que qq s'en occupe
553 553
 		include_spip('inc/minipres');
554 554
 		utiliser_langue_visiteur();
555
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]);
555
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]);
556 556
 		exit;
557 557
 	}
558 558
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -591,12 +591,12 @@  discard block
 block discarded – undo
591 591
 	}
592 592
 	if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) {
593 593
 		include_spip('inc/filtres_mini');
594
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt'));
594
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt'));
595 595
 	} else {
596 596
 		// header minimal
597
-		header(_HEADER_COMPOSED_BY . ' @ www.spip.net');
597
+		header(_HEADER_COMPOSED_BY.' @ www.spip.net');
598 598
 	}
599 599
 }
600 600
 
601 601
 $methode = (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ((php_sapi_name() == 'cli') ? 'cli' : ''));
602
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
602
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.
ecrire/iterateur/data.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		// Si a ce stade on n'a pas de table, il y a un bug
235 235
 		if (!is_array($this->tableau)) {
236 236
 			$this->err = true;
237
-			spip_log('erreur datasource ' . var_export($command, true));
237
+			spip_log('erreur datasource '.var_export($command, true));
238 238
 		}
239 239
 
240 240
 		// {datapath query.results}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			isset($this->command['sourcemode'])
277 277
 			and !in_array($this->command['sourcemode'], ['table', 'array', 'tableau'])
278 278
 		) {
279
-			charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true);
279
+			charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true);
280 280
 		}
281 281
 
282 282
 		# le premier argument peut etre un array, une URL etc.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 		# avons-nous un cache dispo ?
286 286
 		$cle = null;
287 287
 		if (is_string($src)) {
288
-			$cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true));
288
+			$cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true));
289 289
 		}
290 290
 
291 291
 		$cache = $this->cache_get($cle);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
 					if (
346 346
 						!$this->err
347
-						and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true)
347
+						and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true)
348 348
 					) {
349 349
 						$args = $this->command['source'];
350 350
 						$args[0] = $data;
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
 							$tv = '%s';
485 485
 						} # {par valeur/xx/yy} ??
486 486
 						else {
487
-							$tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')';
487
+							$tv = 'table_valeur(%s, '.var_export($r[1], true).')';
488 488
 						}
489 489
 						$sortfunc .= '
490
-					$a = ' . sprintf($tv, '$aa') . ';
491
-					$b = ' . sprintf($tv, '$bb') . ';
490
+					$a = ' . sprintf($tv, '$aa').';
491
+					$b = ' . sprintf($tv, '$bb').';
492 492
 					if ($a <> $b)
493
-						return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;';
493
+						return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;';
494 494
 					}
495 495
 				}
496 496
 			}
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
 		if ($sortfunc) {
500 500
 			$sortfunc .= "\n return 0;";
501
-			uasort($this->tableau, function ($aa, $bb) use ($sortfunc) {
501
+			uasort($this->tableau, function($aa, $bb) use ($sortfunc) {
502 502
 				return eval($sortfunc);
503 503
 			});
504 504
 		}
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 function inc_sql_to_array_dist($data) {
644 644
 	# sortir le connecteur de $data
645 645
 	preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v);
646
-	$serveur = (string)$v[1];
646
+	$serveur = (string) $v[1];
647 647
 	$req = trim($v[2]);
648 648
 	if ($s = sql_query($req, $serveur)) {
649 649
 		$r = [];
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
  */
666 666
 function inc_json_to_array_dist($data) {
667 667
 	if (is_array($json = json_decode($data, true))) {
668
-		return (array)$json;
668
+		return (array) $json;
669 669
 	}
670 670
 }
671 671
 
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
 	$i = 1;
685 685
 	foreach ($entete as $k => $v) {
686 686
 		if (trim($v) == '') {
687
-			$v = 'col' . $i;
687
+			$v = 'col'.$i;
688 688
 		} // reperer des eventuelles cases vides
689 689
 		if (is_numeric($v) and $v < 0) {
690
-			$v = '__' . $v;
690
+			$v = '__'.$v;
691 691
 		} // ne pas risquer d'ecraser une cle numerique
692 692
 		if (is_numeric($v)) {
693
-			$v = '_' . $v;
693
+			$v = '_'.$v;
694 694
 		} // ne pas risquer d'ecraser une cle numerique
695 695
 		$v = strtolower(preg_replace(',\W+,', '_', translitteration($v)));
696 696
 		foreach ($csv as &$item) {
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
  * @return array|bool
776 776
  */
777 777
 function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) {
778
-	return (array)preg_files($dir, $regexp, $limit);
778
+	return (array) preg_files($dir, $regexp, $limit);
779 779
 }
780 780
 
781 781
 /**
@@ -790,13 +790,13 @@  discard block
 block discarded – undo
790 790
 	$glob_to_array = charger_fonction('glob_to_array', 'inc');
791 791
 	$a = $glob_to_array($data);
792 792
 	foreach ($a as &$v) {
793
-		$b = (array)@stat($v);
793
+		$b = (array) @stat($v);
794 794
 		foreach ($b as $k => $ignore) {
795 795
 			if (is_numeric($k)) {
796 796
 				unset($b[$k]);
797 797
 			}
798 798
 		}
799
-		$b['file'] = preg_replace('`/$`', '', $v) ;
799
+		$b['file'] = preg_replace('`/$`', '', $v);
800 800
 		$v = array_merge(
801 801
 			pathinfo($v),
802 802
 			$b
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 	$xml_array = [];
817 817
 	for ($object->rewind(); $object->valid(); $object->next()) {
818 818
 		if (array_key_exists($key = $object->key(), $xml_array)) {
819
-			$key .= '-' . uniqid();
819
+			$key .= '-'.uniqid();
820 820
 		}
821 821
 		$vars = get_object_vars($object->current());
822 822
 		if (isset($vars['@attributes'])) {
Please login to merge, or discard this patch.
ecrire/install/etape_ldap1.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 					'valeur' => $adresse_ldap
59 59
 				],
60 60
 				'port_ldap' => [
61
-					'label' => _T('entree_port_annuaire') . '<br />' . _T('texte_port_annuaire'),
61
+					'label' => _T('entree_port_annuaire').'<br />'._T('texte_port_annuaire'),
62 62
 					'valeur' => $port_ldap
63 63
 				],
64 64
 				'tls_ldap' => [
65
-					'label' => '<b>' . _T('tls_ldap') . '</b>',
65
+					'label' => '<b>'._T('tls_ldap').'</b>',
66 66
 					'valeur' => $tls_ldap,
67 67
 					'alternatives' => [
68 68
 						'non' => _T('item_non'),
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			]
81 81
 		)
82 82
 
83
-		. "\n<p>" . _T('texte_acces_ldap_anonyme_1') . '</p>'
83
+		. "\n<p>"._T('texte_acces_ldap_anonyme_1').'</p>'
84 84
 		. fieldset(
85 85
 			_T('connexion_ldap'),
86 86
 			[
Please login to merge, or discard this patch.
ecrire/install/etape_chmod.php 1 patch
Spacing   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			$test_dir .= '/';
82 82
 		}
83 83
 		if (!in_array($test_dir, $GLOBALS['test_dirs'])) {
84
-			$GLOBALS['test_dirs'][] = _DIR_RACINE . $test_dir;
84
+			$GLOBALS['test_dirs'][] = _DIR_RACINE.$test_dir;
85 85
 		}
86 86
 	} else {
87 87
 		if (!_FILE_CONNECT) {
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 	foreach ($GLOBALS['test_dirs'] as $i => $my_dir) {
97 97
 		$test = test_ecrire($my_dir);
98 98
 		if (!$test) {
99
-			$m = preg_replace(',^' . _DIR_RACINE . ',', '', $my_dir);
99
+			$m = preg_replace(',^'._DIR_RACINE.',', '', $my_dir);
100 100
 			if (@file_exists($my_dir)) {
101
-				$bad_dirs['<li>' . $m . '</li>'] = 1;
101
+				$bad_dirs['<li>'.$m.'</li>'] = 1;
102 102
 			} else {
103
-				$absent_dirs['<li>' . $m . '</li>'] = 1;
103
+				$absent_dirs['<li>'.$m.'</li>'] = 1;
104 104
 			}
105 105
 		} else {
106 106
 			$chmod = max($chmod, $test);
@@ -110,21 +110,21 @@  discard block
 block discarded – undo
110 110
 	if ($bad_dirs or $absent_dirs) {
111 111
 		if (!_FILE_CONNECT) {
112 112
 			$titre = _T('dirs_preliminaire');
113
-			$continuer = ' ' . _T('dirs_commencer') . '.';
113
+			$continuer = ' '._T('dirs_commencer').'.';
114 114
 		} else {
115 115
 			$titre = _T('dirs_probleme_droits');
116 116
 		}
117 117
 
118 118
 
119
-		$res = "<div align='right'>" . menu_langues('var_lang_ecrire') . "</div>\n";
119
+		$res = "<div align='right'>".menu_langues('var_lang_ecrire')."</div>\n";
120 120
 
121 121
 		if ($bad_dirs) {
122 122
 			$res .=
123 123
 				_T(
124 124
 					'dirs_repertoires_suivants',
125 125
 					['bad_dirs' => join("\n", array_keys($bad_dirs))]
126
-				) .
127
-				'<b>' . _T('login_recharger') . '</b>.';
126
+				).
127
+				'<b>'._T('login_recharger').'</b>.';
128 128
 		}
129 129
 
130 130
 		if ($absent_dirs) {
@@ -132,22 +132,21 @@  discard block
 block discarded – undo
132 132
 				_T(
133 133
 					'dirs_repertoires_absents',
134 134
 					['bad_dirs' => join("\n", array_keys($absent_dirs))]
135
-				) .
136
-				'<b>' . _T('login_recharger') . '</b>.';
135
+				).
136
+				'<b>'._T('login_recharger').'</b>.';
137 137
 		}
138
-		$res = '<p>' . $continuer . $res . aider('install0', true) . '</p>';
138
+		$res = '<p>'.$continuer.$res.aider('install0', true).'</p>';
139 139
 
140 140
 		$t = _T('login_recharger');
141
-		$t = (!$test_dir ? '' :
142
-				"<input type='hidden' name='test_dir' value='" . spip_htmlspecialchars($test_dir, ENT_QUOTES) . "' />")
141
+		$t = (!$test_dir ? '' : "<input type='hidden' name='test_dir' value='".spip_htmlspecialchars($test_dir, ENT_QUOTES)."' />")
143 142
 			. "<input type='hidden' name='etape' value='chmod' />"
144
-			. "<div style='text-align: right'><input type='submit' value='" . attribut_html($t) . "' /></div>";
143
+			. "<div style='text-align: right'><input type='submit' value='".attribut_html($t)."' /></div>";
145 144
 
146
-		echo minipres($titre, $res . generer_form_ecrire('install', $t));
145
+		echo minipres($titre, $res.generer_form_ecrire('install', $t));
147 146
 	} else {
148 147
 		$deja = (_FILE_CONNECT and analyse_fichier_connection(_FILE_CONNECT));
149 148
 		if (!$deja) {
150
-			redirige_url_ecrire('install', 'etape=1&chmod=' . $chmod);
149
+			redirige_url_ecrire('install', 'etape=1&chmod='.$chmod);
151 150
 		} else {
152 151
 			redirige_url_ecrire();
153 152
 		}
Please login to merge, or discard this patch.
ecrire/install/etape_ldap4.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	if ($fail) {
41 41
 		echo info_etape(_T('info_chemin_acces_annuaire')),
42 42
 		info_progression_etape(3, 'etape_ldap', 'install/', true),
43
-			"<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'),
44
-			' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>';
43
+			"<div class='error'><p><b>"._T('avis_operation_echec').'</b></p><p>'._T('avis_chemin_invalide_1'),
44
+			' (<tt>'.spip_htmlspecialchars($base_ldap).'</tt>) '._T('avis_chemin_invalide_2').'</p></div>';
45 45
 	} else {
46 46
 		info_etape(_T('info_reglage_ldap'));
47 47
 		echo info_progression_etape(4, 'etape_ldap', 'install/');
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 		$res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap'])
56 56
 			. "<input type='hidden' name='etape' value='ldap5' />"
57
-			. "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />"
57
+			. "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />"
58 58
 			. fieldset(
59 59
 				_T('info_statut_utilisateurs_1'),
60 60
 				[
61 61
 					'statut_ldap' => [
62
-						'label' => _T('info_statut_utilisateurs_2') . '<br />',
62
+						'label' => _T('info_statut_utilisateurs_2').'<br />',
63 63
 						'valeur' => $statut_ldap,
64 64
 						'alternatives' => $statuts
65 65
 					]
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 // https://code.spip.net/@liste_statuts_ldap
78 78
 function liste_statuts_ldap() {
79 79
 	$recom = [
80
-		'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'),
81
-		'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'),
82
-		'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />')
80
+		'info_administrateurs' => ('<b>'._T('info_administrateur_1').'</b> '._T('info_administrateur_2').'<br />'),
81
+		'info_redacteurs' => ('<b>'._T('info_redacteur_1').'</b> '._T('info_redacteur_2').'<br />'),
82
+		'info_visiteurs' => ('<b>'._T('info_visiteur_1').'</b> '._T('info_visiteur_2').'<br />')
83 83
 	];
84 84
 
85 85
 	$res = [];
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
 function install_ldap_correspondances() {
96 96
 	$champs = [];
97 97
 	foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) {
98
-		$nom = 'ldap_' . $champ;
98
+		$nom = 'ldap_'.$champ;
99 99
 		$val = is_array($v) ? join(',', $v) : strval($v);
100 100
 		$champs[$nom] = [
101
-			'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />',
101
+			'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]).'<br />',
102 102
 			'valeur' => $val
103 103
 		];
104 104
 	}
105 105
 
106 106
 	return !$champs ?
107
-		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />');
107
+		'' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />');
108 108
 }
Please login to merge, or discard this patch.