@@ -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; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // affichage "GIT [master: abcdef]" |
| 235 | 235 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 236 | 236 | if ($desc['branch']) { |
| 237 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 237 | + $commit = $desc['branch'].': '.$commit; |
|
| 238 | 238 | } |
| 239 | 239 | return "{$desc['vcs']} [$commit]"; |
| 240 | 240 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // version installee par GIT |
| 256 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 256 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 257 | 257 | $currentHead = trim(substr($c, 4)); |
| 258 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 258 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 259 | 259 | return [ |
| 260 | 260 | 'vcs' => 'GIT', |
| 261 | 261 | 'branch' => basename($currentHead), |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | $dir = '.'; |
| 283 | 283 | } |
| 284 | 284 | // version installee par SVN |
| 285 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 285 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 287 | 287 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 288 | 288 | if ($result) { |
| 289 | 289 | $row = $result->fetchArray(); |
@@ -301,12 +301,12 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 303 | 303 | // et laisser passer les fonctions personnelles baptisees image_... |
| 304 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 305 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 306 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 307 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 308 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 304 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 305 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 306 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 307 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 308 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | 310 | |
| 311 | 311 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 312 | 312 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function filtre_debug($val, $key = null) { |
| 467 | 467 | $debug = ( |
| 468 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 469 | - ) . var_export($val, true); |
|
| 468 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 469 | + ).var_export($val, true); |
|
| 470 | 470 | |
| 471 | 471 | include_spip('inc/autoriser'); |
| 472 | 472 | if (autoriser('webmestre')) { |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $is_file = false; |
| 523 | 523 | } |
| 524 | 524 | if ($is_file) { |
| 525 | - $is_local_file = function ($path) { |
|
| 525 | + $is_local_file = function($path) { |
|
| 526 | 526 | if (strpos($path, '?') !== false) { |
| 527 | 527 | $path = supprimer_timestamp($path); |
| 528 | 528 | // remove ?24px added by find_in_theme on .svg files |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 572 | 572 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 573 | 573 | $srcover = $match[1]; |
| 574 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 574 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 575 | 575 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 576 | 576 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 577 | 577 | } |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | // " -> " et tout ce genre de choses |
| 974 | 974 | $u = $GLOBALS['meta']['pcre_u']; |
| 975 | 975 | $texte = str_replace(' ', ' ', $texte); |
| 976 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 976 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 977 | 977 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 978 | 978 | $texte = entites_html($texte, false, false); |
| 979 | 979 | // mais bien echapper les double quotes ! |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | return ''; |
| 1036 | 1036 | } |
| 1037 | 1037 | return preg_replace( |
| 1038 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1038 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1039 | 1039 | '', |
| 1040 | 1040 | $texte |
| 1041 | 1041 | ); |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | if ( |
| 1065 | 1065 | $texte and |
| 1066 | 1066 | preg_match( |
| 1067 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1067 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1068 | 1068 | $texte, |
| 1069 | 1069 | $regs |
| 1070 | 1070 | ) |
@@ -1155,8 +1155,8 @@ discard block |
||
| 1155 | 1155 | **/ |
| 1156 | 1156 | function textebrut($texte) { |
| 1157 | 1157 | $u = $GLOBALS['meta']['pcre_u']; |
| 1158 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1159 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1158 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1159 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1160 | 1160 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1161 | 1161 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1162 | 1162 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | ) |
| 1191 | 1191 | ) { |
| 1192 | 1192 | foreach ($liens[0] as $a) { |
| 1193 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1193 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1194 | 1194 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1195 | 1195 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1196 | 1196 | $texte = str_replace($a, $ablank, $texte); |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | foreach ($regs[0] as $a) { |
| 1216 | 1216 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1217 | 1217 | if (strpos($rel, 'nofollow') === false) { |
| 1218 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1218 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1219 | 1219 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1220 | 1220 | $texte = str_replace($a, $anofollow, $texte); |
| 1221 | 1221 | } |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $u = $GLOBALS['meta']['pcre_u']; |
| 1245 | 1245 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1246 | 1246 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1247 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1247 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1248 | 1248 | |
| 1249 | 1249 | return $texte; |
| 1250 | 1250 | } |
@@ -1275,7 +1275,7 @@ discard block |
||
| 1275 | 1275 | return $texte; |
| 1276 | 1276 | } |
| 1277 | 1277 | include_spip('inc/texte'); |
| 1278 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1278 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1279 | 1279 | 'div' : 'span'; |
| 1280 | 1280 | |
| 1281 | 1281 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | } |
| 1388 | 1388 | $u = $GLOBALS['meta']['pcre_u']; |
| 1389 | 1389 | if ($textebrut) { |
| 1390 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1390 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1391 | 1391 | } |
| 1392 | 1392 | $texte = texte_backend($texte); |
| 1393 | 1393 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | # un message pour abs_url |
| 1423 | 1423 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1424 | 1424 | $url = trim($url); |
| 1425 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1425 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1426 | 1426 | |
| 1427 | 1427 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1428 | 1428 | } |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | |
| 1630 | 1630 | $debut = ''; |
| 1631 | 1631 | $suite = $texte; |
| 1632 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1632 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1633 | 1633 | $debut .= substr($suite, 0, $t - 1); |
| 1634 | 1634 | $suite = substr($suite, $t); |
| 1635 | 1635 | $car = substr($suite, 0, 1); |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | $suite = substr($suite, strlen($regs[0])); |
| 1648 | 1648 | } |
| 1649 | 1649 | } |
| 1650 | - $texte = $debut . $suite; |
|
| 1650 | + $texte = $debut.$suite; |
|
| 1651 | 1651 | |
| 1652 | 1652 | if ($collecteurModeles) { |
| 1653 | 1653 | $texte = $collecteurModeles->retablir($texte); |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | |
| 1656 | 1656 | $texte = echappe_retour($texte); |
| 1657 | 1657 | |
| 1658 | - return $texte . $fin; |
|
| 1658 | + return $texte.$fin; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | if (is_array($balise)) { |
| 1932 | 1932 | array_walk( |
| 1933 | 1933 | $balise, |
| 1934 | - function (&$a, $key, $t) { |
|
| 1934 | + function(&$a, $key, $t) { |
|
| 1935 | 1935 | $a = extraire_attribut($a, $t); |
| 1936 | 1936 | }, |
| 1937 | 1937 | $attribut |
@@ -2029,14 +2029,14 @@ discard block |
||
| 2029 | 2029 | |
| 2030 | 2030 | if ($old !== null) { |
| 2031 | 2031 | // Remplacer l'ancien attribut du meme nom |
| 2032 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2032 | + $balise = $r[1].$insert.$r[5]; |
|
| 2033 | 2033 | } else { |
| 2034 | 2034 | // preferer une balise " />" (comme <img />) |
| 2035 | 2035 | if (preg_match(',/>,', $balise)) { |
| 2036 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2036 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2037 | 2037 | } // sinon une balise <a ...> ... </a> |
| 2038 | 2038 | else { |
| 2039 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2039 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2040 | 2040 | } |
| 2041 | 2041 | } |
| 2042 | 2042 | |
@@ -2091,7 +2091,7 @@ discard block |
||
| 2091 | 2091 | if ( |
| 2092 | 2092 | $class_courante |
| 2093 | 2093 | and strpos($class_courante, (string) $c) !== false |
| 2094 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2094 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2095 | 2095 | ) { |
| 2096 | 2096 | $is_class_presente = true; |
| 2097 | 2097 | } |
@@ -2099,12 +2099,12 @@ discard block |
||
| 2099 | 2099 | in_array($operation, ['ajouter', 'commuter']) |
| 2100 | 2100 | and !$is_class_presente |
| 2101 | 2101 | ) { |
| 2102 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2102 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2103 | 2103 | } elseif ( |
| 2104 | 2104 | in_array($operation, ['supprimer', 'commuter']) |
| 2105 | 2105 | and $is_class_presente |
| 2106 | 2106 | ) { |
| 2107 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2107 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2108 | 2108 | } |
| 2109 | 2109 | } |
| 2110 | 2110 | |
@@ -2167,7 +2167,7 @@ discard block |
||
| 2167 | 2167 | // Quelques fonctions de calcul arithmetique |
| 2168 | 2168 | // |
| 2169 | 2169 | function floatstr($a) { |
| 2170 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2170 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2171 | 2171 | } |
| 2172 | 2172 | function strize($f, $a, $b) { |
| 2173 | 2173 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2303,13 +2303,13 @@ discard block |
||
| 2303 | 2303 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2304 | 2304 | define('_TAGS_NOM_AUTEUR', ''); |
| 2305 | 2305 | } |
| 2306 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2306 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2307 | 2307 | foreach ($tags_acceptes as $tag) { |
| 2308 | 2308 | if (strlen($tag)) { |
| 2309 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2310 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2311 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2312 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2309 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2310 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2311 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2312 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2313 | 2313 | } |
| 2314 | 2314 | } |
| 2315 | 2315 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2429,10 +2429,10 @@ discard block |
||
| 2429 | 2429 | $fichier = basename($url); |
| 2430 | 2430 | |
| 2431 | 2431 | return '<a rel="enclosure"' |
| 2432 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2433 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2434 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2435 | - . '>' . $fichier . '</a>'; |
|
| 2432 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2433 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2434 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2435 | + . '>'.$fichier.'</a>'; |
|
| 2436 | 2436 | } |
| 2437 | 2437 | |
| 2438 | 2438 | /** |
@@ -2460,9 +2460,9 @@ discard block |
||
| 2460 | 2460 | } # vieux data |
| 2461 | 2461 | $fichier = basename($url); |
| 2462 | 2462 | $enclosures[] = '<enclosure' |
| 2463 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2464 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2465 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2463 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2464 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2465 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2466 | 2466 | . ' />'; |
| 2467 | 2467 | } |
| 2468 | 2468 | } |
@@ -2488,7 +2488,7 @@ discard block |
||
| 2488 | 2488 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2489 | 2489 | $subjects .= '<dc:subject>' |
| 2490 | 2490 | . texte_backend(textebrut($e)) |
| 2491 | - . '</dc:subject>' . "\n"; |
|
| 2491 | + . '</dc:subject>'."\n"; |
|
| 2492 | 2492 | } |
| 2493 | 2493 | } |
| 2494 | 2494 | |
@@ -2524,7 +2524,7 @@ discard block |
||
| 2524 | 2524 | if (is_array($texte)) { |
| 2525 | 2525 | array_walk( |
| 2526 | 2526 | $texte, |
| 2527 | - function (&$a, $key, $t) { |
|
| 2527 | + function(&$a, $key, $t) { |
|
| 2528 | 2528 | $a = extraire_balise($a, $t); |
| 2529 | 2529 | }, |
| 2530 | 2530 | $tag |
@@ -2572,7 +2572,7 @@ discard block |
||
| 2572 | 2572 | if (is_array($texte)) { |
| 2573 | 2573 | array_walk( |
| 2574 | 2574 | $texte, |
| 2575 | - function (&$a, $key, $t) { |
|
| 2575 | + function(&$a, $key, $t) { |
|
| 2576 | 2576 | $a = extraire_balises($a, $t); |
| 2577 | 2577 | }, |
| 2578 | 2578 | $tag |
@@ -2705,7 +2705,7 @@ discard block |
||
| 2705 | 2705 | if ($fond != '404') { |
| 2706 | 2706 | $contexte = array_shift($p); |
| 2707 | 2707 | $contexte['page'] = $fond; |
| 2708 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2708 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2709 | 2709 | } |
| 2710 | 2710 | } |
| 2711 | 2711 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2760,9 +2760,9 @@ discard block |
||
| 2760 | 2760 | . '"' |
| 2761 | 2761 | . (is_null($val) |
| 2762 | 2762 | ? '' |
| 2763 | - : ' value="' . entites_html($val) . '"' |
|
| 2763 | + : ' value="'.entites_html($val).'"' |
|
| 2764 | 2764 | ) |
| 2765 | - . ' type="hidden"' . "\n/>"; |
|
| 2765 | + . ' type="hidden"'."\n/>"; |
|
| 2766 | 2766 | } |
| 2767 | 2767 | |
| 2768 | 2768 | return join('', $hidden); |
@@ -2872,7 +2872,7 @@ discard block |
||
| 2872 | 2872 | |
| 2873 | 2873 | return preg_replace_callback( |
| 2874 | 2874 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2875 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2875 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2876 | 2876 | $contenu |
| 2877 | 2877 | ); |
| 2878 | 2878 | } |
@@ -2933,14 +2933,14 @@ discard block |
||
| 2933 | 2933 | ) { |
| 2934 | 2934 | $distant = true; |
| 2935 | 2935 | $cssf = parse_url($css); |
| 2936 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2936 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2937 | 2937 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2938 | 2938 | } else { |
| 2939 | 2939 | $distant = false; |
| 2940 | 2940 | $cssf = $css; |
| 2941 | 2941 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2942 | 2942 | //propose (rien a faire dans ce cas) |
| 2943 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2943 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2944 | 2944 | if (@file_exists($f)) { |
| 2945 | 2945 | return $f; |
| 2946 | 2946 | } |
@@ -2950,7 +2950,7 @@ discard block |
||
| 2950 | 2950 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2951 | 2951 | $f = $dir_var |
| 2952 | 2952 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2953 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2953 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2954 | 2954 | |
| 2955 | 2955 | // la css peut etre distante (url absolue !) |
| 2956 | 2956 | if ($distant) { |
@@ -2996,8 +2996,8 @@ discard block |
||
| 2996 | 2996 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2997 | 2997 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2998 | 2998 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2999 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3000 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2999 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3000 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3001 | 3001 | } |
| 3002 | 3002 | $src[] = $regs[0][$k]; |
| 3003 | 3003 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3046,7 +3046,7 @@ discard block |
||
| 3046 | 3046 | |
| 3047 | 3047 | $f = basename($css, '.css'); |
| 3048 | 3048 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3049 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3049 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3050 | 3050 | . '.css'; |
| 3051 | 3051 | |
| 3052 | 3052 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3056,7 +3056,7 @@ discard block |
||
| 3056 | 3056 | if ($url_absolue_css == $css) { |
| 3057 | 3057 | if ( |
| 3058 | 3058 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3059 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3059 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3060 | 3060 | ) { |
| 3061 | 3061 | include_spip('inc/distant'); |
| 3062 | 3062 | $contenu = recuperer_url($css); |
@@ -3168,7 +3168,7 @@ discard block |
||
| 3168 | 3168 | $expression = str_replace('\/', '/', $expression); |
| 3169 | 3169 | $expression = str_replace('/', '\/', $expression); |
| 3170 | 3170 | |
| 3171 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3171 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3172 | 3172 | if (isset($r[$capte])) { |
| 3173 | 3173 | return $r[$capte]; |
| 3174 | 3174 | } else { |
@@ -3206,7 +3206,7 @@ discard block |
||
| 3206 | 3206 | $expression = str_replace('\/', '/', $expression); |
| 3207 | 3207 | $expression = str_replace('/', '\/', $expression); |
| 3208 | 3208 | |
| 3209 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3209 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3210 | 3210 | } |
| 3211 | 3211 | |
| 3212 | 3212 | |
@@ -3225,7 +3225,7 @@ discard block |
||
| 3225 | 3225 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3226 | 3226 | |
| 3227 | 3227 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3228 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3228 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3229 | 3229 | |
| 3230 | 3230 | if ( |
| 3231 | 3231 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3239,7 +3239,7 @@ discard block |
||
| 3239 | 3239 | if (!isset($doublons['documents'])) { |
| 3240 | 3240 | $doublons['documents'] = ''; |
| 3241 | 3241 | } |
| 3242 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3242 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3243 | 3243 | } |
| 3244 | 3244 | |
| 3245 | 3245 | return $letexte; |
@@ -3296,7 +3296,7 @@ discard block |
||
| 3296 | 3296 | if ($env) { |
| 3297 | 3297 | foreach ($env as $i => $j) { |
| 3298 | 3298 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3299 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3299 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3300 | 3300 | } |
| 3301 | 3301 | } |
| 3302 | 3302 | } |
@@ -3335,7 +3335,7 @@ discard block |
||
| 3335 | 3335 | if ($env) { |
| 3336 | 3336 | foreach ($env as $i => $j) { |
| 3337 | 3337 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3338 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3338 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3339 | 3339 | } |
| 3340 | 3340 | } |
| 3341 | 3341 | } |
@@ -3409,10 +3409,10 @@ discard block |
||
| 3409 | 3409 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3410 | 3410 | if ( |
| 3411 | 3411 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3412 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3412 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3413 | 3413 | and file_exists($variante_svg_generique) |
| 3414 | 3414 | ) { |
| 3415 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3415 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3416 | 3416 | $img_file = $variante_svg_size; |
| 3417 | 3417 | } |
| 3418 | 3418 | else { |
@@ -3470,7 +3470,7 @@ discard block |
||
| 3470 | 3470 | return ''; |
| 3471 | 3471 | } |
| 3472 | 3472 | } |
| 3473 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3473 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3474 | 3474 | } |
| 3475 | 3475 | |
| 3476 | 3476 | if (file_exists($img_file)) { |
@@ -3480,14 +3480,14 @@ discard block |
||
| 3480 | 3480 | $alt = ''; |
| 3481 | 3481 | } |
| 3482 | 3482 | elseif ($alt or $alt === '') { |
| 3483 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3483 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3484 | 3484 | } |
| 3485 | 3485 | else { |
| 3486 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3486 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3487 | 3487 | } |
| 3488 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3489 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3490 | - . ' ' . ltrim($atts) |
|
| 3488 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3489 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3490 | + . ' '.ltrim($atts) |
|
| 3491 | 3491 | . ' />'; |
| 3492 | 3492 | } |
| 3493 | 3493 | |
@@ -3501,10 +3501,10 @@ discard block |
||
| 3501 | 3501 | */ |
| 3502 | 3502 | function http_style_background($img, $att = '', $size = null) { |
| 3503 | 3503 | if ($size and is_numeric($size)) { |
| 3504 | - $size = trim($size) . 'px'; |
|
| 3504 | + $size = trim($size).'px'; |
|
| 3505 | 3505 | } |
| 3506 | - return " style='background" . |
|
| 3507 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3506 | + return " style='background". |
|
| 3507 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3508 | 3508 | . ($size ? "background-size:{$size};" : '') |
| 3509 | 3509 | . "'"; |
| 3510 | 3510 | } |
@@ -3619,7 +3619,7 @@ discard block |
||
| 3619 | 3619 | $img = http_img_pack( |
| 3620 | 3620 | $img, |
| 3621 | 3621 | $alt, |
| 3622 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3622 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3623 | 3623 | '', |
| 3624 | 3624 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3625 | 3625 | ); |
@@ -3704,7 +3704,7 @@ discard block |
||
| 3704 | 3704 | $balise_svg_source = $balise_svg; |
| 3705 | 3705 | |
| 3706 | 3706 | // entete XML à supprimer |
| 3707 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3707 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3708 | 3708 | |
| 3709 | 3709 | // IE est toujours mon ami |
| 3710 | 3710 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3722,9 +3722,9 @@ discard block |
||
| 3722 | 3722 | // regler le alt |
| 3723 | 3723 | if ($alt) { |
| 3724 | 3724 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3725 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3725 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3726 | 3726 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3727 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3727 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3728 | 3728 | $balise_svg .= $title; |
| 3729 | 3729 | } |
| 3730 | 3730 | else { |
@@ -3772,7 +3772,7 @@ discard block |
||
| 3772 | 3772 | if (is_array($tableau)) { |
| 3773 | 3773 | foreach ($tableau as $k => $v) { |
| 3774 | 3774 | $res = recuperer_fond( |
| 3775 | - 'modeles/' . $modele, |
|
| 3775 | + 'modeles/'.$modele, |
|
| 3776 | 3776 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3777 | 3777 | ); |
| 3778 | 3778 | $texte .= $res; |
@@ -3957,7 +3957,7 @@ discard block |
||
| 3957 | 3957 | } |
| 3958 | 3958 | |
| 3959 | 3959 | $c = serialize($c); |
| 3960 | - $cle = calculer_cle_action($form . $c); |
|
| 3960 | + $cle = calculer_cle_action($form.$c); |
|
| 3961 | 3961 | $c = "$cle:$c"; |
| 3962 | 3962 | |
| 3963 | 3963 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4015,15 +4015,15 @@ discard block |
||
| 4015 | 4015 | } |
| 4016 | 4016 | // toujours encoder l'url source dans le bloc ajax |
| 4017 | 4017 | $r = self(); |
| 4018 | - $r = ' data-origin="' . $r . '"'; |
|
| 4018 | + $r = ' data-origin="'.$r.'"'; |
|
| 4019 | 4019 | $class = 'ajaxbloc'; |
| 4020 | 4020 | if ($ajaxid and is_string($ajaxid)) { |
| 4021 | 4021 | // ajaxid est normalement conforme a un nom de classe css |
| 4022 | 4022 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4023 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4023 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4024 | 4024 | } |
| 4025 | 4025 | |
| 4026 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4026 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4027 | 4027 | } |
| 4028 | 4028 | |
| 4029 | 4029 | /** |
@@ -4067,7 +4067,7 @@ discard block |
||
| 4067 | 4067 | $cle = substr($c, 0, $p); |
| 4068 | 4068 | $c = substr($c, $p + 1); |
| 4069 | 4069 | |
| 4070 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4070 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4071 | 4071 | $env = @unserialize($c); |
| 4072 | 4072 | return $env; |
| 4073 | 4073 | } |
@@ -4188,13 +4188,13 @@ discard block |
||
| 4188 | 4188 | } |
| 4189 | 4189 | } |
| 4190 | 4190 | } |
| 4191 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4191 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4192 | 4192 | } else { |
| 4193 | 4193 | $bal = 'a'; |
| 4194 | 4194 | $att = "href='$url'" |
| 4195 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4196 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4197 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4195 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4196 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4197 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4198 | 4198 | . $evt; |
| 4199 | 4199 | } |
| 4200 | 4200 | if ($libelle === null) { |
@@ -4333,7 +4333,7 @@ discard block |
||
| 4333 | 4333 | |
| 4334 | 4334 | // Icône |
| 4335 | 4335 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4336 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4336 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4337 | 4337 | |
| 4338 | 4338 | // Markup final |
| 4339 | 4339 | if ($type == 'lien') { |
@@ -4608,20 +4608,20 @@ discard block |
||
| 4608 | 4608 | $class_form = 'ajax'; |
| 4609 | 4609 | $class = str_replace('ajax', '', $class); |
| 4610 | 4610 | } |
| 4611 | - $class_btn = 'submit ' . trim($class); |
|
| 4611 | + $class_btn = 'submit '.trim($class); |
|
| 4612 | 4612 | |
| 4613 | 4613 | if ($confirm) { |
| 4614 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4614 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4615 | 4615 | if ($callback) { |
| 4616 | 4616 | $callback = "$confirm?($callback):false"; |
| 4617 | 4617 | } else { |
| 4618 | 4618 | $callback = $confirm; |
| 4619 | 4619 | } |
| 4620 | 4620 | } |
| 4621 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4621 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4622 | 4622 | $title = $title ? " title='$title'" : ''; |
| 4623 | 4623 | |
| 4624 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4624 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4625 | 4625 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4626 | 4626 | } |
| 4627 | 4627 | |
@@ -4686,14 +4686,14 @@ discard block |
||
| 4686 | 4686 | $champ_titre = ''; |
| 4687 | 4687 | if ($demande_titre) { |
| 4688 | 4688 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4689 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4689 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4690 | 4690 | } |
| 4691 | 4691 | include_spip('base/abstract_sql'); |
| 4692 | 4692 | include_spip('base/connect_sql'); |
| 4693 | 4693 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4694 | - '*' . $champ_titre, |
|
| 4694 | + '*'.$champ_titre, |
|
| 4695 | 4695 | $desc['table_sql'], |
| 4696 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4696 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4697 | 4697 | ); |
| 4698 | 4698 | |
| 4699 | 4699 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4786,8 +4786,7 @@ discard block |
||
| 4786 | 4786 | if (isset($ligne_sql['chapo'])) { |
| 4787 | 4787 | $chapo = $ligne_sql['chapo']; |
| 4788 | 4788 | $texte = strlen($descriptif) ? |
| 4789 | - '' : |
|
| 4790 | - "$chapo \n\n $texte"; |
|
| 4789 | + '' : "$chapo \n\n $texte"; |
|
| 4791 | 4790 | } |
| 4792 | 4791 | |
| 4793 | 4792 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4862,7 +4861,7 @@ discard block |
||
| 4862 | 4861 | return $texte; |
| 4863 | 4862 | } |
| 4864 | 4863 | |
| 4865 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4864 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4866 | 4865 | |
| 4867 | 4866 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4868 | 4867 | if (test_espace_prive()) { |
@@ -4901,7 +4900,7 @@ discard block |
||
| 4901 | 4900 | } |
| 4902 | 4901 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4903 | 4902 | |
| 4904 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4903 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4905 | 4904 | } |
| 4906 | 4905 | |
| 4907 | 4906 | /** |
@@ -4927,10 +4926,10 @@ discard block |
||
| 4927 | 4926 | function wrap($texte, $wrap) { |
| 4928 | 4927 | $balises = extraire_balises($wrap); |
| 4929 | 4928 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4930 | - $texte = $wrap . $texte; |
|
| 4929 | + $texte = $wrap.$texte; |
|
| 4931 | 4930 | $regs = array_reverse($regs[1]); |
| 4932 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4933 | - $texte = $texte . $wrap; |
|
| 4931 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4932 | + $texte = $texte.$wrap; |
|
| 4934 | 4933 | } |
| 4935 | 4934 | |
| 4936 | 4935 | return $texte; |
@@ -4961,7 +4960,7 @@ discard block |
||
| 4961 | 4960 | |
| 4962 | 4961 | // caster $u en array si besoin |
| 4963 | 4962 | if (is_object($u)) { |
| 4964 | - $u = (array)$u; |
|
| 4963 | + $u = (array) $u; |
|
| 4965 | 4964 | } |
| 4966 | 4965 | |
| 4967 | 4966 | if (is_array($u)) { |
@@ -4983,7 +4982,7 @@ discard block |
||
| 4983 | 4982 | // sinon on passe a la ligne et on indente |
| 4984 | 4983 | $i_str = str_pad('', $indent, ' '); |
| 4985 | 4984 | foreach ($u as $k => $v) { |
| 4986 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4985 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4987 | 4986 | } |
| 4988 | 4987 | |
| 4989 | 4988 | return $out; |
@@ -5037,7 +5036,7 @@ discard block |
||
| 5037 | 5036 | * @return string |
| 5038 | 5037 | */ |
| 5039 | 5038 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5040 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5039 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5041 | 5040 | $icone = chemin_image($icone); |
| 5042 | 5041 | $balise_img = charger_filtre('balise_img'); |
| 5043 | 5042 | |
@@ -5063,7 +5062,7 @@ discard block |
||
| 5063 | 5062 | */ |
| 5064 | 5063 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5065 | 5064 | $chaine = explode(':', $chaine); |
| 5066 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5065 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5067 | 5066 | return $t; |
| 5068 | 5067 | } |
| 5069 | 5068 | $chaine = implode(':', $chaine); |
@@ -5129,7 +5128,7 @@ discard block |
||
| 5129 | 5128 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5130 | 5129 | |
| 5131 | 5130 | // calculer le nom de la css |
| 5132 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5131 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5133 | 5132 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5134 | 5133 | $contexte_implicite = calculer_contexte_implicite(); |
| 5135 | 5134 | |
@@ -5137,14 +5136,14 @@ discard block |
||
| 5137 | 5136 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5138 | 5137 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5139 | 5138 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5140 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5139 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5141 | 5140 | } |
| 5142 | 5141 | else { |
| 5143 | 5142 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5144 | 5143 | ksort($contexte); |
| 5145 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5144 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5146 | 5145 | } |
| 5147 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5146 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5148 | 5147 | |
| 5149 | 5148 | // mettre a jour le fichier si il n'existe pas |
| 5150 | 5149 | // ou trop ancien |
@@ -5152,8 +5151,8 @@ discard block |
||
| 5152 | 5151 | // et recopie sur le fichier cible uniquement si il change |
| 5153 | 5152 | if ( |
| 5154 | 5153 | !file_exists($filename) |
| 5155 | - or !file_exists($filename . '.last') |
|
| 5156 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5154 | + or !file_exists($filename.'.last') |
|
| 5155 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5157 | 5156 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5158 | 5157 | ) { |
| 5159 | 5158 | $contenu = $cache['texte']; |
@@ -5177,10 +5176,10 @@ discard block |
||
| 5177 | 5176 | } |
| 5178 | 5177 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5179 | 5178 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5180 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5179 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5181 | 5180 | } |
| 5182 | 5181 | // et ecrire le fichier si il change |
| 5183 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5182 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5184 | 5183 | } |
| 5185 | 5184 | |
| 5186 | 5185 | return timestamp($filename); |
@@ -5413,7 +5412,7 @@ discard block |
||
| 5413 | 5412 | if ($e > 0 and strlen($mid) > 8) { |
| 5414 | 5413 | $mid = '***...***'; |
| 5415 | 5414 | } |
| 5416 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5415 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5417 | 5416 | } |
| 5418 | 5417 | |
| 5419 | 5418 | |
@@ -5475,7 +5474,7 @@ discard block |
||
| 5475 | 5474 | case 'id': |
| 5476 | 5475 | case 'anchor': |
| 5477 | 5476 | if (preg_match(',^\d,', $texte)) { |
| 5478 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5477 | + $texte = substr($type, 0, 1).$texte; |
|
| 5479 | 5478 | } |
| 5480 | 5479 | } |
| 5481 | 5480 | |
@@ -5485,9 +5484,9 @@ discard block |
||
| 5485 | 5484 | |
| 5486 | 5485 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5487 | 5486 | if (preg_match(',^\d,', $texte)) { |
| 5488 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5487 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5489 | 5488 | } |
| 5490 | - $texte .= $separateur . md5($original); |
|
| 5489 | + $texte .= $separateur.md5($original); |
|
| 5491 | 5490 | $texte = substr($texte, 0, $longueur_mini); |
| 5492 | 5491 | } |
| 5493 | 5492 | |