summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_edit.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-04-04 00:58:08 -0400
committerjim-p <jim@pingle.org>2010-04-04 00:58:08 -0400
commita2a7f74df4bb65fc173bf0da72a423f7600bd091 (patch)
tree2b0ec73b04216339f6e43debe85c4a1fb8b85352 /usr/local/www/pkg_edit.php
parentbef28e2d569302e8f9e2caaf3493dca6523eb52c (diff)
downloadpfsense-a2a7f74df4bb65fc173bf0da72a423f7600bd091.zip
pfsense-a2a7f74df4bb65fc173bf0da72a423f7600bd091.tar.gz
Check for an empty <config/> as the first setting for a given package's config. When present, this breaks saving for certain packages (namely Squid's caching tab).
Diffstat (limited to 'usr/local/www/pkg_edit.php')
-rwxr-xr-xusr/local/www/pkg_edit.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index 6113d1d..6c2fbde 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -96,6 +96,11 @@ if($pkg['custom_php_global_functions'] <> "")
if(!is_array($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']))
$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'] = array();
+// If the first entry in the array is an empty <config/> tag, kill it.
+if ((count($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']) > 0)
+ && ($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'][0] == ""))
+ array_shift($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']);
+
$a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
if($_GET['savemsg'] <> "")
OpenPOWER on IntegriCloud