V10.1 stable avec correction securité,bug sur csrf dans index

This commit is contained in:
Oleg Barykin committed 2026-05-27 13:54:59 +02:00
1 parent e9d0010451
commit 21f34c64c9
11 files changed
+1136 -445

No files matched your search

+30 -8
View File
@@ -1,6 +1,17 @@
<?php
declare (strict_types = 1);
ini_set('display_errors', '1');
ini_set('log_errors', '1');
ini_set('error_log', __DIR__ . '/php-debug.log');
error_reporting(E_ALL);
register_shutdown_function(function () {
$e = error_get_last();
file_put_contents(__DIR__ . '/php-debug.log',
"SHUTDOWN: " . print_r($e, true) . "\n",
FILE_APPEND
);
});
require_once __DIR__ . '/../includes/bootstrap_global.php';
require_once APP_HTDOCS . '/includes/avatar_initiales.php';
require_once __DIR__ . '/includes/search_helpers.php';
@@ -172,8 +183,9 @@
<body>
<?php if (! empty($logged)):
include_header_clean(APP_HTDOCS . '/public/includes/header.php');
include_header_clean(__DIR__ . '/public/includes/header.php');
else: ?>
<!-- Header public identique -->
<header class="site-header">
<div class="container">
@@ -294,9 +306,9 @@ else: ?>
FROM praticien
WHERE photo IS NOT NULL
AND photo <> ''
AND date_expiration > DATE_ADD(NOW(), INTERVAL 2 DAY)
AND date_expiration >= NOW()
ORDER BY id DESC
LIMIT 50
LIMIT 100
")->fetchAll(PDO::FETCH_COLUMN);
if (! $ids) {
@@ -315,12 +327,20 @@ else: ?>
$placeholders = implode(',', array_fill(0, count($ids), '?'));
$stmt = $pdo->prepare("
SELECT id, nom, prenom, specialite, photo
FROM praticien
WHERE id IN ($placeholders)
SELECT
p.id,
COALESCE(NULLIF(pt.nom_affiche, ''), p.nom) AS nom,
COALESCE(NULLIF(pt.prenom_affiche, ''), p.prenom) AS prenom,
COALESCE(NULLIF(pt.specialite, ''), p.specialite) AS specialite,
p.photo
FROM praticien p
LEFT JOIN praticien_traduction pt
ON pt.praticien_id = p.id
AND pt.langue = ?
WHERE p.id IN ($placeholders)
");
$stmt->execute($ids);
$stmt->execute(array_merge([$lang], $ids));
$randomPros = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (! $randomPros) {
@@ -378,6 +398,7 @@ else: ?>
$note = (float) $stats['m'];
$count = (int) $stats['c'];
$w = percent_from_5($note);
?>
<article class="hp-card">
@@ -420,7 +441,8 @@ else: ?>
<span><?php echo h($availability) ?></span>
</div>
<a class="hp-btn" href="<?php echo h($detailUrl) ?>">
<a class="hp-btn"
href="/public/client/reserver_rdv.php?praticien_id=<?php echo $pid ?>">
<?php echo h($translations['home_btn_book'] ?? '') ?>
</a>
</div>