From f7256bf27d67084743ac7698f5b538fdc4cb760b Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 18 Jan 2023 15:01:52 +0100 Subject: [PATCH] 12101 Fix random captcha --- CHANGES.md | 4 ++++ LISEZMOI.md | 2 +- README.md | 2 +- core/class/template.class.php | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 22c3beff..b2cb3f83 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # 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 ### Corrections : - Corrige l'activation non autorisée d'une version en langue étrangère du site. diff --git a/LISEZMOI.md b/LISEZMOI.md index fa4ea6b3..a53e7439 100644 --- a/LISEZMOI.md +++ b/LISEZMOI.md @@ -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. diff --git a/README.md b/README.md index d6355820..bed27723 100755 --- a/README.md +++ b/README.md @@ -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. diff --git a/core/class/template.class.php b/core/class/template.class.php index 65fbbd3c..35fae002 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -71,7 +71,7 @@ class template $limit = $attributes['limit'] ? count($letters) - 1 : 10; // Tirage de l'opération - mt_srand((int) microtime() * 1000000); + mt_srand(); // Captcha simple limité à l'addition $operator = $attributes['limit'] ? mt_rand(1, 4) : 1; @@ -81,9 +81,9 @@ class template } // Tirage des nombres - mt_srand( (int) microtime(true) * 1000000); + mt_srand(); $firstNumber = mt_rand(1, $limit); - mt_srand( (int) microtime(true) * 1000000); + mt_srand(); $secondNumber = mt_rand(1, $limit); // Permutation si addition ou soustraction @@ -113,7 +113,7 @@ class template for ($i = 1; $i <= $firstNumber; $i++) { $limit = $limit2[$i - 1]; } - mt_srand((int) microtime() * 1000000); + mt_srand(); $secondNumber = mt_rand(1, $limit); $firstNumber = $firstNumber * $secondNumber; $result = $firstNumber / $secondNumber;