From 483bbd46594b0aaeddd58208c9a2de79eb1743ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Tue, 20 Sep 2016 09:32:22 +0200 Subject: [PATCH] Fixes #5151 l and d options of r modifier were reversed --- include/class_plugin.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index c78f2704d..a7a479bf9 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -695,10 +695,12 @@ class plugin $res = ''; for ($i = 0; $i < $length; ++$i) { switch ($chars) { - case 'l': + case 'd': + /* digits */ $res .= (string)rand(0, 9); break; - case 'd': + case 'l': + /* letters */ $nb = mt_rand(65, 116); if ($nb > 90) { /* lowercase */ @@ -707,6 +709,7 @@ class plugin $res .= chr($nb); break; case 'b': + /* both */ default: $nb = mt_rand(65, 126); if ($nb > 116) { -- GitLab