factorisation: site_lang, posts_per_page, site_license, contact dynamique

This commit is contained in:
Cedric Abonnel
2026-05-13 00:23:09 +02:00
parent ff47161721
commit 26c0a03e71
11 changed files with 133 additions and 27 deletions
+3 -2
View File
@@ -46,13 +46,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!$error && $contactEmail !== '') {
$subjectClean = mb_encode_mimeheader(
'[varlog contact] ' . mb_strimwidth($subject, 0, 100, '…'),
'[' . siteTitle() . ' contact] ' . mb_strimwidth($subject, 0, 100, '…'),
'UTF-8',
'B'
);
$nameClean = mb_encode_mimeheader($name, 'UTF-8', 'B');
$headers = 'From: =?UTF-8?B?' . base64_encode('varlog contact') . "?= <noreply@varlog>\r\n";
$fromEmail = $_ENV['CONTACT_FROM_EMAIL'] ?? ('noreply@' . (parse_url(APP_URL, PHP_URL_HOST) ?? 'localhost'));
$headers = 'From: =?UTF-8?B?' . base64_encode(siteTitle() . ' contact') . "?= <{$fromEmail}>\r\n";
$headers .= "Reply-To: {$nameClean} <{$from}>\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";