From 56068684ff612156a77362bbd0a5a87c6c7a80a3 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sat, 27 May 2023 13:30:07 -0600 Subject: [PATCH] Convert base64 description in vars to text --- app/vars/app_defaults.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/app/vars/app_defaults.php b/app/vars/app_defaults.php index 0127245fc0..2f5da1d073 100644 --- a/app/vars/app_defaults.php +++ b/app/vars/app_defaults.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2017 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -26,6 +26,24 @@ if ($domains_processed == 1) { + //base64 decode the description - added for backwards comptability with old versions of FusionPBX + $sql = "select * from v_vars \n"; + $sql .= "where var_description like '%=';\n"; + $database = new database; + $vars = $database->select($sql, null, 'all'); + if (!empty($vars)) { + foreach($vars as $row) { + $sql = "update v_vars "; + $sql .= "set var_description = :var_description "; + $sql .= "where var_uuid = :var_uuid "; + $parameters['var_uuid'] = $row['var_uuid']; + $parameters['var_description'] = base64_decode($row['var_description']); + $database->execute($sql, $parameters); + unset($sql, $parameters); + } + } + unset($sql, $vars); + //add the variables to the database $sql = "select count(*) from v_vars "; $database = new database; @@ -94,9 +112,9 @@ if ($domains_processed == 1) { if (!function_exists('set_country_vars')) { function set_country_vars($x) { require "resources/countries.php"; - + //$country_iso=$_SESSION['domain']['country']['iso_code']; - + $sql = "select default_setting_value "; $sql .= "from v_default_settings "; $sql .= "where default_setting_name = 'iso_code' "; @@ -198,6 +216,7 @@ if ($domains_processed == 1) { //save the vars.xml file save_var_xml(); + } -?> +?> \ No newline at end of file