1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Trim gateway config info

This commit is contained in:
Hillel Coren 2017-01-11 19:51:47 +02:00
parent 029353ff47
commit 28804b0068

View File

@ -259,28 +259,28 @@ class AccountGatewayController extends BaseController
$config = clone $oldConfig; $config = clone $oldConfig;
} }
$publishableKey = Input::get('publishable_key'); $publishableKey = trim(Input::get('publishable_key'));
if ($publishableKey = str_replace('*', '', $publishableKey)) { if ($publishableKey = str_replace('*', '', $publishableKey)) {
$config->publishableKey = $publishableKey; $config->publishableKey = $publishableKey;
} elseif ($oldConfig && property_exists($oldConfig, 'publishableKey')) { } elseif ($oldConfig && property_exists($oldConfig, 'publishableKey')) {
$config->publishableKey = $oldConfig->publishableKey; $config->publishableKey = $oldConfig->publishableKey;
} }
$plaidClientId = Input::get('plaid_client_id'); $plaidClientId = trim(Input::get('plaid_client_id'));
if ($plaidClientId = str_replace('*', '', $plaidClientId)) { if ($plaidClientId = str_replace('*', '', $plaidClientId)) {
$config->plaidClientId = $plaidClientId; $config->plaidClientId = $plaidClientId;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) {
$config->plaidClientId = $oldConfig->plaidClientId; $config->plaidClientId = $oldConfig->plaidClientId;
} }
$plaidSecret = Input::get('plaid_secret'); $plaidSecret = trim(Input::get('plaid_secret'));
if ($plaidSecret = str_replace('*', '', $plaidSecret)) { if ($plaidSecret = str_replace('*', '', $plaidSecret)) {
$config->plaidSecret = $plaidSecret; $config->plaidSecret = $plaidSecret;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) {
$config->plaidSecret = $oldConfig->plaidSecret; $config->plaidSecret = $oldConfig->plaidSecret;
} }
$plaidPublicKey = Input::get('plaid_public_key'); $plaidPublicKey = trim(Input::get('plaid_public_key'));
if ($plaidPublicKey = str_replace('*', '', $plaidPublicKey)) { if ($plaidPublicKey = str_replace('*', '', $plaidPublicKey)) {
$config->plaidPublicKey = $plaidPublicKey; $config->plaidPublicKey = $plaidPublicKey;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) {