From: Moritz Bunkus Date: Mon, 19 Apr 2010 09:42:08 +0000 (+0200) Subject: Hilfsfunktion zur Berechnung von URI-Objekten anhand eines relativen Pfades X-Git-Tag: release-2.6.2beta1~264 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=63b611899bf400244f0b2e89fefa5e96f69a3f2e;p=kivitendo-erp.git Hilfsfunktion zur Berechnung von URI-Objekten anhand eines relativen Pfades --- diff --git a/SL/Form.pm b/SL/Form.pm index 9ad161010..6a5745b43 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -555,6 +555,20 @@ sub _get_request_uri { return $uri; } +sub _add_to_request_uri { + my $self = shift; + + my $relative_new_path = shift; + my $request_uri = shift || $self->_get_request_uri; + my $relative_new_uri = URI->new($relative_new_path); + my @request_segments = $request_uri->path_segments; + + my $new_uri = $request_uri->clone; + $new_uri->path_segments(@request_segments[0..scalar(@request_segments) - 2], $relative_new_uri->path_segments); + + return $new_uri; +} + sub create_http_response { $main::lxdebug->enter_sub();