@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | if (is_callable($f)) { |
| 102 | 102 | return $f; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // affichage "GIT [master: abcdef]" |
| 232 | 232 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 233 | 233 | if ($desc['branch']) { |
| 234 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 234 | + $commit = $desc['branch'].': '.$commit; |
|
| 235 | 235 | } |
| 236 | 236 | return "{$desc['vcs']} [$commit]"; |
| 237 | 237 | } |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // version installee par GIT |
| 253 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 253 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 254 | 254 | $currentHead = trim(substr($c, 4)); |
| 255 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 255 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 256 | 256 | return [ |
| 257 | 257 | 'vcs' => 'GIT', |
| 258 | 258 | 'branch' => basename($currentHead), |
@@ -267,12 +267,12 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 269 | 269 | // et laisser passer les fonctions personnelles baptisees image_... |
| 270 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 271 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 272 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 273 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 274 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 275 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 270 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 271 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 272 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 273 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 274 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 275 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 276 | 276 | |
| 277 | 277 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 278 | 278 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | function filtre_debug($val, $key = null) { |
| 433 | 433 | $debug = ( |
| 434 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 435 | - ) . var_export($val, true); |
|
| 434 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 435 | + ).var_export($val, true); |
|
| 436 | 436 | |
| 437 | 437 | include_spip('inc/autoriser'); |
| 438 | 438 | if (autoriser('webmestre')) { |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $is_file = false; |
| 489 | 489 | } |
| 490 | 490 | if ($is_file) { |
| 491 | - $is_local_file = function ($path) { |
|
| 491 | + $is_local_file = function($path) { |
|
| 492 | 492 | if (strpos($path, '?') !== false) { |
| 493 | 493 | $path = supprimer_timestamp($path); |
| 494 | 494 | // remove ?24px added by find_in_theme on .svg files |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 538 | 538 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 539 | 539 | $srcover = $match[1]; |
| 540 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 540 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 541 | 541 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 542 | 542 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 543 | 543 | } |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | // " -> " et tout ce genre de choses |
| 940 | 940 | $u = $GLOBALS['meta']['pcre_u']; |
| 941 | 941 | $texte = str_replace(' ', ' ', $texte); |
| 942 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 942 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 943 | 943 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 944 | 944 | $texte = entites_html($texte, false, false); |
| 945 | 945 | // mais bien echapper les double quotes ! |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | return ''; |
| 1002 | 1002 | } |
| 1003 | 1003 | return preg_replace( |
| 1004 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1004 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1005 | 1005 | '', |
| 1006 | 1006 | $texte |
| 1007 | 1007 | ); |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | if ( |
| 1031 | 1031 | $texte and |
| 1032 | 1032 | preg_match( |
| 1033 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1033 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1034 | 1034 | $texte, |
| 1035 | 1035 | $regs |
| 1036 | 1036 | ) |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | **/ |
| 1122 | 1122 | function textebrut($texte) { |
| 1123 | 1123 | $u = $GLOBALS['meta']['pcre_u']; |
| 1124 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1125 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1124 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1125 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1126 | 1126 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1127 | 1127 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1128 | 1128 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | ) |
| 1157 | 1157 | ) { |
| 1158 | 1158 | foreach ($liens[0] as $a) { |
| 1159 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1159 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1160 | 1160 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1161 | 1161 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1162 | 1162 | $texte = str_replace($a, $ablank, $texte); |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | foreach ($regs[0] as $a) { |
| 1182 | 1182 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1183 | 1183 | if (strpos($rel, 'nofollow') === false) { |
| 1184 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1184 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1185 | 1185 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1186 | 1186 | $texte = str_replace($a, $anofollow, $texte); |
| 1187 | 1187 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $u = $GLOBALS['meta']['pcre_u']; |
| 1211 | 1211 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1212 | 1212 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1213 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1213 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1214 | 1214 | |
| 1215 | 1215 | return $texte; |
| 1216 | 1216 | } |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | return $texte; |
| 1242 | 1242 | } |
| 1243 | 1243 | include_spip('inc/texte'); |
| 1244 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1244 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1245 | 1245 | 'div' : 'span'; |
| 1246 | 1246 | |
| 1247 | 1247 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | |
| 1333 | 1333 | // Calcul de la taille et choix de l'unité |
| 1334 | 1334 | $affichage = _T( |
| 1335 | - 'spip:taille_' . $unites[$puissance] . $suffixe_item, |
|
| 1335 | + 'spip:taille_'.$unites[$puissance].$suffixe_item, |
|
| 1336 | 1336 | [ |
| 1337 | 1337 | 'taille' => round($octets / pow($kilo, $puissance), $precisions[$puissance]) |
| 1338 | 1338 | ] |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | } |
| 1367 | 1367 | $u = $GLOBALS['meta']['pcre_u']; |
| 1368 | 1368 | if ($textebrut) { |
| 1369 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1369 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1370 | 1370 | } |
| 1371 | 1371 | $texte = texte_backend($texte); |
| 1372 | 1372 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | # un message pour abs_url |
| 1402 | 1402 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1403 | 1403 | $url = trim($url); |
| 1404 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1404 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1405 | 1405 | |
| 1406 | 1406 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1407 | 1407 | } |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | |
| 1609 | 1609 | $debut = ''; |
| 1610 | 1610 | $suite = $texte; |
| 1611 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1611 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1612 | 1612 | $debut .= substr($suite, 0, $t - 1); |
| 1613 | 1613 | $suite = substr($suite, $t); |
| 1614 | 1614 | $car = substr($suite, 0, 1); |
@@ -1626,7 +1626,7 @@ discard block |
||
| 1626 | 1626 | $suite = substr($suite, strlen($regs[0])); |
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | - $texte = $debut . $suite; |
|
| 1629 | + $texte = $debut.$suite; |
|
| 1630 | 1630 | |
| 1631 | 1631 | if ($collecteurModeles) { |
| 1632 | 1632 | $texte = $collecteurModeles->retablir($texte); |
@@ -1634,7 +1634,7 @@ discard block |
||
| 1634 | 1634 | |
| 1635 | 1635 | $texte = echappe_retour($texte); |
| 1636 | 1636 | |
| 1637 | - return $texte . $fin; |
|
| 1637 | + return $texte.$fin; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | |
@@ -1910,7 +1910,7 @@ discard block |
||
| 1910 | 1910 | if (is_array($balise)) { |
| 1911 | 1911 | array_walk( |
| 1912 | 1912 | $balise, |
| 1913 | - function (&$a, $key, $t) { |
|
| 1913 | + function(&$a, $key, $t) { |
|
| 1914 | 1914 | $a = extraire_attribut($a, $t); |
| 1915 | 1915 | }, |
| 1916 | 1916 | $attribut |
@@ -2008,14 +2008,14 @@ discard block |
||
| 2008 | 2008 | |
| 2009 | 2009 | if ($old !== null) { |
| 2010 | 2010 | // Remplacer l'ancien attribut du meme nom |
| 2011 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2011 | + $balise = $r[1].$insert.$r[5]; |
|
| 2012 | 2012 | } else { |
| 2013 | 2013 | // preferer une balise " />" (comme <img />) |
| 2014 | 2014 | if (preg_match(',/>,', $balise)) { |
| 2015 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2015 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2016 | 2016 | } // sinon une balise <a ...> ... </a> |
| 2017 | 2017 | else { |
| 2018 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2018 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2019 | 2019 | } |
| 2020 | 2020 | } |
| 2021 | 2021 | |
@@ -2070,7 +2070,7 @@ discard block |
||
| 2070 | 2070 | if ( |
| 2071 | 2071 | $class_courante |
| 2072 | 2072 | and str_contains($class_courante, (string) $c) |
| 2073 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2073 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2074 | 2074 | ) { |
| 2075 | 2075 | $is_class_presente = true; |
| 2076 | 2076 | } |
@@ -2078,12 +2078,12 @@ discard block |
||
| 2078 | 2078 | in_array($operation, ['ajouter', 'commuter']) |
| 2079 | 2079 | and !$is_class_presente |
| 2080 | 2080 | ) { |
| 2081 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2081 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2082 | 2082 | } elseif ( |
| 2083 | 2083 | in_array($operation, ['supprimer', 'commuter']) |
| 2084 | 2084 | and $is_class_presente |
| 2085 | 2085 | ) { |
| 2086 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2086 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2087 | 2087 | } |
| 2088 | 2088 | } |
| 2089 | 2089 | |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | // Quelques fonctions de calcul arithmetique |
| 2147 | 2147 | // |
| 2148 | 2148 | function floatstr($a) { |
| 2149 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2149 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2150 | 2150 | } |
| 2151 | 2151 | function strize($f, $a, $b) { |
| 2152 | 2152 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2287,13 +2287,13 @@ discard block |
||
| 2287 | 2287 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2288 | 2288 | define('_TAGS_NOM_AUTEUR', ''); |
| 2289 | 2289 | } |
| 2290 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2290 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2291 | 2291 | foreach ($tags_acceptes as $tag) { |
| 2292 | 2292 | if (strlen($tag)) { |
| 2293 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2294 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2295 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2296 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2293 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2294 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2295 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2296 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2297 | 2297 | } |
| 2298 | 2298 | } |
| 2299 | 2299 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2413,10 +2413,10 @@ discard block |
||
| 2413 | 2413 | $fichier = basename($url); |
| 2414 | 2414 | |
| 2415 | 2415 | return '<a rel="enclosure"' |
| 2416 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2417 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2418 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2419 | - . '>' . $fichier . '</a>'; |
|
| 2416 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2417 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2418 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2419 | + . '>'.$fichier.'</a>'; |
|
| 2420 | 2420 | } |
| 2421 | 2421 | |
| 2422 | 2422 | /** |
@@ -2444,9 +2444,9 @@ discard block |
||
| 2444 | 2444 | } # vieux data |
| 2445 | 2445 | $fichier = basename($url); |
| 2446 | 2446 | $enclosures[] = '<enclosure' |
| 2447 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2448 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2449 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2447 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2448 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2449 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2450 | 2450 | . ' />'; |
| 2451 | 2451 | } |
| 2452 | 2452 | } |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2473 | 2473 | $subjects .= '<dc:subject>' |
| 2474 | 2474 | . texte_backend(textebrut($e)) |
| 2475 | - . '</dc:subject>' . "\n"; |
|
| 2475 | + . '</dc:subject>'."\n"; |
|
| 2476 | 2476 | } |
| 2477 | 2477 | } |
| 2478 | 2478 | |
@@ -2508,7 +2508,7 @@ discard block |
||
| 2508 | 2508 | if (is_array($texte)) { |
| 2509 | 2509 | array_walk( |
| 2510 | 2510 | $texte, |
| 2511 | - function (&$a, $key, $t) { |
|
| 2511 | + function(&$a, $key, $t) { |
|
| 2512 | 2512 | $a = extraire_balise($a, $t); |
| 2513 | 2513 | }, |
| 2514 | 2514 | $tag |
@@ -2556,7 +2556,7 @@ discard block |
||
| 2556 | 2556 | if (is_array($texte)) { |
| 2557 | 2557 | array_walk( |
| 2558 | 2558 | $texte, |
| 2559 | - function (&$a, $key, $t) { |
|
| 2559 | + function(&$a, $key, $t) { |
|
| 2560 | 2560 | $a = extraire_balises($a, $t); |
| 2561 | 2561 | }, |
| 2562 | 2562 | $tag |
@@ -2689,7 +2689,7 @@ discard block |
||
| 2689 | 2689 | if ($fond != '404') { |
| 2690 | 2690 | $contexte = array_shift($p); |
| 2691 | 2691 | $contexte['page'] = $fond; |
| 2692 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2692 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2693 | 2693 | } |
| 2694 | 2694 | } |
| 2695 | 2695 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2744,9 +2744,9 @@ discard block |
||
| 2744 | 2744 | . '"' |
| 2745 | 2745 | . (is_null($val) |
| 2746 | 2746 | ? '' |
| 2747 | - : ' value="' . entites_html($val) . '"' |
|
| 2747 | + : ' value="'.entites_html($val).'"' |
|
| 2748 | 2748 | ) |
| 2749 | - . ' type="hidden"' . "\n/>"; |
|
| 2749 | + . ' type="hidden"'."\n/>"; |
|
| 2750 | 2750 | } |
| 2751 | 2751 | |
| 2752 | 2752 | return join('', $hidden); |
@@ -2856,7 +2856,7 @@ discard block |
||
| 2856 | 2856 | |
| 2857 | 2857 | return preg_replace_callback( |
| 2858 | 2858 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2859 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2859 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2860 | 2860 | $contenu |
| 2861 | 2861 | ); |
| 2862 | 2862 | } |
@@ -2917,14 +2917,14 @@ discard block |
||
| 2917 | 2917 | ) { |
| 2918 | 2918 | $distant = true; |
| 2919 | 2919 | $cssf = parse_url($css); |
| 2920 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2920 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2921 | 2921 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2922 | 2922 | } else { |
| 2923 | 2923 | $distant = false; |
| 2924 | 2924 | $cssf = $css; |
| 2925 | 2925 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2926 | 2926 | //propose (rien a faire dans ce cas) |
| 2927 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2927 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2928 | 2928 | if (@file_exists($f)) { |
| 2929 | 2929 | return $f; |
| 2930 | 2930 | } |
@@ -2934,7 +2934,7 @@ discard block |
||
| 2934 | 2934 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2935 | 2935 | $f = $dir_var |
| 2936 | 2936 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2937 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2937 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2938 | 2938 | |
| 2939 | 2939 | // la css peut etre distante (url absolue !) |
| 2940 | 2940 | if ($distant) { |
@@ -2980,8 +2980,8 @@ discard block |
||
| 2980 | 2980 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2981 | 2981 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2982 | 2982 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2983 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2984 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2983 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 2984 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 2985 | 2985 | } |
| 2986 | 2986 | $src[] = $regs[0][$k]; |
| 2987 | 2987 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3030,7 +3030,7 @@ discard block |
||
| 3030 | 3030 | |
| 3031 | 3031 | $f = basename($css, '.css'); |
| 3032 | 3032 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3033 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3033 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3034 | 3034 | . '.css'; |
| 3035 | 3035 | |
| 3036 | 3036 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3040,7 +3040,7 @@ discard block |
||
| 3040 | 3040 | if ($url_absolue_css == $css) { |
| 3041 | 3041 | if ( |
| 3042 | 3042 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3043 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3043 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3044 | 3044 | ) { |
| 3045 | 3045 | include_spip('inc/distant'); |
| 3046 | 3046 | $contenu = recuperer_url($css); |
@@ -3152,7 +3152,7 @@ discard block |
||
| 3152 | 3152 | $expression = str_replace('\/', '/', $expression); |
| 3153 | 3153 | $expression = str_replace('/', '\/', $expression); |
| 3154 | 3154 | |
| 3155 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3155 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3156 | 3156 | if (isset($r[$capte])) { |
| 3157 | 3157 | return $r[$capte]; |
| 3158 | 3158 | } else { |
@@ -3190,7 +3190,7 @@ discard block |
||
| 3190 | 3190 | $expression = str_replace('\/', '/', $expression); |
| 3191 | 3191 | $expression = str_replace('/', '\/', $expression); |
| 3192 | 3192 | |
| 3193 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3193 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3194 | 3194 | } |
| 3195 | 3195 | |
| 3196 | 3196 | |
@@ -3209,7 +3209,7 @@ discard block |
||
| 3209 | 3209 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3210 | 3210 | |
| 3211 | 3211 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3212 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3212 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3213 | 3213 | |
| 3214 | 3214 | if ( |
| 3215 | 3215 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3223,7 +3223,7 @@ discard block |
||
| 3223 | 3223 | if (!isset($doublons['documents'])) { |
| 3224 | 3224 | $doublons['documents'] = ''; |
| 3225 | 3225 | } |
| 3226 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3226 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3227 | 3227 | } |
| 3228 | 3228 | |
| 3229 | 3229 | return $letexte; |
@@ -3280,7 +3280,7 @@ discard block |
||
| 3280 | 3280 | if ($env) { |
| 3281 | 3281 | foreach ($env as $i => $j) { |
| 3282 | 3282 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3283 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3283 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3284 | 3284 | } |
| 3285 | 3285 | } |
| 3286 | 3286 | } |
@@ -3319,7 +3319,7 @@ discard block |
||
| 3319 | 3319 | if ($env) { |
| 3320 | 3320 | foreach ($env as $i => $j) { |
| 3321 | 3321 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3322 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3322 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3323 | 3323 | } |
| 3324 | 3324 | } |
| 3325 | 3325 | } |
@@ -3393,10 +3393,10 @@ discard block |
||
| 3393 | 3393 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3394 | 3394 | if ( |
| 3395 | 3395 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3396 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3396 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3397 | 3397 | and file_exists($variante_svg_generique) |
| 3398 | 3398 | ) { |
| 3399 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3399 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3400 | 3400 | $img_file = $variante_svg_size; |
| 3401 | 3401 | } |
| 3402 | 3402 | else { |
@@ -3454,7 +3454,7 @@ discard block |
||
| 3454 | 3454 | return ''; |
| 3455 | 3455 | } |
| 3456 | 3456 | } |
| 3457 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3457 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3458 | 3458 | } |
| 3459 | 3459 | |
| 3460 | 3460 | if (file_exists($img_file)) { |
@@ -3464,14 +3464,14 @@ discard block |
||
| 3464 | 3464 | $alt = ''; |
| 3465 | 3465 | } |
| 3466 | 3466 | elseif ($alt or $alt === '') { |
| 3467 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3467 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3468 | 3468 | } |
| 3469 | 3469 | else { |
| 3470 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3470 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3471 | 3471 | } |
| 3472 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3473 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3474 | - . ' ' . ltrim($atts) |
|
| 3472 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3473 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3474 | + . ' '.ltrim($atts) |
|
| 3475 | 3475 | . ' />'; |
| 3476 | 3476 | } |
| 3477 | 3477 | |
@@ -3485,10 +3485,10 @@ discard block |
||
| 3485 | 3485 | */ |
| 3486 | 3486 | function http_style_background($img, $att = '', $size = null) { |
| 3487 | 3487 | if ($size and is_numeric($size)) { |
| 3488 | - $size = trim($size) . 'px'; |
|
| 3488 | + $size = trim($size).'px'; |
|
| 3489 | 3489 | } |
| 3490 | - return " style='background" . |
|
| 3491 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3490 | + return " style='background". |
|
| 3491 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3492 | 3492 | . ($size ? "background-size:{$size};" : '') |
| 3493 | 3493 | . "'"; |
| 3494 | 3494 | } |
@@ -3603,7 +3603,7 @@ discard block |
||
| 3603 | 3603 | $img = http_img_pack( |
| 3604 | 3604 | $img, |
| 3605 | 3605 | $alt, |
| 3606 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3606 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3607 | 3607 | '', |
| 3608 | 3608 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3609 | 3609 | ); |
@@ -3688,7 +3688,7 @@ discard block |
||
| 3688 | 3688 | $balise_svg_source = $balise_svg; |
| 3689 | 3689 | |
| 3690 | 3690 | // entete XML à supprimer |
| 3691 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3691 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3692 | 3692 | |
| 3693 | 3693 | // IE est toujours mon ami |
| 3694 | 3694 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3706,9 +3706,9 @@ discard block |
||
| 3706 | 3706 | // regler le alt |
| 3707 | 3707 | if ($alt) { |
| 3708 | 3708 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3709 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3709 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3710 | 3710 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3711 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3711 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3712 | 3712 | $balise_svg .= $title; |
| 3713 | 3713 | } |
| 3714 | 3714 | else { |
@@ -3756,7 +3756,7 @@ discard block |
||
| 3756 | 3756 | if (is_array($tableau)) { |
| 3757 | 3757 | foreach ($tableau as $k => $v) { |
| 3758 | 3758 | $res = recuperer_fond( |
| 3759 | - 'modeles/' . $modele, |
|
| 3759 | + 'modeles/'.$modele, |
|
| 3760 | 3760 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3761 | 3761 | ); |
| 3762 | 3762 | $texte .= $res; |
@@ -3941,7 +3941,7 @@ discard block |
||
| 3941 | 3941 | } |
| 3942 | 3942 | |
| 3943 | 3943 | $c = serialize($c); |
| 3944 | - $cle = calculer_cle_action($form . $c); |
|
| 3944 | + $cle = calculer_cle_action($form.$c); |
|
| 3945 | 3945 | $c = "$cle:$c"; |
| 3946 | 3946 | |
| 3947 | 3947 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3999,15 +3999,15 @@ discard block |
||
| 3999 | 3999 | } |
| 4000 | 4000 | // toujours encoder l'url source dans le bloc ajax |
| 4001 | 4001 | $r = self(); |
| 4002 | - $r = ' data-origin="' . $r . '"'; |
|
| 4002 | + $r = ' data-origin="'.$r.'"'; |
|
| 4003 | 4003 | $class = 'ajaxbloc'; |
| 4004 | 4004 | if ($ajaxid and is_string($ajaxid)) { |
| 4005 | 4005 | // ajaxid est normalement conforme a un nom de classe css |
| 4006 | 4006 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4007 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4007 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4008 | 4008 | } |
| 4009 | 4009 | |
| 4010 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4010 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4011 | 4011 | } |
| 4012 | 4012 | |
| 4013 | 4013 | /** |
@@ -4051,7 +4051,7 @@ discard block |
||
| 4051 | 4051 | $cle = substr($c, 0, $p); |
| 4052 | 4052 | $c = substr($c, $p + 1); |
| 4053 | 4053 | |
| 4054 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4054 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4055 | 4055 | $env = @unserialize($c); |
| 4056 | 4056 | return $env; |
| 4057 | 4057 | } |
@@ -4172,13 +4172,13 @@ discard block |
||
| 4172 | 4172 | } |
| 4173 | 4173 | } |
| 4174 | 4174 | } |
| 4175 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4175 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4176 | 4176 | } else { |
| 4177 | 4177 | $bal = 'a'; |
| 4178 | 4178 | $att = "href='$url'" |
| 4179 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4180 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4181 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4179 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4180 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4181 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4182 | 4182 | . $evt; |
| 4183 | 4183 | } |
| 4184 | 4184 | if ($libelle === null) { |
@@ -4317,7 +4317,7 @@ discard block |
||
| 4317 | 4317 | |
| 4318 | 4318 | // Icône |
| 4319 | 4319 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4320 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4320 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4321 | 4321 | |
| 4322 | 4322 | // Markup final |
| 4323 | 4323 | if ($type == 'lien') { |
@@ -4592,20 +4592,20 @@ discard block |
||
| 4592 | 4592 | $class_form = 'ajax'; |
| 4593 | 4593 | $class = str_replace('ajax', '', $class); |
| 4594 | 4594 | } |
| 4595 | - $class_btn = 'submit ' . trim($class); |
|
| 4595 | + $class_btn = 'submit '.trim($class); |
|
| 4596 | 4596 | |
| 4597 | 4597 | if ($confirm) { |
| 4598 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4598 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4599 | 4599 | if ($callback) { |
| 4600 | 4600 | $callback = "$confirm?($callback):false"; |
| 4601 | 4601 | } else { |
| 4602 | 4602 | $callback = $confirm; |
| 4603 | 4603 | } |
| 4604 | 4604 | } |
| 4605 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4605 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4606 | 4606 | $title = $title ? " title='$title'" : ''; |
| 4607 | 4607 | |
| 4608 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4608 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4609 | 4609 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4610 | 4610 | } |
| 4611 | 4611 | |
@@ -4670,14 +4670,14 @@ discard block |
||
| 4670 | 4670 | $champ_titre = ''; |
| 4671 | 4671 | if ($demande_titre) { |
| 4672 | 4672 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4673 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4673 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4674 | 4674 | } |
| 4675 | 4675 | include_spip('base/abstract_sql'); |
| 4676 | 4676 | include_spip('base/connect_sql'); |
| 4677 | 4677 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4678 | - '*' . $champ_titre, |
|
| 4678 | + '*'.$champ_titre, |
|
| 4679 | 4679 | $desc['table_sql'], |
| 4680 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4680 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4681 | 4681 | ); |
| 4682 | 4682 | |
| 4683 | 4683 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4770,8 +4770,7 @@ discard block |
||
| 4770 | 4770 | if (isset($ligne_sql['chapo'])) { |
| 4771 | 4771 | $chapo = $ligne_sql['chapo']; |
| 4772 | 4772 | $texte = strlen($descriptif) ? |
| 4773 | - '' : |
|
| 4774 | - "$chapo \n\n $texte"; |
|
| 4773 | + '' : "$chapo \n\n $texte"; |
|
| 4775 | 4774 | } |
| 4776 | 4775 | |
| 4777 | 4776 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4846,7 +4845,7 @@ discard block |
||
| 4846 | 4845 | return $texte; |
| 4847 | 4846 | } |
| 4848 | 4847 | |
| 4849 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4848 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4850 | 4849 | |
| 4851 | 4850 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4852 | 4851 | if (test_espace_prive()) { |
@@ -4885,7 +4884,7 @@ discard block |
||
| 4885 | 4884 | } |
| 4886 | 4885 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4887 | 4886 | |
| 4888 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4887 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4889 | 4888 | } |
| 4890 | 4889 | |
| 4891 | 4890 | /** |
@@ -4911,10 +4910,10 @@ discard block |
||
| 4911 | 4910 | function wrap($texte, $wrap) { |
| 4912 | 4911 | $balises = extraire_balises($wrap); |
| 4913 | 4912 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4914 | - $texte = $wrap . $texte; |
|
| 4913 | + $texte = $wrap.$texte; |
|
| 4915 | 4914 | $regs = array_reverse($regs[1]); |
| 4916 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4917 | - $texte = $texte . $wrap; |
|
| 4915 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4916 | + $texte = $texte.$wrap; |
|
| 4918 | 4917 | } |
| 4919 | 4918 | |
| 4920 | 4919 | return $texte; |
@@ -4945,7 +4944,7 @@ discard block |
||
| 4945 | 4944 | |
| 4946 | 4945 | // caster $u en array si besoin |
| 4947 | 4946 | if (is_object($u)) { |
| 4948 | - $u = (array)$u; |
|
| 4947 | + $u = (array) $u; |
|
| 4949 | 4948 | } |
| 4950 | 4949 | |
| 4951 | 4950 | if (is_array($u)) { |
@@ -4967,7 +4966,7 @@ discard block |
||
| 4967 | 4966 | // sinon on passe a la ligne et on indente |
| 4968 | 4967 | $i_str = str_pad('', $indent, ' '); |
| 4969 | 4968 | foreach ($u as $k => $v) { |
| 4970 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4969 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4971 | 4970 | } |
| 4972 | 4971 | |
| 4973 | 4972 | return $out; |
@@ -5021,7 +5020,7 @@ discard block |
||
| 5021 | 5020 | * @return string |
| 5022 | 5021 | */ |
| 5023 | 5022 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5024 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5023 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5025 | 5024 | $icone = chemin_image($icone); |
| 5026 | 5025 | $balise_img = charger_filtre('balise_img'); |
| 5027 | 5026 | |
@@ -5047,7 +5046,7 @@ discard block |
||
| 5047 | 5046 | */ |
| 5048 | 5047 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5049 | 5048 | $chaine = explode(':', $chaine); |
| 5050 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5049 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5051 | 5050 | return $t; |
| 5052 | 5051 | } |
| 5053 | 5052 | $chaine = implode(':', $chaine); |
@@ -5113,7 +5112,7 @@ discard block |
||
| 5113 | 5112 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5114 | 5113 | |
| 5115 | 5114 | // calculer le nom de la css |
| 5116 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5115 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5117 | 5116 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5118 | 5117 | $contexte_implicite = calculer_contexte_implicite(); |
| 5119 | 5118 | |
@@ -5121,14 +5120,14 @@ discard block |
||
| 5121 | 5120 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5122 | 5121 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5123 | 5122 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5124 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5123 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5125 | 5124 | } |
| 5126 | 5125 | else { |
| 5127 | 5126 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5128 | 5127 | ksort($contexte); |
| 5129 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5128 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5130 | 5129 | } |
| 5131 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5130 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5132 | 5131 | |
| 5133 | 5132 | // mettre a jour le fichier si il n'existe pas |
| 5134 | 5133 | // ou trop ancien |
@@ -5136,8 +5135,8 @@ discard block |
||
| 5136 | 5135 | // et recopie sur le fichier cible uniquement si il change |
| 5137 | 5136 | if ( |
| 5138 | 5137 | !file_exists($filename) |
| 5139 | - or !file_exists($filename . '.last') |
|
| 5140 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5138 | + or !file_exists($filename.'.last') |
|
| 5139 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5141 | 5140 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5142 | 5141 | ) { |
| 5143 | 5142 | $contenu = $cache['texte']; |
@@ -5161,10 +5160,10 @@ discard block |
||
| 5161 | 5160 | } |
| 5162 | 5161 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5163 | 5162 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5164 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5163 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5165 | 5164 | } |
| 5166 | 5165 | // et ecrire le fichier si il change |
| 5167 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5166 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5168 | 5167 | } |
| 5169 | 5168 | |
| 5170 | 5169 | return timestamp($filename); |
@@ -5397,7 +5396,7 @@ discard block |
||
| 5397 | 5396 | if ($e > 0 and strlen($mid) > 8) { |
| 5398 | 5397 | $mid = '***...***'; |
| 5399 | 5398 | } |
| 5400 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5399 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5401 | 5400 | } |
| 5402 | 5401 | |
| 5403 | 5402 | |
@@ -5459,7 +5458,7 @@ discard block |
||
| 5459 | 5458 | case 'id': |
| 5460 | 5459 | case 'anchor': |
| 5461 | 5460 | if (preg_match(',^\d,', $texte)) { |
| 5462 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5461 | + $texte = substr($type, 0, 1).$texte; |
|
| 5463 | 5462 | } |
| 5464 | 5463 | } |
| 5465 | 5464 | |
@@ -5469,9 +5468,9 @@ discard block |
||
| 5469 | 5468 | |
| 5470 | 5469 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5471 | 5470 | if (preg_match(',^\d,', $texte)) { |
| 5472 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5471 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5473 | 5472 | } |
| 5474 | - $texte .= $separateur . md5($original); |
|
| 5473 | + $texte .= $separateur.md5($original); |
|
| 5475 | 5474 | $texte = substr($texte, 0, $longueur_mini); |
| 5476 | 5475 | } |
| 5477 | 5476 | |