X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2Flib%2FQA%2FTemplateFilters.pm;h=c4ec77d5246e9e1a6ea6f5311785e27f88410baf;hb=912fb42458a422248986c74fd8a1fd92df531fb5;hp=467010e85a48daf75318d2e45c27113b56a565fe;hpb=5d49ea039c981ee73085c70b326ea47c29bee0ba;p=koha_ffzg diff --git a/t/lib/QA/TemplateFilters.pm b/t/lib/QA/TemplateFilters.pm index 467010e85a..c4ec77d524 100644 --- a/t/lib/QA/TemplateFilters.pm +++ b/t/lib/QA/TemplateFilters.pm @@ -133,14 +133,13 @@ sub process_tt_block { # Already escaped with a special filter # We could escape it but should be safe - or $tt_block =~ m{\s?\|\s?\$KohaDates\s?$} - or $tt_block =~ m{\s?\|\s?\$Price\s?$} + or $tt_block =~ m{\s?\|\s?\$KohaDates[^\|]*$} # Already escaped correctly with raw or $tt_block =~ m{\|\s?\$raw} # Assignment, maybe we should require to use SET (?) - or $tt_block =~ m{=} + or ( $tt_block =~ m{=} and not $tt_block =~ m{\s\|\s} ) # Already has url or uri filter or $tt_block =~ m{\|\s?ur(l|i)} @@ -166,6 +165,21 @@ sub process_tt_block { : q| | : q| |; + if ( $tt_block =~ m{\s?\|\s?\$KohaDates[^\|]*\|.*$} + ) { + $tt_block =~ + s/\s*\|\s*(uri|url|html)\s*$//; # Could be another filter... + $line =~ s{ + \[% + \s*$pre_chomp\s* + \Q$tt_block\E\s*\|\s*(uri|url|html) + \s*$post_chomp\s* + %\] + }{[%$pre_chomp$tt_block$post_chomp%]}xms; + + return ( $line, 'extra_filter_not_needed' ); + } + if ( # Use the uri filter is needed # If html filtered or not filtered