Completed
Push — master ( d64163...2218f7 )
by cam
04:20
created
ecrire/public/references.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	$select = true
125 125
 ) {
126 126
 	if (!is_string($defaut)) {
127
-		$defaut = '@$Pile[0][\'' . strtolower($nom_champ) . '\']';
127
+		$defaut = '@$Pile[0][\''.strtolower($nom_champ).'\']';
128 128
 	}
129 129
 
130 130
 	$i = 0;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			if ($select and !in_array($t, $boucles[$idb]->select)) {
153 153
 				$boucles[$idb]->select[] = $t;
154 154
 			}
155
-			$champ = '$Pile[$SP' . ($i ? "-$i" : "") . '][\'' . $c . '\']';
155
+			$champ = '$Pile[$SP'.($i ? "-$i" : "").'][\''.$c.'\']';
156 156
 			if (!$joker) {
157 157
 				return index_compose($conditionnel, $champ);
158 158
 			}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 function index_compose($conditionnel, $defaut) {
194 194
 	while ($c = array_pop($conditionnel)) {
195 195
 		// si on passe defaut = '', ne pas générer d'erreur de compilation.
196
-		$defaut = "($c:(" . ($defaut ? $defaut : "''") . "))";
196
+		$defaut = "($c:(".($defaut ? $defaut : "''")."))";
197 197
 	}
198 198
 
199 199
 	return $defaut;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	if (!$r) {
241 241
 		$joker = false; // indiquer a l'appelant
242 242
 		# continuer pour chercher l'erreur suivante
243
-		return array("'#" . $r . ':' . $nom_champ . "'", '');
243
+		return array("'#".$r.':'.$nom_champ."'", '');
244 244
 	}
245 245
 
246 246
 	$desc = $boucles[$idb]->show;
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 			$t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep);
341 341
 		}
342 342
 		if ($t == null) {
343
-			list($e, $x) = $excep;  #PHP4 affecte de gauche a droite
344
-			$excep = $x;    #PHP5 de droite a gauche !
343
+			list($e, $x) = $excep; #PHP4 affecte de gauche a droite
344
+			$excep = $x; #PHP5 de droite a gauche !
345 345
 			$j = $trouver_table($e, $boucle->sql_serveur);
346 346
 			if (!$j) {
347 347
 				return array('', '');
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 					$l = (preg_split('/\s*,\s*/', $k));
354 354
 					$k = $desc['key']['PRIMARY KEY'];
355 355
 					if (!in_array($k, $l)) {
356
-						spip_log("jointure impossible $e " . join(',', $l));
356
+						spip_log("jointure impossible $e ".join(',', $l));
357 357
 
358 358
 						return array('', '');
359 359
 					}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	// demander a SQL de gerer le synonyme
370 370
 	// ca permet que excep soit dynamique (Cedric, 2/3/06)
371 371
 	if ($excep != $nom_champ) {
372
-		$excep .= ' AS ' . $nom_champ;
372
+		$excep .= ' AS '.$nom_champ;
373 373
 	}
374 374
 
375 375
 	return array("$t.$excep", $nom_champ);
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		join(',', $collecte),
603 603
 		($collecte ? $param : substr($param, 1)), # virer la virgule
604 604
 		memoriser_contexte_compil($p),
605
-		(!$supp ? '' : (', ' . join(',', $supp))));
605
+		(!$supp ? '' : (', '.join(',', $supp))));
606 606
 
607 607
 	$p->interdire_scripts = false;
608 608
 
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 	$nom = $p->id_boucle;
698 698
 
699 699
 	if ($nom and trouver_nom_serveur_distant($p)) {
700
-		spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit'));
700
+		spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit'));
701 701
 
702 702
 		return false;
703 703
 	}
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 			(strpos($ps, 'typo') !== false)
767 767
 		)
768 768
 	) {
769
-		$ps = 'traiter_doublons_documents($doublons, ' . $ps . ')';
769
+		$ps = 'traiter_doublons_documents($doublons, '.$ps.')';
770 770
 	}
771 771
 
772 772
 	// La protection des champs par |safehtml est assuree par les extensions
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 function compose_filtres_args($p, $args, $sep) {
885 885
 	$arglist = "";
886 886
 	foreach ($args as $arg) {
887
-		$arglist .= $sep .
887
+		$arglist .= $sep.
888 888
 			calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle);
889 889
 	}
890 890
 
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	while ($b != '') {
936 936
 		foreach ($p->boucles[$b]->criteres as $critere) {
937 937
 			if ($critere->op == $motif) {
938
-				$p->code = '$Pile[$SP' . (($n == 0) ? "" : "-$n") .
938
+				$p->code = '$Pile[$SP'.(($n == 0) ? "" : "-$n").
939 939
 					"]['$champ']";
940 940
 				$b = '';
941 941
 				break 2;
@@ -963,6 +963,6 @@  discard block
 block discarded – undo
963 963
  */
964 964
 function zbug_presenter_champ($p, $champ = "") {
965 965
 	$balise = $champ ? $champ : $p->nom_champ;
966
-	$explicite = $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : '';
966
+	$explicite = $explicite = $p->nom_boucle ? $p->nom_boucle.':' : '';
967 967
 	return "#{$explicite}{$balise}";
968 968
 }
969 969
\ No newline at end of file
Please login to merge, or discard this patch.
prive/formulaires/editer_liens.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 	// L'éditabilité :) est définie par un test permanent (par exemple "associermots") ET le 4ème argument
106 106
 	include_spip('inc/autoriser');
107
-	$editable = ($editable and autoriser('associer' . $table_source, $objet, $id_objet)
107
+	$editable = ($editable and autoriser('associer'.$table_source, $objet, $id_objet)
108 108
 		and autoriser('modifier', $objet, $id_objet));
109 109
 
110 110
 	if (!$editable and !count(objet_trouver_liens(
@@ -116,22 +116,22 @@  discard block
 block discarded – undo
116 116
 
117 117
 	// squelettes de vue et de d'association
118 118
 	// ils sont différents si des rôles sont définis.
119
-	$skel_vue = $table_source . '_lies';
120
-	$skel_ajout = $table_source . '_associer';
119
+	$skel_vue = $table_source.'_lies';
120
+	$skel_ajout = $table_source.'_associer';
121 121
 
122 122
 	// description des roles
123 123
 	include_spip('inc/roles');
124 124
 	if ($roles = roles_presents($objet_source, $objet)) {
125 125
 		// on demande de nouveaux squelettes en conséquence
126
-		$skel_vue = $table_source . '_roles_lies';
127
-		$skel_ajout = $table_source . '_roles_associer';
126
+		$skel_vue = $table_source.'_roles_lies';
127
+		$skel_ajout = $table_source.'_roles_associer';
128 128
 	}
129 129
 
130 130
 	$oups = _request('_oups');
131 131
 	if (unserialize(base64_decode($oups))) {
132 132
 		// on est bon, rien a faire
133 133
 	}
134
-	elseif(unserialize($oups)) {
134
+	elseif (unserialize($oups)) {
135 135
 		// il faut encoder
136 136
 		$oups = base64_encode($oups);
137 137
 	}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 function lien_retrouver_qualif($objet_lien, $lien) {
420 420
 	// un role est défini dans la liaison
421 421
 	$defs = explode('-', $lien);
422
-	list($objet1, , $objet2, , $role) = array_pad($defs, 5, null);
422
+	list($objet1,, $objet2,, $role) = array_pad($defs, 5, null);
423 423
 	if ($objet_lien == $objet1) {
424 424
 		$colonne_role = roles_colonne($objet1, $objet2);
425 425
 	} else {
Please login to merge, or discard this patch.
prive/formulaires/traduire.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$id_parent = $valeurs['id_parent'];
61 61
 	}
62 62
 	if ($id_parent) {
63
-		$langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_parent));
63
+		$langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_parent));
64 64
 	}
65 65
 
66 66
 	if (!$langue_parent) {
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	$valeurs['_traduire'] = '';
83 83
 	if (isset($valeurs['id_trad'])) {
84 84
 		$valeurs['_traduire'] = ($traduire ? ' ' : '');
85
-		$valeurs['_vue_traductions'] = 'prive/objets/liste/' . (trouver_fond(
86
-			$f = table_objet($objet) . '-trad',
85
+		$valeurs['_vue_traductions'] = 'prive/objets/liste/'.(trouver_fond(
86
+			$f = table_objet($objet).'-trad',
87 87
 			'prive/objets/liste'
88 88
 		) ? $f : 'objets-trad');
89 89
 		// pour afficher la liste des trad sur la base de l'id_trad en base
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 		if (sql_getfetsel(
129 129
 			'id_trad',
130 130
 			$table_objet_sql,
131
-			"$_id_table_objet=" . intval($id_objet)
131
+			"$_id_table_objet=".intval($id_objet)
132 132
 		)) {
133 133
 			// ne devrait jamais arriver sauf concurence de saisie
134 134
 			$erreurs['id_trad'] = _L('Une traduction est deja referencee');
135
-		} elseif (!sql_getfetsel($_id_table_objet, $table_objet_sql, "$_id_table_objet=" . intval($id_trad))) {
135
+		} elseif (!sql_getfetsel($_id_table_objet, $table_objet_sql, "$_id_table_objet=".intval($id_trad))) {
136 136
 			$erreurs['id_trad'] = _L('Indiquez un contenu existant');
137 137
 		}
138 138
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		) {
172 172
 			$table_objet_sql = table_objet_sql($objet);
173 173
 			$_id_table_objet = id_table_objet($objet);
174
-			if ($id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$_id_table_objet=" . intval($id_objet))) {
174
+			if ($id_trad = sql_getfetsel('id_trad', $table_objet_sql, "$_id_table_objet=".intval($id_objet))) {
175 175
 				$referencer_traduction = charger_fonction('referencer_traduction', 'action');
176 176
 				$referencer_traduction($objet, $id_trad, $new_id_trad);
177 177
 			}
Please login to merge, or discard this patch.
ecrire/public/tracer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 
78 78
 function chrono_requete($temps) {
79 79
 	$total = 0;
80
-	$hors = "<i>" . _T('zbug_hors_compilation') . "</i>";
80
+	$hors = "<i>"._T('zbug_hors_compilation')."</i>";
81 81
 	$t = $q = $n = $d = array();
82 82
 	// Totaliser les temps et completer le Explain
83 83
 	foreach ($temps as $key => $v) {
84 84
 		list($dt, $nb, $boucle, $query, $explain, $res, $contexte) = $v;
85 85
 		if (is_array($contexte)) {
86
-			$k = ($contexte[0] . " $boucle");
86
+			$k = ($contexte[0]." $boucle");
87 87
 			include_spip('public/compiler');
88 88
 			$env = reconstruire_contexte_compil($contexte);
89 89
 		} else {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	// Fabriquer les liens de navigations dans le tableau des temps
129 129
 	foreach ($temps as $k => $v) {
130 130
 		$titre = strip_tags($v[2]);
131
-		$href = quote_amp($GLOBALS['REQUEST_URI']) . "#req$i";
131
+		$href = quote_amp($GLOBALS['REQUEST_URI'])."#req$i";
132 132
 		$href = str_replace("\\'", '&#39;', $href);
133 133
 
134 134
 		if (!isset($t[$v[2]])) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	unset($d['']);
150 150
 	// Fabriquer le tableau des liens de navigation dans le grand tableau
151 151
 	foreach ($d as $k => $v) {
152
-		$d[$k] = $n[$k] . "</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>"
152
+		$d[$k] = $n[$k]."</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>"
153 153
 			. join('', $t[$k]);
154 154
 	}
155 155
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		. join("</td></tr>\n<tr><td>", $d)
160 160
 		. "</td></tr>\n"
161 161
 		. (# _request('var_mode_objet') ? '' :
162
-		("<tr><td>" . count($temps) . "</td><td>" . _T('info_total') . '</td><td class="time">' . $total . "</td><td></td></tr>"))
162
+		("<tr><td>".count($temps)."</td><td>"._T('info_total').'</td><td class="time">'.$total."</td><td></td></tr>"))
163 163
 	);
164 164
 
165 165
 	return array($temps, $navigation);
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
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 			return $r3;
23 23
 		}
24 24
 	}
25
-	if ((tester_url_absolue($redirect) or preg_match(',^\w+:,',trim($redirect)))
25
+	if ((tester_url_absolue($redirect) or preg_match(',^\w+:,', trim($redirect)))
26 26
 		and !defined('_AUTORISER_ACTION_ABS_REDIRECT')) {
27 27
 		// si l'url est une url du site, on la laisse passer sans rien faire
28 28
 		// c'est encore le plus simple
29
-		$base = $GLOBALS['meta']['adresse_site'] . "/";
29
+		$base = $GLOBALS['meta']['adresse_site']."/";
30 30
 		if (strlen($base) and strncmp($redirect, $base, strlen($base)) == 0) {
31 31
 			return $redirect;
32 32
 		}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			if ($ancre = _request('var_ajax_ancre')) {
146 146
 				// pas n'importe quoi quand meme dans la variable !
147 147
 				$ancre = str_replace(array('<', '"', "'"), array('&lt;', '&quot;', ''), $ancre);
148
-				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte;
148
+				$texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte;
149 149
 			}
150 150
 		} else {
151 151
 			include_spip('inc/headers');
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 				// on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7
300 300
 				// sans cela le formulaire n'est pas actif apres le hit ajax
301 301
 				// la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe
302
-				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour;
302
+				$retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour;
303 303
 				ajax_retour($retour, false);
304 304
 
305 305
 				return true; // on a fini le hit
Please login to merge, or discard this patch.
ecrire/inc/meta.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			renouvelle_alea();
63 63
 			$new = false;
64 64
 		} else {
65
-			spip_log("impossible d'ecrire dans " . $cache);
65
+			spip_log("impossible d'ecrire dans ".$cache);
66 66
 		}
67 67
 	}
68 68
 	// et refaire le cache si on a du lire en base
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	if (!isset($touch[$table])) {
163 163
 		touch_meta($antidate, $table);
164 164
 	}
165
-	sql_delete('spip_' . $table, "nom='$nom'", '', 'continue');
165
+	sql_delete('spip_'.$table, "nom='$nom'", '', 'continue');
166 166
 	unset($GLOBALS[$table][$nom]);
167 167
 	if (!isset($touch[$table])) {
168 168
 		touch_meta($antidate, $table);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		return;
194 194
 	}
195 195
 	include_spip('base/abstract_sql');
196
-	$res = sql_select("*", 'spip_' . $table, "nom=" . sql_quote($nom), '', '', '', '', '', 'continue');
196
+	$res = sql_select("*", 'spip_'.$table, "nom=".sql_quote($nom), '', '', '', '', '', 'continue');
197 197
 	// table pas encore installee, travailler en php seulement
198 198
 	if (!$res) {
199 199
 		$GLOBALS[$table][$nom] = $valeur;
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 		$r['impt'] = sql_quote($importable, '', 'text');
227 227
 	}
228 228
 	if ($row) {
229
-		sql_update('spip_' . $table, $r, "nom=" . sql_quote($nom));
229
+		sql_update('spip_'.$table, $r, "nom=".sql_quote($nom));
230 230
 	} else {
231
-		sql_insert('spip_' . $table, "(" . join(',', array_keys($r)) . ")", "(" . join(',', array_values($r)) . ")");
231
+		sql_insert('spip_'.$table, "(".join(',', array_keys($r)).")", "(".join(',', array_values($r)).")");
232 232
 	}
233 233
 	if (!isset($touch[$table])) {
234 234
 		touch_meta($antidate, $table);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  *     Nom du fichier cache
246 246
  **/
247 247
 function cache_meta($table = 'meta') {
248
-	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php');
248
+	return ($table == 'meta') ? _FILE_META : (_DIR_CACHE.$table.'.php');
249 249
 }
250 250
 
251 251
 /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 				$cle = array_search($table, $liste);
308 308
 				if ($cle !== false) {
309 309
 					unset($liste[$cle]);
310
-					if ($liste ) {
310
+					if ($liste) {
311 311
 						ecrire_meta('tables_config', serialize($liste));
312 312
 					} else {
313 313
 						effacer_meta('tables_config');
Please login to merge, or discard this patch.
ecrire/inc/precharger_objet.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	// si demande de traduction
65 65
 	// on recupere les valeurs de la traduction
66 66
 	if ($lier_trad) {
67
-		if ($select = charger_fonction("precharger_traduction_" . $type, 'inc', true)) {
67
+		if ($select = charger_fonction("precharger_traduction_".$type, 'inc', true)) {
68 68
 			$row = $select($id_objet, $id_rubrique, $lier_trad);
69 69
 		} else {
70 70
 			$row = precharger_traduction_objet($type, $id_objet, $id_rubrique, $lier_trad, $champ_titre);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	// recuperer le secteur, pour affecter les bons champs extras
103 103
 	if ($id_rubrique and $is_secteur) {
104 104
 		if (!$row['id_secteur']) {
105
-			$row_rub = sql_getfetsel("id_secteur", "spip_rubriques", "id_rubrique=" . sql_quote($id_rubrique));
105
+			$row_rub = sql_getfetsel("id_secteur", "spip_rubriques", "id_rubrique=".sql_quote($id_rubrique));
106 106
 			$row['id_secteur'] = $row_rub;
107 107
 		}
108 108
 	}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	$row = sql_fetsel("*", $table, "$_id_objet=".intval($lier_trad));
137 137
 	if ($row) {
138 138
 		include_spip('inc/filtres');
139
-		$row[$champ_titre] = filtrer_entites(objet_T($type, 'info_nouvelle_traduction')) . ' ' . $row[$champ_titre];
139
+		$row[$champ_titre] = filtrer_entites(objet_T($type, 'info_nouvelle_traduction')).' '.$row[$champ_titre];
140 140
 	} else {
141 141
 		$row = array();
142 142
 	}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 				}
178 178
 
179 179
 				$row_rub = sql_fetsel("id_rubrique", "spip_rubriques",
180
-					"lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=".intval($id_parent));
180
+					"lang='".$GLOBALS['spip_lang']."' AND id_parent=".intval($id_parent));
181 181
 				if ($row_rub) {
182 182
 					$row['id_rubrique'] = $row_rub['id_rubrique'];
183 183
 				}
Please login to merge, or discard this patch.
ecrire/inc/prepare_recherche.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 	$where_resultat_recent = sql_date_proche('maj', (0 - ($delai_fraicheur + 100)), " SECOND");
81 81
 	if (!isset($cache[$serveur][$table][$recherche])) {
82 82
 		$hash_serv = ($serveur ? substr(md5($serveur), 0, 16) : '');
83
-		$hash = substr(md5($recherche . $table), 0, 16);
84
-		$where = "(resultats.recherche='$hash' AND resultats.table_objet=" . sql_quote($table) . " AND resultats.serveur='$hash_serv')";
83
+		$hash = substr(md5($recherche.$table), 0, 16);
84
+		$where = "(resultats.recherche='$hash' AND resultats.table_objet=".sql_quote($table)." AND resultats.serveur='$hash_serv')";
85 85
 		$row = sql_fetsel('recherche', 'spip_resultats AS resultats',
86
-			$where . " AND $where_resultat_recent", '', '', '0,1');
86
+			$where." AND $where_resultat_recent", '', '', '0,1');
87 87
 		if (!$row
88 88
 			or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul')
89 89
 		) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		}
181 181
 
182 182
 		foreach ($listes_ids as $p => $ids) {
183
-			$select .= "+$p*(" .
183
+			$select .= "+$p*(".
184 184
 				sql_in("$table.$primary", $ids, '', $serveur)
185 185
 				. ") ";
186 186
 		}
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$contenu = @gzfile($fichier);
123 123
 	}
124 124
 
125
-	return is_array($contenu) ? join('', $contenu) : (string)$contenu;
125
+	return is_array($contenu) ? join('', $contenu) : (string) $contenu;
126 126
 }
127 127
 
128 128
 
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
  */
316 316
 function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) {
317 317
 	if (substr($fichier, -4) !== '.php') {
318
-		spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php');
318
+		spip_log('Erreur de programmation: '.$fichier.' doit finir par .php');
319 319
 	}
320
-	$contenu = "<" . "?php die ('Acces interdit'); ?" . ">\n" . $contenu;
320
+	$contenu = "<"."?php die ('Acces interdit'); ?".">\n".$contenu;
321 321
 
322 322
 	return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate);
323 323
 }
@@ -329,9 +329,9 @@  discard block
 block discarded – undo
329 329
  * @param bool $force
330 330
  * @return bool
331 331
  */
332
-function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force=false, $use_copy=false) {
333
-	$fichier_tmp = $fichier . '.last';
334
-	if (!ecrire_fichier($fichier_tmp, $contenu, true)){
332
+function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) {
333
+	$fichier_tmp = $fichier.'.last';
334
+	if (!ecrire_fichier($fichier_tmp, $contenu, true)) {
335 335
 		return false;
336 336
 	}
337 337
 	if ($force
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
  */
369 369
 function lire_fichier_securise($fichier, &$contenu, $options = array()) {
370 370
 	if ($res = lire_fichier($fichier, $contenu, $options)) {
371
-		$contenu = substr($contenu, strlen("<" . "?php die ('Acces interdit'); ?" . ">\n"));
371
+		$contenu = substr($contenu, strlen("<"."?php die ('Acces interdit'); ?".">\n"));
372 372
 	}
373 373
 
374 374
 	return $res;
@@ -488,11 +488,11 @@  discard block
 block discarded – undo
488 488
 		$invalidate = @opcache_invalidate($filepath, true);
489 489
 		// si l'invalidation a echoue lever un flag
490 490
 		if (!$invalidate and !defined('_spip_attend_invalidation_opcode_cache')) {
491
-			define('_spip_attend_invalidation_opcode_cache',true);
491
+			define('_spip_attend_invalidation_opcode_cache', true);
492 492
 		}
493 493
 	} elseif (!defined('_spip_attend_invalidation_opcode_cache')) {
494 494
 		// n'agira que si opcache est effectivement actif (il semble qu'on a pas toujours la fonction opcache_invalidate)
495
-		define('_spip_attend_invalidation_opcode_cache',true);
495
+		define('_spip_attend_invalidation_opcode_cache', true);
496 496
 	}
497 497
 	// APC.
498 498
 	if (function_exists('apc_delete_file')) {
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
 		$wait = $duree + 1;
533 533
 		if ($timestamp) {
534 534
 			$wait -= (time() - $timestamp);
535
-			if ($wait<0) {
535
+			if ($wait < 0) {
536 536
 				$wait = 0;
537 537
 			}
538 538
 		}
539
-		spip_log('Probleme de configuration opcache.revalidate_freq '. $duree .'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
539
+		spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE);
540 540
 		if ($wait) {
541 541
 			sleep($duree + 1);
542 542
 		}
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
 		if ($item == '.' || $item == '..') {
565 565
 			continue;
566 566
 		}
567
-		if (!supprimer_repertoire($dir . "/" . $item)) {
568
-			@chmod($dir . "/" . $item, 0777);
569
-			if (!supprimer_repertoire($dir . "/" . $item)) {
567
+		if (!supprimer_repertoire($dir."/".$item)) {
568
+			@chmod($dir."/".$item, 0777);
569
+			if (!supprimer_repertoire($dir."/".$item)) {
570 570
 				return false;
571 571
 			}
572 572
 		};
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 	if (!strlen($subdir)) {
612 612
 		$n = strrpos($base, "/");
613 613
 		if ($n === false) {
614
-			return $nobase ? '' : ($base . '/');
614
+			return $nobase ? '' : ($base.'/');
615 615
 		}
616 616
 		$subdir = substr($base, $n + 1);
617 617
 		$base = substr($base, 0, $n + 1);
@@ -621,14 +621,14 @@  discard block
 block discarded – undo
621 621
 	}
622 622
 
623 623
 	$baseaff = $nobase ? '' : $base;
624
-	if (isset($dirs[$base . $subdir])) {
625
-		return $baseaff . $dirs[$base . $subdir];
624
+	if (isset($dirs[$base.$subdir])) {
625
+		return $baseaff.$dirs[$base.$subdir];
626 626
 	}
627 627
 
628
-	$path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
628
+	$path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf'
629 629
 
630 630
 	if (file_exists("$path/.ok")) {
631
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
631
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
632 632
 	}
633 633
 
634 634
 	@mkdir($path, _SPIP_CHMOD);
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 		@touch("$path/.ok");
639 639
 		spip_log("creation $base$subdir/");
640 640
 
641
-		return $baseaff . ($dirs[$base . $subdir] = "$subdir/");
641
+		return $baseaff.($dirs[$base.$subdir] = "$subdir/");
642 642
 	}
643 643
 
644 644
 	// en cas d'echec c'est peut etre tout simplement que le disque est plein :
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		return '';
649 649
 	}
650 650
 	if (!_DIR_RESTREINT) {
651
-		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
651
+		$base = preg_replace(',^'._DIR_RACINE.',', '', $base);
652 652
 	}
653 653
 	$base .= $subdir;
654
-	raler_fichier($base . '/.ok');
654
+	raler_fichier($base.'/.ok');
655 655
 }
656 656
 
657 657
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 							$beginning = $fichiers;
720 720
 							$end = preg_files("$f/", $pattern,
721 721
 								$maxfiles - $nbfiles, $recurs);
722
-							$fichiers = array_merge((array)$beginning, (array)$end);
722
+							$fichiers = array_merge((array) $beginning, (array) $end);
723 723
 							$nbfiles = count($fichiers);
724 724
 						}
725 725
 					}
Please login to merge, or discard this patch.