Merge pull request #7562 from hregis/develop_bug

Fix: minimal num, maj and special character with value 0 not work
This commit is contained in:
Laurent Destailleur 2017-10-05 10:29:28 +02:00 committed by GitHub
commit ad63dc8b78

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -98,7 +99,10 @@ class modGeneratePassPerso extends ModeleGenPassword
$this->Spe = str_replace($this->Ambi,"",$this->Spe);
}
$this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe);
$pattern = $this->Min . (! empty($this->NbMaj)?$this->Maj:'') . (! empty($this->NbNum)?$this->Nb:'') . (! empty($this->NbSpe)?$this->Spe:'');
$this->All = str_shuffle($pattern);
//$this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe);
//$this->All = $this->Maj. $this->Min. $this->Nb. $this->Spe;
//$this->All = $this->Spe;