]> git.koha-community.org Git - koha.git/commit
do some validation of the KohaOpacRecentSearches cookie
authorGalen Charlton <gmc@esilibrary.com>
Sun, 28 Jul 2013 02:48:44 +0000 (02:48 +0000)
committerBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Sun, 28 Jul 2013 21:30:15 +0000 (18:30 -0300)
commitdf13c5e14cc987c078d403323661224c1462f7e6
tree7ca0ef463b7cf92d7a913beb9de21726428d7801
parentd45fff48ae85741d8bfb2c0a52ac504858ac238f
do some validation of the KohaOpacRecentSearches cookie

Add validation of the value of the KohaOpacRecentSearches.  In
particular, this patch avoids the generation of an internal server
error when the OPAC is presented with an old cookie that uses the
old Storable-based serialization.

This patch also moves parsing of the cookie value into a
new routine in C4::Auth, ParseSearchHistoryCookie, and adds
a test case.

To test (in conjunction with the previous patch):

Exercise the OPAC search history functionality, after
turning on the EnableOpacSearchHistory syspref:

- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Apply this patch and the previous one.
- Do *not* clear the KohaOpacRecentSearches cookie
- Check the search history and verify that no searches
  are listed any more
- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Log into the OPAC
- Verify that current and past searches are listed in
  search history.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 89792b97cacb01fc6f7d2380a4c8f21703d79e72)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 89792b97cacb01fc6f7d2380a4c8f21703d79e72)
C4/Auth.pm
opac/opac-search-history.pl
opac/opac-search.pl
t/Auth_ParseSearchHistoryCookie.t [new file with mode: 0644]