fix(security): safe JSON-LD encoding and URL escaping

This commit is contained in:
2026-07-27 01:54:49 +04:00
parent a28ba8bfec
commit 4778f0e9e3
3 changed files with 204 additions and 12 deletions
+6 -4
View File
@@ -3,6 +3,8 @@
require_once 'includes/config.php';
// Inclure les fonctions de sécurité
require_once 'includes/security.php';
// Inclure les fonctions de données structurées (getBaseUrl, getCurrentUrl)
require_once 'includes/structured-data.php';
// Appliquer les en-têtes de sécurité
setSecurityHeaders();
?>
@@ -14,7 +16,7 @@ setSecurityHeaders();
<meta name="csrf-token" content="<?php echo generateCSRFToken(); ?>">
<title><?php echo SITE_NAME; ?> - Ouverture prochaine</title>
<meta name="description" content="<?php echo htmlspecialchars(SITE_DESCRIPTION); ?> Ouverture prochaine.">
<link rel="canonical" href="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . '/countdown.php'; ?>">
<link rel="canonical" href="<?php echo getBaseUrl() . '/countdown.php'; ?>">
<!-- Styles -->
<link rel="stylesheet" href="css/countdown.css?v=<?php echo filemtime('css/countdown.css'); ?>">
@@ -42,8 +44,8 @@ setSecurityHeaders();
setlocale(LC_TIME, 'fr_FR.UTF-8');
echo strftime('%e %B %Y', $targetDate->getTimestamp());
?>. Restez connectés !">
<meta property="og:image" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . '/img/logo.png'; ?>">
<meta property="og:url" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
<meta property="og:image" content="<?php echo getBaseUrl() . '/img/logo.png'; ?>">
<meta property="og:url" content="<?php echo htmlspecialchars(getCurrentUrl()); ?>">
<meta property="og:type" content="website">
<meta property="og:site_name" content="<?php echo SITE_NAME; ?>">
<meta property="og:locale" content="fr_FR">
@@ -56,7 +58,7 @@ setSecurityHeaders();
setlocale(LC_TIME, 'fr_FR.UTF-8');
echo strftime('%e %B %Y', $targetDate->getTimestamp());
?>. Restez connectés !">
<meta name="twitter:image" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . '/img/logo.png'; ?>">
<meta name="twitter:image" content="<?php echo getBaseUrl() . '/img/logo.png'; ?>">
<!-- Configuration JavaScript -->
<script nonce="<?php echo getCspNonce(); ?>">