diff --git a/api/js/etemplate/Et2Textbox/Et2Password.ts b/api/js/etemplate/Et2Textbox/Et2Password.ts index 4ce796b4f7..12a9ef2673 100644 --- a/api/js/etemplate/Et2Textbox/Et2Password.ts +++ b/api/js/etemplate/Et2Textbox/Et2Password.ts @@ -55,7 +55,10 @@ export class Et2Password extends Et2InvokerMixin(Et2Textbox) transformAttributes(attrs) { - attrs.suggest = parseInt(attrs.suggest); + if(typeof attrs.suggest !== "undefined") + { + attrs.suggest = parseInt(attrs.suggest); + } attrs.type = 'password'; if (attrs.viewable) diff --git a/api/src/Etemplate/Widget/Password.php b/api/src/Etemplate/Widget/Password.php index 34180b74ed..3e917c1554 100644 --- a/api/src/Etemplate/Widget/Password.php +++ b/api/src/Etemplate/Widget/Password.php @@ -126,7 +126,7 @@ class Password extends Etemplate\Widget\Textbox public static function ajax_suggest($size = 12) { $config = Api\Config::read('phpgwapi'); - $size = max(min((int)$size, (int)$config['force_pwd_length']), 6); + $size = max((int)$size, (int)$config['force_pwd_length'], 6); $password = Auth::randomstring($size, $config['force_pwd_strength'] == 4); $response = \EGroupware\Api\Json\Response::get();