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
Expand Up @@ -40,7 +40,12 @@ sub main {
my $searchDB = getObject('Slash::Search', { db_type => 'search' }); my $searchDB = getObject('Slash::Search', { db_type => 'search' });


# Backwards compatibility, we now favor tid over topic # 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 # Set some defaults
$form->{query} ||= ''; $form->{query} ||= '';
Expand Down Expand Up @@ -144,7 +149,7 @@ sub _buildargs {
my($form) = @_; my($form) = @_;
my $uri; 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 = ""; my $x = "";
$x = $form->{$_} if defined $form->{$_} && $x eq ""; $x = $form->{$_} if defined $form->{$_} && $x eq "";
$x =~ s/ /+/g; $x =~ s/ /+/g;
Expand Down

0 comments on commit 74b20f0

Please sign in to comment.