From 883fc8b2016d016fc58a250b4f2ae45bfd8631e6 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Tue, 8 Oct 2019 13:45:58 +0100
Subject: [PATCH] FIX #12010 authorize empty value for secure

---
 .../configuration/controllers/ConfigurationController.php    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/app/configuration/controllers/ConfigurationController.php b/src/app/configuration/controllers/ConfigurationController.php
index 291256c5ce..2076b45f5c 100755
--- a/src/app/configuration/controllers/ConfigurationController.php
+++ b/src/app/configuration/controllers/ConfigurationController.php
@@ -210,7 +210,6 @@ class ConfigurationController
                 'from'      => $body['value']['from'],
                 'charset'   => empty($body['value']['charset']) ? 'utf-8' : $body['value']['charset']
             ]);
-
         } elseif ($configuration['identifier'] == 'ldapServer') {
             if (!PrivilegeController::hasPrivilege(['userId' => $GLOBALS['id'], 'privilege' => 'manage_connections'])) {
                 return $response->withStatus(403)->withJson(['errors' => 'Privilege forbidden']);
@@ -368,8 +367,8 @@ class ConfigurationController
                 return ['errors' => 'Body[\'value\'] port is empty or not an integer'];
             } elseif (!Validator::boolType()->validate($args['auth'])) {
                 return ['errors' => 'Body[\'value\'] auth is empty or not a boolean'];
-            } elseif (!Validator::stringType()->notEmpty()->validate($args['secure'])) {
-                return ['errors' => 'Body[\'value\'] secure is empty or not a string'];
+            } elseif (!Validator::stringType()->validate($args['secure'])) {
+                return ['errors' => 'Body[\'value\'] secure is not a string'];
             } elseif (!Validator::stringType()->notEmpty()->validate($args['from'])) {
                 return ['errors' => 'Body[\'value\'] from is empty or not a string'];
             }
-- 
GitLab