12101 Fix random captcha

This commit is contained in:
Fred Tempez 2023-01-18 15:01:52 +01:00
parent 2a4dd3b70a
commit f7256bf27d
4 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## Version 12.1.01
### Correction :
- Défaut d'initialisation du générateur de nombre aléatoire utilisé pour le choix des nombres du captcha.
## Version 12.1.00 ## Version 12.1.00
### Corrections : ### Corrections :
- Corrige l'activation non autorisée d'une version en langue étrangère du site. - Corrige l'activation non autorisée d'une version en langue étrangère du site.

View File

@ -1,4 +1,4 @@
# ZwiiCMS 12.1.00 # ZwiiCMS 12.1.01
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.

View File

@ -1,4 +1,4 @@
# ZwiiCMS 12.1.00 # ZwiiCMS 12.1.01
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge. Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.

View File

@ -71,7 +71,7 @@ class template
$limit = $attributes['limit'] ? count($letters) - 1 : 10; $limit = $attributes['limit'] ? count($letters) - 1 : 10;
// Tirage de l'opération // Tirage de l'opération
mt_srand((int) microtime() * 1000000); mt_srand();
// Captcha simple limité à l'addition // Captcha simple limité à l'addition
$operator = $attributes['limit'] ? mt_rand(1, 4) : 1; $operator = $attributes['limit'] ? mt_rand(1, 4) : 1;
@ -81,9 +81,9 @@ class template
} }
// Tirage des nombres // Tirage des nombres
mt_srand( (int) microtime(true) * 1000000); mt_srand();
$firstNumber = mt_rand(1, $limit); $firstNumber = mt_rand(1, $limit);
mt_srand( (int) microtime(true) * 1000000); mt_srand();
$secondNumber = mt_rand(1, $limit); $secondNumber = mt_rand(1, $limit);
// Permutation si addition ou soustraction // Permutation si addition ou soustraction
@ -113,7 +113,7 @@ class template
for ($i = 1; $i <= $firstNumber; $i++) { for ($i = 1; $i <= $firstNumber; $i++) {
$limit = $limit2[$i - 1]; $limit = $limit2[$i - 1];
} }
mt_srand((int) microtime() * 1000000); mt_srand();
$secondNumber = mt_rand(1, $limit); $secondNumber = mt_rand(1, $limit);
$firstNumber = $firstNumber * $secondNumber; $firstNumber = $firstNumber * $secondNumber;
$result = $firstNumber / $secondNumber; $result = $firstNumber / $secondNumber;