X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/46c2cd86104b2699dd6af00c99b515c261e86337..a6bb5ed04fe4aa01b2716edfd4ed45a6ed91c011:/modules/Tool.pm?ds=inline diff --git a/modules/Tool.pm b/modules/Tool.pm index fc1b3b4..0b15f90 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 2003-12-02 +# Last modified: 2004-02-03 # use strict; @@ -24,6 +24,7 @@ use base qw(Exporter); @EXPORT = qw(check_path clean_path devedit_reload + equal_url file_name upper_path); @@ -125,6 +126,28 @@ sub devedit_reload($) return \$header; } +# equal_url() +# +# Create URL equal to a file or directory +# +# Params: 1. HTTP root +# 2. Relative path +# +# Return: Formatted link (String) + +sub equal_url($$) +{ + my ($root,$path) = @_; + my $url; + + $root =~ s!/$!!; + $path =~ s!^/!!; + $url = $root."/".$path; + #$url = encode_entities($url); + + return $url; +} + # file_name() # # Returns the last path of a path