Addressing LP #
1023651 reported by Dan Scott.
When building a cache key, use processed input values that are
guaranteed to be defined rather than raw ones.
This will mean brief cache misses for AutoSuggest once applied, but
the default life of AutoSuggest cache entries is only 5 minutes anyway.
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
# Get raw autosuggest data (rows returned from a stored procedure) from the DB.
sub get_suggestions {
my $editor = shift;
- my $query = shift;
- my $search_class = shift;
- my $org_unit = shift;
+ my $query = shift || ""; # avoid noise about undef
+ my $search_class = shift || "";
+ my $org_unit = shift || -1;
my $css_prefix = shift || 'oils_AS';
my $highlight_min = int(shift || 0);
my $highlight_max = int(shift || 0);
$query .
$search_class .
$org_unit .
- $css_prefix .
- $highlight_min .
- $highlight_max .
$normalization .
$limit .
- $short_word_length
+ $headline_opts
);
my $res = $cache->get_cache( $key );