From: Sven Schöling Date: Wed, 14 Feb 2018 13:02:16 +0000 (+0100) Subject: Controller::Base: url_for unterstützt jetzt URI fragments. X-Git-Tag: release-3.5.4~461 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=aa85133ae4463f1b23045fb7543aa1eda606f147;p=kivitendo-erp.git Controller::Base: url_for unterstützt jetzt URI fragments. --- diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index 01da48b01..d10ba805c 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -29,6 +29,7 @@ sub url_for { my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; my $controller = delete($params{controller}) || $self->controller_name; my $action = $params{action} || 'dispatch'; + my $fragment = delete $params{hash} // delete $params{fragment} // ''; my $script; if ($controller =~ m/\.pl$/) { @@ -41,7 +42,7 @@ sub url_for { my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) }; - return "${script}?${query}"; + return "${script}?${query}" . ($fragment ? "#$fragment" : ''); } sub redirect_to {