diff options
author | doktornotor <notordoktor@gmail.com> | 2017-03-24 21:02:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 21:02:26 +0100 |
commit | 61fe6d83dea8dbf28a1495906cf6d7b2261cc834 (patch) | |
tree | e7e4802b62112d57b7623c85a85db13caff79e1b /src/usr/local/www/pkg_edit.php | |
parent | 19b3f5bcb3151e3dda985783affa3bd5eee03037 (diff) | |
parent | dd844c430622fa68de1f868b62ec375d7131ce16 (diff) | |
download | pfsense-61fe6d83dea8dbf28a1495906cf6d7b2261cc834.zip pfsense-61fe6d83dea8dbf28a1495906cf6d7b2261cc834.tar.gz |
Merge branch 'master' into patch-18
Diffstat (limited to 'src/usr/local/www/pkg_edit.php')
-rw-r--r-- | src/usr/local/www/pkg_edit.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php index 747fbc6..301d311 100644 --- a/src/usr/local/www/pkg_edit.php +++ b/src/usr/local/www/pkg_edit.php @@ -34,6 +34,7 @@ require_once("guiconfig.inc"); require_once("shaper.inc"); require_once("pkg-utils.inc"); require_once("pfsense-utils.inc"); +require_once("util.inc"); $xml = htmlspecialchars($_REQUEST['xml']); @@ -155,7 +156,6 @@ if ($_POST) { } } - // donotsave is enabled. lets simply exit. if (empty($pkg['donotsave'])) { // store values in xml configuration file. @@ -171,11 +171,24 @@ if ($_POST) { foreach ($_POST as $key => $value) { $matches = array(); if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/", $key, $matches)) { - $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = $value; + if ($rowhelperfield['type'] == "textarea") { + $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = unixnewlines($value); + } else { + $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = $value; + } } } } break; + case "textarea": + $fieldname = $fields['fieldname']; + $fieldvalue = unixnewlines(trim($_POST[$fieldname])); + if ($fields['encoding'] == 'base64') { + $fieldvalue = base64_encode($fieldvalue); + } + if ($fieldname) { + $pkgarr[$fieldname] = $fieldvalue; + } default: $fieldname = $fields['fieldname']; if ($fieldname == "interface_array") { @@ -239,6 +252,7 @@ if ($_POST) { $get_from_post = true; } } elseif (!$input_errors) { + // donotsave is enabled. lets simply exit. exit; } } |