From 981df7b2fc02b43eed444cbe404b73b2333c0d5d Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Fri, 9 Oct 2026 11:08:40 +0200 Subject: [PATCH] fix(pwd): fix 0 value for password policy --- .gitignore | 1 + SoObjects/SOGo/SOGoPasswordPolicy.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c34fbc107..d5e060c7b 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ Tests/node_modules Tests/lib/config.js Tests/results.xml Tests/results +Tests/Unit/SoObjects # SAML2 autogenerated files SoObjects/SOGo/SOGoSAML2Exceptions.* diff --git a/SoObjects/SOGo/SOGoPasswordPolicy.m b/SoObjects/SOGo/SOGoPasswordPolicy.m index 5db36c4a5..b32d66d0e 100644 --- a/SoObjects/SOGo/SOGoPasswordPolicy.m +++ b/SoObjects/SOGo/SOGoPasswordPolicy.m @@ -75,7 +75,7 @@ static const NSString *SPECIAL_SYMBOL_ALLOWED = @"%$&*(){}!?\\@#.,:;+=\\[\\]\\|< NSNumber *value = [policy objectForKey:@"value"]; NSInteger index = [[self policies] indexOfObject: label]; - if (0 < value) { + if (0 < [value intValue]) { NSMutableDictionary *newPolicy = [NSMutableDictionary dictionaryWithDictionary: policy]; [newPolicy setObject:[[self regexPoliciesWithCount: value] objectAtIndex: index] forKey:@"regex"]; [passwordPolicy addObject: newPolicy];