/
mnt
/
www
/
animaux-de-jardin.fr
/
Upload File
HOME
<?php /** * Page mentions legales — chargement JS anti-scraping * Adapte du plugin Linkuma (technique mousemove/touchmove) * * Charge le fichier mention-{lang}.txt correspondant a $site_lang * Le contenu est encode, melange, et recompose cote client au premier mouvement souris/touch * * Note securite : le contenu provient uniquement de fichiers locaux statiques * (mention-*.txt) controles par le developpeur, pas de donnees utilisateur. * Le innerHTML est utilise volontairement pour rendre le HTML des mentions legales. */ require __DIR__ . '/config.php'; require_once __DIR__ . '/parts/lang.php'; $page_title = $lang['legal'] ?? 'Mentions legales'; $page_description = $page_title . ' - ' . $site_name; include __DIR__ . '/parts/header.php'; // Mapping langue -> fichier $lang_map = [ 'FR' => 'mention-fr.txt', 'UK' => 'mention-en.txt', 'ES' => 'mention-es.txt', 'IT' => 'mention-it.txt', 'DE' => 'mention-de.txt', 'NL' => 'mention-nl.txt', 'PT' => 'mention-pt.txt', ]; $mention_file = __DIR__ . '/parts/mentions/' . ($lang_map[$site_lang ?? 'FR'] ?? 'mention-fr.txt'); $content = file_exists($mention_file) ? file_get_contents($mention_file) : ''; // Encoder URI (meme methode que Linkuma) function encode_uri($str) { $unescaped = [ '%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!','%7E'=>'~', '%2A'=>'*','%27'=>"'",'%28'=>'(','%29'=>')', ]; $reserved = [ '%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':', '%40'=>'@','%26'=>'&','%3D'=>'=','%2B'=>'+','%24'=>'$', ]; $score = ['%23'=>'#']; return strtr(rawurlencode($str), array_merge($reserved, $unescaped, $score)); } // Melanger les caracteres $uri_encoded = encode_uri($content); $chars = str_split($uri_encoded); $random_array = []; $keys = []; $temp = $chars; while (!empty($temp)) { $key = array_rand($temp); $random_array[] = $temp[$key]; unset($temp[$key]); $keys[] = $key; } // Variables JS aleatoires $used = []; function rand_var(&$used) { do { $v = chr(rand(97, 122)); } while (in_array($v, $used)); $used[] = $v; return $v; } $va = rand_var($used); $vb = rand_var($used); $vc = rand_var($used); $vd = rand_var($used); $ve = rand_var($used); $vf = rand_var($used); $vg = rand_var($used); $cls = chr(rand(97,122)) . chr(rand(97,122)) . '-' . chr(rand(97,122)) . chr(rand(97,122)) . chr(rand(97,122)) . chr(rand(97,122)); ?> <div class="container"> <nav class="breadcrumb"> <a href="/"><?php echo $lang['home'] ?? 'Accueil'; ?></a> › <strong><?php echo htmlspecialchars($page_title); ?></strong> </nav> </div> <div class="article-container"> <h1 class="article-title"><?php echo htmlspecialchars($page_title); ?></h1> <div class="article-content"> <span class="<?php echo $cls; ?>"></span> <script> // Contenu provient uniquement de fichiers mention-*.txt locaux statiques (pas de donnees utilisateur) (function(){ var <?php echo $va; ?> = "<?php echo implode('', $random_array); ?>".split(""); var <?php echo $vb; ?> = <?php echo json_encode($keys); ?>; var <?php echo $vc; ?> = 0; function <?php echo $vd; ?>(){ if(!<?php echo $vc; ?>){ <?php echo $vc; ?> = new Array(<?php echo $va; ?>.length); <?php echo $vb; ?>.forEach(function(<?php echo $ve; ?>,<?php echo $vg; ?>){<?php echo $vc; ?>[<?php echo $ve; ?>]=<?php echo $va; ?>[<?php echo $vg; ?>];}); var el = document.querySelector(".<?php echo $cls; ?>"); var parent = el.parentNode; parent.textContent = ''; var container = document.createElement('div'); container.insertAdjacentHTML('afterbegin', decodeURI(<?php echo $vc; ?>.join(""))); parent.appendChild(container); } } function <?php echo $vf; ?>(){setTimeout(<?php echo $vd; ?>,3000);} document.addEventListener("mousemove",<?php echo $vf; ?>,{once:true}); document.addEventListener("touchstart",<?php echo $vf; ?>,{once:true}); document.addEventListener("scroll",<?php echo $vf; ?>,{once:true}); })(); </script> </div> </div> <?php include __DIR__ . '/parts/footer.php'; ?>