From c448478c3994fece803fa03c1aa1878250fb7acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 31 Oct 2022 07:40:19 +0100 Subject: [PATCH] add lang in a.php --- src/Jirafeau/a.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Jirafeau/a.php b/src/Jirafeau/a.php index 26f4c72..3ddbfeb 100644 --- a/src/Jirafeau/a.php +++ b/src/Jirafeau/a.php @@ -156,6 +156,19 @@ if (isset ($_REQUEST [A_PERIOD]) && !empty ($_REQUEST [A_PERIOD])) { exit; } +// ======================================== +if (isset ($_REQUEST [A_LANG]) && !empty ($_REQUEST [A_LANG])) { + if (!preg_match ("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/i", $_REQUEST [A_LANG])) + $content = DEFAULT_LANG.NL; + else + $content = getSenderLang ($_REQUEST [A_LANG]).NL; + header ('HTTP/1.0 200 OK'); + header ('Content-Length: ' . strlen ($content)); + header ('Content-Type: text/plain'); + echo $content; + exit; +} + // ======================================== $doUpdate = false; if (isset ($_REQUEST [A_UPDATE]) && !empty ($_REQUEST [A_UPDATE])) { @@ -1074,6 +1087,7 @@ div.frame {border: 1px; border-style: solid; padding: 1em; margin: 1em;} $defaultChecked = []; $defaultChecked [isSenderTrack ($sender) ? "on" : "off"] = ' checked="checked"'; $defaultChecked [getSenderPeriod ($sender)] = ' selected="selected"'; +$defaultChecked [getSenderLang ($sender)] = ' selected="selected"'; echo '
'. 'Je veux que Kaz suive tous mes futurs envois: '.