From 1d9947e012c0b95060e64beb0d752e64d2ba4d79 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 30 Dec 2010 16:20:09 +0100 Subject: [PATCH] =?utf8?q?url=5Ffor:=20Template=20=C3=BCbergibt=20Hash-Par?= =?utf8?q?ameter=20als=20Hash-Referenz?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Base.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index d9b1783ee..112a7bd8a 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -14,9 +14,9 @@ sub parse_html_template { sub url_for { my $self = shift; - return $_[0] if scalar(@_) == 1; + return $_[0] if (scalar(@_) == 1) && !ref($_[0]); - my %params = @_; + my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; my $controller = delete($params{controller}) || $self->_controller_name; my $action = delete($params{action}) || 'dispatch'; $params{action} = "${controller}/${action}"; -- 2.20.1