diff --git a/src/library/FOSSBilling/SentryHelper.php b/src/library/FOSSBilling/SentryHelper.php index 8eb282f58..6cbfd341b 100644 --- a/src/library/FOSSBilling/SentryHelper.php +++ b/src/library/FOSSBilling/SentryHelper.php @@ -84,7 +84,8 @@ class SentryHelper // Array containing instance IDs that are blacklisted from error reporting and a timestamp of when their blacklist expires. private static array $blacklistedInstances = [ - '82766452-ff2f-43ff-953a-3cbe3c3973ea' => '2024-07-01', + '82766452-ff2f-43ff-953a-3cbe3c3973ea' => '2024-07-01', // Low quality modifications causing lots of errors + 'fd26d5bc-95f4-4c9f-9807-28577f43c811' => '2024-05-01', // Low quality modifications causing lots of errors ]; private static string $placeholderFirstHalf = '--replace--this--'; diff --git a/src/library/FOSSBilling/Tools.php b/src/library/FOSSBilling/Tools.php index 4f3b1fed4..ba3644c6a 100644 --- a/src/library/FOSSBilling/Tools.php +++ b/src/library/FOSSBilling/Tools.php @@ -335,7 +335,7 @@ class Tools { $protocol = $_SERVER['HTTPS'] ?? $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? $_SERVER['REQUEST_SCHEME'] ?? ''; - // $_SERVER['HTTPS'] will be set to `on` to indicate HTTPS and the other to will be set to `https`, so either one means we are connected via HTTPS. + // $_SERVER['HTTPS'] will be set to `on` to indicate HTTPS and the others to will be set to `https`, so either one means we are connected via HTTPS. return strcasecmp($protocol, 'on') === 0 || strcasecmp($protocol, 'https') === 0; } diff --git a/src/modules/Invoice/ServicePayGateway.php b/src/modules/Invoice/ServicePayGateway.php index 6f8c74f6a..edc07ca83 100644 --- a/src/modules/Invoice/ServicePayGateway.php +++ b/src/modules/Invoice/ServicePayGateway.php @@ -129,8 +129,8 @@ class ServicePayGateway implements InjectionAwareInterface if ($identity instanceof \Model_Admin) { $result['supports_one_time_payments'] = $single; $result['supports_subscriptions'] = $recurrent; - if ($model->config) { - $result['config'] = json_decode($model->config, 1); + if (!empty($model->config) && json_validate($model->config)) { + $result['config'] = json_decode($model->config, true); } else { $result['config'] = []; } diff --git a/src/modules/Order/Service.php b/src/modules/Order/Service.php index 8d736b4b5..ffc899dc3 100644 --- a/src/modules/Order/Service.php +++ b/src/modules/Order/Service.php @@ -335,7 +335,11 @@ class Service implements InjectionAwareInterface $supportService = $this->di['mod_service']('support'); $data = $this->di['db']->toArray($model); - $data['config'] = json_decode($model->config, 1); + if (!empty($model->config) && json_validate($model->config)) { + $data['config'] = json_decode($model->config, true); + } else { + $data['config'] = []; + } $data['total'] = $this->getTotal($model); $data['title'] = $model->title; $data['meta'] = $this->di['db']->getAssoc('SELECT name, value FROM client_order_meta WHERE client_order_id = :id', [':id' => $model->id]); diff --git a/src/modules/Servicehosting/Service.php b/src/modules/Servicehosting/Service.php index 6130e2dfd..27dd19c61 100644 --- a/src/modules/Servicehosting/Service.php +++ b/src/modules/Servicehosting/Service.php @@ -535,8 +535,8 @@ class Service implements InjectionAwareInterface $result['status_url'] = $model->status_url; $result['max_accounts'] = $model->max_accounts; $result['manager'] = $model->manager; - if (!is_null($model->config)) { - $result['config'] = json_decode($model->config, 1); + if (!empty($model->config) && json_validate($model->config)) { + $result['config'] = json_decode($model->config, true); } else { $result['config'] = []; } @@ -776,8 +776,10 @@ class Service implements InjectionAwareInterface $config['host'] = $model->hostname; $config['port'] = $model->port; $config['config'] = []; - if (!is_null($model->config)) { - $config['config'] = json_decode($model->config, 1); + if (!empty($model->config) && json_validate($model->config)) { + $config['config'] = json_decode($model->config, true); + } else { + $config['config'] = []; } $config['secure'] = $model->secure; $config['username'] = $model->username; @@ -884,8 +886,8 @@ class Service implements InjectionAwareInterface $model->max_park = $data['max_park'] ?? $model->max_park; /* add new config value to hosting plan */ - if ($model->config) { - $config = json_decode($model->config, 1); + if (!empty($model->config) && json_validate($model->config)) { + $config = json_decode($model->config, true); } else { $config = []; }