Bug 6536: [QA Follow-up] Remove surrounding spaces in sru_fields

This patch only removes surrouding spaces at comma and equals-sign while
passing the options in sru_fields to the ZOOM object.

Test plan:
If you add spaces between options in sru_fields, searching should still work.
E.g. sru_fields= sru = get , sru_version = 1.1

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Marcel de Rooy 2014-08-21 14:47:06 +02:00 committed by Tomas Cohen Arazi
parent 8c7377d21d
commit a06b1ac728
1 changed files with 4 additions and 1 deletions

View File

@ -360,7 +360,10 @@ sub _create_connection {
if( $server->{servertype} eq 'sru' ) {
foreach( split ',', $server->{sru_options}//'' ) {
my @temp= split '=';
#first remove surrounding spaces at comma and equals-sign
s/^\s+|\s+$//g;
my @temp= split '=', $_, 2;
@temp= map { s/^\s+|\s+$//g; $_; } @temp;
$option1->option( $temp[0] => $temp[1] ) if @temp;
}
} elsif( $server->{servertype} eq 'zed' ) {