From 7993eb5737cf93ed068d681721f1ca99d741f7e9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Apr 2019 18:17:32 +0200 Subject: [PATCH] www/nginx: fix count on iterator CC: @fabianfrz --- www/nginx/Makefile | 1 + .../mvc/app/controllers/OPNsense/Nginx/IndexController.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 1491f1361..e558e2c93 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -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 diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/IndexController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/IndexController.php index c4b4a2637..ee436764f 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/IndexController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/IndexController.php @@ -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'); }