Bug 22007 - KohaDates output does not need to be html filtered
Summary: KohaDates output does not need to be html filtered
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 13618
Blocks:
  Show dependency treegraph
 
Reported: 2018-12-14 19:28 UTC by Jonathan Druart
Modified: 2019-01-09 12:41 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 22007: Remove html filters when KohaDates called with a parameter (32.86 KB, patch)
2018-12-15 02:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22007: Handle safe filtered output (KohaDates) (3.46 KB, patch)
2018-12-15 02:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22007: Also handle Price and HtmlTags (2.20 KB, patch)
2018-12-15 02:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22007: Generated with add_missing_filters.pl (12.80 KB, patch)
2018-12-15 02:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22007: Remove html filters when KohaDates called with a parameter (32.79 KB, patch)
2018-12-17 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22007: Handle safe filtered output (KohaDates) (3.50 KB, patch)
2018-12-17 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22007: Also handle Price and HtmlTags (2.24 KB, patch)
2018-12-17 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22007: Generated with add_missing_filters.pl (12.80 KB, patch)
2018-12-17 14:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22007: Remove html filters when KohaDates called with a parameter (32.97 KB, patch)
2019-01-01 22:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22007: Handle safe filtered output (KohaDates) (3.57 KB, patch)
2019-01-01 22:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22007: Also handle Price and HtmlTags (2.30 KB, patch)
2019-01-01 22:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22007: Generated with add_missing_filters.pl (12.90 KB, patch)
2019-01-01 22:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 2019-01-02 21:12:00 UTC
Awesome work all!

Pushed to master for 19.05
Comment 14 Martin Renvoize 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.