about summary refs log tree commit homepage
path: root/lib/PublicInbox/Search.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-11 12:57:28 +0700
committerEric Wong <e@80x24.org>2021-02-12 22:58:50 -0400
commitc471b946ef629cf3db9043081a1aeaa189436f6b (patch)
tree88d9a38b81b6d32ddfba81158b004cc481607f05 /lib/PublicInbox/Search.pm
parent376778b910cdf787d6e08cfd11acab26118899f4 (diff)
downloadpublic-inbox-c471b946ef629cf3db9043081a1aeaa189436f6b.tar.gz
The cleanup doesn't seem to matter, I initially thought I needed
to handle "" (two double quotes) explicitly because that's what
Xapian does to escape a double quote inside a double-quoted
phrase.  It turns out we only need to be able to pass phrases
through to Xapian unmodified, and the existing group of
["\x{201c}\x{201d}] is sufficient for our purposes.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r--lib/PublicInbox/Search.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 520aa31d..c5a1bd69 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -357,7 +357,7 @@ sub query_approxidate {
         my $DQ = qq<"\x{201c}\x{201d}>; # Xapian can use curly quotes
         $_[2] =~ tr/\x00/ /; # Xapian doesn't do NUL, we use it as a placeholder
         my ($terms, $phrase, $to_parse);
-        $_[2] =~ s{([^$DQ]*)([${DQ}][^\"]*[$DQ])?}{
+        $_[2] =~ s{([^$DQ]*)([$DQ][^$DQ]*[$DQ])?}{
                 ($terms, $phrase) = ($1, $2);
                 $terms =~ s!\b(d|rt|dt):(\S+)!
                         date_parse_prepare($to_parse //= [], $1, $2)!sge;