[Jifty-commit] r4165 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Oct 1 15:52:44 EDT 2007


Author: jesse
Date: Mon Oct  1 15:52:42 2007
New Revision: 4165

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Request.pm

Log:
 r27276 at hualien:  jesse | 2007-10-01 15:50:22 -0400
 * Fixes to several of my fixes for Jifty::Request::load_from_data_structure


Modified: jifty/trunk/lib/Jifty/Request.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Request.pm	(original)
+++ jifty/trunk/lib/Jifty/Request.pm	Mon Oct  1 15:52:42 2007
@@ -146,15 +146,20 @@
 sub from_data_structure {
     my $self = shift;
     my $data = shift;
-    my $cgi = shift;
+    my $cgi;
+    $cgi = shift if (@_);
 
     my $path = $data->{'path'};
     
-    unless ($path) {
+    if ($cgi && ! $path) {
         $path = URI::Escape::uri_unescape($cgi->path_info);
         $path =~ s/\?.*//;
     };
 
+    if (!$path) {
+        $path = '/';
+    }
+
     $self->path( Jifty::Util->canonicalize_path( $path));
     $self->just_validating( $data->{validating} ) if $data->{validating};
 


More information about the Jifty-commit mailing list