Skip to content

Commit

Permalink
topic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Dec 1, 2004
1 parent aa73885 commit 74b20f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/Search/search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ sub main {
my $searchDB = getObject('Slash::Search', { db_type => 'search' });

# Backwards compatibility, we now favor tid over topic
$form->{tid} ||= $form->{topic};
if ($form->{topic}) {
if ($form->{topic} =~ s/^([+-]?[\d.]+).*$/$1/s) {
$form->{tid} ||= $form->{topic};
}
delete $form->{topic};
}

# Set some defaults
$form->{query} ||= '';
Expand Down Expand Up @@ -144,7 +149,7 @@ sub _buildargs {
my($form) = @_;
my $uri;

for (qw[threshold query author op topic tid section sort journal_only]) {
for (qw[threshold query author op tid section sort journal_only]) {
my $x = "";
$x = $form->{$_} if defined $form->{$_} && $x eq "";
$x =~ s/ /+/g;
Expand Down

0 comments on commit 74b20f0

Please sign in to comment.