aboutsummaryrefslogtreecommitdiff
path: root/src/Captcha.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-01-12 17:16:41 +0100
committerpolo <ordipolo@gmx.fr>2026-01-12 17:16:41 +0100
commit505cab0210e83bf62085b665abad0698a8d31352 (patch)
tree6e66d20d2041bae3f800ee99fdde1957c7bb9f51 /src/Captcha.php
parentdfed030ca6edf832397d273fbb0ad4b0b5d35877 (diff)
downloadcms-505cab0210e83bf62085b665abad0698a8d31352.tar.gz
cms-505cab0210e83bf62085b665abad0698a8d31352.tar.bz2
cms-505cab0210e83bf62085b665abad0698a8d31352.zip
upload de fichiers (JS + contrôleur + htaccess), collage de fichiers dans l'éditeur (JS), amélioration utilisation de Imagick (ImageUploadController)
Diffstat (limited to 'src/Captcha.php')
-rw-r--r--src/Captcha.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Captcha.php b/src/Captcha.php
index f60031a..a0c7a54 100644
--- a/src/Captcha.php
+++ b/src/Captcha.php
@@ -10,12 +10,10 @@ class Captcha
10{ 10{
11 private int $a; 11 private int $a;
12 private int $b; 12 private int $b;
13 private int $solution;
14 13
15 public function __construct(){ 14 public function __construct(){
16 $this->a = rand(2, 9); 15 $this->a = rand(2, 9);
17 $this->b = rand(2, 9); 16 $this->b = rand(2, 9);
18 $this->solution = $this->a * $this->b;
19 } 17 }
20 18
21 public function getA(): string 19 public function getA(): string
@@ -28,7 +26,7 @@ class Captcha
28 } 26 }
29 public function getSolution(): int 27 public function getSolution(): int
30 { 28 {
31 return $this->solution; 29 return ($this->a * $this->b);
32 } 30 }
33 31
34 private function toLettersFrench(int $number): string 32 private function toLettersFrench(int $number): string
@@ -45,6 +43,8 @@ class Captcha
45 default => '', // erreur 43 default => '', // erreur
46 }; 44 };
47 } 45 }
46
47 // (à déplacer dans FormValidation?)
48 static public function controlInput(string $input = '0'): int 48 static public function controlInput(string $input = '0'): int
49 { 49 {
50 // un POST est une chaîne qu'on doit convertir en nombre dans deux conditions: 50 // un POST est une chaîne qu'on doit convertir en nombre dans deux conditions: