X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=09493ece263a04f6dcb101f49450d3760835d9b6;hb=1ec67be9e8b738cbd2a523523af3bd7e61f98480;hp=596479e21ec8f2b57cbe4dd20dc1957c2385ad18;hpb=5f90e1e118700c4cba7575299aa42dc4ffc0eb67;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 596479e..09493ec 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -1,5 +1,4 @@ package Maypole; -use Class::C3; use base qw(Class::Accessor::Fast Class::Data::Inheritable); use UNIVERSAL::require; use strict; @@ -13,7 +12,7 @@ use URI::QueryParam; use NEXT; use File::MMagic::XS qw(:compat); -our $VERSION = '2.12'; +our $VERSION = '2.12_pre1'; our $mmagic = File::MMagic::XS->new(); # proposed privacy conventions: @@ -437,8 +436,10 @@ sub handler : method { die "status undefined after start_request_hook()" unless defined $self->status; - $self->session($self->get_session); - $self->user($self->get_user); + my $session = $self->get_session; + $self->session($self->{session} || $session); + my $user = $self->get_user; + $self->user($self->{user} || $user); my $status = $self->handler_guts; return $status unless $status == OK; @@ -1294,9 +1295,9 @@ sub param $self->params->{$key} = $new_val; } - return ref $val ? @$val : ($val) if wantarray; + return (ref $val eq 'ARRAY') ? @$val : ($val) if wantarray; - return ref $val ? $val->[0] : $val; + return (ref $val eq 'ARRAY') ? $val->[0] : $val; }