From ae0ba80a56bab44ef1e7cd6bbbc129c38ecc2451 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Fri, 11 May 2018 15:26:29 -0400 Subject: [PATCH] PHP7 - Resolve "Cannot create references to/from string offset" errors --- .../pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc index 91a13029d738..bb76fbae1033 100644 --- a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc +++ b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc @@ -112,7 +112,8 @@ function shellcmd_sync_package() { * See /etc/inc/xmlparse.inc and /etc/inc/xmlreader.inc */ $afterfilterchangeshellcmd = ''; - $a_shellcmd_config = &$config['installedpackages']['shellcmdsettings']['config']; + $tmp = $config['installedpackages']['shellcmdsettings']['config']; + $a_shellcmd_config = &$tmp; if (!is_array($a_shellcmd_config)) { $a_shellcmd_config = array(); } @@ -146,7 +147,7 @@ function shellcmd_sync_package() { if (($config['system']['shellcmd'] != $a_shellcmd) || ($config['system']['earlyshellcmd'] != $a_earlyshellcmd) || ($config['system']['afterfilterchangeshellcmd'] != $afterfilterchangeshellcmd)) { - /* Write the new system configuration to config.xml from scratch when done + /* Write the new system configuration to config.xml from scratch when done but only if something changed */ unset($config['system']['shellcmd']); $config['system']['shellcmd'] = $a_shellcmd; @@ -162,7 +163,8 @@ function shellcmd_sync_package() { function shellcmd_import_config() { global $config; - $shellcmd_config = &$config['installedpackages']['shellcmdsettings']['config']; + $tmp = $config['installedpackages']['shellcmdsettings']['config']; + $shellcmd_config = &$tmp; if (!is_array($shellcmd_config)) { $shellcmd_config = array(); }