@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | // celle du texte) et public (spip_lang est la langue du texte) |
| 45 | 45 | $dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']); |
| 46 | 46 | |
| 47 | - $p = 'puce' . (test_espace_prive() ? '_prive' : ''); |
|
| 47 | + $p = 'puce'.(test_espace_prive() ? '_prive' : ''); |
|
| 48 | 48 | if ($dir == 'rtl') { |
| 49 | 49 | $p .= '_rtl'; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (!isset($GLOBALS[$p])) { |
| 53 | - $GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>'; |
|
| 53 | + $GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $GLOBALS[$p]; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (!defined('_BALISES_BLOCS_REGEXP')) { |
| 71 | - define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS'); |
|
| 71 | + define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Tester si on echappe en span ou en div |
| 87 | 87 | if (is_null($mode) or !in_array($mode, ['div', 'span'])) { |
| 88 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 88 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Decouper en morceaux, base64 a des probleme selon la taille de la pile |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ) { |
| 121 | 121 | foreach ($matches as $m) { |
| 122 | 122 | if ($m[1] === 'code') { |
| 123 | - $code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>'; |
|
| 123 | + $code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>'; |
|
| 124 | 124 | $pre = str_replace($m[0], $code, $pre); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // Echapper les <code>...</ code> |
| 132 | 132 | function traiter_echap_code_dist($regs, $options = []) { |
| 133 | - [, , $att, $corps] = $regs; |
|
| 133 | + [,, $att, $corps] = $regs; |
|
| 134 | 134 | $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! |
| 135 | 135 | |
| 136 | 136 | // ne pas mettre le <div...> s'il n'y a qu'une ligne |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | $echap = nl2br($echap); |
| 142 | 142 | $echap = "<div style='text-align: left;' " |
| 143 | 143 | . "class='spip_code' dir='ltr'><code$att>" |
| 144 | - . $echap . '</code></div>'; |
|
| 144 | + . $echap.'</code></div>'; |
|
| 145 | 145 | } else { |
| 146 | - $echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>'; |
|
| 146 | + $echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $echap = str_replace("\t", ' ', $echap); |
@@ -220,11 +220,11 @@ discard block |
||
| 220 | 220 | else { |
| 221 | 221 | $callback_secure_prefix = ($callback_options['secure_prefix'] ?? ''); |
| 222 | 222 | if ( |
| 223 | - function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 224 | - or function_exists($f = $f . '_dist') |
|
| 223 | + function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 224 | + or function_exists($f = $f.'_dist') |
|
| 225 | 225 | or ($callback_secure_prefix and ( |
| 226 | - function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 227 | - or function_exists($f = $f . '_dist') |
|
| 226 | + function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 227 | + or function_exists($f = $f.'_dist') |
|
| 228 | 228 | )) |
| 229 | 229 | ) { |
| 230 | 230 | $echap = $f($regs, $callback_options); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | // dans une callback autonommee |
| 247 | 247 | if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) { |
| 248 | 248 | if ( |
| 249 | - strpos($letexte, '<' . '?') !== false and preg_match_all( |
|
| 249 | + strpos($letexte, '<'.'?') !== false and preg_match_all( |
|
| 250 | 250 | ',<[?].*($|[?]>),UisS', |
| 251 | 251 | $letexte, |
| 252 | 252 | $matches, |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | strpos($letexte, '<') !== false |
| 279 | 279 | and |
| 280 | 280 | preg_match_all( |
| 281 | - ',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 281 | + ',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 282 | 282 | $letexte, |
| 283 | 283 | $regs, |
| 284 | 284 | PREG_SET_ORDER |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | if ($at) { |
| 298 | - $rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>'; |
|
| 298 | + $rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>'; |
|
| 299 | 299 | foreach ($at as $attr => $a) { |
| 300 | 300 | $rempl = inserer_attribut($rempl, $attr, $a); |
| 301 | 301 | } |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | $texte = nettoyer_raccourcis_typo($texte); |
| 377 | 377 | |
| 378 | 378 | // balises de sauts de ligne et paragraphe |
| 379 | - $texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte); |
|
| 380 | - $texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte); |
|
| 379 | + $texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte); |
|
| 380 | + $texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte); |
|
| 381 | 381 | |
| 382 | 382 | // on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier |
| 383 | 383 | $texte = str_replace("\n\n", "\r", $texte); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | // supprimer les tags |
| 386 | 386 | $texte = supprimer_tags($texte); |
| 387 | 387 | $texte = trim(str_replace("\n", ' ', $texte)); |
| 388 | - $texte .= "\n"; // marquer la fin |
|
| 388 | + $texte .= "\n"; // marquer la fin |
|
| 389 | 389 | |
| 390 | 390 | // corriger la longueur de coupe |
| 391 | 391 | // en fonction de la presence de caracteres utf |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // couper au mot precedent |
| 401 | 401 | $long = spip_substr($texte, 0, max($taille - 4, 1)); |
| 402 | 402 | $u = $GLOBALS['meta']['pcre_u']; |
| 403 | - $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 403 | + $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 404 | 404 | if (is_null($suite)) { |
| 405 | 405 | $suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : ' (...)'); |
| 406 | 406 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | if (spip_strlen($court) < max(0.75 * $taille, 2)) { |
| 411 | 411 | $points = ''; |
| 412 | 412 | $long = spip_substr($texte, 0, $taille); |
| 413 | - $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 413 | + $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 414 | 414 | // encore trop court ? couper au caractere |
| 415 | 415 | if (spip_strlen($texte) < 0.75 * $taille) { |
| 416 | 416 | $texte = $long; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | // supprimer l'eventuelle entite finale mal coupee |
| 430 | 430 | $texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte); |
| 431 | 431 | |
| 432 | - return quote_amp(trim($texte)) . $points; |
|
| 432 | + return quote_amp(trim($texte)).$points; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
@@ -441,16 +441,16 @@ discard block |
||
| 441 | 441 | define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 442 | 442 | } |
| 443 | 443 | foreach ($r as $regs) { |
| 444 | - $t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
|
| 444 | + $t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t); |
|
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | - if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 447 | + if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 448 | 448 | if (!defined('_PROTEGE_PHP_MODELES')) { |
| 449 | 449 | include_spip('inc/acces'); |
| 450 | 450 | define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 451 | 451 | } |
| 452 | 452 | foreach ($r as $regs) { |
| 453 | - $t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
|
| 453 | + $t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t); |
|
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | if (!empty($options['wrap_suspect'])) { |
| 569 | 569 | $texte = wrap($texte, $options['wrap_suspect']); |
| 570 | 570 | } |
| 571 | - $texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte; |
|
| 571 | + $texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte; |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | $texte = $collecteurModeles->retablir($texte); |
@@ -715,11 +715,11 @@ discard block |
||
| 715 | 715 | **/ |
| 716 | 716 | function supprime_img($letexte, $message = null) { |
| 717 | 717 | if ($message === null) { |
| 718 | - $message = '(' . _T('img_indisponible') . ')'; |
|
| 718 | + $message = '('._T('img_indisponible').')'; |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | return preg_replace( |
| 722 | - ',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i', |
|
| 722 | + ',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i', |
|
| 723 | 723 | $message, |
| 724 | 724 | $letexte |
| 725 | 725 | ); |
@@ -580,8 +580,7 @@ |
||
| 580 | 580 | $collecteurLiens = $collecteurModeles = null; |
| 581 | 581 | if (!empty($options['expanser_liens'])) { |
| 582 | 582 | $texte = expanser_liens($texte, $env['connect'] ?? '', $env['env'] ?? []); |
| 583 | - } |
|
| 584 | - else { |
|
| 583 | + } else { |
|
| 585 | 584 | include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
| 586 | 585 | include_spip("src/Texte/Collecteur/Liens"); |
| 587 | 586 | include_spip("src/Texte/Collecteur/Modeles"); |
@@ -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 ! |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | **/ |
| 1034 | 1034 | function supprimer_numero($texte) { |
| 1035 | 1035 | return preg_replace( |
| 1036 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1036 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1037 | 1037 | '', |
| 1038 | 1038 | $texte |
| 1039 | 1039 | ); |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | if ( |
| 1063 | 1063 | $texte and |
| 1064 | 1064 | preg_match( |
| 1065 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1065 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1066 | 1066 | $texte, |
| 1067 | 1067 | $regs |
| 1068 | 1068 | ) |
@@ -1153,8 +1153,8 @@ discard block |
||
| 1153 | 1153 | **/ |
| 1154 | 1154 | function textebrut($texte) { |
| 1155 | 1155 | $u = $GLOBALS['meta']['pcre_u']; |
| 1156 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1157 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1156 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1157 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1158 | 1158 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1159 | 1159 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1160 | 1160 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | ) |
| 1189 | 1189 | ) { |
| 1190 | 1190 | foreach ($liens[0] as $a) { |
| 1191 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1191 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1192 | 1192 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1193 | 1193 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1194 | 1194 | $texte = str_replace($a, $ablank, $texte); |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | foreach ($regs[0] as $a) { |
| 1214 | 1214 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1215 | 1215 | if (strpos($rel, 'nofollow') === false) { |
| 1216 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1216 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1217 | 1217 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1218 | 1218 | $texte = str_replace($a, $anofollow, $texte); |
| 1219 | 1219 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | $u = $GLOBALS['meta']['pcre_u']; |
| 1243 | 1243 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1244 | 1244 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1245 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1245 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1246 | 1246 | |
| 1247 | 1247 | return $texte; |
| 1248 | 1248 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | return $texte; |
| 1274 | 1274 | } |
| 1275 | 1275 | include_spip('inc/texte'); |
| 1276 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1276 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1277 | 1277 | 'div' : 'span'; |
| 1278 | 1278 | |
| 1279 | 1279 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | } |
| 1386 | 1386 | $u = $GLOBALS['meta']['pcre_u']; |
| 1387 | 1387 | if ($textebrut) { |
| 1388 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1388 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1389 | 1389 | } |
| 1390 | 1390 | $texte = texte_backend($texte); |
| 1391 | 1391 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1420,7 +1420,7 @@ discard block |
||
| 1420 | 1420 | # un message pour abs_url |
| 1421 | 1421 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1422 | 1422 | $url = trim($url); |
| 1423 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1423 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1424 | 1424 | |
| 1425 | 1425 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1426 | 1426 | } |
@@ -1627,7 +1627,7 @@ discard block |
||
| 1627 | 1627 | |
| 1628 | 1628 | $debut = ''; |
| 1629 | 1629 | $suite = $texte; |
| 1630 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1630 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1631 | 1631 | $debut .= substr($suite, 0, $t - 1); |
| 1632 | 1632 | $suite = substr($suite, $t); |
| 1633 | 1633 | $car = substr($suite, 0, 1); |
@@ -1645,7 +1645,7 @@ discard block |
||
| 1645 | 1645 | $suite = substr($suite, strlen($regs[0])); |
| 1646 | 1646 | } |
| 1647 | 1647 | } |
| 1648 | - $texte = $debut . $suite; |
|
| 1648 | + $texte = $debut.$suite; |
|
| 1649 | 1649 | |
| 1650 | 1650 | if ($collecteurModeles) { |
| 1651 | 1651 | $texte = $collecteurModeles->retablir($texte); |
@@ -1653,7 +1653,7 @@ discard block |
||
| 1653 | 1653 | |
| 1654 | 1654 | $texte = echappe_retour($texte); |
| 1655 | 1655 | |
| 1656 | - return $texte . $fin; |
|
| 1656 | + return $texte.$fin; |
|
| 1657 | 1657 | } |
| 1658 | 1658 | |
| 1659 | 1659 | |
@@ -1929,7 +1929,7 @@ discard block |
||
| 1929 | 1929 | if (is_array($balise)) { |
| 1930 | 1930 | array_walk( |
| 1931 | 1931 | $balise, |
| 1932 | - function (&$a, $key, $t) { |
|
| 1932 | + function(&$a, $key, $t) { |
|
| 1933 | 1933 | $a = extraire_attribut($a, $t); |
| 1934 | 1934 | }, |
| 1935 | 1935 | $attribut |
@@ -2027,14 +2027,14 @@ discard block |
||
| 2027 | 2027 | |
| 2028 | 2028 | if ($old !== null) { |
| 2029 | 2029 | // Remplacer l'ancien attribut du meme nom |
| 2030 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2030 | + $balise = $r[1].$insert.$r[5]; |
|
| 2031 | 2031 | } else { |
| 2032 | 2032 | // preferer une balise " />" (comme <img />) |
| 2033 | 2033 | if (preg_match(',/>,', $balise)) { |
| 2034 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2034 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2035 | 2035 | } // sinon une balise <a ...> ... </a> |
| 2036 | 2036 | else { |
| 2037 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2037 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2038 | 2038 | } |
| 2039 | 2039 | } |
| 2040 | 2040 | |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | if ( |
| 2090 | 2090 | $class_courante |
| 2091 | 2091 | and strpos($class_courante, (string) $c) !== false |
| 2092 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2092 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2093 | 2093 | ) { |
| 2094 | 2094 | $is_class_presente = true; |
| 2095 | 2095 | } |
@@ -2097,12 +2097,12 @@ discard block |
||
| 2097 | 2097 | in_array($operation, ['ajouter', 'commuter']) |
| 2098 | 2098 | and !$is_class_presente |
| 2099 | 2099 | ) { |
| 2100 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2100 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2101 | 2101 | } elseif ( |
| 2102 | 2102 | in_array($operation, ['supprimer', 'commuter']) |
| 2103 | 2103 | and $is_class_presente |
| 2104 | 2104 | ) { |
| 2105 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2105 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2106 | 2106 | } |
| 2107 | 2107 | } |
| 2108 | 2108 | |
@@ -2165,7 +2165,7 @@ discard block |
||
| 2165 | 2165 | // Quelques fonctions de calcul arithmetique |
| 2166 | 2166 | // |
| 2167 | 2167 | function floatstr($a) { |
| 2168 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2168 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2169 | 2169 | } |
| 2170 | 2170 | function strize($f, $a, $b) { |
| 2171 | 2171 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2301,13 +2301,13 @@ discard block |
||
| 2301 | 2301 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2302 | 2302 | define('_TAGS_NOM_AUTEUR', ''); |
| 2303 | 2303 | } |
| 2304 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2304 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2305 | 2305 | foreach ($tags_acceptes as $tag) { |
| 2306 | 2306 | if (strlen($tag)) { |
| 2307 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2308 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2309 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2310 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2307 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2308 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2309 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2310 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2311 | 2311 | } |
| 2312 | 2312 | } |
| 2313 | 2313 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2427,10 +2427,10 @@ discard block |
||
| 2427 | 2427 | $fichier = basename($url); |
| 2428 | 2428 | |
| 2429 | 2429 | return '<a rel="enclosure"' |
| 2430 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2431 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2432 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2433 | - . '>' . $fichier . '</a>'; |
|
| 2430 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2431 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2432 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2433 | + . '>'.$fichier.'</a>'; |
|
| 2434 | 2434 | } |
| 2435 | 2435 | |
| 2436 | 2436 | /** |
@@ -2458,9 +2458,9 @@ discard block |
||
| 2458 | 2458 | } # vieux data |
| 2459 | 2459 | $fichier = basename($url); |
| 2460 | 2460 | $enclosures[] = '<enclosure' |
| 2461 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2462 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2463 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2461 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2462 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2463 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2464 | 2464 | . ' />'; |
| 2465 | 2465 | } |
| 2466 | 2466 | } |
@@ -2486,7 +2486,7 @@ discard block |
||
| 2486 | 2486 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2487 | 2487 | $subjects .= '<dc:subject>' |
| 2488 | 2488 | . texte_backend(textebrut($e)) |
| 2489 | - . '</dc:subject>' . "\n"; |
|
| 2489 | + . '</dc:subject>'."\n"; |
|
| 2490 | 2490 | } |
| 2491 | 2491 | } |
| 2492 | 2492 | |
@@ -2522,7 +2522,7 @@ discard block |
||
| 2522 | 2522 | if (is_array($texte)) { |
| 2523 | 2523 | array_walk( |
| 2524 | 2524 | $texte, |
| 2525 | - function (&$a, $key, $t) { |
|
| 2525 | + function(&$a, $key, $t) { |
|
| 2526 | 2526 | $a = extraire_balise($a, $t); |
| 2527 | 2527 | }, |
| 2528 | 2528 | $tag |
@@ -2570,7 +2570,7 @@ discard block |
||
| 2570 | 2570 | if (is_array($texte)) { |
| 2571 | 2571 | array_walk( |
| 2572 | 2572 | $texte, |
| 2573 | - function (&$a, $key, $t) { |
|
| 2573 | + function(&$a, $key, $t) { |
|
| 2574 | 2574 | $a = extraire_balises($a, $t); |
| 2575 | 2575 | }, |
| 2576 | 2576 | $tag |
@@ -2703,7 +2703,7 @@ discard block |
||
| 2703 | 2703 | if ($fond != '404') { |
| 2704 | 2704 | $contexte = array_shift($p); |
| 2705 | 2705 | $contexte['page'] = $fond; |
| 2706 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2706 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2707 | 2707 | } |
| 2708 | 2708 | } |
| 2709 | 2709 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2758,9 +2758,9 @@ discard block |
||
| 2758 | 2758 | . '"' |
| 2759 | 2759 | . (is_null($val) |
| 2760 | 2760 | ? '' |
| 2761 | - : ' value="' . entites_html($val) . '"' |
|
| 2761 | + : ' value="'.entites_html($val).'"' |
|
| 2762 | 2762 | ) |
| 2763 | - . ' type="hidden"' . "\n/>"; |
|
| 2763 | + . ' type="hidden"'."\n/>"; |
|
| 2764 | 2764 | } |
| 2765 | 2765 | |
| 2766 | 2766 | return join('', $hidden); |
@@ -2870,7 +2870,7 @@ discard block |
||
| 2870 | 2870 | |
| 2871 | 2871 | return preg_replace_callback( |
| 2872 | 2872 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2873 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2873 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2874 | 2874 | $contenu |
| 2875 | 2875 | ); |
| 2876 | 2876 | } |
@@ -2931,14 +2931,14 @@ discard block |
||
| 2931 | 2931 | ) { |
| 2932 | 2932 | $distant = true; |
| 2933 | 2933 | $cssf = parse_url($css); |
| 2934 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2934 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2935 | 2935 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2936 | 2936 | } else { |
| 2937 | 2937 | $distant = false; |
| 2938 | 2938 | $cssf = $css; |
| 2939 | 2939 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2940 | 2940 | //propose (rien a faire dans ce cas) |
| 2941 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2941 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2942 | 2942 | if (@file_exists($f)) { |
| 2943 | 2943 | return $f; |
| 2944 | 2944 | } |
@@ -2948,7 +2948,7 @@ discard block |
||
| 2948 | 2948 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2949 | 2949 | $f = $dir_var |
| 2950 | 2950 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2951 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2951 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2952 | 2952 | |
| 2953 | 2953 | // la css peut etre distante (url absolue !) |
| 2954 | 2954 | if ($distant) { |
@@ -2994,8 +2994,8 @@ discard block |
||
| 2994 | 2994 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2995 | 2995 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2996 | 2996 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2997 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2998 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2997 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 2998 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 2999 | 2999 | } |
| 3000 | 3000 | $src[] = $regs[0][$k]; |
| 3001 | 3001 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3044,7 +3044,7 @@ discard block |
||
| 3044 | 3044 | |
| 3045 | 3045 | $f = basename($css, '.css'); |
| 3046 | 3046 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3047 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3047 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3048 | 3048 | . '.css'; |
| 3049 | 3049 | |
| 3050 | 3050 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3054,7 +3054,7 @@ discard block |
||
| 3054 | 3054 | if ($url_absolue_css == $css) { |
| 3055 | 3055 | if ( |
| 3056 | 3056 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3057 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3057 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3058 | 3058 | ) { |
| 3059 | 3059 | include_spip('inc/distant'); |
| 3060 | 3060 | $contenu = recuperer_url($css); |
@@ -3166,7 +3166,7 @@ discard block |
||
| 3166 | 3166 | $expression = str_replace('\/', '/', $expression); |
| 3167 | 3167 | $expression = str_replace('/', '\/', $expression); |
| 3168 | 3168 | |
| 3169 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3169 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3170 | 3170 | if (isset($r[$capte])) { |
| 3171 | 3171 | return $r[$capte]; |
| 3172 | 3172 | } else { |
@@ -3204,7 +3204,7 @@ discard block |
||
| 3204 | 3204 | $expression = str_replace('\/', '/', $expression); |
| 3205 | 3205 | $expression = str_replace('/', '\/', $expression); |
| 3206 | 3206 | |
| 3207 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3207 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3208 | 3208 | } |
| 3209 | 3209 | |
| 3210 | 3210 | |
@@ -3223,7 +3223,7 @@ discard block |
||
| 3223 | 3223 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3224 | 3224 | |
| 3225 | 3225 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3226 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3226 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3227 | 3227 | |
| 3228 | 3228 | if ( |
| 3229 | 3229 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3237,7 +3237,7 @@ discard block |
||
| 3237 | 3237 | if (!isset($doublons['documents'])) { |
| 3238 | 3238 | $doublons['documents'] = ''; |
| 3239 | 3239 | } |
| 3240 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3240 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3241 | 3241 | } |
| 3242 | 3242 | |
| 3243 | 3243 | return $letexte; |
@@ -3294,7 +3294,7 @@ discard block |
||
| 3294 | 3294 | if ($env) { |
| 3295 | 3295 | foreach ($env as $i => $j) { |
| 3296 | 3296 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3297 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3297 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3298 | 3298 | } |
| 3299 | 3299 | } |
| 3300 | 3300 | } |
@@ -3333,7 +3333,7 @@ discard block |
||
| 3333 | 3333 | if ($env) { |
| 3334 | 3334 | foreach ($env as $i => $j) { |
| 3335 | 3335 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3336 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3336 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3337 | 3337 | } |
| 3338 | 3338 | } |
| 3339 | 3339 | } |
@@ -3407,10 +3407,10 @@ discard block |
||
| 3407 | 3407 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3408 | 3408 | if ( |
| 3409 | 3409 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3410 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3410 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3411 | 3411 | and file_exists($variante_svg_generique) |
| 3412 | 3412 | ) { |
| 3413 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3413 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3414 | 3414 | $img_file = $variante_svg_size; |
| 3415 | 3415 | } |
| 3416 | 3416 | else { |
@@ -3468,7 +3468,7 @@ discard block |
||
| 3468 | 3468 | return ''; |
| 3469 | 3469 | } |
| 3470 | 3470 | } |
| 3471 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3471 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3472 | 3472 | } |
| 3473 | 3473 | |
| 3474 | 3474 | if (file_exists($img_file)) { |
@@ -3478,14 +3478,14 @@ discard block |
||
| 3478 | 3478 | $alt = ''; |
| 3479 | 3479 | } |
| 3480 | 3480 | elseif ($alt or $alt === '') { |
| 3481 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3481 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3482 | 3482 | } |
| 3483 | 3483 | else { |
| 3484 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3484 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3485 | 3485 | } |
| 3486 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3487 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3488 | - . ' ' . ltrim($atts) |
|
| 3486 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3487 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3488 | + . ' '.ltrim($atts) |
|
| 3489 | 3489 | . ' />'; |
| 3490 | 3490 | } |
| 3491 | 3491 | |
@@ -3499,10 +3499,10 @@ discard block |
||
| 3499 | 3499 | */ |
| 3500 | 3500 | function http_style_background($img, $att = '', $size = null) { |
| 3501 | 3501 | if ($size and is_numeric($size)) { |
| 3502 | - $size = trim($size) . 'px'; |
|
| 3502 | + $size = trim($size).'px'; |
|
| 3503 | 3503 | } |
| 3504 | - return " style='background" . |
|
| 3505 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3504 | + return " style='background". |
|
| 3505 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3506 | 3506 | . ($size ? "background-size:{$size};" : '') |
| 3507 | 3507 | . "'"; |
| 3508 | 3508 | } |
@@ -3617,7 +3617,7 @@ discard block |
||
| 3617 | 3617 | $img = http_img_pack( |
| 3618 | 3618 | $img, |
| 3619 | 3619 | $alt, |
| 3620 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3620 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3621 | 3621 | '', |
| 3622 | 3622 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3623 | 3623 | ); |
@@ -3702,7 +3702,7 @@ discard block |
||
| 3702 | 3702 | $balise_svg_source = $balise_svg; |
| 3703 | 3703 | |
| 3704 | 3704 | // entete XML à supprimer |
| 3705 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3705 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3706 | 3706 | |
| 3707 | 3707 | // IE est toujours mon ami |
| 3708 | 3708 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3720,9 +3720,9 @@ discard block |
||
| 3720 | 3720 | // regler le alt |
| 3721 | 3721 | if ($alt) { |
| 3722 | 3722 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3723 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3723 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3724 | 3724 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3725 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3725 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3726 | 3726 | $balise_svg .= $title; |
| 3727 | 3727 | } |
| 3728 | 3728 | else { |
@@ -3770,7 +3770,7 @@ discard block |
||
| 3770 | 3770 | if (is_array($tableau)) { |
| 3771 | 3771 | foreach ($tableau as $k => $v) { |
| 3772 | 3772 | $res = recuperer_fond( |
| 3773 | - 'modeles/' . $modele, |
|
| 3773 | + 'modeles/'.$modele, |
|
| 3774 | 3774 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3775 | 3775 | ); |
| 3776 | 3776 | $texte .= $res; |
@@ -3955,7 +3955,7 @@ discard block |
||
| 3955 | 3955 | } |
| 3956 | 3956 | |
| 3957 | 3957 | $c = serialize($c); |
| 3958 | - $cle = calculer_cle_action($form . $c); |
|
| 3958 | + $cle = calculer_cle_action($form.$c); |
|
| 3959 | 3959 | $c = "$cle:$c"; |
| 3960 | 3960 | |
| 3961 | 3961 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4013,15 +4013,15 @@ discard block |
||
| 4013 | 4013 | } |
| 4014 | 4014 | // toujours encoder l'url source dans le bloc ajax |
| 4015 | 4015 | $r = self(); |
| 4016 | - $r = ' data-origin="' . $r . '"'; |
|
| 4016 | + $r = ' data-origin="'.$r.'"'; |
|
| 4017 | 4017 | $class = 'ajaxbloc'; |
| 4018 | 4018 | if ($ajaxid and is_string($ajaxid)) { |
| 4019 | 4019 | // ajaxid est normalement conforme a un nom de classe css |
| 4020 | 4020 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4021 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4021 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4022 | 4022 | } |
| 4023 | 4023 | |
| 4024 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4024 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4025 | 4025 | } |
| 4026 | 4026 | |
| 4027 | 4027 | /** |
@@ -4065,7 +4065,7 @@ discard block |
||
| 4065 | 4065 | $cle = substr($c, 0, $p); |
| 4066 | 4066 | $c = substr($c, $p + 1); |
| 4067 | 4067 | |
| 4068 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4068 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4069 | 4069 | $env = @unserialize($c); |
| 4070 | 4070 | return $env; |
| 4071 | 4071 | } |
@@ -4186,13 +4186,13 @@ discard block |
||
| 4186 | 4186 | } |
| 4187 | 4187 | } |
| 4188 | 4188 | } |
| 4189 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4189 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4190 | 4190 | } else { |
| 4191 | 4191 | $bal = 'a'; |
| 4192 | 4192 | $att = "href='$url'" |
| 4193 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4194 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4195 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4193 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4194 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4195 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4196 | 4196 | . $evt; |
| 4197 | 4197 | } |
| 4198 | 4198 | if ($libelle === null) { |
@@ -4331,7 +4331,7 @@ discard block |
||
| 4331 | 4331 | |
| 4332 | 4332 | // Icône |
| 4333 | 4333 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4334 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4334 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4335 | 4335 | |
| 4336 | 4336 | // Markup final |
| 4337 | 4337 | if ($type == 'lien') { |
@@ -4606,20 +4606,20 @@ discard block |
||
| 4606 | 4606 | $class_form = 'ajax'; |
| 4607 | 4607 | $class = str_replace('ajax', '', $class); |
| 4608 | 4608 | } |
| 4609 | - $class_btn = 'submit ' . trim($class); |
|
| 4609 | + $class_btn = 'submit '.trim($class); |
|
| 4610 | 4610 | |
| 4611 | 4611 | if ($confirm) { |
| 4612 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4612 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4613 | 4613 | if ($callback) { |
| 4614 | 4614 | $callback = "$confirm?($callback):false"; |
| 4615 | 4615 | } else { |
| 4616 | 4616 | $callback = $confirm; |
| 4617 | 4617 | } |
| 4618 | 4618 | } |
| 4619 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4619 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4620 | 4620 | $title = $title ? " title='$title'" : ''; |
| 4621 | 4621 | |
| 4622 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4622 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4623 | 4623 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4624 | 4624 | } |
| 4625 | 4625 | |
@@ -4684,14 +4684,14 @@ discard block |
||
| 4684 | 4684 | $champ_titre = ''; |
| 4685 | 4685 | if ($demande_titre) { |
| 4686 | 4686 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4687 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4687 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4688 | 4688 | } |
| 4689 | 4689 | include_spip('base/abstract_sql'); |
| 4690 | 4690 | include_spip('base/connect_sql'); |
| 4691 | 4691 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4692 | - '*' . $champ_titre, |
|
| 4692 | + '*'.$champ_titre, |
|
| 4693 | 4693 | $desc['table_sql'], |
| 4694 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4694 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4695 | 4695 | ); |
| 4696 | 4696 | |
| 4697 | 4697 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4784,8 +4784,7 @@ discard block |
||
| 4784 | 4784 | if (isset($ligne_sql['chapo'])) { |
| 4785 | 4785 | $chapo = $ligne_sql['chapo']; |
| 4786 | 4786 | $texte = strlen($descriptif) ? |
| 4787 | - '' : |
|
| 4788 | - "$chapo \n\n $texte"; |
|
| 4787 | + '' : "$chapo \n\n $texte"; |
|
| 4789 | 4788 | } |
| 4790 | 4789 | |
| 4791 | 4790 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4860,7 +4859,7 @@ discard block |
||
| 4860 | 4859 | return $texte; |
| 4861 | 4860 | } |
| 4862 | 4861 | |
| 4863 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4862 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4864 | 4863 | |
| 4865 | 4864 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4866 | 4865 | if (test_espace_prive()) { |
@@ -4899,7 +4898,7 @@ discard block |
||
| 4899 | 4898 | } |
| 4900 | 4899 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4901 | 4900 | |
| 4902 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4901 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4903 | 4902 | } |
| 4904 | 4903 | |
| 4905 | 4904 | /** |
@@ -4925,10 +4924,10 @@ discard block |
||
| 4925 | 4924 | function wrap($texte, $wrap) { |
| 4926 | 4925 | $balises = extraire_balises($wrap); |
| 4927 | 4926 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4928 | - $texte = $wrap . $texte; |
|
| 4927 | + $texte = $wrap.$texte; |
|
| 4929 | 4928 | $regs = array_reverse($regs[1]); |
| 4930 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4931 | - $texte = $texte . $wrap; |
|
| 4929 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4930 | + $texte = $texte.$wrap; |
|
| 4932 | 4931 | } |
| 4933 | 4932 | |
| 4934 | 4933 | return $texte; |
@@ -4959,7 +4958,7 @@ discard block |
||
| 4959 | 4958 | |
| 4960 | 4959 | // caster $u en array si besoin |
| 4961 | 4960 | if (is_object($u)) { |
| 4962 | - $u = (array)$u; |
|
| 4961 | + $u = (array) $u; |
|
| 4963 | 4962 | } |
| 4964 | 4963 | |
| 4965 | 4964 | if (is_array($u)) { |
@@ -4981,7 +4980,7 @@ discard block |
||
| 4981 | 4980 | // sinon on passe a la ligne et on indente |
| 4982 | 4981 | $i_str = str_pad('', $indent, ' '); |
| 4983 | 4982 | foreach ($u as $k => $v) { |
| 4984 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4983 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4985 | 4984 | } |
| 4986 | 4985 | |
| 4987 | 4986 | return $out; |
@@ -5035,7 +5034,7 @@ discard block |
||
| 5035 | 5034 | * @return string |
| 5036 | 5035 | */ |
| 5037 | 5036 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5038 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5037 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5039 | 5038 | $icone = chemin_image($icone); |
| 5040 | 5039 | $balise_img = charger_filtre('balise_img'); |
| 5041 | 5040 | |
@@ -5061,7 +5060,7 @@ discard block |
||
| 5061 | 5060 | */ |
| 5062 | 5061 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5063 | 5062 | $chaine = explode(':', $chaine); |
| 5064 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5063 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5065 | 5064 | return $t; |
| 5066 | 5065 | } |
| 5067 | 5066 | $chaine = implode(':', $chaine); |
@@ -5127,7 +5126,7 @@ discard block |
||
| 5127 | 5126 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5128 | 5127 | |
| 5129 | 5128 | // calculer le nom de la css |
| 5130 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5129 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5131 | 5130 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5132 | 5131 | $contexte_implicite = calculer_contexte_implicite(); |
| 5133 | 5132 | |
@@ -5135,14 +5134,14 @@ discard block |
||
| 5135 | 5134 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5136 | 5135 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5137 | 5136 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5138 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5137 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5139 | 5138 | } |
| 5140 | 5139 | else { |
| 5141 | 5140 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5142 | 5141 | ksort($contexte); |
| 5143 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5142 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5144 | 5143 | } |
| 5145 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5144 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5146 | 5145 | |
| 5147 | 5146 | // mettre a jour le fichier si il n'existe pas |
| 5148 | 5147 | // ou trop ancien |
@@ -5150,8 +5149,8 @@ discard block |
||
| 5150 | 5149 | // et recopie sur le fichier cible uniquement si il change |
| 5151 | 5150 | if ( |
| 5152 | 5151 | !file_exists($filename) |
| 5153 | - or !file_exists($filename . '.last') |
|
| 5154 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5152 | + or !file_exists($filename.'.last') |
|
| 5153 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5155 | 5154 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5156 | 5155 | ) { |
| 5157 | 5156 | $contenu = $cache['texte']; |
@@ -5175,10 +5174,10 @@ discard block |
||
| 5175 | 5174 | } |
| 5176 | 5175 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5177 | 5176 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5178 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5177 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5179 | 5178 | } |
| 5180 | 5179 | // et ecrire le fichier si il change |
| 5181 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5180 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5182 | 5181 | } |
| 5183 | 5182 | |
| 5184 | 5183 | return timestamp($filename); |
@@ -5411,7 +5410,7 @@ discard block |
||
| 5411 | 5410 | if ($e > 0 and strlen($mid) > 8) { |
| 5412 | 5411 | $mid = '***...***'; |
| 5413 | 5412 | } |
| 5414 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5413 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5415 | 5414 | } |
| 5416 | 5415 | |
| 5417 | 5416 | |
@@ -5473,7 +5472,7 @@ discard block |
||
| 5473 | 5472 | case 'id': |
| 5474 | 5473 | case 'anchor': |
| 5475 | 5474 | if (preg_match(',^\d,', $texte)) { |
| 5476 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5475 | + $texte = substr($type, 0, 1).$texte; |
|
| 5477 | 5476 | } |
| 5478 | 5477 | } |
| 5479 | 5478 | |
@@ -5483,9 +5482,9 @@ discard block |
||
| 5483 | 5482 | |
| 5484 | 5483 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5485 | 5484 | if (preg_match(',^\d,', $texte)) { |
| 5486 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5485 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5487 | 5486 | } |
| 5488 | - $texte .= $separateur . md5($original); |
|
| 5487 | + $texte .= $separateur.md5($original); |
|
| 5489 | 5488 | $texte = substr($texte, 0, $longueur_mini); |
| 5490 | 5489 | } |
| 5491 | 5490 | |