Completed
Push — master ( 548ed0...f30f27 )
by cam
01:10
created
ecrire/inc/filtres_selecteur_generique.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 	// si id numerique et un seul objet possible, pas d'ambiguite
160 160
 	if (is_numeric($ref) and count($objets) === 1) {
161
-		$ref = reset($objets) . $ref;
161
+		$ref = reset($objets).$ref;
162 162
 	}
163 163
 
164 164
 	// Si la référence ne correspond à rien, c'est fini
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		return json_export(false);
167 167
 	}
168 168
 	// Sinon on récupère les infos utiles
169
-	[$type, , $id, , , , ] = array_pad($match, 7, null);
169
+	[$type,, $id,,,,] = array_pad($match, 7, null);
170 170
 
171 171
 	// On regarde si le type trouvé fait partie des objets sélectionnables
172 172
 	if (!in_array(table_objet($type), $objets)) {
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 		$types = (is_array($types) ? array_filter($types) : []);
212 212
 
213 213
 		// recuperer tous les freres et soeurs de la rubrique visee
214
-		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
215
-		$fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent=' . intval($id_parent));
214
+		$id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique));
215
+		$fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent='.intval($id_parent));
216 216
 		$fratrie = array_column($fratrie, 'id_rubrique');
217 217
 		$has = sql_allfetsel('DISTINCT id_parent', 'spip_rubriques', sql_in('id_parent', $fratrie));
218 218
 		$has = array_column($has, 'id_parent');
Please login to merge, or discard this patch.
ecrire/inc/lien.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	return $r ?: traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo);
103 103
 }
104 104
 
105
-define('_EXTRAIRE_LIEN', ',^\s*(?:' . _PROTOCOLES_STD . '):?/?/?\s*$,iS');
105
+define('_EXTRAIRE_LIEN', ',^\s*(?:'._PROTOCOLES_STD.'):?/?/?\s*$,iS');
106 106
 
107 107
 // https://code.spip.net/@traiter_lien_explicite
108 108
 function traiter_lien_explicite($ref, $texte = '', $pour = 'url', string $connect = '', $echappe_typo = true) {
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 		$lien_court = charger_fonction('lien_court', 'inc');
120 120
 		$texte = $lien_court($texte);
121 121
 		if ($echappe_typo) {
122
-			$texte = '<html>' . quote_amp($texte) . '</html>';
122
+			$texte = '<html>'.quote_amp($texte).'</html>';
123 123
 		}
124 124
 	}
125 125
 
126 126
 	// petites corrections d'URL
127 127
 	if (preg_match('/^www\.[^@]+$/S', $lien)) {
128
-		$lien = 'http://' . $lien;
128
+		$lien = 'http://'.$lien;
129 129
 	} else {
130 130
 		if (strpos($lien, '@') && email_valide($lien)) {
131 131
 			if (!$texte) {
132 132
 				$texte = $lien;
133 133
 			}
134
-			$lien = 'mailto:' . $lien;
134
+			$lien = 'mailto:'.$lien;
135 135
 		}
136 136
 	}
137 137
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 }
148 148
 
149 149
 function liens_implicite_glose_dist($texte, $id, $type, $args, $ancre, string $connect = '') {
150
-	if (function_exists($f = 'glossaire_' . $ancre)) {
150
+	if (function_exists($f = 'glossaire_'.$ancre)) {
151 151
 		$url = $f($texte, $id);
152 152
 	} else {
153 153
 		$url = glossaire_std($texte);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	if (!($match = typer_raccourci($ref))) {
163 163
 		return false;
164 164
 	}
165
-	[$type, , $id, , $args, , $ancre] = array_pad($match, 7, null);
165
+	[$type,, $id,, $args,, $ancre] = array_pad($match, 7, null);
166 166
 	// attention dans le cas des sites le lien doit pointer non pas sur
167 167
 	// la page locale du site, mais directement sur le site lui-meme
168 168
 	if ($f = charger_fonction("implicite_$type", 'liens', true)) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		$r['titre'] = $texte;
190 190
 	}
191 191
 	if (!@$r['titre']) {
192
-		$r['titre'] = _T($type) . " $id";
192
+		$r['titre'] = _T($type)." $id";
193 193
 	}
194 194
 	if ($pour == 'titre') {
195 195
 		return $r['titre'];
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		and $mime = sql_getfetsel(
203 203
 			'mime_type',
204 204
 			'spip_types_documents',
205
-			'extension IN (' . sql_get_select('extension', 'spip_documents', 'id_document=' . sql_quote($id)) . ')',
205
+			'extension IN ('.sql_get_select('extension', 'spip_documents', 'id_document='.sql_quote($id)).')',
206 206
 			'',
207 207
 			'',
208 208
 			'',
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
 	'(<([a-z_-]{3,})' # <modele
306 306
 	. '\s*([0-9]*)\s*' # id
307 307
 	. '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>)
308
-	. '\s*/?' . '>)' # fin du modele >
308
+	. '\s*/?'.'>)' # fin du modele >
309 309
 	. '\s*(<\/a>)?' # eventuel </a>
310 310
 );
311 311
 
312
-define('_RACCOURCI_MODELE_DEBUT', '@^' . _RACCOURCI_MODELE . '@isS');
312
+define('_RACCOURCI_MODELE_DEBUT', '@^'._RACCOURCI_MODELE.'@isS');
313 313
 
314 314
 // https://code.spip.net/@traiter_modeles
315 315
 function traiter_modeles($texte, $doublons = false, $echap = '', string $connect = '', $liens = null, $env = []) {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 						if (test_espace_prive()) {
390 390
 							$modele = entites_html(substr($texte, $a, $cherche));
391 391
 							if (!is_null($liens)) {
392
-								$modele = '<pre>' . str_replace($liens[0], $liens[1], $modele) . '</pre>';
392
+								$modele = '<pre>'.str_replace($liens[0], $liens[1], $modele).'</pre>';
393 393
 							}
394 394
 						}
395 395
 					}
Please login to merge, or discard this patch.