feat: improve security headers and csp nonce handling

This commit is contained in:
2026-07-08 07:33:40 +04:00
parent 05d01fb7bc
commit 3e249bbc34
11 changed files with 62 additions and 42 deletions
+3 -3
View File
@@ -167,7 +167,7 @@ if (empty($videoData) || isset($videoData['error'])) {
<?php endif; ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
<script nonce="<?php echo getCspNonce(); ?>">
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
@@ -330,7 +330,7 @@ if (empty($videoData) || isset($videoData['error'])) {
<i class="fas fa-chevron-down" aria-hidden="true"></i>
</button>
</div>
<div id="full-description" class="full-description" style="display: none;">
<div id="full-description" class="full-description" style="display: none;" nonce="<?php echo getCspNonce(); ?>">
<?php echo markdown_to_html($video['description']); ?>
<button class="show-less-btn" aria-expanded="true" aria-controls="full-description">
<span>Voir moins</span>
@@ -566,7 +566,7 @@ if (empty($videoData) || isset($videoData['error'])) {
</div>
<script src="js/main.js"></script>
<script>
<script nonce="<?php echo getCspNonce(); ?>">
// Script pour la modal de téléchargement
document.addEventListener('DOMContentLoaded', function() {
// Gestion de la description tronquée