www/nginx: fix count on iterator

CC: @fabianfrz
This commit is contained in:
Franco Fichtner
2019-04-05 18:17:32 +02:00
parent 588ceb595d
commit 7993eb5737
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
PLUGIN_NAME= nginx
PLUGIN_VERSION= 1.11
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Nginx HTTP server and reverse proxy
PLUGIN_DEPENDS= nginx
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com
@@ -63,7 +63,8 @@ class IndexController extends \OPNsense\Base\IndexController
$this->view->tls_fingerprint = $this->getForm("tls_fingerprint");
$nginx = new Nginx();
$this->view->show_naxsi_download_button =
count($nginx->custom_policy->iterateItems()) == 0 && count($nginx->naxsi_rule->iterateItems()) == 0;
count(iterator_to_array($nginx->custom_policy->iterateItems())) == 0 &&
count(iterator_to_array($nginx->naxsi_rule->iterateItems())) == 0;
$this->view->pick('OPNsense/Nginx/index');
}