summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-03-19 16:16:46 -0500
committerChris Buechler <cmb@pfsense.org>2016-03-19 16:16:46 -0500
commite5ef7ae26b32d18b7aa1a117605ccbbfafefca14 (patch)
tree829b91bb2c13f0cab9fe42792180ebcba7e60461 /src/etc/inc/upgrade_config.inc
parentdf2aa83e785db4bde91225181902ab543bfe8d28 (diff)
downloadpfsense-e5ef7ae26b32d18b7aa1a117605ccbbfafefca14.zip
pfsense-e5ef7ae26b32d18b7aa1a117605ccbbfafefca14.tar.gz
Save changes to config in 148 config upgrade. Ticket #6012
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r--src/etc/inc/upgrade_config.inc17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index bca2561..eaa7ae1 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -4725,13 +4725,16 @@ function upgrade_147_to_148() {
$exgrps[] = $grp['name'];
}
- foreach ($config['system']['group'] as $grp) {
- $grp['name'] = str_replace(" ", "_", $grp['name']);
-
- // In the unlikely event that there is already a group with this name
- // just replace the whole thing with a unique string
- if (in_array($grp['name'], $exgrps)) {
- $grp['name'] = uniqid();
+ foreach ($config['system']['group'] as $idx => $grp) {
+ if (strstr($grp['name'], " ")) {
+ $newgrpname = str_replace(" ", "_", $grp['name']);
+ // In the unlikely event that there is already a group with this name
+ // just replace the whole thing with a unique string
+ if (in_array($newgrpname, $exgrps)) {
+ $config['system']['group'][$idx]['name'] = uniqid();
+ } else {
+ $config['system']['group'][$idx]['name'] = $newgrpname;
+ }
}
}
}
OpenPOWER on IntegriCloud