Skip to Content.
Sympa Menu

devel - Search.pm doesn't work well with FastCGI (fix)

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Sergiy Zhuk <address@concealed>
  • To: address@concealed
  • Subject: Search.pm doesn't work well with FastCGI (fix)
  • Date: Fri, 1 Mar 2002 18:21:55 -0800 (PST)

hi

I've reported the problem with search in archives couple of days ago.
The problem was caused by the 'o' modifier in Search.pm, which compiles the
search pattern just once.
It works fine for plain CGI scripts, but doesn't work with FastCGI, since it
will use the old pattern in statements like this:

$subj =~ s,($self->{key_word}),<B>$1</B>,go

So, despite the fact you're getting new search results, it still marks the
old keyword.

My patch is attached with this message.

thanks

--
rgds,
serge
--- Search.pm.orig Fri Mar 1 17:56:10 2002
+++ Search.pm Fri Mar 1 17:56:28 2002
@@ -103,28 +103,28 @@
# Check for a match in subject
if (($self->subj) && ($_ = $subj) && (&{$self->{function2}}))
{
- $subj =~ s,($self->{key_word}),<B>$1</B>,go; # Bold any matches
+ $subj =~ s,($self->{key_word}),<B>$1</B>,g; # Bold any matches
$self->subj_count(1); # Keeping count
$match = 1; # We'll be printing this one
}
# Check for a match in from
if (($self->from) && ($_ = $from) && (&{$self->{function2}}))
{
- $from =~ s,($self->{key_word}),<B>$1</B>,go;
+ $from =~ s,($self->{key_word}),<B>$1</B>,g;
$self->from_count(1);
$match = 1;
}
# Check for a match in date
if (($self->date) && ($_ = $date) && (&{$self->{function2}}))
{
- $date =~ s,($self->{key_word}),<B>$1</B>,go;
+ $date =~ s,($self->{key_word}),<B>$1</B>,g;
$self->date_count(1);
$match = 1;
}
# Check for a match in id
if (($self->id) && ($_ = $id) && (&{$self->{function2}}))
{
- $id =~ s,($self->{key_word}),<B>$1</B>,go;
+ $id =~ s,($self->{key_word}),<B>$1</B>,g;
$self->id_count(1);
$match = 1;
}
@@ -164,7 +164,7 @@
$line = $matches{$hit} + 1;
$body_string .= "line $line: $body[$matches{$hit}]";
}
- $body_string =~ s,($self->{key_word}),<B>$1</B>,go;
+ $body_string =~ s,($self->{key_word}),<B>$1</B>,g;
last BODY;
}
}
@@ -178,7 +178,7 @@
if (($_ = $body[$i]) && (&{$self->{function2}}))
{
($body_string = $body[($i - 1)] . $body[$i] .
- $body[($i + 1)]) =~ s,($self->{key_word}),<B>$1</B>,go;
+ $body[($i + 1)]) =~ s,($self->{key_word}),<B>$1</B>,g;
$self->body_count(1);
$match = 1;
last BODY;


  • Search.pm doesn't work well with FastCGI (fix), Sergiy Zhuk, 03/02/2002

Archive powered by MHonArc 2.6.19+.

Top of Page