]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC.pm
fixed pod for warn method
[maypole.git] / lib / Apache / MVC.pm
index 0f6b7d0e9fc8c0dda03506ff398da25900b17cf0..e9caa396679f3f652745b9a6bdeb1432ed111b19 100644 (file)
@@ -93,7 +93,11 @@ functionality. See L<Maypole> for these:
 
 sub get_request {
     my ($self, $r) = @_;
-    my $ar = ($MODPERL2) ? $r : Apache::Request->instance($r);
+    my $ar;
+    if ($MODPERL2) {
+       $ar = eval {require Apache2::Request} ? Apache2::Request->new($r) : $r;
+       }
+    else { $ar = Apache::Request->instance($r); }
     $self->ar($ar);
 }
 
@@ -101,6 +105,21 @@ sub get_request {
 
 =cut
 
+sub warn {
+  my ($self,@args) = @_;
+  my ($package, $line) = (caller)[0,2];
+  if ( $args[0] and ref $self ) {
+    $self->{ar}->warn("[$package line $line] ", @args) ;
+  } else {
+    print "warn called by ", caller, " with ", @_, "\n";
+  }
+  return;
+}
+
+=item warn
+
+=cut
+
 sub parse_location {
     my $self = shift;
 
@@ -224,7 +243,7 @@ sub _mod_perl_args {
     } else {
       my $body = $self->_prepare_body($apr);
       %args = %{$body->param};
-      my $uri = URI->new($self->ar->uri);
+      my $uri = URI->new($self->ar->unparsed_uri);
       foreach my $key ($uri->query_param) {
        if (ref $args{$key}) {
          push (@{$args{$key}}, $uri->query_param($key));