stas 2003/03/07 19:58:59
Modified: ModPerl-Registry/t/conf modperl_extra_startup.pl
ModPerl-Registry/lib/ModPerl RegistryCooker.pm
. Changes
Added: ModPerl-Registry/t bad_scripts.t
ModPerl-Registry/t/cgi-bin r_inherited.pl
Log:
Registry: make sure that $r is not in the scope when the script is
compiled
Revision Changes Path
1.1 modperl-2.0/ModPerl-Registry/t/bad_scripts.t
Index: bad_scripts.t
===================================================================
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET);
plan tests => 1;
{
my $url = "/same_interp/perlrun/r_inherited.pl";
my $res = GET($url);
ok t_cmp(
500,
$res->code,
"the script hasn't declared its private \$r",
);
}
1.1 modperl-2.0/ModPerl-Registry/t/cgi-bin/r_inherited.pl
Index: r_inherited.pl
===================================================================
use strict;
use warnings;
# this script shouldn't work
# this is to test that $r is not in the scope from the function that
# has compiled this script in the registry module
# my $r = shift;
$r->content_type('text/plain');
$r->print($r->args);
1.9 +1 -1 modperl-2.0/ModPerl-Registry/t/conf/modperl_extra_startup.pl
Index: modperl_extra_startup.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/modperl_extra_startup.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- modperl_extra_startup.pl 23 Jan 2003 01:12:01 -0000 1.8
+++ modperl_extra_startup.pl 8 Mar 2003 03:58:59 -0000 1.9
@@ -36,7 +36,7 @@
my %skip = map { $_ => 1 }
qw(lib.pl perlrun_require.pl syntax_error.pl runtime_error.pl
- missing_headers.pl);
+ missing_headers.pl r_inherited.pl);
my $dh = DirHandle->new($base_dir) or die $!;
for my $file ($dh->read) {
next unless $file =~ /\.pl$/;
1.34 +2 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
Index: RegistryCooker.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- RegistryCooker.pm 2 Mar 2003 23:23:57 -0000 1.33
+++ RegistryCooker.pm 8 Mar 2003 03:58:59 -0000 1.34
@@ -628,12 +628,12 @@
# args: $self - registry blessed object
# $eval - a ref to a scalar with the code to compile
# rtrn: success/failure
+# note: $r must not be in scope of compile(), scripts must do
+# my $r = shift; to get it off the args stack
#########################################################################
sub compile {
my($self, $eval) = @_;
-
- my $r = $self->{REQ};
$self->debug("compiling $self->{FILENAME}") if DEBUG && D_COMPILE;
1.144 +3 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- Changes 4 Mar 2003 09:42:41 -0000 1.143
+++ Changes 8 Mar 2003 03:58:59 -0000 1.144
@@ -10,6 +10,9 @@
=item 1.99_09-dev
+Registry: make sure that $r is not in the scope when the script is
+compiled [Stas]
+
$Apache::Server::SaveConfig added. When set to a true value,
will not clear the content of Apache::ReadConfig:: once <Perl >
sections are processed. [Philippe M. Chiasson <[EMAIL PROTECTED]