Compare commits

...

3 Commits

Author SHA1 Message Date
402706496a 🐛 Fix: grilles desktop 2026-02-04 23:19:34 +01:00
cbd0b76074 🎨 UI: sections temoignages et vedettes 2026-02-04 23:06:59 +01:00
ca008f66bb 🐛 Fix: robustesse contact prod 2026-02-04 22:52:45 +01:00
16 changed files with 87 additions and 34 deletions

View File

@@ -166,6 +166,28 @@
}
@layer utilities {
.grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
.sm\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 768px) {
.md\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 1024px) {
.lg\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.animate-fade-in {
animation: fadeIn 0.6s ease-out forwards;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -71,6 +71,9 @@ GPT-5 Codex
- Constantes SMTP ajoutées via .env / config.php
- Endpoint contact charge l'autoload vendor
- Tests locaux OK ; test production confirmé
- SMTP requis (MAIL_HOST obligatoire) pour éviter fallback mail()
- Sanitation CRLF sur champs sensibles (nom/prenom/objet/email)
- reCAPTCHA tolérant si Google indisponible (seuil appliqué)
### Debug Log References

View File

@@ -228,7 +228,7 @@ function verifyRecaptcha(string $token): float
if ($response === false) {
error_log('reCAPTCHA: impossible de contacter Google');
return 0.3;
return RECAPTCHA_THRESHOLD;
}
$result = json_decode($response, true);
@@ -256,8 +256,19 @@ function validateContactData(array $input): array
}
}
$nomRaw = trim($input['nom'] ?? '');
$prenomRaw = trim($input['prenom'] ?? '');
$emailRaw = trim($input['email'] ?? '');
$entrepriseRaw = trim($input['entreprise'] ?? '');
$objetRaw = trim($input['objet'] ?? '');
$messageRaw = trim($input['message'] ?? '');
$nom = str_replace(["\r", "\n"], '', $nomRaw);
$prenom = str_replace(["\r", "\n"], '', $prenomRaw);
$email = str_replace(["\r", "\n"], '', $emailRaw);
$entreprise = str_replace(["\r", "\n"], '', $entrepriseRaw);
$objet = str_replace(["\r", "\n"], '', $objetRaw);
$message = $messageRaw;
if ($email && !filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = "L'adresse email n'est pas valide";
}
@@ -268,22 +279,22 @@ function validateContactData(array $input): array
$errors[] = 'Catégorie invalide';
}
if (strlen($input['nom'] ?? '') > 100) {
if (strlen($nom) > 100) {
$errors[] = 'Le nom est trop long (max 100 caractères)';
}
if (strlen($input['prenom'] ?? '') > 100) {
if (strlen($prenom) > 100) {
$errors[] = 'Le prénom est trop long (max 100 caractères)';
}
if (strlen($input['objet'] ?? '') > 200) {
if (strlen($objet) > 200) {
$errors[] = "L'objet est trop long (max 200 caractères)";
}
if (strlen($input['message'] ?? '') > 5000) {
if (strlen($message) > 5000) {
$errors[] = 'Le message est trop long (max 5000 caractères)';
}
if (strlen($input['objet'] ?? '') > 0 && strlen($input['objet']) < 5) {
if (strlen($objet) > 0 && strlen($objet) < 5) {
$errors[] = "L'objet est trop court (min 5 caractères)";
}
if (strlen($input['message'] ?? '') > 0 && strlen($input['message']) < 20) {
if (strlen($message) > 0 && strlen($message) < 20) {
$errors[] = 'Le message est trop court (min 20 caractères)';
}
@@ -292,13 +303,13 @@ function validateContactData(array $input): array
}
return [
'nom' => htmlspecialchars(trim($input['nom'] ?? ''), ENT_QUOTES, 'UTF-8'),
'prenom' => htmlspecialchars(trim($input['prenom'] ?? ''), ENT_QUOTES, 'UTF-8'),
'nom' => htmlspecialchars($nom, ENT_QUOTES, 'UTF-8'),
'prenom' => htmlspecialchars($prenom, ENT_QUOTES, 'UTF-8'),
'email' => filter_var($email, FILTER_SANITIZE_EMAIL),
'entreprise' => htmlspecialchars(trim($input['entreprise'] ?? ''), ENT_QUOTES, 'UTF-8'),
'entreprise' => htmlspecialchars($entreprise, ENT_QUOTES, 'UTF-8'),
'categorie' => $categorie,
'objet' => htmlspecialchars(trim($input['objet'] ?? ''), ENT_QUOTES, 'UTF-8'),
'message' => htmlspecialchars(trim($input['message'] ?? ''), ENT_QUOTES, 'UTF-8'),
'objet' => htmlspecialchars($objet, ENT_QUOTES, 'UTF-8'),
'message' => htmlspecialchars($message, ENT_QUOTES, 'UTF-8'),
'ip' => $_SERVER['REMOTE_ADDR'] ?? 'inconnue',
'date' => date('d/m/Y à H:i:s'),
];
@@ -341,20 +352,21 @@ IP: {$data['ip']}
============================================
EMAIL;
if (!MAIL_HOST) {
error_log('Échec envoi email contact: MAIL_HOST manquant');
return false;
}
$mail = new \PHPMailer\PHPMailer\PHPMailer(true);
try {
if (MAIL_HOST) {
$mail->isSMTP();
$mail->Host = MAIL_HOST;
$mail->SMTPAuth = true;
$mail->Username = MAIL_USERNAME;
$mail->Password = MAIL_PASSWORD;
$mail->SMTPSecure = MAIL_ENCRYPTION;
$mail->Port = MAIL_PORT;
} else {
$mail->isMail();
}
$mail->isSMTP();
$mail->Host = MAIL_HOST;
$mail->SMTPAuth = true;
$mail->Username = MAIL_USERNAME;
$mail->Password = MAIL_PASSWORD;
$mail->SMTPSecure = MAIL_ENCRYPTION;
$mail->Port = MAIL_PORT;
$mail->CharSet = 'UTF-8';
$mail->setFrom(MAIL_FROM, MAIL_FROM_NAME);

View File

@@ -198,7 +198,7 @@ include_template('navbar', compact('currentPage'));
<?php $testimonials = getTestimonials(); ?>
<?php if (!empty($testimonials)): ?>
<section class="section bg-surface">
<section class="section">
<div class="container-content">
<div class="section-header">
<h2 class="section-title">Ce Qu'ils Disent</h2>
@@ -230,4 +230,4 @@ include_template('navbar', compact('currentPage'));
</section>
</main>
<?php include_template('footer'); ?>
<?php include_template('footer'); ?>

View File

@@ -21,6 +21,13 @@ include_template('navbar', compact('currentPage'));
</div>
<?php if (!empty($featuredProjects)): ?>
<div class="mt-10 mb-16">
<h2 class="text-heading mb-3">Projets vedettes</h2>
<p class="text-text-secondary max-w-2xl">
Une sélection de projets qui montrent le mieux mon approche produit et technique.
</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8">
<?php foreach ($featuredProjects as $project): ?>
<?php include_template('project-card', ['project' => $project]); ?>
@@ -48,4 +55,4 @@ include_template('navbar', compact('currentPage'));
</section>
</main>
<?php include_template('footer'); ?>
<?php include_template('footer'); ?>

View File

@@ -10,6 +10,7 @@ $authorName = $testimonial['author_name'] ?? 'Anonyme';
$authorRole = $testimonial['author_role'] ?? '';
$authorCompany = $testimonial['author_company'] ?? '';
$authorPhoto = $testimonial['author_photo'] ?? null;
$authorPhotoFallback = $authorPhoto ? str_replace('.webp', '.jpg', $authorPhoto) : null;
$projectSlug = $testimonial['project_slug'] ?? null;
$showProjectLink = $showProjectLink ?? true;
?>
@@ -25,12 +26,15 @@ $showProjectLink = $showProjectLink ?? true;
<footer class="flex items-center gap-4">
<?php if ($authorPhoto): ?>
<img
src="/assets/img/testimonials/<?= htmlspecialchars($authorPhoto, ENT_QUOTES, 'UTF-8') ?>"
alt="<?= htmlspecialchars($authorName, ENT_QUOTES, 'UTF-8') ?>"
class="w-12 h-12 rounded-full object-cover"
loading="lazy"
>
<picture>
<source srcset="/assets/img/testimonials/<?= htmlspecialchars($authorPhoto, ENT_QUOTES, 'UTF-8') ?>" type="image/webp">
<img
src="/assets/img/testimonials/<?= htmlspecialchars($authorPhotoFallback, ENT_QUOTES, 'UTF-8') ?>"
alt="<?= htmlspecialchars($authorName, ENT_QUOTES, 'UTF-8') ?>"
class="w-12 h-12 rounded-full object-cover"
loading="lazy"
>
</picture>
<?php else: ?>
<div class="w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center">
<span class="text-primary font-semibold text-lg">
@@ -58,4 +62,4 @@ $showProjectLink = $showProjectLink ?? true;
</svg>
</a>
<?php endif; ?>
</blockquote>
</blockquote>

View File

@@ -11,6 +11,8 @@ assertTrue(strpos($composer, 'phpmailer/phpmailer') !== false, 'missing phpmaile
$functions = file_get_contents(__DIR__ . '/../includes/functions.php');
assertTrue(strpos($functions, 'PHPMailer') !== false, 'missing PHPMailer usage');
assertTrue(strpos($functions, 'MAIL_HOST') !== false, 'missing MAIL_HOST usage');
assertTrue(strpos($functions, 'isSMTP') !== false, 'missing SMTP usage');
$config = file_get_contents(__DIR__ . '/../includes/config.php');
assertTrue(strpos($config, 'MAIL_HOST') !== false, 'missing mail constants');