Bug 8702: System preferences search does not allow accented letters

This bug enables accented/diacritic system preference text to be matched
when searching for sysprefs.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Fridolyn SOMERS 2012-09-18 15:59:37 +02:00 committed by Paul Poulain
parent a6542d4205
commit 9ee5c9ec1e
3 changed files with 6 additions and 3 deletions

View file

@ -297,7 +297,10 @@ my @TABS;
if ( $op eq 'search' ) {
my $searchfield = $input->param( 'searchfield' );
$searchfield =~ s/[^a-zA-Z0-9_ -]//g;
$searchfield =~ s/\p{IsC}//g;
$searchfield =~ s/\s+/ /;
$searchfield =~ s/^\s+//;
$searchfield =~ s/\s+$//;
$template->param( searchfield => $searchfield );

View file

@ -6,7 +6,7 @@
<form action="/cgi-bin/koha/admin/preferences.pl">
<input type="hidden" name="tab" value="[% last_tab %]" />
<input type="hidden" name="op" value="search" />
<input type="text" size="40" name="searchfield" value="[% searchfield %]" />
<input type="text" size="40" name="searchfield" value="[% searchfield |html %]" />
<input type="submit" class="submit" value="Search" />
</form>
</div>

View file

@ -42,7 +42,7 @@
[% END %]
[% IF ( search_not_found ) %]
<div class="dialog alert">
No system preferences matched your search for <strong>[% searchfield %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
No system preferences matched your search for <strong>[% searchfield |html %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
</div>
[% END %]
[% FOREACH TAB IN TABS %]