Should address https://bugs.launchpad.net/bugs/506827 by looking for the position...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Jan 2010 21:18:10 +0000 (21:18 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Jan 2010 21:18:10 +0000 (21:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15369 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index bfda50c..7ef4e94 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($qpart1, 0, $where++);
+        my $value = substr($qpart1, $where);
+
         next unless $type and $value;
 
         $value =~ s/^\s*//og;