Completed
Push — master ( 4fa0dc...b74578 )
by cam
01:19
created
ecrire/inc/bandeau.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 			$_id = $e['id_table_objet'];
52 52
 			if (isset($contexte[$_id]) && ($id = (int) $contexte[$_id])) {
53 53
 				$table = $e['table_objet_sql'];
54
-				$row = sql_fetsel('*', $table, "$_id=" . (int) $id);
54
+				$row = sql_fetsel('*', $table, "$_id=".(int) $id);
55 55
 				if (isset($row['id_rubrique'])) {
56 56
 					$contexte['id_rubrique'] = $row['id_rubrique'];
57 57
 					if (isset($row['id_secteur'])) {
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 				$boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position)
116 116
 					+ [
117 117
 						$id => new Bouton(
118
-							($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '',  // icone
119
-							$infos['titre'],  // titre
118
+							($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone
119
+							$infos['titre'], // titre
120 120
 							(isset($infos['action']) && $infos['action']) ? $infos['action'] : null,
121 121
 							(isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null
122 122
 						)
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 				$boutons_admin = array_slice($boutons_admin, 0, $position)
134 134
 					+ [
135 135
 						$id => new Bouton(
136
-							($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '',  // icone
137
-							$infos['titre'],  // titre
136
+							($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone
137
+							$infos['titre'], // titre
138 138
 							(isset($infos['action']) && $infos['action']) ? $infos['action'] : null,
139 139
 							(isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null
140 140
 						)
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$url = str_replace('&', '&', $url);
222 222
 		while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) {
223 223
 			if ($matches[2] == 'id_secteur' && !isset($contexte['id_secteur']) && isset($contexte['id_rubrique'])) {
224
-				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $contexte['id_rubrique']);
224
+				$contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $contexte['id_rubrique']);
225 225
 			}
226 226
 			$val = _request($matches[2], $contexte);
227 227
 			$url = parametre_url($url, $matches[1], $val ?: '', '&');
Please login to merge, or discard this patch.
ecrire/inc/cvt_autosave.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 		$je_suis_poste = $flux['args']['je_suis_poste'];
47 47
 
48 48
 		$cle_autosave = serialize($cle_autosave);
49
-		$cle_autosave = $form . '_' . md5($cle_autosave);
49
+		$cle_autosave = $form.'_'.md5($cle_autosave);
50 50
 
51 51
 		// si on a un backup en session et qu'on est au premier chargement, non poste
52 52
 		// on restitue les donnees
53 53
 		if (
54
-			isset($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave])
54
+			isset($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave])
55 55
 			&& !$je_suis_poste
56 56
 		) {
57
-			parse_str($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave], $vars);
57
+			parse_str($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave], $vars);
58 58
 			foreach ($vars as $key => $val) {
59 59
 				if (isset($flux['data'][$key])) {
60 60
 					$flux['data'][$key] = (is_string($val) ? autosave_clean_value($val) : array_map(
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 		if ($je_suis_poste && _request('autosave') === $cle_autosave && function_exists('terminer_actualiser_sessions')) {
71 71
 			terminer_actualiser_sessions();
72 72
 			// et verifions si jamais l'autosave a fait un come back, dans ce cas on le revide
73
-			if (isset($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave])) {
74
-				session_set('session_autosave_' . $cle_autosave, null);
73
+			if (isset($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave])) {
74
+				session_set('session_autosave_'.$cle_autosave, null);
75 75
 				// en court sleep pour etre certain que la concurrence est finie
76 76
 				sleep(1);
77 77
 				terminer_actualiser_sessions();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		 */
85 85
 		$flux['data']['_hidden'] .= "<input type='hidden' name='autosave' class='autosaveactive' value='$cle_autosave' />"
86 86
 			. '<script type="text/javascript">/*<![CDATA[*/if (window.jQuery) jQuery(function(){
87
-		  $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'] . '/"}).addClass("autosaveon");
87
+		  $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'].'/"}).addClass("autosaveon");
88 88
 			});/*]]>*/</script>';
89 89
 	}
90 90
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	// on elimine les donnees de la session
107 107
 	if ($cle_autosave = _request('autosave')) {
108 108
 		include_spip('inc/session');
109
-		session_set('session_autosave_' . $cle_autosave, null);
109
+		session_set('session_autosave_'.$cle_autosave, null);
110 110
 	}
111 111
 
112 112
 	if (isset($GLOBALS['visiteur_session']) && $GLOBALS['visiteur_session']) {
Please login to merge, or discard this patch.
ecrire/inc/cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 	// in fine renommer le prefixe si besoin
102 102
 	if (str_starts_with($name, 'spip_')) {
103
-		$name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5);
103
+		$name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5);
104 104
 	}
105 105
 
106 106
 	#spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies");
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	}
159 159
 	foreach ($_COOKIE as $name => $value) {
160 160
 		if (substr($name, 0, $prefix_long) == $cookie_prefix) {
161
-			$spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name);
161
+			$spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name);
162 162
 			$_COOKIE[$spipname] = $value;
163 163
 			$GLOBALS[$spipname] = $value;
164 164
 		}
Please login to merge, or discard this patch.
ecrire/inc/selectionner.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 	if ($aff_racine) {
55 55
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
56
-		$idom3 = $idom . '_selection';
56
+		$idom3 = $idom.'_selection';
57 57
 
58 58
 		$onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;";
59 59
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			'  '
72 72
 		);
73 73
 
74
-		$js_func = $do . '_selection_titre';
74
+		$js_func = $do.'_selection_titre';
75 75
 		$ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');";
76 76
 
77 77
 		$aff_racine = "<div class='petit-item petite-racine item'>"
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
  **/
113 113
 function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '') {
114 114
 
115
-	$idom1 = $idom . '_champ_recherche';
116
-	$idom2 = $idom . '_principal';
117
-	$idom3 = $idom . '_selection';
118
-	$idom4 = $idom . '_col_1';
119
-	$idom5 = 'img_' . $idom4;
120
-	$idom6 = $idom . '_fonc';
115
+	$idom1 = $idom.'_champ_recherche';
116
+	$idom2 = $idom.'_principal';
117
+	$idom3 = $idom.'_selection';
118
+	$idom4 = $idom.'_col_1';
119
+	$idom5 = 'img_'.$idom4;
120
+	$idom6 = $idom.'_fonc';
121 121
 
122 122
 	return "<div id='$idom'>"
123 123
 	. "<a id='$idom6' style='visibility: hidden;'"
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 	. http_img_pack(
128 128
 		'loader.svg',
129 129
 		'',
130
-		"class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'"
130
+		"class='loader' style='visibility: hidden;float:".$GLOBALS['spip_lang_right']."' id='$idom5'"
131 131
 	)
132 132
 	. ''
133
-	. "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'"
133
+	. "<input style='width: 10em;float:".$GLOBALS['spip_lang_right'].";' type='text' class='text search' id='$idom1' placeholder='"._T('info_rechercher')."'"
134 134
 	// eliminer Return car il provoque la soumission (balise unique)
135 135
 	// et eliminer Tab pour la navigation au clavier
136 136
 	// ce serait encore mieux de ne le faire que s'il y a encore plusieurs
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 
178 178
 	$liste = $id_rubrique;
179 179
 	$id_rubrique = (int) $id_rubrique;
180
-	while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = ' . $id_rubrique)) {
181
-		$liste = $id_rubrique . ",$liste";
180
+	while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = '.$id_rubrique)) {
181
+		$liste = $id_rubrique.",$liste";
182 182
 	}
183 183
 
184 184
 	return explode(',', "0,$liste");
Please login to merge, or discard this patch.
ecrire/inc/icone_renommer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 
47 47
 	$dir = 'images/';
48 48
 	$f = "$type-$size.png";
49
-	if ($icone = find_in_theme($dir . $f)) {
49
+	if ($icone = find_in_theme($dir.$f)) {
50 50
 		$dir = dirname($icone);
51 51
 		$fond = $icone;
52 52
 
53 53
 		if (
54 54
 			$rtl
55
-			&& ($fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone)))
55
+			&& ($fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone)))
56 56
 			&& file_exists($fr)
57 57
 		) {
58 58
 			$fond = $fr;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 
70 70
 		$fonction = '';
71
-		if (in_array($action, ['add','del', 'new', 'edit', 'config'])) {
71
+		if (in_array($action, ['add', 'del', 'new', 'edit', 'config'])) {
72 72
 			$fonction = $action;
73 73
 		}
74 74
 
Please login to merge, or discard this patch.
ecrire/inc/chercher_rubrique.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	if (isset($data[$root])) { # pas de racine sauf pour les rubriques
143 143
 	$r = "<option$selected value='$root' class='$class' style='$style'>$espace"
144 144
 			. $data[$root]
145
-			. '</option>' . "\n";
145
+			. '</option>'."\n";
146 146
 	} else {
147 147
 		$r = '';
148 148
 	}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	}
171 171
 
172 172
 	// et voila le travail
173
-	return $r . $sous;
173
+	return $r.$sous;
174 174
 }
175 175
 
176 176
 /**
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	while ($r = sql_fetch($q)) {
219 219
 		if (autoriser('voir', 'rubrique', $r['id_rubrique'])) {
220 220
 			// titre largeur maxi a 50
221
-			$titre = couper(supprimer_tags(typo($r['titre'])) . ' ', 50);
221
+			$titre = couper(supprimer_tags(typo($r['titre'])).' ', 50);
222 222
 			if (
223 223
 				$GLOBALS['meta']['multi_rubriques'] == 'oui'
224 224
 				&& ($r['langue_choisie'] == 'oui' || $r['id_parent'] == 0)
225 225
 			) {
226
-				$titre .= ' [' . traduire_nom_langue($r['lang']) . ']';
226
+				$titre .= ' ['.traduire_nom_langue($r['lang']).']';
227 227
 			}
228 228
 			$data[$r['id_rubrique']] = $titre;
229 229
 			$enfants[$r['id_parent']][] = $r['id_rubrique'];
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	$att = " id='id_parent' name='id_parent'\nclass='selecteur_parent verdana1'";
251 251
 
252 252
 	if (preg_match(',^<option[^<>]*value=.(\d*).[^<>]*>([^<]*)</option>$,', $opt, $r)) {
253
-		$r = "<input$att type='hidden' value='" . $r[1] . "' />" . $r[2];
253
+		$r = "<input$att type='hidden' value='".$r[1]."' />".$r[2];
254 254
 	} else {
255
-		$r = '<select' . $att . " size='1'>\n$opt</select>\n";
255
+		$r = '<select'.$att." size='1'>\n$opt</select>\n";
256 256
 	}
257 257
 
258 258
 	# message pour neuneus (a supprimer ?)
@@ -294,13 +294,13 @@  discard block
 block discarded – undo
294 294
 function selecteur_rubrique_ajax($id_rubrique, $type, $restreint, $idem = 0, $do = 'aff') {
295 295
 
296 296
 	if ($id_rubrique) {
297
-		$titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique);
297
+		$titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique);
298 298
 	} else {
299 299
 		$titre = $type == 'auteur' ? '&nbsp;' : _T('info_racine_site');
300 300
 	}
301 301
 
302 302
 	$titre = str_replace('&amp;', '&', entites_html(textebrut(typo($titre))));
303
-	$init = " disabled='disabled' type='text' value=\"" . $titre . "\"\nstyle='width:300px;'";
303
+	$init = " disabled='disabled' type='text' value=\"".$titre."\"\nstyle='width:300px;'";
304 304
 
305 305
 	$url = generer_url_ecrire('selectionner', "id=$id_rubrique&type=$type&do=$do"
306 306
 		. ($idem ? "&exclus=$idem" : '')
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		. " jQuery(this).toggleClass('toggled'); "
350 350
 		. "return charger_node_url_si_vide('"
351 351
 		. $url
352
-		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='" . attribut_html(_T('titre_image_selecteur')) . "'>"
352
+		. "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='".attribut_html(_T('titre_image_selecteur'))."'>"
353 353
 		. $img_icone
354 354
 		. "</a><img src='"
355 355
 		. chemin_image('loader.svg')
Please login to merge, or discard this patch.
ecrire/inc/completer_traduction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 		$champs[] = 'virtuel';
55 55
 	}
56 56
 
57
-	$data = sql_fetsel('*', $desc['table'], $_id_table . '=' . (int) $id_trad);
57
+	$data = sql_fetsel('*', $desc['table'], $_id_table.'='.(int) $id_trad);
58 58
 
59 59
 	foreach ($champs as $c) {
60 60
 		$set[$c] = $data[$c];
Please login to merge, or discard this patch.
ecrire/inc/log.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 	// si spip_log() est appelé dans mes_options, toutes les constantes n'ont pas été définies
36 36
 	$logfile =
37
-		($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES))
37
+		($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES))
38 38
 		. $logname
39 39
 		. ($logsuf ?? (defined('_FILE_LOG_SUFFIX') ? _FILE_LOG_SUFFIX : '.log'));
40 40
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 	// Si le repertoire défini n'existe pas, poser dans tmp/
52 52
 	if (!$test_repertoire[$d]) {
53
-		$logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log';
53
+		$logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log';
54 54
 	}
55 55
 
56 56
 	$rotate = 0;
57
-	$pid = '(pid ' . @getmypid() . ')';
57
+	$pid = '(pid '.@getmypid().')';
58 58
 
59 59
 	// accepter spip_log( Array )
60 60
 	if (!is_string($message)) {
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 			$fi = substr($fi, strlen(_ROOT_RACINE));
70 70
 		}
71 71
 		$fu = $debug[2]['function'] ?? '';
72
-		$debugverb = "$fi:L$l:$fu" . '():';
72
+		$debugverb = "$fi:L$l:$fu".'():';
73 73
 	}
74 74
 
75
-	$m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' '
75
+	$m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' '
76 76
 		//distinguer les logs prives et publics dans les grep
77 77
 		. $debugverb
78 78
 		. (test_espace_prive() ? ':Pri:' : ':Pub:')
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	if (
97 97
 		$rotate-- > 0 && function_exists('spip_unlink')
98 98
 	) {
99
-		spip_unlink($logfile . '.' . $rotate);
99
+		spip_unlink($logfile.'.'.$rotate);
100 100
 		while ($rotate--) {
101
-			@rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1));
101
+			@rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1));
102 102
 		}
103 103
 	}
104 104
 
Please login to merge, or discard this patch.
ecrire/inc/securiser_action.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	}
93 93
 
94 94
 	$arg = parametre_url($url_action, 'arg');
95
-	$confirm = md5("$action:$arg:" . realpath(__FILE__));
95
+	$confirm = md5("$action:$arg:".realpath(__FILE__));
96 96
 	if (_request('confirm_action') === $confirm) {
97 97
 		return true;
98 98
 	}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		} else {
146 146
 			return generer_url_action(
147 147
 				$action,
148
-				'arg=' . rawurlencode($arg) . "&hash=$hash" . ($r ? "&redirect=$r" : ''),
148
+				'arg='.rawurlencode($arg)."&hash=$hash".($r ? "&redirect=$r" : ''),
149 149
 				$mode,
150 150
 				$public
151 151
 			);
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 	$hash = calculer_action_auteur("$action-$arg");
157 157
 	$att .= " style='margin: 0px; border: 0px'";
158 158
 	if ($redirect) {
159
-		$redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", '&#39;', $redirect) . "' />";
159
+		$redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", '&#39;', $redirect)."' />";
160 160
 	}
161
-	$mode .= $redirect . "
161
+	$mode .= $redirect."
162 162
 <input name='hash' type='hidden' value='$hash' />
163 163
 <input name='arg' type='hidden' value='$arg' />";
164 164
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	$pass ??= '';
227 227
 	$entry = "$action:$id_auteur:$pass:$alea";
228 228
 	if (!isset($sha[$entry])) {
229
-		$sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea));
229
+		$sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea));
230 230
 	}
231 231
 
232 232
 	return $sha[$entry];
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	// On nettoie l’URL de tous les var_.
337 337
 	$url = nettoyer_uri_var($url);
338 338
 
339
-	$token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea);
339
+	$token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea);
340 340
 	return "$id_auteur-$token";
341 341
 }
342 342
 
Please login to merge, or discard this patch.