Backporting fix for https://bugs.launchpad.net/evergreen/+bug/506827
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jan 2010 13:44:34 +0000 (13:44 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jan 2010 13:44:34 +0000 (13:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@15375 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index bfda50c..ab4e2db 100644 (file)
@@ -563,8 +563,12 @@ sub multiclass_query {
     $logger->debug("cleansed query string => $query");
     my $search = $arghash->{searches} = {};
 
-    while ($query =~ s/((?:keyword(?:\|\w+)?|title(?:\|\w+)?|author(?:\|\w+)?|subject(?:\|\w+)?|series(?:\|\w+)?|site|dir|sort|lang|available):[^:]+)$//so) {
-        my($type, $value) = split(':', $1);
+    while ($query =~ s/((?:keyword(?:\|\w+)?|title(?:\|\w+)?|author(?:\|\w+)?|subject(?:\|\w+)?|series(?:\|\w+)?|site|dir|sort|lang|available):.+?)$//so) {
+        my $qpart = $1;
+        my $where = index($qpart,':');
+        my $type = substr($qpart, 0, $where++);
+        my $value = substr($qpart, $where);
+
         next unless $type and $value;
 
         $value =~ s/^\s*//og;