From 427de0594d05a8222f55b2894311e648ba1be991 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 2 Aug 2019 16:42:16 +0200 Subject: [PATCH 1/6] Fix #2363 --- resources/views/v1/transactions/convert.twig | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/resources/views/v1/transactions/convert.twig b/resources/views/v1/transactions/convert.twig index ff71b59d67..051f843a40 100644 --- a/resources/views/v1/transactions/convert.twig +++ b/resources/views/v1/transactions/convert.twig @@ -22,12 +22,12 @@ {# in case of withdrawal #} {% if sourceType.type == "Withdrawal" %} - {{ ExpandedForm.staticText('source_account_asset', ''~sourceAccount.name~'') }} + {{ ExpandedForm.staticText('source_account_asset', ''~sourceAccount.name|escape~'') }} {# if destination is cash, show (cash) #} {% if destinationAccount.accountType.type == "Cash account" %} {{ ExpandedForm.staticText('destination_account_expense', '(cash)') }} {% else %} - {{ ExpandedForm.staticText('destination_account_expense', ''~destinationAccount.name~'') }} + {{ ExpandedForm.staticText('destination_account_expense', ''~destinationAccount.name|escape~'') }} {% endif %} {% endif %} @@ -38,15 +38,15 @@ {% if sourceAccount.accountType.type == "Cash account" %} {{ ExpandedForm.staticText('source_account_revenue', '(cash)') }} {% else %} - {{ ExpandedForm.staticText('source_account_revenue', ''~sourceAccount.name~'') }} + {{ ExpandedForm.staticText('source_account_revenue', ''~sourceAccount.name|escape~'') }} {% endif %} - {{ ExpandedForm.staticText('destination_account_asset', ''~destinationAccount.name~'') }} + {{ ExpandedForm.staticText('destination_account_asset', ''~destinationAccount.name|escape~'') }} {% endif %} {# in case of transfer #} {% if sourceType.type == "Transfer" %} - {{ ExpandedForm.staticText('source_account_asset', ''~sourceAccount.name~'') }} - {{ ExpandedForm.staticText('destination_account_asset', ''~destinationAccount.name~'') }} + {{ ExpandedForm.staticText('source_account_asset', ''~sourceAccount.name|escape~'') }} + {{ ExpandedForm.staticText('destination_account_asset', ''~destinationAccount.name|escape~'') }} {% endif %} {# ONE #} @@ -56,9 +56,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -69,7 +69,7 @@ {% if destinationAccount.accountType.type == "Cash account" %} {{ ExpandedForm.text('source_account_revenue', '') }} {% else %} - {{ ExpandedForm.text('source_account_revenue', destinationAccount.name) }} + {{ ExpandedForm.text('source_account_revenue', destinationAccount.name|escape) }} {% endif %} {% endif %} @@ -80,9 +80,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -104,9 +104,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -119,7 +119,7 @@ {% if sourceAccount.accountType.type == "Cash account" %} {{ ExpandedForm.text('destination_account_expense', '') }} {% else %} - {{ ExpandedForm.text('destination_account_expense', destinationAccount.name) }} + {{ ExpandedForm.text('destination_account_expense', destinationAccount.name|escape) }} {% endif %} {% endif %} @@ -133,9 +133,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -157,9 +157,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -170,7 +170,7 @@

- {{ ExpandedForm.text('destination_account_expense', destinationAccount.name) }} + {{ ExpandedForm.text('destination_account_expense', destinationAccount.name|escape) }} {% endif %} @@ -184,9 +184,9 @@ { amount: positiveAmount|formatAmount, sourceRoute: route('accounts.show', [sourceAccount.id]), - sourceName: sourceAccount.name, + sourceName: sourceAccount.name|escape, destinationRoute: route('accounts.show', [destinationAccount.id]), - destinationName: destinationAccount.name, + destinationName: destinationAccount.name|escape, })|raw }}

@@ -197,7 +197,7 @@

- {{ ExpandedForm.text('source_account_revenue', sourceAccount.name) }} + {{ ExpandedForm.text('source_account_revenue', sourceAccount.name|escape) }} {% endif %} From 3ad4e04e2ae50e60564b60b68dfac083e5684882 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 2 Aug 2019 16:43:36 +0200 Subject: [PATCH 2/6] Fix #2364 --- resources/views/v1/transactions/links/delete.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/v1/transactions/links/delete.twig b/resources/views/v1/transactions/links/delete.twig index fad7391887..0f343125da 100644 --- a/resources/views/v1/transactions/links/delete.twig +++ b/resources/views/v1/transactions/links/delete.twig @@ -12,14 +12,14 @@
-

{{ trans('firefly.delete_journal_link', {source: link.source.description, destination: link.destination.description, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}

+

{{ trans('firefly.delete_journal_link', {source: link.source.description|escape, destination: link.destination.description|escape, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}

{{ trans('form.permDeleteWarning') }}

- {{ trans('form.journal_link_areYouSure', {source: link.source.description, destination: link.destination.description, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }} + {{ trans('form.journal_link_areYouSure', {source: link.source.description|escape, destination: link.destination.description|escape, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}