Bug 22007

Summary: KohaDates output does not need to be html filtered
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jesse, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 13618    
Bug Blocks:    
Attachments: Bug 22007: Remove html filters when KohaDates called with a parameter
Bug 22007: Handle safe filtered output (KohaDates)
Bug 22007: Also handle Price and HtmlTags
Bug 22007: Generated with add_missing_filters.pl
Bug 22007: Remove html filters when KohaDates called with a parameter
Bug 22007: Handle safe filtered output (KohaDates)
Bug 22007: Also handle Price and HtmlTags
Bug 22007: Generated with add_missing_filters.pl
Bug 22007: Remove html filters when KohaDates called with a parameter
Bug 22007: Handle safe filtered output (KohaDates)
Bug 22007: Also handle Price and HtmlTags
Bug 22007: Generated with add_missing_filters.pl

Description Jonathan Druart 2018-12-14 19:28:18 UTC
Bug 13618 took care of the KohaDates output but not if it is called with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).

We could avoid unnecessary processing by removing the extra html filter.
Comment 1 Jonathan Druart 2018-12-15 02:58:05 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2018-12-15 02:58:08 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2018-12-15 02:58:16 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2018-12-15 02:58:20 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2018-12-17 14:18:06 UTC
Created attachment 83286 [details] [review]
Bug 22007: Remove html filters when KohaDates called with a parameter

Bug 13618 took care of the KohaDates output but not if it is called
with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).

We could avoid unnecessary processing by removing the extra html filter.

Patch generated with the following command:
  % perl -p -i -e 's/KohaDates([^%\|]*)\s?\|\s?html\s?/KohaDates $1/g' **/*.inc **/*.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2018-12-17 14:18:09 UTC
Created attachment 83287 [details] [review]
Bug 22007: Handle safe filtered output (KohaDates)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Owen Leonard 2018-12-17 14:18:12 UTC
Created attachment 83288 [details] [review]
Bug 22007: Also handle Price and HtmlTags

Those 2 filters should return safe output as well

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 8 Owen Leonard 2018-12-17 14:18:15 UTC
Created attachment 83289 [details] [review]
Bug 22007: Generated with add_missing_filters.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Katrin Fischer 2019-01-01 22:02:18 UTC
Created attachment 83561 [details] [review]
Bug 22007: Remove html filters when KohaDates called with a parameter

Bug 13618 took care of the KohaDates output but not if it is called
with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).

We could avoid unnecessary processing by removing the extra html filter.

Patch generated with the following command:
  % perl -p -i -e 's/KohaDates([^%\|]*)\s?\|\s?html\s?/KohaDates $1/g' **/*.inc **/*.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2019-01-01 22:02:22 UTC
Created attachment 83562 [details] [review]
Bug 22007: Handle safe filtered output (KohaDates)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-01-01 22:02:26 UTC
Created attachment 83563 [details] [review]
Bug 22007: Also handle Price and HtmlTags

Those 2 filters should return safe output as well

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2019-01-01 22:02:30 UTC
Created attachment 83564 [details] [review]
Bug 22007: Generated with add_missing_filters.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Nick Clemens (kidclamp) 2019-01-02 21:12:00 UTC
Awesome work all!

Pushed to master for 19.05
Comment 14 Martin Renvoize (ashimema) 2019-01-07 15:14:37 UTC
Pushed to 18.11.x for 18.11.02
Comment 15 Jesse Maseto 2019-01-09 12:41:11 UTC
Merge conflicts when attempting to backport to 18.05. If this is required for 18.05.x this will need to be rebased.