From 780bbdb2473e4b9c13cb97d72a4c1e584e5073c1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 4 Aug 2017 07:48:29 +0200 Subject: [PATCH] net/wol: merge change for PHP 7.1 compat --- net/wol/Makefile | 1 + net/wol/src/www/services_wol.php | 6 +----- net/wol/src/www/services_wol_edit.php | 6 +----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/net/wol/Makefile b/net/wol/Makefile index 0d5c8e82c..583164443 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wol PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/wol/src/www/services_wol.php b/net/wol/src/www/services_wol.php index 64e782089..a8d0b09b1 100644 --- a/net/wol/src/www/services_wol.php +++ b/net/wol/src/www/services_wol.php @@ -30,11 +30,7 @@ require_once("guiconfig.inc"); require_once("interfaces.inc"); -if (empty($config['wol']['wolentry']) || !is_array($config['wol']['wolentry'])) { - $config['wol'] = array(); - $config['wol']['wolentry'] = array(); -} -$a_wol = &$config['wol']['wolentry']; +$a_wol = &config_read_array('wol', 'wolentry'); if ($_SERVER['REQUEST_METHOD'] === 'POST') { diff --git a/net/wol/src/www/services_wol_edit.php b/net/wol/src/www/services_wol_edit.php index a3cfa93b6..6394099f5 100644 --- a/net/wol/src/www/services_wol_edit.php +++ b/net/wol/src/www/services_wol_edit.php @@ -35,11 +35,7 @@ function wolcmp($a, $b) { } -if (empty($config['wol']['wolentry']) || !is_array($config['wol']['wolentry'])) { - $config['wol'] = array(); - $config['wol']['wolentry'] = array(); -} -$a_wol = &$config['wol']['wolentry']; +$a_wol = &config_read_array('wol', 'wolentry'); if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (isset($_GET['id']) && !empty($a_wol[$_GET['id']])) {