[Koha-bugs] [Bug 13812] Facet links broken because double-quotes are not URL encoded.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 18 17:39:09 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13812

Barton Chittenden <barton at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Facet links broken when     |Facet links broken because
                   |shelf location limit is     |double-quotes are not URL
                   |used.                       |encoded.

--- Comment #1 from Barton Chittenden <barton at bywatersolutions.com> ---
(In reply to Barton Chittenden from comment #0)
> This bug is analogous to Bug 13442, but it affects shelf location rather
> than collection code:
> 
> Limiting a search by shelf location is broken, because it wraps
> double-quotes around the "value" part of the key-value pair in the URL. This
> breaks the href= part of the anchor tag.
> 
> The anchor tag generated for the shelf location faced is
> 
> <a
> href="/cgi-bin/koha/opac-search.pl?&limit=mc-loc%3A"100100ADFICCF"&limit=mc-
> loc%3A"100200ADFIC"&limit=mc-loc%3A"100250ADFICGN"&limit=mc-
> loc%3A"100300ADFICHF"&limit=yr%2Cst-numeric%3D2014-&
> sort_by=acqdate_dsc&limit=au:Paetro%2C%20Maxine%2C" title="Paetro,
> Maxine,">Paetro, Maxine,</a>
> 
> Once again, double-quotes inside the URL are causing a premature close of
> the href, which results in a broken link.
> 
> I think that we need to take a look for code duplication inside
> C4::Search::buildQuery -- if there's more than one section of code where
> we're wrapping quotes around the 'value' part of the query, these should be
> consolidated -- shouldn't we be using URL encoding for URL reserved
> characters anyway?

I found another example, this time in facets under Subject:

Starting here:

https://library.roseville.ca.us/cgi-bin/koha/opac-detail.pl?biblionumber=35767&query_desc=kw%2Cwrdl%3A%20Fairies

Click on Subject: Faries ... this leads us here:

https://library.roseville.ca.us/cgi-bin/koha/opac-search.pl?q=su:"Fairies."

All of the facets on this page are broken, because the quotes are passed
straight in, without being URL encoded. Here's an example from the HTML of that
page:

<span class="facet-label"><a
href="/cgi-bin/koha/opac-search.pl?q=ccl=su%3A"Fairies."&sort_by=relevance_asc&limit=su-to:Magic"
title="Magic">Magic</a></span>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list