@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Filtres |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | include_spip('inc/charsets'); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | * @return string Fonction PHP correspondante du filtre |
| 43 | 43 | */ |
| 44 | 44 | function charger_filtre($fonc, $default = 'filtre_identite_dist') { |
| 45 | - include_fichiers_fonctions(); // inclure les fichiers fonctions |
|
| 46 | - return chercher_filtre($fonc, $default); |
|
| 45 | + include_fichiers_fonctions(); // inclure les fichiers fonctions |
|
| 46 | + return chercher_filtre($fonc, $default); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return string texte |
| 54 | 54 | **/ |
| 55 | 55 | function filtre_identite_dist($texte) { |
| 56 | - return $texte; |
|
| 56 | + return $texte; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -77,33 +77,33 @@ discard block |
||
| 77 | 77 | * Fonction PHP correspondante du filtre demandé |
| 78 | 78 | */ |
| 79 | 79 | function chercher_filtre($fonc, $default = null) { |
| 80 | - if (!$fonc) { |
|
| 81 | - return $default; |
|
| 82 | - } |
|
| 83 | - // Cas des types mime, sans confondre avec les appels de fonction de classe |
|
| 84 | - // Foo::Bar |
|
| 85 | - // qui peuvent etre avec un namespace : space\Foo::Bar |
|
| 86 | - if (preg_match(',^[\w]+/,', $fonc)) { |
|
| 87 | - $nom = preg_replace(',\W,', '_', $fonc); |
|
| 88 | - $f = chercher_filtre($nom); |
|
| 89 | - // cas du sous-type MIME sans filtre associe, passer au type: |
|
| 90 | - // si filtre_text_plain pas defini, passe a filtre_text |
|
| 91 | - if (!$f and $nom !== $fonc) { |
|
| 92 | - $f = chercher_filtre(preg_replace(',\W.*$,', '', $fonc)); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - return $f; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - include_fichiers_fonctions(); |
|
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 100 | - trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
|
| 101 | - if (is_callable($f)) { |
|
| 102 | - return $f; |
|
| 103 | - } |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - return $default; |
|
| 80 | + if (!$fonc) { |
|
| 81 | + return $default; |
|
| 82 | + } |
|
| 83 | + // Cas des types mime, sans confondre avec les appels de fonction de classe |
|
| 84 | + // Foo::Bar |
|
| 85 | + // qui peuvent etre avec un namespace : space\Foo::Bar |
|
| 86 | + if (preg_match(',^[\w]+/,', $fonc)) { |
|
| 87 | + $nom = preg_replace(',\W,', '_', $fonc); |
|
| 88 | + $f = chercher_filtre($nom); |
|
| 89 | + // cas du sous-type MIME sans filtre associe, passer au type: |
|
| 90 | + // si filtre_text_plain pas defini, passe a filtre_text |
|
| 91 | + if (!$f and $nom !== $fonc) { |
|
| 92 | + $f = chercher_filtre(preg_replace(',\W.*$,', '', $fonc)); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + return $f; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + include_fichiers_fonctions(); |
|
| 99 | + foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 100 | + trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
|
| 101 | + if (is_callable($f)) { |
|
| 102 | + return $f; |
|
| 103 | + } |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + return $default; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | * Chaîne vide sinon. |
| 148 | 148 | **/ |
| 149 | 149 | function appliquer_filtre($arg, $filtre) { |
| 150 | - $args = func_get_args(); |
|
| 151 | - return appliquer_filtre_sinon($arg, $filtre, $args, ''); |
|
| 150 | + $args = func_get_args(); |
|
| 151 | + return appliquer_filtre_sinon($arg, $filtre, $args, ''); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | * texte d'origine sinon |
| 174 | 174 | **/ |
| 175 | 175 | function appliquer_si_filtre($arg, $filtre) { |
| 176 | - $args = func_get_args(); |
|
| 177 | - return appliquer_filtre_sinon($arg, $filtre, $args, $arg); |
|
| 176 | + $args = func_get_args(); |
|
| 177 | + return appliquer_filtre_sinon($arg, $filtre, $args, $arg); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | * Version de SPIP |
| 191 | 191 | **/ |
| 192 | 192 | function spip_version() { |
| 193 | - $version = $GLOBALS['spip_version_affichee']; |
|
| 194 | - if ($vcs_version = version_vcs_courante(_DIR_RACINE)) { |
|
| 195 | - $version .= " $vcs_version"; |
|
| 196 | - } |
|
| 193 | + $version = $GLOBALS['spip_version_affichee']; |
|
| 194 | + if ($vcs_version = version_vcs_courante(_DIR_RACINE)) { |
|
| 195 | + $version .= " $vcs_version"; |
|
| 196 | + } |
|
| 197 | 197 | |
| 198 | - return $version; |
|
| 198 | + return $version; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | * @return string |
| 208 | 208 | */ |
| 209 | 209 | function header_silencieux($version): string { |
| 210 | - if (isset($GLOBALS['spip_header_silencieux']) && (bool) $GLOBALS['spip_header_silencieux']) { |
|
| 211 | - $version = ''; |
|
| 212 | - } |
|
| 210 | + if (isset($GLOBALS['spip_header_silencieux']) && (bool) $GLOBALS['spip_header_silencieux']) { |
|
| 211 | + $version = ''; |
|
| 212 | + } |
|
| 213 | 213 | |
| 214 | - return (string) $version; |
|
| 214 | + return (string) $version; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /** |
@@ -224,16 +224,16 @@ discard block |
||
| 224 | 224 | * - string|null si $raw = false |
| 225 | 225 | */ |
| 226 | 226 | function version_vcs_courante($dir, $raw = false) { |
| 227 | - $desc = decrire_version_git($dir); |
|
| 228 | - if ($desc === null or $raw) { |
|
| 229 | - return $desc; |
|
| 230 | - } |
|
| 231 | - // affichage "GIT [master: abcdef]" |
|
| 232 | - $commit = $desc['commit_short'] ?? $desc['commit']; |
|
| 233 | - if ($desc['branch']) { |
|
| 234 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 235 | - } |
|
| 236 | - return "{$desc['vcs']} [$commit]"; |
|
| 227 | + $desc = decrire_version_git($dir); |
|
| 228 | + if ($desc === null or $raw) { |
|
| 229 | + return $desc; |
|
| 230 | + } |
|
| 231 | + // affichage "GIT [master: abcdef]" |
|
| 232 | + $commit = $desc['commit_short'] ?? $desc['commit']; |
|
| 233 | + if ($desc['branch']) { |
|
| 234 | + $commit = $desc['branch'] . ': ' . $commit; |
|
| 235 | + } |
|
| 236 | + return "{$desc['vcs']} [$commit]"; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -245,24 +245,24 @@ discard block |
||
| 245 | 245 | * array ['branch' => xx, 'commit' => yy] sinon. |
| 246 | 246 | **/ |
| 247 | 247 | function decrire_version_git($dir) { |
| 248 | - if (!$dir) { |
|
| 249 | - $dir = '.'; |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - // version installee par GIT |
|
| 253 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 254 | - $currentHead = trim(substr($c, 4)); |
|
| 255 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 256 | - return [ |
|
| 257 | - 'vcs' => 'GIT', |
|
| 258 | - 'branch' => basename($currentHead), |
|
| 259 | - 'commit' => trim($hash), |
|
| 260 | - 'commit_short' => substr(trim($hash), 0, 8), |
|
| 261 | - ]; |
|
| 262 | - } |
|
| 263 | - } |
|
| 264 | - |
|
| 265 | - return null; |
|
| 248 | + if (!$dir) { |
|
| 249 | + $dir = '.'; |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + // version installee par GIT |
|
| 253 | + if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 254 | + $currentHead = trim(substr($c, 4)); |
|
| 255 | + if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 256 | + return [ |
|
| 257 | + 'vcs' => 'GIT', |
|
| 258 | + 'branch' => basename($currentHead), |
|
| 259 | + 'commit' => trim($hash), |
|
| 260 | + 'commit_short' => substr(trim($hash), 0, 8), |
|
| 261 | + ]; |
|
| 262 | + } |
|
| 263 | + } |
|
| 264 | + |
|
| 265 | + return null; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
@@ -309,18 +309,18 @@ discard block |
||
| 309 | 309 | * Code HTML retourné par le filtre |
| 310 | 310 | **/ |
| 311 | 311 | function filtrer($filtre) { |
| 312 | - $tous = func_get_args(); |
|
| 313 | - if (trouver_filtre_matrice($filtre) and substr($filtre, 0, 6) == 'image_') { |
|
| 314 | - return image_filtrer($tous); |
|
| 315 | - } elseif ($f = chercher_filtre($filtre)) { |
|
| 316 | - array_shift($tous); |
|
| 317 | - return $f(...$tous); |
|
| 318 | - } else { |
|
| 319 | - // le filtre n'existe pas, on provoque une erreur |
|
| 320 | - $msg = ['zbug_erreur_filtre', ['filtre' => texte_script($filtre)]]; |
|
| 321 | - erreur_squelette($msg); |
|
| 322 | - return ''; |
|
| 323 | - } |
|
| 312 | + $tous = func_get_args(); |
|
| 313 | + if (trouver_filtre_matrice($filtre) and substr($filtre, 0, 6) == 'image_') { |
|
| 314 | + return image_filtrer($tous); |
|
| 315 | + } elseif ($f = chercher_filtre($filtre)) { |
|
| 316 | + array_shift($tous); |
|
| 317 | + return $f(...$tous); |
|
| 318 | + } else { |
|
| 319 | + // le filtre n'existe pas, on provoque une erreur |
|
| 320 | + $msg = ['zbug_erreur_filtre', ['filtre' => texte_script($filtre)]]; |
|
| 321 | + erreur_squelette($msg); |
|
| 322 | + return ''; |
|
| 323 | + } |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | * @return bool true si on trouve le filtre dans la matrice, false sinon. |
| 338 | 338 | */ |
| 339 | 339 | function trouver_filtre_matrice($filtre) { |
| 340 | - if (isset($GLOBALS['spip_matrice'][$filtre]) and is_string($f = $GLOBALS['spip_matrice'][$filtre])) { |
|
| 341 | - find_in_path($f, '', true); |
|
| 342 | - $GLOBALS['spip_matrice'][$filtre] = true; |
|
| 343 | - } |
|
| 344 | - return !empty($GLOBALS['spip_matrice'][$filtre]); |
|
| 340 | + if (isset($GLOBALS['spip_matrice'][$filtre]) and is_string($f = $GLOBALS['spip_matrice'][$filtre])) { |
|
| 341 | + find_in_path($f, '', true); |
|
| 342 | + $GLOBALS['spip_matrice'][$filtre] = true; |
|
| 343 | + } |
|
| 344 | + return !empty($GLOBALS['spip_matrice'][$filtre]); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | * @return mixed |
| 370 | 370 | */ |
| 371 | 371 | function filtre_set(&$Pile, $val, $key, $continue = null) { |
| 372 | - $Pile['vars'][$key] = $val; |
|
| 373 | - return $continue ? $val : ''; |
|
| 372 | + $Pile['vars'][$key] = $val; |
|
| 373 | + return $continue ? $val : ''; |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -396,8 +396,8 @@ discard block |
||
| 396 | 396 | * @return string|mixed Retourne `$val` si `$continue` présent, sinon ''. |
| 397 | 397 | */ |
| 398 | 398 | function filtre_setenv(&$Pile, $val, $key, $continue = null) { |
| 399 | - $Pile[0][$key] = $val; |
|
| 400 | - return $continue ? $val : ''; |
|
| 399 | + $Pile[0][$key] = $val; |
|
| 400 | + return $continue ? $val : ''; |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -406,8 +406,8 @@ discard block |
||
| 406 | 406 | * @return string |
| 407 | 407 | */ |
| 408 | 408 | function filtre_sanitize_env(&$Pile, $keys) { |
| 409 | - $Pile[0] = spip_sanitize_from_request($Pile[0], $keys); |
|
| 410 | - return ''; |
|
| 409 | + $Pile[0] = spip_sanitize_from_request($Pile[0], $keys); |
|
| 410 | + return ''; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
@@ -430,18 +430,18 @@ discard block |
||
| 430 | 430 | * @return mixed Retourne la valeur (sans la modifier). |
| 431 | 431 | */ |
| 432 | 432 | function filtre_debug($val, $key = null) { |
| 433 | - $debug = ( |
|
| 434 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 435 | - ) . var_export($val, true); |
|
| 433 | + $debug = ( |
|
| 434 | + is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 435 | + ) . var_export($val, true); |
|
| 436 | 436 | |
| 437 | - include_spip('inc/autoriser'); |
|
| 438 | - if (autoriser('webmestre')) { |
|
| 439 | - echo "<div class='spip_debug'>\n", $debug, "</div>\n"; |
|
| 440 | - } |
|
| 437 | + include_spip('inc/autoriser'); |
|
| 438 | + if (autoriser('webmestre')) { |
|
| 439 | + echo "<div class='spip_debug'>\n", $debug, "</div>\n"; |
|
| 440 | + } |
|
| 441 | 441 | |
| 442 | - spip_log($debug, 'debug'); |
|
| 442 | + spip_log($debug, 'debug'); |
|
| 443 | 443 | |
| 444 | - return $val; |
|
| 444 | + return $val; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -471,84 +471,84 @@ discard block |
||
| 471 | 471 | * texte qui a reçu les filtres |
| 472 | 472 | **/ |
| 473 | 473 | function image_filtrer($args) { |
| 474 | - $filtre = array_shift($args); # enlever $filtre |
|
| 475 | - $texte = array_shift($args); |
|
| 476 | - if ($texte === null || !strlen($texte)) { |
|
| 477 | - return ''; |
|
| 478 | - } |
|
| 479 | - find_in_path('filtres_images_mini.php', 'inc/', true); |
|
| 480 | - statut_effacer_images_temporaires(true); // activer la suppression des images temporaires car le compilo finit la chaine par un image_graver |
|
| 481 | - // Cas du nom de fichier local |
|
| 482 | - $is_file = trim($texte); |
|
| 483 | - if ( |
|
| 484 | - strpos(substr($is_file, strlen(_DIR_RACINE)), '..') !== false |
|
| 485 | - or strpbrk($is_file, "<>\n\r\t") !== false |
|
| 486 | - or strpos($is_file, '/') === 0 |
|
| 487 | - ) { |
|
| 488 | - $is_file = false; |
|
| 489 | - } |
|
| 490 | - if ($is_file) { |
|
| 491 | - $is_local_file = function ($path) { |
|
| 492 | - if (strpos($path, '?') !== false) { |
|
| 493 | - $path = supprimer_timestamp($path); |
|
| 494 | - // remove ?24px added by find_in_theme on .svg files |
|
| 495 | - $path = preg_replace(',\?[[:digit:]]+(px)$,', '', $path); |
|
| 496 | - } |
|
| 497 | - return file_exists($path); |
|
| 498 | - }; |
|
| 499 | - if ($is_local_file($is_file) or tester_url_absolue($is_file)) { |
|
| 500 | - $res = $filtre("<img src='$is_file' />", ...$args); |
|
| 501 | - statut_effacer_images_temporaires(false); // desactiver pour les appels hors compilo |
|
| 502 | - return $res; |
|
| 503 | - } |
|
| 504 | - } |
|
| 505 | - |
|
| 506 | - // Cas general : trier toutes les images, avec eventuellement leur <span> |
|
| 507 | - if ( |
|
| 508 | - preg_match_all( |
|
| 509 | - ',(<([a-z]+) [^<>]*spip_documents[^<>]*>)?\s*(<img\s.*>),UimsS', |
|
| 510 | - $texte, |
|
| 511 | - $tags, |
|
| 512 | - PREG_SET_ORDER |
|
| 513 | - ) |
|
| 514 | - ) { |
|
| 515 | - foreach ($tags as $tag) { |
|
| 516 | - $class = extraire_attribut($tag[3], 'class'); |
|
| 517 | - if ( |
|
| 518 | - !$class or |
|
| 519 | - (strpos($class, 'filtre_inactif') === false |
|
| 520 | - // compat historique a virer en 3.2 |
|
| 521 | - and !str_contains($class, 'no_image_filtrer')) |
|
| 522 | - ) { |
|
| 523 | - if ($reduit = $filtre($tag[3], ...$args)) { |
|
| 524 | - // En cas de span spip_documents, modifier le style=...width: |
|
| 525 | - if ($tag[1]) { |
|
| 526 | - $w = extraire_attribut($reduit, 'width'); |
|
| 527 | - if (!$w and preg_match(',width:\s*(\d+)px,S', extraire_attribut($reduit, 'style'), $regs)) { |
|
| 528 | - $w = $regs[1]; |
|
| 529 | - } |
|
| 530 | - if ($w and ($style = extraire_attribut($tag[1], 'style'))) { |
|
| 531 | - $style = preg_replace(',width:\s*\d+px,S', "width:{$w}px", $style); |
|
| 532 | - $replace = inserer_attribut($tag[1], 'style', $style); |
|
| 533 | - $texte = str_replace($tag[1], $replace, $texte); |
|
| 534 | - } |
|
| 535 | - } |
|
| 536 | - // traiter aussi un eventuel mouseover |
|
| 537 | - if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
|
| 538 | - if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
|
| 539 | - $srcover = $match[1]; |
|
| 540 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 541 | - $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
|
| 542 | - $reduit = str_replace($srcover, $srcover_filter, $reduit); |
|
| 543 | - } |
|
| 544 | - } |
|
| 545 | - $texte = str_replace($tag[3], $reduit, $texte); |
|
| 546 | - } |
|
| 547 | - } |
|
| 548 | - } |
|
| 549 | - } |
|
| 550 | - statut_effacer_images_temporaires(false); // desactiver pour les appels hors compilo |
|
| 551 | - return $texte; |
|
| 474 | + $filtre = array_shift($args); # enlever $filtre |
|
| 475 | + $texte = array_shift($args); |
|
| 476 | + if ($texte === null || !strlen($texte)) { |
|
| 477 | + return ''; |
|
| 478 | + } |
|
| 479 | + find_in_path('filtres_images_mini.php', 'inc/', true); |
|
| 480 | + statut_effacer_images_temporaires(true); // activer la suppression des images temporaires car le compilo finit la chaine par un image_graver |
|
| 481 | + // Cas du nom de fichier local |
|
| 482 | + $is_file = trim($texte); |
|
| 483 | + if ( |
|
| 484 | + strpos(substr($is_file, strlen(_DIR_RACINE)), '..') !== false |
|
| 485 | + or strpbrk($is_file, "<>\n\r\t") !== false |
|
| 486 | + or strpos($is_file, '/') === 0 |
|
| 487 | + ) { |
|
| 488 | + $is_file = false; |
|
| 489 | + } |
|
| 490 | + if ($is_file) { |
|
| 491 | + $is_local_file = function ($path) { |
|
| 492 | + if (strpos($path, '?') !== false) { |
|
| 493 | + $path = supprimer_timestamp($path); |
|
| 494 | + // remove ?24px added by find_in_theme on .svg files |
|
| 495 | + $path = preg_replace(',\?[[:digit:]]+(px)$,', '', $path); |
|
| 496 | + } |
|
| 497 | + return file_exists($path); |
|
| 498 | + }; |
|
| 499 | + if ($is_local_file($is_file) or tester_url_absolue($is_file)) { |
|
| 500 | + $res = $filtre("<img src='$is_file' />", ...$args); |
|
| 501 | + statut_effacer_images_temporaires(false); // desactiver pour les appels hors compilo |
|
| 502 | + return $res; |
|
| 503 | + } |
|
| 504 | + } |
|
| 505 | + |
|
| 506 | + // Cas general : trier toutes les images, avec eventuellement leur <span> |
|
| 507 | + if ( |
|
| 508 | + preg_match_all( |
|
| 509 | + ',(<([a-z]+) [^<>]*spip_documents[^<>]*>)?\s*(<img\s.*>),UimsS', |
|
| 510 | + $texte, |
|
| 511 | + $tags, |
|
| 512 | + PREG_SET_ORDER |
|
| 513 | + ) |
|
| 514 | + ) { |
|
| 515 | + foreach ($tags as $tag) { |
|
| 516 | + $class = extraire_attribut($tag[3], 'class'); |
|
| 517 | + if ( |
|
| 518 | + !$class or |
|
| 519 | + (strpos($class, 'filtre_inactif') === false |
|
| 520 | + // compat historique a virer en 3.2 |
|
| 521 | + and !str_contains($class, 'no_image_filtrer')) |
|
| 522 | + ) { |
|
| 523 | + if ($reduit = $filtre($tag[3], ...$args)) { |
|
| 524 | + // En cas de span spip_documents, modifier le style=...width: |
|
| 525 | + if ($tag[1]) { |
|
| 526 | + $w = extraire_attribut($reduit, 'width'); |
|
| 527 | + if (!$w and preg_match(',width:\s*(\d+)px,S', extraire_attribut($reduit, 'style'), $regs)) { |
|
| 528 | + $w = $regs[1]; |
|
| 529 | + } |
|
| 530 | + if ($w and ($style = extraire_attribut($tag[1], 'style'))) { |
|
| 531 | + $style = preg_replace(',width:\s*\d+px,S', "width:{$w}px", $style); |
|
| 532 | + $replace = inserer_attribut($tag[1], 'style', $style); |
|
| 533 | + $texte = str_replace($tag[1], $replace, $texte); |
|
| 534 | + } |
|
| 535 | + } |
|
| 536 | + // traiter aussi un eventuel mouseover |
|
| 537 | + if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
|
| 538 | + if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
|
| 539 | + $srcover = $match[1]; |
|
| 540 | + $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 541 | + $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
|
| 542 | + $reduit = str_replace($srcover, $srcover_filter, $reduit); |
|
| 543 | + } |
|
| 544 | + } |
|
| 545 | + $texte = str_replace($tag[3], $reduit, $texte); |
|
| 546 | + } |
|
| 547 | + } |
|
| 548 | + } |
|
| 549 | + } |
|
| 550 | + statut_effacer_images_temporaires(false); // desactiver pour les appels hors compilo |
|
| 551 | + return $texte; |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | /** |
@@ -565,91 +565,91 @@ discard block |
||
| 565 | 565 | **/ |
| 566 | 566 | function infos_image($img, $force_refresh = false) { |
| 567 | 567 | |
| 568 | - static $largeur_img = [], $hauteur_img = [], $poids_img = []; |
|
| 569 | - $srcWidth = 0; |
|
| 570 | - $srcHeight = 0; |
|
| 571 | - $srcSize = null; |
|
| 572 | - |
|
| 573 | - $src = extraire_attribut($img, 'src'); |
|
| 574 | - |
|
| 575 | - if (!$src) { |
|
| 576 | - $src = $img; |
|
| 577 | - } else { |
|
| 578 | - $srcWidth = extraire_attribut($img, 'width'); |
|
| 579 | - $srcHeight = extraire_attribut($img, 'height'); |
|
| 580 | - } |
|
| 581 | - |
|
| 582 | - // ne jamais operer directement sur une image distante pour des raisons de perfo |
|
| 583 | - // la copie locale a toutes les chances d'etre la ou de resservir |
|
| 584 | - if (tester_url_absolue($src)) { |
|
| 585 | - include_spip('inc/distant'); |
|
| 586 | - $fichier = copie_locale($src); |
|
| 587 | - $src = $fichier ? _DIR_RACINE . $fichier : $src; |
|
| 588 | - } |
|
| 589 | - if (($p = strpos($src, '?')) !== false) { |
|
| 590 | - $src = substr($src, 0, $p); |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - $imagesize = false; |
|
| 594 | - if (isset($largeur_img[$src]) and !$force_refresh) { |
|
| 595 | - $srcWidth = $largeur_img[$src]; |
|
| 596 | - } |
|
| 597 | - if (isset($hauteur_img[$src]) and !$force_refresh) { |
|
| 598 | - $srcHeight = $hauteur_img[$src]; |
|
| 599 | - } |
|
| 600 | - if (isset($poids_img[$src]) and !$force_refresh) { |
|
| 601 | - $srcSize = $poids_img[$src]; |
|
| 602 | - } |
|
| 603 | - if (!$srcWidth or !$srcHeight or is_null($srcSize)) { |
|
| 604 | - if ( |
|
| 605 | - file_exists($src) |
|
| 606 | - and $imagesize = spip_getimagesize($src) |
|
| 607 | - ) { |
|
| 608 | - if (!$srcWidth) { |
|
| 609 | - $largeur_img[$src] = $srcWidth = $imagesize[0]; |
|
| 610 | - } |
|
| 611 | - if (!$srcHeight) { |
|
| 612 | - $hauteur_img[$src] = $srcHeight = $imagesize[1]; |
|
| 613 | - } |
|
| 614 | - if (!$srcSize) { |
|
| 615 | - $poids_img[$src] = filesize($src); |
|
| 616 | - } |
|
| 617 | - } |
|
| 618 | - elseif (strpos($src, '<svg') !== false) { |
|
| 619 | - include_spip('inc/svg'); |
|
| 620 | - if ($attrs = svg_lire_attributs($src)) { |
|
| 621 | - [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
|
| 622 | - if (!$srcWidth) { |
|
| 623 | - $largeur_img[$src] = $srcWidth = $width; |
|
| 624 | - } |
|
| 625 | - if (!$srcHeight) { |
|
| 626 | - $hauteur_img[$src] = $srcHeight = $height; |
|
| 627 | - } |
|
| 628 | - if (!$srcSize) { |
|
| 629 | - $poids_img[$src] = $srcSize = strlen($src); |
|
| 630 | - } |
|
| 631 | - } |
|
| 632 | - } |
|
| 633 | - // $src peut etre une reference a une image temporaire dont a n'a que le log .src |
|
| 634 | - // on s'y refere, l'image sera reconstruite en temps utile si necessaire |
|
| 635 | - elseif ( |
|
| 636 | - @file_exists($f = "$src.src") |
|
| 637 | - and lire_fichier($f, $valeurs) |
|
| 638 | - and $valeurs = unserialize($valeurs) |
|
| 639 | - ) { |
|
| 640 | - if (!$srcWidth) { |
|
| 641 | - $largeur_img[$src] = $srcWidth = $valeurs['largeur_dest']; |
|
| 642 | - } |
|
| 643 | - if (!$srcHeight) { |
|
| 644 | - $hauteur_img[$src] = $srcHeight = $valeurs['hauteur_dest']; |
|
| 645 | - } |
|
| 646 | - if (!$srcSize) { |
|
| 647 | - $poids_img[$src] = $srcSize = 0; |
|
| 648 | - } |
|
| 649 | - } |
|
| 650 | - } |
|
| 651 | - |
|
| 652 | - return ['hauteur' => $srcHeight, 'largeur' => $srcWidth, 'poids' => $srcSize]; |
|
| 568 | + static $largeur_img = [], $hauteur_img = [], $poids_img = []; |
|
| 569 | + $srcWidth = 0; |
|
| 570 | + $srcHeight = 0; |
|
| 571 | + $srcSize = null; |
|
| 572 | + |
|
| 573 | + $src = extraire_attribut($img, 'src'); |
|
| 574 | + |
|
| 575 | + if (!$src) { |
|
| 576 | + $src = $img; |
|
| 577 | + } else { |
|
| 578 | + $srcWidth = extraire_attribut($img, 'width'); |
|
| 579 | + $srcHeight = extraire_attribut($img, 'height'); |
|
| 580 | + } |
|
| 581 | + |
|
| 582 | + // ne jamais operer directement sur une image distante pour des raisons de perfo |
|
| 583 | + // la copie locale a toutes les chances d'etre la ou de resservir |
|
| 584 | + if (tester_url_absolue($src)) { |
|
| 585 | + include_spip('inc/distant'); |
|
| 586 | + $fichier = copie_locale($src); |
|
| 587 | + $src = $fichier ? _DIR_RACINE . $fichier : $src; |
|
| 588 | + } |
|
| 589 | + if (($p = strpos($src, '?')) !== false) { |
|
| 590 | + $src = substr($src, 0, $p); |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + $imagesize = false; |
|
| 594 | + if (isset($largeur_img[$src]) and !$force_refresh) { |
|
| 595 | + $srcWidth = $largeur_img[$src]; |
|
| 596 | + } |
|
| 597 | + if (isset($hauteur_img[$src]) and !$force_refresh) { |
|
| 598 | + $srcHeight = $hauteur_img[$src]; |
|
| 599 | + } |
|
| 600 | + if (isset($poids_img[$src]) and !$force_refresh) { |
|
| 601 | + $srcSize = $poids_img[$src]; |
|
| 602 | + } |
|
| 603 | + if (!$srcWidth or !$srcHeight or is_null($srcSize)) { |
|
| 604 | + if ( |
|
| 605 | + file_exists($src) |
|
| 606 | + and $imagesize = spip_getimagesize($src) |
|
| 607 | + ) { |
|
| 608 | + if (!$srcWidth) { |
|
| 609 | + $largeur_img[$src] = $srcWidth = $imagesize[0]; |
|
| 610 | + } |
|
| 611 | + if (!$srcHeight) { |
|
| 612 | + $hauteur_img[$src] = $srcHeight = $imagesize[1]; |
|
| 613 | + } |
|
| 614 | + if (!$srcSize) { |
|
| 615 | + $poids_img[$src] = filesize($src); |
|
| 616 | + } |
|
| 617 | + } |
|
| 618 | + elseif (strpos($src, '<svg') !== false) { |
|
| 619 | + include_spip('inc/svg'); |
|
| 620 | + if ($attrs = svg_lire_attributs($src)) { |
|
| 621 | + [$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs); |
|
| 622 | + if (!$srcWidth) { |
|
| 623 | + $largeur_img[$src] = $srcWidth = $width; |
|
| 624 | + } |
|
| 625 | + if (!$srcHeight) { |
|
| 626 | + $hauteur_img[$src] = $srcHeight = $height; |
|
| 627 | + } |
|
| 628 | + if (!$srcSize) { |
|
| 629 | + $poids_img[$src] = $srcSize = strlen($src); |
|
| 630 | + } |
|
| 631 | + } |
|
| 632 | + } |
|
| 633 | + // $src peut etre une reference a une image temporaire dont a n'a que le log .src |
|
| 634 | + // on s'y refere, l'image sera reconstruite en temps utile si necessaire |
|
| 635 | + elseif ( |
|
| 636 | + @file_exists($f = "$src.src") |
|
| 637 | + and lire_fichier($f, $valeurs) |
|
| 638 | + and $valeurs = unserialize($valeurs) |
|
| 639 | + ) { |
|
| 640 | + if (!$srcWidth) { |
|
| 641 | + $largeur_img[$src] = $srcWidth = $valeurs['largeur_dest']; |
|
| 642 | + } |
|
| 643 | + if (!$srcHeight) { |
|
| 644 | + $hauteur_img[$src] = $srcHeight = $valeurs['hauteur_dest']; |
|
| 645 | + } |
|
| 646 | + if (!$srcSize) { |
|
| 647 | + $poids_img[$src] = $srcSize = 0; |
|
| 648 | + } |
|
| 649 | + } |
|
| 650 | + } |
|
| 651 | + |
|
| 652 | + return ['hauteur' => $srcHeight, 'largeur' => $srcWidth, 'poids' => $srcSize]; |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | /** |
@@ -665,13 +665,13 @@ discard block |
||
| 665 | 665 | * poids |
| 666 | 666 | **/ |
| 667 | 667 | function poids_image($img, $force_refresh = false) { |
| 668 | - $infos = infos_image($img, $force_refresh); |
|
| 669 | - return $infos['poids']; |
|
| 668 | + $infos = infos_image($img, $force_refresh); |
|
| 669 | + return $infos['poids']; |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | function taille_image($img, $force_refresh = false) { |
| 673 | - $infos = infos_image($img, $force_refresh); |
|
| 674 | - return [$infos['hauteur'], $infos['largeur']]; |
|
| 673 | + $infos = infos_image($img, $force_refresh); |
|
| 674 | + return [$infos['hauteur'], $infos['largeur']]; |
|
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | /** |
@@ -688,12 +688,12 @@ discard block |
||
| 688 | 688 | * Largeur en pixels, NULL ou 0 si aucune image. |
| 689 | 689 | **/ |
| 690 | 690 | function largeur($img) { |
| 691 | - if (!$img) { |
|
| 692 | - return; |
|
| 693 | - } |
|
| 694 | - [$h, $l] = taille_image($img); |
|
| 691 | + if (!$img) { |
|
| 692 | + return; |
|
| 693 | + } |
|
| 694 | + [$h, $l] = taille_image($img); |
|
| 695 | 695 | |
| 696 | - return $l; |
|
| 696 | + return $l; |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -710,12 +710,12 @@ discard block |
||
| 710 | 710 | * Hauteur en pixels, NULL ou 0 si aucune image. |
| 711 | 711 | **/ |
| 712 | 712 | function hauteur($img) { |
| 713 | - if (!$img) { |
|
| 714 | - return; |
|
| 715 | - } |
|
| 716 | - [$h, $l] = taille_image($img); |
|
| 713 | + if (!$img) { |
|
| 714 | + return; |
|
| 715 | + } |
|
| 716 | + [$h, $l] = taille_image($img); |
|
| 717 | 717 | |
| 718 | - return $h; |
|
| 718 | + return $h; |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | |
@@ -735,11 +735,11 @@ discard block |
||
| 735 | 735 | * @return string |
| 736 | 736 | **/ |
| 737 | 737 | function corriger_entites_html($texte) { |
| 738 | - if (strpos($texte, '&') === false) { |
|
| 739 | - return $texte; |
|
| 740 | - } |
|
| 738 | + if (strpos($texte, '&') === false) { |
|
| 739 | + return $texte; |
|
| 740 | + } |
|
| 741 | 741 | |
| 742 | - return preg_replace(',&(#[0-9][0-9][0-9]+;|amp;),iS', '&\1', $texte); |
|
| 742 | + return preg_replace(',&(#[0-9][0-9][0-9]+;|amp;),iS', '&\1', $texte); |
|
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | /** |
@@ -754,11 +754,11 @@ discard block |
||
| 754 | 754 | * @return string |
| 755 | 755 | **/ |
| 756 | 756 | function corriger_toutes_entites_html($texte) { |
| 757 | - if (strpos($texte, '&') === false) { |
|
| 758 | - return $texte; |
|
| 759 | - } |
|
| 757 | + if (strpos($texte, '&') === false) { |
|
| 758 | + return $texte; |
|
| 759 | + } |
|
| 760 | 760 | |
| 761 | - return preg_replace(',&(#?[a-z0-9]+;),iS', '&\1', $texte); |
|
| 761 | + return preg_replace(',&(#?[a-z0-9]+;),iS', '&\1', $texte); |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | /** |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | * @return string |
| 769 | 769 | **/ |
| 770 | 770 | function proteger_amp($texte) { |
| 771 | - return str_replace('&', '&', $texte); |
|
| 771 | + return str_replace('&', '&', $texte); |
|
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | |
@@ -799,21 +799,21 @@ discard block |
||
| 799 | 799 | * @return mixed|string |
| 800 | 800 | */ |
| 801 | 801 | function entites_html($texte, $tout = false, $quote = true) { |
| 802 | - if ( |
|
| 803 | - !is_string($texte) or !$texte |
|
| 804 | - or strpbrk($texte, "&\"'<>") == false |
|
| 805 | - ) { |
|
| 806 | - return $texte; |
|
| 807 | - } |
|
| 808 | - include_spip('inc/texte'); |
|
| 809 | - $flags = ($quote ? ENT_QUOTES : ENT_NOQUOTES); |
|
| 810 | - $flags |= ENT_HTML401; |
|
| 811 | - $texte = spip_htmlspecialchars(echappe_retour(echappe_html($texte, '', true), '', 'proteger_amp'), $flags); |
|
| 812 | - if ($tout) { |
|
| 813 | - return corriger_toutes_entites_html($texte); |
|
| 814 | - } else { |
|
| 815 | - return corriger_entites_html($texte); |
|
| 816 | - } |
|
| 802 | + if ( |
|
| 803 | + !is_string($texte) or !$texte |
|
| 804 | + or strpbrk($texte, "&\"'<>") == false |
|
| 805 | + ) { |
|
| 806 | + return $texte; |
|
| 807 | + } |
|
| 808 | + include_spip('inc/texte'); |
|
| 809 | + $flags = ($quote ? ENT_QUOTES : ENT_NOQUOTES); |
|
| 810 | + $flags |= ENT_HTML401; |
|
| 811 | + $texte = spip_htmlspecialchars(echappe_retour(echappe_html($texte, '', true), '', 'proteger_amp'), $flags); |
|
| 812 | + if ($tout) { |
|
| 813 | + return corriger_toutes_entites_html($texte); |
|
| 814 | + } else { |
|
| 815 | + return corriger_entites_html($texte); |
|
| 816 | + } |
|
| 817 | 817 | } |
| 818 | 818 | |
| 819 | 819 | /** |
@@ -832,38 +832,38 @@ discard block |
||
| 832 | 832 | * texte converti |
| 833 | 833 | **/ |
| 834 | 834 | function filtrer_entites(?string $texte): string { |
| 835 | - $texte ??= ''; |
|
| 836 | - if (strpos($texte, '&') === false) { |
|
| 837 | - return $texte; |
|
| 838 | - } |
|
| 839 | - // filtrer |
|
| 840 | - $texte = html2unicode($texte); |
|
| 841 | - // remettre le tout dans le charset cible |
|
| 842 | - $texte = unicode2charset($texte); |
|
| 843 | - // cas particulier des " et ' qu'il faut filtrer aussi |
|
| 844 | - // (on le faisait deja avec un ") |
|
| 845 | - if (strpos($texte, '&#') !== false) { |
|
| 846 | - $texte = str_replace([''', ''', '"', '"'], ["'", "'", '"', '"'], $texte); |
|
| 847 | - } |
|
| 835 | + $texte ??= ''; |
|
| 836 | + if (strpos($texte, '&') === false) { |
|
| 837 | + return $texte; |
|
| 838 | + } |
|
| 839 | + // filtrer |
|
| 840 | + $texte = html2unicode($texte); |
|
| 841 | + // remettre le tout dans le charset cible |
|
| 842 | + $texte = unicode2charset($texte); |
|
| 843 | + // cas particulier des " et ' qu'il faut filtrer aussi |
|
| 844 | + // (on le faisait deja avec un ") |
|
| 845 | + if (strpos($texte, '&#') !== false) { |
|
| 846 | + $texte = str_replace([''', ''', '"', '"'], ["'", "'", '"', '"'], $texte); |
|
| 847 | + } |
|
| 848 | 848 | |
| 849 | - return $texte; |
|
| 849 | + return $texte; |
|
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | |
| 853 | 853 | if (!function_exists('filtre_filtrer_entites_dist')) { |
| 854 | - /** |
|
| 855 | - * Version sécurisée de filtrer_entites |
|
| 856 | - * |
|
| 857 | - * @uses interdire_scripts() |
|
| 858 | - * @uses filtrer_entites() |
|
| 859 | - * |
|
| 860 | - * @param string $t |
|
| 861 | - * @return string |
|
| 862 | - */ |
|
| 863 | - function filtre_filtrer_entites_dist($t) { |
|
| 864 | - include_spip('inc/texte'); |
|
| 865 | - return interdire_scripts(filtrer_entites($t)); |
|
| 866 | - } |
|
| 854 | + /** |
|
| 855 | + * Version sécurisée de filtrer_entites |
|
| 856 | + * |
|
| 857 | + * @uses interdire_scripts() |
|
| 858 | + * @uses filtrer_entites() |
|
| 859 | + * |
|
| 860 | + * @param string $t |
|
| 861 | + * @return string |
|
| 862 | + */ |
|
| 863 | + function filtre_filtrer_entites_dist($t) { |
|
| 864 | + include_spip('inc/texte'); |
|
| 865 | + return interdire_scripts(filtrer_entites($t)); |
|
| 866 | + } |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | |
@@ -878,18 +878,18 @@ discard block |
||
| 878 | 878 | * @return string|array |
| 879 | 879 | **/ |
| 880 | 880 | function supprimer_caracteres_illegaux($texte) { |
| 881 | - static $from = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\xB\xC\xE\xF\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; |
|
| 882 | - static $to = null; |
|
| 881 | + static $from = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\xB\xC\xE\xF\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; |
|
| 882 | + static $to = null; |
|
| 883 | 883 | |
| 884 | - if (is_array($texte)) { |
|
| 885 | - return array_map('supprimer_caracteres_illegaux', $texte); |
|
| 886 | - } |
|
| 884 | + if (is_array($texte)) { |
|
| 885 | + return array_map('supprimer_caracteres_illegaux', $texte); |
|
| 886 | + } |
|
| 887 | 887 | |
| 888 | - if (!$to) { |
|
| 889 | - $to = str_repeat('-', strlen($from)); |
|
| 890 | - } |
|
| 888 | + if (!$to) { |
|
| 889 | + $to = str_repeat('-', strlen($from)); |
|
| 890 | + } |
|
| 891 | 891 | |
| 892 | - return strtr($texte, $from, $to); |
|
| 892 | + return strtr($texte, $from, $to); |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | /** |
@@ -901,10 +901,10 @@ discard block |
||
| 901 | 901 | * @return string|array |
| 902 | 902 | **/ |
| 903 | 903 | function corriger_caracteres($texte) { |
| 904 | - $texte = corriger_caracteres_windows($texte); |
|
| 905 | - $texte = supprimer_caracteres_illegaux($texte); |
|
| 904 | + $texte = corriger_caracteres_windows($texte); |
|
| 905 | + $texte = supprimer_caracteres_illegaux($texte); |
|
| 906 | 906 | |
| 907 | - return $texte; |
|
| 907 | + return $texte; |
|
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | /** |
@@ -921,44 +921,44 @@ discard block |
||
| 921 | 921 | * texte encodé pour XML |
| 922 | 922 | */ |
| 923 | 923 | function texte_backend(string $texte): string { |
| 924 | - if ($texte === '') { |
|
| 925 | - return ''; |
|
| 926 | - } |
|
| 924 | + if ($texte === '') { |
|
| 925 | + return ''; |
|
| 926 | + } |
|
| 927 | 927 | |
| 928 | - static $apostrophe = ['’', "'"]; # n'allouer qu'une fois |
|
| 928 | + static $apostrophe = ['’', "'"]; # n'allouer qu'une fois |
|
| 929 | 929 | |
| 930 | - // si on a des liens ou des images, les passer en absolu |
|
| 931 | - $texte = liens_absolus($texte); |
|
| 930 | + // si on a des liens ou des images, les passer en absolu |
|
| 931 | + $texte = liens_absolus($texte); |
|
| 932 | 932 | |
| 933 | - // echapper les tags > < |
|
| 934 | - $texte = preg_replace(',&(gt|lt);,S', '&\1;', $texte); |
|
| 933 | + // echapper les tags > < |
|
| 934 | + $texte = preg_replace(',&(gt|lt);,S', '&\1;', $texte); |
|
| 935 | 935 | |
| 936 | - // importer les é |
|
| 937 | - $texte = filtrer_entites($texte); |
|
| 936 | + // importer les é |
|
| 937 | + $texte = filtrer_entites($texte); |
|
| 938 | 938 | |
| 939 | - // " -> " et tout ce genre de choses |
|
| 940 | - $u = $GLOBALS['meta']['pcre_u']; |
|
| 941 | - $texte = str_replace(' ', ' ', $texte); |
|
| 942 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 943 | - // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
|
| 944 | - $texte = entites_html($texte, false, false); |
|
| 945 | - // mais bien echapper les double quotes ! |
|
| 946 | - $texte = str_replace('"', '"', $texte); |
|
| 939 | + // " -> " et tout ce genre de choses |
|
| 940 | + $u = $GLOBALS['meta']['pcre_u']; |
|
| 941 | + $texte = str_replace(' ', ' ', $texte); |
|
| 942 | + $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 943 | + // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
|
| 944 | + $texte = entites_html($texte, false, false); |
|
| 945 | + // mais bien echapper les double quotes ! |
|
| 946 | + $texte = str_replace('"', '"', $texte); |
|
| 947 | 947 | |
| 948 | - // verifier le charset |
|
| 949 | - $texte = charset2unicode($texte); |
|
| 948 | + // verifier le charset |
|
| 949 | + $texte = charset2unicode($texte); |
|
| 950 | 950 | |
| 951 | - // Caracteres problematiques en iso-latin 1 |
|
| 952 | - if (isset($GLOBALS['meta']['charset']) and $GLOBALS['meta']['charset'] == 'iso-8859-1') { |
|
| 953 | - $texte = str_replace(chr(156), 'œ', $texte); |
|
| 954 | - $texte = str_replace(chr(140), 'Œ', $texte); |
|
| 955 | - $texte = str_replace(chr(159), 'Ÿ', $texte); |
|
| 956 | - } |
|
| 951 | + // Caracteres problematiques en iso-latin 1 |
|
| 952 | + if (isset($GLOBALS['meta']['charset']) and $GLOBALS['meta']['charset'] == 'iso-8859-1') { |
|
| 953 | + $texte = str_replace(chr(156), 'œ', $texte); |
|
| 954 | + $texte = str_replace(chr(140), 'Œ', $texte); |
|
| 955 | + $texte = str_replace(chr(159), 'Ÿ', $texte); |
|
| 956 | + } |
|
| 957 | 957 | |
| 958 | - // l'apostrophe curly pose probleme a certains lecteure de RSS |
|
| 959 | - // et le caractere apostrophe alourdit les squelettes avec PHP |
|
| 960 | - // ==> on les remplace par l'entite HTML |
|
| 961 | - return str_replace($apostrophe, "'", $texte); |
|
| 958 | + // l'apostrophe curly pose probleme a certains lecteure de RSS |
|
| 959 | + // et le caractere apostrophe alourdit les squelettes avec PHP |
|
| 960 | + // ==> on les remplace par l'entite HTML |
|
| 961 | + return str_replace($apostrophe, "'", $texte); |
|
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | /** |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | * texte encodé et quote pour XML |
| 976 | 976 | */ |
| 977 | 977 | function texte_backendq(string $texte): string { |
| 978 | - return addslashes(texte_backend($texte)); |
|
| 978 | + return addslashes(texte_backend($texte)); |
|
| 979 | 979 | } |
| 980 | 980 | |
| 981 | 981 | |
@@ -997,14 +997,14 @@ discard block |
||
| 997 | 997 | * Texte sans son numéro éventuel |
| 998 | 998 | **/ |
| 999 | 999 | function supprimer_numero(?string $texte): string { |
| 1000 | - if ($texte === null) { |
|
| 1001 | - return ''; |
|
| 1002 | - } |
|
| 1003 | - return preg_replace( |
|
| 1004 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1005 | - '', |
|
| 1006 | - $texte |
|
| 1007 | - ); |
|
| 1000 | + if ($texte === null) { |
|
| 1001 | + return ''; |
|
| 1002 | + } |
|
| 1003 | + return preg_replace( |
|
| 1004 | + ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1005 | + '', |
|
| 1006 | + $texte |
|
| 1007 | + ); |
|
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | /** |
@@ -1027,18 +1027,18 @@ discard block |
||
| 1027 | 1027 | * Numéro de titre, sinon chaîne vide |
| 1028 | 1028 | **/ |
| 1029 | 1029 | function recuperer_numero(?string $texte): string { |
| 1030 | - if ( |
|
| 1031 | - $texte and |
|
| 1032 | - preg_match( |
|
| 1033 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1034 | - $texte, |
|
| 1035 | - $regs |
|
| 1036 | - ) |
|
| 1037 | - ) { |
|
| 1038 | - return strval($regs[1]); |
|
| 1039 | - } else { |
|
| 1040 | - return ''; |
|
| 1041 | - } |
|
| 1030 | + if ( |
|
| 1031 | + $texte and |
|
| 1032 | + preg_match( |
|
| 1033 | + ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1034 | + $texte, |
|
| 1035 | + $regs |
|
| 1036 | + ) |
|
| 1037 | + ) { |
|
| 1038 | + return strval($regs[1]); |
|
| 1039 | + } else { |
|
| 1040 | + return ''; |
|
| 1041 | + } |
|
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | /** |
@@ -1065,16 +1065,16 @@ discard block |
||
| 1065 | 1065 | * texte ou tableau de textes converti |
| 1066 | 1066 | **/ |
| 1067 | 1067 | function supprimer_tags($texte, $rempl = '') { |
| 1068 | - if ($texte === null) { |
|
| 1069 | - return ''; |
|
| 1070 | - } |
|
| 1071 | - $texte = preg_replace(',<(!--|\w|/|!\[endif|!\[if)[^>]*>,US', $rempl, $texte); |
|
| 1072 | - // ne pas oublier un < final non ferme car coupe |
|
| 1073 | - $texte = preg_replace(',<(!--|\w|/).*$,US', $rempl, $texte); |
|
| 1074 | - // mais qui peut aussi etre un simple signe plus petit que |
|
| 1075 | - $texte = str_replace('<', '<', $texte); |
|
| 1068 | + if ($texte === null) { |
|
| 1069 | + return ''; |
|
| 1070 | + } |
|
| 1071 | + $texte = preg_replace(',<(!--|\w|/|!\[endif|!\[if)[^>]*>,US', $rempl, $texte); |
|
| 1072 | + // ne pas oublier un < final non ferme car coupe |
|
| 1073 | + $texte = preg_replace(',<(!--|\w|/).*$,US', $rempl, $texte); |
|
| 1074 | + // mais qui peut aussi etre un simple signe plus petit que |
|
| 1075 | + $texte = str_replace('<', '<', $texte); |
|
| 1076 | 1076 | |
| 1077 | - return $texte; |
|
| 1077 | + return $texte; |
|
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | 1080 | /** |
@@ -1097,9 +1097,9 @@ discard block |
||
| 1097 | 1097 | * texte converti |
| 1098 | 1098 | **/ |
| 1099 | 1099 | function echapper_tags($texte, $rempl = '') { |
| 1100 | - $texte = preg_replace('/<([^>]*)>/', "<\\1>", $texte); |
|
| 1100 | + $texte = preg_replace('/<([^>]*)>/', "<\\1>", $texte); |
|
| 1101 | 1101 | |
| 1102 | - return $texte; |
|
| 1102 | + return $texte; |
|
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | /** |
@@ -1120,18 +1120,18 @@ discard block |
||
| 1120 | 1120 | * texte converti |
| 1121 | 1121 | **/ |
| 1122 | 1122 | function textebrut($texte) { |
| 1123 | - $u = $GLOBALS['meta']['pcre_u']; |
|
| 1124 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1125 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1126 | - $texte = preg_replace("/^\n+/", '', $texte); |
|
| 1127 | - $texte = preg_replace("/\n+$/", '', $texte); |
|
| 1128 | - $texte = preg_replace("/\n +/", "\n", $texte); |
|
| 1129 | - $texte = supprimer_tags($texte); |
|
| 1130 | - $texte = preg_replace('/( | )+/S', ' ', $texte); |
|
| 1131 | - // nettoyer l'apostrophe curly qui pose probleme a certains rss-readers, lecteurs de mail... |
|
| 1132 | - $texte = str_replace('’', "'", $texte); |
|
| 1123 | + $u = $GLOBALS['meta']['pcre_u']; |
|
| 1124 | + $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1125 | + $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1126 | + $texte = preg_replace("/^\n+/", '', $texte); |
|
| 1127 | + $texte = preg_replace("/\n+$/", '', $texte); |
|
| 1128 | + $texte = preg_replace("/\n +/", "\n", $texte); |
|
| 1129 | + $texte = supprimer_tags($texte); |
|
| 1130 | + $texte = preg_replace('/( | )+/S', ' ', $texte); |
|
| 1131 | + // nettoyer l'apostrophe curly qui pose probleme a certains rss-readers, lecteurs de mail... |
|
| 1132 | + $texte = str_replace('’', "'", $texte); |
|
| 1133 | 1133 | |
| 1134 | - return $texte; |
|
| 1134 | + return $texte; |
|
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | |
@@ -1147,23 +1147,23 @@ discard block |
||
| 1147 | 1147 | * texte avec liens ouvrants |
| 1148 | 1148 | **/ |
| 1149 | 1149 | function liens_ouvrants($texte) { |
| 1150 | - if ( |
|
| 1151 | - preg_match_all( |
|
| 1152 | - ",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
|
| 1153 | - $texte, |
|
| 1154 | - $liens, |
|
| 1155 | - PREG_PATTERN_ORDER |
|
| 1156 | - ) |
|
| 1157 | - ) { |
|
| 1158 | - foreach ($liens[0] as $a) { |
|
| 1159 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1160 | - $ablank = inserer_attribut($a, 'rel', $rel); |
|
| 1161 | - $ablank = inserer_attribut($ablank, 'target', '_blank'); |
|
| 1162 | - $texte = str_replace($a, $ablank, $texte); |
|
| 1163 | - } |
|
| 1164 | - } |
|
| 1165 | - |
|
| 1166 | - return $texte; |
|
| 1150 | + if ( |
|
| 1151 | + preg_match_all( |
|
| 1152 | + ",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
|
| 1153 | + $texte, |
|
| 1154 | + $liens, |
|
| 1155 | + PREG_PATTERN_ORDER |
|
| 1156 | + ) |
|
| 1157 | + ) { |
|
| 1158 | + foreach ($liens[0] as $a) { |
|
| 1159 | + $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1160 | + $ablank = inserer_attribut($a, 'rel', $rel); |
|
| 1161 | + $ablank = inserer_attribut($ablank, 'target', '_blank'); |
|
| 1162 | + $texte = str_replace($a, $ablank, $texte); |
|
| 1163 | + } |
|
| 1164 | + } |
|
| 1165 | + |
|
| 1166 | + return $texte; |
|
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | /** |
@@ -1173,22 +1173,22 @@ discard block |
||
| 1173 | 1173 | * @return string |
| 1174 | 1174 | */ |
| 1175 | 1175 | function liens_nofollow($texte) { |
| 1176 | - if (stripos($texte, '<a') === false) { |
|
| 1177 | - return $texte; |
|
| 1178 | - } |
|
| 1176 | + if (stripos($texte, '<a') === false) { |
|
| 1177 | + return $texte; |
|
| 1178 | + } |
|
| 1179 | 1179 | |
| 1180 | - if (preg_match_all(",<a\b[^>]*>,UimsS", $texte, $regs, PREG_PATTERN_ORDER)) { |
|
| 1181 | - foreach ($regs[0] as $a) { |
|
| 1182 | - $rel = extraire_attribut($a, 'rel') ?? ''; |
|
| 1183 | - if (strpos($rel, 'nofollow') === false) { |
|
| 1184 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1185 | - $anofollow = inserer_attribut($a, 'rel', $rel); |
|
| 1186 | - $texte = str_replace($a, $anofollow, $texte); |
|
| 1187 | - } |
|
| 1188 | - } |
|
| 1189 | - } |
|
| 1180 | + if (preg_match_all(",<a\b[^>]*>,UimsS", $texte, $regs, PREG_PATTERN_ORDER)) { |
|
| 1181 | + foreach ($regs[0] as $a) { |
|
| 1182 | + $rel = extraire_attribut($a, 'rel') ?? ''; |
|
| 1183 | + if (strpos($rel, 'nofollow') === false) { |
|
| 1184 | + $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1185 | + $anofollow = inserer_attribut($a, 'rel', $rel); |
|
| 1186 | + $texte = str_replace($a, $anofollow, $texte); |
|
| 1187 | + } |
|
| 1188 | + } |
|
| 1189 | + } |
|
| 1190 | 1190 | |
| 1191 | - return $texte; |
|
| 1191 | + return $texte; |
|
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | /** |
@@ -1207,12 +1207,12 @@ discard block |
||
| 1207 | 1207 | * texte sans paraghaphes |
| 1208 | 1208 | **/ |
| 1209 | 1209 | function PtoBR($texte) { |
| 1210 | - $u = $GLOBALS['meta']['pcre_u']; |
|
| 1211 | - $texte = preg_replace('@</p>@iS', "\n", $texte); |
|
| 1212 | - $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
|
| 1213 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1210 | + $u = $GLOBALS['meta']['pcre_u']; |
|
| 1211 | + $texte = preg_replace('@</p>@iS', "\n", $texte); |
|
| 1212 | + $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
|
| 1213 | + $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1214 | 1214 | |
| 1215 | - return $texte; |
|
| 1215 | + return $texte; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | |
| 1218 | 1218 | |
@@ -1237,14 +1237,14 @@ discard block |
||
| 1237 | 1237 | * @return string texte encadré du style CSS |
| 1238 | 1238 | */ |
| 1239 | 1239 | function lignes_longues($texte) { |
| 1240 | - if (!strlen(trim($texte))) { |
|
| 1241 | - return $texte; |
|
| 1242 | - } |
|
| 1243 | - include_spip('inc/texte'); |
|
| 1244 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1245 | - 'div' : 'span'; |
|
| 1240 | + if (!strlen(trim($texte))) { |
|
| 1241 | + return $texte; |
|
| 1242 | + } |
|
| 1243 | + include_spip('inc/texte'); |
|
| 1244 | + $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1245 | + 'div' : 'span'; |
|
| 1246 | 1246 | |
| 1247 | - return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
|
| 1247 | + return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
|
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | /** |
@@ -1263,30 +1263,30 @@ discard block |
||
| 1263 | 1263 | * @return string texte en majuscule |
| 1264 | 1264 | */ |
| 1265 | 1265 | function majuscules($texte) { |
| 1266 | - if (!strlen($texte)) { |
|
| 1267 | - return ''; |
|
| 1268 | - } |
|
| 1266 | + if (!strlen($texte)) { |
|
| 1267 | + return ''; |
|
| 1268 | + } |
|
| 1269 | 1269 | |
| 1270 | - // Cas du turc |
|
| 1271 | - if ($GLOBALS['spip_lang'] == 'tr') { |
|
| 1272 | - # remplacer hors des tags et des entites |
|
| 1273 | - if (preg_match_all(',<[^<>]+>|&[^;]+;,S', $texte, $regs, PREG_SET_ORDER)) { |
|
| 1274 | - foreach ($regs as $n => $match) { |
|
| 1275 | - $texte = str_replace($match[0], "@@SPIP_TURC$n@@", $texte); |
|
| 1276 | - } |
|
| 1277 | - } |
|
| 1270 | + // Cas du turc |
|
| 1271 | + if ($GLOBALS['spip_lang'] == 'tr') { |
|
| 1272 | + # remplacer hors des tags et des entites |
|
| 1273 | + if (preg_match_all(',<[^<>]+>|&[^;]+;,S', $texte, $regs, PREG_SET_ORDER)) { |
|
| 1274 | + foreach ($regs as $n => $match) { |
|
| 1275 | + $texte = str_replace($match[0], "@@SPIP_TURC$n@@", $texte); |
|
| 1276 | + } |
|
| 1277 | + } |
|
| 1278 | 1278 | |
| 1279 | - $texte = str_replace('i', 'İ', $texte); |
|
| 1279 | + $texte = str_replace('i', 'İ', $texte); |
|
| 1280 | 1280 | |
| 1281 | - if ($regs) { |
|
| 1282 | - foreach ($regs as $n => $match) { |
|
| 1283 | - $texte = str_replace("@@SPIP_TURC$n@@", $match[0], $texte); |
|
| 1284 | - } |
|
| 1285 | - } |
|
| 1286 | - } |
|
| 1281 | + if ($regs) { |
|
| 1282 | + foreach ($regs as $n => $match) { |
|
| 1283 | + $texte = str_replace("@@SPIP_TURC$n@@", $match[0], $texte); |
|
| 1284 | + } |
|
| 1285 | + } |
|
| 1286 | + } |
|
| 1287 | 1287 | |
| 1288 | - // Cas general |
|
| 1289 | - return "<span style='text-transform: uppercase;'>$texte</span>"; |
|
| 1288 | + // Cas general |
|
| 1289 | + return "<span style='text-transform: uppercase;'>$texte</span>"; |
|
| 1290 | 1290 | } |
| 1291 | 1291 | |
| 1292 | 1292 | /** |
@@ -1308,38 +1308,38 @@ discard block |
||
| 1308 | 1308 | */ |
| 1309 | 1309 | function taille_en_octets($octets, $systeme = 'BI') { |
| 1310 | 1310 | |
| 1311 | - // Texte à afficher pour la taille |
|
| 1312 | - $affichage = ''; |
|
| 1311 | + // Texte à afficher pour la taille |
|
| 1312 | + $affichage = ''; |
|
| 1313 | 1313 | |
| 1314 | - static $unites = ['octets', 'ko', 'mo', 'go']; |
|
| 1315 | - static $precisions = [0, 1, 1, 2]; |
|
| 1314 | + static $unites = ['octets', 'ko', 'mo', 'go']; |
|
| 1315 | + static $precisions = [0, 1, 1, 2]; |
|
| 1316 | 1316 | |
| 1317 | - if ($octets >= 1) { |
|
| 1318 | - // Déterminer le nombre d'octets représentant le kilo en fonction du système choisi |
|
| 1319 | - $systeme = strtolower($systeme); |
|
| 1320 | - if ($systeme === 'bi') { |
|
| 1321 | - $kilo = 1024; |
|
| 1322 | - $suffixe_item = "_$systeme"; |
|
| 1323 | - } elseif ($systeme === 'si') { |
|
| 1324 | - $kilo = 1000; |
|
| 1325 | - $suffixe_item = ''; |
|
| 1326 | - } else { |
|
| 1327 | - return $affichage; |
|
| 1328 | - } |
|
| 1317 | + if ($octets >= 1) { |
|
| 1318 | + // Déterminer le nombre d'octets représentant le kilo en fonction du système choisi |
|
| 1319 | + $systeme = strtolower($systeme); |
|
| 1320 | + if ($systeme === 'bi') { |
|
| 1321 | + $kilo = 1024; |
|
| 1322 | + $suffixe_item = "_$systeme"; |
|
| 1323 | + } elseif ($systeme === 'si') { |
|
| 1324 | + $kilo = 1000; |
|
| 1325 | + $suffixe_item = ''; |
|
| 1326 | + } else { |
|
| 1327 | + return $affichage; |
|
| 1328 | + } |
|
| 1329 | 1329 | |
| 1330 | - // Identification de la puissance en "kilo" correspondant à l'unité la plus appropriée |
|
| 1331 | - $puissance = floor(log($octets, $kilo)); |
|
| 1330 | + // Identification de la puissance en "kilo" correspondant à l'unité la plus appropriée |
|
| 1331 | + $puissance = floor(log($octets, $kilo)); |
|
| 1332 | 1332 | |
| 1333 | - // Calcul de la taille et choix de l'unité |
|
| 1334 | - $affichage = _T( |
|
| 1335 | - 'spip:taille_' . $unites[$puissance] . $suffixe_item, |
|
| 1336 | - [ |
|
| 1337 | - 'taille' => round($octets / pow($kilo, $puissance), $precisions[$puissance]) |
|
| 1338 | - ] |
|
| 1339 | - ); |
|
| 1340 | - } |
|
| 1333 | + // Calcul de la taille et choix de l'unité |
|
| 1334 | + $affichage = _T( |
|
| 1335 | + 'spip:taille_' . $unites[$puissance] . $suffixe_item, |
|
| 1336 | + [ |
|
| 1337 | + 'taille' => round($octets / pow($kilo, $puissance), $precisions[$puissance]) |
|
| 1338 | + ] |
|
| 1339 | + ); |
|
| 1340 | + } |
|
| 1341 | 1341 | |
| 1342 | - return $affichage; |
|
| 1342 | + return $affichage; |
|
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | |
@@ -1361,21 +1361,21 @@ discard block |
||
| 1361 | 1361 | * texte prêt pour être utilisé en attribut HTML |
| 1362 | 1362 | **/ |
| 1363 | 1363 | function attribut_html(?string $texte, $textebrut = true): string { |
| 1364 | - if ($texte === null) { |
|
| 1365 | - return ''; |
|
| 1366 | - } |
|
| 1367 | - $u = $GLOBALS['meta']['pcre_u']; |
|
| 1368 | - if ($textebrut) { |
|
| 1369 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1370 | - } |
|
| 1371 | - $texte = texte_backend($texte); |
|
| 1372 | - $texte = str_replace(["'", '"'], [''', '"'], $texte); |
|
| 1364 | + if ($texte === null) { |
|
| 1365 | + return ''; |
|
| 1366 | + } |
|
| 1367 | + $u = $GLOBALS['meta']['pcre_u']; |
|
| 1368 | + if ($textebrut) { |
|
| 1369 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1370 | + } |
|
| 1371 | + $texte = texte_backend($texte); |
|
| 1372 | + $texte = str_replace(["'", '"'], [''', '"'], $texte); |
|
| 1373 | 1373 | |
| 1374 | - return preg_replace( |
|
| 1375 | - ['/&(amp;|#38;)/', '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/'], |
|
| 1376 | - ['&', '&'], |
|
| 1377 | - $texte |
|
| 1378 | - ); |
|
| 1374 | + return preg_replace( |
|
| 1375 | + ['/&(amp;|#38;)/', '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/'], |
|
| 1376 | + ['&', '&'], |
|
| 1377 | + $texte |
|
| 1378 | + ); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | |
@@ -1395,15 +1395,15 @@ discard block |
||
| 1395 | 1395 | * URL ou chaîne vide |
| 1396 | 1396 | **/ |
| 1397 | 1397 | function vider_url(?string $url, $entites = true): string { |
| 1398 | - if ($url === null) { |
|
| 1399 | - return ''; |
|
| 1400 | - } |
|
| 1401 | - # un message pour abs_url |
|
| 1402 | - $GLOBALS['mode_abs_url'] = 'url'; |
|
| 1403 | - $url = trim($url); |
|
| 1404 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1398 | + if ($url === null) { |
|
| 1399 | + return ''; |
|
| 1400 | + } |
|
| 1401 | + # un message pour abs_url |
|
| 1402 | + $GLOBALS['mode_abs_url'] = 'url'; |
|
| 1403 | + $url = trim($url); |
|
| 1404 | + $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1405 | 1405 | |
| 1406 | - return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
|
| 1406 | + return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
|
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | 1409 | |
@@ -1418,10 +1418,10 @@ discard block |
||
| 1418 | 1418 | * @return string Adresse email maquillée |
| 1419 | 1419 | **/ |
| 1420 | 1420 | function antispam($texte) { |
| 1421 | - include_spip('inc/acces'); |
|
| 1422 | - $masque = creer_pass_aleatoire(3); |
|
| 1421 | + include_spip('inc/acces'); |
|
| 1422 | + $masque = creer_pass_aleatoire(3); |
|
| 1423 | 1423 | |
| 1424 | - return preg_replace('/@/', " $masque ", $texte); |
|
| 1424 | + return preg_replace('/@/', " $masque ", $texte); |
|
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | /** |
@@ -1453,8 +1453,8 @@ discard block |
||
| 1453 | 1453 | * True si on a le droit d'accès, false sinon. |
| 1454 | 1454 | **/ |
| 1455 | 1455 | function filtre_securiser_acces_dist($id_auteur, $cle, $dir, $op = '', $args = '') { |
| 1456 | - include_spip('inc/acces'); |
|
| 1457 | - return securiser_acces_low_sec($id_auteur, $cle, $op ? "$dir $op $args" : $dir); |
|
| 1456 | + include_spip('inc/acces'); |
|
| 1457 | + return securiser_acces_low_sec($id_auteur, $cle, $op ? "$dir $op $args" : $dir); |
|
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | 1460 | /** |
@@ -1479,13 +1479,13 @@ discard block |
||
| 1479 | 1479 | * Retourne $texte, sinon $sinon. |
| 1480 | 1480 | **/ |
| 1481 | 1481 | function sinon($texte, $sinon = '') { |
| 1482 | - if ($texte) { |
|
| 1483 | - return $texte; |
|
| 1484 | - } elseif (is_scalar($texte) and strlen($texte)) { |
|
| 1485 | - return $texte; |
|
| 1486 | - } else { |
|
| 1487 | - return $sinon; |
|
| 1488 | - } |
|
| 1482 | + if ($texte) { |
|
| 1483 | + return $texte; |
|
| 1484 | + } elseif (is_scalar($texte) and strlen($texte)) { |
|
| 1485 | + return $texte; |
|
| 1486 | + } else { |
|
| 1487 | + return $sinon; |
|
| 1488 | + } |
|
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | 1491 | /** |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | * @return mixed |
| 1510 | 1510 | **/ |
| 1511 | 1511 | function choixsivide($a, $vide, $pasvide) { |
| 1512 | - return $a ? $pasvide : $vide; |
|
| 1512 | + return $a ? $pasvide : $vide; |
|
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | /** |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | * @return mixed |
| 1534 | 1534 | **/ |
| 1535 | 1535 | function choixsiegal($a1, $a2, $v, $f) { |
| 1536 | - return ($a1 == $a2) ? $v : $f; |
|
| 1536 | + return ($a1 == $a2) ? $v : $f; |
|
| 1537 | 1537 | } |
| 1538 | 1538 | |
| 1539 | 1539 | // |
@@ -1552,13 +1552,13 @@ discard block |
||
| 1552 | 1552 | * @return string |
| 1553 | 1553 | **/ |
| 1554 | 1554 | function filtrer_ical($texte) { |
| 1555 | - #include_spip('inc/charsets'); |
|
| 1556 | - $texte = html2unicode($texte); |
|
| 1557 | - $texte = unicode2charset(charset2unicode($texte, $GLOBALS['meta']['charset']), 'utf-8'); |
|
| 1558 | - $texte = preg_replace("/\n/", ' ', $texte); |
|
| 1559 | - $texte = preg_replace('/,/', '\,', $texte); |
|
| 1555 | + #include_spip('inc/charsets'); |
|
| 1556 | + $texte = html2unicode($texte); |
|
| 1557 | + $texte = unicode2charset(charset2unicode($texte, $GLOBALS['meta']['charset']), 'utf-8'); |
|
| 1558 | + $texte = preg_replace("/\n/", ' ', $texte); |
|
| 1559 | + $texte = preg_replace('/,/', '\,', $texte); |
|
| 1560 | 1560 | |
| 1561 | - return $texte; |
|
| 1561 | + return $texte; |
|
| 1562 | 1562 | } |
| 1563 | 1563 | |
| 1564 | 1564 | |
@@ -1583,58 +1583,58 @@ discard block |
||
| 1583 | 1583 | * @return string |
| 1584 | 1584 | **/ |
| 1585 | 1585 | function post_autobr($texte, $delim = "\n_ ") { |
| 1586 | - if (!function_exists('echappe_html')) { |
|
| 1587 | - include_spip('inc/texte_mini'); |
|
| 1588 | - } |
|
| 1589 | - $texte = str_replace("\r\n", "\r", $texte); |
|
| 1590 | - $texte = str_replace("\r", "\n", $texte); |
|
| 1591 | - |
|
| 1592 | - if (preg_match(",\n+$,", $texte, $fin)) { |
|
| 1593 | - $texte = substr($texte, 0, -strlen($fin = $fin[0])); |
|
| 1594 | - } else { |
|
| 1595 | - $fin = ''; |
|
| 1596 | - } |
|
| 1597 | - |
|
| 1598 | - $texte = echappe_html($texte, '', true); |
|
| 1599 | - |
|
| 1600 | - // echapper les modeles |
|
| 1601 | - $collecteurModeles = null; |
|
| 1602 | - if (strpos($texte, '<') !== false) { |
|
| 1603 | - include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1604 | - include_spip("src/Texte/Collecteur/Modeles"); |
|
| 1605 | - $collecteurModeles = new Spip\Texte\Collecteur\Modeles(); |
|
| 1606 | - $texte = $collecteurModeles->echapper($texte); |
|
| 1607 | - } |
|
| 1608 | - |
|
| 1609 | - $debut = ''; |
|
| 1610 | - $suite = $texte; |
|
| 1611 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1612 | - $debut .= substr($suite, 0, $t - 1); |
|
| 1613 | - $suite = substr($suite, $t); |
|
| 1614 | - $car = substr($suite, 0, 1); |
|
| 1615 | - if ( |
|
| 1616 | - ($car <> '-') and ($car <> '_') and ($car <> "\n") and ($car <> '|') and ($car <> '}') |
|
| 1617 | - and !preg_match(',^\s*(\n|</?(quote|div|dl|dt|dd)|$),S', ($suite)) |
|
| 1618 | - and !preg_match(',</?(quote|div|dl|dt|dd)> *$,iS', $debut) |
|
| 1619 | - ) { |
|
| 1620 | - $debut .= $delim; |
|
| 1621 | - } else { |
|
| 1622 | - $debut .= "\n"; |
|
| 1623 | - } |
|
| 1624 | - if (preg_match(",^\n+,", $suite, $regs)) { |
|
| 1625 | - $debut .= $regs[0]; |
|
| 1626 | - $suite = substr($suite, strlen($regs[0])); |
|
| 1627 | - } |
|
| 1628 | - } |
|
| 1629 | - $texte = $debut . $suite; |
|
| 1630 | - |
|
| 1631 | - if ($collecteurModeles) { |
|
| 1632 | - $texte = $collecteurModeles->retablir($texte); |
|
| 1633 | - } |
|
| 1634 | - |
|
| 1635 | - $texte = echappe_retour($texte); |
|
| 1636 | - |
|
| 1637 | - return $texte . $fin; |
|
| 1586 | + if (!function_exists('echappe_html')) { |
|
| 1587 | + include_spip('inc/texte_mini'); |
|
| 1588 | + } |
|
| 1589 | + $texte = str_replace("\r\n", "\r", $texte); |
|
| 1590 | + $texte = str_replace("\r", "\n", $texte); |
|
| 1591 | + |
|
| 1592 | + if (preg_match(",\n+$,", $texte, $fin)) { |
|
| 1593 | + $texte = substr($texte, 0, -strlen($fin = $fin[0])); |
|
| 1594 | + } else { |
|
| 1595 | + $fin = ''; |
|
| 1596 | + } |
|
| 1597 | + |
|
| 1598 | + $texte = echappe_html($texte, '', true); |
|
| 1599 | + |
|
| 1600 | + // echapper les modeles |
|
| 1601 | + $collecteurModeles = null; |
|
| 1602 | + if (strpos($texte, '<') !== false) { |
|
| 1603 | + include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1604 | + include_spip("src/Texte/Collecteur/Modeles"); |
|
| 1605 | + $collecteurModeles = new Spip\Texte\Collecteur\Modeles(); |
|
| 1606 | + $texte = $collecteurModeles->echapper($texte); |
|
| 1607 | + } |
|
| 1608 | + |
|
| 1609 | + $debut = ''; |
|
| 1610 | + $suite = $texte; |
|
| 1611 | + while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1612 | + $debut .= substr($suite, 0, $t - 1); |
|
| 1613 | + $suite = substr($suite, $t); |
|
| 1614 | + $car = substr($suite, 0, 1); |
|
| 1615 | + if ( |
|
| 1616 | + ($car <> '-') and ($car <> '_') and ($car <> "\n") and ($car <> '|') and ($car <> '}') |
|
| 1617 | + and !preg_match(',^\s*(\n|</?(quote|div|dl|dt|dd)|$),S', ($suite)) |
|
| 1618 | + and !preg_match(',</?(quote|div|dl|dt|dd)> *$,iS', $debut) |
|
| 1619 | + ) { |
|
| 1620 | + $debut .= $delim; |
|
| 1621 | + } else { |
|
| 1622 | + $debut .= "\n"; |
|
| 1623 | + } |
|
| 1624 | + if (preg_match(",^\n+,", $suite, $regs)) { |
|
| 1625 | + $debut .= $regs[0]; |
|
| 1626 | + $suite = substr($suite, strlen($regs[0])); |
|
| 1627 | + } |
|
| 1628 | + } |
|
| 1629 | + $texte = $debut . $suite; |
|
| 1630 | + |
|
| 1631 | + if ($collecteurModeles) { |
|
| 1632 | + $texte = $collecteurModeles->retablir($texte); |
|
| 1633 | + } |
|
| 1634 | + |
|
| 1635 | + $texte = echappe_retour($texte); |
|
| 1636 | + |
|
| 1637 | + return $texte . $fin; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | |
@@ -1669,30 +1669,30 @@ discard block |
||
| 1669 | 1669 | **/ |
| 1670 | 1670 | function extraire_idiome($letexte, $lang = null, $options = []) { |
| 1671 | 1671 | |
| 1672 | - if ( |
|
| 1673 | - $letexte |
|
| 1674 | - and strpos($letexte, '<:') !== false |
|
| 1675 | - ) { |
|
| 1676 | - if (!$lang) { |
|
| 1677 | - $lang = $GLOBALS['spip_lang']; |
|
| 1678 | - } |
|
| 1679 | - // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
|
| 1680 | - if (is_bool($options)) { |
|
| 1681 | - $options = ['echappe_span' => $options]; |
|
| 1682 | - } |
|
| 1683 | - if (!isset($options['echappe_span'])) { |
|
| 1684 | - $options = array_merge($options, ['echappe_span' => false]); |
|
| 1685 | - } |
|
| 1686 | - $options['lang'] = $lang; |
|
| 1672 | + if ( |
|
| 1673 | + $letexte |
|
| 1674 | + and strpos($letexte, '<:') !== false |
|
| 1675 | + ) { |
|
| 1676 | + if (!$lang) { |
|
| 1677 | + $lang = $GLOBALS['spip_lang']; |
|
| 1678 | + } |
|
| 1679 | + // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
|
| 1680 | + if (is_bool($options)) { |
|
| 1681 | + $options = ['echappe_span' => $options]; |
|
| 1682 | + } |
|
| 1683 | + if (!isset($options['echappe_span'])) { |
|
| 1684 | + $options = array_merge($options, ['echappe_span' => false]); |
|
| 1685 | + } |
|
| 1686 | + $options['lang'] = $lang; |
|
| 1687 | 1687 | |
| 1688 | - include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1689 | - include_spip("src/Texte/Collecteur/Idiomes"); |
|
| 1690 | - $collecteurIdiomes = new Spip\Texte\Collecteur\Idiomes(); |
|
| 1688 | + include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1689 | + include_spip("src/Texte/Collecteur/Idiomes"); |
|
| 1690 | + $collecteurIdiomes = new Spip\Texte\Collecteur\Idiomes(); |
|
| 1691 | 1691 | |
| 1692 | - $letexte = $collecteurIdiomes->traiter($letexte, $options); |
|
| 1692 | + $letexte = $collecteurIdiomes->traiter($letexte, $options); |
|
| 1693 | 1693 | |
| 1694 | - } |
|
| 1695 | - return $letexte; |
|
| 1694 | + } |
|
| 1695 | + return $letexte; |
|
| 1696 | 1696 | } |
| 1697 | 1697 | |
| 1698 | 1698 | /** |
@@ -1730,34 +1730,34 @@ discard block |
||
| 1730 | 1730 | **/ |
| 1731 | 1731 | function extraire_multi($letexte, $lang = null, $options = []) { |
| 1732 | 1732 | |
| 1733 | - if ( |
|
| 1734 | - $letexte |
|
| 1735 | - and stripos($letexte, '<multi') !== false |
|
| 1736 | - ) { |
|
| 1737 | - if (!$lang) { |
|
| 1738 | - $lang = $GLOBALS['spip_lang']; |
|
| 1739 | - } |
|
| 1733 | + if ( |
|
| 1734 | + $letexte |
|
| 1735 | + and stripos($letexte, '<multi') !== false |
|
| 1736 | + ) { |
|
| 1737 | + if (!$lang) { |
|
| 1738 | + $lang = $GLOBALS['spip_lang']; |
|
| 1739 | + } |
|
| 1740 | 1740 | |
| 1741 | - // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
|
| 1742 | - if (is_bool($options)) { |
|
| 1743 | - $options = ['echappe_span' => $options, 'lang_defaut' => _LANGUE_PAR_DEFAUT]; |
|
| 1744 | - } |
|
| 1745 | - if (!isset($options['echappe_span'])) { |
|
| 1746 | - $options = array_merge($options, ['echappe_span' => false]); |
|
| 1747 | - } |
|
| 1748 | - if (!isset($options['lang_defaut'])) { |
|
| 1749 | - $options = array_merge($options, ['lang_defaut' => _LANGUE_PAR_DEFAUT]); |
|
| 1750 | - } |
|
| 1751 | - $options['lang'] = $lang; |
|
| 1741 | + // Compatibilité avec le prototype de fonction précédente qui utilisait un boolean |
|
| 1742 | + if (is_bool($options)) { |
|
| 1743 | + $options = ['echappe_span' => $options, 'lang_defaut' => _LANGUE_PAR_DEFAUT]; |
|
| 1744 | + } |
|
| 1745 | + if (!isset($options['echappe_span'])) { |
|
| 1746 | + $options = array_merge($options, ['echappe_span' => false]); |
|
| 1747 | + } |
|
| 1748 | + if (!isset($options['lang_defaut'])) { |
|
| 1749 | + $options = array_merge($options, ['lang_defaut' => _LANGUE_PAR_DEFAUT]); |
|
| 1750 | + } |
|
| 1751 | + $options['lang'] = $lang; |
|
| 1752 | 1752 | |
| 1753 | - include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1754 | - include_spip("src/Texte/Collecteur/Multis"); |
|
| 1755 | - $collecteurMultis = new Spip\Texte\Collecteur\Multis(); |
|
| 1753 | + include_spip("src/Texte/Collecteur/AbstractCollecteur"); |
|
| 1754 | + include_spip("src/Texte/Collecteur/Multis"); |
|
| 1755 | + $collecteurMultis = new Spip\Texte\Collecteur\Multis(); |
|
| 1756 | 1756 | |
| 1757 | - $letexte = $collecteurMultis->traiter($letexte, $options); |
|
| 1758 | - } |
|
| 1757 | + $letexte = $collecteurMultis->traiter($letexte, $options); |
|
| 1758 | + } |
|
| 1759 | 1759 | |
| 1760 | - return $letexte; |
|
| 1760 | + return $letexte; |
|
| 1761 | 1761 | } |
| 1762 | 1762 | |
| 1763 | 1763 | /** |
@@ -1767,7 +1767,7 @@ discard block |
||
| 1767 | 1767 | * @return string L'initiale en majuscule |
| 1768 | 1768 | */ |
| 1769 | 1769 | function filtre_initiale($nom) { |
| 1770 | - return spip_substr(trim(strtoupper(extraire_multi($nom))), 0, 1); |
|
| 1770 | + return spip_substr(trim(strtoupper(extraire_multi($nom))), 0, 1); |
|
| 1771 | 1771 | } |
| 1772 | 1772 | |
| 1773 | 1773 | |
@@ -1812,33 +1812,33 @@ discard block |
||
| 1812 | 1812 | * - null (interne) : si on empile |
| 1813 | 1813 | **/ |
| 1814 | 1814 | function unique($donnee, $famille = '', $cpt = false) { |
| 1815 | - static $mem = []; |
|
| 1816 | - // permettre de vider la pile et de la restaurer |
|
| 1817 | - // pour le calcul de introduction... |
|
| 1818 | - if ($famille == '_spip_raz_') { |
|
| 1819 | - $tmp = $mem; |
|
| 1820 | - $mem = []; |
|
| 1821 | - |
|
| 1822 | - return $tmp; |
|
| 1823 | - } elseif ($famille == '_spip_set_') { |
|
| 1824 | - $mem = $donnee; |
|
| 1825 | - |
|
| 1826 | - return; |
|
| 1827 | - } |
|
| 1828 | - // eviter une notice |
|
| 1829 | - if (!isset($mem[$famille])) { |
|
| 1830 | - $mem[$famille] = []; |
|
| 1831 | - } |
|
| 1832 | - if ($cpt) { |
|
| 1833 | - return is_countable($mem[$famille]) ? count($mem[$famille]) : 0; |
|
| 1834 | - } |
|
| 1835 | - // eviter une notice |
|
| 1836 | - if (!isset($mem[$famille][$donnee])) { |
|
| 1837 | - $mem[$famille][$donnee] = 0; |
|
| 1838 | - } |
|
| 1839 | - if (!($mem[$famille][$donnee]++)) { |
|
| 1840 | - return $donnee; |
|
| 1841 | - } |
|
| 1815 | + static $mem = []; |
|
| 1816 | + // permettre de vider la pile et de la restaurer |
|
| 1817 | + // pour le calcul de introduction... |
|
| 1818 | + if ($famille == '_spip_raz_') { |
|
| 1819 | + $tmp = $mem; |
|
| 1820 | + $mem = []; |
|
| 1821 | + |
|
| 1822 | + return $tmp; |
|
| 1823 | + } elseif ($famille == '_spip_set_') { |
|
| 1824 | + $mem = $donnee; |
|
| 1825 | + |
|
| 1826 | + return; |
|
| 1827 | + } |
|
| 1828 | + // eviter une notice |
|
| 1829 | + if (!isset($mem[$famille])) { |
|
| 1830 | + $mem[$famille] = []; |
|
| 1831 | + } |
|
| 1832 | + if ($cpt) { |
|
| 1833 | + return is_countable($mem[$famille]) ? count($mem[$famille]) : 0; |
|
| 1834 | + } |
|
| 1835 | + // eviter une notice |
|
| 1836 | + if (!isset($mem[$famille][$donnee])) { |
|
| 1837 | + $mem[$famille][$donnee] = 0; |
|
| 1838 | + } |
|
| 1839 | + if (!($mem[$famille][$donnee]++)) { |
|
| 1840 | + return $donnee; |
|
| 1841 | + } |
|
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | 1844 | |
@@ -1868,20 +1868,20 @@ discard block |
||
| 1868 | 1868 | * Une des valeurs en fonction du compteur. |
| 1869 | 1869 | **/ |
| 1870 | 1870 | function alterner($i, ...$args) { |
| 1871 | - // recuperer les arguments (attention fonctions un peu space) |
|
| 1872 | - $num = count($args); |
|
| 1871 | + // recuperer les arguments (attention fonctions un peu space) |
|
| 1872 | + $num = count($args); |
|
| 1873 | 1873 | |
| 1874 | - if ($num === 1 && is_array($args[0])) { |
|
| 1875 | - // un tableau de valeur dont les cles sont numerotees de 0 a num |
|
| 1876 | - $args = array_values($args[0]); |
|
| 1877 | - $num = count($args); |
|
| 1878 | - } |
|
| 1874 | + if ($num === 1 && is_array($args[0])) { |
|
| 1875 | + // un tableau de valeur dont les cles sont numerotees de 0 a num |
|
| 1876 | + $args = array_values($args[0]); |
|
| 1877 | + $num = count($args); |
|
| 1878 | + } |
|
| 1879 | 1879 | |
| 1880 | - // un index compris entre 0 et num exclus |
|
| 1881 | - $i = ((intval($i) - 1) % $num); // dans ]-$num;$num[ |
|
| 1882 | - $i = ($i + $num) % $num; // dans [0;$num[ |
|
| 1883 | - // renvoyer le i-ieme argument, modulo le nombre d'arguments |
|
| 1884 | - return $args[$i]; |
|
| 1880 | + // un index compris entre 0 et num exclus |
|
| 1881 | + $i = ((intval($i) - 1) % $num); // dans ]-$num;$num[ |
|
| 1882 | + $i = ($i + $num) % $num; // dans [0;$num[ |
|
| 1883 | + // renvoyer le i-ieme argument, modulo le nombre d'arguments |
|
| 1884 | + return $args[$i]; |
|
| 1885 | 1885 | } |
| 1886 | 1886 | |
| 1887 | 1887 | |
@@ -1907,52 +1907,52 @@ discard block |
||
| 1907 | 1907 | * - null lorsque l’attribut n’existe pas. |
| 1908 | 1908 | **/ |
| 1909 | 1909 | function extraire_attribut($balise, $attribut, $complet = false) { |
| 1910 | - if (is_array($balise)) { |
|
| 1911 | - array_walk( |
|
| 1912 | - $balise, |
|
| 1913 | - function (&$a, $key, $t) { |
|
| 1914 | - $a = extraire_attribut($a, $t); |
|
| 1915 | - }, |
|
| 1916 | - $attribut |
|
| 1917 | - ); |
|
| 1918 | - |
|
| 1919 | - return $balise; |
|
| 1920 | - } |
|
| 1921 | - if ( |
|
| 1922 | - $balise |
|
| 1923 | - && stripos($balise, $attribut) !== false |
|
| 1924 | - && preg_match( |
|
| 1925 | - ',(^.*?<(?:(?>\s*)(?>[\w:.-]+)(?>(?:=(?:"[^"]*"|\'[^\']*\'|[^\'"]\S*))?))*?)(\s+' |
|
| 1926 | - . $attribut |
|
| 1927 | - . '(?:=\s*("[^"]*"|\'[^\']*\'|[^\'"]\S*))?)()((?:[\s/][^>]*)?>.*),isS', |
|
| 1928 | - $balise, |
|
| 1929 | - $r |
|
| 1930 | - ) |
|
| 1931 | - ) { |
|
| 1932 | - if (isset($r[3][0]) and ($r[3][0] == '"' || $r[3][0] == "'")) { |
|
| 1933 | - $r[4] = substr($r[3], 1, -1); |
|
| 1934 | - $r[3] = $r[3][0]; |
|
| 1935 | - } elseif ($r[3] !== '') { |
|
| 1936 | - $r[4] = $r[3]; |
|
| 1937 | - $r[3] = ''; |
|
| 1938 | - } else { |
|
| 1939 | - $r[4] = trim($r[2]); |
|
| 1940 | - } |
|
| 1941 | - $att = $r[4]; |
|
| 1942 | - if (strpos($att, '&#') !== false) { |
|
| 1943 | - $att = str_replace([''', ''', '"', '"'], ["'", "'", '"', '"'], $att); |
|
| 1944 | - } |
|
| 1945 | - $att = filtrer_entites($att); |
|
| 1946 | - } else { |
|
| 1947 | - $att = null; |
|
| 1948 | - $r = []; |
|
| 1949 | - } |
|
| 1950 | - |
|
| 1951 | - if ($complet) { |
|
| 1952 | - return [$att, $r]; |
|
| 1953 | - } else { |
|
| 1954 | - return $att; |
|
| 1955 | - } |
|
| 1910 | + if (is_array($balise)) { |
|
| 1911 | + array_walk( |
|
| 1912 | + $balise, |
|
| 1913 | + function (&$a, $key, $t) { |
|
| 1914 | + $a = extraire_attribut($a, $t); |
|
| 1915 | + }, |
|
| 1916 | + $attribut |
|
| 1917 | + ); |
|
| 1918 | + |
|
| 1919 | + return $balise; |
|
| 1920 | + } |
|
| 1921 | + if ( |
|
| 1922 | + $balise |
|
| 1923 | + && stripos($balise, $attribut) !== false |
|
| 1924 | + && preg_match( |
|
| 1925 | + ',(^.*?<(?:(?>\s*)(?>[\w:.-]+)(?>(?:=(?:"[^"]*"|\'[^\']*\'|[^\'"]\S*))?))*?)(\s+' |
|
| 1926 | + . $attribut |
|
| 1927 | + . '(?:=\s*("[^"]*"|\'[^\']*\'|[^\'"]\S*))?)()((?:[\s/][^>]*)?>.*),isS', |
|
| 1928 | + $balise, |
|
| 1929 | + $r |
|
| 1930 | + ) |
|
| 1931 | + ) { |
|
| 1932 | + if (isset($r[3][0]) and ($r[3][0] == '"' || $r[3][0] == "'")) { |
|
| 1933 | + $r[4] = substr($r[3], 1, -1); |
|
| 1934 | + $r[3] = $r[3][0]; |
|
| 1935 | + } elseif ($r[3] !== '') { |
|
| 1936 | + $r[4] = $r[3]; |
|
| 1937 | + $r[3] = ''; |
|
| 1938 | + } else { |
|
| 1939 | + $r[4] = trim($r[2]); |
|
| 1940 | + } |
|
| 1941 | + $att = $r[4]; |
|
| 1942 | + if (strpos($att, '&#') !== false) { |
|
| 1943 | + $att = str_replace([''', ''', '"', '"'], ["'", "'", '"', '"'], $att); |
|
| 1944 | + } |
|
| 1945 | + $att = filtrer_entites($att); |
|
| 1946 | + } else { |
|
| 1947 | + $att = null; |
|
| 1948 | + $r = []; |
|
| 1949 | + } |
|
| 1950 | + |
|
| 1951 | + if ($complet) { |
|
| 1952 | + return [$att, $r]; |
|
| 1953 | + } else { |
|
| 1954 | + return $att; |
|
| 1955 | + } |
|
| 1956 | 1956 | } |
| 1957 | 1957 | |
| 1958 | 1958 | /** |
@@ -1985,41 +1985,41 @@ discard block |
||
| 1985 | 1985 | **/ |
| 1986 | 1986 | function inserer_attribut(?string $balise, string $attribut, string $val, bool $proteger = true, bool $vider = false): string { |
| 1987 | 1987 | |
| 1988 | - if ($balise === null or $balise === '') { |
|
| 1989 | - return ''; |
|
| 1990 | - } |
|
| 1988 | + if ($balise === null or $balise === '') { |
|
| 1989 | + return ''; |
|
| 1990 | + } |
|
| 1991 | 1991 | |
| 1992 | - // preparer l'attribut |
|
| 1993 | - // supprimer les etc mais pas les balises html |
|
| 1994 | - // qui ont un sens dans un attribut value d'un input |
|
| 1995 | - if ($proteger) { |
|
| 1996 | - $val = attribut_html($val, false); |
|
| 1997 | - } |
|
| 1992 | + // preparer l'attribut |
|
| 1993 | + // supprimer les etc mais pas les balises html |
|
| 1994 | + // qui ont un sens dans un attribut value d'un input |
|
| 1995 | + if ($proteger) { |
|
| 1996 | + $val = attribut_html($val, false); |
|
| 1997 | + } |
|
| 1998 | 1998 | |
| 1999 | - // echapper les ' pour eviter tout bug |
|
| 2000 | - $val = str_replace("'", ''', $val); |
|
| 2001 | - if ($vider and strlen($val) === 0) { |
|
| 2002 | - $insert = ''; |
|
| 2003 | - } else { |
|
| 2004 | - $insert = " $attribut='$val'"; |
|
| 2005 | - } |
|
| 1999 | + // echapper les ' pour eviter tout bug |
|
| 2000 | + $val = str_replace("'", ''', $val); |
|
| 2001 | + if ($vider and strlen($val) === 0) { |
|
| 2002 | + $insert = ''; |
|
| 2003 | + } else { |
|
| 2004 | + $insert = " $attribut='$val'"; |
|
| 2005 | + } |
|
| 2006 | 2006 | |
| 2007 | - [$old, $r] = extraire_attribut($balise, $attribut, true); |
|
| 2007 | + [$old, $r] = extraire_attribut($balise, $attribut, true); |
|
| 2008 | 2008 | |
| 2009 | - if ($old !== null) { |
|
| 2010 | - // Remplacer l'ancien attribut du meme nom |
|
| 2011 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2012 | - } else { |
|
| 2013 | - // preferer une balise " />" (comme <img />) |
|
| 2014 | - if (preg_match(',/>,', $balise)) { |
|
| 2015 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2016 | - } // sinon une balise <a ...> ... </a> |
|
| 2017 | - else { |
|
| 2018 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2019 | - } |
|
| 2020 | - } |
|
| 2009 | + if ($old !== null) { |
|
| 2010 | + // Remplacer l'ancien attribut du meme nom |
|
| 2011 | + $balise = $r[1] . $insert . $r[5]; |
|
| 2012 | + } else { |
|
| 2013 | + // preferer une balise " />" (comme <img />) |
|
| 2014 | + if (preg_match(',/>,', $balise)) { |
|
| 2015 | + $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2016 | + } // sinon une balise <a ...> ... </a> |
|
| 2017 | + else { |
|
| 2018 | + $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2019 | + } |
|
| 2020 | + } |
|
| 2021 | 2021 | |
| 2022 | - return $balise; |
|
| 2022 | + return $balise; |
|
| 2023 | 2023 | } |
| 2024 | 2024 | |
| 2025 | 2025 | /** |
@@ -2037,7 +2037,7 @@ discard block |
||
| 2037 | 2037 | * @return string Code HTML sans l'attribut |
| 2038 | 2038 | **/ |
| 2039 | 2039 | function vider_attribut(?string $balise, string $attribut): string { |
| 2040 | - return inserer_attribut($balise, $attribut, '', false, true); |
|
| 2040 | + return inserer_attribut($balise, $attribut, '', false, true); |
|
| 2041 | 2041 | } |
| 2042 | 2042 | |
| 2043 | 2043 | /** |
@@ -2049,53 +2049,53 @@ discard block |
||
| 2049 | 2049 | * @return string |
| 2050 | 2050 | */ |
| 2051 | 2051 | function modifier_class($balise, $class, $operation = 'ajouter') { |
| 2052 | - if (is_string($class)) { |
|
| 2053 | - $class = explode(' ', trim($class)); |
|
| 2054 | - } |
|
| 2055 | - $class = array_filter($class); |
|
| 2056 | - $class = array_unique($class); |
|
| 2057 | - if (!$class) { |
|
| 2058 | - return $balise; |
|
| 2059 | - } |
|
| 2060 | - |
|
| 2061 | - // si la ou les classes ont des caracteres invalides on ne fait rien |
|
| 2062 | - if (preg_match(',[^\w-],', implode('', $class))) { |
|
| 2063 | - return $balise; |
|
| 2064 | - } |
|
| 2065 | - |
|
| 2066 | - $class_courante = extraire_attribut($balise, 'class'); |
|
| 2067 | - $class_new = $class_courante; |
|
| 2068 | - foreach ($class as $c) { |
|
| 2069 | - $is_class_presente = false; |
|
| 2070 | - if ( |
|
| 2071 | - $class_courante |
|
| 2072 | - and str_contains($class_courante, (string) $c) |
|
| 2073 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2074 | - ) { |
|
| 2075 | - $is_class_presente = true; |
|
| 2076 | - } |
|
| 2077 | - if ( |
|
| 2078 | - in_array($operation, ['ajouter', 'commuter']) |
|
| 2079 | - and !$is_class_presente |
|
| 2080 | - ) { |
|
| 2081 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2082 | - } elseif ( |
|
| 2083 | - in_array($operation, ['supprimer', 'commuter']) |
|
| 2084 | - and $is_class_presente |
|
| 2085 | - ) { |
|
| 2086 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2087 | - } |
|
| 2088 | - } |
|
| 2089 | - |
|
| 2090 | - if ($class_new !== $class_courante) { |
|
| 2091 | - if (strlen($class_new)) { |
|
| 2092 | - $balise = inserer_attribut($balise, 'class', $class_new); |
|
| 2093 | - } elseif ($class_courante) { |
|
| 2094 | - $balise = vider_attribut($balise, 'class'); |
|
| 2095 | - } |
|
| 2096 | - } |
|
| 2097 | - |
|
| 2098 | - return $balise; |
|
| 2052 | + if (is_string($class)) { |
|
| 2053 | + $class = explode(' ', trim($class)); |
|
| 2054 | + } |
|
| 2055 | + $class = array_filter($class); |
|
| 2056 | + $class = array_unique($class); |
|
| 2057 | + if (!$class) { |
|
| 2058 | + return $balise; |
|
| 2059 | + } |
|
| 2060 | + |
|
| 2061 | + // si la ou les classes ont des caracteres invalides on ne fait rien |
|
| 2062 | + if (preg_match(',[^\w-],', implode('', $class))) { |
|
| 2063 | + return $balise; |
|
| 2064 | + } |
|
| 2065 | + |
|
| 2066 | + $class_courante = extraire_attribut($balise, 'class'); |
|
| 2067 | + $class_new = $class_courante; |
|
| 2068 | + foreach ($class as $c) { |
|
| 2069 | + $is_class_presente = false; |
|
| 2070 | + if ( |
|
| 2071 | + $class_courante |
|
| 2072 | + and str_contains($class_courante, (string) $c) |
|
| 2073 | + and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2074 | + ) { |
|
| 2075 | + $is_class_presente = true; |
|
| 2076 | + } |
|
| 2077 | + if ( |
|
| 2078 | + in_array($operation, ['ajouter', 'commuter']) |
|
| 2079 | + and !$is_class_presente |
|
| 2080 | + ) { |
|
| 2081 | + $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2082 | + } elseif ( |
|
| 2083 | + in_array($operation, ['supprimer', 'commuter']) |
|
| 2084 | + and $is_class_presente |
|
| 2085 | + ) { |
|
| 2086 | + $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2087 | + } |
|
| 2088 | + } |
|
| 2089 | + |
|
| 2090 | + if ($class_new !== $class_courante) { |
|
| 2091 | + if (strlen($class_new)) { |
|
| 2092 | + $balise = inserer_attribut($balise, 'class', $class_new); |
|
| 2093 | + } elseif ($class_courante) { |
|
| 2094 | + $balise = vider_attribut($balise, 'class'); |
|
| 2095 | + } |
|
| 2096 | + } |
|
| 2097 | + |
|
| 2098 | + return $balise; |
|
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | 2101 | /** |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | * @return string |
| 2106 | 2106 | */ |
| 2107 | 2107 | function ajouter_class($balise, $class) { |
| 2108 | - return modifier_class($balise, $class, 'ajouter'); |
|
| 2108 | + return modifier_class($balise, $class, 'ajouter'); |
|
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | 2111 | /** |
@@ -2115,7 +2115,7 @@ discard block |
||
| 2115 | 2115 | * @return string |
| 2116 | 2116 | */ |
| 2117 | 2117 | function supprimer_class($balise, $class) { |
| 2118 | - return modifier_class($balise, $class, 'supprimer'); |
|
| 2118 | + return modifier_class($balise, $class, 'supprimer'); |
|
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | /** |
@@ -2126,7 +2126,7 @@ discard block |
||
| 2126 | 2126 | * @return string |
| 2127 | 2127 | */ |
| 2128 | 2128 | function commuter_class($balise, $class) { |
| 2129 | - return modifier_class($balise, $class, 'commuter'); |
|
| 2129 | + return modifier_class($balise, $class, 'commuter'); |
|
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | /** |
@@ -2137,19 +2137,19 @@ discard block |
||
| 2137 | 2137 | * @return string |
| 2138 | 2138 | */ |
| 2139 | 2139 | function tester_config($id, $mode = '') { |
| 2140 | - include_spip('action/inscrire_auteur'); |
|
| 2140 | + include_spip('action/inscrire_auteur'); |
|
| 2141 | 2141 | |
| 2142 | - return tester_statut_inscription($mode, $id); |
|
| 2142 | + return tester_statut_inscription($mode, $id); |
|
| 2143 | 2143 | } |
| 2144 | 2144 | |
| 2145 | 2145 | // |
| 2146 | 2146 | // Quelques fonctions de calcul arithmetique |
| 2147 | 2147 | // |
| 2148 | 2148 | function floatstr($a) { |
| 2149 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2149 | + return str_replace(',', '.', (string)floatval($a)); |
|
| 2150 | 2150 | } |
| 2151 | 2151 | function strize($f, $a, $b) { |
| 2152 | - return floatstr($f(floatstr($a), floatstr($b))); |
|
| 2152 | + return floatstr($f(floatstr($a), floatstr($b))); |
|
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | /** |
@@ -2168,11 +2168,11 @@ discard block |
||
| 2168 | 2168 | * @return int $a+$b |
| 2169 | 2169 | **/ |
| 2170 | 2170 | function plus($a, $b) { |
| 2171 | - return $a + $b; |
|
| 2171 | + return $a + $b; |
|
| 2172 | 2172 | } |
| 2173 | 2173 | |
| 2174 | 2174 | function strplus($a, $b) { |
| 2175 | - return strize('plus', $a, $b); |
|
| 2175 | + return strize('plus', $a, $b); |
|
| 2176 | 2176 | } |
| 2177 | 2177 | |
| 2178 | 2178 | /** |
@@ -2191,11 +2191,11 @@ discard block |
||
| 2191 | 2191 | * @return int $a-$b |
| 2192 | 2192 | **/ |
| 2193 | 2193 | function moins($a, $b) { |
| 2194 | - return $a - $b; |
|
| 2194 | + return $a - $b; |
|
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | 2197 | function strmoins($a, $b) { |
| 2198 | - return strize('moins', $a, $b); |
|
| 2198 | + return strize('moins', $a, $b); |
|
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | /** |
@@ -2215,11 +2215,11 @@ discard block |
||
| 2215 | 2215 | * @return int $a*$b |
| 2216 | 2216 | **/ |
| 2217 | 2217 | function mult($a, $b) { |
| 2218 | - return $a * $b; |
|
| 2218 | + return $a * $b; |
|
| 2219 | 2219 | } |
| 2220 | 2220 | |
| 2221 | 2221 | function strmult($a, $b) { |
| 2222 | - return strize('mult', $a, $b); |
|
| 2222 | + return strize('mult', $a, $b); |
|
| 2223 | 2223 | } |
| 2224 | 2224 | |
| 2225 | 2225 | /** |
@@ -2239,11 +2239,11 @@ discard block |
||
| 2239 | 2239 | * @return int $a/$b (ou 0 si $b est nul) |
| 2240 | 2240 | **/ |
| 2241 | 2241 | function div($a, $b) { |
| 2242 | - return $b ? $a / $b : 0; |
|
| 2242 | + return $b ? $a / $b : 0; |
|
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | 2245 | function strdiv($a, $b) { |
| 2246 | - return strize('div', $a, $b); |
|
| 2246 | + return strize('div', $a, $b); |
|
| 2247 | 2247 | } |
| 2248 | 2248 | |
| 2249 | 2249 | /** |
@@ -2264,7 +2264,7 @@ discard block |
||
| 2264 | 2264 | * @return int ($nb % $mod) + $add |
| 2265 | 2265 | **/ |
| 2266 | 2266 | function modulo($nb, $mod, $add = 0) { |
| 2267 | - return ($mod ? $nb % $mod : 0) + $add; |
|
| 2267 | + return ($mod ? $nb % $mod : 0) + $add; |
|
| 2268 | 2268 | } |
| 2269 | 2269 | |
| 2270 | 2270 | |
@@ -2279,26 +2279,26 @@ discard block |
||
| 2279 | 2279 | * - true sinon |
| 2280 | 2280 | **/ |
| 2281 | 2281 | function nom_acceptable($nom) { |
| 2282 | - $remp2 = []; |
|
| 2283 | - $remp1 = []; |
|
| 2284 | - if (!is_string($nom)) { |
|
| 2285 | - return false; |
|
| 2286 | - } |
|
| 2287 | - if (!defined('_TAGS_NOM_AUTEUR')) { |
|
| 2288 | - define('_TAGS_NOM_AUTEUR', ''); |
|
| 2289 | - } |
|
| 2290 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2291 | - foreach ($tags_acceptes as $tag) { |
|
| 2292 | - if (strlen($tag)) { |
|
| 2293 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2294 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2295 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2296 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2297 | - } |
|
| 2298 | - } |
|
| 2299 | - $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
|
| 2300 | - |
|
| 2301 | - return str_replace('<', '<', $v_nom) == $nom; |
|
| 2282 | + $remp2 = []; |
|
| 2283 | + $remp1 = []; |
|
| 2284 | + if (!is_string($nom)) { |
|
| 2285 | + return false; |
|
| 2286 | + } |
|
| 2287 | + if (!defined('_TAGS_NOM_AUTEUR')) { |
|
| 2288 | + define('_TAGS_NOM_AUTEUR', ''); |
|
| 2289 | + } |
|
| 2290 | + $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2291 | + foreach ($tags_acceptes as $tag) { |
|
| 2292 | + if (strlen($tag)) { |
|
| 2293 | + $remp1[] = '<' . trim($tag) . '>'; |
|
| 2294 | + $remp1[] = '</' . trim($tag) . '>'; |
|
| 2295 | + $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2296 | + $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2297 | + } |
|
| 2298 | + } |
|
| 2299 | + $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
|
| 2300 | + |
|
| 2301 | + return str_replace('<', '<', $v_nom) == $nom; |
|
| 2302 | 2302 | } |
| 2303 | 2303 | |
| 2304 | 2304 | |
@@ -2314,14 +2314,14 @@ discard block |
||
| 2314 | 2314 | * - renvoie un tableau si l'entree est un tableau |
| 2315 | 2315 | **/ |
| 2316 | 2316 | function email_valide($adresses) { |
| 2317 | - if (is_array($adresses)) { |
|
| 2318 | - $adresses = array_map('email_valide', $adresses); |
|
| 2319 | - $adresses = array_filter($adresses); |
|
| 2320 | - return $adresses; |
|
| 2321 | - } |
|
| 2317 | + if (is_array($adresses)) { |
|
| 2318 | + $adresses = array_map('email_valide', $adresses); |
|
| 2319 | + $adresses = array_filter($adresses); |
|
| 2320 | + return $adresses; |
|
| 2321 | + } |
|
| 2322 | 2322 | |
| 2323 | - $email_valide = charger_fonction('email_valide', 'inc'); |
|
| 2324 | - return $email_valide($adresses); |
|
| 2323 | + $email_valide = charger_fonction('email_valide', 'inc'); |
|
| 2324 | + return $email_valide($adresses); |
|
| 2325 | 2325 | } |
| 2326 | 2326 | |
| 2327 | 2327 | /** |
@@ -2335,29 +2335,29 @@ discard block |
||
| 2335 | 2335 | * @return string texte |
| 2336 | 2336 | **/ |
| 2337 | 2337 | function afficher_enclosures($tags) { |
| 2338 | - $s = []; |
|
| 2339 | - foreach (extraire_balises($tags, 'a') as $tag) { |
|
| 2340 | - if ( |
|
| 2341 | - extraire_attribut($tag, 'rel') == 'enclosure' |
|
| 2342 | - and $t = extraire_attribut($tag, 'href') |
|
| 2343 | - ) { |
|
| 2344 | - $s[] = preg_replace( |
|
| 2345 | - ',>[^<]+</a>,S', |
|
| 2346 | - '>' |
|
| 2347 | - . http_img_pack( |
|
| 2348 | - 'attachment-16.png', |
|
| 2349 | - $t, |
|
| 2350 | - '', |
|
| 2351 | - $t, |
|
| 2352 | - ['utiliser_suffixe_size' => true] |
|
| 2353 | - ) |
|
| 2354 | - . '</a>', |
|
| 2355 | - $tag |
|
| 2356 | - ); |
|
| 2357 | - } |
|
| 2358 | - } |
|
| 2359 | - |
|
| 2360 | - return join(' ', $s); |
|
| 2338 | + $s = []; |
|
| 2339 | + foreach (extraire_balises($tags, 'a') as $tag) { |
|
| 2340 | + if ( |
|
| 2341 | + extraire_attribut($tag, 'rel') == 'enclosure' |
|
| 2342 | + and $t = extraire_attribut($tag, 'href') |
|
| 2343 | + ) { |
|
| 2344 | + $s[] = preg_replace( |
|
| 2345 | + ',>[^<]+</a>,S', |
|
| 2346 | + '>' |
|
| 2347 | + . http_img_pack( |
|
| 2348 | + 'attachment-16.png', |
|
| 2349 | + $t, |
|
| 2350 | + '', |
|
| 2351 | + $t, |
|
| 2352 | + ['utiliser_suffixe_size' => true] |
|
| 2353 | + ) |
|
| 2354 | + . '</a>', |
|
| 2355 | + $tag |
|
| 2356 | + ); |
|
| 2357 | + } |
|
| 2358 | + } |
|
| 2359 | + |
|
| 2360 | + return join(' ', $s); |
|
| 2361 | 2361 | } |
| 2362 | 2362 | |
| 2363 | 2363 | /** |
@@ -2372,15 +2372,15 @@ discard block |
||
| 2372 | 2372 | * @return string Liens trouvés |
| 2373 | 2373 | **/ |
| 2374 | 2374 | function afficher_tags($tags, $rels = 'tag,directory') { |
| 2375 | - $s = []; |
|
| 2376 | - foreach (extraire_balises($tags, 'a') as $tag) { |
|
| 2377 | - $rel = extraire_attribut($tag, 'rel'); |
|
| 2378 | - if (strstr(",$rels,", (string) ",$rel,")) { |
|
| 2379 | - $s[] = $tag; |
|
| 2380 | - } |
|
| 2381 | - } |
|
| 2375 | + $s = []; |
|
| 2376 | + foreach (extraire_balises($tags, 'a') as $tag) { |
|
| 2377 | + $rel = extraire_attribut($tag, 'rel'); |
|
| 2378 | + if (strstr(",$rels,", (string) ",$rel,")) { |
|
| 2379 | + $s[] = $tag; |
|
| 2380 | + } |
|
| 2381 | + } |
|
| 2382 | 2382 | |
| 2383 | - return join(', ', $s); |
|
| 2383 | + return join(', ', $s); |
|
| 2384 | 2384 | } |
| 2385 | 2385 | |
| 2386 | 2386 | |
@@ -2402,21 +2402,21 @@ discard block |
||
| 2402 | 2402 | * @return string Tag HTML `<a>` avec microformat. |
| 2403 | 2403 | **/ |
| 2404 | 2404 | function enclosure2microformat($e) { |
| 2405 | - if (!$url = filtrer_entites(extraire_attribut($e, 'url') ?? '')) { |
|
| 2406 | - $url = filtrer_entites(extraire_attribut($e, 'href') ?? ''); |
|
| 2407 | - } |
|
| 2408 | - $type = extraire_attribut($e, 'type'); |
|
| 2409 | - if (!$length = extraire_attribut($e, 'length')) { |
|
| 2410 | - # <media:content : longeur dans fileSize. On tente. |
|
| 2411 | - $length = extraire_attribut($e, 'fileSize'); |
|
| 2412 | - } |
|
| 2413 | - $fichier = basename($url); |
|
| 2405 | + if (!$url = filtrer_entites(extraire_attribut($e, 'url') ?? '')) { |
|
| 2406 | + $url = filtrer_entites(extraire_attribut($e, 'href') ?? ''); |
|
| 2407 | + } |
|
| 2408 | + $type = extraire_attribut($e, 'type'); |
|
| 2409 | + if (!$length = extraire_attribut($e, 'length')) { |
|
| 2410 | + # <media:content : longeur dans fileSize. On tente. |
|
| 2411 | + $length = extraire_attribut($e, 'fileSize'); |
|
| 2412 | + } |
|
| 2413 | + $fichier = basename($url); |
|
| 2414 | 2414 | |
| 2415 | - return '<a rel="enclosure"' |
|
| 2416 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2417 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2418 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2419 | - . '>' . $fichier . '</a>'; |
|
| 2415 | + return '<a rel="enclosure"' |
|
| 2416 | + . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2417 | + . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2418 | + . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2419 | + . '>' . $fichier . '</a>'; |
|
| 2420 | 2420 | } |
| 2421 | 2421 | |
| 2422 | 2422 | /** |
@@ -2434,24 +2434,24 @@ discard block |
||
| 2434 | 2434 | * @return string Tags RSS `<enclosure>`. |
| 2435 | 2435 | **/ |
| 2436 | 2436 | function microformat2enclosure($tags) { |
| 2437 | - $enclosures = []; |
|
| 2438 | - foreach (extraire_balises($tags, 'a') as $e) { |
|
| 2439 | - if (extraire_attribut($e, 'rel') == 'enclosure') { |
|
| 2440 | - $url = filtrer_entites(extraire_attribut($e, 'href')); |
|
| 2441 | - $type = extraire_attribut($e, 'type'); |
|
| 2442 | - if (!$length = intval(extraire_attribut($e, 'title'))) { |
|
| 2443 | - $length = intval(extraire_attribut($e, 'length')); |
|
| 2444 | - } # vieux data |
|
| 2445 | - $fichier = basename($url); |
|
| 2446 | - $enclosures[] = '<enclosure' |
|
| 2447 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2448 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2449 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2450 | - . ' />'; |
|
| 2451 | - } |
|
| 2452 | - } |
|
| 2437 | + $enclosures = []; |
|
| 2438 | + foreach (extraire_balises($tags, 'a') as $e) { |
|
| 2439 | + if (extraire_attribut($e, 'rel') == 'enclosure') { |
|
| 2440 | + $url = filtrer_entites(extraire_attribut($e, 'href')); |
|
| 2441 | + $type = extraire_attribut($e, 'type'); |
|
| 2442 | + if (!$length = intval(extraire_attribut($e, 'title'))) { |
|
| 2443 | + $length = intval(extraire_attribut($e, 'length')); |
|
| 2444 | + } # vieux data |
|
| 2445 | + $fichier = basename($url); |
|
| 2446 | + $enclosures[] = '<enclosure' |
|
| 2447 | + . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2448 | + . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2449 | + . ($length ? ' length="' . $length . '"' : '') |
|
| 2450 | + . ' />'; |
|
| 2451 | + } |
|
| 2452 | + } |
|
| 2453 | 2453 | |
| 2454 | - return join("\n", $enclosures); |
|
| 2454 | + return join("\n", $enclosures); |
|
| 2455 | 2455 | } |
| 2456 | 2456 | |
| 2457 | 2457 | |
@@ -2467,16 +2467,16 @@ discard block |
||
| 2467 | 2467 | * @return string Tags RSS Atom `<dc:subject>`. |
| 2468 | 2468 | **/ |
| 2469 | 2469 | function tags2dcsubject($tags) { |
| 2470 | - $subjects = ''; |
|
| 2471 | - foreach (extraire_balises($tags, 'a') as $e) { |
|
| 2472 | - if (extraire_attribut($e, 'rel') == 'tag') { |
|
| 2473 | - $subjects .= '<dc:subject>' |
|
| 2474 | - . texte_backend(textebrut($e)) |
|
| 2475 | - . '</dc:subject>' . "\n"; |
|
| 2476 | - } |
|
| 2477 | - } |
|
| 2470 | + $subjects = ''; |
|
| 2471 | + foreach (extraire_balises($tags, 'a') as $e) { |
|
| 2472 | + if (extraire_attribut($e, 'rel') == 'tag') { |
|
| 2473 | + $subjects .= '<dc:subject>' |
|
| 2474 | + . texte_backend(textebrut($e)) |
|
| 2475 | + . '</dc:subject>' . "\n"; |
|
| 2476 | + } |
|
| 2477 | + } |
|
| 2478 | 2478 | |
| 2479 | - return $subjects; |
|
| 2479 | + return $subjects; |
|
| 2480 | 2480 | } |
| 2481 | 2481 | |
| 2482 | 2482 | /** |
@@ -2505,27 +2505,27 @@ discard block |
||
| 2505 | 2505 | * - Tableau de résultats, si tableau en entrée. |
| 2506 | 2506 | **/ |
| 2507 | 2507 | function extraire_balise($texte, $tag = 'a') { |
| 2508 | - if (is_array($texte)) { |
|
| 2509 | - array_walk( |
|
| 2510 | - $texte, |
|
| 2511 | - function (&$a, $key, $t) { |
|
| 2512 | - $a = extraire_balise($a, $t); |
|
| 2513 | - }, |
|
| 2514 | - $tag |
|
| 2515 | - ); |
|
| 2516 | - |
|
| 2517 | - return $texte; |
|
| 2518 | - } |
|
| 2519 | - |
|
| 2520 | - if ( |
|
| 2521 | - preg_match( |
|
| 2522 | - ",<$tag\b[^>]*(/>|>.*</$tag\b[^>]*>|>),UimsS", |
|
| 2523 | - $texte, |
|
| 2524 | - $regs |
|
| 2525 | - ) |
|
| 2526 | - ) { |
|
| 2527 | - return $regs[0]; |
|
| 2528 | - } |
|
| 2508 | + if (is_array($texte)) { |
|
| 2509 | + array_walk( |
|
| 2510 | + $texte, |
|
| 2511 | + function (&$a, $key, $t) { |
|
| 2512 | + $a = extraire_balise($a, $t); |
|
| 2513 | + }, |
|
| 2514 | + $tag |
|
| 2515 | + ); |
|
| 2516 | + |
|
| 2517 | + return $texte; |
|
| 2518 | + } |
|
| 2519 | + |
|
| 2520 | + if ( |
|
| 2521 | + preg_match( |
|
| 2522 | + ",<$tag\b[^>]*(/>|>.*</$tag\b[^>]*>|>),UimsS", |
|
| 2523 | + $texte, |
|
| 2524 | + $regs |
|
| 2525 | + ) |
|
| 2526 | + ) { |
|
| 2527 | + return $regs[0]; |
|
| 2528 | + } |
|
| 2529 | 2529 | } |
| 2530 | 2530 | |
| 2531 | 2531 | /** |
@@ -2553,30 +2553,30 @@ discard block |
||
| 2553 | 2553 | * - Tableau de résultats, si tableau en entrée. |
| 2554 | 2554 | **/ |
| 2555 | 2555 | function extraire_balises($texte, $tag = 'a') { |
| 2556 | - if (is_array($texte)) { |
|
| 2557 | - array_walk( |
|
| 2558 | - $texte, |
|
| 2559 | - function (&$a, $key, $t) { |
|
| 2560 | - $a = extraire_balises($a, $t); |
|
| 2561 | - }, |
|
| 2562 | - $tag |
|
| 2563 | - ); |
|
| 2564 | - |
|
| 2565 | - return $texte; |
|
| 2566 | - } |
|
| 2567 | - |
|
| 2568 | - if ( |
|
| 2569 | - preg_match_all( |
|
| 2570 | - ",<{$tag}\b[^>]*(/>|>.*</{$tag}\b[^>]*>|>),UimsS", |
|
| 2571 | - $texte, |
|
| 2572 | - $regs, |
|
| 2573 | - PREG_PATTERN_ORDER |
|
| 2574 | - ) |
|
| 2575 | - ) { |
|
| 2576 | - return $regs[0]; |
|
| 2577 | - } else { |
|
| 2578 | - return []; |
|
| 2579 | - } |
|
| 2556 | + if (is_array($texte)) { |
|
| 2557 | + array_walk( |
|
| 2558 | + $texte, |
|
| 2559 | + function (&$a, $key, $t) { |
|
| 2560 | + $a = extraire_balises($a, $t); |
|
| 2561 | + }, |
|
| 2562 | + $tag |
|
| 2563 | + ); |
|
| 2564 | + |
|
| 2565 | + return $texte; |
|
| 2566 | + } |
|
| 2567 | + |
|
| 2568 | + if ( |
|
| 2569 | + preg_match_all( |
|
| 2570 | + ",<{$tag}\b[^>]*(/>|>.*</{$tag}\b[^>]*>|>),UimsS", |
|
| 2571 | + $texte, |
|
| 2572 | + $regs, |
|
| 2573 | + PREG_PATTERN_ORDER |
|
| 2574 | + ) |
|
| 2575 | + ) { |
|
| 2576 | + return $regs[0]; |
|
| 2577 | + } else { |
|
| 2578 | + return []; |
|
| 2579 | + } |
|
| 2580 | 2580 | } |
| 2581 | 2581 | |
| 2582 | 2582 | /** |
@@ -2605,11 +2605,11 @@ discard block |
||
| 2605 | 2605 | * - `$def` si on n'a pas transmis de tableau |
| 2606 | 2606 | **/ |
| 2607 | 2607 | function in_any($val, $vals, $def = '') { |
| 2608 | - if (!is_array($vals) and $vals and $v = unserialize($vals)) { |
|
| 2609 | - $vals = $v; |
|
| 2610 | - } |
|
| 2608 | + if (!is_array($vals) and $vals and $v = unserialize($vals)) { |
|
| 2609 | + $vals = $v; |
|
| 2610 | + } |
|
| 2611 | 2611 | |
| 2612 | - return (!is_array($vals) ? $def : (in_array($val, $vals) ? ' ' : '')); |
|
| 2612 | + return (!is_array($vals) ? $def : (in_array($val, $vals) ? ' ' : '')); |
|
| 2613 | 2613 | } |
| 2614 | 2614 | |
| 2615 | 2615 | |
@@ -2630,12 +2630,12 @@ discard block |
||
| 2630 | 2630 | * Résultat du calcul |
| 2631 | 2631 | **/ |
| 2632 | 2632 | function valeur_numerique($expr) { |
| 2633 | - $a = 0; |
|
| 2634 | - if (preg_match(',^[0-9]+(\s*[+*-]\s*[0-9]+)*$,S', trim($expr))) { |
|
| 2635 | - eval("\$a = $expr;"); |
|
| 2636 | - } |
|
| 2633 | + $a = 0; |
|
| 2634 | + if (preg_match(',^[0-9]+(\s*[+*-]\s*[0-9]+)*$,S', trim($expr))) { |
|
| 2635 | + eval("\$a = $expr;"); |
|
| 2636 | + } |
|
| 2637 | 2637 | |
| 2638 | - return intval($a); |
|
| 2638 | + return intval($a); |
|
| 2639 | 2639 | } |
| 2640 | 2640 | |
| 2641 | 2641 | /** |
@@ -2654,7 +2654,7 @@ discard block |
||
| 2654 | 2654 | * Retourne `$a*$b/$c` |
| 2655 | 2655 | **/ |
| 2656 | 2656 | function regledetrois($a, $b, $c) { |
| 2657 | - return round($a * $b / $c); |
|
| 2657 | + return round($a * $b / $c); |
|
| 2658 | 2658 | } |
| 2659 | 2659 | |
| 2660 | 2660 | |
@@ -2677,79 +2677,79 @@ discard block |
||
| 2677 | 2677 | * @return string Suite de champs input hidden |
| 2678 | 2678 | **/ |
| 2679 | 2679 | function form_hidden(?string $action = ''): string { |
| 2680 | - $action ??= ''; |
|
| 2681 | - |
|
| 2682 | - $contexte = []; |
|
| 2683 | - include_spip('inc/urls'); |
|
| 2684 | - if ( |
|
| 2685 | - $p = urls_decoder_url($action, '') |
|
| 2686 | - and reset($p) |
|
| 2687 | - ) { |
|
| 2688 | - $fond = array_shift($p); |
|
| 2689 | - if ($fond != '404') { |
|
| 2690 | - $contexte = array_shift($p); |
|
| 2691 | - $contexte['page'] = $fond; |
|
| 2692 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2693 | - } |
|
| 2694 | - } |
|
| 2695 | - // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
|
| 2696 | - if (defined('_DEFINIR_CONTEXTE_TYPE') and _DEFINIR_CONTEXTE_TYPE) { |
|
| 2697 | - unset($contexte['type']); |
|
| 2698 | - } |
|
| 2699 | - if (!defined('_DEFINIR_CONTEXTE_TYPE_PAGE') or _DEFINIR_CONTEXTE_TYPE_PAGE) { |
|
| 2700 | - unset($contexte['type-page']); |
|
| 2701 | - } |
|
| 2702 | - |
|
| 2703 | - // on va remplir un tableau de valeurs en prenant bien soin de ne pas |
|
| 2704 | - // ecraser les elements de la forme mots[]=1&mots[]=2 |
|
| 2705 | - $values = []; |
|
| 2706 | - |
|
| 2707 | - // d'abord avec celles de l'url |
|
| 2708 | - if (false !== ($p = strpos($action, '?'))) { |
|
| 2709 | - foreach (preg_split('/&(amp;)?/S', substr($action, $p + 1)) as $c) { |
|
| 2710 | - $c = explode('=', $c, 2); |
|
| 2711 | - $var = array_shift($c); |
|
| 2712 | - $val = array_shift($c) ?? ''; |
|
| 2713 | - if ($var) { |
|
| 2714 | - $val = rawurldecode($val); |
|
| 2715 | - $var = rawurldecode($var); // decoder les [] eventuels |
|
| 2716 | - if (preg_match(',\[\]$,S', $var)) { |
|
| 2717 | - $values[] = [$var, $val]; |
|
| 2718 | - } else { |
|
| 2719 | - if (!isset($values[$var])) { |
|
| 2720 | - $values[$var] = [$var, $val]; |
|
| 2721 | - } |
|
| 2722 | - } |
|
| 2723 | - } |
|
| 2724 | - } |
|
| 2725 | - } |
|
| 2726 | - |
|
| 2727 | - // ensuite avec celles du contexte, sans doublonner ! |
|
| 2728 | - foreach ($contexte as $var => $val) { |
|
| 2729 | - if (preg_match(',\[\]$,S', $var)) { |
|
| 2730 | - $values[] = [$var, $val]; |
|
| 2731 | - } else { |
|
| 2732 | - if (!isset($values[$var])) { |
|
| 2733 | - $values[$var] = [$var, $val]; |
|
| 2734 | - } |
|
| 2735 | - } |
|
| 2736 | - } |
|
| 2737 | - |
|
| 2738 | - // puis on rassemble le tout |
|
| 2739 | - $hidden = []; |
|
| 2740 | - foreach ($values as $value) { |
|
| 2741 | - [$var, $val] = $value; |
|
| 2742 | - $hidden[] = '<input name="' |
|
| 2743 | - . entites_html($var) |
|
| 2744 | - . '"' |
|
| 2745 | - . (is_null($val) |
|
| 2746 | - ? '' |
|
| 2747 | - : ' value="' . entites_html($val) . '"' |
|
| 2748 | - ) |
|
| 2749 | - . ' type="hidden"' . "\n/>"; |
|
| 2750 | - } |
|
| 2751 | - |
|
| 2752 | - return join('', $hidden); |
|
| 2680 | + $action ??= ''; |
|
| 2681 | + |
|
| 2682 | + $contexte = []; |
|
| 2683 | + include_spip('inc/urls'); |
|
| 2684 | + if ( |
|
| 2685 | + $p = urls_decoder_url($action, '') |
|
| 2686 | + and reset($p) |
|
| 2687 | + ) { |
|
| 2688 | + $fond = array_shift($p); |
|
| 2689 | + if ($fond != '404') { |
|
| 2690 | + $contexte = array_shift($p); |
|
| 2691 | + $contexte['page'] = $fond; |
|
| 2692 | + $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2693 | + } |
|
| 2694 | + } |
|
| 2695 | + // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
|
| 2696 | + if (defined('_DEFINIR_CONTEXTE_TYPE') and _DEFINIR_CONTEXTE_TYPE) { |
|
| 2697 | + unset($contexte['type']); |
|
| 2698 | + } |
|
| 2699 | + if (!defined('_DEFINIR_CONTEXTE_TYPE_PAGE') or _DEFINIR_CONTEXTE_TYPE_PAGE) { |
|
| 2700 | + unset($contexte['type-page']); |
|
| 2701 | + } |
|
| 2702 | + |
|
| 2703 | + // on va remplir un tableau de valeurs en prenant bien soin de ne pas |
|
| 2704 | + // ecraser les elements de la forme mots[]=1&mots[]=2 |
|
| 2705 | + $values = []; |
|
| 2706 | + |
|
| 2707 | + // d'abord avec celles de l'url |
|
| 2708 | + if (false !== ($p = strpos($action, '?'))) { |
|
| 2709 | + foreach (preg_split('/&(amp;)?/S', substr($action, $p + 1)) as $c) { |
|
| 2710 | + $c = explode('=', $c, 2); |
|
| 2711 | + $var = array_shift($c); |
|
| 2712 | + $val = array_shift($c) ?? ''; |
|
| 2713 | + if ($var) { |
|
| 2714 | + $val = rawurldecode($val); |
|
| 2715 | + $var = rawurldecode($var); // decoder les [] eventuels |
|
| 2716 | + if (preg_match(',\[\]$,S', $var)) { |
|
| 2717 | + $values[] = [$var, $val]; |
|
| 2718 | + } else { |
|
| 2719 | + if (!isset($values[$var])) { |
|
| 2720 | + $values[$var] = [$var, $val]; |
|
| 2721 | + } |
|
| 2722 | + } |
|
| 2723 | + } |
|
| 2724 | + } |
|
| 2725 | + } |
|
| 2726 | + |
|
| 2727 | + // ensuite avec celles du contexte, sans doublonner ! |
|
| 2728 | + foreach ($contexte as $var => $val) { |
|
| 2729 | + if (preg_match(',\[\]$,S', $var)) { |
|
| 2730 | + $values[] = [$var, $val]; |
|
| 2731 | + } else { |
|
| 2732 | + if (!isset($values[$var])) { |
|
| 2733 | + $values[$var] = [$var, $val]; |
|
| 2734 | + } |
|
| 2735 | + } |
|
| 2736 | + } |
|
| 2737 | + |
|
| 2738 | + // puis on rassemble le tout |
|
| 2739 | + $hidden = []; |
|
| 2740 | + foreach ($values as $value) { |
|
| 2741 | + [$var, $val] = $value; |
|
| 2742 | + $hidden[] = '<input name="' |
|
| 2743 | + . entites_html($var) |
|
| 2744 | + . '"' |
|
| 2745 | + . (is_null($val) |
|
| 2746 | + ? '' |
|
| 2747 | + : ' value="' . entites_html($val) . '"' |
|
| 2748 | + ) |
|
| 2749 | + . ' type="hidden"' . "\n/>"; |
|
| 2750 | + } |
|
| 2751 | + |
|
| 2752 | + return join('', $hidden); |
|
| 2753 | 2753 | } |
| 2754 | 2754 | |
| 2755 | 2755 | |
@@ -2771,7 +2771,7 @@ discard block |
||
| 2771 | 2771 | * - la première valeur du tableau sinon. |
| 2772 | 2772 | **/ |
| 2773 | 2773 | function filtre_reset($array) { |
| 2774 | - return !is_array($array) ? null : reset($array); |
|
| 2774 | + return !is_array($array) ? null : reset($array); |
|
| 2775 | 2775 | } |
| 2776 | 2776 | |
| 2777 | 2777 | /** |
@@ -2792,7 +2792,7 @@ discard block |
||
| 2792 | 2792 | * - la dernière valeur du tableau sinon. |
| 2793 | 2793 | **/ |
| 2794 | 2794 | function filtre_end($array) { |
| 2795 | - return !is_array($array) ? null : end($array); |
|
| 2795 | + return !is_array($array) ? null : end($array); |
|
| 2796 | 2796 | } |
| 2797 | 2797 | |
| 2798 | 2798 | /** |
@@ -2812,11 +2812,11 @@ discard block |
||
| 2812 | 2812 | * |
| 2813 | 2813 | **/ |
| 2814 | 2814 | function filtre_push($array, $val) { |
| 2815 | - if (!is_array($array) or !array_push($array, $val)) { |
|
| 2816 | - return ''; |
|
| 2817 | - } |
|
| 2815 | + if (!is_array($array) or !array_push($array, $val)) { |
|
| 2816 | + return ''; |
|
| 2817 | + } |
|
| 2818 | 2818 | |
| 2819 | - return $array; |
|
| 2819 | + return $array; |
|
| 2820 | 2820 | } |
| 2821 | 2821 | |
| 2822 | 2822 | /** |
@@ -2835,7 +2835,7 @@ discard block |
||
| 2835 | 2835 | * - `true` si la valeur existe dans le tableau, `false` sinon. |
| 2836 | 2836 | **/ |
| 2837 | 2837 | function filtre_find($array, $val) { |
| 2838 | - return (is_array($array) and in_array($val, $array)); |
|
| 2838 | + return (is_array($array) and in_array($val, $array)); |
|
| 2839 | 2839 | } |
| 2840 | 2840 | |
| 2841 | 2841 | |
@@ -2852,13 +2852,13 @@ discard block |
||
| 2852 | 2852 | * Contenu avec urls en absolus |
| 2853 | 2853 | **/ |
| 2854 | 2854 | function urls_absolues_css($contenu, $source) { |
| 2855 | - $path = suivre_lien(url_absolue($source), './'); |
|
| 2855 | + $path = suivre_lien(url_absolue($source), './'); |
|
| 2856 | 2856 | |
| 2857 | - return preg_replace_callback( |
|
| 2858 | - ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
|
| 2859 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2860 | - $contenu |
|
| 2861 | - ); |
|
| 2857 | + return preg_replace_callback( |
|
| 2858 | + ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
|
| 2859 | + fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2860 | + $contenu |
|
| 2861 | + ); |
|
| 2862 | 2862 | } |
| 2863 | 2863 | |
| 2864 | 2864 | |
@@ -2887,119 +2887,119 @@ discard block |
||
| 2887 | 2887 | * Chemin du fichier CSS inversé |
| 2888 | 2888 | **/ |
| 2889 | 2889 | function direction_css($css, $voulue = '') { |
| 2890 | - if (!preg_match(',(_rtl)?\.css$,i', $css, $r)) { |
|
| 2891 | - return $css; |
|
| 2892 | - } |
|
| 2893 | - include_spip('inc/lang'); |
|
| 2894 | - // si on a precise le sens voulu en argument, le prendre en compte |
|
| 2895 | - if ($voulue = strtolower($voulue)) { |
|
| 2896 | - if ($voulue != 'rtl' and $voulue != 'ltr') { |
|
| 2897 | - $voulue = lang_dir($voulue); |
|
| 2898 | - } |
|
| 2899 | - } else { |
|
| 2900 | - $voulue = lang_dir(); |
|
| 2901 | - } |
|
| 2902 | - |
|
| 2903 | - $r = count($r) > 1; |
|
| 2904 | - $right = $r ? 'left' : 'right'; // 'right' de la css lue en entree |
|
| 2905 | - $dir = $r ? 'rtl' : 'ltr'; |
|
| 2906 | - $ndir = $r ? 'ltr' : 'rtl'; |
|
| 2907 | - |
|
| 2908 | - if ($voulue == $dir) { |
|
| 2909 | - return $css; |
|
| 2910 | - } |
|
| 2911 | - |
|
| 2912 | - if ( |
|
| 2913 | - // url absolue |
|
| 2914 | - preg_match(',^https?:,i', $css) |
|
| 2915 | - // ou qui contient un ? |
|
| 2916 | - or (($p = strpos($css, '?')) !== false) |
|
| 2917 | - ) { |
|
| 2918 | - $distant = true; |
|
| 2919 | - $cssf = parse_url($css); |
|
| 2920 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2921 | - $cssf = preg_replace(',[?:&=],', '_', $cssf); |
|
| 2922 | - } else { |
|
| 2923 | - $distant = false; |
|
| 2924 | - $cssf = $css; |
|
| 2925 | - // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
|
| 2926 | - //propose (rien a faire dans ce cas) |
|
| 2927 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2928 | - if (@file_exists($f)) { |
|
| 2929 | - return $f; |
|
| 2930 | - } |
|
| 2931 | - } |
|
| 2932 | - |
|
| 2933 | - // 2. |
|
| 2934 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
|
| 2935 | - $f = $dir_var |
|
| 2936 | - . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
|
| 2937 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2938 | - |
|
| 2939 | - // la css peut etre distante (url absolue !) |
|
| 2940 | - if ($distant) { |
|
| 2941 | - include_spip('inc/distant'); |
|
| 2942 | - $res = recuperer_url($css); |
|
| 2943 | - if (!$res or !$contenu = $res['page']) { |
|
| 2944 | - return $css; |
|
| 2945 | - } |
|
| 2946 | - } else { |
|
| 2947 | - if ( |
|
| 2948 | - (@filemtime($f) > @filemtime($css)) |
|
| 2949 | - and (_VAR_MODE != 'recalcul') |
|
| 2950 | - ) { |
|
| 2951 | - return $f; |
|
| 2952 | - } |
|
| 2953 | - if (!lire_fichier($css, $contenu)) { |
|
| 2954 | - return $css; |
|
| 2955 | - } |
|
| 2956 | - } |
|
| 2957 | - |
|
| 2958 | - |
|
| 2959 | - // Inverser la direction gauche-droite en utilisant CSSTidy qui gere aussi les shorthands |
|
| 2960 | - include_spip('lib/csstidy/class.csstidy'); |
|
| 2961 | - $parser = new csstidy(); |
|
| 2962 | - $parser->set_cfg('optimise_shorthands', 0); |
|
| 2963 | - $parser->set_cfg('reverse_left_and_right', true); |
|
| 2964 | - $parser->parse($contenu); |
|
| 2965 | - |
|
| 2966 | - $contenu = $parser->print->plain(); |
|
| 2967 | - |
|
| 2968 | - |
|
| 2969 | - // reperer les @import auxquels il faut propager le direction_css |
|
| 2970 | - preg_match_all(",\@import\s*url\s*\(\s*['\"]?([^'\"/][^:]*)['\"]?\s*\),Uims", $contenu, $regs); |
|
| 2971 | - $src = []; |
|
| 2972 | - $src_direction_css = []; |
|
| 2973 | - $src_faux_abs = []; |
|
| 2974 | - $d = dirname($css); |
|
| 2975 | - foreach ($regs[1] as $k => $import_css) { |
|
| 2976 | - $css_direction = direction_css("$d/$import_css", $voulue); |
|
| 2977 | - // si la css_direction est dans le meme path que la css d'origine, on tronque le path, elle sera passee en absolue |
|
| 2978 | - if (substr($css_direction, 0, strlen($d) + 1) == "$d/") { |
|
| 2979 | - $css_direction = substr($css_direction, strlen($d) + 1); |
|
| 2980 | - } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
|
| 2981 | - elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
|
| 2982 | - $css_direction = substr($css_direction, strlen($dir_var)); |
|
| 2983 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2984 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2985 | - } |
|
| 2986 | - $src[] = $regs[0][$k]; |
|
| 2987 | - $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
|
| 2988 | - } |
|
| 2989 | - $contenu = str_replace($src, $src_direction_css, $contenu); |
|
| 2990 | - |
|
| 2991 | - $contenu = urls_absolues_css($contenu, $css); |
|
| 2992 | - |
|
| 2993 | - // virer les fausses url absolues que l'on a mis dans les import |
|
| 2994 | - if (count($src_faux_abs)) { |
|
| 2995 | - $contenu = str_replace(array_keys($src_faux_abs), $src_faux_abs, $contenu); |
|
| 2996 | - } |
|
| 2997 | - |
|
| 2998 | - if (!ecrire_fichier($f, $contenu)) { |
|
| 2999 | - return $css; |
|
| 3000 | - } |
|
| 3001 | - |
|
| 3002 | - return $f; |
|
| 2890 | + if (!preg_match(',(_rtl)?\.css$,i', $css, $r)) { |
|
| 2891 | + return $css; |
|
| 2892 | + } |
|
| 2893 | + include_spip('inc/lang'); |
|
| 2894 | + // si on a precise le sens voulu en argument, le prendre en compte |
|
| 2895 | + if ($voulue = strtolower($voulue)) { |
|
| 2896 | + if ($voulue != 'rtl' and $voulue != 'ltr') { |
|
| 2897 | + $voulue = lang_dir($voulue); |
|
| 2898 | + } |
|
| 2899 | + } else { |
|
| 2900 | + $voulue = lang_dir(); |
|
| 2901 | + } |
|
| 2902 | + |
|
| 2903 | + $r = count($r) > 1; |
|
| 2904 | + $right = $r ? 'left' : 'right'; // 'right' de la css lue en entree |
|
| 2905 | + $dir = $r ? 'rtl' : 'ltr'; |
|
| 2906 | + $ndir = $r ? 'ltr' : 'rtl'; |
|
| 2907 | + |
|
| 2908 | + if ($voulue == $dir) { |
|
| 2909 | + return $css; |
|
| 2910 | + } |
|
| 2911 | + |
|
| 2912 | + if ( |
|
| 2913 | + // url absolue |
|
| 2914 | + preg_match(',^https?:,i', $css) |
|
| 2915 | + // ou qui contient un ? |
|
| 2916 | + or (($p = strpos($css, '?')) !== false) |
|
| 2917 | + ) { |
|
| 2918 | + $distant = true; |
|
| 2919 | + $cssf = parse_url($css); |
|
| 2920 | + $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2921 | + $cssf = preg_replace(',[?:&=],', '_', $cssf); |
|
| 2922 | + } else { |
|
| 2923 | + $distant = false; |
|
| 2924 | + $cssf = $css; |
|
| 2925 | + // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
|
| 2926 | + //propose (rien a faire dans ce cas) |
|
| 2927 | + $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2928 | + if (@file_exists($f)) { |
|
| 2929 | + return $f; |
|
| 2930 | + } |
|
| 2931 | + } |
|
| 2932 | + |
|
| 2933 | + // 2. |
|
| 2934 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
|
| 2935 | + $f = $dir_var |
|
| 2936 | + . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
|
| 2937 | + . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2938 | + |
|
| 2939 | + // la css peut etre distante (url absolue !) |
|
| 2940 | + if ($distant) { |
|
| 2941 | + include_spip('inc/distant'); |
|
| 2942 | + $res = recuperer_url($css); |
|
| 2943 | + if (!$res or !$contenu = $res['page']) { |
|
| 2944 | + return $css; |
|
| 2945 | + } |
|
| 2946 | + } else { |
|
| 2947 | + if ( |
|
| 2948 | + (@filemtime($f) > @filemtime($css)) |
|
| 2949 | + and (_VAR_MODE != 'recalcul') |
|
| 2950 | + ) { |
|
| 2951 | + return $f; |
|
| 2952 | + } |
|
| 2953 | + if (!lire_fichier($css, $contenu)) { |
|
| 2954 | + return $css; |
|
| 2955 | + } |
|
| 2956 | + } |
|
| 2957 | + |
|
| 2958 | + |
|
| 2959 | + // Inverser la direction gauche-droite en utilisant CSSTidy qui gere aussi les shorthands |
|
| 2960 | + include_spip('lib/csstidy/class.csstidy'); |
|
| 2961 | + $parser = new csstidy(); |
|
| 2962 | + $parser->set_cfg('optimise_shorthands', 0); |
|
| 2963 | + $parser->set_cfg('reverse_left_and_right', true); |
|
| 2964 | + $parser->parse($contenu); |
|
| 2965 | + |
|
| 2966 | + $contenu = $parser->print->plain(); |
|
| 2967 | + |
|
| 2968 | + |
|
| 2969 | + // reperer les @import auxquels il faut propager le direction_css |
|
| 2970 | + preg_match_all(",\@import\s*url\s*\(\s*['\"]?([^'\"/][^:]*)['\"]?\s*\),Uims", $contenu, $regs); |
|
| 2971 | + $src = []; |
|
| 2972 | + $src_direction_css = []; |
|
| 2973 | + $src_faux_abs = []; |
|
| 2974 | + $d = dirname($css); |
|
| 2975 | + foreach ($regs[1] as $k => $import_css) { |
|
| 2976 | + $css_direction = direction_css("$d/$import_css", $voulue); |
|
| 2977 | + // si la css_direction est dans le meme path que la css d'origine, on tronque le path, elle sera passee en absolue |
|
| 2978 | + if (substr($css_direction, 0, strlen($d) + 1) == "$d/") { |
|
| 2979 | + $css_direction = substr($css_direction, strlen($d) + 1); |
|
| 2980 | + } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
|
| 2981 | + elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
|
| 2982 | + $css_direction = substr($css_direction, strlen($dir_var)); |
|
| 2983 | + $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2984 | + $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2985 | + } |
|
| 2986 | + $src[] = $regs[0][$k]; |
|
| 2987 | + $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
|
| 2988 | + } |
|
| 2989 | + $contenu = str_replace($src, $src_direction_css, $contenu); |
|
| 2990 | + |
|
| 2991 | + $contenu = urls_absolues_css($contenu, $css); |
|
| 2992 | + |
|
| 2993 | + // virer les fausses url absolues que l'on a mis dans les import |
|
| 2994 | + if (count($src_faux_abs)) { |
|
| 2995 | + $contenu = str_replace(array_keys($src_faux_abs), $src_faux_abs, $contenu); |
|
| 2996 | + } |
|
| 2997 | + |
|
| 2998 | + if (!ecrire_fichier($f, $contenu)) { |
|
| 2999 | + return $css; |
|
| 3000 | + } |
|
| 3001 | + |
|
| 3002 | + return $f; |
|
| 3003 | 3003 | } |
| 3004 | 3004 | |
| 3005 | 3005 | |
@@ -3022,46 +3022,46 @@ discard block |
||
| 3022 | 3022 | * - Chemin ou URL du fichier CSS source sinon. |
| 3023 | 3023 | **/ |
| 3024 | 3024 | function url_absolue_css($css) { |
| 3025 | - if (!preg_match(',\.css$,i', $css, $r)) { |
|
| 3026 | - return $css; |
|
| 3027 | - } |
|
| 3025 | + if (!preg_match(',\.css$,i', $css, $r)) { |
|
| 3026 | + return $css; |
|
| 3027 | + } |
|
| 3028 | 3028 | |
| 3029 | - $url_absolue_css = url_absolue($css); |
|
| 3029 | + $url_absolue_css = url_absolue($css); |
|
| 3030 | 3030 | |
| 3031 | - $f = basename($css, '.css'); |
|
| 3032 | - $f = sous_repertoire(_DIR_VAR, 'cache-css') |
|
| 3033 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3034 | - . '.css'; |
|
| 3031 | + $f = basename($css, '.css'); |
|
| 3032 | + $f = sous_repertoire(_DIR_VAR, 'cache-css') |
|
| 3033 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3034 | + . '.css'; |
|
| 3035 | 3035 | |
| 3036 | - if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
|
| 3037 | - return $f; |
|
| 3038 | - } |
|
| 3036 | + if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
|
| 3037 | + return $f; |
|
| 3038 | + } |
|
| 3039 | 3039 | |
| 3040 | - if ($url_absolue_css == $css) { |
|
| 3041 | - if ( |
|
| 3042 | - strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
|
| 3043 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3044 | - ) { |
|
| 3045 | - include_spip('inc/distant'); |
|
| 3046 | - $contenu = recuperer_url($css); |
|
| 3047 | - $contenu = $contenu['page'] ?? ''; |
|
| 3048 | - if (!$contenu) { |
|
| 3049 | - return $css; |
|
| 3050 | - } |
|
| 3051 | - } |
|
| 3052 | - } elseif (!lire_fichier($css, $contenu)) { |
|
| 3053 | - return $css; |
|
| 3054 | - } |
|
| 3040 | + if ($url_absolue_css == $css) { |
|
| 3041 | + if ( |
|
| 3042 | + strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
|
| 3043 | + or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3044 | + ) { |
|
| 3045 | + include_spip('inc/distant'); |
|
| 3046 | + $contenu = recuperer_url($css); |
|
| 3047 | + $contenu = $contenu['page'] ?? ''; |
|
| 3048 | + if (!$contenu) { |
|
| 3049 | + return $css; |
|
| 3050 | + } |
|
| 3051 | + } |
|
| 3052 | + } elseif (!lire_fichier($css, $contenu)) { |
|
| 3053 | + return $css; |
|
| 3054 | + } |
|
| 3055 | 3055 | |
| 3056 | - // passer les url relatives a la css d'origine en url absolues |
|
| 3057 | - $contenu = urls_absolues_css($contenu, $css); |
|
| 3056 | + // passer les url relatives a la css d'origine en url absolues |
|
| 3057 | + $contenu = urls_absolues_css($contenu, $css); |
|
| 3058 | 3058 | |
| 3059 | - // ecrire la css |
|
| 3060 | - if (!ecrire_fichier($f, $contenu)) { |
|
| 3061 | - return $css; |
|
| 3062 | - } |
|
| 3059 | + // ecrire la css |
|
| 3060 | + if (!ecrire_fichier($f, $contenu)) { |
|
| 3061 | + return $css; |
|
| 3062 | + } |
|
| 3063 | 3063 | |
| 3064 | - return $f; |
|
| 3064 | + return $f; |
|
| 3065 | 3065 | } |
| 3066 | 3066 | |
| 3067 | 3067 | |
@@ -3095,24 +3095,24 @@ discard block |
||
| 3095 | 3095 | * Valeur trouvée ou valeur par défaut. |
| 3096 | 3096 | **/ |
| 3097 | 3097 | function table_valeur($table, $cle, $defaut = '', $conserver_null = false) { |
| 3098 | - foreach (explode('/', $cle) as $k) { |
|
| 3099 | - $table = (is_string($table) ? @unserialize($table) : $table); |
|
| 3098 | + foreach (explode('/', $cle) as $k) { |
|
| 3099 | + $table = (is_string($table) ? @unserialize($table) : $table); |
|
| 3100 | 3100 | |
| 3101 | - if (is_object($table)) { |
|
| 3102 | - $table = (($k !== '') and isset($table->$k)) ? $table->$k : $defaut; |
|
| 3103 | - } elseif (is_array($table)) { |
|
| 3104 | - if ($conserver_null) { |
|
| 3105 | - $table = array_key_exists($k, $table) ? $table[$k] : $defaut; |
|
| 3106 | - } else { |
|
| 3107 | - $table = ($table[$k] ?? $defaut); |
|
| 3108 | - } |
|
| 3109 | - } else { |
|
| 3110 | - $table = $defaut; |
|
| 3111 | - break; |
|
| 3112 | - } |
|
| 3113 | - } |
|
| 3101 | + if (is_object($table)) { |
|
| 3102 | + $table = (($k !== '') and isset($table->$k)) ? $table->$k : $defaut; |
|
| 3103 | + } elseif (is_array($table)) { |
|
| 3104 | + if ($conserver_null) { |
|
| 3105 | + $table = array_key_exists($k, $table) ? $table[$k] : $defaut; |
|
| 3106 | + } else { |
|
| 3107 | + $table = ($table[$k] ?? $defaut); |
|
| 3108 | + } |
|
| 3109 | + } else { |
|
| 3110 | + $table = $defaut; |
|
| 3111 | + break; |
|
| 3112 | + } |
|
| 3113 | + } |
|
| 3114 | 3114 | |
| 3115 | - return $table; |
|
| 3115 | + return $table; |
|
| 3116 | 3116 | } |
| 3117 | 3117 | |
| 3118 | 3118 | /** |
@@ -3145,22 +3145,22 @@ discard block |
||
| 3145 | 3145 | * - string : expression trouvée. |
| 3146 | 3146 | **/ |
| 3147 | 3147 | function filtre_match_dist(?string $texte, $expression, $modif = 'UuimsS', $capte = 0) { |
| 3148 | - if (intval($modif) and $capte == 0) { |
|
| 3149 | - $capte = $modif; |
|
| 3150 | - $modif = 'UuimsS'; |
|
| 3151 | - } |
|
| 3152 | - $expression = str_replace('\/', '/', $expression); |
|
| 3153 | - $expression = str_replace('/', '\/', $expression); |
|
| 3148 | + if (intval($modif) and $capte == 0) { |
|
| 3149 | + $capte = $modif; |
|
| 3150 | + $modif = 'UuimsS'; |
|
| 3151 | + } |
|
| 3152 | + $expression = str_replace('\/', '/', $expression); |
|
| 3153 | + $expression = str_replace('/', '\/', $expression); |
|
| 3154 | 3154 | |
| 3155 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3156 | - if (isset($r[$capte])) { |
|
| 3157 | - return $r[$capte]; |
|
| 3158 | - } else { |
|
| 3159 | - return true; |
|
| 3160 | - } |
|
| 3161 | - } |
|
| 3155 | + if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3156 | + if (isset($r[$capte])) { |
|
| 3157 | + return $r[$capte]; |
|
| 3158 | + } else { |
|
| 3159 | + return true; |
|
| 3160 | + } |
|
| 3161 | + } |
|
| 3162 | 3162 | |
| 3163 | - return false; |
|
| 3163 | + return false; |
|
| 3164 | 3164 | } |
| 3165 | 3165 | |
| 3166 | 3166 | |
@@ -3187,10 +3187,10 @@ discard block |
||
| 3187 | 3187 | * texte |
| 3188 | 3188 | **/ |
| 3189 | 3189 | function replace($texte, $expression, $replace = '', $modif = 'UimsS') { |
| 3190 | - $expression = str_replace('\/', '/', $expression); |
|
| 3191 | - $expression = str_replace('/', '\/', $expression); |
|
| 3190 | + $expression = str_replace('\/', '/', $expression); |
|
| 3191 | + $expression = str_replace('/', '\/', $expression); |
|
| 3192 | 3192 | |
| 3193 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3193 | + return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3194 | 3194 | } |
| 3195 | 3195 | |
| 3196 | 3196 | |
@@ -3208,25 +3208,25 @@ discard block |
||
| 3208 | 3208 | **/ |
| 3209 | 3209 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3210 | 3210 | |
| 3211 | - // Verifier dans le texte & les notes (pas beau, helas) |
|
| 3212 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3211 | + // Verifier dans le texte & les notes (pas beau, helas) |
|
| 3212 | + $t = $letexte . $GLOBALS['les_notes']; |
|
| 3213 | 3213 | |
| 3214 | - if ( |
|
| 3215 | - strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
|
| 3216 | - and preg_match_all( |
|
| 3217 | - ',<[^>]+\sclass=["\']spip_document_([0-9]+)[\s"\'],imsS', |
|
| 3218 | - $t, |
|
| 3219 | - $matches, |
|
| 3220 | - PREG_PATTERN_ORDER |
|
| 3221 | - ) |
|
| 3222 | - ) { |
|
| 3223 | - if (!isset($doublons['documents'])) { |
|
| 3224 | - $doublons['documents'] = ''; |
|
| 3225 | - } |
|
| 3226 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3227 | - } |
|
| 3214 | + if ( |
|
| 3215 | + strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
|
| 3216 | + and preg_match_all( |
|
| 3217 | + ',<[^>]+\sclass=["\']spip_document_([0-9]+)[\s"\'],imsS', |
|
| 3218 | + $t, |
|
| 3219 | + $matches, |
|
| 3220 | + PREG_PATTERN_ORDER |
|
| 3221 | + ) |
|
| 3222 | + ) { |
|
| 3223 | + if (!isset($doublons['documents'])) { |
|
| 3224 | + $doublons['documents'] = ''; |
|
| 3225 | + } |
|
| 3226 | + $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3227 | + } |
|
| 3228 | 3228 | |
| 3229 | - return $letexte; |
|
| 3229 | + return $letexte; |
|
| 3230 | 3230 | } |
| 3231 | 3231 | |
| 3232 | 3232 | /** |
@@ -3240,7 +3240,7 @@ discard block |
||
| 3240 | 3240 | * @return string Chaîne vide |
| 3241 | 3241 | **/ |
| 3242 | 3242 | function vide($texte) { |
| 3243 | - return ''; |
|
| 3243 | + return ''; |
|
| 3244 | 3244 | } |
| 3245 | 3245 | |
| 3246 | 3246 | // |
@@ -3269,23 +3269,23 @@ discard block |
||
| 3269 | 3269 | * Code HTML résultant |
| 3270 | 3270 | **/ |
| 3271 | 3271 | function env_to_params($env, $ignore_params = []) { |
| 3272 | - $ignore_params = array_merge( |
|
| 3273 | - ['id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'], |
|
| 3274 | - $ignore_params |
|
| 3275 | - ); |
|
| 3276 | - if (!is_array($env)) { |
|
| 3277 | - $env = unserialize($env); |
|
| 3278 | - } |
|
| 3279 | - $texte = ''; |
|
| 3280 | - if ($env) { |
|
| 3281 | - foreach ($env as $i => $j) { |
|
| 3282 | - if (is_string($j) and !in_array($i, $ignore_params)) { |
|
| 3283 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3284 | - } |
|
| 3285 | - } |
|
| 3286 | - } |
|
| 3287 | - |
|
| 3288 | - return $texte; |
|
| 3272 | + $ignore_params = array_merge( |
|
| 3273 | + ['id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'], |
|
| 3274 | + $ignore_params |
|
| 3275 | + ); |
|
| 3276 | + if (!is_array($env)) { |
|
| 3277 | + $env = unserialize($env); |
|
| 3278 | + } |
|
| 3279 | + $texte = ''; |
|
| 3280 | + if ($env) { |
|
| 3281 | + foreach ($env as $i => $j) { |
|
| 3282 | + if (is_string($j) and !in_array($i, $ignore_params)) { |
|
| 3283 | + $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3284 | + } |
|
| 3285 | + } |
|
| 3286 | + } |
|
| 3287 | + |
|
| 3288 | + return $texte; |
|
| 3289 | 3289 | } |
| 3290 | 3290 | |
| 3291 | 3291 | /** |
@@ -3308,23 +3308,23 @@ discard block |
||
| 3308 | 3308 | * Code HTML résultant |
| 3309 | 3309 | **/ |
| 3310 | 3310 | function env_to_attributs($env, $ignore_params = []) { |
| 3311 | - $ignore_params = array_merge( |
|
| 3312 | - ['id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'], |
|
| 3313 | - $ignore_params |
|
| 3314 | - ); |
|
| 3315 | - if (!is_array($env)) { |
|
| 3316 | - $env = unserialize($env); |
|
| 3317 | - } |
|
| 3318 | - $texte = ''; |
|
| 3319 | - if ($env) { |
|
| 3320 | - foreach ($env as $i => $j) { |
|
| 3321 | - if (is_string($j) and !in_array($i, $ignore_params)) { |
|
| 3322 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3323 | - } |
|
| 3324 | - } |
|
| 3325 | - } |
|
| 3311 | + $ignore_params = array_merge( |
|
| 3312 | + ['id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'], |
|
| 3313 | + $ignore_params |
|
| 3314 | + ); |
|
| 3315 | + if (!is_array($env)) { |
|
| 3316 | + $env = unserialize($env); |
|
| 3317 | + } |
|
| 3318 | + $texte = ''; |
|
| 3319 | + if ($env) { |
|
| 3320 | + foreach ($env as $i => $j) { |
|
| 3321 | + if (is_string($j) and !in_array($i, $ignore_params)) { |
|
| 3322 | + $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3323 | + } |
|
| 3324 | + } |
|
| 3325 | + } |
|
| 3326 | 3326 | |
| 3327 | - return $texte; |
|
| 3327 | + return $texte; |
|
| 3328 | 3328 | } |
| 3329 | 3329 | |
| 3330 | 3330 | |
@@ -3342,7 +3342,7 @@ discard block |
||
| 3342 | 3342 | * @return string Chaînes concaténés |
| 3343 | 3343 | **/ |
| 3344 | 3344 | function concat(...$args): string { |
| 3345 | - return join('', $args); |
|
| 3345 | + return join('', $args); |
|
| 3346 | 3346 | } |
| 3347 | 3347 | |
| 3348 | 3348 | |
@@ -3362,23 +3362,23 @@ discard block |
||
| 3362 | 3362 | * Contenu du ou des fichiers, concaténé |
| 3363 | 3363 | **/ |
| 3364 | 3364 | function charge_scripts($files, $script = true) { |
| 3365 | - $flux = ''; |
|
| 3366 | - foreach (is_array($files) ? $files : explode('|', $files) as $file) { |
|
| 3367 | - if (!is_string($file)) { |
|
| 3368 | - continue; |
|
| 3369 | - } |
|
| 3370 | - if ($script) { |
|
| 3371 | - $file = preg_match(',^\w+$,', $file) ? "javascript/$file.js" : ''; |
|
| 3372 | - } |
|
| 3373 | - if ($file) { |
|
| 3374 | - $path = find_in_path($file); |
|
| 3375 | - if ($path) { |
|
| 3376 | - $flux .= spip_file_get_contents($path); |
|
| 3377 | - } |
|
| 3378 | - } |
|
| 3379 | - } |
|
| 3380 | - |
|
| 3381 | - return $flux; |
|
| 3365 | + $flux = ''; |
|
| 3366 | + foreach (is_array($files) ? $files : explode('|', $files) as $file) { |
|
| 3367 | + if (!is_string($file)) { |
|
| 3368 | + continue; |
|
| 3369 | + } |
|
| 3370 | + if ($script) { |
|
| 3371 | + $file = preg_match(',^\w+$,', $file) ? "javascript/$file.js" : ''; |
|
| 3372 | + } |
|
| 3373 | + if ($file) { |
|
| 3374 | + $path = find_in_path($file); |
|
| 3375 | + if ($path) { |
|
| 3376 | + $flux .= spip_file_get_contents($path); |
|
| 3377 | + } |
|
| 3378 | + } |
|
| 3379 | + } |
|
| 3380 | + |
|
| 3381 | + return $flux; |
|
| 3382 | 3382 | } |
| 3383 | 3383 | |
| 3384 | 3384 | /** |
@@ -3389,22 +3389,22 @@ discard block |
||
| 3389 | 3389 | * @return string |
| 3390 | 3390 | */ |
| 3391 | 3391 | function http_img_variante_svg_si_possible($img_file) { |
| 3392 | - // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
|
| 3393 | - // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
|
| 3394 | - if ( |
|
| 3395 | - preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
|
| 3396 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3397 | - and file_exists($variante_svg_generique) |
|
| 3398 | - ) { |
|
| 3399 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3400 | - $img_file = $variante_svg_size; |
|
| 3401 | - } |
|
| 3402 | - else { |
|
| 3403 | - $img_file = $variante_svg_generique; |
|
| 3404 | - } |
|
| 3405 | - } |
|
| 3392 | + // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
|
| 3393 | + // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
|
| 3394 | + if ( |
|
| 3395 | + preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
|
| 3396 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3397 | + and file_exists($variante_svg_generique) |
|
| 3398 | + ) { |
|
| 3399 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3400 | + $img_file = $variante_svg_size; |
|
| 3401 | + } |
|
| 3402 | + else { |
|
| 3403 | + $img_file = $variante_svg_generique; |
|
| 3404 | + } |
|
| 3405 | + } |
|
| 3406 | 3406 | |
| 3407 | - return $img_file; |
|
| 3407 | + return $img_file; |
|
| 3408 | 3408 | } |
| 3409 | 3409 | |
| 3410 | 3410 | /** |
@@ -3425,54 +3425,54 @@ discard block |
||
| 3425 | 3425 | */ |
| 3426 | 3426 | function http_img_pack($img, $alt, $atts = '', $title = '', $options = []) { |
| 3427 | 3427 | |
| 3428 | - $img_file = $img; |
|
| 3429 | - if ($p = strpos($img_file, '?')) { |
|
| 3430 | - $img_file = substr($img_file, 0, $p); |
|
| 3431 | - } |
|
| 3432 | - if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
|
| 3433 | - $img_file = chemin_image($img); |
|
| 3434 | - } |
|
| 3435 | - else { |
|
| 3436 | - if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3437 | - $img_file = http_img_variante_svg_si_possible($img_file); |
|
| 3438 | - } |
|
| 3439 | - } |
|
| 3440 | - if (stripos($atts, 'width') === false) { |
|
| 3441 | - // utiliser directement l'info de taille presente dans le nom |
|
| 3442 | - if ( |
|
| 3443 | - (!isset($options['utiliser_suffixe_size']) |
|
| 3444 | - or $options['utiliser_suffixe_size'] == true |
|
| 3445 | - or str_contains($img_file, '-xx.svg')) |
|
| 3446 | - and (preg_match(',-([0-9]+)[.](png|gif|svg)$,', $img, $regs) |
|
| 3447 | - or preg_match(',\?([0-9]+)px$,', $img, $regs)) |
|
| 3448 | - ) { |
|
| 3449 | - $largeur = $hauteur = intval($regs[1]); |
|
| 3450 | - } else { |
|
| 3451 | - $taille = taille_image($img_file); |
|
| 3452 | - [$hauteur, $largeur] = $taille; |
|
| 3453 | - if (!$hauteur or !$largeur) { |
|
| 3454 | - return ''; |
|
| 3455 | - } |
|
| 3456 | - } |
|
| 3457 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3458 | - } |
|
| 3459 | - |
|
| 3460 | - if (file_exists($img_file)) { |
|
| 3461 | - $img_file = timestamp($img_file); |
|
| 3462 | - } |
|
| 3463 | - if ($alt === false) { |
|
| 3464 | - $alt = ''; |
|
| 3465 | - } |
|
| 3466 | - elseif ($alt or $alt === '') { |
|
| 3467 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3468 | - } |
|
| 3469 | - else { |
|
| 3470 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3471 | - } |
|
| 3472 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3473 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3474 | - . ' ' . ltrim($atts) |
|
| 3475 | - . ' />'; |
|
| 3428 | + $img_file = $img; |
|
| 3429 | + if ($p = strpos($img_file, '?')) { |
|
| 3430 | + $img_file = substr($img_file, 0, $p); |
|
| 3431 | + } |
|
| 3432 | + if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
|
| 3433 | + $img_file = chemin_image($img); |
|
| 3434 | + } |
|
| 3435 | + else { |
|
| 3436 | + if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3437 | + $img_file = http_img_variante_svg_si_possible($img_file); |
|
| 3438 | + } |
|
| 3439 | + } |
|
| 3440 | + if (stripos($atts, 'width') === false) { |
|
| 3441 | + // utiliser directement l'info de taille presente dans le nom |
|
| 3442 | + if ( |
|
| 3443 | + (!isset($options['utiliser_suffixe_size']) |
|
| 3444 | + or $options['utiliser_suffixe_size'] == true |
|
| 3445 | + or str_contains($img_file, '-xx.svg')) |
|
| 3446 | + and (preg_match(',-([0-9]+)[.](png|gif|svg)$,', $img, $regs) |
|
| 3447 | + or preg_match(',\?([0-9]+)px$,', $img, $regs)) |
|
| 3448 | + ) { |
|
| 3449 | + $largeur = $hauteur = intval($regs[1]); |
|
| 3450 | + } else { |
|
| 3451 | + $taille = taille_image($img_file); |
|
| 3452 | + [$hauteur, $largeur] = $taille; |
|
| 3453 | + if (!$hauteur or !$largeur) { |
|
| 3454 | + return ''; |
|
| 3455 | + } |
|
| 3456 | + } |
|
| 3457 | + $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3458 | + } |
|
| 3459 | + |
|
| 3460 | + if (file_exists($img_file)) { |
|
| 3461 | + $img_file = timestamp($img_file); |
|
| 3462 | + } |
|
| 3463 | + if ($alt === false) { |
|
| 3464 | + $alt = ''; |
|
| 3465 | + } |
|
| 3466 | + elseif ($alt or $alt === '') { |
|
| 3467 | + $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3468 | + } |
|
| 3469 | + else { |
|
| 3470 | + $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3471 | + } |
|
| 3472 | + return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3473 | + . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3474 | + . ' ' . ltrim($atts) |
|
| 3475 | + . ' />'; |
|
| 3476 | 3476 | } |
| 3477 | 3477 | |
| 3478 | 3478 | /** |
@@ -3484,70 +3484,70 @@ discard block |
||
| 3484 | 3484 | * @return string |
| 3485 | 3485 | */ |
| 3486 | 3486 | function http_style_background($img, $att = '', $size = null) { |
| 3487 | - if ($size and is_numeric($size)) { |
|
| 3488 | - $size = trim($size) . 'px'; |
|
| 3489 | - } |
|
| 3490 | - return " style='background" . |
|
| 3491 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3492 | - . ($size ? "background-size:{$size};" : '') |
|
| 3493 | - . "'"; |
|
| 3487 | + if ($size and is_numeric($size)) { |
|
| 3488 | + $size = trim($size) . 'px'; |
|
| 3489 | + } |
|
| 3490 | + return " style='background" . |
|
| 3491 | + ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3492 | + . ($size ? "background-size:{$size};" : '') |
|
| 3493 | + . "'"; |
|
| 3494 | 3494 | } |
| 3495 | 3495 | |
| 3496 | 3496 | |
| 3497 | 3497 | function helper_filtre_balise_img_svg_arguments($alt_or_size, $class_or_size, $size) { |
| 3498 | - $args = [$alt_or_size, $class_or_size, $size]; |
|
| 3499 | - while (is_null(end($args)) and count($args)) { |
|
| 3500 | - array_pop($args); |
|
| 3501 | - } |
|
| 3502 | - if (!count($args)) { |
|
| 3503 | - return [null, null, null]; |
|
| 3504 | - } |
|
| 3505 | - if (count($args) < 3) { |
|
| 3506 | - $maybe_size = array_pop($args); |
|
| 3507 | - // @2x |
|
| 3508 | - // @1.5x |
|
| 3509 | - // 512 |
|
| 3510 | - // 512x* |
|
| 3511 | - // 512x300 |
|
| 3512 | - if ( |
|
| 3513 | - !strlen($maybe_size) |
|
| 3514 | - or !preg_match(',^(@\d+(\.\d+)?x|\d+(x\*)?|\d+x\d+)$,', trim($maybe_size)) |
|
| 3515 | - ) { |
|
| 3516 | - $args[] = $maybe_size; |
|
| 3517 | - $maybe_size = null; |
|
| 3518 | - } |
|
| 3519 | - while (count($args) < 2) { |
|
| 3520 | - $args[] = null; // default alt or class |
|
| 3521 | - } |
|
| 3522 | - $args[] = $maybe_size; |
|
| 3523 | - } |
|
| 3524 | - return $args; |
|
| 3498 | + $args = [$alt_or_size, $class_or_size, $size]; |
|
| 3499 | + while (is_null(end($args)) and count($args)) { |
|
| 3500 | + array_pop($args); |
|
| 3501 | + } |
|
| 3502 | + if (!count($args)) { |
|
| 3503 | + return [null, null, null]; |
|
| 3504 | + } |
|
| 3505 | + if (count($args) < 3) { |
|
| 3506 | + $maybe_size = array_pop($args); |
|
| 3507 | + // @2x |
|
| 3508 | + // @1.5x |
|
| 3509 | + // 512 |
|
| 3510 | + // 512x* |
|
| 3511 | + // 512x300 |
|
| 3512 | + if ( |
|
| 3513 | + !strlen($maybe_size) |
|
| 3514 | + or !preg_match(',^(@\d+(\.\d+)?x|\d+(x\*)?|\d+x\d+)$,', trim($maybe_size)) |
|
| 3515 | + ) { |
|
| 3516 | + $args[] = $maybe_size; |
|
| 3517 | + $maybe_size = null; |
|
| 3518 | + } |
|
| 3519 | + while (count($args) < 2) { |
|
| 3520 | + $args[] = null; // default alt or class |
|
| 3521 | + } |
|
| 3522 | + $args[] = $maybe_size; |
|
| 3523 | + } |
|
| 3524 | + return $args; |
|
| 3525 | 3525 | } |
| 3526 | 3526 | |
| 3527 | 3527 | function helper_filtre_balise_img_svg_size($img, $size) { |
| 3528 | - // si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite |
|
| 3529 | - if (strpos($size, '@') === 0 and substr($size, -1) === 'x') { |
|
| 3530 | - $coef = floatval(substr($size, 1, -1)); |
|
| 3531 | - [$h, $w] = taille_image($img); |
|
| 3532 | - $height = intval(round($h / $coef)); |
|
| 3533 | - $width = intval(round($w / $coef)); |
|
| 3534 | - } |
|
| 3535 | - // sinon c'est une valeur seule si image caree ou largeurxhauteur |
|
| 3536 | - else { |
|
| 3537 | - $size = explode('x', $size, 2); |
|
| 3538 | - $size = array_map('trim', $size); |
|
| 3539 | - $height = $width = intval(array_shift($size)); |
|
| 3540 | - |
|
| 3541 | - if (count($size) and reset($size)) { |
|
| 3542 | - $height = array_shift($size); |
|
| 3543 | - if ($height === '*') { |
|
| 3544 | - [$h, $w] = taille_image($img); |
|
| 3545 | - $height = intval(round($h * $width / $w)); |
|
| 3546 | - } |
|
| 3547 | - } |
|
| 3548 | - } |
|
| 3549 | - |
|
| 3550 | - return [$width, $height]; |
|
| 3528 | + // si size est de la forme '@2x' c'est un coeff multiplicateur sur la densite |
|
| 3529 | + if (strpos($size, '@') === 0 and substr($size, -1) === 'x') { |
|
| 3530 | + $coef = floatval(substr($size, 1, -1)); |
|
| 3531 | + [$h, $w] = taille_image($img); |
|
| 3532 | + $height = intval(round($h / $coef)); |
|
| 3533 | + $width = intval(round($w / $coef)); |
|
| 3534 | + } |
|
| 3535 | + // sinon c'est une valeur seule si image caree ou largeurxhauteur |
|
| 3536 | + else { |
|
| 3537 | + $size = explode('x', $size, 2); |
|
| 3538 | + $size = array_map('trim', $size); |
|
| 3539 | + $height = $width = intval(array_shift($size)); |
|
| 3540 | + |
|
| 3541 | + if (count($size) and reset($size)) { |
|
| 3542 | + $height = array_shift($size); |
|
| 3543 | + if ($height === '*') { |
|
| 3544 | + [$h, $w] = taille_image($img); |
|
| 3545 | + $height = intval(round($h * $width / $w)); |
|
| 3546 | + } |
|
| 3547 | + } |
|
| 3548 | + } |
|
| 3549 | + |
|
| 3550 | + return [$width, $height]; |
|
| 3551 | 3551 | } |
| 3552 | 3552 | |
| 3553 | 3553 | /** |
@@ -3583,43 +3583,43 @@ discard block |
||
| 3583 | 3583 | */ |
| 3584 | 3584 | function filtre_balise_img_dist($img, $alt = '', $class = null, $size = null) { |
| 3585 | 3585 | |
| 3586 | - [$alt, $class, $size] = helper_filtre_balise_img_svg_arguments($alt, $class, $size); |
|
| 3587 | - |
|
| 3588 | - $img = trim((string) $img); |
|
| 3589 | - if (strpos($img, '<img') === 0) { |
|
| 3590 | - if (!is_null($alt)) { |
|
| 3591 | - $img = inserer_attribut($img, 'alt', $alt); |
|
| 3592 | - } |
|
| 3593 | - if (!is_null($class)) { |
|
| 3594 | - if (strlen($class)) { |
|
| 3595 | - $img = inserer_attribut($img, 'class', $class); |
|
| 3596 | - } |
|
| 3597 | - else { |
|
| 3598 | - $img = vider_attribut($img, 'class'); |
|
| 3599 | - } |
|
| 3600 | - } |
|
| 3601 | - } |
|
| 3602 | - else { |
|
| 3603 | - $img = http_img_pack( |
|
| 3604 | - $img, |
|
| 3605 | - $alt, |
|
| 3606 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3607 | - '', |
|
| 3608 | - ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
|
| 3609 | - ); |
|
| 3610 | - if (is_null($alt)) { |
|
| 3611 | - $img = vider_attribut($img, 'alt'); |
|
| 3612 | - } |
|
| 3613 | - } |
|
| 3614 | - |
|
| 3615 | - if ($img and !is_null($size) and strlen($size = trim($size))) { |
|
| 3616 | - [$width, $height] = helper_filtre_balise_img_svg_size($img, $size); |
|
| 3617 | - |
|
| 3618 | - $img = inserer_attribut($img, 'width', $width); |
|
| 3619 | - $img = inserer_attribut($img, 'height', $height); |
|
| 3620 | - } |
|
| 3621 | - |
|
| 3622 | - return $img; |
|
| 3586 | + [$alt, $class, $size] = helper_filtre_balise_img_svg_arguments($alt, $class, $size); |
|
| 3587 | + |
|
| 3588 | + $img = trim((string) $img); |
|
| 3589 | + if (strpos($img, '<img') === 0) { |
|
| 3590 | + if (!is_null($alt)) { |
|
| 3591 | + $img = inserer_attribut($img, 'alt', $alt); |
|
| 3592 | + } |
|
| 3593 | + if (!is_null($class)) { |
|
| 3594 | + if (strlen($class)) { |
|
| 3595 | + $img = inserer_attribut($img, 'class', $class); |
|
| 3596 | + } |
|
| 3597 | + else { |
|
| 3598 | + $img = vider_attribut($img, 'class'); |
|
| 3599 | + } |
|
| 3600 | + } |
|
| 3601 | + } |
|
| 3602 | + else { |
|
| 3603 | + $img = http_img_pack( |
|
| 3604 | + $img, |
|
| 3605 | + $alt, |
|
| 3606 | + $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3607 | + '', |
|
| 3608 | + ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
|
| 3609 | + ); |
|
| 3610 | + if (is_null($alt)) { |
|
| 3611 | + $img = vider_attribut($img, 'alt'); |
|
| 3612 | + } |
|
| 3613 | + } |
|
| 3614 | + |
|
| 3615 | + if ($img and !is_null($size) and strlen($size = trim($size))) { |
|
| 3616 | + [$width, $height] = helper_filtre_balise_img_svg_size($img, $size); |
|
| 3617 | + |
|
| 3618 | + $img = inserer_attribut($img, 'width', $width); |
|
| 3619 | + $img = inserer_attribut($img, 'height', $height); |
|
| 3620 | + } |
|
| 3621 | + |
|
| 3622 | + return $img; |
|
| 3623 | 3623 | } |
| 3624 | 3624 | |
| 3625 | 3625 | |
@@ -3653,80 +3653,80 @@ discard block |
||
| 3653 | 3653 | */ |
| 3654 | 3654 | function filtre_balise_svg_dist($img, $alt = '', $class = null, $size = null) { |
| 3655 | 3655 | |
| 3656 | - $svg = null; |
|
| 3657 | - $img = trim($img); |
|
| 3658 | - $img_file = $img; |
|
| 3659 | - if (strpos($img, '<svg') === false) { |
|
| 3660 | - if ($p = strpos($img_file, '?')) { |
|
| 3661 | - $img_file = substr($img_file, 0, $p); |
|
| 3662 | - } |
|
| 3663 | - |
|
| 3664 | - // ne jamais operer directement sur une image distante pour des raisons de perfo |
|
| 3665 | - // la copie locale a toutes les chances d'etre la ou de resservir |
|
| 3666 | - if (tester_url_absolue($img_file)) { |
|
| 3667 | - include_spip('inc/distant'); |
|
| 3668 | - $fichier = copie_locale($img_file); |
|
| 3669 | - $img_file = ($fichier ? _DIR_RACINE . $fichier : $img_file); |
|
| 3670 | - } |
|
| 3671 | - |
|
| 3672 | - if ( |
|
| 3673 | - !$img_file |
|
| 3674 | - or !file_exists($img_file) |
|
| 3675 | - or !$svg = file_get_contents($img_file) |
|
| 3676 | - ) { |
|
| 3677 | - return ''; |
|
| 3678 | - } |
|
| 3679 | - } |
|
| 3680 | - |
|
| 3681 | - if (!preg_match(",<svg\b[^>]*>,UimsS", $svg, $match)) { |
|
| 3682 | - return ''; |
|
| 3683 | - } |
|
| 3684 | - |
|
| 3685 | - [$alt, $class, $size] = helper_filtre_balise_img_svg_arguments($alt, $class, $size); |
|
| 3686 | - |
|
| 3687 | - $balise_svg = $match[0]; |
|
| 3688 | - $balise_svg_source = $balise_svg; |
|
| 3689 | - |
|
| 3690 | - // entete XML à supprimer |
|
| 3691 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3692 | - |
|
| 3693 | - // IE est toujours mon ami |
|
| 3694 | - $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
|
| 3695 | - |
|
| 3696 | - // regler la classe |
|
| 3697 | - if (!is_null($class)) { |
|
| 3698 | - if (strlen($class)) { |
|
| 3699 | - $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
|
| 3700 | - } |
|
| 3701 | - else { |
|
| 3702 | - $balise_svg = vider_attribut($balise_svg, 'class'); |
|
| 3703 | - } |
|
| 3704 | - } |
|
| 3705 | - |
|
| 3706 | - // regler le alt |
|
| 3707 | - if ($alt) { |
|
| 3708 | - $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
|
| 3709 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3710 | - $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
|
| 3711 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3712 | - $balise_svg .= $title; |
|
| 3713 | - } |
|
| 3714 | - else { |
|
| 3715 | - $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
|
| 3716 | - } |
|
| 3717 | - |
|
| 3718 | - $svg = str_replace($balise_svg_source, $balise_svg, $svg); |
|
| 3719 | - |
|
| 3720 | - if (!is_null($size) and strlen($size = trim($size))) { |
|
| 3721 | - [$width, $height] = helper_filtre_balise_img_svg_size($svg, $size); |
|
| 3722 | - |
|
| 3723 | - if (!function_exists('svg_redimensionner')) { |
|
| 3724 | - include_spip('inc/svg'); |
|
| 3725 | - } |
|
| 3726 | - $svg = svg_redimensionner($svg, $width, $height); |
|
| 3727 | - } |
|
| 3728 | - |
|
| 3729 | - return $svg; |
|
| 3656 | + $svg = null; |
|
| 3657 | + $img = trim($img); |
|
| 3658 | + $img_file = $img; |
|
| 3659 | + if (strpos($img, '<svg') === false) { |
|
| 3660 | + if ($p = strpos($img_file, '?')) { |
|
| 3661 | + $img_file = substr($img_file, 0, $p); |
|
| 3662 | + } |
|
| 3663 | + |
|
| 3664 | + // ne jamais operer directement sur une image distante pour des raisons de perfo |
|
| 3665 | + // la copie locale a toutes les chances d'etre la ou de resservir |
|
| 3666 | + if (tester_url_absolue($img_file)) { |
|
| 3667 | + include_spip('inc/distant'); |
|
| 3668 | + $fichier = copie_locale($img_file); |
|
| 3669 | + $img_file = ($fichier ? _DIR_RACINE . $fichier : $img_file); |
|
| 3670 | + } |
|
| 3671 | + |
|
| 3672 | + if ( |
|
| 3673 | + !$img_file |
|
| 3674 | + or !file_exists($img_file) |
|
| 3675 | + or !$svg = file_get_contents($img_file) |
|
| 3676 | + ) { |
|
| 3677 | + return ''; |
|
| 3678 | + } |
|
| 3679 | + } |
|
| 3680 | + |
|
| 3681 | + if (!preg_match(",<svg\b[^>]*>,UimsS", $svg, $match)) { |
|
| 3682 | + return ''; |
|
| 3683 | + } |
|
| 3684 | + |
|
| 3685 | + [$alt, $class, $size] = helper_filtre_balise_img_svg_arguments($alt, $class, $size); |
|
| 3686 | + |
|
| 3687 | + $balise_svg = $match[0]; |
|
| 3688 | + $balise_svg_source = $balise_svg; |
|
| 3689 | + |
|
| 3690 | + // entete XML à supprimer |
|
| 3691 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3692 | + |
|
| 3693 | + // IE est toujours mon ami |
|
| 3694 | + $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
|
| 3695 | + |
|
| 3696 | + // regler la classe |
|
| 3697 | + if (!is_null($class)) { |
|
| 3698 | + if (strlen($class)) { |
|
| 3699 | + $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
|
| 3700 | + } |
|
| 3701 | + else { |
|
| 3702 | + $balise_svg = vider_attribut($balise_svg, 'class'); |
|
| 3703 | + } |
|
| 3704 | + } |
|
| 3705 | + |
|
| 3706 | + // regler le alt |
|
| 3707 | + if ($alt) { |
|
| 3708 | + $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
|
| 3709 | + $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3710 | + $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
|
| 3711 | + $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3712 | + $balise_svg .= $title; |
|
| 3713 | + } |
|
| 3714 | + else { |
|
| 3715 | + $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
|
| 3716 | + } |
|
| 3717 | + |
|
| 3718 | + $svg = str_replace($balise_svg_source, $balise_svg, $svg); |
|
| 3719 | + |
|
| 3720 | + if (!is_null($size) and strlen($size = trim($size))) { |
|
| 3721 | + [$width, $height] = helper_filtre_balise_img_svg_size($svg, $size); |
|
| 3722 | + |
|
| 3723 | + if (!function_exists('svg_redimensionner')) { |
|
| 3724 | + include_spip('inc/svg'); |
|
| 3725 | + } |
|
| 3726 | + $svg = svg_redimensionner($svg, $width, $height); |
|
| 3727 | + } |
|
| 3728 | + |
|
| 3729 | + return $svg; |
|
| 3730 | 3730 | } |
| 3731 | 3731 | |
| 3732 | 3732 | |
@@ -3752,18 +3752,18 @@ discard block |
||
| 3752 | 3752 | * Code HTML résultant |
| 3753 | 3753 | **/ |
| 3754 | 3754 | function filtre_foreach_dist($tableau, $modele = 'foreach') { |
| 3755 | - $texte = ''; |
|
| 3756 | - if (is_array($tableau)) { |
|
| 3757 | - foreach ($tableau as $k => $v) { |
|
| 3758 | - $res = recuperer_fond( |
|
| 3759 | - 'modeles/' . $modele, |
|
| 3760 | - array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
|
| 3761 | - ); |
|
| 3762 | - $texte .= $res; |
|
| 3763 | - } |
|
| 3764 | - } |
|
| 3755 | + $texte = ''; |
|
| 3756 | + if (is_array($tableau)) { |
|
| 3757 | + foreach ($tableau as $k => $v) { |
|
| 3758 | + $res = recuperer_fond( |
|
| 3759 | + 'modeles/' . $modele, |
|
| 3760 | + array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
|
| 3761 | + ); |
|
| 3762 | + $texte .= $res; |
|
| 3763 | + } |
|
| 3764 | + } |
|
| 3765 | 3765 | |
| 3766 | - return $texte; |
|
| 3766 | + return $texte; |
|
| 3767 | 3767 | } |
| 3768 | 3768 | |
| 3769 | 3769 | |
@@ -3788,37 +3788,37 @@ discard block |
||
| 3788 | 3788 | * - tout : retourne toutes les informations du plugin actif |
| 3789 | 3789 | **/ |
| 3790 | 3790 | function filtre_info_plugin_dist($plugin, $type_info, $reload = false) { |
| 3791 | - include_spip('inc/plugin'); |
|
| 3792 | - $plugin = strtoupper($plugin); |
|
| 3793 | - $plugins_actifs = liste_plugin_actifs(); |
|
| 3794 | - |
|
| 3795 | - if (!$plugin) { |
|
| 3796 | - return serialize(array_keys($plugins_actifs)); |
|
| 3797 | - } elseif (empty($plugins_actifs[$plugin]) and !$reload) { |
|
| 3798 | - return ''; |
|
| 3799 | - } elseif (($type_info == 'est_actif') and !$reload) { |
|
| 3800 | - return $plugins_actifs[$plugin] ? 1 : 0; |
|
| 3801 | - } elseif (isset($plugins_actifs[$plugin][$type_info]) and !$reload) { |
|
| 3802 | - return $plugins_actifs[$plugin][$type_info]; |
|
| 3803 | - } else { |
|
| 3804 | - $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 3805 | - // On prend en compte les extensions |
|
| 3806 | - if (!is_dir($plugins_actifs[$plugin]['dir_type'])) { |
|
| 3807 | - $dir_plugins = constant($plugins_actifs[$plugin]['dir_type']); |
|
| 3808 | - } else { |
|
| 3809 | - $dir_plugins = $plugins_actifs[$plugin]['dir_type']; |
|
| 3810 | - } |
|
| 3811 | - if (!$infos = $get_infos($plugins_actifs[$plugin]['dir'], $reload, $dir_plugins)) { |
|
| 3812 | - return ''; |
|
| 3813 | - } |
|
| 3814 | - if ($type_info == 'tout') { |
|
| 3815 | - return $infos; |
|
| 3816 | - } elseif ($type_info == 'est_actif') { |
|
| 3817 | - return $infos ? 1 : 0; |
|
| 3818 | - } else { |
|
| 3819 | - return strval($infos[$type_info]); |
|
| 3820 | - } |
|
| 3821 | - } |
|
| 3791 | + include_spip('inc/plugin'); |
|
| 3792 | + $plugin = strtoupper($plugin); |
|
| 3793 | + $plugins_actifs = liste_plugin_actifs(); |
|
| 3794 | + |
|
| 3795 | + if (!$plugin) { |
|
| 3796 | + return serialize(array_keys($plugins_actifs)); |
|
| 3797 | + } elseif (empty($plugins_actifs[$plugin]) and !$reload) { |
|
| 3798 | + return ''; |
|
| 3799 | + } elseif (($type_info == 'est_actif') and !$reload) { |
|
| 3800 | + return $plugins_actifs[$plugin] ? 1 : 0; |
|
| 3801 | + } elseif (isset($plugins_actifs[$plugin][$type_info]) and !$reload) { |
|
| 3802 | + return $plugins_actifs[$plugin][$type_info]; |
|
| 3803 | + } else { |
|
| 3804 | + $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 3805 | + // On prend en compte les extensions |
|
| 3806 | + if (!is_dir($plugins_actifs[$plugin]['dir_type'])) { |
|
| 3807 | + $dir_plugins = constant($plugins_actifs[$plugin]['dir_type']); |
|
| 3808 | + } else { |
|
| 3809 | + $dir_plugins = $plugins_actifs[$plugin]['dir_type']; |
|
| 3810 | + } |
|
| 3811 | + if (!$infos = $get_infos($plugins_actifs[$plugin]['dir'], $reload, $dir_plugins)) { |
|
| 3812 | + return ''; |
|
| 3813 | + } |
|
| 3814 | + if ($type_info == 'tout') { |
|
| 3815 | + return $infos; |
|
| 3816 | + } elseif ($type_info == 'est_actif') { |
|
| 3817 | + return $infos ? 1 : 0; |
|
| 3818 | + } else { |
|
| 3819 | + return strval($infos[$type_info]); |
|
| 3820 | + } |
|
| 3821 | + } |
|
| 3822 | 3822 | } |
| 3823 | 3823 | |
| 3824 | 3824 | |
@@ -3845,9 +3845,9 @@ discard block |
||
| 3845 | 3845 | * Code HTML de l'image de puce de statut à insérer (et du menu de changement si présent) |
| 3846 | 3846 | */ |
| 3847 | 3847 | function puce_changement_statut($id_objet, $statut, $id_rubrique, $type, $ajax = false) { |
| 3848 | - $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 3848 | + $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 3849 | 3849 | |
| 3850 | - return $puce_statut($id_objet, $statut, $id_rubrique, $type, $ajax); |
|
| 3850 | + return $puce_statut($id_objet, $statut, $id_rubrique, $type, $ajax); |
|
| 3851 | 3851 | } |
| 3852 | 3852 | |
| 3853 | 3853 | |
@@ -3877,19 +3877,19 @@ discard block |
||
| 3877 | 3877 | * Code HTML de l'image de puce de statut à insérer (et du menu de changement si présent) |
| 3878 | 3878 | */ |
| 3879 | 3879 | function filtre_puce_statut_dist($statut, $objet, $id_objet = 0, $id_parent = 0) { |
| 3880 | - static $puce_statut = null; |
|
| 3881 | - if (!$puce_statut) { |
|
| 3882 | - $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 3883 | - } |
|
| 3880 | + static $puce_statut = null; |
|
| 3881 | + if (!$puce_statut) { |
|
| 3882 | + $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 3883 | + } |
|
| 3884 | 3884 | |
| 3885 | - return $puce_statut( |
|
| 3886 | - $id_objet, |
|
| 3887 | - $statut, |
|
| 3888 | - $id_parent, |
|
| 3889 | - $objet, |
|
| 3890 | - false, |
|
| 3891 | - objet_info($objet, 'editable') ? _ACTIVER_PUCE_RAPIDE : false |
|
| 3892 | - ); |
|
| 3885 | + return $puce_statut( |
|
| 3886 | + $id_objet, |
|
| 3887 | + $statut, |
|
| 3888 | + $id_parent, |
|
| 3889 | + $objet, |
|
| 3890 | + false, |
|
| 3891 | + objet_info($objet, 'editable') ? _ACTIVER_PUCE_RAPIDE : false |
|
| 3892 | + ); |
|
| 3893 | 3893 | } |
| 3894 | 3894 | |
| 3895 | 3895 | |
@@ -3916,98 +3916,98 @@ discard block |
||
| 3916 | 3916 | * hash du contexte |
| 3917 | 3917 | */ |
| 3918 | 3918 | function encoder_contexte_ajax($c, $form = '', $emboite = null, $ajaxid = '') { |
| 3919 | - $env = null; |
|
| 3920 | - if ( |
|
| 3921 | - is_string($c) |
|
| 3922 | - and @unserialize($c) !== false |
|
| 3923 | - ) { |
|
| 3924 | - $c = unserialize($c); |
|
| 3925 | - } |
|
| 3926 | - |
|
| 3927 | - // supprimer les parametres debut_x |
|
| 3928 | - // pour que la pagination ajax ne soit pas plantee |
|
| 3929 | - // si on charge la page &debut_x=1 : car alors en cliquant sur l'item 0, |
|
| 3930 | - // le debut_x=0 n'existe pas, et on resterait sur 1 |
|
| 3931 | - if (is_array($c)) { |
|
| 3932 | - foreach ($c as $k => $v) { |
|
| 3933 | - if (strpos($k, 'debut_') === 0) { |
|
| 3934 | - unset($c[$k]); |
|
| 3935 | - } |
|
| 3936 | - } |
|
| 3937 | - } |
|
| 3938 | - |
|
| 3939 | - if (!function_exists('calculer_cle_action')) { |
|
| 3940 | - include_spip('inc/securiser_action'); |
|
| 3941 | - } |
|
| 3942 | - |
|
| 3943 | - $c = serialize($c); |
|
| 3944 | - $cle = calculer_cle_action($form . $c); |
|
| 3945 | - $c = "$cle:$c"; |
|
| 3946 | - |
|
| 3947 | - // on ne stocke pas les contextes dans des fichiers en cache |
|
| 3948 | - // par defaut, sauf si cette configuration a été forcée |
|
| 3949 | - // OU que la longueur de l’argument géneré est plus long |
|
| 3950 | - // que ce qui est toléré. |
|
| 3951 | - $cache_contextes_ajax = (defined('_CACHE_CONTEXTES_AJAX') and _CACHE_CONTEXTES_AJAX); |
|
| 3952 | - if (!$cache_contextes_ajax) { |
|
| 3953 | - $env = $c; |
|
| 3954 | - if (function_exists('gzdeflate') && function_exists('gzinflate')) { |
|
| 3955 | - $env = gzdeflate($env); |
|
| 3956 | - } |
|
| 3957 | - $env = _xor($env); |
|
| 3958 | - $env = base64_encode($env); |
|
| 3959 | - $len = strlen($env); |
|
| 3960 | - // Si l’url est trop longue pour le navigateur |
|
| 3961 | - $max_len = _CACHE_CONTEXTES_AJAX_SUR_LONGUEUR; |
|
| 3962 | - if ($len > $max_len) { |
|
| 3963 | - $cache_contextes_ajax = true; |
|
| 3964 | - spip_log( |
|
| 3965 | - 'Contextes AJAX forces en fichiers !' |
|
| 3966 | - . ' Cela arrive lorsque la valeur du contexte' |
|
| 3967 | - . " depasse la longueur maximale autorisee ($max_len). Ici : $len.", |
|
| 3968 | - _LOG_AVERTISSEMENT |
|
| 3969 | - ); |
|
| 3970 | - } |
|
| 3971 | - // Sinon si Suhosin est actif et a une la valeur maximale des variables en GET... |
|
| 3972 | - elseif ( |
|
| 3973 | - $max_len = @ini_get('suhosin.get.max_value_length') |
|
| 3974 | - and $max_len < $len |
|
| 3975 | - ) { |
|
| 3976 | - $cache_contextes_ajax = true; |
|
| 3977 | - spip_log('Contextes AJAX forces en fichiers !' |
|
| 3978 | - . ' Cela arrive lorsque la valeur du contexte' |
|
| 3979 | - . ' depasse la longueur maximale autorisee par Suhosin' |
|
| 3980 | - . " ($max_len) dans 'suhosin.get.max_value_length'. Ici : $len." |
|
| 3981 | - . ' Vous devriez modifier les parametres de Suhosin' |
|
| 3982 | - . ' pour accepter au moins 1024 caracteres.', _LOG_AVERTISSEMENT); |
|
| 3983 | - } |
|
| 3984 | - } |
|
| 3985 | - |
|
| 3986 | - if ($cache_contextes_ajax) { |
|
| 3987 | - $dir = sous_repertoire(_DIR_CACHE, 'contextes'); |
|
| 3988 | - // stocker les contextes sur disque et ne passer qu'un hash dans l'url |
|
| 3989 | - $md5 = md5($c); |
|
| 3990 | - ecrire_fichier("$dir/c$md5", $c); |
|
| 3991 | - $env = $md5; |
|
| 3992 | - } |
|
| 3993 | - |
|
| 3994 | - if ($emboite === null) { |
|
| 3995 | - return $env; |
|
| 3996 | - } |
|
| 3997 | - if (!trim($emboite)) { |
|
| 3998 | - return ''; |
|
| 3999 | - } |
|
| 4000 | - // toujours encoder l'url source dans le bloc ajax |
|
| 4001 | - $r = self(); |
|
| 4002 | - $r = ' data-origin="' . $r . '"'; |
|
| 4003 | - $class = 'ajaxbloc'; |
|
| 4004 | - if ($ajaxid and is_string($ajaxid)) { |
|
| 4005 | - // ajaxid est normalement conforme a un nom de classe css |
|
| 4006 | - // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
|
| 4007 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4008 | - } |
|
| 4009 | - |
|
| 4010 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3919 | + $env = null; |
|
| 3920 | + if ( |
|
| 3921 | + is_string($c) |
|
| 3922 | + and @unserialize($c) !== false |
|
| 3923 | + ) { |
|
| 3924 | + $c = unserialize($c); |
|
| 3925 | + } |
|
| 3926 | + |
|
| 3927 | + // supprimer les parametres debut_x |
|
| 3928 | + // pour que la pagination ajax ne soit pas plantee |
|
| 3929 | + // si on charge la page &debut_x=1 : car alors en cliquant sur l'item 0, |
|
| 3930 | + // le debut_x=0 n'existe pas, et on resterait sur 1 |
|
| 3931 | + if (is_array($c)) { |
|
| 3932 | + foreach ($c as $k => $v) { |
|
| 3933 | + if (strpos($k, 'debut_') === 0) { |
|
| 3934 | + unset($c[$k]); |
|
| 3935 | + } |
|
| 3936 | + } |
|
| 3937 | + } |
|
| 3938 | + |
|
| 3939 | + if (!function_exists('calculer_cle_action')) { |
|
| 3940 | + include_spip('inc/securiser_action'); |
|
| 3941 | + } |
|
| 3942 | + |
|
| 3943 | + $c = serialize($c); |
|
| 3944 | + $cle = calculer_cle_action($form . $c); |
|
| 3945 | + $c = "$cle:$c"; |
|
| 3946 | + |
|
| 3947 | + // on ne stocke pas les contextes dans des fichiers en cache |
|
| 3948 | + // par defaut, sauf si cette configuration a été forcée |
|
| 3949 | + // OU que la longueur de l’argument géneré est plus long |
|
| 3950 | + // que ce qui est toléré. |
|
| 3951 | + $cache_contextes_ajax = (defined('_CACHE_CONTEXTES_AJAX') and _CACHE_CONTEXTES_AJAX); |
|
| 3952 | + if (!$cache_contextes_ajax) { |
|
| 3953 | + $env = $c; |
|
| 3954 | + if (function_exists('gzdeflate') && function_exists('gzinflate')) { |
|
| 3955 | + $env = gzdeflate($env); |
|
| 3956 | + } |
|
| 3957 | + $env = _xor($env); |
|
| 3958 | + $env = base64_encode($env); |
|
| 3959 | + $len = strlen($env); |
|
| 3960 | + // Si l’url est trop longue pour le navigateur |
|
| 3961 | + $max_len = _CACHE_CONTEXTES_AJAX_SUR_LONGUEUR; |
|
| 3962 | + if ($len > $max_len) { |
|
| 3963 | + $cache_contextes_ajax = true; |
|
| 3964 | + spip_log( |
|
| 3965 | + 'Contextes AJAX forces en fichiers !' |
|
| 3966 | + . ' Cela arrive lorsque la valeur du contexte' |
|
| 3967 | + . " depasse la longueur maximale autorisee ($max_len). Ici : $len.", |
|
| 3968 | + _LOG_AVERTISSEMENT |
|
| 3969 | + ); |
|
| 3970 | + } |
|
| 3971 | + // Sinon si Suhosin est actif et a une la valeur maximale des variables en GET... |
|
| 3972 | + elseif ( |
|
| 3973 | + $max_len = @ini_get('suhosin.get.max_value_length') |
|
| 3974 | + and $max_len < $len |
|
| 3975 | + ) { |
|
| 3976 | + $cache_contextes_ajax = true; |
|
| 3977 | + spip_log('Contextes AJAX forces en fichiers !' |
|
| 3978 | + . ' Cela arrive lorsque la valeur du contexte' |
|
| 3979 | + . ' depasse la longueur maximale autorisee par Suhosin' |
|
| 3980 | + . " ($max_len) dans 'suhosin.get.max_value_length'. Ici : $len." |
|
| 3981 | + . ' Vous devriez modifier les parametres de Suhosin' |
|
| 3982 | + . ' pour accepter au moins 1024 caracteres.', _LOG_AVERTISSEMENT); |
|
| 3983 | + } |
|
| 3984 | + } |
|
| 3985 | + |
|
| 3986 | + if ($cache_contextes_ajax) { |
|
| 3987 | + $dir = sous_repertoire(_DIR_CACHE, 'contextes'); |
|
| 3988 | + // stocker les contextes sur disque et ne passer qu'un hash dans l'url |
|
| 3989 | + $md5 = md5($c); |
|
| 3990 | + ecrire_fichier("$dir/c$md5", $c); |
|
| 3991 | + $env = $md5; |
|
| 3992 | + } |
|
| 3993 | + |
|
| 3994 | + if ($emboite === null) { |
|
| 3995 | + return $env; |
|
| 3996 | + } |
|
| 3997 | + if (!trim($emboite)) { |
|
| 3998 | + return ''; |
|
| 3999 | + } |
|
| 4000 | + // toujours encoder l'url source dans le bloc ajax |
|
| 4001 | + $r = self(); |
|
| 4002 | + $r = ' data-origin="' . $r . '"'; |
|
| 4003 | + $class = 'ajaxbloc'; |
|
| 4004 | + if ($ajaxid and is_string($ajaxid)) { |
|
| 4005 | + // ajaxid est normalement conforme a un nom de classe css |
|
| 4006 | + // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
|
| 4007 | + $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4008 | + } |
|
| 4009 | + |
|
| 4010 | + return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4011 | 4011 | } |
| 4012 | 4012 | |
| 4013 | 4013 | /** |
@@ -4027,37 +4027,37 @@ discard block |
||
| 4027 | 4027 | * - false : erreur de décodage |
| 4028 | 4028 | */ |
| 4029 | 4029 | function decoder_contexte_ajax($c, $form = '') { |
| 4030 | - if (!function_exists('calculer_cle_action')) { |
|
| 4031 | - include_spip('inc/securiser_action'); |
|
| 4032 | - } |
|
| 4033 | - if ( |
|
| 4034 | - ((defined('_CACHE_CONTEXTES_AJAX') and _CACHE_CONTEXTES_AJAX) or strlen($c) == 32) |
|
| 4035 | - and $dir = sous_repertoire(_DIR_CACHE, 'contextes') |
|
| 4036 | - and lire_fichier("$dir/c$c", $contexte) |
|
| 4037 | - ) { |
|
| 4038 | - $c = $contexte; |
|
| 4039 | - } else { |
|
| 4040 | - $c = @base64_decode($c); |
|
| 4041 | - $c = _xor($c); |
|
| 4042 | - if (function_exists('gzdeflate') && function_exists('gzinflate')) { |
|
| 4043 | - $c = @gzinflate($c); |
|
| 4044 | - } |
|
| 4045 | - } |
|
| 4046 | - |
|
| 4047 | - // extraire la signature en debut de contexte |
|
| 4048 | - // et la verifier avant de deserializer |
|
| 4049 | - // format : signature:donneesserializees |
|
| 4050 | - if ($p = strpos($c, ':')) { |
|
| 4051 | - $cle = substr($c, 0, $p); |
|
| 4052 | - $c = substr($c, $p + 1); |
|
| 4053 | - |
|
| 4054 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4055 | - $env = @unserialize($c); |
|
| 4056 | - return $env; |
|
| 4057 | - } |
|
| 4058 | - } |
|
| 4059 | - |
|
| 4060 | - return false; |
|
| 4030 | + if (!function_exists('calculer_cle_action')) { |
|
| 4031 | + include_spip('inc/securiser_action'); |
|
| 4032 | + } |
|
| 4033 | + if ( |
|
| 4034 | + ((defined('_CACHE_CONTEXTES_AJAX') and _CACHE_CONTEXTES_AJAX) or strlen($c) == 32) |
|
| 4035 | + and $dir = sous_repertoire(_DIR_CACHE, 'contextes') |
|
| 4036 | + and lire_fichier("$dir/c$c", $contexte) |
|
| 4037 | + ) { |
|
| 4038 | + $c = $contexte; |
|
| 4039 | + } else { |
|
| 4040 | + $c = @base64_decode($c); |
|
| 4041 | + $c = _xor($c); |
|
| 4042 | + if (function_exists('gzdeflate') && function_exists('gzinflate')) { |
|
| 4043 | + $c = @gzinflate($c); |
|
| 4044 | + } |
|
| 4045 | + } |
|
| 4046 | + |
|
| 4047 | + // extraire la signature en debut de contexte |
|
| 4048 | + // et la verifier avant de deserializer |
|
| 4049 | + // format : signature:donneesserializees |
|
| 4050 | + if ($p = strpos($c, ':')) { |
|
| 4051 | + $cle = substr($c, 0, $p); |
|
| 4052 | + $c = substr($c, $p + 1); |
|
| 4053 | + |
|
| 4054 | + if ($cle == calculer_cle_action($form . $c)) { |
|
| 4055 | + $env = @unserialize($c); |
|
| 4056 | + return $env; |
|
| 4057 | + } |
|
| 4058 | + } |
|
| 4059 | + |
|
| 4060 | + return false; |
|
| 4061 | 4061 | } |
| 4062 | 4062 | |
| 4063 | 4063 | |
@@ -4075,20 +4075,20 @@ discard block |
||
| 4075 | 4075 | * Message décrypté ou encrypté |
| 4076 | 4076 | **/ |
| 4077 | 4077 | function _xor($message, $key = null) { |
| 4078 | - if (is_null($key)) { |
|
| 4079 | - if (!function_exists('calculer_cle_action')) { |
|
| 4080 | - include_spip('inc/securiser_action'); |
|
| 4081 | - } |
|
| 4082 | - $key = pack('H*', calculer_cle_action('_xor')); |
|
| 4083 | - } |
|
| 4078 | + if (is_null($key)) { |
|
| 4079 | + if (!function_exists('calculer_cle_action')) { |
|
| 4080 | + include_spip('inc/securiser_action'); |
|
| 4081 | + } |
|
| 4082 | + $key = pack('H*', calculer_cle_action('_xor')); |
|
| 4083 | + } |
|
| 4084 | 4084 | |
| 4085 | - $keylen = strlen($key); |
|
| 4086 | - $messagelen = strlen($message); |
|
| 4087 | - for ($i = 0; $i < $messagelen; $i++) { |
|
| 4088 | - $message[$i] = ~($message[$i] ^ $key[$i % $keylen]); |
|
| 4089 | - } |
|
| 4085 | + $keylen = strlen($key); |
|
| 4086 | + $messagelen = strlen($message); |
|
| 4087 | + for ($i = 0; $i < $messagelen; $i++) { |
|
| 4088 | + $message[$i] = ~($message[$i] ^ $key[$i % $keylen]); |
|
| 4089 | + } |
|
| 4090 | 4090 | |
| 4091 | - return $message; |
|
| 4091 | + return $message; |
|
| 4092 | 4092 | } |
| 4093 | 4093 | |
| 4094 | 4094 | /** |
@@ -4102,7 +4102,7 @@ discard block |
||
| 4102 | 4102 | * @return string |
| 4103 | 4103 | */ |
| 4104 | 4104 | function url_reponse_forum($texte) { |
| 4105 | - return $texte; |
|
| 4105 | + return $texte; |
|
| 4106 | 4106 | } |
| 4107 | 4107 | |
| 4108 | 4108 | /** |
@@ -4116,7 +4116,7 @@ discard block |
||
| 4116 | 4116 | * @return string |
| 4117 | 4117 | */ |
| 4118 | 4118 | function url_rss_forum($texte) { |
| 4119 | - return $texte; |
|
| 4119 | + return $texte; |
|
| 4120 | 4120 | } |
| 4121 | 4121 | |
| 4122 | 4122 | |
@@ -4155,37 +4155,37 @@ discard block |
||
| 4155 | 4155 | * Code HTML |
| 4156 | 4156 | */ |
| 4157 | 4157 | function lien_ou_expose($url, $libelle = null, $on = false, $class = '', $title = '', $rel = '', $evt = '') { |
| 4158 | - if ($on) { |
|
| 4159 | - $bal = 'strong'; |
|
| 4160 | - $class = ''; |
|
| 4161 | - $att = ''; |
|
| 4162 | - // si $on passe la balise et optionnelement une ou ++classe |
|
| 4163 | - // a.active span.selected.active etc.... |
|
| 4164 | - if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) { |
|
| 4165 | - $on = explode('.', $on); |
|
| 4166 | - // on verifie que c'est exactement une des 3 balises a, span ou strong |
|
| 4167 | - if (in_array(reset($on), ['a', 'span', 'strong'])) { |
|
| 4168 | - $bal = array_shift($on); |
|
| 4169 | - $class = implode(' ', $on); |
|
| 4170 | - if ($bal == 'a') { |
|
| 4171 | - $att = 'href="#" '; |
|
| 4172 | - } |
|
| 4173 | - } |
|
| 4174 | - } |
|
| 4175 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4176 | - } else { |
|
| 4177 | - $bal = 'a'; |
|
| 4178 | - $att = "href='$url'" |
|
| 4179 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4180 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4181 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4182 | - . $evt; |
|
| 4183 | - } |
|
| 4184 | - if ($libelle === null) { |
|
| 4185 | - $libelle = $url; |
|
| 4186 | - } |
|
| 4187 | - |
|
| 4188 | - return "<$bal $att>$libelle</$bal>"; |
|
| 4158 | + if ($on) { |
|
| 4159 | + $bal = 'strong'; |
|
| 4160 | + $class = ''; |
|
| 4161 | + $att = ''; |
|
| 4162 | + // si $on passe la balise et optionnelement une ou ++classe |
|
| 4163 | + // a.active span.selected.active etc.... |
|
| 4164 | + if (is_string($on) and (strncmp($on, 'a', 1) == 0 or strncmp($on, 'span', 4) == 0 or strncmp($on, 'strong', 6) == 0)) { |
|
| 4165 | + $on = explode('.', $on); |
|
| 4166 | + // on verifie que c'est exactement une des 3 balises a, span ou strong |
|
| 4167 | + if (in_array(reset($on), ['a', 'span', 'strong'])) { |
|
| 4168 | + $bal = array_shift($on); |
|
| 4169 | + $class = implode(' ', $on); |
|
| 4170 | + if ($bal == 'a') { |
|
| 4171 | + $att = 'href="#" '; |
|
| 4172 | + } |
|
| 4173 | + } |
|
| 4174 | + } |
|
| 4175 | + $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4176 | + } else { |
|
| 4177 | + $bal = 'a'; |
|
| 4178 | + $att = "href='$url'" |
|
| 4179 | + . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4180 | + . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4181 | + . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4182 | + . $evt; |
|
| 4183 | + } |
|
| 4184 | + if ($libelle === null) { |
|
| 4185 | + $libelle = $url; |
|
| 4186 | + } |
|
| 4187 | + |
|
| 4188 | + return "<$bal $att>$libelle</$bal>"; |
|
| 4189 | 4189 | } |
| 4190 | 4190 | |
| 4191 | 4191 | |
@@ -4202,39 +4202,39 @@ discard block |
||
| 4202 | 4202 | * @return string : la chaine de langue finale en utilisant la fonction _T() |
| 4203 | 4203 | */ |
| 4204 | 4204 | function singulier_ou_pluriel($nb, $chaine_un, $chaine_plusieurs, $var = 'nb', $vars = []) { |
| 4205 | - static $local_singulier_ou_pluriel = []; |
|
| 4206 | - |
|
| 4207 | - // si nb=0 ou pas de $vars valide on retourne une chaine vide, a traiter par un |sinon |
|
| 4208 | - if (!is_numeric($nb) or $nb == 0) { |
|
| 4209 | - return ''; |
|
| 4210 | - } |
|
| 4211 | - if (!is_array($vars)) { |
|
| 4212 | - return ''; |
|
| 4213 | - } |
|
| 4214 | - |
|
| 4215 | - $langue = $GLOBALS['spip_lang']; |
|
| 4216 | - if (!isset($local_singulier_ou_pluriel[$langue])) { |
|
| 4217 | - $local_singulier_ou_pluriel[$langue] = false; |
|
| 4218 | - if ( |
|
| 4219 | - $f = charger_fonction("singulier_ou_pluriel_{$langue}", 'inc', true) |
|
| 4220 | - or $f = charger_fonction('singulier_ou_pluriel', 'inc', true) |
|
| 4221 | - ) { |
|
| 4222 | - $local_singulier_ou_pluriel[$langue] = $f; |
|
| 4223 | - } |
|
| 4224 | - } |
|
| 4225 | - |
|
| 4226 | - // si on a une surcharge on l'utilise |
|
| 4227 | - if ($local_singulier_ou_pluriel[$langue]) { |
|
| 4228 | - return ($local_singulier_ou_pluriel[$langue])($nb, $chaine_un, $chaine_plusieurs, $var, $vars); |
|
| 4229 | - } |
|
| 4230 | - |
|
| 4231 | - // sinon traitement par defaut |
|
| 4232 | - $vars[$var] = $nb; |
|
| 4233 | - if ($nb >= 2) { |
|
| 4234 | - return _T($chaine_plusieurs, $vars); |
|
| 4235 | - } else { |
|
| 4236 | - return _T($chaine_un, $vars); |
|
| 4237 | - } |
|
| 4205 | + static $local_singulier_ou_pluriel = []; |
|
| 4206 | + |
|
| 4207 | + // si nb=0 ou pas de $vars valide on retourne une chaine vide, a traiter par un |sinon |
|
| 4208 | + if (!is_numeric($nb) or $nb == 0) { |
|
| 4209 | + return ''; |
|
| 4210 | + } |
|
| 4211 | + if (!is_array($vars)) { |
|
| 4212 | + return ''; |
|
| 4213 | + } |
|
| 4214 | + |
|
| 4215 | + $langue = $GLOBALS['spip_lang']; |
|
| 4216 | + if (!isset($local_singulier_ou_pluriel[$langue])) { |
|
| 4217 | + $local_singulier_ou_pluriel[$langue] = false; |
|
| 4218 | + if ( |
|
| 4219 | + $f = charger_fonction("singulier_ou_pluriel_{$langue}", 'inc', true) |
|
| 4220 | + or $f = charger_fonction('singulier_ou_pluriel', 'inc', true) |
|
| 4221 | + ) { |
|
| 4222 | + $local_singulier_ou_pluriel[$langue] = $f; |
|
| 4223 | + } |
|
| 4224 | + } |
|
| 4225 | + |
|
| 4226 | + // si on a une surcharge on l'utilise |
|
| 4227 | + if ($local_singulier_ou_pluriel[$langue]) { |
|
| 4228 | + return ($local_singulier_ou_pluriel[$langue])($nb, $chaine_un, $chaine_plusieurs, $var, $vars); |
|
| 4229 | + } |
|
| 4230 | + |
|
| 4231 | + // sinon traitement par defaut |
|
| 4232 | + $vars[$var] = $nb; |
|
| 4233 | + if ($nb >= 2) { |
|
| 4234 | + return _T($chaine_plusieurs, $vars); |
|
| 4235 | + } else { |
|
| 4236 | + return _T($chaine_un, $vars); |
|
| 4237 | + } |
|
| 4238 | 4238 | } |
| 4239 | 4239 | |
| 4240 | 4240 | |
@@ -4262,73 +4262,73 @@ discard block |
||
| 4262 | 4262 | */ |
| 4263 | 4263 | function prepare_icone_base($type, $lien, $texte, $fond, $fonction = '', $class = '', $javascript = '') { |
| 4264 | 4264 | |
| 4265 | - $class_lien = $class_bouton = $class; |
|
| 4266 | - |
|
| 4267 | - // Normaliser la fonction et compléter la classe en fonction |
|
| 4268 | - if (in_array($fonction, ['del', 'supprimer.gif'])) { |
|
| 4269 | - $class_lien .= ' danger'; |
|
| 4270 | - $class_bouton .= ' btn_danger'; |
|
| 4271 | - } elseif ($fonction == 'rien.gif') { |
|
| 4272 | - $fonction = ''; |
|
| 4273 | - } elseif ($fonction == 'delsafe') { |
|
| 4274 | - $fonction = 'del'; |
|
| 4275 | - } |
|
| 4276 | - |
|
| 4277 | - $fond_origine = $fond; |
|
| 4278 | - // Remappage des icone : article-24.png+new => article-new-24.png |
|
| 4279 | - if ($icone_renommer = charger_fonction('icone_renommer', 'inc', true)) { |
|
| 4280 | - [$fond, $fonction] = $icone_renommer($fond, $fonction); |
|
| 4281 | - } |
|
| 4282 | - |
|
| 4283 | - // Ajouter le type d'objet dans la classe |
|
| 4284 | - $objet_type = substr(basename($fond), 0, -4); |
|
| 4285 | - $class_lien .= " $objet_type"; |
|
| 4286 | - $class_bouton .= " $objet_type"; |
|
| 4287 | - |
|
| 4288 | - // texte |
|
| 4289 | - $alt = attribut_html($texte); |
|
| 4290 | - $title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ? |
|
| 4291 | - |
|
| 4292 | - // Liens : préparer les classes ajax |
|
| 4293 | - $ajax = ''; |
|
| 4294 | - if ($type === 'lien') { |
|
| 4295 | - if (strpos($class_lien, 'ajax') !== false) { |
|
| 4296 | - $ajax = 'ajax'; |
|
| 4297 | - if (strpos($class_lien, 'preload') !== false) { |
|
| 4298 | - $ajax .= ' preload'; |
|
| 4299 | - } |
|
| 4300 | - if (strpos($class_lien, 'nocache') !== false) { |
|
| 4301 | - $ajax .= ' nocache'; |
|
| 4302 | - } |
|
| 4303 | - $ajax = " class='$ajax'"; |
|
| 4304 | - } |
|
| 4305 | - } |
|
| 4306 | - |
|
| 4307 | - // Repérer la taille et l'ajouter dans la classe |
|
| 4308 | - $size = 24; |
|
| 4309 | - if ( |
|
| 4310 | - preg_match('/-([0-9]{1,3})[.](gif|png|svg)$/i', $fond, $match) |
|
| 4311 | - or preg_match('/-([0-9]{1,3})([.](gif|png|svg))?$/i', $fond_origine, $match) |
|
| 4312 | - ) { |
|
| 4313 | - $size = $match[1]; |
|
| 4314 | - } |
|
| 4315 | - $class_lien .= " s$size"; |
|
| 4316 | - $class_bouton .= " s$size"; |
|
| 4317 | - |
|
| 4318 | - // Icône |
|
| 4319 | - $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
|
| 4320 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4321 | - |
|
| 4322 | - // Markup final |
|
| 4323 | - if ($type == 'lien') { |
|
| 4324 | - return "<span class='icone $class_lien'>" |
|
| 4325 | - . "<a href='$lien'$title$ajax$javascript>" |
|
| 4326 | - . $icone |
|
| 4327 | - . "<b>$texte</b>" |
|
| 4328 | - . "</a></span>\n"; |
|
| 4329 | - } else { |
|
| 4330 | - return bouton_action("$icone $texte", $lien, $class_bouton, $javascript, $alt); |
|
| 4331 | - } |
|
| 4265 | + $class_lien = $class_bouton = $class; |
|
| 4266 | + |
|
| 4267 | + // Normaliser la fonction et compléter la classe en fonction |
|
| 4268 | + if (in_array($fonction, ['del', 'supprimer.gif'])) { |
|
| 4269 | + $class_lien .= ' danger'; |
|
| 4270 | + $class_bouton .= ' btn_danger'; |
|
| 4271 | + } elseif ($fonction == 'rien.gif') { |
|
| 4272 | + $fonction = ''; |
|
| 4273 | + } elseif ($fonction == 'delsafe') { |
|
| 4274 | + $fonction = 'del'; |
|
| 4275 | + } |
|
| 4276 | + |
|
| 4277 | + $fond_origine = $fond; |
|
| 4278 | + // Remappage des icone : article-24.png+new => article-new-24.png |
|
| 4279 | + if ($icone_renommer = charger_fonction('icone_renommer', 'inc', true)) { |
|
| 4280 | + [$fond, $fonction] = $icone_renommer($fond, $fonction); |
|
| 4281 | + } |
|
| 4282 | + |
|
| 4283 | + // Ajouter le type d'objet dans la classe |
|
| 4284 | + $objet_type = substr(basename($fond), 0, -4); |
|
| 4285 | + $class_lien .= " $objet_type"; |
|
| 4286 | + $class_bouton .= " $objet_type"; |
|
| 4287 | + |
|
| 4288 | + // texte |
|
| 4289 | + $alt = attribut_html($texte); |
|
| 4290 | + $title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ? |
|
| 4291 | + |
|
| 4292 | + // Liens : préparer les classes ajax |
|
| 4293 | + $ajax = ''; |
|
| 4294 | + if ($type === 'lien') { |
|
| 4295 | + if (strpos($class_lien, 'ajax') !== false) { |
|
| 4296 | + $ajax = 'ajax'; |
|
| 4297 | + if (strpos($class_lien, 'preload') !== false) { |
|
| 4298 | + $ajax .= ' preload'; |
|
| 4299 | + } |
|
| 4300 | + if (strpos($class_lien, 'nocache') !== false) { |
|
| 4301 | + $ajax .= ' nocache'; |
|
| 4302 | + } |
|
| 4303 | + $ajax = " class='$ajax'"; |
|
| 4304 | + } |
|
| 4305 | + } |
|
| 4306 | + |
|
| 4307 | + // Repérer la taille et l'ajouter dans la classe |
|
| 4308 | + $size = 24; |
|
| 4309 | + if ( |
|
| 4310 | + preg_match('/-([0-9]{1,3})[.](gif|png|svg)$/i', $fond, $match) |
|
| 4311 | + or preg_match('/-([0-9]{1,3})([.](gif|png|svg))?$/i', $fond_origine, $match) |
|
| 4312 | + ) { |
|
| 4313 | + $size = $match[1]; |
|
| 4314 | + } |
|
| 4315 | + $class_lien .= " s$size"; |
|
| 4316 | + $class_bouton .= " s$size"; |
|
| 4317 | + |
|
| 4318 | + // Icône |
|
| 4319 | + $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
|
| 4320 | + $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4321 | + |
|
| 4322 | + // Markup final |
|
| 4323 | + if ($type == 'lien') { |
|
| 4324 | + return "<span class='icone $class_lien'>" |
|
| 4325 | + . "<a href='$lien'$title$ajax$javascript>" |
|
| 4326 | + . $icone |
|
| 4327 | + . "<b>$texte</b>" |
|
| 4328 | + . "</a></span>\n"; |
|
| 4329 | + } else { |
|
| 4330 | + return bouton_action("$icone $texte", $lien, $class_bouton, $javascript, $alt); |
|
| 4331 | + } |
|
| 4332 | 4332 | } |
| 4333 | 4333 | |
| 4334 | 4334 | /** |
@@ -4352,7 +4352,7 @@ discard block |
||
| 4352 | 4352 | * Code HTML du lien |
| 4353 | 4353 | **/ |
| 4354 | 4354 | function icone_base($lien, $texte, $fond, $fonction = '', $class = '', $javascript = '') { |
| 4355 | - return prepare_icone_base('lien', $lien, $texte, $fond, $fonction, $class, $javascript); |
|
| 4355 | + return prepare_icone_base('lien', $lien, $texte, $fond, $fonction, $class, $javascript); |
|
| 4356 | 4356 | } |
| 4357 | 4357 | |
| 4358 | 4358 | /** |
@@ -4387,7 +4387,7 @@ discard block |
||
| 4387 | 4387 | * Code HTML du lien |
| 4388 | 4388 | **/ |
| 4389 | 4389 | function filtre_icone_verticale_dist($lien, $texte, $fond, $fonction = '', $class = '', $javascript = '') { |
| 4390 | - return icone_base($lien, $texte, $fond, $fonction, "verticale $class", $javascript); |
|
| 4390 | + return icone_base($lien, $texte, $fond, $fonction, "verticale $class", $javascript); |
|
| 4391 | 4391 | } |
| 4392 | 4392 | |
| 4393 | 4393 | /** |
@@ -4432,7 +4432,7 @@ discard block |
||
| 4432 | 4432 | * Code HTML du lien |
| 4433 | 4433 | **/ |
| 4434 | 4434 | function filtre_icone_horizontale_dist($lien, $texte, $fond, $fonction = '', $class = '', $javascript = '') { |
| 4435 | - return icone_base($lien, $texte, $fond, $fonction, "horizontale $class", $javascript); |
|
| 4435 | + return icone_base($lien, $texte, $fond, $fonction, "horizontale $class", $javascript); |
|
| 4436 | 4436 | } |
| 4437 | 4437 | |
| 4438 | 4438 | /** |
@@ -4463,7 +4463,7 @@ discard block |
||
| 4463 | 4463 | * Code HTML du lien |
| 4464 | 4464 | **/ |
| 4465 | 4465 | function filtre_bouton_action_horizontal_dist($lien, $texte, $fond, $fonction = '', $class = '', $confirm = '') { |
| 4466 | - return prepare_icone_base('bouton', $lien, $texte, $fond, $fonction, $class, $confirm); |
|
| 4466 | + return prepare_icone_base('bouton', $lien, $texte, $fond, $fonction, $class, $confirm); |
|
| 4467 | 4467 | } |
| 4468 | 4468 | |
| 4469 | 4469 | /** |
@@ -4494,7 +4494,7 @@ discard block |
||
| 4494 | 4494 | * Code HTML du lien |
| 4495 | 4495 | */ |
| 4496 | 4496 | function filtre_icone_dist($lien, $texte, $fond, $align = '', $fonction = '', $class = '', $javascript = '') { |
| 4497 | - return icone_base($lien, $texte, $fond, $fonction, "verticale $align $class", $javascript); |
|
| 4497 | + return icone_base($lien, $texte, $fond, $fonction, "verticale $align $class", $javascript); |
|
| 4498 | 4498 | } |
| 4499 | 4499 | |
| 4500 | 4500 | |
@@ -4516,7 +4516,7 @@ discard block |
||
| 4516 | 4516 | * @return array Liste des éléments |
| 4517 | 4517 | */ |
| 4518 | 4518 | function filtre_explode_dist($a, $b) { |
| 4519 | - return explode($b, (string) $a); |
|
| 4519 | + return explode($b, (string) $a); |
|
| 4520 | 4520 | } |
| 4521 | 4521 | |
| 4522 | 4522 | /** |
@@ -4537,7 +4537,7 @@ discard block |
||
| 4537 | 4537 | * @return string texte |
| 4538 | 4538 | */ |
| 4539 | 4539 | function filtre_implode_dist($a, $b) { |
| 4540 | - return is_array($a) ? implode($b, $a) : $a; |
|
| 4540 | + return is_array($a) ? implode($b, $a) : $a; |
|
| 4541 | 4541 | } |
| 4542 | 4542 | |
| 4543 | 4543 | /** |
@@ -4546,22 +4546,22 @@ discard block |
||
| 4546 | 4546 | * @return string Code CSS |
| 4547 | 4547 | */ |
| 4548 | 4548 | function bando_images_background() { |
| 4549 | - include_spip('inc/bandeau'); |
|
| 4550 | - // recuperer tous les boutons et leurs images |
|
| 4551 | - $boutons = definir_barre_boutons(definir_barre_contexte(), true, false); |
|
| 4549 | + include_spip('inc/bandeau'); |
|
| 4550 | + // recuperer tous les boutons et leurs images |
|
| 4551 | + $boutons = definir_barre_boutons(definir_barre_contexte(), true, false); |
|
| 4552 | 4552 | |
| 4553 | - $res = ''; |
|
| 4554 | - foreach ($boutons as $page => $detail) { |
|
| 4555 | - $selecteur = (in_array($page, ['outils_rapides', 'outils_collaboratifs']) ? '' : '.navigation_avec_icones '); |
|
| 4556 | - foreach ($detail->sousmenu as $souspage => $sousdetail) { |
|
| 4557 | - if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
|
| 4558 | - $img = http_img_variante_svg_si_possible($sousdetail->icone); |
|
| 4559 | - $res .= "\n$selecteur.bando2_$souspage {background-image:url($img);}"; |
|
| 4560 | - } |
|
| 4561 | - } |
|
| 4562 | - } |
|
| 4553 | + $res = ''; |
|
| 4554 | + foreach ($boutons as $page => $detail) { |
|
| 4555 | + $selecteur = (in_array($page, ['outils_rapides', 'outils_collaboratifs']) ? '' : '.navigation_avec_icones '); |
|
| 4556 | + foreach ($detail->sousmenu as $souspage => $sousdetail) { |
|
| 4557 | + if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
|
| 4558 | + $img = http_img_variante_svg_si_possible($sousdetail->icone); |
|
| 4559 | + $res .= "\n$selecteur.bando2_$souspage {background-image:url($img);}"; |
|
| 4560 | + } |
|
| 4561 | + } |
|
| 4562 | + } |
|
| 4563 | 4563 | |
| 4564 | - return $res; |
|
| 4564 | + return $res; |
|
| 4565 | 4565 | } |
| 4566 | 4566 | |
| 4567 | 4567 | /** |
@@ -4586,27 +4586,27 @@ discard block |
||
| 4586 | 4586 | */ |
| 4587 | 4587 | function bouton_action($libelle, $url, $class = '', $confirm = '', $title = '', $callback = '') { |
| 4588 | 4588 | |
| 4589 | - // Classes : dispatcher `ajax` sur le formulaire |
|
| 4590 | - $class_form = ''; |
|
| 4591 | - if (strpos($class, 'ajax') !== false) { |
|
| 4592 | - $class_form = 'ajax'; |
|
| 4593 | - $class = str_replace('ajax', '', $class); |
|
| 4594 | - } |
|
| 4595 | - $class_btn = 'submit ' . trim($class); |
|
| 4589 | + // Classes : dispatcher `ajax` sur le formulaire |
|
| 4590 | + $class_form = ''; |
|
| 4591 | + if (strpos($class, 'ajax') !== false) { |
|
| 4592 | + $class_form = 'ajax'; |
|
| 4593 | + $class = str_replace('ajax', '', $class); |
|
| 4594 | + } |
|
| 4595 | + $class_btn = 'submit ' . trim($class); |
|
| 4596 | 4596 | |
| 4597 | - if ($confirm) { |
|
| 4598 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4599 | - if ($callback) { |
|
| 4600 | - $callback = "$confirm?($callback):false"; |
|
| 4601 | - } else { |
|
| 4602 | - $callback = $confirm; |
|
| 4603 | - } |
|
| 4604 | - } |
|
| 4605 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4606 | - $title = $title ? " title='$title'" : ''; |
|
| 4597 | + if ($confirm) { |
|
| 4598 | + $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4599 | + if ($callback) { |
|
| 4600 | + $callback = "$confirm?($callback):false"; |
|
| 4601 | + } else { |
|
| 4602 | + $callback = $confirm; |
|
| 4603 | + } |
|
| 4604 | + } |
|
| 4605 | + $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4606 | + $title = $title ? " title='$title'" : ''; |
|
| 4607 | 4607 | |
| 4608 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4609 | - . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
|
| 4608 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4609 | + . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
|
| 4610 | 4610 | } |
| 4611 | 4611 | |
| 4612 | 4612 | /** |
@@ -4629,101 +4629,101 @@ discard block |
||
| 4629 | 4629 | * @return string |
| 4630 | 4630 | */ |
| 4631 | 4631 | function generer_objet_info($id_objet, string $type_objet, string $info, string $etoile = '', array $params = []): string { |
| 4632 | - static $trouver_table = null; |
|
| 4633 | - static $objets; |
|
| 4634 | - |
|
| 4635 | - // On verifie qu'on a tout ce qu'il faut |
|
| 4636 | - $id_objet = intval($id_objet); |
|
| 4637 | - if (!($id_objet and $type_objet and $info)) { |
|
| 4638 | - return ''; |
|
| 4639 | - } |
|
| 4640 | - |
|
| 4641 | - // si on a deja note que l'objet n'existe pas, ne pas aller plus loin |
|
| 4642 | - if (isset($objets[$type_objet]) and $objets[$type_objet] === false) { |
|
| 4643 | - return ''; |
|
| 4644 | - } |
|
| 4645 | - |
|
| 4646 | - // Si on demande l'url, on retourne direct la fonction |
|
| 4647 | - if ($info == 'url') { |
|
| 4648 | - return generer_objet_url($id_objet, $type_objet, ...$params); |
|
| 4649 | - } |
|
| 4650 | - |
|
| 4651 | - // Sinon on va tout chercher dans la table et on garde en memoire |
|
| 4652 | - $demande_titre = ($info === 'titre'); |
|
| 4653 | - $demande_introduction = ($info === 'introduction'); |
|
| 4654 | - |
|
| 4655 | - // On ne fait la requete que si on a pas deja l'objet ou si on demande le titre mais qu'on ne l'a pas encore |
|
| 4656 | - if ( |
|
| 4657 | - !isset($objets[$type_objet][$id_objet]) |
|
| 4658 | - or |
|
| 4659 | - ($demande_titre and !isset($objets[$type_objet][$id_objet]['titre'])) |
|
| 4660 | - ) { |
|
| 4661 | - if (!$trouver_table) { |
|
| 4662 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 4663 | - } |
|
| 4664 | - $desc = $trouver_table(table_objet_sql($type_objet)); |
|
| 4665 | - if (!$desc) { |
|
| 4666 | - return $objets[$type_objet] = false; |
|
| 4667 | - } |
|
| 4668 | - |
|
| 4669 | - // Si on demande le titre, on le gere en interne |
|
| 4670 | - $champ_titre = ''; |
|
| 4671 | - if ($demande_titre) { |
|
| 4672 | - // si pas de titre declare mais champ titre, il sera peuple par le select * |
|
| 4673 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4674 | - } |
|
| 4675 | - include_spip('base/abstract_sql'); |
|
| 4676 | - include_spip('base/connect_sql'); |
|
| 4677 | - $objets[$type_objet][$id_objet] = sql_fetsel( |
|
| 4678 | - '*' . $champ_titre, |
|
| 4679 | - $desc['table_sql'], |
|
| 4680 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4681 | - ); |
|
| 4682 | - |
|
| 4683 | - // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
|
| 4684 | - $objets[$type_objet]['introduction_longueur'] = $desc['introduction_longueur'] ?? null; |
|
| 4685 | - } |
|
| 4686 | - |
|
| 4687 | - // Pour les fonction generer_xxx, si on demande l'introduction, |
|
| 4688 | - // ajouter la longueur au début des params supplémentaires |
|
| 4689 | - if ($demande_introduction) { |
|
| 4690 | - $introduction_longueur = $objets[$type_objet]['introduction_longueur']; |
|
| 4691 | - array_unshift($params, $introduction_longueur); |
|
| 4692 | - } |
|
| 4693 | - |
|
| 4694 | - // Si la fonction generer_TYPE_TRUC existe, on l'utilise pour formater $info_generee |
|
| 4695 | - if ( |
|
| 4696 | - $generer = charger_fonction("generer_{$type_objet}_{$info}", '', true) |
|
| 4697 | - // @deprecated 4.1 generer_TRUC_TYPE |
|
| 4698 | - or $generer = charger_fonction("generer_{$info}_{$type_objet}", '', true) |
|
| 4699 | - ) { |
|
| 4700 | - $info_generee = $generer($id_objet, $objets[$type_objet][$id_objet], ...$params); |
|
| 4701 | - } |
|
| 4702 | - // Si la fonction generer_objet_TRUC existe, on l'utilise pour formater $info_generee |
|
| 4703 | - elseif ( |
|
| 4704 | - $generer = charger_fonction("generer_objet_{$info}", '', true) |
|
| 4705 | - // @deprecated 4.1 generer_TRUC_entite |
|
| 4706 | - or $generer = charger_fonction("generer_{$info}_entite", '', true) |
|
| 4707 | - ) { |
|
| 4708 | - $info_generee = $generer($id_objet, $type_objet, $objets[$type_objet][$id_objet], ...$params); |
|
| 4709 | - } // Sinon on prend directement le champ SQL tel quel |
|
| 4710 | - else { |
|
| 4711 | - $info_generee = ($objets[$type_objet][$id_objet][$info] ?? ''); |
|
| 4712 | - } |
|
| 4713 | - |
|
| 4714 | - // On va ensuite appliquer les traitements automatiques si besoin |
|
| 4715 | - if (!$etoile) { |
|
| 4716 | - // FIXME: on fournit un ENV minimum avec id et type et connect='' |
|
| 4717 | - // mais ce fonctionnement est a ameliorer ! |
|
| 4718 | - $info_generee = appliquer_traitement_champ( |
|
| 4719 | - $info_generee, |
|
| 4720 | - $info, |
|
| 4721 | - table_objet($type_objet), |
|
| 4722 | - ['id_objet' => $id_objet, 'objet' => $type_objet, ''] |
|
| 4723 | - ); |
|
| 4724 | - } |
|
| 4725 | - |
|
| 4726 | - return $info_generee; |
|
| 4632 | + static $trouver_table = null; |
|
| 4633 | + static $objets; |
|
| 4634 | + |
|
| 4635 | + // On verifie qu'on a tout ce qu'il faut |
|
| 4636 | + $id_objet = intval($id_objet); |
|
| 4637 | + if (!($id_objet and $type_objet and $info)) { |
|
| 4638 | + return ''; |
|
| 4639 | + } |
|
| 4640 | + |
|
| 4641 | + // si on a deja note que l'objet n'existe pas, ne pas aller plus loin |
|
| 4642 | + if (isset($objets[$type_objet]) and $objets[$type_objet] === false) { |
|
| 4643 | + return ''; |
|
| 4644 | + } |
|
| 4645 | + |
|
| 4646 | + // Si on demande l'url, on retourne direct la fonction |
|
| 4647 | + if ($info == 'url') { |
|
| 4648 | + return generer_objet_url($id_objet, $type_objet, ...$params); |
|
| 4649 | + } |
|
| 4650 | + |
|
| 4651 | + // Sinon on va tout chercher dans la table et on garde en memoire |
|
| 4652 | + $demande_titre = ($info === 'titre'); |
|
| 4653 | + $demande_introduction = ($info === 'introduction'); |
|
| 4654 | + |
|
| 4655 | + // On ne fait la requete que si on a pas deja l'objet ou si on demande le titre mais qu'on ne l'a pas encore |
|
| 4656 | + if ( |
|
| 4657 | + !isset($objets[$type_objet][$id_objet]) |
|
| 4658 | + or |
|
| 4659 | + ($demande_titre and !isset($objets[$type_objet][$id_objet]['titre'])) |
|
| 4660 | + ) { |
|
| 4661 | + if (!$trouver_table) { |
|
| 4662 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 4663 | + } |
|
| 4664 | + $desc = $trouver_table(table_objet_sql($type_objet)); |
|
| 4665 | + if (!$desc) { |
|
| 4666 | + return $objets[$type_objet] = false; |
|
| 4667 | + } |
|
| 4668 | + |
|
| 4669 | + // Si on demande le titre, on le gere en interne |
|
| 4670 | + $champ_titre = ''; |
|
| 4671 | + if ($demande_titre) { |
|
| 4672 | + // si pas de titre declare mais champ titre, il sera peuple par le select * |
|
| 4673 | + $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4674 | + } |
|
| 4675 | + include_spip('base/abstract_sql'); |
|
| 4676 | + include_spip('base/connect_sql'); |
|
| 4677 | + $objets[$type_objet][$id_objet] = sql_fetsel( |
|
| 4678 | + '*' . $champ_titre, |
|
| 4679 | + $desc['table_sql'], |
|
| 4680 | + id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4681 | + ); |
|
| 4682 | + |
|
| 4683 | + // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
|
| 4684 | + $objets[$type_objet]['introduction_longueur'] = $desc['introduction_longueur'] ?? null; |
|
| 4685 | + } |
|
| 4686 | + |
|
| 4687 | + // Pour les fonction generer_xxx, si on demande l'introduction, |
|
| 4688 | + // ajouter la longueur au début des params supplémentaires |
|
| 4689 | + if ($demande_introduction) { |
|
| 4690 | + $introduction_longueur = $objets[$type_objet]['introduction_longueur']; |
|
| 4691 | + array_unshift($params, $introduction_longueur); |
|
| 4692 | + } |
|
| 4693 | + |
|
| 4694 | + // Si la fonction generer_TYPE_TRUC existe, on l'utilise pour formater $info_generee |
|
| 4695 | + if ( |
|
| 4696 | + $generer = charger_fonction("generer_{$type_objet}_{$info}", '', true) |
|
| 4697 | + // @deprecated 4.1 generer_TRUC_TYPE |
|
| 4698 | + or $generer = charger_fonction("generer_{$info}_{$type_objet}", '', true) |
|
| 4699 | + ) { |
|
| 4700 | + $info_generee = $generer($id_objet, $objets[$type_objet][$id_objet], ...$params); |
|
| 4701 | + } |
|
| 4702 | + // Si la fonction generer_objet_TRUC existe, on l'utilise pour formater $info_generee |
|
| 4703 | + elseif ( |
|
| 4704 | + $generer = charger_fonction("generer_objet_{$info}", '', true) |
|
| 4705 | + // @deprecated 4.1 generer_TRUC_entite |
|
| 4706 | + or $generer = charger_fonction("generer_{$info}_entite", '', true) |
|
| 4707 | + ) { |
|
| 4708 | + $info_generee = $generer($id_objet, $type_objet, $objets[$type_objet][$id_objet], ...$params); |
|
| 4709 | + } // Sinon on prend directement le champ SQL tel quel |
|
| 4710 | + else { |
|
| 4711 | + $info_generee = ($objets[$type_objet][$id_objet][$info] ?? ''); |
|
| 4712 | + } |
|
| 4713 | + |
|
| 4714 | + // On va ensuite appliquer les traitements automatiques si besoin |
|
| 4715 | + if (!$etoile) { |
|
| 4716 | + // FIXME: on fournit un ENV minimum avec id et type et connect='' |
|
| 4717 | + // mais ce fonctionnement est a ameliorer ! |
|
| 4718 | + $info_generee = appliquer_traitement_champ( |
|
| 4719 | + $info_generee, |
|
| 4720 | + $info, |
|
| 4721 | + table_objet($type_objet), |
|
| 4722 | + ['id_objet' => $id_objet, 'objet' => $type_objet, ''] |
|
| 4723 | + ); |
|
| 4724 | + } |
|
| 4725 | + |
|
| 4726 | + return $info_generee; |
|
| 4727 | 4727 | } |
| 4728 | 4728 | |
| 4729 | 4729 | /** |
@@ -4731,7 +4731,7 @@ discard block |
||
| 4731 | 4731 | * @see generer_objet_info |
| 4732 | 4732 | */ |
| 4733 | 4733 | function generer_info_entite($id_objet, $type_objet, $info, $etoile = '', $params = []) { |
| 4734 | - return generer_objet_info(intval($id_objet), $type_objet, $info, $etoile, $params); |
|
| 4734 | + return generer_objet_info(intval($id_objet), $type_objet, $info, $etoile, $params); |
|
| 4735 | 4735 | } |
| 4736 | 4736 | |
| 4737 | 4737 | /** |
@@ -4764,36 +4764,36 @@ discard block |
||
| 4764 | 4764 | */ |
| 4765 | 4765 | function generer_objet_introduction(int $id_objet, string $type_objet, array $ligne_sql, ?int $introduction_longueur = null, $longueur_ou_suite = null, ?string $suite = null, string $connect = ''): string { |
| 4766 | 4766 | |
| 4767 | - $descriptif = $ligne_sql['descriptif'] ?? ''; |
|
| 4768 | - $texte = $ligne_sql['texte'] ?? ''; |
|
| 4769 | - // En absence de descriptif, on se rabat sur chapo + texte |
|
| 4770 | - if (isset($ligne_sql['chapo'])) { |
|
| 4771 | - $chapo = $ligne_sql['chapo']; |
|
| 4772 | - $texte = strlen($descriptif) ? |
|
| 4773 | - '' : |
|
| 4774 | - "$chapo \n\n $texte"; |
|
| 4775 | - } |
|
| 4767 | + $descriptif = $ligne_sql['descriptif'] ?? ''; |
|
| 4768 | + $texte = $ligne_sql['texte'] ?? ''; |
|
| 4769 | + // En absence de descriptif, on se rabat sur chapo + texte |
|
| 4770 | + if (isset($ligne_sql['chapo'])) { |
|
| 4771 | + $chapo = $ligne_sql['chapo']; |
|
| 4772 | + $texte = strlen($descriptif) ? |
|
| 4773 | + '' : |
|
| 4774 | + "$chapo \n\n $texte"; |
|
| 4775 | + } |
|
| 4776 | 4776 | |
| 4777 | - // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
|
| 4778 | - if (!intval($longueur_ou_suite)) { |
|
| 4779 | - $longueur = intval($introduction_longueur ?: 600); |
|
| 4780 | - } else { |
|
| 4781 | - $longueur = intval($longueur_ou_suite); |
|
| 4782 | - } |
|
| 4777 | + // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
|
| 4778 | + if (!intval($longueur_ou_suite)) { |
|
| 4779 | + $longueur = intval($introduction_longueur ?: 600); |
|
| 4780 | + } else { |
|
| 4781 | + $longueur = intval($longueur_ou_suite); |
|
| 4782 | + } |
|
| 4783 | 4783 | |
| 4784 | - // On peut optionnellement passer la suite en 1er paramètre de la balise |
|
| 4785 | - // Ex : #INTRODUCTION{...} |
|
| 4786 | - if ( |
|
| 4787 | - is_null($suite) |
|
| 4788 | - and !intval($longueur_ou_suite) |
|
| 4789 | - ) { |
|
| 4790 | - $suite = $longueur_ou_suite; |
|
| 4791 | - } |
|
| 4784 | + // On peut optionnellement passer la suite en 1er paramètre de la balise |
|
| 4785 | + // Ex : #INTRODUCTION{...} |
|
| 4786 | + if ( |
|
| 4787 | + is_null($suite) |
|
| 4788 | + and !intval($longueur_ou_suite) |
|
| 4789 | + ) { |
|
| 4790 | + $suite = $longueur_ou_suite; |
|
| 4791 | + } |
|
| 4792 | 4792 | |
| 4793 | - $f = chercher_filtre('introduction'); |
|
| 4794 | - $introduction = $f($descriptif, $texte, $longueur, $connect, $suite); |
|
| 4793 | + $f = chercher_filtre('introduction'); |
|
| 4794 | + $introduction = $f($descriptif, $texte, $longueur, $connect, $suite); |
|
| 4795 | 4795 | |
| 4796 | - return $introduction; |
|
| 4796 | + return $introduction; |
|
| 4797 | 4797 | } |
| 4798 | 4798 | |
| 4799 | 4799 | /** |
@@ -4801,7 +4801,7 @@ discard block |
||
| 4801 | 4801 | * @see generer_objet_introduction |
| 4802 | 4802 | */ |
| 4803 | 4803 | function generer_introduction_entite($id_objet, $type_objet, $ligne_sql, $introduction_longueur = null, $longueur_ou_suite = null, $suite = null, string $connect = '') { |
| 4804 | - return generer_objet_introduction(intval($id_objet), $type_objet, $ligne_sql, $introduction_longueur, $longueur_ou_suite, $suite, $connect); |
|
| 4804 | + return generer_objet_introduction(intval($id_objet), $type_objet, $ligne_sql, $introduction_longueur, $longueur_ou_suite, $suite, $connect); |
|
| 4805 | 4805 | } |
| 4806 | 4806 | |
| 4807 | 4807 | /** |
@@ -4815,49 +4815,49 @@ discard block |
||
| 4815 | 4815 | * @return string |
| 4816 | 4816 | */ |
| 4817 | 4817 | function appliquer_traitement_champ($texte, $champ, $table_objet = '', $env = [], string $connect = '') { |
| 4818 | - if (!$champ) { |
|
| 4819 | - return $texte; |
|
| 4820 | - } |
|
| 4818 | + if (!$champ) { |
|
| 4819 | + return $texte; |
|
| 4820 | + } |
|
| 4821 | 4821 | |
| 4822 | - // On charge les définitions des traitements (inc/texte et fichiers de fonctions) |
|
| 4823 | - // car il ne faut pas partir du principe que c'est déjà chargé (form ajax, etc) |
|
| 4824 | - include_fichiers_fonctions(); |
|
| 4822 | + // On charge les définitions des traitements (inc/texte et fichiers de fonctions) |
|
| 4823 | + // car il ne faut pas partir du principe que c'est déjà chargé (form ajax, etc) |
|
| 4824 | + include_fichiers_fonctions(); |
|
| 4825 | 4825 | |
| 4826 | - $champ = strtoupper($champ); |
|
| 4827 | - $traitements = $GLOBALS['table_des_traitements'][$champ] ?? false; |
|
| 4828 | - if (!$traitements or !is_array($traitements)) { |
|
| 4829 | - return $texte; |
|
| 4830 | - } |
|
| 4826 | + $champ = strtoupper($champ); |
|
| 4827 | + $traitements = $GLOBALS['table_des_traitements'][$champ] ?? false; |
|
| 4828 | + if (!$traitements or !is_array($traitements)) { |
|
| 4829 | + return $texte; |
|
| 4830 | + } |
|
| 4831 | 4831 | |
| 4832 | - $traitement = ''; |
|
| 4833 | - if ($table_objet and (!isset($traitements[0]) or count($traitements) > 1)) { |
|
| 4834 | - // necessaire pour prendre en charge les vieux appels avec un table_objet_sql en 3e arg |
|
| 4835 | - $table_objet = table_objet($table_objet); |
|
| 4836 | - if (isset($traitements[$table_objet])) { |
|
| 4837 | - $traitement = $traitements[$table_objet]; |
|
| 4838 | - } |
|
| 4839 | - } |
|
| 4840 | - if (!$traitement and isset($traitements[0])) { |
|
| 4841 | - $traitement = $traitements[0]; |
|
| 4842 | - } |
|
| 4843 | - // (sinon prendre le premier de la liste par defaut ?) |
|
| 4832 | + $traitement = ''; |
|
| 4833 | + if ($table_objet and (!isset($traitements[0]) or count($traitements) > 1)) { |
|
| 4834 | + // necessaire pour prendre en charge les vieux appels avec un table_objet_sql en 3e arg |
|
| 4835 | + $table_objet = table_objet($table_objet); |
|
| 4836 | + if (isset($traitements[$table_objet])) { |
|
| 4837 | + $traitement = $traitements[$table_objet]; |
|
| 4838 | + } |
|
| 4839 | + } |
|
| 4840 | + if (!$traitement and isset($traitements[0])) { |
|
| 4841 | + $traitement = $traitements[0]; |
|
| 4842 | + } |
|
| 4843 | + // (sinon prendre le premier de la liste par defaut ?) |
|
| 4844 | 4844 | |
| 4845 | - if (!$traitement) { |
|
| 4846 | - return $texte; |
|
| 4847 | - } |
|
| 4845 | + if (!$traitement) { |
|
| 4846 | + return $texte; |
|
| 4847 | + } |
|
| 4848 | 4848 | |
| 4849 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4849 | + $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4850 | 4850 | |
| 4851 | - // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
|
| 4852 | - if (test_espace_prive()) { |
|
| 4853 | - $env['espace_prive'] = 1; |
|
| 4854 | - } |
|
| 4851 | + // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
|
| 4852 | + if (test_espace_prive()) { |
|
| 4853 | + $env['espace_prive'] = 1; |
|
| 4854 | + } |
|
| 4855 | 4855 | |
| 4856 | - // Fournir $connect et $Pile[0] au traitement si besoin |
|
| 4857 | - $Pile = [0 => $env]; |
|
| 4858 | - eval("\$texte = $traitement;"); |
|
| 4856 | + // Fournir $connect et $Pile[0] au traitement si besoin |
|
| 4857 | + $Pile = [0 => $env]; |
|
| 4858 | + eval("\$texte = $traitement;"); |
|
| 4859 | 4859 | |
| 4860 | - return $texte; |
|
| 4860 | + return $texte; |
|
| 4861 | 4861 | } |
| 4862 | 4862 | |
| 4863 | 4863 | |
@@ -4871,21 +4871,21 @@ discard block |
||
| 4871 | 4871 | * @return string |
| 4872 | 4872 | */ |
| 4873 | 4873 | function generer_objet_lien(int $id_objet, string $objet, int $longueur = 80, string $connect = ''): string { |
| 4874 | - include_spip('inc/liens'); |
|
| 4875 | - $titre = traiter_raccourci_titre($id_objet, $objet, $connect); |
|
| 4876 | - // lorsque l'objet n'est plus declare (plugin desactive par exemple) |
|
| 4877 | - // le raccourcis n'est plus valide |
|
| 4878 | - $titre = typo($titre['titre'] ?? ''); |
|
| 4879 | - // on essaye avec generer_info_entite ? |
|
| 4880 | - if (!strlen($titre) and !$connect) { |
|
| 4881 | - $titre = generer_objet_info($id_objet, $objet, 'titre'); |
|
| 4882 | - } |
|
| 4883 | - if (!strlen($titre)) { |
|
| 4884 | - $titre = _T('info_sans_titre'); |
|
| 4885 | - } |
|
| 4886 | - $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
|
| 4874 | + include_spip('inc/liens'); |
|
| 4875 | + $titre = traiter_raccourci_titre($id_objet, $objet, $connect); |
|
| 4876 | + // lorsque l'objet n'est plus declare (plugin desactive par exemple) |
|
| 4877 | + // le raccourcis n'est plus valide |
|
| 4878 | + $titre = typo($titre['titre'] ?? ''); |
|
| 4879 | + // on essaye avec generer_info_entite ? |
|
| 4880 | + if (!strlen($titre) and !$connect) { |
|
| 4881 | + $titre = generer_objet_info($id_objet, $objet, 'titre'); |
|
| 4882 | + } |
|
| 4883 | + if (!strlen($titre)) { |
|
| 4884 | + $titre = _T('info_sans_titre'); |
|
| 4885 | + } |
|
| 4886 | + $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
|
| 4887 | 4887 | |
| 4888 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4888 | + return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4889 | 4889 | } |
| 4890 | 4890 | |
| 4891 | 4891 | /** |
@@ -4893,7 +4893,7 @@ discard block |
||
| 4893 | 4893 | * @see generer_objet_lien |
| 4894 | 4894 | */ |
| 4895 | 4895 | function generer_lien_entite($id_objet, $objet, $longueur = 80, $connect = null) { |
| 4896 | - return generer_objet_lien(intval($id_objet), $objet, $longueur, $connect ?? ''); |
|
| 4896 | + return generer_objet_lien(intval($id_objet), $objet, $longueur, $connect ?? ''); |
|
| 4897 | 4897 | } |
| 4898 | 4898 | |
| 4899 | 4899 | /** |
@@ -4909,15 +4909,15 @@ discard block |
||
| 4909 | 4909 | * @return string |
| 4910 | 4910 | */ |
| 4911 | 4911 | function wrap($texte, $wrap) { |
| 4912 | - $balises = extraire_balises($wrap); |
|
| 4913 | - if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
|
| 4914 | - $texte = $wrap . $texte; |
|
| 4915 | - $regs = array_reverse($regs[1]); |
|
| 4916 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4917 | - $texte = $texte . $wrap; |
|
| 4918 | - } |
|
| 4912 | + $balises = extraire_balises($wrap); |
|
| 4913 | + if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
|
| 4914 | + $texte = $wrap . $texte; |
|
| 4915 | + $regs = array_reverse($regs[1]); |
|
| 4916 | + $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4917 | + $texte = $texte . $wrap; |
|
| 4918 | + } |
|
| 4919 | 4919 | |
| 4920 | - return $texte; |
|
| 4920 | + return $texte; |
|
| 4921 | 4921 | } |
| 4922 | 4922 | |
| 4923 | 4923 | |
@@ -4937,44 +4937,44 @@ discard block |
||
| 4937 | 4937 | * @return array|mixed|string |
| 4938 | 4938 | */ |
| 4939 | 4939 | function filtre_print_dist($u, $join = '<br />', $indent = 0) { |
| 4940 | - if (is_string($u)) { |
|
| 4941 | - $u = typo($u); |
|
| 4940 | + if (is_string($u)) { |
|
| 4941 | + $u = typo($u); |
|
| 4942 | 4942 | |
| 4943 | - return $u; |
|
| 4944 | - } |
|
| 4943 | + return $u; |
|
| 4944 | + } |
|
| 4945 | 4945 | |
| 4946 | - // caster $u en array si besoin |
|
| 4947 | - if (is_object($u)) { |
|
| 4948 | - $u = (array)$u; |
|
| 4949 | - } |
|
| 4946 | + // caster $u en array si besoin |
|
| 4947 | + if (is_object($u)) { |
|
| 4948 | + $u = (array)$u; |
|
| 4949 | + } |
|
| 4950 | 4950 | |
| 4951 | - if (is_array($u)) { |
|
| 4952 | - $out = ''; |
|
| 4953 | - // toutes les cles sont numeriques ? |
|
| 4954 | - // et aucun enfant n'est un tableau |
|
| 4955 | - // liste simple separee par des virgules |
|
| 4956 | - $numeric_keys = array_map('is_numeric', array_keys($u)); |
|
| 4957 | - $array_values = array_map('is_array', $u); |
|
| 4958 | - $object_values = array_map('is_object', $u); |
|
| 4959 | - if ( |
|
| 4960 | - array_sum($numeric_keys) == count($numeric_keys) |
|
| 4961 | - and !array_sum($array_values) |
|
| 4962 | - and !array_sum($object_values) |
|
| 4963 | - ) { |
|
| 4964 | - return join(', ', array_map('filtre_print_dist', $u)); |
|
| 4965 | - } |
|
| 4951 | + if (is_array($u)) { |
|
| 4952 | + $out = ''; |
|
| 4953 | + // toutes les cles sont numeriques ? |
|
| 4954 | + // et aucun enfant n'est un tableau |
|
| 4955 | + // liste simple separee par des virgules |
|
| 4956 | + $numeric_keys = array_map('is_numeric', array_keys($u)); |
|
| 4957 | + $array_values = array_map('is_array', $u); |
|
| 4958 | + $object_values = array_map('is_object', $u); |
|
| 4959 | + if ( |
|
| 4960 | + array_sum($numeric_keys) == count($numeric_keys) |
|
| 4961 | + and !array_sum($array_values) |
|
| 4962 | + and !array_sum($object_values) |
|
| 4963 | + ) { |
|
| 4964 | + return join(', ', array_map('filtre_print_dist', $u)); |
|
| 4965 | + } |
|
| 4966 | 4966 | |
| 4967 | - // sinon on passe a la ligne et on indente |
|
| 4968 | - $i_str = str_pad('', $indent, ' '); |
|
| 4969 | - foreach ($u as $k => $v) { |
|
| 4970 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4971 | - } |
|
| 4967 | + // sinon on passe a la ligne et on indente |
|
| 4968 | + $i_str = str_pad('', $indent, ' '); |
|
| 4969 | + foreach ($u as $k => $v) { |
|
| 4970 | + $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4971 | + } |
|
| 4972 | 4972 | |
| 4973 | - return $out; |
|
| 4974 | - } |
|
| 4973 | + return $out; |
|
| 4974 | + } |
|
| 4975 | 4975 | |
| 4976 | - // on sait pas quoi faire... |
|
| 4977 | - return $u; |
|
| 4976 | + // on sait pas quoi faire... |
|
| 4977 | + return $u; |
|
| 4978 | 4978 | } |
| 4979 | 4979 | |
| 4980 | 4980 | |
@@ -4987,10 +4987,10 @@ discard block |
||
| 4987 | 4987 | * @return string|array |
| 4988 | 4988 | */ |
| 4989 | 4989 | function objet_info($objet, $info) { |
| 4990 | - $table = table_objet_sql($objet); |
|
| 4991 | - $infos = lister_tables_objets_sql($table); |
|
| 4990 | + $table = table_objet_sql($objet); |
|
| 4991 | + $infos = lister_tables_objets_sql($table); |
|
| 4992 | 4992 | |
| 4993 | - return ($infos[$info] ?? ''); |
|
| 4993 | + return ($infos[$info] ?? ''); |
|
| 4994 | 4994 | } |
| 4995 | 4995 | |
| 4996 | 4996 | /** |
@@ -5005,11 +5005,11 @@ discard block |
||
| 5005 | 5005 | * texte traduit du comptage, tel que '3 articles' |
| 5006 | 5006 | */ |
| 5007 | 5007 | function objet_afficher_nb($nb, $objet) { |
| 5008 | - if (!$nb) { |
|
| 5009 | - return _T(objet_info($objet, 'info_aucun_objet')); |
|
| 5010 | - } else { |
|
| 5011 | - return _T(objet_info($objet, $nb == 1 ? 'info_1_objet' : 'info_nb_objets'), ['nb' => $nb]); |
|
| 5012 | - } |
|
| 5008 | + if (!$nb) { |
|
| 5009 | + return _T(objet_info($objet, 'info_aucun_objet')); |
|
| 5010 | + } else { |
|
| 5011 | + return _T(objet_info($objet, $nb == 1 ? 'info_1_objet' : 'info_nb_objets'), ['nb' => $nb]); |
|
| 5012 | + } |
|
| 5013 | 5013 | } |
| 5014 | 5014 | |
| 5015 | 5015 | /** |
@@ -5021,11 +5021,11 @@ discard block |
||
| 5021 | 5021 | * @return string |
| 5022 | 5022 | */ |
| 5023 | 5023 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5024 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5025 | - $icone = chemin_image($icone); |
|
| 5026 | - $balise_img = charger_filtre('balise_img'); |
|
| 5024 | + $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5025 | + $icone = chemin_image($icone); |
|
| 5026 | + $balise_img = charger_filtre('balise_img'); |
|
| 5027 | 5027 | |
| 5028 | - return $icone ? $balise_img($icone, _T(objet_info($objet, 'texte_objet')), $class, $taille) : ''; |
|
| 5028 | + return $icone ? $balise_img($icone, _T(objet_info($objet, 'texte_objet')), $class, $taille) : ''; |
|
| 5029 | 5029 | } |
| 5030 | 5030 | |
| 5031 | 5031 | /** |
@@ -5046,12 +5046,12 @@ discard block |
||
| 5046 | 5046 | * @return string |
| 5047 | 5047 | */ |
| 5048 | 5048 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5049 | - $chaine = explode(':', $chaine); |
|
| 5050 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5051 | - return $t; |
|
| 5052 | - } |
|
| 5053 | - $chaine = implode(':', $chaine); |
|
| 5054 | - return _T($chaine, $args, $options); |
|
| 5049 | + $chaine = explode(':', $chaine); |
|
| 5050 | + if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5051 | + return $t; |
|
| 5052 | + } |
|
| 5053 | + $chaine = implode(':', $chaine); |
|
| 5054 | + return _T($chaine, $args, $options); |
|
| 5055 | 5055 | } |
| 5056 | 5056 | |
| 5057 | 5057 | /** |
@@ -5065,18 +5065,18 @@ discard block |
||
| 5065 | 5065 | * @return string Code HTML |
| 5066 | 5066 | */ |
| 5067 | 5067 | function insert_head_css_conditionnel($flux) { |
| 5068 | - if ( |
|
| 5069 | - strpos($flux, '<!-- insert_head_css -->') === false |
|
| 5070 | - and $p = strpos($flux, '<!-- insert_head -->') |
|
| 5071 | - ) { |
|
| 5072 | - // plutot avant le premier js externe (jquery) pour etre non bloquant |
|
| 5073 | - if ($p1 = stripos($flux, '<script src=') and $p1 < $p) { |
|
| 5074 | - $p = $p1; |
|
| 5075 | - } |
|
| 5076 | - $flux = substr_replace($flux, pipeline('insert_head_css', '<!-- insert_head_css -->'), $p, 0); |
|
| 5077 | - } |
|
| 5068 | + if ( |
|
| 5069 | + strpos($flux, '<!-- insert_head_css -->') === false |
|
| 5070 | + and $p = strpos($flux, '<!-- insert_head -->') |
|
| 5071 | + ) { |
|
| 5072 | + // plutot avant le premier js externe (jquery) pour etre non bloquant |
|
| 5073 | + if ($p1 = stripos($flux, '<script src=') and $p1 < $p) { |
|
| 5074 | + $p = $p1; |
|
| 5075 | + } |
|
| 5076 | + $flux = substr_replace($flux, pipeline('insert_head_css', '<!-- insert_head_css -->'), $p, 0); |
|
| 5077 | + } |
|
| 5078 | 5078 | |
| 5079 | - return $flux; |
|
| 5079 | + return $flux; |
|
| 5080 | 5080 | } |
| 5081 | 5081 | |
| 5082 | 5082 | /** |
@@ -5099,75 +5099,75 @@ discard block |
||
| 5099 | 5099 | * @return string |
| 5100 | 5100 | */ |
| 5101 | 5101 | function produire_fond_statique($fond, $contexte = [], $options = [], string $connect = '') { |
| 5102 | - if (isset($contexte['format'])) { |
|
| 5103 | - $extension = $contexte['format']; |
|
| 5104 | - unset($contexte['format']); |
|
| 5105 | - } else { |
|
| 5106 | - $extension = 'html'; |
|
| 5107 | - if (preg_match(',[.](css|js|json|xml|svg)$,', $fond, $m)) { |
|
| 5108 | - $extension = $m[1]; |
|
| 5109 | - } |
|
| 5110 | - } |
|
| 5111 | - // recuperer le contenu produit par le squelette |
|
| 5112 | - $options['raw'] = true; |
|
| 5113 | - $cache = recuperer_fond($fond, $contexte, $options, $connect); |
|
| 5114 | - |
|
| 5115 | - // calculer le nom de la css |
|
| 5116 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5117 | - $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
|
| 5118 | - $contexte_implicite = calculer_contexte_implicite(); |
|
| 5119 | - |
|
| 5120 | - // par defaut on hash selon les contextes qui sont a priori moins variables |
|
| 5121 | - // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
|
| 5122 | - // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
|
| 5123 | - if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
|
| 5124 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5125 | - } |
|
| 5126 | - else { |
|
| 5127 | - unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
|
| 5128 | - ksort($contexte); |
|
| 5129 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5130 | - } |
|
| 5131 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5132 | - |
|
| 5133 | - // mettre a jour le fichier si il n'existe pas |
|
| 5134 | - // ou trop ancien |
|
| 5135 | - // le dernier fichier produit est toujours suffixe par .last |
|
| 5136 | - // et recopie sur le fichier cible uniquement si il change |
|
| 5137 | - if ( |
|
| 5138 | - !file_exists($filename) |
|
| 5139 | - or !file_exists($filename . '.last') |
|
| 5140 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5141 | - or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
|
| 5142 | - ) { |
|
| 5143 | - $contenu = $cache['texte']; |
|
| 5144 | - // passer les urls en absolu si c'est une css |
|
| 5145 | - if ($extension == 'css') { |
|
| 5146 | - $contenu = urls_absolues_css( |
|
| 5147 | - $contenu, |
|
| 5148 | - test_espace_prive() ? generer_url_ecrire('accueil') : generer_url_public($fond) |
|
| 5149 | - ); |
|
| 5150 | - } |
|
| 5151 | - |
|
| 5152 | - $comment = ''; |
|
| 5153 | - // ne pas insérer de commentaire sur certains formats |
|
| 5154 | - if (!in_array($extension, ['json', 'xml', 'svg'])) { |
|
| 5155 | - $comment = "/* #PRODUIRE{fond=$fond"; |
|
| 5156 | - foreach ($contexte as $k => $v) { |
|
| 5157 | - if (is_array($v)) { |
|
| 5158 | - $v = var_export($v, true); |
|
| 5159 | - } |
|
| 5160 | - $comment .= ",$k=$v"; |
|
| 5161 | - } |
|
| 5162 | - // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
|
| 5163 | - // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
|
| 5164 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5165 | - } |
|
| 5166 | - // et ecrire le fichier si il change |
|
| 5167 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5168 | - } |
|
| 5169 | - |
|
| 5170 | - return timestamp($filename); |
|
| 5102 | + if (isset($contexte['format'])) { |
|
| 5103 | + $extension = $contexte['format']; |
|
| 5104 | + unset($contexte['format']); |
|
| 5105 | + } else { |
|
| 5106 | + $extension = 'html'; |
|
| 5107 | + if (preg_match(',[.](css|js|json|xml|svg)$,', $fond, $m)) { |
|
| 5108 | + $extension = $m[1]; |
|
| 5109 | + } |
|
| 5110 | + } |
|
| 5111 | + // recuperer le contenu produit par le squelette |
|
| 5112 | + $options['raw'] = true; |
|
| 5113 | + $cache = recuperer_fond($fond, $contexte, $options, $connect); |
|
| 5114 | + |
|
| 5115 | + // calculer le nom de la css |
|
| 5116 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5117 | + $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
|
| 5118 | + $contexte_implicite = calculer_contexte_implicite(); |
|
| 5119 | + |
|
| 5120 | + // par defaut on hash selon les contextes qui sont a priori moins variables |
|
| 5121 | + // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
|
| 5122 | + // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
|
| 5123 | + if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
|
| 5124 | + $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5125 | + } |
|
| 5126 | + else { |
|
| 5127 | + unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
|
| 5128 | + ksort($contexte); |
|
| 5129 | + $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5130 | + } |
|
| 5131 | + $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5132 | + |
|
| 5133 | + // mettre a jour le fichier si il n'existe pas |
|
| 5134 | + // ou trop ancien |
|
| 5135 | + // le dernier fichier produit est toujours suffixe par .last |
|
| 5136 | + // et recopie sur le fichier cible uniquement si il change |
|
| 5137 | + if ( |
|
| 5138 | + !file_exists($filename) |
|
| 5139 | + or !file_exists($filename . '.last') |
|
| 5140 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5141 | + or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
|
| 5142 | + ) { |
|
| 5143 | + $contenu = $cache['texte']; |
|
| 5144 | + // passer les urls en absolu si c'est une css |
|
| 5145 | + if ($extension == 'css') { |
|
| 5146 | + $contenu = urls_absolues_css( |
|
| 5147 | + $contenu, |
|
| 5148 | + test_espace_prive() ? generer_url_ecrire('accueil') : generer_url_public($fond) |
|
| 5149 | + ); |
|
| 5150 | + } |
|
| 5151 | + |
|
| 5152 | + $comment = ''; |
|
| 5153 | + // ne pas insérer de commentaire sur certains formats |
|
| 5154 | + if (!in_array($extension, ['json', 'xml', 'svg'])) { |
|
| 5155 | + $comment = "/* #PRODUIRE{fond=$fond"; |
|
| 5156 | + foreach ($contexte as $k => $v) { |
|
| 5157 | + if (is_array($v)) { |
|
| 5158 | + $v = var_export($v, true); |
|
| 5159 | + } |
|
| 5160 | + $comment .= ",$k=$v"; |
|
| 5161 | + } |
|
| 5162 | + // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
|
| 5163 | + // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
|
| 5164 | + $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5165 | + } |
|
| 5166 | + // et ecrire le fichier si il change |
|
| 5167 | + ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5168 | + } |
|
| 5169 | + |
|
| 5170 | + return timestamp($filename); |
|
| 5171 | 5171 | } |
| 5172 | 5172 | |
| 5173 | 5173 | /** |
@@ -5180,15 +5180,15 @@ discard block |
||
| 5180 | 5180 | * $fichier auquel on a ajouté le timestamp |
| 5181 | 5181 | */ |
| 5182 | 5182 | function timestamp($fichier) { |
| 5183 | - if ( |
|
| 5184 | - !$fichier |
|
| 5185 | - or !file_exists($fichier) |
|
| 5186 | - or !$m = filemtime($fichier) |
|
| 5187 | - ) { |
|
| 5188 | - return $fichier; |
|
| 5189 | - } |
|
| 5183 | + if ( |
|
| 5184 | + !$fichier |
|
| 5185 | + or !file_exists($fichier) |
|
| 5186 | + or !$m = filemtime($fichier) |
|
| 5187 | + ) { |
|
| 5188 | + return $fichier; |
|
| 5189 | + } |
|
| 5190 | 5190 | |
| 5191 | - return "$fichier?$m"; |
|
| 5191 | + return "$fichier?$m"; |
|
| 5192 | 5192 | } |
| 5193 | 5193 | |
| 5194 | 5194 | /** |
@@ -5198,11 +5198,11 @@ discard block |
||
| 5198 | 5198 | * @return string |
| 5199 | 5199 | */ |
| 5200 | 5200 | function supprimer_timestamp($url) { |
| 5201 | - if (strpos($url, '?') === false) { |
|
| 5202 | - return $url; |
|
| 5203 | - } |
|
| 5201 | + if (strpos($url, '?') === false) { |
|
| 5202 | + return $url; |
|
| 5203 | + } |
|
| 5204 | 5204 | |
| 5205 | - return preg_replace(',\?[[:digit:]]+$,', '', $url); |
|
| 5205 | + return preg_replace(',\?[[:digit:]]+$,', '', $url); |
|
| 5206 | 5206 | } |
| 5207 | 5207 | |
| 5208 | 5208 | /** |
@@ -5217,15 +5217,15 @@ discard block |
||
| 5217 | 5217 | * @return string |
| 5218 | 5218 | */ |
| 5219 | 5219 | function filtre_nettoyer_titre_email_dist($titre) { |
| 5220 | - include_spip('inc/envoyer_mail'); |
|
| 5220 | + include_spip('inc/envoyer_mail'); |
|
| 5221 | 5221 | |
| 5222 | - $titre = nettoyer_titre_email($titre); |
|
| 5223 | - // on est dans un squelette : securiser le retour |
|
| 5224 | - if (strpos($titre, '<') !== false) { |
|
| 5225 | - $titre = interdire_scripts($titre); |
|
| 5226 | - } |
|
| 5222 | + $titre = nettoyer_titre_email($titre); |
|
| 5223 | + // on est dans un squelette : securiser le retour |
|
| 5224 | + if (strpos($titre, '<') !== false) { |
|
| 5225 | + $titre = interdire_scripts($titre); |
|
| 5226 | + } |
|
| 5227 | 5227 | |
| 5228 | - return $titre; |
|
| 5228 | + return $titre; |
|
| 5229 | 5229 | } |
| 5230 | 5230 | |
| 5231 | 5231 | /** |
@@ -5247,27 +5247,27 @@ discard block |
||
| 5247 | 5247 | * @return string |
| 5248 | 5248 | */ |
| 5249 | 5249 | function filtre_chercher_rubrique_dist( |
| 5250 | - $titre, |
|
| 5251 | - $id_objet, |
|
| 5252 | - $id_parent, |
|
| 5253 | - $objet, |
|
| 5254 | - $id_secteur, |
|
| 5255 | - $restreint, |
|
| 5256 | - $actionable = false, |
|
| 5257 | - $retour_sans_cadre = false |
|
| 5250 | + $titre, |
|
| 5251 | + $id_objet, |
|
| 5252 | + $id_parent, |
|
| 5253 | + $objet, |
|
| 5254 | + $id_secteur, |
|
| 5255 | + $restreint, |
|
| 5256 | + $actionable = false, |
|
| 5257 | + $retour_sans_cadre = false |
|
| 5258 | 5258 | ) { |
| 5259 | - include_spip('inc/filtres_ecrire'); |
|
| 5259 | + include_spip('inc/filtres_ecrire'); |
|
| 5260 | 5260 | |
| 5261 | - return chercher_rubrique( |
|
| 5262 | - $titre, |
|
| 5263 | - $id_objet, |
|
| 5264 | - $id_parent, |
|
| 5265 | - $objet, |
|
| 5266 | - $id_secteur, |
|
| 5267 | - $restreint, |
|
| 5268 | - $actionable, |
|
| 5269 | - $retour_sans_cadre |
|
| 5270 | - ); |
|
| 5261 | + return chercher_rubrique( |
|
| 5262 | + $titre, |
|
| 5263 | + $id_objet, |
|
| 5264 | + $id_parent, |
|
| 5265 | + $objet, |
|
| 5266 | + $id_secteur, |
|
| 5267 | + $restreint, |
|
| 5268 | + $actionable, |
|
| 5269 | + $retour_sans_cadre |
|
| 5270 | + ); |
|
| 5271 | 5271 | } |
| 5272 | 5272 | |
| 5273 | 5273 | /** |
@@ -5296,56 +5296,56 @@ discard block |
||
| 5296 | 5296 | * Chaîne vide si l'accès est autorisé |
| 5297 | 5297 | */ |
| 5298 | 5298 | function sinon_interdire_acces($ok = false, $url = '', $statut = 0, $message = null) { |
| 5299 | - if ($ok) { |
|
| 5300 | - return ''; |
|
| 5301 | - } |
|
| 5302 | - |
|
| 5303 | - // Vider tous les tampons |
|
| 5304 | - $level = @ob_get_level(); |
|
| 5305 | - while ($level--) { |
|
| 5306 | - @ob_end_clean(); |
|
| 5307 | - } |
|
| 5308 | - |
|
| 5309 | - include_spip('inc/headers'); |
|
| 5310 | - |
|
| 5311 | - // S'il y a une URL, on redirige (si pas de statut, la fonction mettra 302 par défaut) |
|
| 5312 | - if ($url) { |
|
| 5313 | - redirige_par_entete($url, '', $statut); |
|
| 5314 | - } |
|
| 5315 | - |
|
| 5316 | - // ecriture simplifiee avec message en 3eme argument (= statut 403) |
|
| 5317 | - if (!is_numeric($statut) and is_null($message)) { |
|
| 5318 | - $message = $statut; |
|
| 5319 | - $statut = 0; |
|
| 5320 | - } |
|
| 5321 | - if (!$message) { |
|
| 5322 | - $message = ''; |
|
| 5323 | - } |
|
| 5324 | - $statut = intval($statut); |
|
| 5325 | - |
|
| 5326 | - // Si on est dans l'espace privé, on génère du 403 Forbidden par defaut ou du 404 |
|
| 5327 | - if (test_espace_prive()) { |
|
| 5328 | - if (!$statut or !in_array($statut, [404, 403])) { |
|
| 5329 | - $statut = 403; |
|
| 5330 | - } |
|
| 5331 | - http_response_code(403); |
|
| 5332 | - $echec = charger_fonction('403', 'exec'); |
|
| 5333 | - $echec($message); |
|
| 5334 | - } else { |
|
| 5335 | - // Sinon dans l'espace public on redirige vers une 404 par défaut, car elle toujours présente normalement |
|
| 5336 | - if (!$statut) { |
|
| 5337 | - $statut = 404; |
|
| 5338 | - } |
|
| 5339 | - // Dans tous les cas on modifie l'entité avec ce qui est demandé |
|
| 5340 | - http_response_code($statut); |
|
| 5341 | - // Si le statut est une erreur et qu'il n'y a pas de redirection on va chercher le squelette du même nom |
|
| 5342 | - if ($statut >= 400) { |
|
| 5343 | - echo recuperer_fond("$statut", ['erreur' => $message]); |
|
| 5344 | - } |
|
| 5345 | - } |
|
| 5346 | - |
|
| 5347 | - |
|
| 5348 | - exit; |
|
| 5299 | + if ($ok) { |
|
| 5300 | + return ''; |
|
| 5301 | + } |
|
| 5302 | + |
|
| 5303 | + // Vider tous les tampons |
|
| 5304 | + $level = @ob_get_level(); |
|
| 5305 | + while ($level--) { |
|
| 5306 | + @ob_end_clean(); |
|
| 5307 | + } |
|
| 5308 | + |
|
| 5309 | + include_spip('inc/headers'); |
|
| 5310 | + |
|
| 5311 | + // S'il y a une URL, on redirige (si pas de statut, la fonction mettra 302 par défaut) |
|
| 5312 | + if ($url) { |
|
| 5313 | + redirige_par_entete($url, '', $statut); |
|
| 5314 | + } |
|
| 5315 | + |
|
| 5316 | + // ecriture simplifiee avec message en 3eme argument (= statut 403) |
|
| 5317 | + if (!is_numeric($statut) and is_null($message)) { |
|
| 5318 | + $message = $statut; |
|
| 5319 | + $statut = 0; |
|
| 5320 | + } |
|
| 5321 | + if (!$message) { |
|
| 5322 | + $message = ''; |
|
| 5323 | + } |
|
| 5324 | + $statut = intval($statut); |
|
| 5325 | + |
|
| 5326 | + // Si on est dans l'espace privé, on génère du 403 Forbidden par defaut ou du 404 |
|
| 5327 | + if (test_espace_prive()) { |
|
| 5328 | + if (!$statut or !in_array($statut, [404, 403])) { |
|
| 5329 | + $statut = 403; |
|
| 5330 | + } |
|
| 5331 | + http_response_code(403); |
|
| 5332 | + $echec = charger_fonction('403', 'exec'); |
|
| 5333 | + $echec($message); |
|
| 5334 | + } else { |
|
| 5335 | + // Sinon dans l'espace public on redirige vers une 404 par défaut, car elle toujours présente normalement |
|
| 5336 | + if (!$statut) { |
|
| 5337 | + $statut = 404; |
|
| 5338 | + } |
|
| 5339 | + // Dans tous les cas on modifie l'entité avec ce qui est demandé |
|
| 5340 | + http_response_code($statut); |
|
| 5341 | + // Si le statut est une erreur et qu'il n'y a pas de redirection on va chercher le squelette du même nom |
|
| 5342 | + if ($statut >= 400) { |
|
| 5343 | + echo recuperer_fond("$statut", ['erreur' => $message]); |
|
| 5344 | + } |
|
| 5345 | + } |
|
| 5346 | + |
|
| 5347 | + |
|
| 5348 | + exit; |
|
| 5349 | 5349 | } |
| 5350 | 5350 | |
| 5351 | 5351 | /** |
@@ -5356,11 +5356,11 @@ discard block |
||
| 5356 | 5356 | * @return string |
| 5357 | 5357 | */ |
| 5358 | 5358 | function filtre_compacte_dist($source, $format = null) { |
| 5359 | - if (function_exists('minifier')) { |
|
| 5360 | - return minifier($source, $format); |
|
| 5361 | - } |
|
| 5359 | + if (function_exists('minifier')) { |
|
| 5360 | + return minifier($source, $format); |
|
| 5361 | + } |
|
| 5362 | 5362 | |
| 5363 | - return $source; |
|
| 5363 | + return $source; |
|
| 5364 | 5364 | } |
| 5365 | 5365 | |
| 5366 | 5366 | |
@@ -5372,32 +5372,32 @@ discard block |
||
| 5372 | 5372 | * @return string |
| 5373 | 5373 | */ |
| 5374 | 5374 | function spip_affiche_mot_de_passe_masque(?string $passe, bool $afficher_partiellement = false, ?int $portion_pourcent = null): string { |
| 5375 | - $passe ??= ''; |
|
| 5376 | - $l = strlen($passe); |
|
| 5377 | - |
|
| 5378 | - if ($l <= 8 or !$afficher_partiellement) { |
|
| 5379 | - if (!$l) { |
|
| 5380 | - return ''; // montrer qu'il y a pas de mot de passe si il y en a pas |
|
| 5381 | - } |
|
| 5382 | - return str_pad('', $afficher_partiellement ? $l : 16, '*'); |
|
| 5383 | - } |
|
| 5384 | - |
|
| 5385 | - if (is_null($portion_pourcent)) { |
|
| 5386 | - if (!defined('_SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT')) { |
|
| 5387 | - define('_SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT', 20); // 20% |
|
| 5388 | - } |
|
| 5389 | - $portion_pourcent = _SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT; |
|
| 5390 | - } |
|
| 5391 | - if ($portion_pourcent >= 100) { |
|
| 5392 | - return $passe; |
|
| 5393 | - } |
|
| 5394 | - $e = intval(ceil($l * $portion_pourcent / 100 / 2)); |
|
| 5395 | - $e = max($e, 0); |
|
| 5396 | - $mid = str_pad('', $l - 2 * $e, '*'); |
|
| 5397 | - if ($e > 0 and strlen($mid) > 8) { |
|
| 5398 | - $mid = '***...***'; |
|
| 5399 | - } |
|
| 5400 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5375 | + $passe ??= ''; |
|
| 5376 | + $l = strlen($passe); |
|
| 5377 | + |
|
| 5378 | + if ($l <= 8 or !$afficher_partiellement) { |
|
| 5379 | + if (!$l) { |
|
| 5380 | + return ''; // montrer qu'il y a pas de mot de passe si il y en a pas |
|
| 5381 | + } |
|
| 5382 | + return str_pad('', $afficher_partiellement ? $l : 16, '*'); |
|
| 5383 | + } |
|
| 5384 | + |
|
| 5385 | + if (is_null($portion_pourcent)) { |
|
| 5386 | + if (!defined('_SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT')) { |
|
| 5387 | + define('_SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT', 20); // 20% |
|
| 5388 | + } |
|
| 5389 | + $portion_pourcent = _SPIP_AFFICHE_MOT_DE_PASSE_MASQUE_PERCENT; |
|
| 5390 | + } |
|
| 5391 | + if ($portion_pourcent >= 100) { |
|
| 5392 | + return $passe; |
|
| 5393 | + } |
|
| 5394 | + $e = intval(ceil($l * $portion_pourcent / 100 / 2)); |
|
| 5395 | + $e = max($e, 0); |
|
| 5396 | + $mid = str_pad('', $l - 2 * $e, '*'); |
|
| 5397 | + if ($e > 0 and strlen($mid) > 8) { |
|
| 5398 | + $mid = '***...***'; |
|
| 5399 | + } |
|
| 5400 | + return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5401 | 5401 | } |
| 5402 | 5402 | |
| 5403 | 5403 | |
@@ -5418,64 +5418,64 @@ discard block |
||
| 5418 | 5418 | */ |
| 5419 | 5419 | function identifiant_slug($texte, $type = '', $options = []) { |
| 5420 | 5420 | |
| 5421 | - $original = $texte; |
|
| 5422 | - $separateur = ($options['separateur'] ?? '_'); |
|
| 5423 | - $longueur_maxi = ($options['longueur_maxi'] ?? 60); |
|
| 5424 | - $longueur_mini = ($options['longueur_mini'] ?? 0); |
|
| 5421 | + $original = $texte; |
|
| 5422 | + $separateur = ($options['separateur'] ?? '_'); |
|
| 5423 | + $longueur_maxi = ($options['longueur_maxi'] ?? 60); |
|
| 5424 | + $longueur_mini = ($options['longueur_mini'] ?? 0); |
|
| 5425 | 5425 | |
| 5426 | - if (!function_exists('translitteration')) { |
|
| 5427 | - include_spip('inc/charsets'); |
|
| 5428 | - } |
|
| 5426 | + if (!function_exists('translitteration')) { |
|
| 5427 | + include_spip('inc/charsets'); |
|
| 5428 | + } |
|
| 5429 | 5429 | |
| 5430 | - // pas de balise html |
|
| 5431 | - if (strpos($texte, '<') !== false) { |
|
| 5432 | - $texte = strip_tags($texte); |
|
| 5433 | - } |
|
| 5434 | - if (strpos($texte, '&') !== false) { |
|
| 5435 | - $texte = unicode2charset($texte); |
|
| 5436 | - } |
|
| 5437 | - // On enlève les espaces indésirables |
|
| 5438 | - $texte = trim($texte); |
|
| 5430 | + // pas de balise html |
|
| 5431 | + if (strpos($texte, '<') !== false) { |
|
| 5432 | + $texte = strip_tags($texte); |
|
| 5433 | + } |
|
| 5434 | + if (strpos($texte, '&') !== false) { |
|
| 5435 | + $texte = unicode2charset($texte); |
|
| 5436 | + } |
|
| 5437 | + // On enlève les espaces indésirables |
|
| 5438 | + $texte = trim($texte); |
|
| 5439 | 5439 | |
| 5440 | - // On enlève les accents et cie |
|
| 5441 | - $texte = translitteration($texte); |
|
| 5440 | + // On enlève les accents et cie |
|
| 5441 | + $texte = translitteration($texte); |
|
| 5442 | 5442 | |
| 5443 | - // On remplace tout ce qui n'est pas un mot par un séparateur |
|
| 5444 | - $texte = preg_replace(',[\W_]+,ms', $separateur, $texte); |
|
| 5443 | + // On remplace tout ce qui n'est pas un mot par un séparateur |
|
| 5444 | + $texte = preg_replace(',[\W_]+,ms', $separateur, $texte); |
|
| 5445 | 5445 | |
| 5446 | - // nettoyer les doubles occurences du separateur si besoin |
|
| 5447 | - while (strpos($texte, (string) "$separateur$separateur") !== false) { |
|
| 5448 | - $texte = str_replace("$separateur$separateur", $separateur, $texte); |
|
| 5449 | - } |
|
| 5446 | + // nettoyer les doubles occurences du separateur si besoin |
|
| 5447 | + while (strpos($texte, (string) "$separateur$separateur") !== false) { |
|
| 5448 | + $texte = str_replace("$separateur$separateur", $separateur, $texte); |
|
| 5449 | + } |
|
| 5450 | 5450 | |
| 5451 | - // pas de separateur au debut ni a la fin |
|
| 5452 | - $texte = trim($texte, $separateur); |
|
| 5451 | + // pas de separateur au debut ni a la fin |
|
| 5452 | + $texte = trim($texte, $separateur); |
|
| 5453 | 5453 | |
| 5454 | - // en minuscules |
|
| 5455 | - $texte = strtolower($texte); |
|
| 5454 | + // en minuscules |
|
| 5455 | + $texte = strtolower($texte); |
|
| 5456 | 5456 | |
| 5457 | - switch ($type) { |
|
| 5458 | - case 'class': |
|
| 5459 | - case 'id': |
|
| 5460 | - case 'anchor': |
|
| 5461 | - if (preg_match(',^\d,', $texte)) { |
|
| 5462 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5463 | - } |
|
| 5464 | - } |
|
| 5457 | + switch ($type) { |
|
| 5458 | + case 'class': |
|
| 5459 | + case 'id': |
|
| 5460 | + case 'anchor': |
|
| 5461 | + if (preg_match(',^\d,', $texte)) { |
|
| 5462 | + $texte = substr($type, 0, 1) . $texte; |
|
| 5463 | + } |
|
| 5464 | + } |
|
| 5465 | 5465 | |
| 5466 | - if (strlen($texte) > $longueur_maxi) { |
|
| 5467 | - $texte = substr($texte, 0, $longueur_maxi); |
|
| 5468 | - } |
|
| 5466 | + if (strlen($texte) > $longueur_maxi) { |
|
| 5467 | + $texte = substr($texte, 0, $longueur_maxi); |
|
| 5468 | + } |
|
| 5469 | 5469 | |
| 5470 | - if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
|
| 5471 | - if (preg_match(',^\d,', $texte)) { |
|
| 5472 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5473 | - } |
|
| 5474 | - $texte .= $separateur . md5($original); |
|
| 5475 | - $texte = substr($texte, 0, $longueur_mini); |
|
| 5476 | - } |
|
| 5470 | + if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
|
| 5471 | + if (preg_match(',^\d,', $texte)) { |
|
| 5472 | + $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5473 | + } |
|
| 5474 | + $texte .= $separateur . md5($original); |
|
| 5475 | + $texte = substr($texte, 0, $longueur_mini); |
|
| 5476 | + } |
|
| 5477 | 5477 | |
| 5478 | - return $texte; |
|
| 5478 | + return $texte; |
|
| 5479 | 5479 | } |
| 5480 | 5480 | |
| 5481 | 5481 | |
@@ -5496,11 +5496,11 @@ discard block |
||
| 5496 | 5496 | * @exemple `<:info_maximum|label_nettoyer:>` |
| 5497 | 5497 | */ |
| 5498 | 5498 | function label_nettoyer(string $text, bool $ucfirst = true): string { |
| 5499 | - $label = preg_replace('#([\s:]|\ )+$#u', '', $text); |
|
| 5500 | - if ($ucfirst) { |
|
| 5501 | - $label = spip_ucfirst($label); |
|
| 5502 | - } |
|
| 5503 | - return $label; |
|
| 5499 | + $label = preg_replace('#([\s:]|\ )+$#u', '', $text); |
|
| 5500 | + if ($ucfirst) { |
|
| 5501 | + $label = spip_ucfirst($label); |
|
| 5502 | + } |
|
| 5503 | + return $label; |
|
| 5504 | 5504 | } |
| 5505 | 5505 | |
| 5506 | 5506 | /** |
@@ -5513,8 +5513,8 @@ discard block |
||
| 5513 | 5513 | * @exemple `<:info_maximum|label_ponctuer:>` |
| 5514 | 5514 | */ |
| 5515 | 5515 | function label_ponctuer(string $text, bool $ucfirst = true): string { |
| 5516 | - $label = label_nettoyer($text, $ucfirst); |
|
| 5517 | - return _T('label_ponctuer', ['label' => $label]); |
|
| 5516 | + $label = label_nettoyer($text, $ucfirst); |
|
| 5517 | + return _T('label_ponctuer', ['label' => $label]); |
|
| 5518 | 5518 | } |
| 5519 | 5519 | |
| 5520 | 5520 | |
@@ -5527,19 +5527,19 @@ discard block |
||
| 5527 | 5527 | * @return array |
| 5528 | 5528 | */ |
| 5529 | 5529 | function helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, $fonction) { |
| 5530 | - if (!in_array($fonction, ['objet_lister_parents', 'objet_lister_enfants', 'objet_lister_parents_par_type', 'objet_lister_enfants_par_type'])) { |
|
| 5531 | - return []; |
|
| 5532 | - } |
|
| 5530 | + if (!in_array($fonction, ['objet_lister_parents', 'objet_lister_enfants', 'objet_lister_parents_par_type', 'objet_lister_enfants_par_type'])) { |
|
| 5531 | + return []; |
|
| 5532 | + } |
|
| 5533 | 5533 | |
| 5534 | - // compatibilite signature inversee |
|
| 5535 | - if (is_numeric($objet) and !is_numeric($id_objet)) { |
|
| 5536 | - [$objet, $id_objet] = [$id_objet, $objet]; |
|
| 5537 | - } |
|
| 5534 | + // compatibilite signature inversee |
|
| 5535 | + if (is_numeric($objet) and !is_numeric($id_objet)) { |
|
| 5536 | + [$objet, $id_objet] = [$id_objet, $objet]; |
|
| 5537 | + } |
|
| 5538 | 5538 | |
| 5539 | - if (!function_exists($fonction)) { |
|
| 5540 | - include_spip('base/objets'); |
|
| 5541 | - } |
|
| 5542 | - return $fonction($objet, $id_objet); |
|
| 5539 | + if (!function_exists($fonction)) { |
|
| 5540 | + include_spip('base/objets'); |
|
| 5541 | + } |
|
| 5542 | + return $fonction($objet, $id_objet); |
|
| 5543 | 5543 | } |
| 5544 | 5544 | |
| 5545 | 5545 | |
@@ -5554,7 +5554,7 @@ discard block |
||
| 5554 | 5554 | * @return array |
| 5555 | 5555 | */ |
| 5556 | 5556 | function filtre_objet_lister_parents_dist($objet, $id_objet) { |
| 5557 | - return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_parents'); |
|
| 5557 | + return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_parents'); |
|
| 5558 | 5558 | } |
| 5559 | 5559 | |
| 5560 | 5560 | /** |
@@ -5568,7 +5568,7 @@ discard block |
||
| 5568 | 5568 | * @return array |
| 5569 | 5569 | */ |
| 5570 | 5570 | function filtre_objet_lister_parents_par_type_dist($objet, $id_objet) { |
| 5571 | - return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_parents_par_type'); |
|
| 5571 | + return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_parents_par_type'); |
|
| 5572 | 5572 | } |
| 5573 | 5573 | |
| 5574 | 5574 | /** |
@@ -5582,7 +5582,7 @@ discard block |
||
| 5582 | 5582 | * @return array |
| 5583 | 5583 | */ |
| 5584 | 5584 | function filtre_objet_lister_enfants_dist($objet, $id_objet) { |
| 5585 | - return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_enfants'); |
|
| 5585 | + return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_enfants'); |
|
| 5586 | 5586 | } |
| 5587 | 5587 | |
| 5588 | 5588 | /** |
@@ -5596,5 +5596,5 @@ discard block |
||
| 5596 | 5596 | * @return array |
| 5597 | 5597 | */ |
| 5598 | 5598 | function filtre_objet_lister_enfants_par_type_dist($objet, $id_objet) { |
| 5599 | - return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_enfants_par_type'); |
|
| 5599 | + return helper_filtre_objet_lister_enfants_ou_parents($objet, $id_objet, 'objet_lister_enfants_par_type'); |
|
| 5600 | 5600 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | if (is_callable($f)) { |
| 102 | 102 | return $f; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // affichage "GIT [master: abcdef]" |
| 232 | 232 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 233 | 233 | if ($desc['branch']) { |
| 234 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 234 | + $commit = $desc['branch'].': '.$commit; |
|
| 235 | 235 | } |
| 236 | 236 | return "{$desc['vcs']} [$commit]"; |
| 237 | 237 | } |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // version installee par GIT |
| 253 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 253 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 254 | 254 | $currentHead = trim(substr($c, 4)); |
| 255 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 255 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 256 | 256 | return [ |
| 257 | 257 | 'vcs' => 'GIT', |
| 258 | 258 | 'branch' => basename($currentHead), |
@@ -267,12 +267,12 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 269 | 269 | // et laisser passer les fonctions personnelles baptisees image_... |
| 270 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 271 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 272 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 273 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 274 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 275 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 270 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 271 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 272 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 273 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 274 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 275 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 276 | 276 | |
| 277 | 277 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 278 | 278 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | function filtre_debug($val, $key = null) { |
| 433 | 433 | $debug = ( |
| 434 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 435 | - ) . var_export($val, true); |
|
| 434 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 435 | + ).var_export($val, true); |
|
| 436 | 436 | |
| 437 | 437 | include_spip('inc/autoriser'); |
| 438 | 438 | if (autoriser('webmestre')) { |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $is_file = false; |
| 489 | 489 | } |
| 490 | 490 | if ($is_file) { |
| 491 | - $is_local_file = function ($path) { |
|
| 491 | + $is_local_file = function($path) { |
|
| 492 | 492 | if (strpos($path, '?') !== false) { |
| 493 | 493 | $path = supprimer_timestamp($path); |
| 494 | 494 | // remove ?24px added by find_in_theme on .svg files |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 538 | 538 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 539 | 539 | $srcover = $match[1]; |
| 540 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 540 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 541 | 541 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 542 | 542 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 543 | 543 | } |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | // " -> " et tout ce genre de choses |
| 940 | 940 | $u = $GLOBALS['meta']['pcre_u']; |
| 941 | 941 | $texte = str_replace(' ', ' ', $texte); |
| 942 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 942 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 943 | 943 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 944 | 944 | $texte = entites_html($texte, false, false); |
| 945 | 945 | // mais bien echapper les double quotes ! |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | return ''; |
| 1002 | 1002 | } |
| 1003 | 1003 | return preg_replace( |
| 1004 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1004 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1005 | 1005 | '', |
| 1006 | 1006 | $texte |
| 1007 | 1007 | ); |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | if ( |
| 1031 | 1031 | $texte and |
| 1032 | 1032 | preg_match( |
| 1033 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1033 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1034 | 1034 | $texte, |
| 1035 | 1035 | $regs |
| 1036 | 1036 | ) |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | **/ |
| 1122 | 1122 | function textebrut($texte) { |
| 1123 | 1123 | $u = $GLOBALS['meta']['pcre_u']; |
| 1124 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1125 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1124 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1125 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1126 | 1126 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1127 | 1127 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1128 | 1128 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | ) |
| 1157 | 1157 | ) { |
| 1158 | 1158 | foreach ($liens[0] as $a) { |
| 1159 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1159 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1160 | 1160 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1161 | 1161 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1162 | 1162 | $texte = str_replace($a, $ablank, $texte); |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | foreach ($regs[0] as $a) { |
| 1182 | 1182 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1183 | 1183 | if (strpos($rel, 'nofollow') === false) { |
| 1184 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1184 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1185 | 1185 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1186 | 1186 | $texte = str_replace($a, $anofollow, $texte); |
| 1187 | 1187 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $u = $GLOBALS['meta']['pcre_u']; |
| 1211 | 1211 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1212 | 1212 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1213 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1213 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1214 | 1214 | |
| 1215 | 1215 | return $texte; |
| 1216 | 1216 | } |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | return $texte; |
| 1242 | 1242 | } |
| 1243 | 1243 | include_spip('inc/texte'); |
| 1244 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1244 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1245 | 1245 | 'div' : 'span'; |
| 1246 | 1246 | |
| 1247 | 1247 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | |
| 1333 | 1333 | // Calcul de la taille et choix de l'unité |
| 1334 | 1334 | $affichage = _T( |
| 1335 | - 'spip:taille_' . $unites[$puissance] . $suffixe_item, |
|
| 1335 | + 'spip:taille_'.$unites[$puissance].$suffixe_item, |
|
| 1336 | 1336 | [ |
| 1337 | 1337 | 'taille' => round($octets / pow($kilo, $puissance), $precisions[$puissance]) |
| 1338 | 1338 | ] |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | } |
| 1367 | 1367 | $u = $GLOBALS['meta']['pcre_u']; |
| 1368 | 1368 | if ($textebrut) { |
| 1369 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1369 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1370 | 1370 | } |
| 1371 | 1371 | $texte = texte_backend($texte); |
| 1372 | 1372 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | # un message pour abs_url |
| 1402 | 1402 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1403 | 1403 | $url = trim($url); |
| 1404 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1404 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1405 | 1405 | |
| 1406 | 1406 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1407 | 1407 | } |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | |
| 1609 | 1609 | $debut = ''; |
| 1610 | 1610 | $suite = $texte; |
| 1611 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1611 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1612 | 1612 | $debut .= substr($suite, 0, $t - 1); |
| 1613 | 1613 | $suite = substr($suite, $t); |
| 1614 | 1614 | $car = substr($suite, 0, 1); |
@@ -1626,7 +1626,7 @@ discard block |
||
| 1626 | 1626 | $suite = substr($suite, strlen($regs[0])); |
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | - $texte = $debut . $suite; |
|
| 1629 | + $texte = $debut.$suite; |
|
| 1630 | 1630 | |
| 1631 | 1631 | if ($collecteurModeles) { |
| 1632 | 1632 | $texte = $collecteurModeles->retablir($texte); |
@@ -1634,7 +1634,7 @@ discard block |
||
| 1634 | 1634 | |
| 1635 | 1635 | $texte = echappe_retour($texte); |
| 1636 | 1636 | |
| 1637 | - return $texte . $fin; |
|
| 1637 | + return $texte.$fin; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | |
@@ -1910,7 +1910,7 @@ discard block |
||
| 1910 | 1910 | if (is_array($balise)) { |
| 1911 | 1911 | array_walk( |
| 1912 | 1912 | $balise, |
| 1913 | - function (&$a, $key, $t) { |
|
| 1913 | + function(&$a, $key, $t) { |
|
| 1914 | 1914 | $a = extraire_attribut($a, $t); |
| 1915 | 1915 | }, |
| 1916 | 1916 | $attribut |
@@ -2008,14 +2008,14 @@ discard block |
||
| 2008 | 2008 | |
| 2009 | 2009 | if ($old !== null) { |
| 2010 | 2010 | // Remplacer l'ancien attribut du meme nom |
| 2011 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2011 | + $balise = $r[1].$insert.$r[5]; |
|
| 2012 | 2012 | } else { |
| 2013 | 2013 | // preferer une balise " />" (comme <img />) |
| 2014 | 2014 | if (preg_match(',/>,', $balise)) { |
| 2015 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2015 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2016 | 2016 | } // sinon une balise <a ...> ... </a> |
| 2017 | 2017 | else { |
| 2018 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2018 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2019 | 2019 | } |
| 2020 | 2020 | } |
| 2021 | 2021 | |
@@ -2070,7 +2070,7 @@ discard block |
||
| 2070 | 2070 | if ( |
| 2071 | 2071 | $class_courante |
| 2072 | 2072 | and str_contains($class_courante, (string) $c) |
| 2073 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2073 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2074 | 2074 | ) { |
| 2075 | 2075 | $is_class_presente = true; |
| 2076 | 2076 | } |
@@ -2078,12 +2078,12 @@ discard block |
||
| 2078 | 2078 | in_array($operation, ['ajouter', 'commuter']) |
| 2079 | 2079 | and !$is_class_presente |
| 2080 | 2080 | ) { |
| 2081 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2081 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2082 | 2082 | } elseif ( |
| 2083 | 2083 | in_array($operation, ['supprimer', 'commuter']) |
| 2084 | 2084 | and $is_class_presente |
| 2085 | 2085 | ) { |
| 2086 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2086 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2087 | 2087 | } |
| 2088 | 2088 | } |
| 2089 | 2089 | |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | // Quelques fonctions de calcul arithmetique |
| 2147 | 2147 | // |
| 2148 | 2148 | function floatstr($a) { |
| 2149 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2149 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2150 | 2150 | } |
| 2151 | 2151 | function strize($f, $a, $b) { |
| 2152 | 2152 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2287,13 +2287,13 @@ discard block |
||
| 2287 | 2287 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2288 | 2288 | define('_TAGS_NOM_AUTEUR', ''); |
| 2289 | 2289 | } |
| 2290 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2290 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2291 | 2291 | foreach ($tags_acceptes as $tag) { |
| 2292 | 2292 | if (strlen($tag)) { |
| 2293 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2294 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2295 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2296 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2293 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2294 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2295 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2296 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2297 | 2297 | } |
| 2298 | 2298 | } |
| 2299 | 2299 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2413,10 +2413,10 @@ discard block |
||
| 2413 | 2413 | $fichier = basename($url); |
| 2414 | 2414 | |
| 2415 | 2415 | return '<a rel="enclosure"' |
| 2416 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2417 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2418 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2419 | - . '>' . $fichier . '</a>'; |
|
| 2416 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2417 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2418 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2419 | + . '>'.$fichier.'</a>'; |
|
| 2420 | 2420 | } |
| 2421 | 2421 | |
| 2422 | 2422 | /** |
@@ -2444,9 +2444,9 @@ discard block |
||
| 2444 | 2444 | } # vieux data |
| 2445 | 2445 | $fichier = basename($url); |
| 2446 | 2446 | $enclosures[] = '<enclosure' |
| 2447 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2448 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2449 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2447 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2448 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2449 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2450 | 2450 | . ' />'; |
| 2451 | 2451 | } |
| 2452 | 2452 | } |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2473 | 2473 | $subjects .= '<dc:subject>' |
| 2474 | 2474 | . texte_backend(textebrut($e)) |
| 2475 | - . '</dc:subject>' . "\n"; |
|
| 2475 | + . '</dc:subject>'."\n"; |
|
| 2476 | 2476 | } |
| 2477 | 2477 | } |
| 2478 | 2478 | |
@@ -2508,7 +2508,7 @@ discard block |
||
| 2508 | 2508 | if (is_array($texte)) { |
| 2509 | 2509 | array_walk( |
| 2510 | 2510 | $texte, |
| 2511 | - function (&$a, $key, $t) { |
|
| 2511 | + function(&$a, $key, $t) { |
|
| 2512 | 2512 | $a = extraire_balise($a, $t); |
| 2513 | 2513 | }, |
| 2514 | 2514 | $tag |
@@ -2556,7 +2556,7 @@ discard block |
||
| 2556 | 2556 | if (is_array($texte)) { |
| 2557 | 2557 | array_walk( |
| 2558 | 2558 | $texte, |
| 2559 | - function (&$a, $key, $t) { |
|
| 2559 | + function(&$a, $key, $t) { |
|
| 2560 | 2560 | $a = extraire_balises($a, $t); |
| 2561 | 2561 | }, |
| 2562 | 2562 | $tag |
@@ -2689,7 +2689,7 @@ discard block |
||
| 2689 | 2689 | if ($fond != '404') { |
| 2690 | 2690 | $contexte = array_shift($p); |
| 2691 | 2691 | $contexte['page'] = $fond; |
| 2692 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2692 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2693 | 2693 | } |
| 2694 | 2694 | } |
| 2695 | 2695 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2744,9 +2744,9 @@ discard block |
||
| 2744 | 2744 | . '"' |
| 2745 | 2745 | . (is_null($val) |
| 2746 | 2746 | ? '' |
| 2747 | - : ' value="' . entites_html($val) . '"' |
|
| 2747 | + : ' value="'.entites_html($val).'"' |
|
| 2748 | 2748 | ) |
| 2749 | - . ' type="hidden"' . "\n/>"; |
|
| 2749 | + . ' type="hidden"'."\n/>"; |
|
| 2750 | 2750 | } |
| 2751 | 2751 | |
| 2752 | 2752 | return join('', $hidden); |
@@ -2856,7 +2856,7 @@ discard block |
||
| 2856 | 2856 | |
| 2857 | 2857 | return preg_replace_callback( |
| 2858 | 2858 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2859 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2859 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2860 | 2860 | $contenu |
| 2861 | 2861 | ); |
| 2862 | 2862 | } |
@@ -2917,14 +2917,14 @@ discard block |
||
| 2917 | 2917 | ) { |
| 2918 | 2918 | $distant = true; |
| 2919 | 2919 | $cssf = parse_url($css); |
| 2920 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2920 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2921 | 2921 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2922 | 2922 | } else { |
| 2923 | 2923 | $distant = false; |
| 2924 | 2924 | $cssf = $css; |
| 2925 | 2925 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2926 | 2926 | //propose (rien a faire dans ce cas) |
| 2927 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2927 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2928 | 2928 | if (@file_exists($f)) { |
| 2929 | 2929 | return $f; |
| 2930 | 2930 | } |
@@ -2934,7 +2934,7 @@ discard block |
||
| 2934 | 2934 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2935 | 2935 | $f = $dir_var |
| 2936 | 2936 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2937 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2937 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2938 | 2938 | |
| 2939 | 2939 | // la css peut etre distante (url absolue !) |
| 2940 | 2940 | if ($distant) { |
@@ -2980,8 +2980,8 @@ discard block |
||
| 2980 | 2980 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2981 | 2981 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2982 | 2982 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2983 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2984 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2983 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 2984 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 2985 | 2985 | } |
| 2986 | 2986 | $src[] = $regs[0][$k]; |
| 2987 | 2987 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3030,7 +3030,7 @@ discard block |
||
| 3030 | 3030 | |
| 3031 | 3031 | $f = basename($css, '.css'); |
| 3032 | 3032 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3033 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3033 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3034 | 3034 | . '.css'; |
| 3035 | 3035 | |
| 3036 | 3036 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3040,7 +3040,7 @@ discard block |
||
| 3040 | 3040 | if ($url_absolue_css == $css) { |
| 3041 | 3041 | if ( |
| 3042 | 3042 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3043 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3043 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3044 | 3044 | ) { |
| 3045 | 3045 | include_spip('inc/distant'); |
| 3046 | 3046 | $contenu = recuperer_url($css); |
@@ -3152,7 +3152,7 @@ discard block |
||
| 3152 | 3152 | $expression = str_replace('\/', '/', $expression); |
| 3153 | 3153 | $expression = str_replace('/', '\/', $expression); |
| 3154 | 3154 | |
| 3155 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3155 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3156 | 3156 | if (isset($r[$capte])) { |
| 3157 | 3157 | return $r[$capte]; |
| 3158 | 3158 | } else { |
@@ -3190,7 +3190,7 @@ discard block |
||
| 3190 | 3190 | $expression = str_replace('\/', '/', $expression); |
| 3191 | 3191 | $expression = str_replace('/', '\/', $expression); |
| 3192 | 3192 | |
| 3193 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3193 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3194 | 3194 | } |
| 3195 | 3195 | |
| 3196 | 3196 | |
@@ -3209,7 +3209,7 @@ discard block |
||
| 3209 | 3209 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3210 | 3210 | |
| 3211 | 3211 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3212 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3212 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3213 | 3213 | |
| 3214 | 3214 | if ( |
| 3215 | 3215 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3223,7 +3223,7 @@ discard block |
||
| 3223 | 3223 | if (!isset($doublons['documents'])) { |
| 3224 | 3224 | $doublons['documents'] = ''; |
| 3225 | 3225 | } |
| 3226 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3226 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3227 | 3227 | } |
| 3228 | 3228 | |
| 3229 | 3229 | return $letexte; |
@@ -3280,7 +3280,7 @@ discard block |
||
| 3280 | 3280 | if ($env) { |
| 3281 | 3281 | foreach ($env as $i => $j) { |
| 3282 | 3282 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3283 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3283 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3284 | 3284 | } |
| 3285 | 3285 | } |
| 3286 | 3286 | } |
@@ -3319,7 +3319,7 @@ discard block |
||
| 3319 | 3319 | if ($env) { |
| 3320 | 3320 | foreach ($env as $i => $j) { |
| 3321 | 3321 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3322 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3322 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3323 | 3323 | } |
| 3324 | 3324 | } |
| 3325 | 3325 | } |
@@ -3393,10 +3393,10 @@ discard block |
||
| 3393 | 3393 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3394 | 3394 | if ( |
| 3395 | 3395 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3396 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3396 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3397 | 3397 | and file_exists($variante_svg_generique) |
| 3398 | 3398 | ) { |
| 3399 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3399 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3400 | 3400 | $img_file = $variante_svg_size; |
| 3401 | 3401 | } |
| 3402 | 3402 | else { |
@@ -3454,7 +3454,7 @@ discard block |
||
| 3454 | 3454 | return ''; |
| 3455 | 3455 | } |
| 3456 | 3456 | } |
| 3457 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3457 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3458 | 3458 | } |
| 3459 | 3459 | |
| 3460 | 3460 | if (file_exists($img_file)) { |
@@ -3464,14 +3464,14 @@ discard block |
||
| 3464 | 3464 | $alt = ''; |
| 3465 | 3465 | } |
| 3466 | 3466 | elseif ($alt or $alt === '') { |
| 3467 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3467 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3468 | 3468 | } |
| 3469 | 3469 | else { |
| 3470 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3470 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3471 | 3471 | } |
| 3472 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3473 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3474 | - . ' ' . ltrim($atts) |
|
| 3472 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3473 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3474 | + . ' '.ltrim($atts) |
|
| 3475 | 3475 | . ' />'; |
| 3476 | 3476 | } |
| 3477 | 3477 | |
@@ -3485,10 +3485,10 @@ discard block |
||
| 3485 | 3485 | */ |
| 3486 | 3486 | function http_style_background($img, $att = '', $size = null) { |
| 3487 | 3487 | if ($size and is_numeric($size)) { |
| 3488 | - $size = trim($size) . 'px'; |
|
| 3488 | + $size = trim($size).'px'; |
|
| 3489 | 3489 | } |
| 3490 | - return " style='background" . |
|
| 3491 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3490 | + return " style='background". |
|
| 3491 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3492 | 3492 | . ($size ? "background-size:{$size};" : '') |
| 3493 | 3493 | . "'"; |
| 3494 | 3494 | } |
@@ -3603,7 +3603,7 @@ discard block |
||
| 3603 | 3603 | $img = http_img_pack( |
| 3604 | 3604 | $img, |
| 3605 | 3605 | $alt, |
| 3606 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3606 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3607 | 3607 | '', |
| 3608 | 3608 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3609 | 3609 | ); |
@@ -3688,7 +3688,7 @@ discard block |
||
| 3688 | 3688 | $balise_svg_source = $balise_svg; |
| 3689 | 3689 | |
| 3690 | 3690 | // entete XML à supprimer |
| 3691 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3691 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3692 | 3692 | |
| 3693 | 3693 | // IE est toujours mon ami |
| 3694 | 3694 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3706,9 +3706,9 @@ discard block |
||
| 3706 | 3706 | // regler le alt |
| 3707 | 3707 | if ($alt) { |
| 3708 | 3708 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3709 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3709 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3710 | 3710 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3711 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3711 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3712 | 3712 | $balise_svg .= $title; |
| 3713 | 3713 | } |
| 3714 | 3714 | else { |
@@ -3756,7 +3756,7 @@ discard block |
||
| 3756 | 3756 | if (is_array($tableau)) { |
| 3757 | 3757 | foreach ($tableau as $k => $v) { |
| 3758 | 3758 | $res = recuperer_fond( |
| 3759 | - 'modeles/' . $modele, |
|
| 3759 | + 'modeles/'.$modele, |
|
| 3760 | 3760 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3761 | 3761 | ); |
| 3762 | 3762 | $texte .= $res; |
@@ -3941,7 +3941,7 @@ discard block |
||
| 3941 | 3941 | } |
| 3942 | 3942 | |
| 3943 | 3943 | $c = serialize($c); |
| 3944 | - $cle = calculer_cle_action($form . $c); |
|
| 3944 | + $cle = calculer_cle_action($form.$c); |
|
| 3945 | 3945 | $c = "$cle:$c"; |
| 3946 | 3946 | |
| 3947 | 3947 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3999,15 +3999,15 @@ discard block |
||
| 3999 | 3999 | } |
| 4000 | 4000 | // toujours encoder l'url source dans le bloc ajax |
| 4001 | 4001 | $r = self(); |
| 4002 | - $r = ' data-origin="' . $r . '"'; |
|
| 4002 | + $r = ' data-origin="'.$r.'"'; |
|
| 4003 | 4003 | $class = 'ajaxbloc'; |
| 4004 | 4004 | if ($ajaxid and is_string($ajaxid)) { |
| 4005 | 4005 | // ajaxid est normalement conforme a un nom de classe css |
| 4006 | 4006 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4007 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4007 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4008 | 4008 | } |
| 4009 | 4009 | |
| 4010 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4010 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4011 | 4011 | } |
| 4012 | 4012 | |
| 4013 | 4013 | /** |
@@ -4051,7 +4051,7 @@ discard block |
||
| 4051 | 4051 | $cle = substr($c, 0, $p); |
| 4052 | 4052 | $c = substr($c, $p + 1); |
| 4053 | 4053 | |
| 4054 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4054 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4055 | 4055 | $env = @unserialize($c); |
| 4056 | 4056 | return $env; |
| 4057 | 4057 | } |
@@ -4172,13 +4172,13 @@ discard block |
||
| 4172 | 4172 | } |
| 4173 | 4173 | } |
| 4174 | 4174 | } |
| 4175 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4175 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4176 | 4176 | } else { |
| 4177 | 4177 | $bal = 'a'; |
| 4178 | 4178 | $att = "href='$url'" |
| 4179 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4180 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4181 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4179 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4180 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4181 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4182 | 4182 | . $evt; |
| 4183 | 4183 | } |
| 4184 | 4184 | if ($libelle === null) { |
@@ -4317,7 +4317,7 @@ discard block |
||
| 4317 | 4317 | |
| 4318 | 4318 | // Icône |
| 4319 | 4319 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4320 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4320 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4321 | 4321 | |
| 4322 | 4322 | // Markup final |
| 4323 | 4323 | if ($type == 'lien') { |
@@ -4592,20 +4592,20 @@ discard block |
||
| 4592 | 4592 | $class_form = 'ajax'; |
| 4593 | 4593 | $class = str_replace('ajax', '', $class); |
| 4594 | 4594 | } |
| 4595 | - $class_btn = 'submit ' . trim($class); |
|
| 4595 | + $class_btn = 'submit '.trim($class); |
|
| 4596 | 4596 | |
| 4597 | 4597 | if ($confirm) { |
| 4598 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4598 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4599 | 4599 | if ($callback) { |
| 4600 | 4600 | $callback = "$confirm?($callback):false"; |
| 4601 | 4601 | } else { |
| 4602 | 4602 | $callback = $confirm; |
| 4603 | 4603 | } |
| 4604 | 4604 | } |
| 4605 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4605 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4606 | 4606 | $title = $title ? " title='$title'" : ''; |
| 4607 | 4607 | |
| 4608 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4608 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4609 | 4609 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4610 | 4610 | } |
| 4611 | 4611 | |
@@ -4670,14 +4670,14 @@ discard block |
||
| 4670 | 4670 | $champ_titre = ''; |
| 4671 | 4671 | if ($demande_titre) { |
| 4672 | 4672 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4673 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4673 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4674 | 4674 | } |
| 4675 | 4675 | include_spip('base/abstract_sql'); |
| 4676 | 4676 | include_spip('base/connect_sql'); |
| 4677 | 4677 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4678 | - '*' . $champ_titre, |
|
| 4678 | + '*'.$champ_titre, |
|
| 4679 | 4679 | $desc['table_sql'], |
| 4680 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4680 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4681 | 4681 | ); |
| 4682 | 4682 | |
| 4683 | 4683 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4770,8 +4770,7 @@ discard block |
||
| 4770 | 4770 | if (isset($ligne_sql['chapo'])) { |
| 4771 | 4771 | $chapo = $ligne_sql['chapo']; |
| 4772 | 4772 | $texte = strlen($descriptif) ? |
| 4773 | - '' : |
|
| 4774 | - "$chapo \n\n $texte"; |
|
| 4773 | + '' : "$chapo \n\n $texte"; |
|
| 4775 | 4774 | } |
| 4776 | 4775 | |
| 4777 | 4776 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4846,7 +4845,7 @@ discard block |
||
| 4846 | 4845 | return $texte; |
| 4847 | 4846 | } |
| 4848 | 4847 | |
| 4849 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4848 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4850 | 4849 | |
| 4851 | 4850 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4852 | 4851 | if (test_espace_prive()) { |
@@ -4885,7 +4884,7 @@ discard block |
||
| 4885 | 4884 | } |
| 4886 | 4885 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4887 | 4886 | |
| 4888 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4887 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4889 | 4888 | } |
| 4890 | 4889 | |
| 4891 | 4890 | /** |
@@ -4911,10 +4910,10 @@ discard block |
||
| 4911 | 4910 | function wrap($texte, $wrap) { |
| 4912 | 4911 | $balises = extraire_balises($wrap); |
| 4913 | 4912 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4914 | - $texte = $wrap . $texte; |
|
| 4913 | + $texte = $wrap.$texte; |
|
| 4915 | 4914 | $regs = array_reverse($regs[1]); |
| 4916 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4917 | - $texte = $texte . $wrap; |
|
| 4915 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4916 | + $texte = $texte.$wrap; |
|
| 4918 | 4917 | } |
| 4919 | 4918 | |
| 4920 | 4919 | return $texte; |
@@ -4945,7 +4944,7 @@ discard block |
||
| 4945 | 4944 | |
| 4946 | 4945 | // caster $u en array si besoin |
| 4947 | 4946 | if (is_object($u)) { |
| 4948 | - $u = (array)$u; |
|
| 4947 | + $u = (array) $u; |
|
| 4949 | 4948 | } |
| 4950 | 4949 | |
| 4951 | 4950 | if (is_array($u)) { |
@@ -4967,7 +4966,7 @@ discard block |
||
| 4967 | 4966 | // sinon on passe a la ligne et on indente |
| 4968 | 4967 | $i_str = str_pad('', $indent, ' '); |
| 4969 | 4968 | foreach ($u as $k => $v) { |
| 4970 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4969 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4971 | 4970 | } |
| 4972 | 4971 | |
| 4973 | 4972 | return $out; |
@@ -5021,7 +5020,7 @@ discard block |
||
| 5021 | 5020 | * @return string |
| 5022 | 5021 | */ |
| 5023 | 5022 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5024 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5023 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5025 | 5024 | $icone = chemin_image($icone); |
| 5026 | 5025 | $balise_img = charger_filtre('balise_img'); |
| 5027 | 5026 | |
@@ -5047,7 +5046,7 @@ discard block |
||
| 5047 | 5046 | */ |
| 5048 | 5047 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5049 | 5048 | $chaine = explode(':', $chaine); |
| 5050 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5049 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5051 | 5050 | return $t; |
| 5052 | 5051 | } |
| 5053 | 5052 | $chaine = implode(':', $chaine); |
@@ -5113,7 +5112,7 @@ discard block |
||
| 5113 | 5112 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5114 | 5113 | |
| 5115 | 5114 | // calculer le nom de la css |
| 5116 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5115 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5117 | 5116 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5118 | 5117 | $contexte_implicite = calculer_contexte_implicite(); |
| 5119 | 5118 | |
@@ -5121,14 +5120,14 @@ discard block |
||
| 5121 | 5120 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5122 | 5121 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5123 | 5122 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5124 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5123 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5125 | 5124 | } |
| 5126 | 5125 | else { |
| 5127 | 5126 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5128 | 5127 | ksort($contexte); |
| 5129 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5128 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5130 | 5129 | } |
| 5131 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5130 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5132 | 5131 | |
| 5133 | 5132 | // mettre a jour le fichier si il n'existe pas |
| 5134 | 5133 | // ou trop ancien |
@@ -5136,8 +5135,8 @@ discard block |
||
| 5136 | 5135 | // et recopie sur le fichier cible uniquement si il change |
| 5137 | 5136 | if ( |
| 5138 | 5137 | !file_exists($filename) |
| 5139 | - or !file_exists($filename . '.last') |
|
| 5140 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5138 | + or !file_exists($filename.'.last') |
|
| 5139 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5141 | 5140 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5142 | 5141 | ) { |
| 5143 | 5142 | $contenu = $cache['texte']; |
@@ -5161,10 +5160,10 @@ discard block |
||
| 5161 | 5160 | } |
| 5162 | 5161 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5163 | 5162 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5164 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5163 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5165 | 5164 | } |
| 5166 | 5165 | // et ecrire le fichier si il change |
| 5167 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5166 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5168 | 5167 | } |
| 5169 | 5168 | |
| 5170 | 5169 | return timestamp($filename); |
@@ -5397,7 +5396,7 @@ discard block |
||
| 5397 | 5396 | if ($e > 0 and strlen($mid) > 8) { |
| 5398 | 5397 | $mid = '***...***'; |
| 5399 | 5398 | } |
| 5400 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5399 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5401 | 5400 | } |
| 5402 | 5401 | |
| 5403 | 5402 | |
@@ -5459,7 +5458,7 @@ discard block |
||
| 5459 | 5458 | case 'id': |
| 5460 | 5459 | case 'anchor': |
| 5461 | 5460 | if (preg_match(',^\d,', $texte)) { |
| 5462 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5461 | + $texte = substr($type, 0, 1).$texte; |
|
| 5463 | 5462 | } |
| 5464 | 5463 | } |
| 5465 | 5464 | |
@@ -5469,9 +5468,9 @@ discard block |
||
| 5469 | 5468 | |
| 5470 | 5469 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5471 | 5470 | if (preg_match(',^\d,', $texte)) { |
| 5472 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5471 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5473 | 5472 | } |
| 5474 | - $texte .= $separateur . md5($original); |
|
| 5473 | + $texte .= $separateur.md5($original); |
|
| 5475 | 5474 | $texte = substr($texte, 0, $longueur_mini); |
| 5476 | 5475 | } |
| 5477 | 5476 | |
@@ -2,248 +2,248 @@ discard block |
||
| 2 | 2 | // This is a SPIP language file -- Ceci est un fichier langue de SPIP |
| 3 | 3 | // Fichier source, a modifier dans https://git.spip.net/spip/spip.git |
| 4 | 4 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 5 | - return; |
|
| 5 | + return; |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | $GLOBALS[$GLOBALS['idx_lang']] = array( |
| 9 | 9 | |
| 10 | - // A |
|
| 11 | - 'access_interface_graphique' => 'Retour à l’interface graphique complète', |
|
| 12 | - 'access_mode_texte' => 'Afficher l’interface textuelle simplifiée', |
|
| 13 | - 'admin_debug' => 'debug', |
|
| 14 | - 'admin_modifier_article' => 'Modifier cet article', |
|
| 15 | - 'admin_modifier_auteur' => 'Modifier cet auteur', |
|
| 16 | - 'admin_modifier_breve' => 'Modifier cette brève', |
|
| 17 | - 'admin_modifier_mot' => 'Modifier ce mot-clé', |
|
| 18 | - 'admin_modifier_rubrique' => 'Modifier cette rubrique', |
|
| 19 | - 'admin_recalculer' => 'Recalculer cette page', |
|
| 20 | - 'afficher_calendrier' => 'Afficher le calendrier', |
|
| 21 | - 'afficher_trad' => 'afficher les traductions', |
|
| 22 | - 'alerte_maj_impossible' => '<b>Alerte !</b> La mise à jour de la base SQL vers la version @version@ est impossible, peut-être à cause d’un problème de droit de modification sur la base de données. Veuillez contacter votre hébergeur.', |
|
| 23 | - 'alerte_modif_info_concourante' => 'ATTENTION : Cette information a été modifiée par ailleurs. La valeur actuelle est :', |
|
| 24 | - 'analyse_xml' => 'Analyse XML', |
|
| 25 | - 'annuler' => 'Annuler', |
|
| 26 | - 'antispam_champ_vide' => 'Veuillez laisser ce champ vide :', |
|
| 27 | - 'articles_recents' => 'Articles les plus récents', |
|
| 28 | - 'attention_champ_mini_nb_caractères' => 'Attention ! @nb@ caractères au minimum', |
|
| 29 | - 'avis_1_erreur_saisie' => 'Il y a 1 erreur dans votre saisie, veuillez vérifier les informations.', |
|
| 30 | - 'avis_archive_incorrect' => 'le fichier archive n’est pas un fichier SPIP', |
|
| 31 | - 'avis_archive_invalide' => 'le fichier archive n’est pas valide', |
|
| 32 | - 'avis_attention' => 'ATTENTION !', |
|
| 33 | - 'avis_champ_incorrect_type_objet' => 'Nom de champ incorrect @name@ pour objet de type @type@', |
|
| 34 | - 'avis_colonne_inexistante' => 'La colonne @col@ n’existe pas', |
|
| 35 | - 'avis_erreur' => 'Erreur : voir ci-dessous', |
|
| 36 | - 'avis_erreur_connexion' => 'Erreur de connexion', |
|
| 37 | - 'avis_erreur_cookie' => 'problème de cookie', |
|
| 38 | - 'avis_erreur_fonction_contexte' => 'Erreur de programmation. Cette fonction ne doit pas être appelée dans ce contexte.', |
|
| 39 | - 'avis_erreur_mysql' => 'Erreur SQL', |
|
| 40 | - 'avis_erreur_sauvegarde' => 'Erreur dans la sauvegarde (@type@ @id_objet@) !', |
|
| 41 | - 'avis_erreur_visiteur' => 'Problème d’accès à l’espace privé', |
|
| 42 | - 'avis_nb_erreurs_saisie' => 'Il y a @nb@ erreurs dans votre saisie, veuillez vérifier les informations.', |
|
| 10 | + // A |
|
| 11 | + 'access_interface_graphique' => 'Retour à l’interface graphique complète', |
|
| 12 | + 'access_mode_texte' => 'Afficher l’interface textuelle simplifiée', |
|
| 13 | + 'admin_debug' => 'debug', |
|
| 14 | + 'admin_modifier_article' => 'Modifier cet article', |
|
| 15 | + 'admin_modifier_auteur' => 'Modifier cet auteur', |
|
| 16 | + 'admin_modifier_breve' => 'Modifier cette brève', |
|
| 17 | + 'admin_modifier_mot' => 'Modifier ce mot-clé', |
|
| 18 | + 'admin_modifier_rubrique' => 'Modifier cette rubrique', |
|
| 19 | + 'admin_recalculer' => 'Recalculer cette page', |
|
| 20 | + 'afficher_calendrier' => 'Afficher le calendrier', |
|
| 21 | + 'afficher_trad' => 'afficher les traductions', |
|
| 22 | + 'alerte_maj_impossible' => '<b>Alerte !</b> La mise à jour de la base SQL vers la version @version@ est impossible, peut-être à cause d’un problème de droit de modification sur la base de données. Veuillez contacter votre hébergeur.', |
|
| 23 | + 'alerte_modif_info_concourante' => 'ATTENTION : Cette information a été modifiée par ailleurs. La valeur actuelle est :', |
|
| 24 | + 'analyse_xml' => 'Analyse XML', |
|
| 25 | + 'annuler' => 'Annuler', |
|
| 26 | + 'antispam_champ_vide' => 'Veuillez laisser ce champ vide :', |
|
| 27 | + 'articles_recents' => 'Articles les plus récents', |
|
| 28 | + 'attention_champ_mini_nb_caractères' => 'Attention ! @nb@ caractères au minimum', |
|
| 29 | + 'avis_1_erreur_saisie' => 'Il y a 1 erreur dans votre saisie, veuillez vérifier les informations.', |
|
| 30 | + 'avis_archive_incorrect' => 'le fichier archive n’est pas un fichier SPIP', |
|
| 31 | + 'avis_archive_invalide' => 'le fichier archive n’est pas valide', |
|
| 32 | + 'avis_attention' => 'ATTENTION !', |
|
| 33 | + 'avis_champ_incorrect_type_objet' => 'Nom de champ incorrect @name@ pour objet de type @type@', |
|
| 34 | + 'avis_colonne_inexistante' => 'La colonne @col@ n’existe pas', |
|
| 35 | + 'avis_erreur' => 'Erreur : voir ci-dessous', |
|
| 36 | + 'avis_erreur_connexion' => 'Erreur de connexion', |
|
| 37 | + 'avis_erreur_cookie' => 'problème de cookie', |
|
| 38 | + 'avis_erreur_fonction_contexte' => 'Erreur de programmation. Cette fonction ne doit pas être appelée dans ce contexte.', |
|
| 39 | + 'avis_erreur_mysql' => 'Erreur SQL', |
|
| 40 | + 'avis_erreur_sauvegarde' => 'Erreur dans la sauvegarde (@type@ @id_objet@) !', |
|
| 41 | + 'avis_erreur_visiteur' => 'Problème d’accès à l’espace privé', |
|
| 42 | + 'avis_nb_erreurs_saisie' => 'Il y a @nb@ erreurs dans votre saisie, veuillez vérifier les informations.', |
|
| 43 | 43 | |
| 44 | - // B |
|
| 45 | - 'barre_a_accent_grave' => 'Insérer un A accent grave majuscule', |
|
| 46 | - 'barre_aide' => 'Utilisez les raccourcis typographiques pour enrichir votre mise en page', |
|
| 47 | - 'barre_e_accent_aigu' => 'Insérer un E accent aigu majuscule', |
|
| 48 | - 'barre_eo' => 'Insérer un E dans l’O', |
|
| 49 | - 'barre_eo_maj' => 'Insérer un E dans l’O majuscule', |
|
| 50 | - 'barre_euro' => 'Insérer le symbole €', |
|
| 51 | - 'barre_gras' => 'Mettre en {{gras}}', |
|
| 52 | - 'barre_guillemets' => 'Entourer de « guillemets »', |
|
| 53 | - 'barre_guillemets_simples' => 'Entourer de “guillemets de second niveau”', |
|
| 54 | - 'barre_intertitre' => 'Transformer en {{{intertitre}}}', |
|
| 55 | - 'barre_italic' => 'Mettre en {italique}', |
|
| 56 | - 'barre_lien' => 'Transformer en [lien hypertexte->http://...]', |
|
| 57 | - 'barre_lien_input' => 'Veuillez indiquer l’adresse de votre lien (vous pouvez indiquer une adresse Web sous la forme http://www.monsite/com ou simplement indiquer le numéro d’un article de ce site.', |
|
| 58 | - 'barre_note' => 'Transformer en [[Note de bas de page]]', |
|
| 59 | - 'barre_paragraphe' => 'Créer un paragraphe', |
|
| 60 | - 'barre_quote' => '<quote>Citer un message</quote>', |
|
| 61 | - 'bouton_changer' => 'Changer', |
|
| 62 | - 'bouton_chercher' => 'Chercher', |
|
| 63 | - 'bouton_choisir' => 'Choisir', |
|
| 64 | - 'bouton_deplacer' => 'Déplacer', |
|
| 65 | - 'bouton_download' => 'Télécharger', |
|
| 66 | - 'bouton_enregistrer' => 'Enregistrer', |
|
| 67 | - 'bouton_radio_desactiver_messagerie_interne' => 'Désactiver la messagerie interne', |
|
| 68 | - 'bouton_radio_envoi_annonces' => 'Envoyer les annonces éditoriales', |
|
| 69 | - 'bouton_radio_non_envoi_annonces' => 'Ne pas envoyer d’annonces', |
|
| 70 | - 'bouton_radio_non_envoi_liste_nouveautes' => 'Ne pas envoyer la liste des nouveautés', |
|
| 71 | - 'bouton_recharger_page' => 'recharger cette page', |
|
| 72 | - 'bouton_telecharger' => 'Télécharger', |
|
| 73 | - 'bouton_upload' => 'Téléverser', |
|
| 74 | - 'bouton_valider' => 'Valider', |
|
| 44 | + // B |
|
| 45 | + 'barre_a_accent_grave' => 'Insérer un A accent grave majuscule', |
|
| 46 | + 'barre_aide' => 'Utilisez les raccourcis typographiques pour enrichir votre mise en page', |
|
| 47 | + 'barre_e_accent_aigu' => 'Insérer un E accent aigu majuscule', |
|
| 48 | + 'barre_eo' => 'Insérer un E dans l’O', |
|
| 49 | + 'barre_eo_maj' => 'Insérer un E dans l’O majuscule', |
|
| 50 | + 'barre_euro' => 'Insérer le symbole €', |
|
| 51 | + 'barre_gras' => 'Mettre en {{gras}}', |
|
| 52 | + 'barre_guillemets' => 'Entourer de « guillemets »', |
|
| 53 | + 'barre_guillemets_simples' => 'Entourer de “guillemets de second niveau”', |
|
| 54 | + 'barre_intertitre' => 'Transformer en {{{intertitre}}}', |
|
| 55 | + 'barre_italic' => 'Mettre en {italique}', |
|
| 56 | + 'barre_lien' => 'Transformer en [lien hypertexte->http://...]', |
|
| 57 | + 'barre_lien_input' => 'Veuillez indiquer l’adresse de votre lien (vous pouvez indiquer une adresse Web sous la forme http://www.monsite/com ou simplement indiquer le numéro d’un article de ce site.', |
|
| 58 | + 'barre_note' => 'Transformer en [[Note de bas de page]]', |
|
| 59 | + 'barre_paragraphe' => 'Créer un paragraphe', |
|
| 60 | + 'barre_quote' => '<quote>Citer un message</quote>', |
|
| 61 | + 'bouton_changer' => 'Changer', |
|
| 62 | + 'bouton_chercher' => 'Chercher', |
|
| 63 | + 'bouton_choisir' => 'Choisir', |
|
| 64 | + 'bouton_deplacer' => 'Déplacer', |
|
| 65 | + 'bouton_download' => 'Télécharger', |
|
| 66 | + 'bouton_enregistrer' => 'Enregistrer', |
|
| 67 | + 'bouton_radio_desactiver_messagerie_interne' => 'Désactiver la messagerie interne', |
|
| 68 | + 'bouton_radio_envoi_annonces' => 'Envoyer les annonces éditoriales', |
|
| 69 | + 'bouton_radio_non_envoi_annonces' => 'Ne pas envoyer d’annonces', |
|
| 70 | + 'bouton_radio_non_envoi_liste_nouveautes' => 'Ne pas envoyer la liste des nouveautés', |
|
| 71 | + 'bouton_recharger_page' => 'recharger cette page', |
|
| 72 | + 'bouton_telecharger' => 'Télécharger', |
|
| 73 | + 'bouton_upload' => 'Téléverser', |
|
| 74 | + 'bouton_valider' => 'Valider', |
|
| 75 | 75 | |
| 76 | - // C |
|
| 77 | - 'cal_apresmidi' => 'après-midi', |
|
| 78 | - 'cal_jour_entier' => 'jour entier', |
|
| 79 | - 'cal_matin' => 'matin', |
|
| 80 | - 'cal_par_jour' => 'calendrier par jour', |
|
| 81 | - 'cal_par_mois' => 'calendrier par mois', |
|
| 82 | - 'cal_par_semaine' => 'calendrier par semaine', |
|
| 83 | - 'choix_couleur_interface' => 'couleur ', |
|
| 84 | - 'choix_interface' => 'choix de l’interface', |
|
| 85 | - 'colonne' => 'Colonne', |
|
| 86 | - 'confirm_changer_statut' => 'Attention, vous avez demandé à changer le statut de cet élément. Souhaitez-vous continuer ?', |
|
| 87 | - 'correcte' => 'correcte', # chaine utilisée dans le debugueur : "validation .. impossible" ou "validation .. correcte" |
|
| 76 | + // C |
|
| 77 | + 'cal_apresmidi' => 'après-midi', |
|
| 78 | + 'cal_jour_entier' => 'jour entier', |
|
| 79 | + 'cal_matin' => 'matin', |
|
| 80 | + 'cal_par_jour' => 'calendrier par jour', |
|
| 81 | + 'cal_par_mois' => 'calendrier par mois', |
|
| 82 | + 'cal_par_semaine' => 'calendrier par semaine', |
|
| 83 | + 'choix_couleur_interface' => 'couleur ', |
|
| 84 | + 'choix_interface' => 'choix de l’interface', |
|
| 85 | + 'colonne' => 'Colonne', |
|
| 86 | + 'confirm_changer_statut' => 'Attention, vous avez demandé à changer le statut de cet élément. Souhaitez-vous continuer ?', |
|
| 87 | + 'correcte' => 'correcte', # chaine utilisée dans le debugueur : "validation .. impossible" ou "validation .. correcte" |
|
| 88 | 88 | |
| 89 | - // D |
|
| 90 | - 'date_aujourdhui' => 'aujourd’hui', |
|
| 91 | - 'date_avant_jc' => 'av. J.C.', |
|
| 92 | - 'date_dans' => 'dans @delai@', |
|
| 93 | - 'date_de_mois_1' => '@j@ @nommois@', |
|
| 94 | - 'date_de_mois_10' => '@j@ @nommois@', |
|
| 95 | - 'date_de_mois_11' => '@j@ @nommois@', |
|
| 96 | - 'date_de_mois_12' => '@j@ @nommois@', |
|
| 97 | - 'date_de_mois_2' => '@j@ @nommois@', |
|
| 98 | - 'date_de_mois_3' => '@j@ @nommois@', |
|
| 99 | - 'date_de_mois_4' => '@j@ @nommois@', |
|
| 100 | - 'date_de_mois_5' => '@j@ @nommois@', |
|
| 101 | - 'date_de_mois_6' => '@j@ @nommois@', |
|
| 102 | - 'date_de_mois_7' => '@j@ @nommois@', |
|
| 103 | - 'date_de_mois_8' => '@j@ @nommois@', |
|
| 104 | - 'date_de_mois_9' => '@j@ @nommois@', |
|
| 105 | - 'date_demain' => 'demain', |
|
| 106 | - 'date_fmt_heures_minutes' => '@h@h@m@min', |
|
| 107 | - 'date_fmt_heures_minutes_court' => '@h@h@m@', |
|
| 108 | - 'date_fmt_jour' => '@nomjour@ @jour@', |
|
| 109 | - 'date_fmt_jour_heure' => '@jour@ à @heure@', |
|
| 110 | - 'date_fmt_jour_heure_debut_fin' => '@jour@ de @heure_debut@ à @heure_fin@', |
|
| 111 | - 'date_fmt_jour_heure_debut_fin_abbr' => '@dtstart@@jour@ de @heure_debut@@dtabbr@ à @dtend@@heure_fin@@dtabbr@', |
|
| 112 | - 'date_fmt_jour_mois' => '@jour@ @nommois@', |
|
| 113 | - 'date_fmt_jour_mois_annee' => '@jour@ @nommois@ @annee@', |
|
| 114 | - 'date_fmt_mois_annee' => '@nommois@ @annee@', |
|
| 115 | - 'date_fmt_nomjour' => '@nomjour@ @date@', |
|
| 116 | - 'date_fmt_nomjour_date' => 'le @nomjour@ @date@', |
|
| 117 | - 'date_fmt_periode' => 'Du @date_debut@ au @date_fin@', |
|
| 118 | - 'date_fmt_periode_abbr' => 'Du @dtart@@date_debut@@dtabbr@ au @dtend@@date_fin@@dtabbr@', |
|
| 119 | - 'date_fmt_periode_from' => 'Du', |
|
| 120 | - 'date_fmt_periode_to' => 'au', |
|
| 121 | - 'date_fmt_saison_annee' => '@saison@ @annee@', |
|
| 122 | - 'date_heures' => 'heures', |
|
| 123 | - 'date_hier' => 'hier', |
|
| 124 | - 'date_il_y_a' => 'il y a @delai@', |
|
| 125 | - 'date_jnum1' => '1er', |
|
| 126 | - 'date_jnum10' => '10', |
|
| 127 | - 'date_jnum11' => '11', |
|
| 128 | - 'date_jnum12' => '12', |
|
| 129 | - 'date_jnum13' => '13', |
|
| 130 | - 'date_jnum14' => '14', |
|
| 131 | - 'date_jnum15' => '15', |
|
| 132 | - 'date_jnum16' => '16', |
|
| 133 | - 'date_jnum17' => '17', |
|
| 134 | - 'date_jnum18' => '18', |
|
| 135 | - 'date_jnum19' => '19', |
|
| 136 | - 'date_jnum2' => '2', |
|
| 137 | - 'date_jnum20' => '20', |
|
| 138 | - 'date_jnum21' => '21', |
|
| 139 | - 'date_jnum22' => '22', |
|
| 140 | - 'date_jnum23' => '23', |
|
| 141 | - 'date_jnum24' => '24', |
|
| 142 | - 'date_jnum25' => '25', |
|
| 143 | - 'date_jnum26' => '26', |
|
| 144 | - 'date_jnum27' => '27', |
|
| 145 | - 'date_jnum28' => '28', |
|
| 146 | - 'date_jnum29' => '29', |
|
| 147 | - 'date_jnum3' => '3', |
|
| 148 | - 'date_jnum30' => '30', |
|
| 149 | - 'date_jnum31' => '31', |
|
| 150 | - 'date_jnum4' => '4', |
|
| 151 | - 'date_jnum5' => '5', |
|
| 152 | - 'date_jnum6' => '6', |
|
| 153 | - 'date_jnum7' => '7', |
|
| 154 | - 'date_jnum8' => '8', |
|
| 155 | - 'date_jnum9' => '9', |
|
| 156 | - 'date_jour_1' => 'dimanche', |
|
| 157 | - 'date_jour_1_abbr' => 'dim.', |
|
| 158 | - 'date_jour_1_initiale' => 'd.', |
|
| 159 | - 'date_jour_2' => 'lundi', |
|
| 160 | - 'date_jour_2_abbr' => 'lun.', |
|
| 161 | - 'date_jour_2_initiale' => 'l.', |
|
| 162 | - 'date_jour_3' => 'mardi', |
|
| 163 | - 'date_jour_3_abbr' => 'mar.', |
|
| 164 | - 'date_jour_3_initiale' => 'm.', |
|
| 165 | - 'date_jour_4' => 'mercredi', |
|
| 166 | - 'date_jour_4_abbr' => 'mer.', |
|
| 167 | - 'date_jour_4_initiale' => 'm.', |
|
| 168 | - 'date_jour_5' => 'jeudi', |
|
| 169 | - 'date_jour_5_abbr' => 'jeu.', |
|
| 170 | - 'date_jour_5_initiale' => 'j.', |
|
| 171 | - 'date_jour_6' => 'vendredi', |
|
| 172 | - 'date_jour_6_abbr' => 'ven.', |
|
| 173 | - 'date_jour_6_initiale' => 'v.', |
|
| 174 | - 'date_jour_7' => 'samedi', |
|
| 175 | - 'date_jour_7_abbr' => 'sam.', |
|
| 176 | - 'date_jour_7_initiale' => 's.', |
|
| 177 | - 'date_jours' => 'jours', |
|
| 178 | - 'date_minutes' => 'minutes', |
|
| 179 | - 'date_mois' => 'mois', |
|
| 180 | - 'date_mois_1' => 'janvier', |
|
| 181 | - 'date_mois_10' => 'octobre', |
|
| 182 | - 'date_mois_10_abbr' => 'oct.', |
|
| 183 | - 'date_mois_11' => 'novembre', |
|
| 184 | - 'date_mois_11_abbr' => 'nov.', |
|
| 185 | - 'date_mois_12' => 'décembre', |
|
| 186 | - 'date_mois_12_abbr' => 'déc.', |
|
| 187 | - 'date_mois_1_abbr' => 'janv.', |
|
| 188 | - 'date_mois_2' => 'février', |
|
| 189 | - 'date_mois_2_abbr' => 'févr.', |
|
| 190 | - 'date_mois_3' => 'mars', |
|
| 191 | - 'date_mois_3_abbr' => 'mars', |
|
| 192 | - 'date_mois_4' => 'avril', |
|
| 193 | - 'date_mois_4_abbr' => 'avr.', |
|
| 194 | - 'date_mois_5' => 'mai', |
|
| 195 | - 'date_mois_5_abbr' => 'mai', |
|
| 196 | - 'date_mois_6' => 'juin', |
|
| 197 | - 'date_mois_6_abbr' => 'juin', |
|
| 198 | - 'date_mois_7' => 'juillet', |
|
| 199 | - 'date_mois_7_abbr' => 'juil.', |
|
| 200 | - 'date_mois_8' => 'août', |
|
| 201 | - 'date_mois_8_abbr' => 'août', |
|
| 202 | - 'date_mois_9' => 'septembre', |
|
| 203 | - 'date_mois_9_abbr' => 'sept.', |
|
| 204 | - 'date_saison_1' => 'hiver', |
|
| 205 | - 'date_saison_2' => 'printemps', |
|
| 206 | - 'date_saison_3' => 'été', |
|
| 207 | - 'date_saison_4' => 'automne', |
|
| 208 | - 'date_secondes' => 'secondes', |
|
| 209 | - 'date_semaines' => 'semaines', |
|
| 210 | - 'date_un_mois' => 'mois', |
|
| 211 | - 'date_une_heure' => 'heure', |
|
| 212 | - 'date_une_minute' => 'minute', |
|
| 213 | - 'date_une_seconde' => 'seconde', |
|
| 214 | - 'date_une_semaine' => 'semaine', |
|
| 215 | - 'dirs_commencer' => ' afin de commencer réellement l’installation', |
|
| 216 | - 'dirs_preliminaire' => 'Préliminaire : <b>Régler les droits d’accès</b>', |
|
| 217 | - 'dirs_probleme_droits' => 'Problème de droits d’accès', |
|
| 218 | - 'dirs_repertoires_absents' => '<p><b>Les répertoires suivants n’ont pas été trouvés :</b></p><ul>@bad_dirs@</ul> |
|
| 89 | + // D |
|
| 90 | + 'date_aujourdhui' => 'aujourd’hui', |
|
| 91 | + 'date_avant_jc' => 'av. J.C.', |
|
| 92 | + 'date_dans' => 'dans @delai@', |
|
| 93 | + 'date_de_mois_1' => '@j@ @nommois@', |
|
| 94 | + 'date_de_mois_10' => '@j@ @nommois@', |
|
| 95 | + 'date_de_mois_11' => '@j@ @nommois@', |
|
| 96 | + 'date_de_mois_12' => '@j@ @nommois@', |
|
| 97 | + 'date_de_mois_2' => '@j@ @nommois@', |
|
| 98 | + 'date_de_mois_3' => '@j@ @nommois@', |
|
| 99 | + 'date_de_mois_4' => '@j@ @nommois@', |
|
| 100 | + 'date_de_mois_5' => '@j@ @nommois@', |
|
| 101 | + 'date_de_mois_6' => '@j@ @nommois@', |
|
| 102 | + 'date_de_mois_7' => '@j@ @nommois@', |
|
| 103 | + 'date_de_mois_8' => '@j@ @nommois@', |
|
| 104 | + 'date_de_mois_9' => '@j@ @nommois@', |
|
| 105 | + 'date_demain' => 'demain', |
|
| 106 | + 'date_fmt_heures_minutes' => '@h@h@m@min', |
|
| 107 | + 'date_fmt_heures_minutes_court' => '@h@h@m@', |
|
| 108 | + 'date_fmt_jour' => '@nomjour@ @jour@', |
|
| 109 | + 'date_fmt_jour_heure' => '@jour@ à @heure@', |
|
| 110 | + 'date_fmt_jour_heure_debut_fin' => '@jour@ de @heure_debut@ à @heure_fin@', |
|
| 111 | + 'date_fmt_jour_heure_debut_fin_abbr' => '@dtstart@@jour@ de @heure_debut@@dtabbr@ à @dtend@@heure_fin@@dtabbr@', |
|
| 112 | + 'date_fmt_jour_mois' => '@jour@ @nommois@', |
|
| 113 | + 'date_fmt_jour_mois_annee' => '@jour@ @nommois@ @annee@', |
|
| 114 | + 'date_fmt_mois_annee' => '@nommois@ @annee@', |
|
| 115 | + 'date_fmt_nomjour' => '@nomjour@ @date@', |
|
| 116 | + 'date_fmt_nomjour_date' => 'le @nomjour@ @date@', |
|
| 117 | + 'date_fmt_periode' => 'Du @date_debut@ au @date_fin@', |
|
| 118 | + 'date_fmt_periode_abbr' => 'Du @dtart@@date_debut@@dtabbr@ au @dtend@@date_fin@@dtabbr@', |
|
| 119 | + 'date_fmt_periode_from' => 'Du', |
|
| 120 | + 'date_fmt_periode_to' => 'au', |
|
| 121 | + 'date_fmt_saison_annee' => '@saison@ @annee@', |
|
| 122 | + 'date_heures' => 'heures', |
|
| 123 | + 'date_hier' => 'hier', |
|
| 124 | + 'date_il_y_a' => 'il y a @delai@', |
|
| 125 | + 'date_jnum1' => '1er', |
|
| 126 | + 'date_jnum10' => '10', |
|
| 127 | + 'date_jnum11' => '11', |
|
| 128 | + 'date_jnum12' => '12', |
|
| 129 | + 'date_jnum13' => '13', |
|
| 130 | + 'date_jnum14' => '14', |
|
| 131 | + 'date_jnum15' => '15', |
|
| 132 | + 'date_jnum16' => '16', |
|
| 133 | + 'date_jnum17' => '17', |
|
| 134 | + 'date_jnum18' => '18', |
|
| 135 | + 'date_jnum19' => '19', |
|
| 136 | + 'date_jnum2' => '2', |
|
| 137 | + 'date_jnum20' => '20', |
|
| 138 | + 'date_jnum21' => '21', |
|
| 139 | + 'date_jnum22' => '22', |
|
| 140 | + 'date_jnum23' => '23', |
|
| 141 | + 'date_jnum24' => '24', |
|
| 142 | + 'date_jnum25' => '25', |
|
| 143 | + 'date_jnum26' => '26', |
|
| 144 | + 'date_jnum27' => '27', |
|
| 145 | + 'date_jnum28' => '28', |
|
| 146 | + 'date_jnum29' => '29', |
|
| 147 | + 'date_jnum3' => '3', |
|
| 148 | + 'date_jnum30' => '30', |
|
| 149 | + 'date_jnum31' => '31', |
|
| 150 | + 'date_jnum4' => '4', |
|
| 151 | + 'date_jnum5' => '5', |
|
| 152 | + 'date_jnum6' => '6', |
|
| 153 | + 'date_jnum7' => '7', |
|
| 154 | + 'date_jnum8' => '8', |
|
| 155 | + 'date_jnum9' => '9', |
|
| 156 | + 'date_jour_1' => 'dimanche', |
|
| 157 | + 'date_jour_1_abbr' => 'dim.', |
|
| 158 | + 'date_jour_1_initiale' => 'd.', |
|
| 159 | + 'date_jour_2' => 'lundi', |
|
| 160 | + 'date_jour_2_abbr' => 'lun.', |
|
| 161 | + 'date_jour_2_initiale' => 'l.', |
|
| 162 | + 'date_jour_3' => 'mardi', |
|
| 163 | + 'date_jour_3_abbr' => 'mar.', |
|
| 164 | + 'date_jour_3_initiale' => 'm.', |
|
| 165 | + 'date_jour_4' => 'mercredi', |
|
| 166 | + 'date_jour_4_abbr' => 'mer.', |
|
| 167 | + 'date_jour_4_initiale' => 'm.', |
|
| 168 | + 'date_jour_5' => 'jeudi', |
|
| 169 | + 'date_jour_5_abbr' => 'jeu.', |
|
| 170 | + 'date_jour_5_initiale' => 'j.', |
|
| 171 | + 'date_jour_6' => 'vendredi', |
|
| 172 | + 'date_jour_6_abbr' => 'ven.', |
|
| 173 | + 'date_jour_6_initiale' => 'v.', |
|
| 174 | + 'date_jour_7' => 'samedi', |
|
| 175 | + 'date_jour_7_abbr' => 'sam.', |
|
| 176 | + 'date_jour_7_initiale' => 's.', |
|
| 177 | + 'date_jours' => 'jours', |
|
| 178 | + 'date_minutes' => 'minutes', |
|
| 179 | + 'date_mois' => 'mois', |
|
| 180 | + 'date_mois_1' => 'janvier', |
|
| 181 | + 'date_mois_10' => 'octobre', |
|
| 182 | + 'date_mois_10_abbr' => 'oct.', |
|
| 183 | + 'date_mois_11' => 'novembre', |
|
| 184 | + 'date_mois_11_abbr' => 'nov.', |
|
| 185 | + 'date_mois_12' => 'décembre', |
|
| 186 | + 'date_mois_12_abbr' => 'déc.', |
|
| 187 | + 'date_mois_1_abbr' => 'janv.', |
|
| 188 | + 'date_mois_2' => 'février', |
|
| 189 | + 'date_mois_2_abbr' => 'févr.', |
|
| 190 | + 'date_mois_3' => 'mars', |
|
| 191 | + 'date_mois_3_abbr' => 'mars', |
|
| 192 | + 'date_mois_4' => 'avril', |
|
| 193 | + 'date_mois_4_abbr' => 'avr.', |
|
| 194 | + 'date_mois_5' => 'mai', |
|
| 195 | + 'date_mois_5_abbr' => 'mai', |
|
| 196 | + 'date_mois_6' => 'juin', |
|
| 197 | + 'date_mois_6_abbr' => 'juin', |
|
| 198 | + 'date_mois_7' => 'juillet', |
|
| 199 | + 'date_mois_7_abbr' => 'juil.', |
|
| 200 | + 'date_mois_8' => 'août', |
|
| 201 | + 'date_mois_8_abbr' => 'août', |
|
| 202 | + 'date_mois_9' => 'septembre', |
|
| 203 | + 'date_mois_9_abbr' => 'sept.', |
|
| 204 | + 'date_saison_1' => 'hiver', |
|
| 205 | + 'date_saison_2' => 'printemps', |
|
| 206 | + 'date_saison_3' => 'été', |
|
| 207 | + 'date_saison_4' => 'automne', |
|
| 208 | + 'date_secondes' => 'secondes', |
|
| 209 | + 'date_semaines' => 'semaines', |
|
| 210 | + 'date_un_mois' => 'mois', |
|
| 211 | + 'date_une_heure' => 'heure', |
|
| 212 | + 'date_une_minute' => 'minute', |
|
| 213 | + 'date_une_seconde' => 'seconde', |
|
| 214 | + 'date_une_semaine' => 'semaine', |
|
| 215 | + 'dirs_commencer' => ' afin de commencer réellement l’installation', |
|
| 216 | + 'dirs_preliminaire' => 'Préliminaire : <b>Régler les droits d’accès</b>', |
|
| 217 | + 'dirs_probleme_droits' => 'Problème de droits d’accès', |
|
| 218 | + 'dirs_repertoires_absents' => '<p><b>Les répertoires suivants n’ont pas été trouvés :</b></p><ul>@bad_dirs@</ul> |
|
| 219 | 219 | <p>Il est probable que cela soit dû à un problème de mauvaise mise en majuscules ou minuscules. |
| 220 | 220 | Vérifiez que les minuscules et majuscules de ces répertoires concordent bien avec ce qui est affiché |
| 221 | 221 | ci-dessus ; si ce n’est pas le cas, renommez les répertoires avec votre logiciel FTP de façon à corriger l’erreur.</p> |
| 222 | 222 | <p>Une fois cette manipulation effectuée, vous pourrez ', |
| 223 | - 'dirs_repertoires_suivants' => '<p><b>Les répertoires suivants ne sont pas accessibles en écriture :</b></p> <ul>@bad_dirs@</ul> |
|
| 223 | + 'dirs_repertoires_suivants' => '<p><b>Les répertoires suivants ne sont pas accessibles en écriture :</b></p> <ul>@bad_dirs@</ul> |
|
| 224 | 224 | <p>Pour y remédier, utilisez votre client FTP afin de régler les droits d’accès de chacun |
| 225 | 225 | de ces répertoires. La procédure est expliquée en détail dans le guide d’installation.</p> |
| 226 | 226 | <p>Une fois cette manipulation effectuée, vous pourrez ', |
| 227 | - 'double_occurrence' => 'Double occurrence de @balise@', |
|
| 227 | + 'double_occurrence' => 'Double occurrence de @balise@', |
|
| 228 | 228 | |
| 229 | - // E |
|
| 230 | - 'en_cours' => 'en cours', |
|
| 231 | - 'envoi_via_le_site' => 'Envoi via le site', |
|
| 232 | - 'erreur' => 'Erreur', |
|
| 233 | - 'erreur_balise_non_fermee' => 'dernière balise non refermée :', |
|
| 234 | - 'erreur_technique_ajaxform' => 'Oups. Une erreur inattendue a empêché de soumettre le formulaire. Vous pouvez essayer à nouveau.', |
|
| 235 | - 'erreur_technique_enregistrement_champs' => 'Une erreur technique a empêché l’enregistrement correct du champ @champs@.', |
|
| 236 | - 'erreur_technique_enregistrement_impossible' => 'Une erreur technique a empêché l’enregistrement.', |
|
| 237 | - 'erreur_texte' => 'erreur(s)', |
|
| 238 | - 'etape' => 'Étape', |
|
| 229 | + // E |
|
| 230 | + 'en_cours' => 'en cours', |
|
| 231 | + 'envoi_via_le_site' => 'Envoi via le site', |
|
| 232 | + 'erreur' => 'Erreur', |
|
| 233 | + 'erreur_balise_non_fermee' => 'dernière balise non refermée :', |
|
| 234 | + 'erreur_technique_ajaxform' => 'Oups. Une erreur inattendue a empêché de soumettre le formulaire. Vous pouvez essayer à nouveau.', |
|
| 235 | + 'erreur_technique_enregistrement_champs' => 'Une erreur technique a empêché l’enregistrement correct du champ @champs@.', |
|
| 236 | + 'erreur_technique_enregistrement_impossible' => 'Une erreur technique a empêché l’enregistrement.', |
|
| 237 | + 'erreur_texte' => 'erreur(s)', |
|
| 238 | + 'etape' => 'Étape', |
|
| 239 | 239 | |
| 240 | - // F |
|
| 241 | - 'fichier_introuvable' => 'Fichier @fichier@ introuvable.', |
|
| 242 | - 'fonction_introuvable' => 'Fonction @fonction@() introuvable.', |
|
| 243 | - 'form_auteur_confirmation' => 'Confirmez votre adresse email', |
|
| 244 | - 'form_auteur_email_modifie' => 'Votre adresse email a été modifiée.', |
|
| 245 | - 'form_auteur_envoi_mail_confirmation' => 'Un courrier électronique de confirmation vient d’être envoyé à @email@. Vous devrez visiter l’adresse Web mentionnée dans ce courrier pour valider votre adresse mail.', |
|
| 246 | - 'form_auteur_mail_confirmation' => 'Bonjour, |
|
| 240 | + // F |
|
| 241 | + 'fichier_introuvable' => 'Fichier @fichier@ introuvable.', |
|
| 242 | + 'fonction_introuvable' => 'Fonction @fonction@() introuvable.', |
|
| 243 | + 'form_auteur_confirmation' => 'Confirmez votre adresse email', |
|
| 244 | + 'form_auteur_email_modifie' => 'Votre adresse email a été modifiée.', |
|
| 245 | + 'form_auteur_envoi_mail_confirmation' => 'Un courrier électronique de confirmation vient d’être envoyé à @email@. Vous devrez visiter l’adresse Web mentionnée dans ce courrier pour valider votre adresse mail.', |
|
| 246 | + 'form_auteur_mail_confirmation' => 'Bonjour, |
|
| 247 | 247 | |
| 248 | 248 | Vous avez demandé à changer votre adresse email. |
| 249 | 249 | Pour confirmer votre nouvelle adresse, il suffit de vous connecter à |
@@ -252,346 +252,346 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | @url@ |
| 254 | 254 | ', |
| 255 | - 'form_deja_inscrit' => 'Vous êtes déjà inscrit.', |
|
| 256 | - 'form_email_non_valide' => 'Votre adresse email n’est pas valide.', |
|
| 257 | - 'form_forum_access_refuse' => 'Vous n’avez plus accès à ce site.', |
|
| 258 | - 'form_forum_bonjour' => 'Bonjour @nom@,', |
|
| 259 | - 'form_forum_confirmer_email' => 'Pour confirmer votre adresse email, rendez-vous à cette adresse : @url_confirm@', |
|
| 260 | - 'form_forum_email_deja_enregistre' => 'Cette adresse email est déjà enregistrée, vous pouvez donc utiliser votre mot de passe habituel.', |
|
| 261 | - 'form_forum_identifiant_mail' => 'Votre nouvel identifiant vient de vous être envoyé par email.', |
|
| 262 | - 'form_forum_identifiants' => 'Identifiants personnels', |
|
| 263 | - 'form_forum_indiquer_nom_email' => 'Indiquez ici votre nom et votre adresse email. Votre identifiant personnel vous parviendra rapidement, par courrier électronique.', |
|
| 264 | - 'form_forum_login' => 'login :', |
|
| 265 | - 'form_forum_message_auto' => '(ceci est un message automatique)', |
|
| 266 | - 'form_forum_pass' => 'mot de passe :', |
|
| 267 | - 'form_forum_probleme_mail' => 'Problème de mail : l’identifiant ne peut pas être envoyé.', |
|
| 268 | - 'form_forum_voici1' => 'Voici vos identifiants pour pouvoir participer à la vie du site "@nom_site_spip@" (@adresse_site@) :', |
|
| 269 | - 'form_forum_voici2' => 'Voici vos identifiants pour proposer des articles sur |
|
| 255 | + 'form_deja_inscrit' => 'Vous êtes déjà inscrit.', |
|
| 256 | + 'form_email_non_valide' => 'Votre adresse email n’est pas valide.', |
|
| 257 | + 'form_forum_access_refuse' => 'Vous n’avez plus accès à ce site.', |
|
| 258 | + 'form_forum_bonjour' => 'Bonjour @nom@,', |
|
| 259 | + 'form_forum_confirmer_email' => 'Pour confirmer votre adresse email, rendez-vous à cette adresse : @url_confirm@', |
|
| 260 | + 'form_forum_email_deja_enregistre' => 'Cette adresse email est déjà enregistrée, vous pouvez donc utiliser votre mot de passe habituel.', |
|
| 261 | + 'form_forum_identifiant_mail' => 'Votre nouvel identifiant vient de vous être envoyé par email.', |
|
| 262 | + 'form_forum_identifiants' => 'Identifiants personnels', |
|
| 263 | + 'form_forum_indiquer_nom_email' => 'Indiquez ici votre nom et votre adresse email. Votre identifiant personnel vous parviendra rapidement, par courrier électronique.', |
|
| 264 | + 'form_forum_login' => 'login :', |
|
| 265 | + 'form_forum_message_auto' => '(ceci est un message automatique)', |
|
| 266 | + 'form_forum_pass' => 'mot de passe :', |
|
| 267 | + 'form_forum_probleme_mail' => 'Problème de mail : l’identifiant ne peut pas être envoyé.', |
|
| 268 | + 'form_forum_voici1' => 'Voici vos identifiants pour pouvoir participer à la vie du site "@nom_site_spip@" (@adresse_site@) :', |
|
| 269 | + 'form_forum_voici2' => 'Voici vos identifiants pour proposer des articles sur |
|
| 270 | 270 | le site "@nom_site_spip@" (@adresse_login@) :', |
| 271 | - 'form_indiquer_email' => 'Veuillez indiquer votre adresse email.', |
|
| 272 | - 'form_indiquer_nom' => 'Veuillez indiquer votre nom.', |
|
| 273 | - 'form_indiquer_nom_site' => 'Veuillez indiquer le nom de votre site.', |
|
| 274 | - 'form_pet_deja_enregistre' => 'Ce site est déjà enregistré', |
|
| 275 | - 'form_pet_signature_pasprise' => 'Votre signature n’est pas prise en compte.', |
|
| 276 | - 'form_prop_confirmer_envoi' => 'Confirmer l’envoi', |
|
| 277 | - 'form_prop_description' => 'Description/commentaire', |
|
| 278 | - 'form_prop_enregistre' => 'Votre proposition est enregistrée, elle apparaîtra en ligne après validation par les responsables de ce site.', |
|
| 279 | - 'form_prop_envoyer' => 'Envoyer un message', |
|
| 280 | - 'form_prop_indiquer_email' => 'Veuillez indiquer une adresse email valide', |
|
| 281 | - 'form_prop_indiquer_nom_site' => 'Veuillez indiquer le nom du site.', |
|
| 282 | - 'form_prop_indiquer_sujet' => 'Veuillez indiquer un sujet', |
|
| 283 | - 'form_prop_message_envoye' => 'Message envoyé', |
|
| 284 | - 'form_prop_non_enregistre' => 'Votre proposition n’a pas été enregistrée.', |
|
| 285 | - 'form_prop_sujet' => 'Sujet', |
|
| 286 | - 'form_prop_url_site' => 'Adresse URL du site', |
|
| 287 | - 'format_date_attendu' => 'Saisir une date au format jj/mm/aaaa.', |
|
| 288 | - 'format_date_incorrecte' => 'La date ou son format est incorrect', |
|
| 289 | - 'format_heure_attendu' => 'Saisir une heure au format hh:mm.', |
|
| 290 | - 'format_heure_incorrecte' => 'L’heure ou son format est incorrect', |
|
| 291 | - 'forum_non_inscrit' => 'Vous n’êtes pas inscrit, ou l’adresse ou le mot de passe sont erronés.', |
|
| 292 | - 'forum_par_auteur' => 'par @auteur@', |
|
| 293 | - 'forum_titre_erreur' => 'Erreur...', |
|
| 271 | + 'form_indiquer_email' => 'Veuillez indiquer votre adresse email.', |
|
| 272 | + 'form_indiquer_nom' => 'Veuillez indiquer votre nom.', |
|
| 273 | + 'form_indiquer_nom_site' => 'Veuillez indiquer le nom de votre site.', |
|
| 274 | + 'form_pet_deja_enregistre' => 'Ce site est déjà enregistré', |
|
| 275 | + 'form_pet_signature_pasprise' => 'Votre signature n’est pas prise en compte.', |
|
| 276 | + 'form_prop_confirmer_envoi' => 'Confirmer l’envoi', |
|
| 277 | + 'form_prop_description' => 'Description/commentaire', |
|
| 278 | + 'form_prop_enregistre' => 'Votre proposition est enregistrée, elle apparaîtra en ligne après validation par les responsables de ce site.', |
|
| 279 | + 'form_prop_envoyer' => 'Envoyer un message', |
|
| 280 | + 'form_prop_indiquer_email' => 'Veuillez indiquer une adresse email valide', |
|
| 281 | + 'form_prop_indiquer_nom_site' => 'Veuillez indiquer le nom du site.', |
|
| 282 | + 'form_prop_indiquer_sujet' => 'Veuillez indiquer un sujet', |
|
| 283 | + 'form_prop_message_envoye' => 'Message envoyé', |
|
| 284 | + 'form_prop_non_enregistre' => 'Votre proposition n’a pas été enregistrée.', |
|
| 285 | + 'form_prop_sujet' => 'Sujet', |
|
| 286 | + 'form_prop_url_site' => 'Adresse URL du site', |
|
| 287 | + 'format_date_attendu' => 'Saisir une date au format jj/mm/aaaa.', |
|
| 288 | + 'format_date_incorrecte' => 'La date ou son format est incorrect', |
|
| 289 | + 'format_heure_attendu' => 'Saisir une heure au format hh:mm.', |
|
| 290 | + 'format_heure_incorrecte' => 'L’heure ou son format est incorrect', |
|
| 291 | + 'forum_non_inscrit' => 'Vous n’êtes pas inscrit, ou l’adresse ou le mot de passe sont erronés.', |
|
| 292 | + 'forum_par_auteur' => 'par @auteur@', |
|
| 293 | + 'forum_titre_erreur' => 'Erreur...', |
|
| 294 | 294 | |
| 295 | - // I |
|
| 296 | - 'ical_texte_rss_articles' => 'Le fichier « backend » des articles de ce site se trouve à l’adresse :', |
|
| 297 | - 'ical_texte_rss_articles2' => 'Vous pouvez également obtenir des fichiers « backend » pour les articles de chaque rubrique du site :', |
|
| 298 | - 'ical_texte_rss_breves' => 'Il existe de plus un fichier contenant les brèves du site. En précisant un numéro de rubrique, vous obtiendrez uniquement les brèves de cette rubrique.', |
|
| 299 | - 'icone_a_suivre' => 'À suivre', |
|
| 300 | - 'icone_admin_site' => 'Administration du site', |
|
| 301 | - 'icone_agenda' => 'Agenda', |
|
| 302 | - 'icone_aide_ligne' => 'Aide', |
|
| 303 | - 'icone_articles' => 'Articles', |
|
| 304 | - 'icone_auteurs' => 'Auteurs', |
|
| 305 | - 'icone_brouteur' => 'Navigation rapide', |
|
| 306 | - 'icone_configuration_site' => 'Configuration', |
|
| 307 | - 'icone_configurer_site' => 'Configurer votre site', |
|
| 308 | - 'icone_creer_nouvel_auteur' => 'Créer un nouvel auteur', |
|
| 309 | - 'icone_creer_rubrique' => 'Créer une rubrique', |
|
| 310 | - 'icone_creer_sous_rubrique' => 'Créer une sous-rubrique', |
|
| 311 | - 'icone_deconnecter' => 'Se déconnecter', |
|
| 312 | - 'icone_discussions' => 'Discussions', |
|
| 313 | - 'icone_doc_rubrique' => 'Documents des rubriques', |
|
| 314 | - 'icone_ecrire_article' => 'Écrire un nouvel article', |
|
| 315 | - 'icone_edition_site' => 'Édition', |
|
| 316 | - 'icone_gestion_langues' => 'Gestion des langues', |
|
| 317 | - 'icone_informations_personnelles' => 'Informations personnelles', |
|
| 318 | - 'icone_interface_complet' => 'interface complète', |
|
| 319 | - 'icone_interface_simple' => 'Interface simplifiée', |
|
| 320 | - 'icone_maintenance_site' => 'Maintenance du site', |
|
| 321 | - 'icone_messagerie_personnelle' => 'Messagerie personnelle', |
|
| 322 | - 'icone_repartition_debut' => 'Afficher la répartition depuis le début', |
|
| 323 | - 'icone_rubriques' => 'Rubriques', |
|
| 324 | - 'icone_sauver_site' => 'Sauvegarde du site', |
|
| 325 | - 'icone_site_entier' => 'Tout le site', |
|
| 326 | - 'icone_sites_references' => 'Sites référencés', |
|
| 327 | - 'icone_statistiques' => 'Statistiques du site', |
|
| 328 | - 'icone_suivi_activite' => 'Suivre la vie du site', |
|
| 329 | - 'icone_suivi_actualite' => 'Évolution du site', |
|
| 330 | - 'icone_suivi_pettions' => 'Suivre/gérer les pétitions', |
|
| 331 | - 'icone_suivi_revisions' => 'Modifications des articles', |
|
| 332 | - 'icone_supprimer_document' => 'Supprimer ce document', |
|
| 333 | - 'icone_supprimer_image' => 'Supprimer cette image', |
|
| 334 | - 'icone_tous_articles' => 'Tous vos articles', |
|
| 335 | - 'icone_tous_auteur' => 'Tous les auteurs', |
|
| 336 | - 'icone_tous_visiteur' => 'Tous les visiteurs', |
|
| 337 | - 'icone_visiter_site' => 'Voir le site public', |
|
| 338 | - 'icone_voir_en_ligne' => 'Voir en ligne', |
|
| 339 | - 'img_indisponible' => 'image indisponible', |
|
| 340 | - 'impossible' => 'impossible', |
|
| 341 | - 'info_a_suivre' => 'À SUIVRE »', |
|
| 342 | - 'info_acces_interdit' => 'Accès interdit', |
|
| 343 | - 'info_acces_refuse' => 'Accès refusé', |
|
| 344 | - 'info_action' => 'Action : @action@', |
|
| 345 | - 'info_administrer_rubriques' => 'Vous pouvez administrer cette rubrique et ses sous-rubriques', |
|
| 346 | - 'info_adresse_non_indiquee' => 'Vous n’avez pas indiqué d’adresse à tester !', |
|
| 347 | - 'info_aide' => 'AIDE :', |
|
| 348 | - 'info_ajouter_mot' => 'Ajouter ce mot', |
|
| 349 | - 'info_annonce' => 'ANNONCE', |
|
| 350 | - 'info_annonces_generales' => 'Annonces générales :', |
|
| 351 | - 'info_article_propose' => 'Article proposé', |
|
| 352 | - 'info_article_publie' => 'Article publié', |
|
| 353 | - 'info_article_redaction' => 'Article en cours de rédaction', |
|
| 354 | - 'info_article_refuse' => 'Article refusé', |
|
| 355 | - 'info_article_supprime' => 'Article supprimé', |
|
| 356 | - 'info_articles' => 'Articles', |
|
| 357 | - 'info_articles_a_valider' => 'Les articles à valider', |
|
| 358 | - 'info_articles_nb' => '@nb@ articles', |
|
| 359 | - 'info_articles_proposes' => 'Articles proposés', |
|
| 360 | - 'info_articles_un' => '1 article', |
|
| 361 | - 'info_auteurs_nombre' => 'auteur(s) :', |
|
| 362 | - 'info_authentification_ftp' => 'Authentification (par FTP).', |
|
| 363 | - 'info_breves_2' => 'brèves', |
|
| 364 | - 'info_breves_nb' => '@nb@ brèves', |
|
| 365 | - 'info_breves_un' => '1 brève', |
|
| 366 | - 'info_connexion_refusee' => 'Connexion refusée', |
|
| 367 | - 'info_contact_developpeur' => 'Veuillez contacter un développeur.', |
|
| 368 | - 'info_contenance' => 'Ce site contient :', |
|
| 369 | - 'info_contribution' => 'contributions', |
|
| 370 | - 'info_copyright' => '@spip@ est un logiciel libre distribué @lien_gpl@.', |
|
| 371 | - 'info_copyright_doc' => 'Pour plus d’informations, voir le site <a href="@spipnet@">@spipnet_affiche@</a>.', |
|
| 372 | - 'info_copyright_gpl' => 'sous licence GPL', |
|
| 373 | - 'info_cours_edition' => 'En cours de modification', |
|
| 374 | - 'info_creer_repertoire' => 'Veuillez créer un fichier ou un répertoire nommé :', |
|
| 375 | - 'info_creer_repertoire_2' => 'à l’intérieur du sous-répertoire <b>@repertoire@</b>, puis :', |
|
| 376 | - 'info_creer_vignette' => 'création automatique de la vignette', |
|
| 377 | - 'info_creerdansrubrique_non_autorise' => 'Vous n’avez pas de droits suffisants pour créer un contenu dans cette rubrique', |
|
| 378 | - 'info_deplier' => 'Déplier', |
|
| 379 | - 'info_descriptif_nombre' => 'descriptif(s) :', |
|
| 380 | - 'info_description' => 'Description :', |
|
| 381 | - 'info_description_2' => 'Description :', |
|
| 382 | - 'info_dimension' => 'Dimensions :', |
|
| 383 | - 'info_documents_nb' => '@nb@ documents', |
|
| 384 | - 'info_documents_un' => '1 document', |
|
| 385 | - 'info_ecire_message_prive' => 'Écrire un message privé', |
|
| 386 | - 'info_email_invalide' => 'Adresse email invalide.', |
|
| 387 | - 'info_en_cours_validation' => 'Vos articles en cours de rédaction', |
|
| 388 | - 'info_en_ligne' => 'Actuellement en ligne :', |
|
| 389 | - 'info_envoyer_message_prive' => 'Envoyer un message privé à cet auteur', |
|
| 390 | - 'info_erreur_requete' => 'Erreur dans la requête :', |
|
| 391 | - 'info_erreur_squelette2' => 'Aucun squelette <b>@fichier@</b> n’est disponible...', |
|
| 392 | - 'info_erreur_systeme' => 'Erreur système (errno @errsys@)', |
|
| 393 | - 'info_erreur_systeme2' => 'Le disque dur est peut-être plein, ou la base de données endommagée.<br /> |
|
| 295 | + // I |
|
| 296 | + 'ical_texte_rss_articles' => 'Le fichier « backend » des articles de ce site se trouve à l’adresse :', |
|
| 297 | + 'ical_texte_rss_articles2' => 'Vous pouvez également obtenir des fichiers « backend » pour les articles de chaque rubrique du site :', |
|
| 298 | + 'ical_texte_rss_breves' => 'Il existe de plus un fichier contenant les brèves du site. En précisant un numéro de rubrique, vous obtiendrez uniquement les brèves de cette rubrique.', |
|
| 299 | + 'icone_a_suivre' => 'À suivre', |
|
| 300 | + 'icone_admin_site' => 'Administration du site', |
|
| 301 | + 'icone_agenda' => 'Agenda', |
|
| 302 | + 'icone_aide_ligne' => 'Aide', |
|
| 303 | + 'icone_articles' => 'Articles', |
|
| 304 | + 'icone_auteurs' => 'Auteurs', |
|
| 305 | + 'icone_brouteur' => 'Navigation rapide', |
|
| 306 | + 'icone_configuration_site' => 'Configuration', |
|
| 307 | + 'icone_configurer_site' => 'Configurer votre site', |
|
| 308 | + 'icone_creer_nouvel_auteur' => 'Créer un nouvel auteur', |
|
| 309 | + 'icone_creer_rubrique' => 'Créer une rubrique', |
|
| 310 | + 'icone_creer_sous_rubrique' => 'Créer une sous-rubrique', |
|
| 311 | + 'icone_deconnecter' => 'Se déconnecter', |
|
| 312 | + 'icone_discussions' => 'Discussions', |
|
| 313 | + 'icone_doc_rubrique' => 'Documents des rubriques', |
|
| 314 | + 'icone_ecrire_article' => 'Écrire un nouvel article', |
|
| 315 | + 'icone_edition_site' => 'Édition', |
|
| 316 | + 'icone_gestion_langues' => 'Gestion des langues', |
|
| 317 | + 'icone_informations_personnelles' => 'Informations personnelles', |
|
| 318 | + 'icone_interface_complet' => 'interface complète', |
|
| 319 | + 'icone_interface_simple' => 'Interface simplifiée', |
|
| 320 | + 'icone_maintenance_site' => 'Maintenance du site', |
|
| 321 | + 'icone_messagerie_personnelle' => 'Messagerie personnelle', |
|
| 322 | + 'icone_repartition_debut' => 'Afficher la répartition depuis le début', |
|
| 323 | + 'icone_rubriques' => 'Rubriques', |
|
| 324 | + 'icone_sauver_site' => 'Sauvegarde du site', |
|
| 325 | + 'icone_site_entier' => 'Tout le site', |
|
| 326 | + 'icone_sites_references' => 'Sites référencés', |
|
| 327 | + 'icone_statistiques' => 'Statistiques du site', |
|
| 328 | + 'icone_suivi_activite' => 'Suivre la vie du site', |
|
| 329 | + 'icone_suivi_actualite' => 'Évolution du site', |
|
| 330 | + 'icone_suivi_pettions' => 'Suivre/gérer les pétitions', |
|
| 331 | + 'icone_suivi_revisions' => 'Modifications des articles', |
|
| 332 | + 'icone_supprimer_document' => 'Supprimer ce document', |
|
| 333 | + 'icone_supprimer_image' => 'Supprimer cette image', |
|
| 334 | + 'icone_tous_articles' => 'Tous vos articles', |
|
| 335 | + 'icone_tous_auteur' => 'Tous les auteurs', |
|
| 336 | + 'icone_tous_visiteur' => 'Tous les visiteurs', |
|
| 337 | + 'icone_visiter_site' => 'Voir le site public', |
|
| 338 | + 'icone_voir_en_ligne' => 'Voir en ligne', |
|
| 339 | + 'img_indisponible' => 'image indisponible', |
|
| 340 | + 'impossible' => 'impossible', |
|
| 341 | + 'info_a_suivre' => 'À SUIVRE »', |
|
| 342 | + 'info_acces_interdit' => 'Accès interdit', |
|
| 343 | + 'info_acces_refuse' => 'Accès refusé', |
|
| 344 | + 'info_action' => 'Action : @action@', |
|
| 345 | + 'info_administrer_rubriques' => 'Vous pouvez administrer cette rubrique et ses sous-rubriques', |
|
| 346 | + 'info_adresse_non_indiquee' => 'Vous n’avez pas indiqué d’adresse à tester !', |
|
| 347 | + 'info_aide' => 'AIDE :', |
|
| 348 | + 'info_ajouter_mot' => 'Ajouter ce mot', |
|
| 349 | + 'info_annonce' => 'ANNONCE', |
|
| 350 | + 'info_annonces_generales' => 'Annonces générales :', |
|
| 351 | + 'info_article_propose' => 'Article proposé', |
|
| 352 | + 'info_article_publie' => 'Article publié', |
|
| 353 | + 'info_article_redaction' => 'Article en cours de rédaction', |
|
| 354 | + 'info_article_refuse' => 'Article refusé', |
|
| 355 | + 'info_article_supprime' => 'Article supprimé', |
|
| 356 | + 'info_articles' => 'Articles', |
|
| 357 | + 'info_articles_a_valider' => 'Les articles à valider', |
|
| 358 | + 'info_articles_nb' => '@nb@ articles', |
|
| 359 | + 'info_articles_proposes' => 'Articles proposés', |
|
| 360 | + 'info_articles_un' => '1 article', |
|
| 361 | + 'info_auteurs_nombre' => 'auteur(s) :', |
|
| 362 | + 'info_authentification_ftp' => 'Authentification (par FTP).', |
|
| 363 | + 'info_breves_2' => 'brèves', |
|
| 364 | + 'info_breves_nb' => '@nb@ brèves', |
|
| 365 | + 'info_breves_un' => '1 brève', |
|
| 366 | + 'info_connexion_refusee' => 'Connexion refusée', |
|
| 367 | + 'info_contact_developpeur' => 'Veuillez contacter un développeur.', |
|
| 368 | + 'info_contenance' => 'Ce site contient :', |
|
| 369 | + 'info_contribution' => 'contributions', |
|
| 370 | + 'info_copyright' => '@spip@ est un logiciel libre distribué @lien_gpl@.', |
|
| 371 | + 'info_copyright_doc' => 'Pour plus d’informations, voir le site <a href="@spipnet@">@spipnet_affiche@</a>.', |
|
| 372 | + 'info_copyright_gpl' => 'sous licence GPL', |
|
| 373 | + 'info_cours_edition' => 'En cours de modification', |
|
| 374 | + 'info_creer_repertoire' => 'Veuillez créer un fichier ou un répertoire nommé :', |
|
| 375 | + 'info_creer_repertoire_2' => 'à l’intérieur du sous-répertoire <b>@repertoire@</b>, puis :', |
|
| 376 | + 'info_creer_vignette' => 'création automatique de la vignette', |
|
| 377 | + 'info_creerdansrubrique_non_autorise' => 'Vous n’avez pas de droits suffisants pour créer un contenu dans cette rubrique', |
|
| 378 | + 'info_deplier' => 'Déplier', |
|
| 379 | + 'info_descriptif_nombre' => 'descriptif(s) :', |
|
| 380 | + 'info_description' => 'Description :', |
|
| 381 | + 'info_description_2' => 'Description :', |
|
| 382 | + 'info_dimension' => 'Dimensions :', |
|
| 383 | + 'info_documents_nb' => '@nb@ documents', |
|
| 384 | + 'info_documents_un' => '1 document', |
|
| 385 | + 'info_ecire_message_prive' => 'Écrire un message privé', |
|
| 386 | + 'info_email_invalide' => 'Adresse email invalide.', |
|
| 387 | + 'info_en_cours_validation' => 'Vos articles en cours de rédaction', |
|
| 388 | + 'info_en_ligne' => 'Actuellement en ligne :', |
|
| 389 | + 'info_envoyer_message_prive' => 'Envoyer un message privé à cet auteur', |
|
| 390 | + 'info_erreur_requete' => 'Erreur dans la requête :', |
|
| 391 | + 'info_erreur_squelette2' => 'Aucun squelette <b>@fichier@</b> n’est disponible...', |
|
| 392 | + 'info_erreur_systeme' => 'Erreur système (errno @errsys@)', |
|
| 393 | + 'info_erreur_systeme2' => 'Le disque dur est peut-être plein, ou la base de données endommagée.<br /> |
|
| 394 | 394 | <span style="color:red;">Essayez de <a href=\'@script@\'>réparer la base</a>, ou contactez votre hébergeur.</span>', |
| 395 | - 'info_fini' => 'C’est fini !', |
|
| 396 | - 'info_format_image' => 'Formats d’images pouvant être utilisées pour créer des vignettes : @gd_formats@.', |
|
| 397 | - 'info_format_non_defini' => 'format non défini', |
|
| 398 | - 'info_grand_ecran' => 'Grand écran', |
|
| 399 | - 'info_image_aide' => 'AIDE', |
|
| 400 | - 'info_image_process_titre' => 'Méthode de fabrication des vignettes', |
|
| 401 | - 'info_impossible_lire_page' => '<b>Erreur !</b> Impossible de lire la page <tt><html>@test_proxy@</html></tt> à travers le proxy ', |
|
| 402 | - 'info_installation_systeme_publication' => 'Installation du système de publication...', |
|
| 403 | - 'info_installer_documents' => 'Vous pouvez installer automatiquement tous les documents contenus dans le dossier @upload@.', |
|
| 404 | - 'info_installer_ftp' => 'En tant qu’administrateur, vous pouvez installer (par FTP) des fichiers dans le dossier @upload@ pour ensuite les sélectionner directement ici.', |
|
| 405 | - 'info_installer_images' => 'Vous pouvez installer des images aux formats JPEG, GIF et PNG.', |
|
| 406 | - 'info_installer_images_dossier' => 'Installer des images dans le dossier @upload@ pour pouvoir les sélectionner ici.', |
|
| 407 | - 'info_interface_complete' => 'interface complète', |
|
| 408 | - 'info_interface_simple' => 'Interface simplifiée', |
|
| 409 | - 'info_joindre_document_article' => 'Vous pouvez joindre à cet article des documents de type', |
|
| 410 | - 'info_joindre_document_rubrique' => 'Vous pouvez ajouter dans cette rubrique des documents de type', |
|
| 411 | - 'info_joindre_documents_article' => 'Vous pouvez joindre à votre article des documents de type :', |
|
| 412 | - 'info_l_article' => 'l’article', |
|
| 413 | - 'info_la_breve' => 'la brève', |
|
| 414 | - 'info_la_rubrique' => 'la rubrique', |
|
| 415 | - 'info_langue_principale' => 'Langue principale du site', |
|
| 416 | - 'info_largeur_vignette' => '@largeur_vignette@ × @hauteur_vignette@ pixels', |
|
| 417 | - 'info_les_auteurs_1' => 'par @les_auteurs@', |
|
| 418 | - 'info_logo_format_interdit' => 'Seuls les logos aux formats @formats@ sont autorisés.', |
|
| 419 | - 'info_logo_max_poids' => 'Les logos doivent obligatoirement faire moins de @maxi@ (ce fichier fait @actuel@).', |
|
| 420 | - 'info_mail_fournisseur' => '[email protected]', |
|
| 421 | - 'info_message_2' => 'MESSAGE', |
|
| 422 | - 'info_message_supprime' => 'MESSAGE SUPPRIMÉ', |
|
| 423 | - 'info_messages_nb' => '@nb@ messages', |
|
| 424 | - 'info_messages_un' => '1 message', |
|
| 425 | - 'info_mise_en_ligne' => 'Date de mise en ligne :', |
|
| 426 | - 'info_modification_parametres_securite' => 'modifications des paramètres de sécurité', |
|
| 427 | - 'info_mois_courant' => 'Dans le courant du mois :', |
|
| 428 | - 'info_mot_cle_ajoute' => 'Le mot-clé suivant a été ajouté à', |
|
| 429 | - 'info_multi_herit' => 'Langue par défaut', |
|
| 430 | - 'info_multi_langues_soulignees' => 'Les <u>langues soulignées</u> bénéficient d’une traduction totale ou partielle des textes de l’interface. Si vous sélectionnez ces langues, de nombreux éléments du site public (dates, formulaires) seront automatiquement traduits. Pour les langues non soulignées, ces éléments apparaîtront dans la langue principale du site.', |
|
| 431 | - 'info_multilinguisme' => 'Multilinguisme', |
|
| 432 | - 'info_nom_non_utilisateurs_connectes' => 'Votre nom n’apparaît pas dans la liste des utilisateurs connectés.', |
|
| 433 | - 'info_nom_utilisateurs_connectes' => 'Votre nom apparaît dans la liste des utilisateurs connectés.', |
|
| 434 | - 'info_nombre_en_ligne' => 'Actuellement en ligne :', |
|
| 435 | - 'info_non_resultat' => 'Aucun résultat pour "@cherche_mot@"', |
|
| 436 | - 'info_non_utilisation_messagerie' => 'Vous n’utilisez pas la messagerie interne de ce site.', |
|
| 437 | - 'info_nouveau_message' => 'VOUS AVEZ UN NOUVEAU MESSAGE', |
|
| 438 | - 'info_nouveaux_messages' => 'VOUS AVEZ @total_messages@ NOUVEAUX MESSAGES', |
|
| 439 | - 'info_numero_abbreviation' => 'N° ', |
|
| 440 | - 'info_obligatoire' => 'Cette information est obligatoire', |
|
| 441 | - 'info_page_actuelle' => 'Page actuelle', |
|
| 442 | - 'info_pense_bete' => 'PENSE-BÊTE', |
|
| 443 | - 'info_petit_ecran' => 'Petit écran', |
|
| 444 | - 'info_petition_close' => 'Pétition close', |
|
| 445 | - 'info_pixels' => 'pixels', |
|
| 446 | - 'info_plusieurs_mots_trouves' => 'Plusieurs mots-clés trouvés pour "@cherche_mot@" :', |
|
| 447 | - 'info_portfolio_automatique' => 'Portfolio automatique :', |
|
| 448 | - 'info_premier_resultat' => '[@debut_limit@ premiers résultats sur @total@]', |
|
| 449 | - 'info_premier_resultat_sur' => '[@debut_limit@ premiers résultats sur @total@]', |
|
| 450 | - 'info_propose_1' => '[@nom_site_spip@] Propose : @titre@', |
|
| 451 | - 'info_propose_2' => 'Article proposé |
|
| 395 | + 'info_fini' => 'C’est fini !', |
|
| 396 | + 'info_format_image' => 'Formats d’images pouvant être utilisées pour créer des vignettes : @gd_formats@.', |
|
| 397 | + 'info_format_non_defini' => 'format non défini', |
|
| 398 | + 'info_grand_ecran' => 'Grand écran', |
|
| 399 | + 'info_image_aide' => 'AIDE', |
|
| 400 | + 'info_image_process_titre' => 'Méthode de fabrication des vignettes', |
|
| 401 | + 'info_impossible_lire_page' => '<b>Erreur !</b> Impossible de lire la page <tt><html>@test_proxy@</html></tt> à travers le proxy ', |
|
| 402 | + 'info_installation_systeme_publication' => 'Installation du système de publication...', |
|
| 403 | + 'info_installer_documents' => 'Vous pouvez installer automatiquement tous les documents contenus dans le dossier @upload@.', |
|
| 404 | + 'info_installer_ftp' => 'En tant qu’administrateur, vous pouvez installer (par FTP) des fichiers dans le dossier @upload@ pour ensuite les sélectionner directement ici.', |
|
| 405 | + 'info_installer_images' => 'Vous pouvez installer des images aux formats JPEG, GIF et PNG.', |
|
| 406 | + 'info_installer_images_dossier' => 'Installer des images dans le dossier @upload@ pour pouvoir les sélectionner ici.', |
|
| 407 | + 'info_interface_complete' => 'interface complète', |
|
| 408 | + 'info_interface_simple' => 'Interface simplifiée', |
|
| 409 | + 'info_joindre_document_article' => 'Vous pouvez joindre à cet article des documents de type', |
|
| 410 | + 'info_joindre_document_rubrique' => 'Vous pouvez ajouter dans cette rubrique des documents de type', |
|
| 411 | + 'info_joindre_documents_article' => 'Vous pouvez joindre à votre article des documents de type :', |
|
| 412 | + 'info_l_article' => 'l’article', |
|
| 413 | + 'info_la_breve' => 'la brève', |
|
| 414 | + 'info_la_rubrique' => 'la rubrique', |
|
| 415 | + 'info_langue_principale' => 'Langue principale du site', |
|
| 416 | + 'info_largeur_vignette' => '@largeur_vignette@ × @hauteur_vignette@ pixels', |
|
| 417 | + 'info_les_auteurs_1' => 'par @les_auteurs@', |
|
| 418 | + 'info_logo_format_interdit' => 'Seuls les logos aux formats @formats@ sont autorisés.', |
|
| 419 | + 'info_logo_max_poids' => 'Les logos doivent obligatoirement faire moins de @maxi@ (ce fichier fait @actuel@).', |
|
| 420 | + 'info_mail_fournisseur' => '[email protected]', |
|
| 421 | + 'info_message_2' => 'MESSAGE', |
|
| 422 | + 'info_message_supprime' => 'MESSAGE SUPPRIMÉ', |
|
| 423 | + 'info_messages_nb' => '@nb@ messages', |
|
| 424 | + 'info_messages_un' => '1 message', |
|
| 425 | + 'info_mise_en_ligne' => 'Date de mise en ligne :', |
|
| 426 | + 'info_modification_parametres_securite' => 'modifications des paramètres de sécurité', |
|
| 427 | + 'info_mois_courant' => 'Dans le courant du mois :', |
|
| 428 | + 'info_mot_cle_ajoute' => 'Le mot-clé suivant a été ajouté à', |
|
| 429 | + 'info_multi_herit' => 'Langue par défaut', |
|
| 430 | + 'info_multi_langues_soulignees' => 'Les <u>langues soulignées</u> bénéficient d’une traduction totale ou partielle des textes de l’interface. Si vous sélectionnez ces langues, de nombreux éléments du site public (dates, formulaires) seront automatiquement traduits. Pour les langues non soulignées, ces éléments apparaîtront dans la langue principale du site.', |
|
| 431 | + 'info_multilinguisme' => 'Multilinguisme', |
|
| 432 | + 'info_nom_non_utilisateurs_connectes' => 'Votre nom n’apparaît pas dans la liste des utilisateurs connectés.', |
|
| 433 | + 'info_nom_utilisateurs_connectes' => 'Votre nom apparaît dans la liste des utilisateurs connectés.', |
|
| 434 | + 'info_nombre_en_ligne' => 'Actuellement en ligne :', |
|
| 435 | + 'info_non_resultat' => 'Aucun résultat pour "@cherche_mot@"', |
|
| 436 | + 'info_non_utilisation_messagerie' => 'Vous n’utilisez pas la messagerie interne de ce site.', |
|
| 437 | + 'info_nouveau_message' => 'VOUS AVEZ UN NOUVEAU MESSAGE', |
|
| 438 | + 'info_nouveaux_messages' => 'VOUS AVEZ @total_messages@ NOUVEAUX MESSAGES', |
|
| 439 | + 'info_numero_abbreviation' => 'N° ', |
|
| 440 | + 'info_obligatoire' => 'Cette information est obligatoire', |
|
| 441 | + 'info_page_actuelle' => 'Page actuelle', |
|
| 442 | + 'info_pense_bete' => 'PENSE-BÊTE', |
|
| 443 | + 'info_petit_ecran' => 'Petit écran', |
|
| 444 | + 'info_petition_close' => 'Pétition close', |
|
| 445 | + 'info_pixels' => 'pixels', |
|
| 446 | + 'info_plusieurs_mots_trouves' => 'Plusieurs mots-clés trouvés pour "@cherche_mot@" :', |
|
| 447 | + 'info_portfolio_automatique' => 'Portfolio automatique :', |
|
| 448 | + 'info_premier_resultat' => '[@debut_limit@ premiers résultats sur @total@]', |
|
| 449 | + 'info_premier_resultat_sur' => '[@debut_limit@ premiers résultats sur @total@]', |
|
| 450 | + 'info_propose_1' => '[@nom_site_spip@] Propose : @titre@', |
|
| 451 | + 'info_propose_2' => 'Article proposé |
|
| 452 | 452 | ---------------', |
| 453 | - 'info_propose_3' => 'L’article "@titre@" est proposé à la publication.', |
|
| 454 | - 'info_propose_4' => 'Vous êtes invité à venir le consulter et à donner votre opinion', |
|
| 455 | - 'info_propose_5' => 'dans le forum qui lui est attaché. Il est disponible à l’adresse :', |
|
| 456 | - 'info_publie_01' => 'L’article "@titre@" a été validé par @connect_nom@.', |
|
| 457 | - 'info_publie_1' => '[@nom_site_spip@] PUBLIE : @titre@', |
|
| 458 | - 'info_publie_2' => 'Article publié |
|
| 453 | + 'info_propose_3' => 'L’article "@titre@" est proposé à la publication.', |
|
| 454 | + 'info_propose_4' => 'Vous êtes invité à venir le consulter et à donner votre opinion', |
|
| 455 | + 'info_propose_5' => 'dans le forum qui lui est attaché. Il est disponible à l’adresse :', |
|
| 456 | + 'info_publie_01' => 'L’article "@titre@" a été validé par @connect_nom@.', |
|
| 457 | + 'info_publie_1' => '[@nom_site_spip@] PUBLIE : @titre@', |
|
| 458 | + 'info_publie_2' => 'Article publié |
|
| 459 | 459 | --------------', |
| 460 | - 'info_rechercher' => 'Rechercher', |
|
| 461 | - 'info_rechercher_02' => 'Rechercher :', |
|
| 462 | - 'info_remplacer_vignette' => 'Remplacer la vignette par défaut par un logo personnalisé :', |
|
| 463 | - 'info_rubriques_nb' => '@nb@ rubriques', |
|
| 464 | - 'info_rubriques_un' => '1 rubrique', |
|
| 465 | - 'info_sans_titre_2' => 'sans titre', |
|
| 466 | - 'info_selectionner_fichier' => 'Vous pouvez sélectionner un fichier du dossier @upload@', |
|
| 467 | - 'info_selectionner_fichier_2' => 'Sélectionner un fichier :', |
|
| 468 | - 'info_sites_nb' => '@nb@ sites', |
|
| 469 | - 'info_sites_un' => '1 site', |
|
| 470 | - 'info_supprimer_vignette' => 'supprimer la vignette', |
|
| 471 | - 'info_symbole_bleu' => 'Le symbole <b>bleu</b> indique un <b>pense-bête</b> : c’est-à-dire un message à votre usage personnel.', |
|
| 472 | - 'info_symbole_jaune' => 'Le symbole <b>jaune</b> indique une <b>annonce à tous les rédacteurs</b> : modifiable par tous les administrateurs, et visible par tous les rédacteurs.', |
|
| 473 | - 'info_symbole_vert' => 'Le symbole <b>vert</b> indique les <b>messages échangés avec d’autres utilisateurs</b> du site.', |
|
| 474 | - 'info_telecharger_nouveau_logo' => 'Télécharger un nouveau logo :', |
|
| 475 | - 'info_telecharger_ordinateur' => 'Télécharger depuis votre ordinateur :', |
|
| 476 | - 'info_tous_resultats_enregistres' => '[tous les résultats sont enregistrés]', |
|
| 477 | - 'info_tout_afficher' => 'Tout afficher', |
|
| 478 | - 'info_travaux_texte' => 'Ce site n’est pas encore configuré. Revenez plus tard...', |
|
| 479 | - 'info_travaux_titre' => 'Site en travaux', |
|
| 480 | - 'info_trop_resultat' => 'Trop de résultats pour "@cherche_mot@" ; veuillez affiner la recherche.', |
|
| 481 | - 'info_utilisation_messagerie_interne' => 'Vous utilisez la messagerie interne de ce site.', |
|
| 482 | - 'info_valider_lien' => 'valider ce lien', |
|
| 483 | - 'info_verifier_image' => ', veuillez vérifier que vos images ont été transférées correctement.', |
|
| 484 | - 'info_vignette_defaut' => 'Vignette par défaut', |
|
| 485 | - 'info_vignette_personnalisee' => 'Vignette personnalisée', |
|
| 486 | - 'info_visite' => 'visite :', |
|
| 487 | - 'info_vos_rendez_vous' => 'Vos rendez-vous à venir', |
|
| 488 | - 'infos_vos_pense_bete' => 'Vos pense-bêtes', |
|
| 460 | + 'info_rechercher' => 'Rechercher', |
|
| 461 | + 'info_rechercher_02' => 'Rechercher :', |
|
| 462 | + 'info_remplacer_vignette' => 'Remplacer la vignette par défaut par un logo personnalisé :', |
|
| 463 | + 'info_rubriques_nb' => '@nb@ rubriques', |
|
| 464 | + 'info_rubriques_un' => '1 rubrique', |
|
| 465 | + 'info_sans_titre_2' => 'sans titre', |
|
| 466 | + 'info_selectionner_fichier' => 'Vous pouvez sélectionner un fichier du dossier @upload@', |
|
| 467 | + 'info_selectionner_fichier_2' => 'Sélectionner un fichier :', |
|
| 468 | + 'info_sites_nb' => '@nb@ sites', |
|
| 469 | + 'info_sites_un' => '1 site', |
|
| 470 | + 'info_supprimer_vignette' => 'supprimer la vignette', |
|
| 471 | + 'info_symbole_bleu' => 'Le symbole <b>bleu</b> indique un <b>pense-bête</b> : c’est-à-dire un message à votre usage personnel.', |
|
| 472 | + 'info_symbole_jaune' => 'Le symbole <b>jaune</b> indique une <b>annonce à tous les rédacteurs</b> : modifiable par tous les administrateurs, et visible par tous les rédacteurs.', |
|
| 473 | + 'info_symbole_vert' => 'Le symbole <b>vert</b> indique les <b>messages échangés avec d’autres utilisateurs</b> du site.', |
|
| 474 | + 'info_telecharger_nouveau_logo' => 'Télécharger un nouveau logo :', |
|
| 475 | + 'info_telecharger_ordinateur' => 'Télécharger depuis votre ordinateur :', |
|
| 476 | + 'info_tous_resultats_enregistres' => '[tous les résultats sont enregistrés]', |
|
| 477 | + 'info_tout_afficher' => 'Tout afficher', |
|
| 478 | + 'info_travaux_texte' => 'Ce site n’est pas encore configuré. Revenez plus tard...', |
|
| 479 | + 'info_travaux_titre' => 'Site en travaux', |
|
| 480 | + 'info_trop_resultat' => 'Trop de résultats pour "@cherche_mot@" ; veuillez affiner la recherche.', |
|
| 481 | + 'info_utilisation_messagerie_interne' => 'Vous utilisez la messagerie interne de ce site.', |
|
| 482 | + 'info_valider_lien' => 'valider ce lien', |
|
| 483 | + 'info_verifier_image' => ', veuillez vérifier que vos images ont été transférées correctement.', |
|
| 484 | + 'info_vignette_defaut' => 'Vignette par défaut', |
|
| 485 | + 'info_vignette_personnalisee' => 'Vignette personnalisée', |
|
| 486 | + 'info_visite' => 'visite :', |
|
| 487 | + 'info_vos_rendez_vous' => 'Vos rendez-vous à venir', |
|
| 488 | + 'infos_vos_pense_bete' => 'Vos pense-bêtes', |
|
| 489 | 489 | |
| 490 | - // L |
|
| 491 | - 'label_ajout_id_rapide' => 'Ajout rapide', |
|
| 492 | - 'label_poids_fichier' => 'Taille', |
|
| 493 | - 'label_ponctuer' => '@label@ :', |
|
| 494 | - 'lien_afficher_icones_seuls' => 'Afficher uniquement les icones', |
|
| 495 | - 'lien_afficher_texte_icones' => 'Afficher les icones et le texte', |
|
| 496 | - 'lien_afficher_texte_seul' => 'Afficher uniquement le texte', |
|
| 497 | - 'lien_aller_a_la_derniere_page' => 'Aller à la dernière page', |
|
| 498 | - 'lien_aller_a_la_page_nb' => 'Aller à la page @nb@', |
|
| 499 | - 'lien_aller_a_la_page_precedente' => 'Aller à la page précédente', |
|
| 500 | - 'lien_aller_a_la_page_suivante' => 'Aller à la page suivante', |
|
| 501 | - 'lien_aller_a_la_premiere_page' => 'Aller à la première page', |
|
| 502 | - 'lien_liberer' => 'libérer', |
|
| 503 | - 'lien_liberer_tous' => 'Tout libérer', |
|
| 504 | - 'lien_nouvea_pense_bete' => 'NOUVEAU PENSE-BÊTE', |
|
| 505 | - 'lien_nouveau_message' => 'NOUVEAU MESSAGE', |
|
| 506 | - 'lien_nouvelle_annonce' => 'NOUVELLE ANNONCE', |
|
| 507 | - 'lien_petitions' => 'PÉTITION', |
|
| 508 | - 'lien_popularite' => 'popularité : @popularite@%', |
|
| 509 | - 'lien_racine_site' => 'RACINE DU SITE', |
|
| 510 | - 'lien_reessayer' => 'réessayer', |
|
| 511 | - 'lien_repondre_message' => 'Répondre à ce message', |
|
| 512 | - 'lien_supprimer' => 'supprimer', |
|
| 513 | - 'lien_tout_afficher' => 'Tout afficher', |
|
| 514 | - 'lien_visite_site' => 'visiter ce site', |
|
| 515 | - 'lien_visites' => '@visites@ visites', |
|
| 516 | - 'lien_voir_auteur' => 'Voir cet auteur', |
|
| 517 | - 'ligne' => 'Ligne', |
|
| 518 | - 'login' => 'Connexion', |
|
| 519 | - 'login_acces_prive' => 'accès à l’espace privé', |
|
| 520 | - 'login_autre_identifiant' => 'se connecter sous un autre identifiant', |
|
| 521 | - 'login_cookie_accepte' => 'Veuillez régler votre navigateur pour qu’il les accepte (au moins pour ce site).', |
|
| 522 | - 'login_cookie_oblige' => 'Pour vous identifier de façon sûre sur ce site, vous devez accepter les cookies.', |
|
| 523 | - 'login_deconnexion_ok' => 'Déconnexion effectuée.', |
|
| 524 | - 'login_erreur_pass' => 'Erreur de mot de passe.', |
|
| 525 | - 'login_espace_prive' => 'espace privé', |
|
| 526 | - 'login_identifiant_inconnu' => 'L’identifiant « @login@ » est inconnu.', |
|
| 527 | - 'login_login' => 'Login :', |
|
| 528 | - 'login_login2' => 'Login ou adresse email :', |
|
| 529 | - 'login_login_pass_incorrect' => '(Login ou mot de passe incorrect.)', |
|
| 530 | - 'login_motpasseoublie' => 'mot de passe oublié ?', |
|
| 531 | - 'login_non_securise' => 'Attention, ce formulaire n’est pas sécurisé. |
|
| 490 | + // L |
|
| 491 | + 'label_ajout_id_rapide' => 'Ajout rapide', |
|
| 492 | + 'label_poids_fichier' => 'Taille', |
|
| 493 | + 'label_ponctuer' => '@label@ :', |
|
| 494 | + 'lien_afficher_icones_seuls' => 'Afficher uniquement les icones', |
|
| 495 | + 'lien_afficher_texte_icones' => 'Afficher les icones et le texte', |
|
| 496 | + 'lien_afficher_texte_seul' => 'Afficher uniquement le texte', |
|
| 497 | + 'lien_aller_a_la_derniere_page' => 'Aller à la dernière page', |
|
| 498 | + 'lien_aller_a_la_page_nb' => 'Aller à la page @nb@', |
|
| 499 | + 'lien_aller_a_la_page_precedente' => 'Aller à la page précédente', |
|
| 500 | + 'lien_aller_a_la_page_suivante' => 'Aller à la page suivante', |
|
| 501 | + 'lien_aller_a_la_premiere_page' => 'Aller à la première page', |
|
| 502 | + 'lien_liberer' => 'libérer', |
|
| 503 | + 'lien_liberer_tous' => 'Tout libérer', |
|
| 504 | + 'lien_nouvea_pense_bete' => 'NOUVEAU PENSE-BÊTE', |
|
| 505 | + 'lien_nouveau_message' => 'NOUVEAU MESSAGE', |
|
| 506 | + 'lien_nouvelle_annonce' => 'NOUVELLE ANNONCE', |
|
| 507 | + 'lien_petitions' => 'PÉTITION', |
|
| 508 | + 'lien_popularite' => 'popularité : @popularite@%', |
|
| 509 | + 'lien_racine_site' => 'RACINE DU SITE', |
|
| 510 | + 'lien_reessayer' => 'réessayer', |
|
| 511 | + 'lien_repondre_message' => 'Répondre à ce message', |
|
| 512 | + 'lien_supprimer' => 'supprimer', |
|
| 513 | + 'lien_tout_afficher' => 'Tout afficher', |
|
| 514 | + 'lien_visite_site' => 'visiter ce site', |
|
| 515 | + 'lien_visites' => '@visites@ visites', |
|
| 516 | + 'lien_voir_auteur' => 'Voir cet auteur', |
|
| 517 | + 'ligne' => 'Ligne', |
|
| 518 | + 'login' => 'Connexion', |
|
| 519 | + 'login_acces_prive' => 'accès à l’espace privé', |
|
| 520 | + 'login_autre_identifiant' => 'se connecter sous un autre identifiant', |
|
| 521 | + 'login_cookie_accepte' => 'Veuillez régler votre navigateur pour qu’il les accepte (au moins pour ce site).', |
|
| 522 | + 'login_cookie_oblige' => 'Pour vous identifier de façon sûre sur ce site, vous devez accepter les cookies.', |
|
| 523 | + 'login_deconnexion_ok' => 'Déconnexion effectuée.', |
|
| 524 | + 'login_erreur_pass' => 'Erreur de mot de passe.', |
|
| 525 | + 'login_espace_prive' => 'espace privé', |
|
| 526 | + 'login_identifiant_inconnu' => 'L’identifiant « @login@ » est inconnu.', |
|
| 527 | + 'login_login' => 'Login :', |
|
| 528 | + 'login_login2' => 'Login ou adresse email :', |
|
| 529 | + 'login_login_pass_incorrect' => '(Login ou mot de passe incorrect.)', |
|
| 530 | + 'login_motpasseoublie' => 'mot de passe oublié ?', |
|
| 531 | + 'login_non_securise' => 'Attention, ce formulaire n’est pas sécurisé. |
|
| 532 | 532 | Si vous ne voulez pas que votre mot de passe puisse être |
| 533 | 533 | intercepté sur le réseau, veuillez activer Javascript |
| 534 | 534 | dans votre navigateur et', |
| 535 | - 'login_nouvelle_tentative' => 'Nouvelle tentative', |
|
| 536 | - 'login_par_ici' => 'Vous êtes enregistré... par ici...', |
|
| 537 | - 'login_pass2' => 'Mot de passe :', |
|
| 538 | - 'login_preferez_refuser' => '<b>Si vous préférez refuser les cookies</b>, une autre méthode de connexion (moins sécurisée) est à votre disposition :', |
|
| 539 | - 'login_recharger' => 'recharger cette page', |
|
| 540 | - 'login_rester_identifie' => 'Se souvenir de moi', |
|
| 541 | - 'login_retour_public' => 'Retour au site public', |
|
| 542 | - 'login_retour_site' => 'Retour au site public', |
|
| 543 | - 'login_retoursitepublic' => 'retour au site public', |
|
| 544 | - 'login_sans_cookie' => 'Identification sans cookie', |
|
| 545 | - 'login_securise' => 'Login sécurisé', |
|
| 546 | - 'login_sinscrire' => 'S’inscrire', |
|
| 547 | - 'login_test_navigateur' => 'test navigateur/reconnexion', |
|
| 548 | - 'login_verifiez_navigateur' => '(Vérifiez toutefois que votre navigateur n’a pas mémorisé votre mot de passe...)', |
|
| 535 | + 'login_nouvelle_tentative' => 'Nouvelle tentative', |
|
| 536 | + 'login_par_ici' => 'Vous êtes enregistré... par ici...', |
|
| 537 | + 'login_pass2' => 'Mot de passe :', |
|
| 538 | + 'login_preferez_refuser' => '<b>Si vous préférez refuser les cookies</b>, une autre méthode de connexion (moins sécurisée) est à votre disposition :', |
|
| 539 | + 'login_recharger' => 'recharger cette page', |
|
| 540 | + 'login_rester_identifie' => 'Se souvenir de moi', |
|
| 541 | + 'login_retour_public' => 'Retour au site public', |
|
| 542 | + 'login_retour_site' => 'Retour au site public', |
|
| 543 | + 'login_retoursitepublic' => 'retour au site public', |
|
| 544 | + 'login_sans_cookie' => 'Identification sans cookie', |
|
| 545 | + 'login_securise' => 'Login sécurisé', |
|
| 546 | + 'login_sinscrire' => 'S’inscrire', |
|
| 547 | + 'login_test_navigateur' => 'test navigateur/reconnexion', |
|
| 548 | + 'login_verifiez_navigateur' => '(Vérifiez toutefois que votre navigateur n’a pas mémorisé votre mot de passe...)', |
|
| 549 | 549 | |
| 550 | - // M |
|
| 551 | - 'masquer_colonne' => 'Masquer cette colonne', |
|
| 552 | - 'masquer_trad' => 'masquer les traductions', |
|
| 553 | - 'message_nouveaux_identifiants_echec' => 'Impossible de générer de nouveaux identifiants.', |
|
| 554 | - 'message_nouveaux_identifiants_echec_envoi' => 'Les nouveaux identifiants de connexion n’ont pas pu être envoyés.', |
|
| 555 | - 'message_nouveaux_identifiants_ok' => 'Les nouveaux identifiants de connexion ont été envoyés à @email@.', |
|
| 556 | - 'module_fichiers_langues' => 'Fichiers de langue', |
|
| 550 | + // M |
|
| 551 | + 'masquer_colonne' => 'Masquer cette colonne', |
|
| 552 | + 'masquer_trad' => 'masquer les traductions', |
|
| 553 | + 'message_nouveaux_identifiants_echec' => 'Impossible de générer de nouveaux identifiants.', |
|
| 554 | + 'message_nouveaux_identifiants_echec_envoi' => 'Les nouveaux identifiants de connexion n’ont pas pu être envoyés.', |
|
| 555 | + 'message_nouveaux_identifiants_ok' => 'Les nouveaux identifiants de connexion ont été envoyés à @email@.', |
|
| 556 | + 'module_fichiers_langues' => 'Fichiers de langue', |
|
| 557 | 557 | |
| 558 | - // N |
|
| 559 | - 'navigateur_pas_redirige' => 'Si votre navigateur n’est pas redirigé, cliquez ici pour continuer.', |
|
| 560 | - 'numero' => 'Numéro', |
|
| 558 | + // N |
|
| 559 | + 'navigateur_pas_redirige' => 'Si votre navigateur n’est pas redirigé, cliquez ici pour continuer.', |
|
| 560 | + 'numero' => 'Numéro', |
|
| 561 | 561 | |
| 562 | - // O |
|
| 563 | - 'occurence' => 'Occurrence', |
|
| 564 | - 'onglet_affacer_base' => 'Effacer la base', |
|
| 565 | - 'onglet_auteur' => 'L’auteur', |
|
| 566 | - 'onglet_contenu_site' => 'Contenu du site', |
|
| 567 | - 'onglet_evolution_visite_mod' => 'Évolution', |
|
| 568 | - 'onglet_fonctions_avances' => 'Fonctions avancées', |
|
| 569 | - 'onglet_informations_personnelles' => 'Informations personnelles', |
|
| 570 | - 'onglet_interactivite' => 'Interactivité', |
|
| 571 | - 'onglet_messagerie' => 'Messagerie', |
|
| 572 | - 'onglet_repartition_rubrique' => 'Répartition par rubriques', |
|
| 573 | - 'onglet_save_restaur_base' => 'Sauvegarder/restaurer la base', |
|
| 574 | - 'onglet_vider_cache' => 'Vider le cache', |
|
| 562 | + // O |
|
| 563 | + 'occurence' => 'Occurrence', |
|
| 564 | + 'onglet_affacer_base' => 'Effacer la base', |
|
| 565 | + 'onglet_auteur' => 'L’auteur', |
|
| 566 | + 'onglet_contenu_site' => 'Contenu du site', |
|
| 567 | + 'onglet_evolution_visite_mod' => 'Évolution', |
|
| 568 | + 'onglet_fonctions_avances' => 'Fonctions avancées', |
|
| 569 | + 'onglet_informations_personnelles' => 'Informations personnelles', |
|
| 570 | + 'onglet_interactivite' => 'Interactivité', |
|
| 571 | + 'onglet_messagerie' => 'Messagerie', |
|
| 572 | + 'onglet_repartition_rubrique' => 'Répartition par rubriques', |
|
| 573 | + 'onglet_save_restaur_base' => 'Sauvegarder/restaurer la base', |
|
| 574 | + 'onglet_vider_cache' => 'Vider le cache', |
|
| 575 | 575 | |
| 576 | - // P |
|
| 577 | - 'pass_choix_pass' => 'Veuillez choisir votre nouveau mot de passe :', |
|
| 578 | - 'pass_erreur' => 'Erreur', |
|
| 579 | - 'pass_erreur_acces_refuse' => '<b>Erreur :</b> vous n’avez plus accès à ce site.', |
|
| 580 | - 'pass_erreur_code_inconnu' => '<b>Erreur :</b> ce code ne correspond à aucun des visiteurs ayant accès à ce site.', |
|
| 581 | - 'pass_erreur_non_enregistre' => '<b>Erreur :</b> l’adresse <tt>@email_oubli@</tt> n’est pas enregistrée sur ce site.', |
|
| 582 | - 'pass_erreur_non_valide' => '<b>Erreur :</b> cet email <tt>@email_oubli@</tt> n’est pas valide !', |
|
| 583 | - 'pass_erreur_probleme_technique' => '<b>Erreur :</b> à cause d’un problème technique, l’email ne peut pas être envoyé.', |
|
| 584 | - 'pass_espace_prive_bla' => 'L’espace privé de ce site est ouvert aux |
|
| 576 | + // P |
|
| 577 | + 'pass_choix_pass' => 'Veuillez choisir votre nouveau mot de passe :', |
|
| 578 | + 'pass_erreur' => 'Erreur', |
|
| 579 | + 'pass_erreur_acces_refuse' => '<b>Erreur :</b> vous n’avez plus accès à ce site.', |
|
| 580 | + 'pass_erreur_code_inconnu' => '<b>Erreur :</b> ce code ne correspond à aucun des visiteurs ayant accès à ce site.', |
|
| 581 | + 'pass_erreur_non_enregistre' => '<b>Erreur :</b> l’adresse <tt>@email_oubli@</tt> n’est pas enregistrée sur ce site.', |
|
| 582 | + 'pass_erreur_non_valide' => '<b>Erreur :</b> cet email <tt>@email_oubli@</tt> n’est pas valide !', |
|
| 583 | + 'pass_erreur_probleme_technique' => '<b>Erreur :</b> à cause d’un problème technique, l’email ne peut pas être envoyé.', |
|
| 584 | + 'pass_espace_prive_bla' => 'L’espace privé de ce site est ouvert aux |
|
| 585 | 585 | visiteurs, après inscription. Une fois enregistré, |
| 586 | 586 | vous pourrez consulter les articles en cours de rédaction, |
| 587 | 587 | proposer des articles et participer à tous les forums.', |
| 588 | - 'pass_forum_bla' => 'Vous avez demandé à intervenir sur un forum |
|
| 588 | + 'pass_forum_bla' => 'Vous avez demandé à intervenir sur un forum |
|
| 589 | 589 | réservé aux visiteurs enregistrés.', |
| 590 | - 'pass_indiquez_cidessous' => 'Indiquez ci-dessous l’adresse email sous laquelle vous |
|
| 590 | + 'pass_indiquez_cidessous' => 'Indiquez ci-dessous l’adresse email sous laquelle vous |
|
| 591 | 591 | vous êtes précédemment enregistré. Vous |
| 592 | 592 | recevrez un email vous indiquant la marche à suivre pour |
| 593 | 593 | récupérer votre accès.', |
| 594 | - 'pass_mail_passcookie' => '(ceci est un message automatique) |
|
| 594 | + 'pass_mail_passcookie' => '(ceci est un message automatique) |
|
| 595 | 595 | Pour retrouver votre accès au site |
| 596 | 596 | @nom_site_spip@ (@adresse_site@) |
| 597 | 597 | |
@@ -603,150 +603,150 @@ discard block |
||
| 603 | 603 | et vous reconnecter au site. |
| 604 | 604 | |
| 605 | 605 | ', |
| 606 | - 'pass_mot_oublie' => 'Mot de passe oublié', |
|
| 607 | - 'pass_nouveau_enregistre' => 'Votre nouveau mot de passe a été enregistré.', |
|
| 608 | - 'pass_nouveau_pass' => 'Nouveau mot de passe', |
|
| 609 | - 'pass_ok' => 'OK', |
|
| 610 | - 'pass_oubli_mot' => 'Oubli du mot de passe', |
|
| 611 | - 'pass_procedure_changer' => 'Pour modifier votre mot de passe, merci d’indiquer l’adresse email associée à votre compte.', |
|
| 612 | - 'pass_quitter_fenetre' => 'Quitter cette fenêtre', |
|
| 613 | - 'pass_rappel_login' => 'Rappel : votre identifiant (login) est « @login@ ».', |
|
| 614 | - 'pass_recevoir_mail' => 'Un lien de réinitialisation de votre mot de passe vous a été envoyé sur votre adresse email (si celle-ci est valide).', |
|
| 615 | - 'pass_retour_public' => 'Retour sur le site public', |
|
| 616 | - 'pass_rien_a_faire_ici' => 'Rien à faire ici.', |
|
| 617 | - 'pass_vousinscrire' => 'Vous inscrire sur ce site', |
|
| 618 | - 'precedent' => 'précédent', |
|
| 619 | - 'previsualisation' => 'Prévisualisation', |
|
| 620 | - 'previsualiser' => 'Prévisualiser', |
|
| 606 | + 'pass_mot_oublie' => 'Mot de passe oublié', |
|
| 607 | + 'pass_nouveau_enregistre' => 'Votre nouveau mot de passe a été enregistré.', |
|
| 608 | + 'pass_nouveau_pass' => 'Nouveau mot de passe', |
|
| 609 | + 'pass_ok' => 'OK', |
|
| 610 | + 'pass_oubli_mot' => 'Oubli du mot de passe', |
|
| 611 | + 'pass_procedure_changer' => 'Pour modifier votre mot de passe, merci d’indiquer l’adresse email associée à votre compte.', |
|
| 612 | + 'pass_quitter_fenetre' => 'Quitter cette fenêtre', |
|
| 613 | + 'pass_rappel_login' => 'Rappel : votre identifiant (login) est « @login@ ».', |
|
| 614 | + 'pass_recevoir_mail' => 'Un lien de réinitialisation de votre mot de passe vous a été envoyé sur votre adresse email (si celle-ci est valide).', |
|
| 615 | + 'pass_retour_public' => 'Retour sur le site public', |
|
| 616 | + 'pass_rien_a_faire_ici' => 'Rien à faire ici.', |
|
| 617 | + 'pass_vousinscrire' => 'Vous inscrire sur ce site', |
|
| 618 | + 'precedent' => 'précédent', |
|
| 619 | + 'previsualisation' => 'Prévisualisation', |
|
| 620 | + 'previsualiser' => 'Prévisualiser', |
|
| 621 | 621 | |
| 622 | - // R |
|
| 623 | - 'retour' => 'Retour', |
|
| 622 | + // R |
|
| 623 | + 'retour' => 'Retour', |
|
| 624 | 624 | |
| 625 | - // S |
|
| 626 | - 'spip_conforme_dtd' => 'SPIP considère ce document comme conforme à son DOCTYPE :', |
|
| 627 | - 'squelette' => 'squelette', |
|
| 628 | - 'squelette_inclus_ligne' => 'squelette inclus, ligne', |
|
| 629 | - 'squelette_ligne' => 'squelette, ligne', |
|
| 630 | - 'stats_visites_et_popularite' => '@visites@ visites ; popularité : @popularite@', |
|
| 631 | - 'suivant' => 'suivant', |
|
| 625 | + // S |
|
| 626 | + 'spip_conforme_dtd' => 'SPIP considère ce document comme conforme à son DOCTYPE :', |
|
| 627 | + 'squelette' => 'squelette', |
|
| 628 | + 'squelette_inclus_ligne' => 'squelette inclus, ligne', |
|
| 629 | + 'squelette_ligne' => 'squelette, ligne', |
|
| 630 | + 'stats_visites_et_popularite' => '@visites@ visites ; popularité : @popularite@', |
|
| 631 | + 'suivant' => 'suivant', |
|
| 632 | 632 | |
| 633 | - // T |
|
| 634 | - 'taille_go' => '@taille@ Go', |
|
| 635 | - 'taille_ko' => '@taille@ ko', |
|
| 636 | - 'taille_mo' => '@taille@ Mo', |
|
| 637 | - 'taille_octets' => '@taille@ octets', |
|
| 638 | - 'taille_go_bi' => '@taille@ Gio', |
|
| 639 | - 'taille_ko_bi' => '@taille@ kio', |
|
| 640 | - 'taille_mo_bi' => '@taille@ Mio', |
|
| 641 | - 'taille_octets_bi' => '@taille@ octets', |
|
| 642 | - 'texte_actualite_site_1' => 'Quand vous serez familiarisé(e) avec l’interface, vous pourrez cliquer sur « ', |
|
| 643 | - 'texte_actualite_site_2' => 'interface complète', |
|
| 644 | - 'texte_actualite_site_3' => ' » pour ouvrir plus de possibilités.', |
|
| 645 | - 'texte_creation_automatique_vignette' => 'La création automatique de vignettes de prévisualisation est activée sur ce site. Si vous installez à partir de ce formulaire des images au(x) format(s) @gd_formats@, elles seront accompagnées d’une vignette d’une taille maximale de @taille_preview@ pixels.', |
|
| 646 | - 'texte_documents_associes' => 'Les documents suivants sont associés à l’article, |
|
| 633 | + // T |
|
| 634 | + 'taille_go' => '@taille@ Go', |
|
| 635 | + 'taille_ko' => '@taille@ ko', |
|
| 636 | + 'taille_mo' => '@taille@ Mo', |
|
| 637 | + 'taille_octets' => '@taille@ octets', |
|
| 638 | + 'taille_go_bi' => '@taille@ Gio', |
|
| 639 | + 'taille_ko_bi' => '@taille@ kio', |
|
| 640 | + 'taille_mo_bi' => '@taille@ Mio', |
|
| 641 | + 'taille_octets_bi' => '@taille@ octets', |
|
| 642 | + 'texte_actualite_site_1' => 'Quand vous serez familiarisé(e) avec l’interface, vous pourrez cliquer sur « ', |
|
| 643 | + 'texte_actualite_site_2' => 'interface complète', |
|
| 644 | + 'texte_actualite_site_3' => ' » pour ouvrir plus de possibilités.', |
|
| 645 | + 'texte_creation_automatique_vignette' => 'La création automatique de vignettes de prévisualisation est activée sur ce site. Si vous installez à partir de ce formulaire des images au(x) format(s) @gd_formats@, elles seront accompagnées d’une vignette d’une taille maximale de @taille_preview@ pixels.', |
|
| 646 | + 'texte_documents_associes' => 'Les documents suivants sont associés à l’article, |
|
| 647 | 647 | mais ils n’y ont pas été directement |
| 648 | 648 | insérés. Selon la mise en page du site public, |
| 649 | 649 | ils pourront apparaître sous forme de documents joints.', |
| 650 | - 'texte_erreur_mise_niveau_base' => 'Erreur de base de données lors de la mise à niveau. |
|
| 650 | + 'texte_erreur_mise_niveau_base' => 'Erreur de base de données lors de la mise à niveau. |
|
| 651 | 651 | L’image <b>@fichier@</b> n’est pas passée (article @id_article@). |
| 652 | 652 | Notez bien cette référence, réessayez la mise à |
| 653 | 653 | niveau, et enfin vérifiez que les images apparaissent |
| 654 | 654 | toujours dans les articles.', |
| 655 | - 'texte_erreur_visiteur' => 'Vous avez tenté d’accéder à l’espace privé avec un login qui ne le permet pas.', |
|
| 656 | - 'texte_inc_auth_1' => 'Vous êtes identifié sous le |
|
| 655 | + 'texte_erreur_visiteur' => 'Vous avez tenté d’accéder à l’espace privé avec un login qui ne le permet pas.', |
|
| 656 | + 'texte_inc_auth_1' => 'Vous êtes identifié sous le |
|
| 657 | 657 | login <b>@auth_login@</b>, mais celui-ci n’existe pas/plus dans la base. |
| 658 | 658 | Essayez de vous', |
| 659 | - 'texte_inc_auth_2' => 'reconnecter', |
|
| 660 | - 'texte_inc_auth_3' => ', après avoir éventuellement quitté puis |
|
| 659 | + 'texte_inc_auth_2' => 'reconnecter', |
|
| 660 | + 'texte_inc_auth_3' => ', après avoir éventuellement quitté puis |
|
| 661 | 661 | redémarré votre navigateur.', |
| 662 | - 'texte_inc_config' => 'Les modifications effectuées dans ces pages influent notablement sur le |
|
| 662 | + 'texte_inc_config' => 'Les modifications effectuées dans ces pages influent notablement sur le |
|
| 663 | 663 | fonctionnement de votre site. Nous vous recommandons de ne pas y intervenir tant que vous n’êtes pas |
| 664 | 664 | familier du fonctionnement du système SPIP. <br /><br /><b>Plus |
| 665 | 665 | généralement, il est fortement conseillé |
| 666 | 666 | de laisser la charge de ces pages au webmestre principal de votre site.</b>', |
| 667 | - 'texte_inc_meta_1' => 'Le système a rencontré une erreur lors de l’écriture du fichier <code>@fichier@</code>. Veuillez, en tant qu’administrateur du site,', |
|
| 668 | - 'texte_inc_meta_2' => 'vérifier les droits d’écriture', |
|
| 669 | - 'texte_inc_meta_3' => 'sur le répertoire <code>@repertoire@</code>.', |
|
| 670 | - 'texte_statut_en_cours_redaction' => 'en cours de rédaction', |
|
| 671 | - 'texte_statut_poubelle' => 'à la poubelle', |
|
| 672 | - 'texte_statut_propose_evaluation' => 'proposé à l’évaluation', |
|
| 673 | - 'texte_statut_publie' => 'publié en ligne', |
|
| 674 | - 'texte_statut_refuse' => 'refusé', |
|
| 675 | - 'titre_ajouter_mot_cle' => 'AJOUTER UN MOT-CLÉ :', |
|
| 676 | - 'titre_cadre_raccourcis' => 'RACCOURCIS :', |
|
| 677 | - 'titre_changer_couleur_interface' => 'Changer la couleur de l’interface', |
|
| 678 | - 'titre_image_admin_article' => 'Vous pouvez administrer cet article', |
|
| 679 | - 'titre_image_administrateur' => 'Administrateur', |
|
| 680 | - 'titre_image_aide' => 'De l’aide sur cet élément', |
|
| 681 | - 'titre_image_auteur_supprime' => 'Auteur supprimé', |
|
| 682 | - 'titre_image_redacteur' => 'Rédacteur sans accès', |
|
| 683 | - 'titre_image_redacteur_02' => 'Rédacteur', |
|
| 684 | - 'titre_image_selecteur' => 'Afficher la liste', |
|
| 685 | - 'titre_image_visiteur' => 'Visiteur', |
|
| 686 | - 'titre_joindre_document' => 'JOINDRE UN DOCUMENT', |
|
| 687 | - 'titre_mots_cles' => 'MOTS-CLÉS', |
|
| 688 | - 'titre_probleme_technique' => 'Attention : un problème technique (serveur SQL) empêche l’accès à cette partie du site. Merci de votre compréhension.', |
|
| 689 | - 'titre_publier_document' => 'PUBLIER UN DOCUMENT DANS CETTE RUBRIQUE', |
|
| 690 | - 'titre_signatures_attente' => 'Signatures en attente de validation', |
|
| 691 | - 'titre_signatures_confirmees' => 'Signatures confirmées', |
|
| 692 | - 'titre_statistiques' => 'Statistiques du site', |
|
| 693 | - 'titre_titre_document' => 'Titre du document :', |
|
| 694 | - 'todo' => 'à venir', |
|
| 695 | - 'trad_definir_reference' => 'Choisir "@titre@" comme référence des traductions', |
|
| 696 | - 'trad_reference' => '(référence des traductions)', |
|
| 667 | + 'texte_inc_meta_1' => 'Le système a rencontré une erreur lors de l’écriture du fichier <code>@fichier@</code>. Veuillez, en tant qu’administrateur du site,', |
|
| 668 | + 'texte_inc_meta_2' => 'vérifier les droits d’écriture', |
|
| 669 | + 'texte_inc_meta_3' => 'sur le répertoire <code>@repertoire@</code>.', |
|
| 670 | + 'texte_statut_en_cours_redaction' => 'en cours de rédaction', |
|
| 671 | + 'texte_statut_poubelle' => 'à la poubelle', |
|
| 672 | + 'texte_statut_propose_evaluation' => 'proposé à l’évaluation', |
|
| 673 | + 'texte_statut_publie' => 'publié en ligne', |
|
| 674 | + 'texte_statut_refuse' => 'refusé', |
|
| 675 | + 'titre_ajouter_mot_cle' => 'AJOUTER UN MOT-CLÉ :', |
|
| 676 | + 'titre_cadre_raccourcis' => 'RACCOURCIS :', |
|
| 677 | + 'titre_changer_couleur_interface' => 'Changer la couleur de l’interface', |
|
| 678 | + 'titre_image_admin_article' => 'Vous pouvez administrer cet article', |
|
| 679 | + 'titre_image_administrateur' => 'Administrateur', |
|
| 680 | + 'titre_image_aide' => 'De l’aide sur cet élément', |
|
| 681 | + 'titre_image_auteur_supprime' => 'Auteur supprimé', |
|
| 682 | + 'titre_image_redacteur' => 'Rédacteur sans accès', |
|
| 683 | + 'titre_image_redacteur_02' => 'Rédacteur', |
|
| 684 | + 'titre_image_selecteur' => 'Afficher la liste', |
|
| 685 | + 'titre_image_visiteur' => 'Visiteur', |
|
| 686 | + 'titre_joindre_document' => 'JOINDRE UN DOCUMENT', |
|
| 687 | + 'titre_mots_cles' => 'MOTS-CLÉS', |
|
| 688 | + 'titre_probleme_technique' => 'Attention : un problème technique (serveur SQL) empêche l’accès à cette partie du site. Merci de votre compréhension.', |
|
| 689 | + 'titre_publier_document' => 'PUBLIER UN DOCUMENT DANS CETTE RUBRIQUE', |
|
| 690 | + 'titre_signatures_attente' => 'Signatures en attente de validation', |
|
| 691 | + 'titre_signatures_confirmees' => 'Signatures confirmées', |
|
| 692 | + 'titre_statistiques' => 'Statistiques du site', |
|
| 693 | + 'titre_titre_document' => 'Titre du document :', |
|
| 694 | + 'todo' => 'à venir', |
|
| 695 | + 'trad_definir_reference' => 'Choisir "@titre@" comme référence des traductions', |
|
| 696 | + 'trad_reference' => '(référence des traductions)', |
|
| 697 | 697 | |
| 698 | - // U |
|
| 699 | - 'upload_limit' => 'Ce fichier est trop gros pour le serveur ; la taille maximum autorisée en <i>upload</i> est de @max@.', |
|
| 698 | + // U |
|
| 699 | + 'upload_limit' => 'Ce fichier est trop gros pour le serveur ; la taille maximum autorisée en <i>upload</i> est de @max@.', |
|
| 700 | 700 | |
| 701 | - // Z |
|
| 702 | - 'zbug_balise_b_aval' => ' : balise B en aval', |
|
| 703 | - 'zbug_balise_inexistante' => 'Balise @balise@ mal déclarée pour @from@', |
|
| 704 | - 'zbug_balise_sans_argument' => 'Argument manquant dans la balise @balise@', |
|
| 705 | - 'zbug_boucle' => 'boucle', |
|
| 706 | - 'zbug_boucle_recursive_undef' => 'Boucle récursive non définie : @nom@', |
|
| 707 | - 'zbug_calcul' => 'calcul', |
|
| 708 | - 'zbug_champ_hors_boucle' => 'Champ @champ@ hors boucle', |
|
| 709 | - 'zbug_champ_hors_critere' => 'Champ @champ@ hors critère @critere@', |
|
| 710 | - 'zbug_champ_hors_motif' => 'Champ @champ@ hors d’un contexte @motif@', |
|
| 711 | - 'zbug_code' => 'code', |
|
| 712 | - 'zbug_critere_inconnu' => 'Critère inconnu @critere@', |
|
| 713 | - 'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} sur une table sans clef primaire atomique', |
|
| 714 | - 'zbug_distant_interdit' => 'Externe interdit', # Contexte : une base de données "externe", pas gérée par SPIP, mais que SPIP 1.8 sait utiliser dans ses boucles -- seul problèmes certaines manipulations sont interdites sur ces bases-là. |
|
| 715 | - 'zbug_doublon_table_sans_cle_primaire' => 'Doublons sur une table sans clef primaire atomique', |
|
| 716 | - 'zbug_doublon_table_sans_index' => 'Doublons sur une table sans index', |
|
| 717 | - 'zbug_erreur_boucle_double' => 'Double définition de la boucle @id@', |
|
| 718 | - 'zbug_erreur_boucle_fermant' => 'Boucle @id@ non fermée', |
|
| 719 | - 'zbug_erreur_boucle_syntaxe' => 'Syntaxe de la boucle @id@ incorrecte', |
|
| 720 | - 'zbug_erreur_compilation' => 'Erreur de compilation', |
|
| 721 | - 'zbug_erreur_execution_page' => 'Erreur d’exécution', |
|
| 722 | - 'zbug_erreur_filtre' => 'Filtre @filtre@ non défini', |
|
| 723 | - 'zbug_erreur_filtre_nbarg_min' => 'Filtre @filtre@ : il manque @nb@ argument(s)', |
|
| 724 | - 'zbug_erreur_meme_parent' => 'Le critère {meme_parent} ne s’applique qu’aux boucles (FORUMS) ou (RUBRIQUES)', |
|
| 725 | - 'zbug_erreur_squelette' => 'Erreur(s) dans le squelette', |
|
| 726 | - 'zbug_hors_compilation' => 'Hors Compilation', |
|
| 727 | - 'zbug_info_erreur_squelette' => 'Erreur sur le site', |
|
| 728 | - 'zbug_inversion_ordre_inexistant' => 'Inversion d’un ordre inexistant', |
|
| 729 | - 'zbug_pagination_sans_critere' => 'Balise #PAGINATION sans critère {pagination} ou employé dans une boucle récursive', |
|
| 730 | - 'zbug_parametres_inclus_incorrects' => 'Paramètre d’inclusion incorrect : @param@', |
|
| 731 | - 'zbug_profile' => 'Temps de calcul : @time@', |
|
| 732 | - 'zbug_resultat' => 'résultat', |
|
| 733 | - 'zbug_serveur_indefini' => 'Serveur SQL indéfini', |
|
| 734 | - 'zbug_statistiques' => 'Statistiques des requêtes SQL classées par durée', |
|
| 735 | - 'zbug_table_inconnue' => 'Table SQL « @table@ » inconnue', |
|
| 736 | - 'zxml_connus_attributs' => 'attributs connus', |
|
| 737 | - 'zxml_de' => 'de', |
|
| 738 | - 'zxml_inconnu_attribut' => 'attribut inconnu', |
|
| 739 | - 'zxml_inconnu_balise' => 'balise inconnue', |
|
| 740 | - 'zxml_inconnu_entite' => 'entité inconnue', |
|
| 741 | - 'zxml_inconnu_id' => 'ID inconnu', |
|
| 742 | - 'zxml_mais_de' => 'mais de', |
|
| 743 | - 'zxml_non_conforme' => 'n’est pas conforme au motif', |
|
| 744 | - 'zxml_non_fils' => 'n’est pas un fils de', |
|
| 745 | - 'zxml_nonvide_balise' => 'balise non vide', |
|
| 746 | - 'zxml_obligatoire_attribut' => 'attribut obligatoire mais absent dans', |
|
| 747 | - 'zxml_succession_fils_incorrecte' => 'succession des fils incorrecte', |
|
| 748 | - 'zxml_survoler' => 'survoler pour voir les corrects', |
|
| 749 | - 'zxml_valeur_attribut' => 'valeur de l’attribut', |
|
| 750 | - 'zxml_vide_balise' => 'balise vide', |
|
| 751 | - 'zxml_vu' => 'vu auparavant' |
|
| 701 | + // Z |
|
| 702 | + 'zbug_balise_b_aval' => ' : balise B en aval', |
|
| 703 | + 'zbug_balise_inexistante' => 'Balise @balise@ mal déclarée pour @from@', |
|
| 704 | + 'zbug_balise_sans_argument' => 'Argument manquant dans la balise @balise@', |
|
| 705 | + 'zbug_boucle' => 'boucle', |
|
| 706 | + 'zbug_boucle_recursive_undef' => 'Boucle récursive non définie : @nom@', |
|
| 707 | + 'zbug_calcul' => 'calcul', |
|
| 708 | + 'zbug_champ_hors_boucle' => 'Champ @champ@ hors boucle', |
|
| 709 | + 'zbug_champ_hors_critere' => 'Champ @champ@ hors critère @critere@', |
|
| 710 | + 'zbug_champ_hors_motif' => 'Champ @champ@ hors d’un contexte @motif@', |
|
| 711 | + 'zbug_code' => 'code', |
|
| 712 | + 'zbug_critere_inconnu' => 'Critère inconnu @critere@', |
|
| 713 | + 'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} sur une table sans clef primaire atomique', |
|
| 714 | + 'zbug_distant_interdit' => 'Externe interdit', # Contexte : une base de données "externe", pas gérée par SPIP, mais que SPIP 1.8 sait utiliser dans ses boucles -- seul problèmes certaines manipulations sont interdites sur ces bases-là. |
|
| 715 | + 'zbug_doublon_table_sans_cle_primaire' => 'Doublons sur une table sans clef primaire atomique', |
|
| 716 | + 'zbug_doublon_table_sans_index' => 'Doublons sur une table sans index', |
|
| 717 | + 'zbug_erreur_boucle_double' => 'Double définition de la boucle @id@', |
|
| 718 | + 'zbug_erreur_boucle_fermant' => 'Boucle @id@ non fermée', |
|
| 719 | + 'zbug_erreur_boucle_syntaxe' => 'Syntaxe de la boucle @id@ incorrecte', |
|
| 720 | + 'zbug_erreur_compilation' => 'Erreur de compilation', |
|
| 721 | + 'zbug_erreur_execution_page' => 'Erreur d’exécution', |
|
| 722 | + 'zbug_erreur_filtre' => 'Filtre @filtre@ non défini', |
|
| 723 | + 'zbug_erreur_filtre_nbarg_min' => 'Filtre @filtre@ : il manque @nb@ argument(s)', |
|
| 724 | + 'zbug_erreur_meme_parent' => 'Le critère {meme_parent} ne s’applique qu’aux boucles (FORUMS) ou (RUBRIQUES)', |
|
| 725 | + 'zbug_erreur_squelette' => 'Erreur(s) dans le squelette', |
|
| 726 | + 'zbug_hors_compilation' => 'Hors Compilation', |
|
| 727 | + 'zbug_info_erreur_squelette' => 'Erreur sur le site', |
|
| 728 | + 'zbug_inversion_ordre_inexistant' => 'Inversion d’un ordre inexistant', |
|
| 729 | + 'zbug_pagination_sans_critere' => 'Balise #PAGINATION sans critère {pagination} ou employé dans une boucle récursive', |
|
| 730 | + 'zbug_parametres_inclus_incorrects' => 'Paramètre d’inclusion incorrect : @param@', |
|
| 731 | + 'zbug_profile' => 'Temps de calcul : @time@', |
|
| 732 | + 'zbug_resultat' => 'résultat', |
|
| 733 | + 'zbug_serveur_indefini' => 'Serveur SQL indéfini', |
|
| 734 | + 'zbug_statistiques' => 'Statistiques des requêtes SQL classées par durée', |
|
| 735 | + 'zbug_table_inconnue' => 'Table SQL « @table@ » inconnue', |
|
| 736 | + 'zxml_connus_attributs' => 'attributs connus', |
|
| 737 | + 'zxml_de' => 'de', |
|
| 738 | + 'zxml_inconnu_attribut' => 'attribut inconnu', |
|
| 739 | + 'zxml_inconnu_balise' => 'balise inconnue', |
|
| 740 | + 'zxml_inconnu_entite' => 'entité inconnue', |
|
| 741 | + 'zxml_inconnu_id' => 'ID inconnu', |
|
| 742 | + 'zxml_mais_de' => 'mais de', |
|
| 743 | + 'zxml_non_conforme' => 'n’est pas conforme au motif', |
|
| 744 | + 'zxml_non_fils' => 'n’est pas un fils de', |
|
| 745 | + 'zxml_nonvide_balise' => 'balise non vide', |
|
| 746 | + 'zxml_obligatoire_attribut' => 'attribut obligatoire mais absent dans', |
|
| 747 | + 'zxml_succession_fils_incorrecte' => 'succession des fils incorrecte', |
|
| 748 | + 'zxml_survoler' => 'survoler pour voir les corrects', |
|
| 749 | + 'zxml_valeur_attribut' => 'valeur de l’attribut', |
|
| 750 | + 'zxml_vide_balise' => 'balise vide', |
|
| 751 | + 'zxml_vu' => 'vu auparavant' |
|
| 752 | 752 | ); |