Description
Jonathan Druart
2018-10-15 20:14:05 UTC
Created attachment 80640 [details] [review] Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Created attachment 80642 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Created attachment 80644 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Created attachment 80648 [details] [review] Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Created attachment 80659 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Created attachment 80660 [details] [review] Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Created attachment 80671 [details] [review] Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 80672 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 80673 [details] [review] Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 80694 [details] [review] Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 80695 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 80696 [details] [review] Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Awesome work making the devs lives easier Jonathan. Passing QA.. reads well and works as expected. Created attachment 80716 [details] [review] Bug 21576: Preserve chomp chars for USE raw See bug 21526 comments 5-7 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 81060 [details] [review] Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 81061 [details] [review] Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 81062 [details] [review] Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 81063 [details] [review] Bug 21576: Preserve chomp chars for USE raw See bug 21526 comments 5-7 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Just given the final followup a quick once over.. still Passed QA Awesome work all! Pushed to master for 18.11 Enhancement, will not be backported to 18.05.x series. What about <img src=""> here ? I think the are a few improvements that could be made here, but personally I think they should be recorded in follow-up bugs so they don't get lost in the conversion here. Resolved ? (In reply to Marcel de Rooy from comment #22) > What about <img src=""> here ? Hi Marcel, can you explain what you had in mind? I am not sure I understand. (In reply to Jonathan Druart from comment #25) > (In reply to Marcel de Rooy from comment #22) > > What about <img src=""> here ? > > Hi Marcel, can you explain what you had in mind? I am not sure I understand. I am not sure if I still do too :) Waited too long.. But I guess it is about things like: if ( $line =~ qr{<a href="([^"]+)} ) { Here you handle the URI in the href attribute. Which is good. But I do not see something similar for handling the src attribute of an img tag. Probably that was my question ;) Yes Marcel, it's a good idea. But we must catch the other tags as well. |