Bugzilla – Attachment 15093 Details for
Bug 9554
single quote in didyoumean
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-9554-single-quot-not-escaped-by-TT-URL-filter.patch (text/plain), 5.20 KB, created by
Fridolin Somers
on 2013-02-06 13:40:18 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-02-06 13:40:18 UTC
Size:
5.20 KB
patch
obsolete
>From 70da9cdde9b6b96926f889e246407932a58b1284 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Mon, 4 Feb 2013 17:48:58 +0100 >Subject: [PATCH] Bug 9554: single quot not escaped by TT URL filter > >When using "url" or "uri" template toolkit filters, I noticed that double quotes are escaped (%22), but not single quotes. >This causes sometimes a problem when URL is written in JavaScript code, in a string delimited by single quotes. >--- > .../prog/en/modules/opac-results-grouped.tt | 4 ++-- > .../opac-tmpl/prog/en/modules/opac-results.tt | 24 ++++++++++++-------- > .../opac-tmpl/prog/en/modules/svc/suggestion.tt | 6 ++--- > 3 files changed, 19 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >index a461800..d17a906 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >@@ -16,8 +16,8 @@ var q_array = new Array(); // will hold the search terms, if possible > > $(document).ready(function(){ > [% IF ( OpacHighlightedWords ) %] >- $('a.title').each(function() { >- $(this).attr('href', $(this).attr('href') + '&query_desc=[% query_desc | url %]'); >+ $("a.title").each(function() { >+ $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc |url %]"); > }); > [% END %] > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 30682c4..ece7d2b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >@@ -104,8 +104,8 @@ function highlightOn() { > [% END %] > $(document).ready(function(){ > [% IF ( OpacHighlightedWords ) %] >- $('a.title').each(function() { >- $(this).attr('href', $(this).attr('href') + '&query_desc=[% query_desc | url %]'); >+ $("a.title").each(function() { >+ $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc |url %]"); > }); > [% END %] > >@@ -303,12 +303,16 @@ $(document).ready(function(){ > [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] > [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] > >- $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]', >+[% IF ( DidYouMean ) %] >+ $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]", > function() { >- $('.searchsuggestion').parent().parent().css({ >- 'border-color': '#F4ECBE', >- 'background-color': '#FFFBEA'}); >- } ); >+ $(".searchsuggestion").parent().parent().css({ >+ "border-color": "#F4ECBE", >+ "background-color": "#FFFBEA" >+ }); >+ }); >+[% END %] >+ > }); > > //]]> >@@ -325,7 +329,7 @@ $(document).ready(function(){ > <div class="yui-b"> > <div id="userresults" class="container"> > [% IF ( DidYouMean ) %] >- <div id='didyoumean'>Not what you expected? Check for <a href='/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring | uri %]'>suggestions</a></div> >+ <div id="didyoumean">Not what you expected? Check for <a href="/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring |uri %]">suggestions</a></div> > [% END %] > <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div> > [% IF ( koha_spsuggest ) %] >@@ -607,8 +611,8 @@ $(document).ready(function(){ > [% END %] > > [% END %] >- <input type="hidden" name='biblionumber' value="[% SEARCH_RESULT.biblionumber %]" /> >- <input type="hidden" name='loggedinuser' value="[% loggedinuser %]" /> >+ <input type="hidden" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> >+ <input type="hidden" name="loggedinuser" value="[% loggedinuser %]" /> > > [% IF ( SEARCH_RESULT.rating_total ) > 0 %] > <span id="rating_total_[% SEARCH_RESULT.biblionumber %]"> ([% SEARCH_RESULT.rating_total %] votes)</span> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/svc/suggestion.tt b/koha-tmpl/opac-tmpl/prog/en/modules/svc/suggestion.tt >index 1bc77ba..7960445 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/svc/suggestion.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/svc/suggestion.tt >@@ -14,13 +14,13 @@ > [% END %] > [% IF suggestions && suggestions.size %] > <div> >- <span class='suggestionlabel'>Did you mean:</span> >+ <span class="suggestionlabel">Did you mean:</span> > [% FOREACH suggestion IN suggestions %] >- <span class='searchsuggestion'><a href='/cgi-bin/koha/opac-search.pl?q=[% suggestion.search | uri %]'>[% suggestion.label %]</a></span> >+ <span class="searchsuggestion"><a href="/cgi-bin/koha/opac-search.pl?q=[% suggestion.search |uri %]">[% suggestion.label |html %]</a></span> > [% END %] > </div> > [% ELSE %] >- <span class='nosuggestions'>Sorry, no suggestions.</span> >+ <span class="nosuggestions">Sorry, no suggestions.</span> > [% END %] > [% IF (render=='standalone') %] > </div> >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9554
:
15093
|
15095
|
15177
|
16264
|
17174