1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Plaid ClientID, Secret, and Public Key entry won't delete if fields contained prior data. #1440

This commit is contained in:
Hillel Coren 2017-04-20 13:19:37 +03:00
parent 8ae95c90ba
commit d76005ee2c

View File

@ -274,21 +274,21 @@ class AccountGatewayController extends BaseController
}
$plaidClientId = trim(Input::get('plaid_client_id'));
if ($plaidClientId = str_replace('*', '', $plaidClientId)) {
if (! $plaidClientId || $plaidClientId = str_replace('*', '', $plaidClientId)) {
$config->plaidClientId = $plaidClientId;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) {
$config->plaidClientId = $oldConfig->plaidClientId;
}
$plaidSecret = trim(Input::get('plaid_secret'));
if ($plaidSecret = str_replace('*', '', $plaidSecret)) {
if (! $plaidSecret || $plaidSecret = str_replace('*', '', $plaidSecret)) {
$config->plaidSecret = $plaidSecret;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) {
$config->plaidSecret = $oldConfig->plaidSecret;
}
$plaidPublicKey = trim(Input::get('plaid_public_key'));
if ($plaidPublicKey = str_replace('*', '', $plaidPublicKey)) {
if (! $plaidPublicKey || $plaidPublicKey = str_replace('*', '', $plaidPublicKey)) {
$config->plaidPublicKey = $plaidPublicKey;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) {
$config->plaidPublicKey = $oldConfig->plaidPublicKey;