Perlfect Solutions
 

[Perlfect-search] Problem with "index.html" file

Daniel Naber perlfect-search@perlfect.com
Tue, 30 Jul 2002 13:41:48 +0200
--Boundary-00=_8tnR9z6WP4tFAcx
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Monday 29 July 2002 22:20, Mark Love wrote:

> When Perlfect Search returns a result from the homepage (index.html) of
> the site I installed it on, if I click the "highlight matches" is
> returns the following:
>
> Error: getting the file 'http://www.iaci-usa.org' is not allowed

That seems to be a bug in the script. The attached patch should fix it.

Regards
 Daniel

=2D-=20
http://www.danielnaber.de

--Boundary-00=_8tnR9z6WP4tFAcx
Content-Type: text/x-diff;
  charset="us-ascii";
  name="search_highlight_fix.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="search_highlight_fix.diff"

Index: search.pl
===================================================================
RCS file: /home/cvsroot/search/search.pl,v
retrieving revision 1.75
diff -u -r1.75 search.pl
--- search.pl   1 May 2002 14:18:03 -0000       1.75
+++ search.pl   29 Jul 2002 23:53:02 -0000
@@ -734,11 +734,13 @@
 # of the path (i.e. parts delimited by "/") on its own.
 sub my_uri_escape {
     my $str = shift;
-    my @parts = split("/", $str);
+    my @parts = split("(/)", $str);
     foreach my $part (@parts) {
-      $part = CGI::escape($part);
+      if( $part ne '/' ) {
+        $part = CGI::escape($part);
+      }
     }
-    $str = join("/", @parts);
+    $str = join("", @parts);
     return $str;
 }
 

--Boundary-00=_8tnR9z6WP4tFAcx--