Completed
Pull Request — master (#39)
by
unknown
09:06
created
ecrire/urls/page.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite
24 24
 define('_separateur_urls_page', '');
25 25
 # on peut indiquer '' si on a installe le .htaccess
26
-define('_debut_urls_page', get_spip_script('./') . '?');
26
+define('_debut_urls_page', get_spip_script('./').'?');
27 27
 #######
28 28
 
29 29
 
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 	}
39 39
 
40
-	$url = _debut_urls_page . $type . _separateur_urls_page
41
-		. $id . _terminaison_urls_page;
40
+	$url = _debut_urls_page.$type._separateur_urls_page
41
+		. $id._terminaison_urls_page;
42 42
 
43 43
 	if ($args) {
44 44
 		$args = strpos($url, '?') ? "&$args" : "?$args";
45 45
 	}
46 46
 
47
-	return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : '');
47
+	return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : '');
48 48
 }
49 49
 
50 50
 // retrouve le fond et les parametres d'une URL abregee
Please login to merge, or discard this patch.
ecrire/xml/interfaces.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,23 +23,23 @@
 block discarded – undo
23 23
 
24 24
 define('_SUB_REGEXP_SYMBOL', '[\w_:.-]');
25 25
 
26
-define('_REGEXP_NMTOKEN', '/^' . _SUB_REGEXP_SYMBOL . '+$/');
26
+define('_REGEXP_NMTOKEN', '/^'._SUB_REGEXP_SYMBOL.'+$/');
27 27
 
28
-define('_REGEXP_NMTOKENS', '/^(' . _SUB_REGEXP_SYMBOL . '+\s*)*$/');
28
+define('_REGEXP_NMTOKENS', '/^('._SUB_REGEXP_SYMBOL.'+\s*)*$/');
29 29
 
30
-define('_REGEXP_ID', '/^[A-Za-z_:]' . _SUB_REGEXP_SYMBOL . '*$/');
30
+define('_REGEXP_ID', '/^[A-Za-z_:]'._SUB_REGEXP_SYMBOL.'*$/');
31 31
 
32
-define('_REGEXP_ENTITY_USE', '/%(' . _SUB_REGEXP_SYMBOL . '+);/');
33
-define('_REGEXP_ENTITY_DEF', '/^%(' . _SUB_REGEXP_SYMBOL . '+);/');
32
+define('_REGEXP_ENTITY_USE', '/%('._SUB_REGEXP_SYMBOL.'+);/');
33
+define('_REGEXP_ENTITY_DEF', '/^%('._SUB_REGEXP_SYMBOL.'+);/');
34 34
 define('_REGEXP_TYPE_XML', 'PUBLIC|SYSTEM|INCLUDE|IGNORE|CDATA');
35
-define('_REGEXP_ENTITY_DECL', '/^<!ENTITY\s+(%?)\s*(' .
36
-	_SUB_REGEXP_SYMBOL .
37
-	'+;?)\s+(' .
38
-	_REGEXP_TYPE_XML .
39
-	')?\s*(' .
40
-	"('([^']*)')" .
41
-	'|("([^"]*)")' .
42
-	'|\s*(%' . _SUB_REGEXP_SYMBOL . '+;)\s*' .
35
+define('_REGEXP_ENTITY_DECL', '/^<!ENTITY\s+(%?)\s*('.
36
+	_SUB_REGEXP_SYMBOL.
37
+	'+;?)\s+('.
38
+	_REGEXP_TYPE_XML.
39
+	')?\s*('.
40
+	"('([^']*)')".
41
+	'|("([^"]*)")'.
42
+	'|\s*(%'._SUB_REGEXP_SYMBOL.'+;)\s*'.
43 43
 	')\s*(--.*?--)?("([^"]*)")?\s*>\s*(.*)$/s');
44 44
 
45 45
 define('_REGEXP_INCLUDE_USE', '/^<!\[\s*%\s*([^;]*);\s*\[\s*(.*)$/s');
Please login to merge, or discard this patch.
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
 		}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			}
157 157
 		}
158 158
 		if (!is_string($r)) {
159
-			spip_log("erreur $r dans la DTD  " . substr($dtd, 0, 80) . ".....");
159
+			spip_log("erreur $r dans la DTD  ".substr($dtd, 0, 80).".....");
160 160
 
161 161
 			return false;
162 162
 		}
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		if (($n[0] == 'PUBLIC')
204 204
 			and !tester_url_absolue($n[1])
205 205
 		) {
206
-			$n[1] = substr($grammaire, 0, strrpos($grammaire, '/') + 1) . $n[1];
206
+			$n[1] = substr($grammaire, 0, strrpos($grammaire, '/') + 1).$n[1];
207 207
 		}
208 208
 		analyser_dtd($n[1], $n[0], $dtc);
209 209
 	}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	}
228 228
 
229 229
 	if ($dtc->macros[$m[1]] == 'INCLUDE') {
230
-		$retour = $r[1] . substr($m[2], strlen($r[0]));
230
+		$retour = $r[1].substr($m[2], strlen($r[0]));
231 231
 	} else {
232 232
 		$retour = substr($m[2], strlen($r[0]));
233 233
 	}
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 		spip_log("redefinition de l'entite $nom");
261 261
 	}
262 262
 	if ($k6) {
263
-		return $k6 . $dtd;
263
+		return $k6.$dtd;
264 264
 	} // cas du synonyme complet
265 265
 	$val = expanserEntite(($k2 ? $k3 : ($k4 ? $k5 : $k6)), $dtc->macros);
266 266
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	if (preg_match_all("/\s*(\S+)\s+(([(][^)]*[)])|(\S+))\s+([^\s']*)(\s*'[^']*')?/", $val, $r2, PREG_SET_ORDER)) {
367 367
 		foreach ($r2 as $m2) {
368 368
 			$v = preg_match('/^\w+$/', $m2[2]) ? $m2[2]
369
-				: ('/^' . preg_replace('/\s+/', '', $m2[2]) . '$/');
369
+				: ('/^'.preg_replace('/\s+/', '', $m2[2]).'$/');
370 370
 			$m21 = expanserEntite($m2[1], $dtc->macros);
371 371
 			$m25 = expanserEntite($m2[5], $dtc->macros);
372 372
 			$dtc->attributs[$nom][$m21] = array($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/valider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 							. $pere
63 63
 							. '</b>'
64 64
 							. (!$bons_peres ? ''
65
-								: ('<p style="font-size: 80%"> ' . _T('zxml_mais_de') . ' <b>' . $bons_peres . '</b></p>')));
65
+								: ('<p style="font-size: 80%"> '._T('zxml_mais_de').' <b>'.$bons_peres.'</b></p>')));
66 66
 					} elseif ($this->dtc->regles[$pere][0] == '/') {
67 67
 						$frat = substr($depth, 2);
68 68
 						if (!isset($this->fratrie[$frat])) {
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
 		if (!isset($a[$name])) {
101 101
 			$bons = join(', ', array_keys($a));
102 102
 			if ($bons) {
103
-				$bons = " title=' " .
104
-					_T('zxml_connus_attributs') .
105
-					'&nbsp;: ' .
106
-					$bons .
103
+				$bons = " title=' ".
104
+					_T('zxml_connus_attributs').
105
+					'&nbsp;: '.
106
+					$bons.
107 107
 					"'";
108 108
 			}
109 109
 			$bons .= " style='font-weight: bold'";
110 110
 			coordonnees_erreur($this, " <b>$name</b> "
111
-				. _T('zxml_inconnu_attribut') . ' ' . _T('zxml_de')
111
+				. _T('zxml_inconnu_attribut').' '._T('zxml_de')
112 112
 				. " <a$bons>$bal</a> ("
113 113
 				. _T('zxml_survoler')
114 114
 				. ")");
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			if (!preg_match('/^\w+$/', $type)) {
118 118
 				$this->valider_motif($phraseur, $name, $val, $bal, $type);
119 119
 			} else {
120
-				if (method_exists($this, $f = 'validerAttribut_' . $type)) {
120
+				if (method_exists($this, $f = 'validerAttribut_'.$type)) {
121 121
 					$this->$f($phraseur, $name, $val, $bal);
122 122
 				}
123 123
 			}
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 				. " <b>$bal</b> "
171 171
 				. _T('zxml_non_conforme')
172 172
 				. "</p><p>"
173
-				. "<b>" . $motif . "</b>");
173
+				. "<b>".$motif."</b>");
174 174
 		}
175 175
 	}
176 176
 
177 177
 	// http://code.spip.net/@valider_idref
178 178
 	public function valider_idref($nom, $ligne, $col) {
179 179
 		if (!isset($this->ids[$nom])) {
180
-			$this->err[] = array(" <p><b>$nom</b> " . _T('zxml_inconnu_id'), $ligne, $col);
180
+			$this->err[] = array(" <p><b>$nom</b> "._T('zxml_inconnu_id'), $ligne, $col);
181 181
 		}
182 182
 	}
183 183
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		// controler que les balises devant etre vides le sont 
228 228
 		if ($vide) {
229 229
 			if ($n <> ($k + $c)) {
230
-				coordonnees_erreur($this, " <p><b>$name</b> " . _T('zxml_nonvide_balise'));
230
+				coordonnees_erreur($this, " <p><b>$name</b> "._T('zxml_nonvide_balise'));
231 231
 			}
232 232
 			// pour les regles PCDATA ou iteration de disjonction, tout est fait
233 233
 		} elseif ($regle and ($regle != '*')) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 			$d = $this->ouvrant[$d];
263 263
 			preg_match('/^\s*(\S+)/', $d, $m);
264 264
 			if (isset($this->dtc->pcdata[$m[1]]) and ($this->dtc->pcdata[$m[1]])) {
265
-				coordonnees_erreur($this, " <p><b>" . $m[1] . "</b> "
265
+				coordonnees_erreur($this, " <p><b>".$m[1]."</b> "
266 266
 					. _T('zxml_nonvide_balise') // message a affiner
267 267
 				);
268 268
 			}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	public function phraserTout($phraseur, $data) {
310 310
 		xml_parsestring($this, $data);
311 311
 
312
-		if (!$this->dtc or preg_match(',^' . _MESSAGE_DOCTYPE . ',', $data)) {
312
+		if (!$this->dtc or preg_match(',^'._MESSAGE_DOCTYPE.',', $data)) {
313 313
 			$this->err[] = array('DOCTYPE ?', 0, 0);
314 314
 		} else {
315 315
 			$this->valider_passe2($this);
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
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	$t = isset($phraseur->ouvrant[$depth]) ? $phraseur->ouvrant[$depth] : ' ';
46 46
 	// espace initial signifie: deja integree au resultat
47 47
 	if ($t[0] != ' ') {
48
-		$phraseur->res .= '<' . $t . '>';
49
-		$phraseur->ouvrant[$depth] = ' ' . $t;
48
+		$phraseur->res .= '<'.$t.'>';
49
+		$phraseur->ouvrant[$depth] = ' '.$t;
50 50
 	}
51 51
 	$t = $phraseur->contenu[$depth];
52 52
 	// n'indenter que s'il y a un separateur avant
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
 	foreach ($attrs as $k => $v) {
58 58
 		$delim = strpos($v, "'") === false ? "'" : '"';
59 59
 		$val = xml_entites_html($v);
60
-		$att .= $sep . $k . "=" . $delim
60
+		$att .= $sep.$k."=".$delim
61 61
 			. ($delim !== '"' ? str_replace('&quot;', '"', $val) : $val)
62 62
 			. $delim;
63 63
 		$sep = "\n $depth";
64 64
 	}
65 65
 	$phraseur->depth .= '  ';
66 66
 	$phraseur->contenu[$phraseur->depth] = "";
67
-	$phraseur->ouvrant[$phraseur->depth] = $name . $att;
67
+	$phraseur->ouvrant[$phraseur->depth] = $name.$att;
68 68
 	$phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax);
69 69
 }
70 70
 
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	$ouv = $phraseur->ouvrant[$phraseur->depth];
74 74
 
75 75
 	if ($ouv[0] != ' ') {
76
-		$phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv;
76
+		$phraseur->ouvrant[$phraseur->depth] = ' '.$ouv;
77 77
 	} else {
78 78
 		$ouv = "";
79 79
 	}
80 80
 	$t = $phraseur->contenu[$phraseur->depth];
81 81
 	$phraseur->depth = substr($phraseur->depth, 2);
82
-	$t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t);
82
+	$t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t);
83 83
 
84 84
 	// fusion <balise></balise> en <balise />.
85 85
 	// ATTENTION,  certains clients http croient que fusion ==> pas d'atttributs
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
 	// (param fusion_bal)
89 89
 
90 90
 	if ($t || (($ouv != $name) and !$fusion_bal)) {
91
-		$phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . "</" . $name . ">";
91
+		$phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t."</".$name.">";
92 92
 	} else {
93
-		$phraseur->res .= ($ouv ? ('<' . $ouv . ' />') : ("</" . $name . ">"));
93
+		$phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ("</".$name.">"));
94 94
 	}
95 95
 }
96 96
 
@@ -134,16 +134,15 @@  discard block
 block discarded – undo
134 134
 	if (!xml_parse($phraseur->sax, $data, true)) {
135 135
 		coordonnees_erreur($phraseur,
136 136
 			xml_error_string(xml_get_error_code($phraseur->sax))
137
-			. "<br />\n" .
138
-			(!$phraseur->depth ? '' :
139
-				('(' .
140
-					_T('erreur_balise_non_fermee') .
141
-					" <tt>" .
142
-					$phraseur->ouvrant[$phraseur->depth] .
143
-					"</tt> " .
144
-					_T('ligne') .
145
-					" " .
146
-					$phraseur->reperes[$phraseur->depth] .
137
+			. "<br />\n".
138
+			(!$phraseur->depth ? '' : ('('.
139
+					_T('erreur_balise_non_fermee').
140
+					" <tt>".
141
+					$phraseur->ouvrant[$phraseur->depth].
142
+					"</tt> ".
143
+					_T('ligne').
144
+					" ".
145
+					$phraseur->reperes[$phraseur->depth].
147 146
 					") <br />\n")));
148 147
 	}
149 148
 }
@@ -185,7 +184,7 @@  discard block
 block discarded – undo
185 184
 	// et escamoter le doctype que sax mange en php5 mais pas en  php4
186 185
 	if (!$doctype) {
187 186
 		if (!$r = analyser_doctype($page)) {
188
-			$page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE
187
+			$page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE
189 188
 				. preg_replace(_REGEXP_DOCTYPE, '', $page);
190 189
 			$r = analyser_doctype($page);
191 190
 		}
@@ -286,18 +285,18 @@  discard block
 block discarded – undo
286 285
 					'rss-0.91.dtd'
287 286
 				);
288 287
 			} else {
289
-				$dtd = $topelement . '.dtd';
288
+				$dtd = $topelement.'.dtd';
290 289
 				$f = find_in_path($dtd);
291 290
 				if (file_exists($f)) {
292 291
 					return array($entete, 'SYSTEM', $f, $dtd);
293 292
 				}
294 293
 			}
295 294
 		}
296
-		spip_log("Dtd pas vu pour " . substr($data, 0, 100));
295
+		spip_log("Dtd pas vu pour ".substr($data, 0, 100));
297 296
 
298 297
 		return array();
299 298
 	}
300
-	list($entete, , $topelement, $avail, $suite) = $page;
299
+	list($entete,, $topelement, $avail, $suite) = $page;
301 300
 
302 301
 	if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r)) {
303 302
 		if (!preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r)) {
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function generer_nom_fichier_cache($contexte, $page) {
30 30
 	$u = md5(var_export(array($contexte, $page), true));
31 31
 
32
-	return $u . ".cache";
32
+	return $u.".cache";
33 33
 }
34 34
 
35 35
 /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	$rep = sous_repertoire($rep, '', false, true);
47 47
 	$rep = sous_repertoire($rep, $d, false, true);
48 48
 
49
-	return ecrire_fichier($rep . $u . ".cache", serialize(array("nom_cache" => $nom_cache, "valeur" => $valeur)));
49
+	return ecrire_fichier($rep.$u.".cache", serialize(array("nom_cache" => $nom_cache, "valeur" => $valeur)));
50 50
 }
51 51
 
52 52
 /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 function lire_cache($nom_cache) {
59 59
 	$d = substr($nom_cache, 0, 2);
60 60
 	$u = substr($nom_cache, 2, 2);
61
-	if (file_exists($f = _DIR_CACHE . "$d/$u.cache")
61
+	if (file_exists($f = _DIR_CACHE."$d/$u.cache")
62 62
 		and lire_fichier($f, $tmp)
63 63
 		and $tmp = unserialize($tmp)
64 64
 		and $tmp['nom_cache'] == $nom_cache
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 		include_spip('inc/acces');
78 78
 		include_spip('auth/sha256.inc');
79 79
 		ecrire_meta('cache_signature',
80
-			_nano_sha256($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SERVER_SIGNATURE"] . creer_uniqid()), 'non');
80
+			_nano_sha256($_SERVER["DOCUMENT_ROOT"].$_SERVER["SERVER_SIGNATURE"].creer_uniqid()), 'non');
81 81
 	}
82 82
 
83
-	return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']);
83
+	return crc32($GLOBALS['meta']['cache_signature'].$page['texte']);
84 84
 }
85 85
 
86 86
 /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		// "cache sessionne" ; sa date indique la date de validite
235 235
 		// des caches sessionnes
236 236
 		if (!$tmp = lire_cache($chemin_cache)) {
237
-			spip_log('Creation cache sessionne ' . $chemin_cache);
237
+			spip_log('Creation cache sessionne '.$chemin_cache);
238 238
 			$tmp = array(
239 239
 				'invalideurs' => array('session' => ''),
240 240
 				'lastmodified' => $_SERVER['REQUEST_TIME']
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 	// l'enregistrer, compresse ou non...
259 259
 	$ok = ecrire_cache($chemin_cache, $pagez);
260 260
 
261
-	spip_log((_IS_BOT ? "Bot:" : "") . "Creation du cache $chemin_cache pour "
262
-		. $page['entetes']['X-Spip-Cache'] . " secondes" . ($ok ? '' : ' (erreur!)'), _LOG_INFO_IMPORTANTE);
261
+	spip_log((_IS_BOT ? "Bot:" : "")."Creation du cache $chemin_cache pour "
262
+		. $page['entetes']['X-Spip-Cache']." secondes".($ok ? '' : ' (erreur!)'), _LOG_INFO_IMPORTANTE);
263 263
 
264 264
 	// Inserer ses invalideurs
265 265
 	include_spip('inc/invalideur');
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 function nettoyer_petit_cache($prefix, $duree = 300) {
282 282
 	// determiner le repertoire a purger : 'tmp/CACHE/rech/'
283 283
 	$dircache = sous_repertoire(_DIR_CACHE, $prefix);
284
-	if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) {
284
+	if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) {
285 285
 		foreach (preg_files($dircache, '[.]txt$') as $f) {
286 286
 			if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) {
287 287
 				spip_unlink($f);
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 		if (spip_connect()) {
372 372
 			include_spip('inc/invalideur');
373 373
 			retire_caches($chemin_cache); # API invalideur inutile
374
-			supprimer_fichier(_DIR_CACHE . $chemin_cache);
374
+			supprimer_fichier(_DIR_CACHE.$chemin_cache);
375 375
 			if (isset($chemin_cache_session) and $chemin_cache_session) {
376
-				supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
376
+				supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
377 377
 			}
378 378
 		}
379 379
 	}
@@ -388,9 +388,9 @@  discard block
 block discarded – undo
388 388
 		$page = array('contexte_implicite' => $contexte_implicite); // ignorer le cache deja lu
389 389
 		include_spip('inc/invalideur');
390 390
 		retire_caches($chemin_cache); # API invalideur inutile
391
-		supprimer_fichier(_DIR_CACHE . $chemin_cache);
391
+		supprimer_fichier(_DIR_CACHE.$chemin_cache);
392 392
 		if (isset($chemin_cache_session) and $chemin_cache_session) {
393
-			supprimer_fichier(_DIR_CACHE . $chemin_cache_session);
393
+			supprimer_fichier(_DIR_CACHE.$chemin_cache_session);
394 394
 		}
395 395
 	}
396 396
 
Please login to merge, or discard this patch.
ecrire/public/decompiler.php 1 patch
Spacing   +19 added lines, -21 removed lines patch added patch discarded remove patch
@@ -24,11 +24,10 @@  discard block
 block discarded – undo
24 24
 	$milieu = decompiler_($struct->milieu, $fmt, $prof);
25 25
 
26 26
 	$type = $struct->sql_serveur ? "$struct->sql_serveur:" : '';
27
-	$type .= ($struct->type_requete ? $struct->type_requete :
28
-		$struct->table_optionnelle);
27
+	$type .= ($struct->type_requete ? $struct->type_requete : $struct->table_optionnelle);
29 28
 
30 29
 	if ($struct->jointures_explicites) {
31
-		$type .= " " . $struct->jointures_explicites;
30
+		$type .= " ".$struct->jointures_explicites;
32 31
 	}
33 32
 	if ($struct->table_optionnelle) {
34 33
 		$type .= "?";
@@ -37,11 +36,11 @@  discard block
 block discarded – undo
37 36
 
38 37
 	$crit = $struct->param;
39 38
 	if ($crit and !is_array($crit[0])) {
40
-		$type = strtolower($type) . array_shift($crit);
39
+		$type = strtolower($type).array_shift($crit);
41 40
 	}
42 41
 	$crit = decompiler_criteres($struct, $fmt, $prof);
43 42
 
44
-	$f = 'format_boucle_' . $fmt;
43
+	$f = 'format_boucle_'.$fmt;
45 44
 
46 45
 	return $f($avant, $nom, $type, $crit, $milieu, $apres, $altern, $prof);
47 46
 }
@@ -54,21 +53,20 @@  discard block
 block discarded – undo
54 53
 			$res[] = decompiler_($v, $fmt, $prof);
55 54
 		}
56 55
 	}
57
-	$file = is_string($struct->texte) ? $struct->texte :
58
-		decompiler_($struct->texte, $fmt, $prof);
59
-	$f = 'format_inclure_' . $fmt;
56
+	$file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof);
57
+	$f = 'format_inclure_'.$fmt;
60 58
 
61 59
 	return $f($file, $res, $prof);
62 60
 }
63 61
 
64 62
 function decompiler_texte($struct, $fmt = '', $prof = 0) {
65
-	$f = 'format_texte_' . $fmt;
63
+	$f = 'format_texte_'.$fmt;
66 64
 
67 65
 	return strlen($struct->texte) ? $f($struct->texte, $prof) : '';
68 66
 }
69 67
 
70 68
 function decompiler_polyglotte($struct, $fmt = '', $prof = 0) {
71
-	$f = 'format_polyglotte_' . $fmt;
69
+	$f = 'format_polyglotte_'.$fmt;
72 70
 
73 71
 	return $f($struct->traductions, $prof);
74 72
 }
@@ -81,7 +79,7 @@  discard block
 block discarded – undo
81 79
 
82 80
 	$filtres = decompiler_liste($struct->param, $fmt, $prof);
83 81
 
84
-	$f = 'format_idiome_' . $fmt;
82
+	$f = 'format_idiome_'.$fmt;
85 83
 
86 84
 	return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof);
87 85
 }
@@ -96,7 +94,7 @@  discard block
 block discarded – undo
96 94
 		}
97 95
 		$filtres = decompiler_liste($p, $fmt, $prof);
98 96
 	}
99
-	$f = 'format_champ_' . $fmt;
97
+	$f = 'format_champ_'.$fmt;
100 98
 
101 99
 	return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof);
102 100
 }
@@ -105,7 +103,7 @@  discard block
 block discarded – undo
105 103
 	if (!is_array($sources)) {
106 104
 		return '';
107 105
 	}
108
-	$f = 'format_liste_' . $fmt;
106
+	$f = 'format_liste_'.$fmt;
109 107
 	$res = '';
110 108
 	foreach ($sources as $arg) {
111 109
 		if (!is_array($arg)) {
@@ -121,7 +119,7 @@  discard block
 block discarded – undo
121 119
 				and (strlen($v[0]->apres) == 1)
122 120
 				and $v[0]->apres == $v[0]->avant
123 121
 			) {
124
-				$args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres;
122
+				$args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres;
125 123
 			} else {
126 124
 				$args[] = decompiler_($v, $fmt, 0 - $prof);
127 125
 			}
@@ -144,7 +142,7 @@  discard block
 block discarded – undo
144 142
 		return '';
145 143
 	}
146 144
 	$res = '';
147
-	$f = 'format_critere_' . $fmt;
145
+	$f = 'format_critere_'.$fmt;
148 146
 	foreach ($sources as $crit) {
149 147
 		if (!is_array($crit)) {
150 148
 			continue;
@@ -156,12 +154,12 @@  discard block
 block discarded – undo
156 154
 				and $v[0]->type == 'texte'
157 155
 				and $v[0]->apres
158 156
 			) {
159
-				$args[] = array(array('texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)));
157
+				$args[] = array(array('texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)));
160 158
 			} else {
161 159
 				$res2 = array();
162 160
 				foreach ($v as $k => $p) {
163 161
 					if (isset($p->type)
164
-						and function_exists($d = 'decompiler_' . $p->type)
162
+						and function_exists($d = 'decompiler_'.$p->type)
165 163
 					) {
166 164
 						$r = $d($p, $fmt, (0 - $prof), @$v[$k + 1]);
167 165
 						$res2[] = array($p->type, $r);
@@ -189,7 +187,7 @@  discard block
 block discarded – undo
189 187
 		if (!isset($p->type)) {
190 188
 			continue;
191 189
 		} #??????
192
-		$d = 'decompiler_' . $p->type;
190
+		$d = 'decompiler_'.$p->type;
193 191
 		$next = isset($liste[$k + 1]) ? $liste[$k + 1] : false;
194 192
 		// Forcer le champ etendu si son source (pas les reecritures)
195 193
 		// contenait des args et s'il est suivi d'espaces,
@@ -214,16 +212,16 @@  discard block
 block discarded – undo
214 212
 		$contenu[] = array($d($p, $fmt, $prof2), $p->type);
215 213
 
216 214
 	}
217
-	$f = 'format_suite_' . $fmt;
215
+	$f = 'format_suite_'.$fmt;
218 216
 
219 217
 	return $f($contenu);
220 218
 }
221 219
 
222 220
 function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') {
223
-	if (!include_spip('public/format_' . $fmt)) {
221
+	if (!include_spip('public/format_'.$fmt)) {
224 222
 		return "'$fmt'?";
225 223
 	}
226
-	$f = 'decompiler_' . $quoi;
224
+	$f = 'decompiler_'.$quoi;
227 225
 
228 226
 	return $f($liste, $fmt, $prof);
229 227
 }
Please login to merge, or discard this patch.
ecrire/public/aiguiller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 }
16 16
 
17 17
 function securiser_redirect_action($redirect) {
18
-	if ((tester_url_absolue($redirect) or preg_match(',^\w+:,',trim($redirect)))
18
+	if ((tester_url_absolue($redirect) or preg_match(',^\w+:,', trim($redirect)))
19 19
 		and !defined('_AUTORISER_ACTION_ABS_REDIRECT')) {
20 20
 		// si l'url est une url du site, on la laisse passer sans rien faire
21 21
 		// c'est encore le plus simple
22
-		$base = $GLOBALS['meta']['adresse_site'] . "/";
22
+		$base = $GLOBALS['meta']['adresse_site']."/";
23 23
 		if (strlen($base) and strncmp($redirect, $base, strlen($base)) == 0) {
24 24
 			return $redirect;
25 25
 		}
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			if ($ancre = _request('var_ajax_ancre')) {
139 139
 				// pas n'importe quoi quand meme dans la variable !
140 140
 				$ancre = str_replace(array('<', '"', "'"), array('&lt;', '&quot;', ''), $ancre);
141
-				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte;
141
+				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte;
142 142
 			}
143 143
 		} else {
144 144
 			include_spip('inc/headers');
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 				// on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7
293 293
 				// sans cela le formulaire n'est pas actif apres le hit ajax
294 294
 				// la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe
295
-				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour;
295
+				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour;
296 296
 				ajax_retour($retour, false);
297 297
 
298 298
 				return true; // on a fini le hit
Please login to merge, or discard this patch.