Skip to content

Firefly III: a personal finances manager

Fix view and mails.

James Cole314cf3f6334c
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 8d4cf94d88..f2fb31f0cc 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -240,7 +240,23 @@ class Handler extends ExceptionHandler
$userData['email'] = auth()->user()->email;
}
- $headers = request()->headers->all();
+ // remove sensitive info from POST.
+ $post = '';
+ if('PUT' === request()->method() || 'POST' === request()->method()) {
+ $sensitive = ['password', 'password_confirmation', 'secret', 'token', 'api_key', 'client_secret'];
+ // @mago-expect lint:no-request-all
+ $content = request()->all();
+ foreach ($sensitive as $field) {
+ if (array_key_exists($field, $content)) {
+ $content[$field] = '(removed)';
+ }
+ }
+ $post = json_encode($content);
+ }
+
+ // remove specific headers
+ $headers = request()->headers->all();
+ unset($headers['authorization'], $headers['cookie'], $headers['x-csrf-token']);
$data = [
'class' => $e::class,
@@ -256,8 +272,7 @@ class Handler extends ExceptionHandler
'json' => request()->acceptsJson(),
'method' => request()->method(),
'headers' => $headers,
- // @mago-expect lint:no-request-all
- 'post' => 'PUT' === request()->method() || 'POST' === request()->method() ? json_encode(request()->all()) : '',
+ 'post' => $post,
];
// create job that will mail.
diff --git a/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php b/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
index 9958ce4780..09ae384f8a 100644
--- a/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
+++ b/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
@@ -143,7 +143,7 @@ class PrimaryAmountRecalculationService
TransactionObserver::$recalculate = false;
Log::debug(sprintf('Count of set is %d', $set->count()));
foreach ($set as $item) {
- Log::debug(sprintf('Touch transaction #%d', $item->id));
+ //Log::debug(sprintf('Touch transaction #%d', $item->id));
// here we are.
/** @var null|Transaction $transaction */
@@ -177,7 +177,7 @@ class PrimaryAmountRecalculationService
TransactionObserver::$recalculate = false;
Log::debug(sprintf('Count of set is %d', $set->count()));
foreach ($set as $item) {
- Log::debug(sprintf('Touch transaction #%d', $item->id));
+ // Log::debug(sprintf('Touch transaction #%d', $item->id));
// here we are.
/** @var null|Transaction $transaction */
diff --git a/resources/views/emails/error/error-html.blade.php b/resources/views/emails/error/error-html.blade.php
index 34ec1058c9..7affd3d45b 100644
--- a/resources/views/emails/error/error-html.blade.php
+++ b/resources/views/emails/error/error-html.blade.php
@@ -12,7 +12,7 @@
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
-{{ trans('email.error_location', ['file' => $file, 'line' => $line, 'code' => $code]) }}
+{!! trans('email.error_location', ['file' => $file, 'line' => $line, 'code' => $code]) !!}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
diff --git a/resources/views/json/piggy-banks.blade.php b/resources/views/json/piggy-banks.blade.php
index 80da11e939..04219c9097 100644
--- a/resources/views/json/piggy-banks.blade.php
+++ b/resources/views/json/piggy-banks.blade.php
@@ -9,7 +9,7 @@
<div class="progress">
<div class="progress-bar progress-bar-striped w-{{ round($entry['percentage']) }}" role="progressbar" aria-valuenow="{{ $entry['percentage'] }}" aria-valuemin="0" aria-valuemax="100">
@if($entry['percentage'] > 20)
- @if($convertToPrimary && 0 !== $avg['pc_amount'])
+ @if($convertToPrimary && 0 !== $entry['pc_amount'])
{!! format_amount_by_symbol($entry['pc_amount'], $entry['primary_currency_symbol'], $entry['primary_currency_decimal_places'], false) !!}
({!! format_amount_by_symbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places'], false) !!})
@endif
@@ -20,7 +20,7 @@
</div>
@if($entry['percentage'] <= 20)
&nbsp;
- @if($convertToPrimary && 0 !== $avg['pc_amount'])
+ @if($convertToPrimary && 0 !== $entry['pc_amount'])
{!! format_amount_by_symbol($entry['pc_amount'], $entry['primary_currency_symbol'], $entry['primary_currency_decimal_places'], false) !!}
({!! format_amount_by_symbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places'], false) !!})
@endif