Hello,

when Apache::Registry::handler ist called with an URL ending in '/'
(other than the root-URL '/' itself), compilation of the script the
handler is called for fails. This case may occure when using
Apache::Registry together with mod_rewrite. 

The compilation error is due to the URL-based script name the script is
compiled within ending in '::'. This ending results from the handler's
rule to derive the script name from the URL.

The attached diff (relative to Apache::Registry version 2.01 from
mod_perl 1.21) resolves the problem by always substituting tailing '/'
with the constant '__INDEX__' (in the distribution, this is done for the
URI '/' only).

-- 
[ p e t e r   d e i s t e r ]
        diplom-physiker   http://www.opus5.de
        opus 5 interaktive medien gmbh   frankfurter strasse 151c
        63303 dreieich   fon: 06103 5853-128   fax: 06103 5853-200
--- Apache/Registry.pm  Tue Feb  8 08:52:47 2000
+++ /home/peter/work/mod_perl-1.21/lib/Apache/Registry.pm       Wed Jan 13 03:56:34 
+1999
@@ -33,8 +33,6 @@
     #local $0 = $filename; #this core dumps!?
     *0 = \$filename;
     my $oldwarn = $^W;
-    $r->log_error("modified Apache::Registry::handler")
-       if $Debug && $Debug & 4;
     $r->log_error("Apache::Registry::handler for $filename in process $$")
        if $Debug && $Debug & 4;
 
@@ -56,15 +54,13 @@
        my $mtime = -M _;
 
        my $uri = $r->uri;
-       # $uri = "/__INDEX__" if $uri eq "/";
+       $uri = "/__INDEX__" if $uri eq "/";
        # turn into a package name
        $r->log_error(sprintf "Apache::Registry::handler examining %s",
                      $uri) if $Debug && $Debug & 4;
        my $script_name = $r->path_info ?
            substr($uri, 0, length($uri)-length($r->path_info)) :
                $uri;
-       $script_name =~ s:/+$:/__INDEX__:;
-
 
        if($Apache::Registry::NameWithVirtualHost) {
            my $name = $r->get_server_name;

Reply via email to