From 63b611899bf400244f0b2e89fefa5e96f69a3f2e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 19 Apr 2010 11:42:08 +0200 Subject: [PATCH] Hilfsfunktion zur Berechnung von URI-Objekten anhand eines relativen Pfades --- SL/Form.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); -- 2.20.1