@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | include_fichiers_fonctions(); |
| 103 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 103 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 104 | 104 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 105 | 105 | if (is_callable($f)) { |
| 106 | 106 | return $f; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | // affichage "GIT [master: abcdef]" |
| 236 | 236 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 237 | 237 | if ($desc['branch']) { |
| 238 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 238 | + $commit = $desc['branch'].': '.$commit; |
|
| 239 | 239 | } |
| 240 | 240 | return "{$desc['vcs']} [$commit]"; |
| 241 | 241 | } |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | // version installee par GIT |
| 259 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 259 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 260 | 260 | $currentHead = trim(substr((string) $c, 4)); |
| 261 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 261 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 262 | 262 | return [ |
| 263 | 263 | 'vcs' => 'GIT', |
| 264 | 264 | 'branch' => basename($currentHead), |
@@ -273,12 +273,12 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 275 | 275 | // et laisser passer les fonctions personnelles baptisees image_... |
| 276 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 277 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 278 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 279 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 280 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 281 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 276 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 277 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 278 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 279 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 280 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 281 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 282 | 282 | |
| 283 | 283 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 284 | 284 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -437,8 +437,8 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | function filtre_debug(mixed $val, $key = null) { |
| 439 | 439 | $debug = ( |
| 440 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 441 | - ) . var_export($val, true); |
|
| 440 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 441 | + ).var_export($val, true); |
|
| 442 | 442 | |
| 443 | 443 | include_spip('inc/autoriser'); |
| 444 | 444 | if (autoriser('webmestre')) { |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | $is_file = false; |
| 495 | 495 | } |
| 496 | 496 | if ($is_file) { |
| 497 | - $is_local_file = function ($path) { |
|
| 497 | + $is_local_file = function($path) { |
|
| 498 | 498 | if (str_contains($path, '?')) { |
| 499 | 499 | $path = supprimer_timestamp($path); |
| 500 | 500 | // remove ?24px added by find_in_theme on .svg files |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | && preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match) |
| 543 | 543 | ) { |
| 544 | 544 | $srcover = $match[1]; |
| 545 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 545 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 546 | 546 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 547 | 547 | $reduit = str_replace($srcover, $srcover_filter, (string) $reduit); |
| 548 | 548 | } |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | // " -> " et tout ce genre de choses |
| 944 | 944 | $u = $GLOBALS['meta']['pcre_u']; |
| 945 | 945 | $texte = str_replace(' ', ' ', $texte); |
| 946 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 946 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 947 | 947 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 948 | 948 | $texte = entites_html($texte, false, false); |
| 949 | 949 | // mais bien echapper les double quotes ! |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | return ''; |
| 1006 | 1006 | } |
| 1007 | 1007 | return preg_replace( |
| 1008 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1008 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1009 | 1009 | '', |
| 1010 | 1010 | $texte |
| 1011 | 1011 | ); |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | return ''; |
| 1036 | 1036 | } |
| 1037 | 1037 | if (preg_match( |
| 1038 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1038 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1039 | 1039 | $texte, |
| 1040 | 1040 | $regs |
| 1041 | 1041 | ) |
@@ -1127,7 +1127,7 @@ discard block |
||
| 1127 | 1127 | return ''; |
| 1128 | 1128 | } |
| 1129 | 1129 | $u = $GLOBALS['meta']['pcre_u']; |
| 1130 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1130 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1131 | 1131 | $texte = preg_replace('/<(p|br)( [^>]*)?>/iS', "\n\n", $texte); |
| 1132 | 1132 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1133 | 1133 | $texte = preg_replace("/\n+$/", '', $texte); |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | ) |
| 1166 | 1166 | ) { |
| 1167 | 1167 | foreach ($liens[0] as $a) { |
| 1168 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1168 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1169 | 1169 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1170 | 1170 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1171 | 1171 | $texte = str_replace($a, $ablank, $texte); |
@@ -1193,7 +1193,7 @@ discard block |
||
| 1193 | 1193 | foreach ($regs[0] as $a) { |
| 1194 | 1194 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1195 | 1195 | if (!str_contains($rel, 'nofollow')) { |
| 1196 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1196 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1197 | 1197 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1198 | 1198 | $texte = str_replace($a, $anofollow, $texte); |
| 1199 | 1199 | } |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1227 | 1227 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1228 | 1228 | |
| 1229 | - return preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1229 | + return preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | /** |
@@ -1314,7 +1314,7 @@ discard block |
||
| 1314 | 1314 | |
| 1315 | 1315 | // Calcul de la taille et choix de l'unité |
| 1316 | 1316 | $affichage = _T( |
| 1317 | - 'spip:taille_' . $unites[$puissance] . $suffixe_item, |
|
| 1317 | + 'spip:taille_'.$unites[$puissance].$suffixe_item, |
|
| 1318 | 1318 | [ |
| 1319 | 1319 | 'taille' => round($octets / $kilo ** $puissance, $precisions[$puissance]) |
| 1320 | 1320 | ] |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | } |
| 1349 | 1349 | $u = $GLOBALS['meta']['pcre_u']; |
| 1350 | 1350 | if ($textebrut) { |
| 1351 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1351 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1352 | 1352 | } |
| 1353 | 1353 | $texte = texte_backend($texte); |
| 1354 | 1354 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1383,7 +1383,7 @@ discard block |
||
| 1383 | 1383 | # un message pour abs_url |
| 1384 | 1384 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1385 | 1385 | $url = trim($url); |
| 1386 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1386 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1387 | 1387 | |
| 1388 | 1388 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1389 | 1389 | } |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | |
| 1590 | 1590 | $debut = ''; |
| 1591 | 1591 | $suite = $texte; |
| 1592 | - while ($t = strpos((string) ('-' . $suite), "\n", 1)) { |
|
| 1592 | + while ($t = strpos((string) ('-'.$suite), "\n", 1)) { |
|
| 1593 | 1593 | $debut .= substr($suite, 0, $t - 1); |
| 1594 | 1594 | $suite = substr($suite, $t); |
| 1595 | 1595 | $car = substr($suite, 0, 1); |
@@ -1607,7 +1607,7 @@ discard block |
||
| 1607 | 1607 | $suite = substr($suite, strlen($regs[0])); |
| 1608 | 1608 | } |
| 1609 | 1609 | } |
| 1610 | - $texte = $debut . $suite; |
|
| 1610 | + $texte = $debut.$suite; |
|
| 1611 | 1611 | |
| 1612 | 1612 | if ($collecteurModeles) { |
| 1613 | 1613 | $texte = $collecteurModeles->retablir($texte); |
@@ -1615,7 +1615,7 @@ discard block |
||
| 1615 | 1615 | |
| 1616 | 1616 | $texte = CollecteurHtmlTag::retablir_depuisHtmlBase64($texte); |
| 1617 | 1617 | |
| 1618 | - return $texte . $fin; |
|
| 1618 | + return $texte.$fin; |
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | |
@@ -1654,7 +1654,7 @@ discard block |
||
| 1654 | 1654 | } |
| 1655 | 1655 | // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
| 1656 | 1656 | if (is_bool($options)) { |
| 1657 | - trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => ' . var_export($options, true) . ']'); |
|
| 1657 | + trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => '.var_export($options, true).']'); |
|
| 1658 | 1658 | $options = ['echappe_span' => $options]; |
| 1659 | 1659 | } |
| 1660 | 1660 | if (!isset($options['echappe_span'])) { |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | |
| 1712 | 1712 | // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
| 1713 | 1713 | if (is_bool($options)) { |
| 1714 | - trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => ' . var_export($options, true) . ']'); |
|
| 1714 | + trigger_deprecation('spip', '5.0', 'Using boolean $options parameter in "%s()" function is deprecated. Use %s array parameter instead.', __FUNCTION__, '[\'echappe_span\' => '.var_export($options, true).']'); |
|
| 1715 | 1715 | $options = ['echappe_span' => $options, 'lang_defaut' => _LANGUE_PAR_DEFAUT]; |
| 1716 | 1716 | } |
| 1717 | 1717 | if (!isset($options['echappe_span'])) { |
@@ -1880,7 +1880,7 @@ discard block |
||
| 1880 | 1880 | if (is_array($balise)) { |
| 1881 | 1881 | array_walk( |
| 1882 | 1882 | $balise, |
| 1883 | - function (&$a, $key, $t) { |
|
| 1883 | + function(&$a, $key, $t) { |
|
| 1884 | 1884 | $a = extraire_attribut($a, $t); |
| 1885 | 1885 | }, |
| 1886 | 1886 | $attribut |
@@ -1974,14 +1974,14 @@ discard block |
||
| 1974 | 1974 | |
| 1975 | 1975 | if ($old !== null) { |
| 1976 | 1976 | // Remplacer l'ancien attribut du meme nom |
| 1977 | - $balise = $r[1] . $insert . $r[5]; |
|
| 1977 | + $balise = $r[1].$insert.$r[5]; |
|
| 1978 | 1978 | } else { |
| 1979 | 1979 | // preferer une balise " />" (comme <img />) |
| 1980 | 1980 | if (preg_match(',/>,', $balise)) { |
| 1981 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 1981 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 1982 | 1982 | } // sinon une balise <a ...> ... </a> |
| 1983 | 1983 | else { |
| 1984 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 1984 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 1985 | 1985 | } |
| 1986 | 1986 | } |
| 1987 | 1987 | |
@@ -2039,7 +2039,7 @@ discard block |
||
| 2039 | 2039 | in_array($operation, ['ajouter', 'commuter']) |
| 2040 | 2040 | && !$is_class_presente |
| 2041 | 2041 | ) { |
| 2042 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2042 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2043 | 2043 | } elseif ( |
| 2044 | 2044 | in_array($operation, ['supprimer', 'commuter']) |
| 2045 | 2045 | && $is_class_presente |
@@ -2109,7 +2109,7 @@ discard block |
||
| 2109 | 2109 | // Quelques fonctions de calcul arithmetique |
| 2110 | 2110 | // |
| 2111 | 2111 | function floatstr($a) { |
| 2112 | - return str_replace(',', '.', (string)(float) $a); |
|
| 2112 | + return str_replace(',', '.', (string) (float) $a); |
|
| 2113 | 2113 | } |
| 2114 | 2114 | function strize($f, $a, $b) { |
| 2115 | 2115 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2250,13 +2250,13 @@ discard block |
||
| 2250 | 2250 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2251 | 2251 | define('_TAGS_NOM_AUTEUR', ''); |
| 2252 | 2252 | } |
| 2253 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2253 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2254 | 2254 | foreach ($tags_acceptes as $tag) { |
| 2255 | 2255 | if (strlen($tag)) { |
| 2256 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2257 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2258 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2259 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2256 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2257 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2258 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2259 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2260 | 2260 | } |
| 2261 | 2261 | } |
| 2262 | 2262 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2375,10 +2375,10 @@ discard block |
||
| 2375 | 2375 | $fichier = basename($url); |
| 2376 | 2376 | |
| 2377 | 2377 | return '<a rel="enclosure"' |
| 2378 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2379 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2380 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2381 | - . '>' . $fichier . '</a>'; |
|
| 2378 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2379 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2380 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2381 | + . '>'.$fichier.'</a>'; |
|
| 2382 | 2382 | } |
| 2383 | 2383 | |
| 2384 | 2384 | /** |
@@ -2406,9 +2406,9 @@ discard block |
||
| 2406 | 2406 | } # vieux data |
| 2407 | 2407 | $fichier = basename($url); |
| 2408 | 2408 | $enclosures[] = '<enclosure' |
| 2409 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2410 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2411 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2409 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2410 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2411 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2412 | 2412 | . ' />'; |
| 2413 | 2413 | } |
| 2414 | 2414 | } |
@@ -2434,7 +2434,7 @@ discard block |
||
| 2434 | 2434 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2435 | 2435 | $subjects .= '<dc:subject>' |
| 2436 | 2436 | . texte_backend(textebrut($e)) |
| 2437 | - . '</dc:subject>' . "\n"; |
|
| 2437 | + . '</dc:subject>'."\n"; |
|
| 2438 | 2438 | } |
| 2439 | 2439 | } |
| 2440 | 2440 | |
@@ -2503,7 +2503,7 @@ discard block |
||
| 2503 | 2503 | if (is_array($texte)) { |
| 2504 | 2504 | array_walk( |
| 2505 | 2505 | $texte, |
| 2506 | - function (&$a, $key, $t) { |
|
| 2506 | + function(&$a, $key, $t) { |
|
| 2507 | 2507 | $a = extraire_balises($a, $t); |
| 2508 | 2508 | }, |
| 2509 | 2509 | $tag |
@@ -2631,7 +2631,7 @@ discard block |
||
| 2631 | 2631 | if ($fond != '404') { |
| 2632 | 2632 | $contexte = array_shift($p); |
| 2633 | 2633 | $contexte['page'] = $fond; |
| 2634 | - $action = preg_replace('/([?]' . preg_quote((string) $fond, '/') . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2634 | + $action = preg_replace('/([?]'.preg_quote((string) $fond, '/').'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2635 | 2635 | } |
| 2636 | 2636 | } |
| 2637 | 2637 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2686,9 +2686,9 @@ discard block |
||
| 2686 | 2686 | . '"' |
| 2687 | 2687 | . (is_null($val) |
| 2688 | 2688 | ? '' |
| 2689 | - : ' value="' . entites_html($val) . '"' |
|
| 2689 | + : ' value="'.entites_html($val).'"' |
|
| 2690 | 2690 | ) |
| 2691 | - . ' type="hidden"' . "\n/>"; |
|
| 2691 | + . ' type="hidden"'."\n/>"; |
|
| 2692 | 2692 | } |
| 2693 | 2693 | |
| 2694 | 2694 | return implode('', $hidden); |
@@ -2798,7 +2798,7 @@ discard block |
||
| 2798 | 2798 | |
| 2799 | 2799 | return preg_replace_callback( |
| 2800 | 2800 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2801 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2801 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2802 | 2802 | $contenu |
| 2803 | 2803 | ); |
| 2804 | 2804 | } |
@@ -2862,14 +2862,14 @@ discard block |
||
| 2862 | 2862 | ) { |
| 2863 | 2863 | $distant = true; |
| 2864 | 2864 | $cssf = parse_url($css); |
| 2865 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2865 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2866 | 2866 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2867 | 2867 | } else { |
| 2868 | 2868 | $distant = false; |
| 2869 | 2869 | $cssf = $css; |
| 2870 | 2870 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2871 | 2871 | //propose (rien a faire dans ce cas) |
| 2872 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2872 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2873 | 2873 | if (@file_exists($f)) { |
| 2874 | 2874 | return $f; |
| 2875 | 2875 | } |
@@ -2879,7 +2879,7 @@ discard block |
||
| 2879 | 2879 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2880 | 2880 | $f = $dir_var |
| 2881 | 2881 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2882 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2882 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2883 | 2883 | |
| 2884 | 2884 | // la css peut etre distante (url absolue !) |
| 2885 | 2885 | $contenu = null; |
@@ -2926,8 +2926,8 @@ discard block |
||
| 2926 | 2926 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2927 | 2927 | elseif (str_starts_with($css_direction, $dir_var)) { |
| 2928 | 2928 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2929 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2930 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2929 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 2930 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 2931 | 2931 | } |
| 2932 | 2932 | $src[] = $regs[0][$k]; |
| 2933 | 2933 | $src_direction_css[] = str_replace($import_css, $css_direction, (string) $regs[0][$k]); |
@@ -2976,7 +2976,7 @@ discard block |
||
| 2976 | 2976 | |
| 2977 | 2977 | $f = basename($css, '.css'); |
| 2978 | 2978 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 2979 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 2979 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 2980 | 2980 | . '.css'; |
| 2981 | 2981 | |
| 2982 | 2982 | if (@filemtime($f) > @filemtime($css) && _VAR_MODE != 'recalcul') { |
@@ -2987,7 +2987,7 @@ discard block |
||
| 2987 | 2987 | if ($url_absolue_css == $css) { |
| 2988 | 2988 | if ( |
| 2989 | 2989 | strncmp((string) $GLOBALS['meta']['adresse_site'], $css, $l = strlen((string) $GLOBALS['meta']['adresse_site'])) != 0 |
| 2990 | - || !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 2990 | + || !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 2991 | 2991 | ) { |
| 2992 | 2992 | include_spip('inc/distant'); |
| 2993 | 2993 | $contenu = recuperer_url($css); |
@@ -3099,7 +3099,7 @@ discard block |
||
| 3099 | 3099 | $expression = str_replace('\/', '/', $expression); |
| 3100 | 3100 | $expression = str_replace('/', '\/', $expression); |
| 3101 | 3101 | |
| 3102 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3102 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3103 | 3103 | if (isset($r[$capte])) { |
| 3104 | 3104 | return $r[$capte]; |
| 3105 | 3105 | } else { |
@@ -3141,7 +3141,7 @@ discard block |
||
| 3141 | 3141 | $expression = str_replace('\/', '/', $expression); |
| 3142 | 3142 | $expression = str_replace('/', '\/', $expression); |
| 3143 | 3143 | |
| 3144 | - return (string) preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3144 | + return (string) preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3145 | 3145 | } |
| 3146 | 3146 | |
| 3147 | 3147 | |
@@ -3160,7 +3160,7 @@ discard block |
||
| 3160 | 3160 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3161 | 3161 | |
| 3162 | 3162 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3163 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3163 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3164 | 3164 | |
| 3165 | 3165 | if ( |
| 3166 | 3166 | strstr($t, 'spip_document_') |
@@ -3174,7 +3174,7 @@ discard block |
||
| 3174 | 3174 | if (!isset($doublons['documents'])) { |
| 3175 | 3175 | $doublons['documents'] = ''; |
| 3176 | 3176 | } |
| 3177 | - $doublons['documents'] .= ',' . implode(',', $matches[1]); |
|
| 3177 | + $doublons['documents'] .= ','.implode(',', $matches[1]); |
|
| 3178 | 3178 | } |
| 3179 | 3179 | |
| 3180 | 3180 | return $letexte; |
@@ -3231,7 +3231,7 @@ discard block |
||
| 3231 | 3231 | if ($env) { |
| 3232 | 3232 | foreach ($env as $i => $j) { |
| 3233 | 3233 | if (is_string($j) && !in_array($i, $ignore_params)) { |
| 3234 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3234 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3235 | 3235 | } |
| 3236 | 3236 | } |
| 3237 | 3237 | } |
@@ -3270,7 +3270,7 @@ discard block |
||
| 3270 | 3270 | if ($env) { |
| 3271 | 3271 | foreach ($env as $i => $j) { |
| 3272 | 3272 | if (is_string($j) && !in_array($i, $ignore_params)) { |
| 3273 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3273 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3274 | 3274 | } |
| 3275 | 3275 | } |
| 3276 | 3276 | } |
@@ -3344,11 +3344,11 @@ discard block |
||
| 3344 | 3344 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3345 | 3345 | if ( |
| 3346 | 3346 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3347 | - && ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg') |
|
| 3347 | + && ($variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg') |
|
| 3348 | 3348 | && file_exists($variante_svg_generique) |
| 3349 | 3349 | ) { |
| 3350 | 3350 | if ( |
| 3351 | - ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg') |
|
| 3351 | + ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg') |
|
| 3352 | 3352 | && file_exists($variante_svg_size) |
| 3353 | 3353 | ) { |
| 3354 | 3354 | $img_file = $variante_svg_size; |
@@ -3404,7 +3404,7 @@ discard block |
||
| 3404 | 3404 | return ''; |
| 3405 | 3405 | } |
| 3406 | 3406 | } |
| 3407 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3407 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3408 | 3408 | } |
| 3409 | 3409 | |
| 3410 | 3410 | if (file_exists($img_file)) { |
@@ -3414,14 +3414,14 @@ discard block |
||
| 3414 | 3414 | $alt = ''; |
| 3415 | 3415 | } |
| 3416 | 3416 | elseif ($alt || $alt === '') { |
| 3417 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3417 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3418 | 3418 | } |
| 3419 | 3419 | else { |
| 3420 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3420 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3421 | 3421 | } |
| 3422 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3423 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3424 | - . ' ' . ltrim($atts) |
|
| 3422 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3423 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3424 | + . ' '.ltrim($atts) |
|
| 3425 | 3425 | . ' />'; |
| 3426 | 3426 | } |
| 3427 | 3427 | |
@@ -3435,10 +3435,10 @@ discard block |
||
| 3435 | 3435 | */ |
| 3436 | 3436 | function http_style_background($img, $att = '', $size = null) { |
| 3437 | 3437 | if ($size && is_numeric($size)) { |
| 3438 | - $size = trim($size) . 'px'; |
|
| 3438 | + $size = trim($size).'px'; |
|
| 3439 | 3439 | } |
| 3440 | - return " style='background" . |
|
| 3441 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3440 | + return " style='background". |
|
| 3441 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3442 | 3442 | . ($size ? "background-size:{$size};" : '') |
| 3443 | 3443 | . "'"; |
| 3444 | 3444 | } |
@@ -3548,7 +3548,7 @@ discard block |
||
| 3548 | 3548 | $img = http_img_pack( |
| 3549 | 3549 | $img, |
| 3550 | 3550 | $alt, |
| 3551 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3551 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3552 | 3552 | '', |
| 3553 | 3553 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3554 | 3554 | ); |
@@ -3648,9 +3648,9 @@ discard block |
||
| 3648 | 3648 | // regler le alt |
| 3649 | 3649 | if ($alt) { |
| 3650 | 3650 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3651 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3651 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3652 | 3652 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3653 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3653 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3654 | 3654 | $balise_svg .= $title; |
| 3655 | 3655 | } |
| 3656 | 3656 | else { |
@@ -3842,7 +3842,7 @@ discard block |
||
| 3842 | 3842 | } |
| 3843 | 3843 | |
| 3844 | 3844 | $c = serialize($c); |
| 3845 | - $cle = calculer_cle_action($form . $c); |
|
| 3845 | + $cle = calculer_cle_action($form.$c); |
|
| 3846 | 3846 | $c = "$cle:$c"; |
| 3847 | 3847 | |
| 3848 | 3848 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3900,15 +3900,15 @@ discard block |
||
| 3900 | 3900 | } |
| 3901 | 3901 | // toujours encoder l'url source dans le bloc ajax |
| 3902 | 3902 | $r = self(); |
| 3903 | - $r = ' data-origin="' . $r . '"'; |
|
| 3903 | + $r = ' data-origin="'.$r.'"'; |
|
| 3904 | 3904 | $class = 'ajaxbloc'; |
| 3905 | 3905 | if ($ajaxid && is_string($ajaxid)) { |
| 3906 | 3906 | // ajaxid est normalement conforme a un nom de classe css |
| 3907 | 3907 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3908 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3908 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3909 | 3909 | } |
| 3910 | 3910 | |
| 3911 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3911 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3912 | 3912 | } |
| 3913 | 3913 | |
| 3914 | 3914 | /** |
@@ -3953,7 +3953,7 @@ discard block |
||
| 3953 | 3953 | $cle = substr((string) $c, 0, $p); |
| 3954 | 3954 | $c = substr((string) $c, $p + 1); |
| 3955 | 3955 | |
| 3956 | - if ($cle === calculer_cle_action($form . $c)) { |
|
| 3956 | + if ($cle === calculer_cle_action($form.$c)) { |
|
| 3957 | 3957 | return @unserialize($c); |
| 3958 | 3958 | } |
| 3959 | 3959 | } |
@@ -4073,13 +4073,13 @@ discard block |
||
| 4073 | 4073 | } |
| 4074 | 4074 | } |
| 4075 | 4075 | } |
| 4076 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4076 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4077 | 4077 | } else { |
| 4078 | 4078 | $bal = 'a'; |
| 4079 | 4079 | $att = "href='$url'" |
| 4080 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4081 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4082 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4080 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4081 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4082 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4083 | 4083 | . $evt; |
| 4084 | 4084 | } |
| 4085 | 4085 | if ($libelle === null) { |
@@ -4216,7 +4216,7 @@ discard block |
||
| 4216 | 4216 | |
| 4217 | 4217 | // Icône |
| 4218 | 4218 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4219 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4219 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4220 | 4220 | |
| 4221 | 4221 | // Markup final |
| 4222 | 4222 | if ($type == 'lien') { |
@@ -4491,16 +4491,16 @@ discard block |
||
| 4491 | 4491 | $class_form = 'ajax'; |
| 4492 | 4492 | $class = str_replace('ajax', '', $class); |
| 4493 | 4493 | } |
| 4494 | - $class_btn = 'submit ' . trim($class); |
|
| 4494 | + $class_btn = 'submit '.trim($class); |
|
| 4495 | 4495 | |
| 4496 | 4496 | if ($confirm) { |
| 4497 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4497 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4498 | 4498 | $callback = $callback ? "$confirm?($callback):false" : $confirm; |
| 4499 | 4499 | } |
| 4500 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4500 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4501 | 4501 | $title = $title ? " title='$title'" : ''; |
| 4502 | 4502 | |
| 4503 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4503 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4504 | 4504 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4505 | 4505 | } |
| 4506 | 4506 | |
@@ -4564,14 +4564,14 @@ discard block |
||
| 4564 | 4564 | $champ_titre = ''; |
| 4565 | 4565 | if ($demande_titre) { |
| 4566 | 4566 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4567 | - $champ_titre = (empty($desc['titre'])) ? '' : ', ' . $desc['titre']; |
|
| 4567 | + $champ_titre = (empty($desc['titre'])) ? '' : ', '.$desc['titre']; |
|
| 4568 | 4568 | } |
| 4569 | 4569 | include_spip('base/abstract_sql'); |
| 4570 | 4570 | include_spip('base/connect_sql'); |
| 4571 | 4571 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4572 | - '*' . $champ_titre, |
|
| 4572 | + '*'.$champ_titre, |
|
| 4573 | 4573 | $desc['table_sql'], |
| 4574 | - id_table_objet($type_objet) . ' = ' . (int) $id_objet |
|
| 4574 | + id_table_objet($type_objet).' = '.(int) $id_objet |
|
| 4575 | 4575 | ); |
| 4576 | 4576 | |
| 4577 | 4577 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4660,8 +4660,7 @@ discard block |
||
| 4660 | 4660 | if (isset($ligne_sql['chapo'])) { |
| 4661 | 4661 | $chapo = $ligne_sql['chapo']; |
| 4662 | 4662 | $texte = strlen((string) $descriptif) ? |
| 4663 | - '' : |
|
| 4664 | - "$chapo \n\n $texte"; |
|
| 4663 | + '' : "$chapo \n\n $texte"; |
|
| 4665 | 4664 | } |
| 4666 | 4665 | |
| 4667 | 4666 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4725,7 +4724,7 @@ discard block |
||
| 4725 | 4724 | return $texte; |
| 4726 | 4725 | } |
| 4727 | 4726 | |
| 4728 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", (string) $traitement); |
|
| 4727 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", (string) $traitement); |
|
| 4729 | 4728 | |
| 4730 | 4729 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4731 | 4730 | if (test_espace_prive()) { |
@@ -4761,7 +4760,7 @@ discard block |
||
| 4761 | 4760 | } |
| 4762 | 4761 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4763 | 4762 | |
| 4764 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4763 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4765 | 4764 | } |
| 4766 | 4765 | |
| 4767 | 4766 | /** |
@@ -4779,9 +4778,9 @@ discard block |
||
| 4779 | 4778 | function wrap($texte, $wrap) { |
| 4780 | 4779 | $balises = extraire_balises($wrap); |
| 4781 | 4780 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4782 | - $texte = $wrap . $texte; |
|
| 4781 | + $texte = $wrap.$texte; |
|
| 4783 | 4782 | $regs = array_reverse($regs[1]); |
| 4784 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4783 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4785 | 4784 | $texte .= $wrap; |
| 4786 | 4785 | } |
| 4787 | 4786 | |
@@ -4811,7 +4810,7 @@ discard block |
||
| 4811 | 4810 | |
| 4812 | 4811 | // caster $u en array si besoin |
| 4813 | 4812 | if (is_object($u)) { |
| 4814 | - $u = (array)$u; |
|
| 4813 | + $u = (array) $u; |
|
| 4815 | 4814 | } |
| 4816 | 4815 | |
| 4817 | 4816 | if (is_array($u)) { |
@@ -4833,7 +4832,7 @@ discard block |
||
| 4833 | 4832 | // sinon on passe a la ligne et on indente |
| 4834 | 4833 | $i_str = str_pad('', $indent, ' '); |
| 4835 | 4834 | foreach ($u as $k => $v) { |
| 4836 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4835 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4837 | 4836 | } |
| 4838 | 4837 | |
| 4839 | 4838 | return $out; |
@@ -4887,7 +4886,7 @@ discard block |
||
| 4887 | 4886 | * @return string |
| 4888 | 4887 | */ |
| 4889 | 4888 | function objet_icone($objet, $taille = 24, $class = '') { |
| 4890 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 4889 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 4891 | 4890 | $icone = chemin_image($icone); |
| 4892 | 4891 | $balise_img = charger_filtre('balise_img'); |
| 4893 | 4892 | |
@@ -4913,7 +4912,7 @@ discard block |
||
| 4913 | 4912 | */ |
| 4914 | 4913 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 4915 | 4914 | $chaine = explode(':', $chaine); |
| 4916 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 4915 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 4917 | 4916 | return $t; |
| 4918 | 4917 | } |
| 4919 | 4918 | $chaine = implode(':', $chaine); |
@@ -4979,7 +4978,7 @@ discard block |
||
| 4979 | 4978 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 4980 | 4979 | |
| 4981 | 4980 | // calculer le nom de la css |
| 4982 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 4981 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 4983 | 4982 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 4984 | 4983 | $contexte_implicite = calculer_contexte_implicite(); |
| 4985 | 4984 | |
@@ -4987,14 +4986,14 @@ discard block |
||
| 4987 | 4986 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 4988 | 4987 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 4989 | 4988 | if (isset($options['hash_on_content']) && $options['hash_on_content']) { |
| 4990 | - $hash = md5((string) ($contexte_implicite['host'] . '::' . $cache)); |
|
| 4989 | + $hash = md5((string) ($contexte_implicite['host'].'::'.$cache)); |
|
| 4991 | 4990 | } |
| 4992 | 4991 | else { |
| 4993 | 4992 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 4994 | 4993 | ksort($contexte); |
| 4995 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 4994 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 4996 | 4995 | } |
| 4997 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 4996 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 4998 | 4997 | |
| 4999 | 4998 | // mettre a jour le fichier si il n'existe pas |
| 5000 | 4999 | // ou trop ancien |
@@ -5002,8 +5001,8 @@ discard block |
||
| 5002 | 5001 | // et recopie sur le fichier cible uniquement si il change |
| 5003 | 5002 | if ( |
| 5004 | 5003 | !file_exists($filename) |
| 5005 | - || !file_exists($filename . '.last') |
|
| 5006 | - || isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename . '.last') < $cache['lastmodified'] |
|
| 5004 | + || !file_exists($filename.'.last') |
|
| 5005 | + || isset($cache['lastmodified']) && $cache['lastmodified'] && filemtime($filename.'.last') < $cache['lastmodified'] |
|
| 5007 | 5006 | || defined('_VAR_MODE') && _VAR_MODE == 'recalcul' |
| 5008 | 5007 | ) { |
| 5009 | 5008 | $contenu = $cache['texte']; |
@@ -5027,10 +5026,10 @@ discard block |
||
| 5027 | 5026 | } |
| 5028 | 5027 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5029 | 5028 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5030 | - $comment .= "}\n md5:" . md5((string) $contenu) . " */\n"; |
|
| 5029 | + $comment .= "}\n md5:".md5((string) $contenu)." */\n"; |
|
| 5031 | 5030 | } |
| 5032 | 5031 | // et ecrire le fichier si il change |
| 5033 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5032 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5034 | 5033 | } |
| 5035 | 5034 | |
| 5036 | 5035 | return timestamp($filename); |
@@ -5257,7 +5256,7 @@ discard block |
||
| 5257 | 5256 | if ($e > 0 && strlen($mid) > 8) { |
| 5258 | 5257 | $mid = '***...***'; |
| 5259 | 5258 | } |
| 5260 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5259 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5261 | 5260 | } |
| 5262 | 5261 | |
| 5263 | 5262 | |
@@ -5319,7 +5318,7 @@ discard block |
||
| 5319 | 5318 | case 'id': |
| 5320 | 5319 | case 'anchor': |
| 5321 | 5320 | if (preg_match(',^\d,', $texte)) { |
| 5322 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5321 | + $texte = substr($type, 0, 1).$texte; |
|
| 5323 | 5322 | } |
| 5324 | 5323 | } |
| 5325 | 5324 | |
@@ -5329,9 +5328,9 @@ discard block |
||
| 5329 | 5328 | |
| 5330 | 5329 | if (strlen($texte) < $longueur_mini && $longueur_mini < $longueur_maxi) { |
| 5331 | 5330 | if (preg_match(',^\d,', $texte)) { |
| 5332 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5331 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5333 | 5332 | } |
| 5334 | - $texte .= $separateur . md5($original); |
|
| 5333 | + $texte .= $separateur.md5($original); |
|
| 5335 | 5334 | $texte = substr($texte, 0, $longueur_mini); |
| 5336 | 5335 | } |
| 5337 | 5336 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 100 | 100 | if ($retour) { |
| 101 | 101 | if (str_starts_with($retour, 'javascript:')) { |
| 102 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 102 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 103 | 103 | $res['editable'] = true; |
| 104 | 104 | } else { |
| 105 | 105 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | if (!isset($erreurs[$champ])) { |
| 140 | 140 | $erreurs[$champ] = ''; |
| 141 | 141 | } |
| 142 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 142 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | if ( |
| 220 | 220 | $config_fonc |
| 221 | 221 | && !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 222 | - && $config_fonc !== $table_objet . '_edit_config' |
|
| 222 | + && $config_fonc !== $table_objet.'_edit_config' |
|
| 223 | 223 | && ($args = test_formulaire_inclus_par_modele()) |
| 224 | 224 | && in_array($config_fonc, $args) |
| 225 | 225 | ) { |
@@ -231,12 +231,12 @@ discard block |
||
| 231 | 231 | // Appel direct dans un squelette |
| 232 | 232 | if (!$row) { |
| 233 | 233 | if (!$new || $lier_trad) { |
| 234 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 234 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 235 | 235 | $row = $select($id, $id_parent, $lier_trad); |
| 236 | 236 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 237 | 237 | $lang_default = (empty($row['lang']) ? null : $row['lang']); |
| 238 | 238 | } else { |
| 239 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . (int) $id); |
|
| 239 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.(int) $id); |
|
| 240 | 240 | } |
| 241 | 241 | if (!$new) { |
| 242 | 242 | $md5 = controles_md5($row ?: []); |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $contexte['config'] = $config = $config_fonc($contexte); |
| 288 | 288 | if (!$lang_default) { |
| 289 | 289 | include_spip('inc/session'); |
| 290 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 290 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | $config += [ |
@@ -309,13 +309,13 @@ discard block |
||
| 309 | 309 | unset($contexte['lang']); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 312 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 313 | 313 | ($lier_trad |
| 314 | - ? "\n<input type='hidden' name='lier_trad' value='" . |
|
| 315 | - $lier_trad . |
|
| 316 | - "' />" . |
|
| 317 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 318 | - $lang_default . |
|
| 314 | + ? "\n<input type='hidden' name='lier_trad' value='". |
|
| 315 | + $lier_trad. |
|
| 316 | + "' />". |
|
| 317 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 318 | + $lang_default. |
|
| 319 | 319 | "' />" |
| 320 | 320 | : '') |
| 321 | 321 | . $hidden |
@@ -356,14 +356,14 @@ discard block |
||
| 356 | 356 | $aider = charger_fonction('aider', 'inc'); |
| 357 | 357 | if (strlen($texte) > 28 * 1024) { |
| 358 | 358 | $texte = str_replace("\r\n", "\n", $texte); |
| 359 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 359 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 360 | 360 | if ($pos > 0 && $pos < 32 * 1024) { |
| 361 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 361 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 362 | 362 | $suite = substr($texte, $pos + 2); |
| 363 | 363 | } else { |
| 364 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 364 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 365 | 365 | if (!($pos > 0 && $pos < 32 * 1024)) { |
| 366 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 366 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 367 | 367 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 368 | 368 | } else { |
| 369 | 369 | $decalage = 1; |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $ctr = []; |
| 451 | 451 | foreach ($data as $key => $val) { |
| 452 | 452 | $m = md5($val ?? ''); |
| 453 | - $k = $prefixe . $key; |
|
| 453 | + $k = $prefixe.$key; |
|
| 454 | 454 | |
| 455 | 455 | $ctr[$k] = match ($format) { |
| 456 | 456 | 'html' => "<input type='hidden' value='$m' name='$k' />", |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | if ($format === 'html') { |
| 462 | - return "\n\n<!-- controles md5 -->\n" . implode("\n", $ctr) . "\n\n"; |
|
| 462 | + return "\n\n<!-- controles md5 -->\n".implode("\n", $ctr)."\n\n"; |
|
| 463 | 463 | } else { |
| 464 | 464 | return $ctr; |
| 465 | 465 | } |
@@ -612,8 +612,8 @@ discard block |
||
| 612 | 612 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 613 | 613 | foreach ($champs as $key => $val) { |
| 614 | 614 | if ( |
| 615 | - isset($ctr[$prefix . $key]) |
|
| 616 | - && ($m = $ctr[$prefix . $key]) |
|
| 615 | + isset($ctr[$prefix.$key]) |
|
| 616 | + && ($m = $ctr[$prefix.$key]) |
|
| 617 | 617 | && (is_scalar($val) && $m == md5($val)) |
| 618 | 618 | ) { |
| 619 | 619 | unset($champs[$key]); |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | // de conflit. |
| 643 | 643 | $ctrh = $ctrq = $conflits = []; |
| 644 | 644 | foreach (array_keys($champs) as $key) { |
| 645 | - if (isset($ctr[$prefix . $key]) && ($m = $ctr[$prefix . $key])) { |
|
| 645 | + if (isset($ctr[$prefix.$key]) && ($m = $ctr[$prefix.$key])) { |
|
| 646 | 646 | $ctrh[$key] = $m; |
| 647 | 647 | $ctrq[] = $key; |
| 648 | 648 | } |
@@ -676,8 +676,8 @@ discard block |
||
| 676 | 676 | */ |
| 677 | 677 | function display_conflit_champ($x) { |
| 678 | 678 | if (strstr($x, "\n") || strlen($x) > 80) { |
| 679 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 679 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 680 | 680 | } else { |
| 681 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 681 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 682 | 682 | } |
| 683 | 683 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 23 | 23 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 24 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 24 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | if ($dir) { |
| 379 | 379 | $dir .= '/'; |
| 380 | 380 | } |
| 381 | - $dir .= 'procure:' . $procure['nom']; |
|
| 381 | + $dir .= 'procure:'.$procure['nom']; |
|
| 382 | 382 | |
| 383 | 383 | $procure['etat'] = '?'; |
| 384 | 384 | $procure['dir_type'] = $resume['dir_type']; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | $plug = $resume['dir']; |
| 559 | 559 | $k = $infos[$dir_type][$plug]; |
| 560 | 560 | |
| 561 | - $plug = constant($dir_type) . $plug; |
|
| 561 | + $plug = constant($dir_type).$plug; |
|
| 562 | 562 | if (!isset($msg[$p])) { |
| 563 | 563 | if (isset($resume['erreur']) && $resume['erreur']) { |
| 564 | 564 | $msg[$p] = [$resume['erreur']]; |
@@ -601,10 +601,10 @@ discard block |
||
| 601 | 601 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 602 | 602 | } elseif (!$raw) { |
| 603 | 603 | foreach ($list as $plug => $msg) { |
| 604 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 604 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 606 | 606 | } |
| 607 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 607 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 608 | 608 | } |
| 609 | 609 | if ($raz) { |
| 610 | 610 | effacer_meta('plugin_erreur_activation'); |
@@ -718,13 +718,13 @@ discard block |
||
| 718 | 718 | if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) { |
| 719 | 719 | return _T("plugin_{$balise}_{$type}", [ |
| 720 | 720 | 'plugin' => $nom, |
| 721 | - 'version' => ' ≥ ' . $minimum |
|
| 721 | + 'version' => ' ≥ '.$minimum |
|
| 722 | 722 | ]); |
| 723 | 723 | } |
| 724 | 724 | if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) { |
| 725 | 725 | return _T("plugin_{$balise}_{$type}", [ |
| 726 | 726 | 'plugin' => $nom, |
| 727 | - 'version' => ' > ' . $minimum |
|
| 727 | + 'version' => ' > '.$minimum |
|
| 728 | 728 | ]); |
| 729 | 729 | } |
| 730 | 730 | } |
@@ -733,13 +733,13 @@ discard block |
||
| 733 | 733 | if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) { |
| 734 | 734 | return _T("plugin_{$balise}_{$type}", [ |
| 735 | 735 | 'plugin' => $nom, |
| 736 | - 'version' => ' ≤ ' . $maximum |
|
| 736 | + 'version' => ' ≤ '.$maximum |
|
| 737 | 737 | ]); |
| 738 | 738 | } |
| 739 | 739 | if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) { |
| 740 | 740 | return _T("plugin_{$balise}_plugin", [ |
| 741 | 741 | 'plugin' => $nom, |
| 742 | - 'version' => ' < ' . $maximum |
|
| 742 | + 'version' => ' < '.$maximum |
|
| 743 | 743 | ]); |
| 744 | 744 | } |
| 745 | 745 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | include_spip('inc/charger_plugin'); |
| 759 | 759 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 760 | 760 | }*/ |
| 761 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 761 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($plugin_valides as $p => $resume) { |
| 858 | 858 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 859 | 859 | if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') { |
| 860 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 860 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 861 | 861 | } |
| 862 | 862 | if ($resume['dir']) { |
| 863 | 863 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $header = strtolower(implode(',', $header)); |
| 883 | 883 | if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) { |
| 884 | 884 | ecrire_fichier( |
| 885 | - _DIR_VAR . 'config.txt', |
|
| 886 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 885 | + _DIR_VAR.'config.txt', |
|
| 886 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 887 | 887 | ); |
| 888 | 888 | } else { |
| 889 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 889 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 890 | 890 | } |
| 891 | 891 | // generer charger_plugins_chemin.php |
| 892 | 892 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | // definir le plugin, donc le path avant l'include du fichier options |
| 941 | 941 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 942 | 942 | |
| 943 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 943 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 944 | 944 | |
| 945 | 945 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 946 | 946 | if ( |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if (!$info['chemin']) { |
| 952 | 952 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 953 | 953 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 954 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 954 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 955 | 955 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 956 | } |
| 957 | 957 | } |
@@ -973,13 +973,13 @@ discard block |
||
| 973 | 973 | $dir = ''; |
| 974 | 974 | } |
| 975 | 975 | if (strlen($dir)) { |
| 976 | - $dir = rtrim($dir, '/') . '/'; |
|
| 976 | + $dir = rtrim($dir, '/').'/'; |
|
| 977 | 977 | } |
| 978 | 978 | if (!isset($chemin['type']) || $chemin['type'] == 'public') { |
| 979 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 980 | 980 | } |
| 981 | 981 | if (!isset($chemin['type']) || $chemin['type'] == 'prive') { |
| 982 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | } |
@@ -988,11 +988,11 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | if (count($chemins['public']) || count($chemins['prive'])) { |
| 991 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 991 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 992 | 992 | ',', |
| 993 | 993 | array_reverse($chemins['public']) |
| 994 | - ) . "]);\n" |
|
| 995 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 994 | + )."]);\n" |
|
| 995 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | && !str_contains($dir, ':') |
| 1042 | 1042 | && file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1043 | 1043 | ) { |
| 1044 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1044 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1045 | 1045 | $info[$charge] = [$file]; |
| 1046 | 1046 | } |
| 1047 | 1047 | } |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | ) { |
| 1057 | 1057 | unset($info[$charge][$k]); |
| 1058 | 1058 | } else { |
| 1059 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1059 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1060 | 1060 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | } |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1069 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1070 | 1070 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1071 | 1071 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1072 | 1072 | |
@@ -1101,12 +1101,12 @@ discard block |
||
| 1101 | 1101 | define("_UPDATED_$nom", $val); |
| 1102 | 1102 | define("_UPDATED_md5_$nom", $md5); |
| 1103 | 1103 | } |
| 1104 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1104 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1105 | 1105 | |
| 1106 | 1106 | return |
| 1107 | 1107 | "if (!function_exists('$nom')) {\n" |
| 1108 | 1108 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1109 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1109 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1110 | 1110 | . "}\n"; |
| 1111 | 1111 | } |
| 1112 | 1112 | |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1130 | 1130 | include_once(_CACHE_PLUGINS_OPT); |
| 1131 | 1131 | } else { |
| 1132 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1132 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } |
| 1135 | 1135 | |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1167 | 1167 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1168 | 1168 | $plug = $plugin_valides[$p]['dir']; |
| 1169 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1169 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1170 | 1170 | if (isset($info['pipeline']) && is_array($info['pipeline'])) { |
| 1171 | 1171 | foreach ($info['pipeline'] as $pipe) { |
| 1172 | 1172 | $nom = $pipe['nom']; |
@@ -1200,7 +1200,7 @@ discard block |
||
| 1200 | 1200 | } |
| 1201 | 1201 | if (isset($pipe['inclure'])) { |
| 1202 | 1202 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1203 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1203 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1204 | 1204 | } |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $prepend_code['taches_generales_cron'] = ''; |
| 1211 | 1211 | } |
| 1212 | 1212 | foreach ($info['genie'] as $genie) { |
| 1213 | - $nom = $prefix . $genie['nom']; |
|
| 1213 | + $nom = $prefix.$genie['nom']; |
|
| 1214 | 1214 | $periode = max(60, intval($genie['periode'])); |
| 1215 | 1215 | if (charger_fonction($nom, 'genie', true)) { |
| 1216 | 1216 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1228,13 +1228,13 @@ discard block |
||
| 1228 | 1228 | } |
| 1229 | 1229 | foreach ($info['style'] as $style) { |
| 1230 | 1230 | if (isset($style['path']) && $style['path']) { |
| 1231 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1231 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1232 | 1232 | } else { |
| 1233 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1233 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1234 | 1234 | } |
| 1235 | 1235 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1236 | 1236 | if (isset($style['media']) && strlen($style['media'])) { |
| 1237 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1237 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | $code .= "/>';\n"; |
| 1240 | 1240 | if ($style['type'] != 'prive') { |
@@ -1254,9 +1254,9 @@ discard block |
||
| 1254 | 1254 | if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) { |
| 1255 | 1255 | foreach ($info['script'] as $script) { |
| 1256 | 1256 | if (isset($script['path']) && $script['path']) { |
| 1257 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1257 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1258 | 1258 | } else { |
| 1259 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1259 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1262 | 1262 | if ($script['type'] != 'prive') { |
@@ -1319,10 +1319,10 @@ discard block |
||
| 1319 | 1319 | unset($GLOBALS['spip_pipeline']['all']); |
| 1320 | 1320 | $all_pipes = trim(array_shift($a)); |
| 1321 | 1321 | if ($all_pipes) { |
| 1322 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1322 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | if (count($a)) { |
| 1325 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1325 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | } |
| 1328 | 1328 | $content = ''; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1340 | 1340 | foreach ($pipe as $fonc) { |
| 1341 | 1341 | $fonc = trim($fonc); |
| 1342 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1342 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1343 | 1343 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1344 | 1344 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1345 | 1345 | $file = "'$file'"; |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | if (defined($root_dir)) { |
| 1351 | 1351 | $dir = $root_dir; |
| 1352 | 1352 | } |
| 1353 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1353 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1354 | 1354 | $file = str_replace("''.", '', $file); |
| 1355 | 1355 | $file = str_replace(constant($dir), '', $file); |
| 1356 | 1356 | } |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | $content .= "// Pipeline $action \n" |
| 1364 | 1364 | . "function execute_pipeline_$action(&\$val){\n" |
| 1365 | 1365 | . $s_inc |
| 1366 | - . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1366 | + . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1367 | 1367 | . $s_call |
| 1368 | 1368 | . "return \$val;\n}\n"; |
| 1369 | 1369 | } |
@@ -1419,9 +1419,9 @@ discard block |
||
| 1419 | 1419 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1420 | 1420 | if (_IS_CLI) { |
| 1421 | 1421 | include_spip('inc/filtres'); |
| 1422 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1423 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1424 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1422 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1423 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1424 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1425 | 1425 | $trace, |
| 1426 | 1426 | "\n"; |
| 1427 | 1427 | } |
@@ -1456,15 +1456,15 @@ discard block |
||
| 1456 | 1456 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1459 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1460 | 1460 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1461 | 1461 | // si pas de modif on ne touche pas au fichier initial |
| 1462 | 1462 | if (file_exists($nom)) { |
| 1463 | 1463 | if (str_ends_with($nom, '.php')) { |
| 1464 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1464 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1465 | 1465 | } |
| 1466 | 1466 | else { |
| 1467 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1467 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1468 | 1468 | } |
| 1469 | 1469 | file_put_contents($fichier_tmp, $contenu); |
| 1470 | 1470 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $n = (int) sql_errno(); |
| 61 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 61 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 62 | 62 | |
| 63 | 63 | return $n ?: 1; |
| 64 | 64 | } |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | // erreur SQL a afficher |
| 102 | 102 | $raison = minipres( |
| 103 | 103 | _T('info_travaux_titre'), |
| 104 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 104 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 105 | 105 | ); |
| 106 | 106 | } elseif (@$raison['statut']) { |
| 107 | 107 | // un simple visiteur n'a pas acces a l'espace prive |
| 108 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 108 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 109 | 109 | $est_connecte = (!empty($GLOBALS['visiteur_session']['login']) && !empty($GLOBALS['visiteur_session']['statut'])); // idem test balise #URL_LOGOUT |
| 110 | 110 | $raison = minipres( |
| 111 | 111 | _T('avis_erreur_connexion'), |
| 112 | 112 | _T('avis_erreur_visiteur') |
| 113 | 113 | // Lien vers le site public |
| 114 | - . '<br /><a href="' . url_de_base() . '">' . _T('login_retour_public') . '</a>' |
|
| 114 | + . '<br /><a href="'.url_de_base().'">'._T('login_retour_public').'</a>' |
|
| 115 | 115 | // Si la personne est connectée, lien de déconnexion ramenant vers la page de login |
| 116 | - . ($est_connecte ? ' | <a href="' . generer_url_public('', 'action=logout&logout=prive') . '">' . _T('icone_deconnecter') . '</a>' : '') |
|
| 116 | + . ($est_connecte ? ' | <a href="'.generer_url_public('', 'action=logout&logout=prive').'">'._T('icone_deconnecter').'</a>' : '') |
|
| 117 | 117 | ); |
| 118 | 118 | } else { |
| 119 | 119 | // auteur en fin de droits ... |
@@ -201,8 +201,7 @@ discard block |
||
| 201 | 201 | $where = (is_numeric($id_auteur) |
| 202 | 202 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 203 | 203 | ) ? |
| 204 | - "id_auteur=$id_auteur" : |
|
| 205 | - (strlen((string) $GLOBALS['connect_login']) ? 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text') : ''); |
|
| 204 | + "id_auteur=$id_auteur" : (strlen((string) $GLOBALS['connect_login']) ? 'login='.sql_quote($GLOBALS['connect_login'], '', 'text') : ''); |
|
| 206 | 205 | |
| 207 | 206 | if (!$where) { |
| 208 | 207 | return ''; |
@@ -327,7 +326,7 @@ discard block |
||
| 327 | 326 | * @return string |
| 328 | 327 | */ |
| 329 | 328 | function auth_a_loger() { |
| 330 | - $redirect = generer_url_public('login', 'url=' . rawurlencode((string) self('&', true)), true); |
|
| 329 | + $redirect = generer_url_public('login', 'url='.rawurlencode((string) self('&', true)), true); |
|
| 331 | 330 | |
| 332 | 331 | // un echec au "bonjour" (login initial) quand le statut est |
| 333 | 332 | // inconnu signale sans doute un probleme de cookies |
@@ -363,7 +362,7 @@ discard block |
||
| 363 | 362 | $date ??= date('Y-m-d H:i:s'); |
| 364 | 363 | |
| 365 | 364 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 366 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . (int) $row['id_auteur']); |
|
| 365 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.(int) $row['id_auteur']); |
|
| 367 | 366 | $row['en_ligne'] = $date; |
| 368 | 367 | } |
| 369 | 368 | |
@@ -471,7 +470,7 @@ discard block |
||
| 471 | 470 | if ( |
| 472 | 471 | !$login |
| 473 | 472 | || !($login_base = auth_retrouver_login($login, $serveur)) |
| 474 | - || !($row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur)) |
|
| 473 | + || !($row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur)) |
|
| 475 | 474 | ) { |
| 476 | 475 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 477 | 476 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
@@ -581,7 +580,7 @@ discard block |
||
| 581 | 580 | sql_updateq( |
| 582 | 581 | 'spip_auteurs', |
| 583 | 582 | ['prefs' => serialize($p)], |
| 584 | - 'id_auteur=' . (int) $auteur['id_auteur'] |
|
| 583 | + 'id_auteur='.(int) $auteur['id_auteur'] |
|
| 585 | 584 | ); |
| 586 | 585 | |
| 587 | 586 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -745,7 +744,7 @@ discard block |
||
| 745 | 744 | return false; |
| 746 | 745 | } |
| 747 | 746 | |
| 748 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 747 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 749 | 748 | |
| 750 | 749 | if (!$row) { |
| 751 | 750 | if ( |
@@ -801,11 +800,11 @@ discard block |
||
| 801 | 800 | $retour = $retour ?: _T('icone_retour'); |
| 802 | 801 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 803 | 802 | if ($url) { |
| 804 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 803 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 805 | 804 | } |
| 806 | 805 | |
| 807 | 806 | if ($lien) { |
| 808 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 807 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 809 | 808 | } |
| 810 | 809 | include_spip('inc/minipres'); |
| 811 | 810 | echo minipres($pb, $corps); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $contenu = @gzfile($fichier); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return is_array($contenu) ? implode('', $contenu) : (string)$contenu; |
|
| 124 | + return is_array($contenu) ? implode('', $contenu) : (string) $contenu; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) { |
| 323 | 323 | if (!str_ends_with($fichier, '.php')) { |
| 324 | - spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php'); |
|
| 324 | + spip_log('Erreur de programmation: '.$fichier.' doit finir par .php'); |
|
| 325 | 325 | } |
| 326 | - $contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu; |
|
| 326 | + $contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu; |
|
| 327 | 327 | |
| 328 | 328 | return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate); |
| 329 | 329 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | * @return bool |
| 337 | 337 | */ |
| 338 | 338 | function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) { |
| 339 | - $fichier_tmp = $fichier . '.last'; |
|
| 339 | + $fichier_tmp = $fichier.'.last'; |
|
| 340 | 340 | if (!ecrire_fichier($fichier_tmp, $contenu, true)) { |
| 341 | 341 | return false; |
| 342 | 342 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $wait = 0; |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | - spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE); |
|
| 550 | + spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE); |
|
| 551 | 551 | if ($wait) { |
| 552 | 552 | sleep($duree + 1); |
| 553 | 553 | } |
@@ -575,9 +575,9 @@ discard block |
||
| 575 | 575 | if ($item == '.' || $item == '..') { |
| 576 | 576 | continue; |
| 577 | 577 | } |
| 578 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 579 | - @chmod($dir . '/' . $item, 0777); |
|
| 580 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 578 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 579 | + @chmod($dir.'/'.$item, 0777); |
|
| 580 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 581 | 581 | return false; |
| 582 | 582 | } |
| 583 | 583 | }; |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | if (!strlen($subdir)) { |
| 623 | 623 | $n = strrpos($base, '/'); |
| 624 | 624 | if ($n === false) { |
| 625 | - return $nobase ? '' : ($base . '/'); |
|
| 625 | + return $nobase ? '' : ($base.'/'); |
|
| 626 | 626 | } |
| 627 | 627 | $subdir = substr($base, $n + 1); |
| 628 | 628 | $base = substr($base, 0, $n + 1); |
@@ -632,14 +632,14 @@ discard block |
||
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | $baseaff = $nobase ? '' : $base; |
| 635 | - if (isset($dirs[$base . $subdir])) { |
|
| 636 | - return $baseaff . $dirs[$base . $subdir]; |
|
| 635 | + if (isset($dirs[$base.$subdir])) { |
|
| 636 | + return $baseaff.$dirs[$base.$subdir]; |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | - $path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 639 | + $path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 640 | 640 | |
| 641 | 641 | if (file_exists("$path/.ok")) { |
| 642 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 642 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | @mkdir($path, _SPIP_CHMOD); |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | @touch("$path/.ok"); |
| 650 | 650 | spip_log("creation $base$subdir/"); |
| 651 | 651 | |
| 652 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 652 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | // en cas d'echec c'est peut etre tout simplement que le disque est plein : |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | // FIXME: throw an Exception… |
| 662 | 662 | if (!_DIR_RESTREINT) { |
| 663 | - $base = preg_replace(',^' . _DIR_RACINE . ',', '', $base); |
|
| 663 | + $base = preg_replace(',^'._DIR_RACINE.',', '', $base); |
|
| 664 | 664 | } |
| 665 | 665 | $base .= $subdir; |
| 666 | - raler_fichier($base . '/.ok'); |
|
| 666 | + raler_fichier($base.'/.ok'); |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | $maxfiles - $nbfiles, |
| 736 | 736 | $recurs |
| 737 | 737 | ); |
| 738 | - $fichiers = array_merge((array)$beginning, (array)$end); |
|
| 738 | + $fichiers = array_merge((array) $beginning, (array) $end); |
|
| 739 | 739 | $nbfiles = count($fichiers); |
| 740 | 740 | } |
| 741 | 741 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | // mais apres la fonction autoriser() |
| 120 | 120 | if ($f = find_in_path('mes_fonctions.php')) { |
| 121 | 121 | global $dossier_squelettes; |
| 122 | - include_once(_ROOT_CWD . $f); |
|
| 122 | + include_once(_ROOT_CWD.$f); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 161 | 161 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 162 | 162 | } elseif (is_numeric($qui)) { |
| 163 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 163 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 164 | 164 | if (!$qui) { |
| 165 | 165 | return false; |
| 166 | 166 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | spip_log( |
| 176 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 177 | - 'autoriser' . _LOG_DEBUG |
|
| 176 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 177 | + 'autoriser'._LOG_DEBUG |
|
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | 180 | // passer par objet_type pour avoir les alias |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) |
| 191 | 191 | && autoriser_exception($faire, $type, $id, 'verifier') || isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) && autoriser_exception($faire, $type, '*', 'verifier') |
| 192 | 192 | ) { |
| 193 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 193 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 194 | 194 | return true; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -199,18 +199,18 @@ discard block |
||
| 199 | 199 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 200 | 200 | $fonctions = $type |
| 201 | 201 | ? [ |
| 202 | - 'autoriser_' . $type . '_' . $faire, |
|
| 203 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 204 | - 'autoriser_' . $type, |
|
| 205 | - 'autoriser_' . $type . '_dist', |
|
| 206 | - 'autoriser_' . $faire, |
|
| 207 | - 'autoriser_' . $faire . '_dist', |
|
| 202 | + 'autoriser_'.$type.'_'.$faire, |
|
| 203 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 204 | + 'autoriser_'.$type, |
|
| 205 | + 'autoriser_'.$type.'_dist', |
|
| 206 | + 'autoriser_'.$faire, |
|
| 207 | + 'autoriser_'.$faire.'_dist', |
|
| 208 | 208 | 'autoriser_defaut', |
| 209 | 209 | 'autoriser_defaut_dist' |
| 210 | 210 | ] |
| 211 | 211 | : [ |
| 212 | - 'autoriser_' . $faire, |
|
| 213 | - 'autoriser_' . $faire . '_dist', |
|
| 212 | + 'autoriser_'.$faire, |
|
| 213 | + 'autoriser_'.$faire.'_dist', |
|
| 214 | 214 | 'autoriser_defaut', |
| 215 | 215 | 'autoriser_defaut_dist' |
| 216 | 216 | ]; |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | spip_log( |
| 227 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 228 | - 'autoriser' . _LOG_DEBUG |
|
| 227 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 228 | + 'autoriser'._LOG_DEBUG |
|
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | if (!is_bool($a)) { |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 375 | 375 | |
| 376 | 376 | // Le visiteur a-t-il un statut prevu par la config ? |
| 377 | - if (str_contains((string) $GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',')) { |
|
| 377 | + if (str_contains((string) $GLOBALS['meta']['preview'], ','.$qui['statut'].',')) { |
|
| 378 | 378 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | } // pas de champ passe a la demande => NIET |
| 429 | 429 | $previsu = explode(',', (string) $c['previsu']); |
| 430 | 430 | // regarder si ce statut est autorise pour l'auteur |
| 431 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 431 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 432 | 432 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 433 | 433 | // sinon l’auteur en session |
| 434 | 434 | include_spip('inc/securiser_action'); |
@@ -442,12 +442,12 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | if (!$id_auteur) { |
| 444 | 444 | return false; |
| 445 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 445 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 446 | 446 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 447 | 447 | } elseif ( |
| 448 | 448 | !sql_countsel( |
| 449 | 449 | 'spip_auteurs_liens', |
| 450 | - 'id_auteur=' . (int) $id_auteur . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . (int) $id |
|
| 450 | + 'id_auteur='.(int) $id_auteur.' AND objet='.sql_quote($type).' AND id_objet='.(int) $id |
|
| 451 | 451 | ) |
| 452 | 452 | ) { |
| 453 | 453 | return false; |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 493 | 493 | $primary = id_table_objet($type); |
| 494 | 494 | $id_rubrique = $table != 'spip_rubriques' |
| 495 | - ? sql_getfetsel('id_rubrique', "$table", "$primary=" . (int) $id) |
|
| 495 | + ? sql_getfetsel('id_rubrique', "$table", "$primary=".(int) $id) |
|
| 496 | 496 | : $id; |
| 497 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique); |
|
| 497 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique); |
|
| 498 | 498 | if (!$id_secteur > 0) { |
| 499 | 499 | $id_secteur = $id_rubrique; |
| 500 | 500 | } |
| 501 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . (int) $id_secteur); |
|
| 502 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . (int) $id); |
|
| 501 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.(int) $id_secteur); |
|
| 502 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".(int) $id); |
|
| 503 | 503 | if ($langue_secteur != $langue_objet) { |
| 504 | 504 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 505 | 505 | return true; |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 508 | 508 | return false; |
| 509 | 509 | } else { |
| 510 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . (int) $id); |
|
| 510 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.(int) $id); |
|
| 511 | 511 | if ($id_parent != 0) { |
| 512 | 512 | // sous-rubriques : pas de choix de langue |
| 513 | 513 | return false; |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | |
| 560 | 560 | if (!isset($opt['statut'])) { |
| 561 | 561 | if (isset($desc['field']['statut'])) { |
| 562 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . (int) $id); |
|
| 562 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.(int) $id); |
|
| 563 | 563 | } else { |
| 564 | 564 | $statut = 'publie'; |
| 565 | 565 | } // pas de statut => publie |
@@ -724,11 +724,11 @@ discard block |
||
| 724 | 724 | return false; |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | - if (sql_countsel('spip_rubriques', 'id_parent=' . (int) $id)) { |
|
| 727 | + if (sql_countsel('spip_rubriques', 'id_parent='.(int) $id)) { |
|
| 728 | 728 | return false; |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | - if (sql_countsel('spip_articles', 'id_rubrique=' . (int) $id . " AND (statut<>'poubelle')")) { |
|
| 731 | + if (sql_countsel('spip_articles', 'id_rubrique='.(int) $id." AND (statut<>'poubelle')")) { |
|
| 732 | 732 | return false; |
| 733 | 733 | } |
| 734 | 734 | |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | if (!$id) { |
| 766 | 766 | return false; |
| 767 | 767 | } |
| 768 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 768 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 769 | 769 | |
| 770 | 770 | return $r && ( |
| 771 | 771 | autoriser('publierdans', 'rubrique', $r['id_rubrique'], $qui, $opt) |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | (!isset($opt['statut']) || !in_array($opt['statut'], ['publie', 'refuse'], true)) |
| 774 | 774 | && in_array($qui['statut'], ['0minirezo', '1comite']) |
| 775 | 775 | && in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 776 | - && auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 776 | + && auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 777 | 777 | ) |
| 778 | 778 | ); |
| 779 | 779 | } |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | if (!$id) { |
| 832 | 832 | return false; |
| 833 | 833 | } |
| 834 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . (int) $id); |
|
| 834 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.(int) $id); |
|
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | return |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | in_array($statut, ['prop', 'publie']) |
| 841 | 841 | // sinon si on est auteur, on a le droit de le voir, evidemment ! |
| 842 | 842 | |
| 843 | - || $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']); |
|
| 843 | + || $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | |
@@ -861,8 +861,8 @@ discard block |
||
| 861 | 861 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 862 | 862 | # securite, mais on aurait pas du arriver ici ! |
| 863 | 863 | if ( |
| 864 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 865 | - || function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 864 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 865 | + || function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 866 | 866 | ) { |
| 867 | 867 | return $f($faire, $type, $id, $qui, $opt); |
| 868 | 868 | } |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | $n = sql_fetsel( |
| 988 | 988 | 'A.id_article', |
| 989 | 989 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 990 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 990 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 991 | 991 | ); |
| 992 | 992 | |
| 993 | 993 | return (bool) $n; |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | && ($r = sql_allfetsel( |
| 1186 | 1186 | 'id_objet', |
| 1187 | 1187 | 'spip_auteurs_liens', |
| 1188 | - 'id_auteur=' . (int) $id_auteur . " AND objet='rubrique' AND id_objet!=0" |
|
| 1188 | + 'id_auteur='.(int) $id_auteur." AND objet='rubrique' AND id_objet!=0" |
|
| 1189 | 1189 | )) |
| 1190 | 1190 | && (is_countable($r) ? count($r) : 0) |
| 1191 | 1191 | ) { |
@@ -1862,8 +1862,8 @@ discard block |
||
| 1862 | 1862 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1863 | 1863 | $objet = objet_type($objet); |
| 1864 | 1864 | $where = [ |
| 1865 | - 'objet=' . sql_quote($objet), |
|
| 1866 | - 'id_objet=' . (int) $id_objet |
|
| 1865 | + 'objet='.sql_quote($objet), |
|
| 1866 | + 'id_objet='.(int) $id_objet |
|
| 1867 | 1867 | ]; |
| 1868 | 1868 | if (!empty($cond)) { |
| 1869 | 1869 | if (is_array($cond)) { |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (is_null($liste_langues)) { |
| 46 | - $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 46 | + $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 47 | 47 | } else { |
| 48 | 48 | if (is_array($liste_langues)) { |
| 49 | 49 | $liste_langues = implode(',', $liste_langues); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 52 | + $liste_langues = ','.$liste_langues.','; |
|
| 53 | 53 | |
| 54 | 54 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 55 | 55 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | } |
| 192 | 192 | foreach ($langues as $l) { |
| 193 | 193 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 194 | - $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n"; |
|
| 194 | + $ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n"; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (!test_espace_prive()) { |
@@ -209,21 +209,20 @@ discard block |
||
| 209 | 209 | $base, |
| 210 | 210 | $cible, |
| 211 | 211 | (select_langues($nom_select, $change, $ret) |
| 212 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 212 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 213 | 213 | " method='post'" |
| 214 | 214 | ); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | function select_langues($nom_select, $change, $options, $label = '') { |
| 218 | 218 | static $cpt = 0; |
| 219 | - $id = 'menu_langues' . $cpt++; |
|
| 219 | + $id = 'menu_langues'.$cpt++; |
|
| 220 | 220 | |
| 221 | 221 | return |
| 222 | - "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' . |
|
| 222 | + "<label for='$id'>".($label ?: _T('info_langues')).'</label> '. |
|
| 223 | 223 | "<select name='$nom_select' id='$id' " |
| 224 | 224 | . ((test_espace_prive()) ? |
| 225 | - (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : |
|
| 226 | - ("class='forml menu_langues'")) |
|
| 225 | + (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : ("class='forml menu_langues'")) |
|
| 227 | 226 | . $change |
| 228 | 227 | . ">\n" |
| 229 | 228 | . $options |
@@ -346,7 +345,7 @@ discard block |
||
| 346 | 345 | isset($GLOBALS['meta']['langue_site']) |
| 347 | 346 | && (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 348 | 347 | ) { |
| 349 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 348 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 350 | 349 | } |
| 351 | 350 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 352 | 351 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -458,7 +457,7 @@ discard block |
||
| 458 | 457 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 459 | 458 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 460 | 459 | $GLOBALS['meta']['langue_site'] = $tout = |
| 461 | - (!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,")) |
|
| 460 | + (!$all_langs || str_contains(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,")) |
|
| 462 | 461 | ? _LANGUE_PAR_DEFAUT |
| 463 | 462 | : substr((string) $all_langs, 0, strpos((string) $all_langs, ',')); |
| 464 | 463 | ecrire_meta('langue_site', $tout); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return $x . $texte; |
|
| 66 | + return $x.$texte; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 141 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 141 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 142 | 142 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | $texte = substr_replace($texte, $x, $pos, 0); |
| 172 | 172 | // pas de preview en fenetre enfant |
| 173 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 173 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes((string) $GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 174 | 174 | if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) { |
| 175 | 175 | $pos = -1; |
| 176 | 176 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 243 | 243 | if (($p = strpos($texte, '</body>')) !== false) { |
| 244 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 244 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 245 | 245 | } else { |
| 246 | 246 | $texte .= $code; |
| 247 | 247 | } |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | foreach (['script', 'iframe'] as $tag) { |
| 107 | 107 | if ( |
| 108 | 108 | stripos($t, (string) "<$tag") !== false |
| 109 | - && preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER) |
|
| 109 | + && preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER) |
|
| 110 | 110 | ) { |
| 111 | 111 | foreach ($r as $regs) { |
| 112 | 112 | $t = str_replace( |
| 113 | 113 | $regs[0], |
| 114 | - "<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', |
|
| 114 | + "<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>', |
|
| 115 | 115 | $t |
| 116 | 116 | ); |
| 117 | 117 | } |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // echapper les tags asp/php |
| 167 | - $t = str_replace('<' . '%', '<%', $arg); |
|
| 167 | + $t = str_replace('<'.'%', '<%', $arg); |
|
| 168 | 168 | |
| 169 | 169 | // echapper le php |
| 170 | - $t = str_replace('<' . '?', '<?', $t); |
|
| 170 | + $t = str_replace('<'.'?', '<?', $t); |
|
| 171 | 171 | |
| 172 | 172 | // echapper le < script language=php > |
| 173 | 173 | $t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '<\1', $t); |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | // Reinserer les echappements des modeles |
| 191 | 191 | if (defined('_PROTEGE_JS_MODELES')) { |
| 192 | - $t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES); |
|
| 192 | + $t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES); |
|
| 193 | 193 | } |
| 194 | 194 | if (defined('_PROTEGE_PHP_MODELES')) { |
| 195 | - $t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES); |
|
| 195 | + $t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | return $dejavu[$mode_filtre][$arg] = $t; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | define('_TYPO_PROTEGER', "!':;?~%-"); |
| 291 | 291 | define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8"); |
| 292 | 292 | |
| 293 | -define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS'); |
|
| 293 | +define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS'); |
|
| 294 | 294 | |
| 295 | 295 | /** |
| 296 | 296 | * Corrige la typographie |