Add JSON decrypt for #2125

This commit is contained in:
James Cole 2019-03-02 09:18:26 +01:00
parent c51c1b8098
commit 9f3c114d57

View File

@ -147,6 +147,11 @@ class UpgradeDatabase extends Command
}
$currencyCode = $this->tryDecrypt($currencyPreference->data);
// try json decrypt just in case.
if (\strlen($currencyCode) > 3) {
$currencyCode = json_decode($currencyCode) ?? 'EUR';
}
$currency = TransactionCurrency::where('code', $currencyCode)->first();
if (null === $currency) {
$this->line('Fall back to default currency in migrateBillsToRules().');