diff --git a/lib/actions/settings/payment/shopSettingsPaymentSave.controller.php b/lib/actions/settings/payment/shopSettingsPaymentSave.controller.php index 3785ece04..ced969273 100644 --- a/lib/actions/settings/payment/shopSettingsPaymentSave.controller.php +++ b/lib/actions/settings/payment/shopSettingsPaymentSave.controller.php @@ -11,9 +11,8 @@ public function execute() if (!isset($plugin['settings'])) { $plugin['settings'] = array(); } - foreach ($plugin['settings'] as $key => $value) { - $plugin['settings'][$key] = trim($value); - } + + $this->trimSettingsValue($plugin['settings']); shopPayment::savePlugin($plugin); $is_edit = $plugin['id'] > 0; @@ -36,4 +35,14 @@ public function execute() } } } + + public function trimSettingsValue(&$settings){ + foreach ($settings as &$value) { + if(is_array($value)){ + $this->trimSettingsValue($value); + } else { + $value = trim($value); + } + } + } }