Skip to content

Commit 17561a5

Browse files
committed
fix contact send email
1 parent dea877e commit 17561a5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Controller/ContactController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class ContactController extends MainController
2222
*/
2323
public function defaultMethod()
2424
{
25-
2625
return $this->render('contact.twig', [
2726
'success' => $this->isFormSuccess(),
2827
'errorContact' => $this->isFormError(),

src/Controller/Functions/MainFunctions.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public static function inputPost($key = false, $isArray = true)
2828
}
2929
return false;
3030
break;
31+
case 'email':
32+
if (filter_var($post, FILTER_VALIDATE_EMAIL)) {
33+
return $post;
34+
}
35+
return false;
36+
break;
3137
case 'tel':
3238
$post = str_replace(' ', '', $post);
3339
$post = str_replace('-', '', $post);
@@ -135,7 +141,7 @@ public static function checkAllInput($context)
135141
return false;
136142
}
137143

138-
$getMail = self::inputPost('mail', false);
144+
$getMail = self::inputPost('email', false);
139145
$getTel = self::inputPost('tel', false);
140146

141147
if (isset($post['email']) && $getMail == false) {

src/Controller/MailController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Controller;
44

5-
use App\Controller\Functions\MainFunctions;
65
use Twig\Error\LoaderError;
76
use Twig\Error\RuntimeError;
87
use Twig\Error\SyntaxError;

0 commit comments

Comments
 (0)