From fba57380480e3a3470e5d0a9cc9cc205c0ff47ea Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 9 Apr 2019 13:26:23 +0200 Subject: [PATCH] php7.2, fix some count() issues in inc/plugins.inc.d/openvpn/wizard.inc for https://github.com/opnsense/core/issues/3400 --- src/etc/inc/plugins.inc.d/openvpn/wizard.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/openvpn/wizard.inc b/src/etc/inc/plugins.inc.d/openvpn/wizard.inc index 8ac981d26..7f701a552 100644 --- a/src/etc/inc/plugins.inc.d/openvpn/wizard.inc +++ b/src/etc/inc/plugins.inc.d/openvpn/wizard.inc @@ -113,7 +113,7 @@ function step3_submitphpaction() empty($_POST['scope']) || empty($_POST['basedn']) || empty($_POST['authscope']) || empty($_POST['nameattr'])) { $input_errors[] = gettext('Please enter all information for authentication server.'); $stepid--; - } elseif ($authcfg !== false && count($authcfg) > 0) { + } elseif ($authcfg !== false && !empty($authcfg)) { $input_errors[] = gettext('Please choose a different name because an authentication ' . 'server with this name already exists.'); $stepid--; @@ -178,7 +178,7 @@ function step5_submitphpaction() if (empty($_POST['name']) || empty($_POST['ip']) || empty($_POST['secret'])) { $input_errors[] = gettext('Please enter all information for authentication server.'); $stepid--; - } elseif ($authcfg !== false && count($authcfg) > 0) { + } elseif ($authcfg !== false && !empty($authcfg)) { $input_errors[] = gettext('Please choose a different name because an authentication ' . 'server with this name already exists.'); $stepid--; @@ -195,7 +195,7 @@ function step6_stepbeforeformdisplay() { global $stepid, $config; - if (count($config['ca']) < 1) { + if (!empty($config['ca'])) { $stepid++; } } @@ -254,7 +254,7 @@ function step8_stepbeforeformdisplay() { global $stepid, $config; - if (count($config['cert']) < 1 || (count($config['cert']) == 1 && + if (empty($config['cert']) || (count($config['cert']) == 1 && stristr($config['cert'][0]['descr'], "webconf"))) { $stepid++; }