From 378144a02586e0f19f6b46dfd93ed270c43789e6 Mon Sep 17 00:00:00 2001
From: Simon Leblanc <contact@leblanc-simon.eu>
Date: Sun, 22 May 2011 04:17:24 +0200
Subject: [PATCH] Send mail use  address without verification, check it before
 (possibility fail for send spam)

---
 creation_sondage.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/creation_sondage.php b/creation_sondage.php
index 44368179..417f9604 100644
--- a/creation_sondage.php
+++ b/creation_sondage.php
@@ -117,8 +117,10 @@ function ajouter_sondage()
   $message = sprintf($message, getUrlSondage($sondage));
   $message_admin = sprintf($message_admin, getUrlSondage($sondage_admin, true));
   
-  mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message, $headers);
-  mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message, $headers);
+  if (validateEmail($_SESSION['adresse'])) {
+    mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message, $headers);
+    mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message, $headers);
+  }
   
   $date=date('H:i:s d/m/Y:');
   error_log($date . " CREATION: $sondage\t$_SESSION[formatsondage]\t$_SESSION[nom]\t$_SESSION[adresse]\t \t$_SESSION[toutchoix]\n", 3, 'admin/logs_studs.txt');
-- 
GitLab