diff --git a/tools/math-captcha/README.md b/tools/math-captcha/README.md
new file mode 100644
index 00000000..09592bbd
--- /dev/null
+++ b/tools/math-captcha/README.md
@@ -0,0 +1,41 @@
+## Description:
+This is a PHP class for generating images with simple mathematical questions (Math CAPTCHAs) to protect the forms of your website from spambots.
+
+## How to Use:
+
+To generate a captcha you simply:
+
+```PHP
+session_start();
+
+$mathCaptcha = new MathCaptcha\MathCaptcha();
+
+$mathCaptcha->generate();
+$mathCaptcha->output();
+```
+
+The `MathCaptcha` class makes use of session variables so you have to call the `session_start()` function before instantiating a `MathCaptcha` object.
+
+You can optionally supply an identifier for the captcha, to the constructor of the `MathCaptcha` class, if you want to use multiple captchas in your website.
+
+To verify the user's answer you simply:
+
+```PHP
+session_start();
+
+$mathCaptcha = new MathCaptcha\MathCaptcha();
+
+if ( $mathCaptcha->check($captcha_answer) === true ) {
+ // Correct answer
+}
+else {
+ // Incorrect answer
+}
+```
+
+If you use more than one captchas in your website you need also to supply the identifier of the captcha, to the constructor of the `MathCaptcha` class.
+
+Check out the `test_form.php` and `math_captcha.php` files for a working example.
+
+## Requirements:
+PHP 5, GD 2.0.1 or later (2.0.28 or later is recommended)
diff --git a/tools/math-captcha/autoloadPrestashop.php b/tools/math-captcha/autoloadPrestashop.php
new file mode 100644
index 00000000..19266710
--- /dev/null
+++ b/tools/math-captcha/autoloadPrestashop.php
@@ -0,0 +1,27 @@
+=5.0.0",
+ "ext-gd": "*"
+ },
+ "autoload": {
+ "psr-0": {
+ "MathCaptcha": "src/"
+ }
+ }
+}
diff --git a/tools/math-captcha/math_captcha.php b/tools/math-captcha/math_captcha.php
new file mode 100644
index 00000000..8ac41cd8
--- /dev/null
+++ b/tools/math-captcha/math_captcha.php
@@ -0,0 +1,15 @@
+generate();
+ $mathCaptcha->output();
+}
+catch ( MathCaptcha\MathCaptchaException $e ) {
+ // Here you normally log the error, and you can output an error image
+ // to notify the user that something went wrong, if you want.
+}
\ No newline at end of file
diff --git a/tools/math-captcha/src/MathCaptcha/MathCaptcha.php b/tools/math-captcha/src/MathCaptcha/MathCaptcha.php
new file mode 100644
index 00000000..5c26e102
--- /dev/null
+++ b/tools/math-captcha/src/MathCaptcha/MathCaptcha.php
@@ -0,0 +1,79 @@
+captchaID = 'math_captcha_' . $captchaID;
+
+ // Set the captcha result from last generated captcha and unset it from the session
+ if ( isset($_SESSION[$this->captchaID]) ) {
+ $this->answer = $_SESSION[$this->captchaID];
+ unset($_SESSION[$this->captchaID]);
+ }
+
+ }
+
+ public function generate ()
+ {
+ $this->addNum1 = rand(0, 10) * rand(1, 3);
+ $this->addNum2 = rand(0, 10) * rand(1, 3);
+
+ // Set the captcha result for current captcha and set it to the session for later check
+ $_SESSION[$this->captchaID] = $this->answer = $this->addNum1 + $this->addNum2;
+
+ // Create a canvas
+ if ( ($this->captchaImg = @imagecreatetruecolor(99, 19)) === false ) {
+ throw new MathCaptchaException('Creation of true color image failed');
+ }
+
+ // Allocate black and white colors
+ $color_black = imagecolorallocate($this->captchaImg, 0, 0, 0);
+ $color_white = imagecolorallocate($this->captchaImg, 255, 255, 255);
+
+ // Make the background of the image white
+ imagefilledrectangle($this->captchaImg, 0, 0, 99, 19, $color_white);
+
+ // Draw the math question on the image using black color
+ imagestring($this->captchaImg, 10, 2, 2, $this->addNum1 . ' + ' . $this->addNum2 . ' = ', $color_black);
+
+ }
+
+ public function output ()
+ {
+ if ( $this->captchaImg === null ) {
+ throw new MathCaptchaException('Captcha image has not been generated');
+ }
+
+ header('Content-Disposition: Attachment;filename=captcha.png');
+ header('Content-Type: image/png');
+
+ imagepng($this->captchaImg);
+ imagedestroy($this->captchaImg);
+ }
+
+ public function check ( $answer )
+ {
+ // Check if math captcha has been generated
+ if ( $this->answer === null ) {
+ return false;
+ }
+
+ // Validate captcha
+ if ( $this->answer === (int) trim($answer) ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/tools/math-captcha/src/MathCaptcha/MathCaptchaException.php b/tools/math-captcha/src/MathCaptcha/MathCaptchaException.php
new file mode 100644
index 00000000..0656a15a
--- /dev/null
+++ b/tools/math-captcha/src/MathCaptcha/MathCaptchaException.php
@@ -0,0 +1,4 @@
+Please fill the answer to the math question';
+
+ }
+ else {
+
+ $mathCaptcha = new MathCaptcha\MathCaptcha();
+
+ // Validate the answer
+ if ( $mathCaptcha->check($_POST['captcha_ans']) === true ) {
+
+ // In a real application here you can register/login the user, insert a comment in the database etc
+ $msg = 'SUCCESS';
+
+ }
+ else {
+
+ $msg = 'You didn\'t answered the question correctly';
+
+ }
+
+ }
+
+}
+?>
+
+
+
+
+ PHP Math Captcha
+
+
+
+
+
Answer to this simple math question:
+
+
+
\ No newline at end of file
From 4a63488b5104445e683d501ee704c9db738cfb2f Mon Sep 17 00:00:00 2001
From: Michael RICOIS
Date: Mon, 5 Mar 2018 17:28:11 +0100
Subject: [PATCH 3/5] Style
---
modules/ant_support_form/support.tpl | 5 +++--
themes/site/contact-form.tpl | 7 ++++---
themes/site_mobile/contact-form.tpl | 5 +++--
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/modules/ant_support_form/support.tpl b/modules/ant_support_form/support.tpl
index f025c92f..185dd83d 100644
--- a/modules/ant_support_form/support.tpl
+++ b/modules/ant_support_form/support.tpl
@@ -177,8 +177,9 @@