Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix #335
James Coledc893588b033
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex f418fce394..b1b8e7c10f 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -295,14 +295,14 @@ class AccountController extends Controllerpublic function store(AccountFormRequest $request, AccountCrudInterface $crud){$accountData = [- 'name' => $request->input('name'),+ 'name' => trim($request->input('name')),'accountType' => $request->input('what'),'virtualBalance' => round($request->input('virtualBalance'), 2),'virtualBalanceCurrency' => intval($request->input('amount_currency_id_virtualBalance')),'active' => true,'user' => auth()->user()->id,- 'iban' => $request->input('iban'),- 'accountNumber' => $request->input('accountNumber'),+ 'iban' => trim($request->input('iban')),+ 'accountNumber' => trim($request->input('accountNumber')),'accountRole' => $request->input('accountRole'),'openingBalance' => round($request->input('openingBalance'), 2),'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.phpindex dbcac2308d..e9b05fd324 100644--- a/app/Http/Controllers/CategoryController.php+++ b/app/Http/Controllers/CategoryController.php@@ -263,7 +263,7 @@ class CategoryController extends Controllerpublic function store(CategoryFormRequest $request, CRI $repository){$categoryData = [- 'name' => $request->input('name'),+ 'name' => trim($request->input('name')),'user' => auth()->user()->id,];$category = $repository->store($categoryData);diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.phpindex c45c97862f..49bb2e69a3 100644--- a/app/Http/Requests/JournalFormRequest.php+++ b/app/Http/Requests/JournalFormRequest.php@@ -43,11 +43,11 @@ class JournalFormRequest extends Requestreturn ['what' => $this->get('what'),- 'description' => $this->get('description'),+ 'description' => trim($this->get('description')),'source_account_id' => intval($this->get('source_account_id')),- 'source_account_name' => $this->getFieldOrEmptyString('source_account_name'),+ 'source_account_name' => trim($this->getFieldOrEmptyString('source_account_name')),'destination_account_id' => intval($this->get('destination_account_id')),- 'destination_account_name' => $this->getFieldOrEmptyString('destination_account_name'),+ 'destination_account_name' => trim($this->getFieldOrEmptyString('destination_account_name')),'amount' => round($this->get('amount'), 2),'user' => auth()->user()->id,'amount_currency_id_amount' => intval($this->get('amount_currency_id_amount')),@@ -56,7 +56,7 @@ class JournalFormRequest extends Request'book_date' => $this->getDateOrNull('book_date'),'process_date' => $this->getDateOrNull('process_date'),'budget_id' => intval($this->get('budget_id')),- 'category' => $this->getFieldOrEmptyString('category'),+ 'category' => trim($this->getFieldOrEmptyString('category')),'tags' => explode(',', $tags),'piggy_bank_id' => intval($this->get('piggy_bank_id')),@@ -64,8 +64,8 @@ class JournalFormRequest extends Request'due_date' => $this->getDateOrNull('due_date'),'payment_date' => $this->getDateOrNull('payment_date'),'invoice_date' => $this->getDateOrNull('invoice_date'),- 'internal_reference' => $this->get('internal_reference'),- 'notes' => $this->get('notes'),+ 'internal_reference' => trim($this->get('internal_reference')),+ 'notes' => trim($this->get('notes')),];}