From: Moritz Bunkus Date: Thu, 30 Dec 2010 15:20:09 +0000 (+0100) Subject: url_for: Template übergibt Hash-Parameter als Hash-Referenz X-Git-Tag: release-2.6.2beta1~17^2~3^2~12 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1d9947e012c0b95060e64beb0d752e64d2ba4d79;p=kivitendo-erp.git url_for: Template übergibt Hash-Parameter als Hash-Referenz --- 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}";