X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/104b2df49b9ee7e65d6b48923ea539bf01041575..e31b4973197f7d0ca6b9ca5fbf2ba923d3ea63fe:/modules/Tool.pm diff --git a/modules/Tool.pm b/modules/Tool.pm index baaff16..6a615da 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 2004-11-13 +# Last modified: 2004-12-16 # use strict; @@ -106,10 +106,11 @@ sub clean_path($) # with some other parameters # # Params: Hash Reference (will be merged to a query string) +# (optional) # # Return: HTTP redirection header (Scalar Reference) -sub devedit_reload($) +sub devedit_reload(;$) { my $params = shift; @@ -138,13 +139,18 @@ sub devedit_reload($) # Andre Malo's selfforum (http://sourceforge.net/projects/selfforum/) # and modified by Patrick Canterino - my $query = '?'.join ('&' => - map { - (ref) - ? map{escape ($_).'='.escape ($params -> {$_})} @{$params -> {$_}} - : escape ($_).'='.escape ($params -> {$_}) - } keys %$params - ); + my $query = ""; + + if(ref($params) eq "HASH") + { + $query = '?'.join ('&' => + map { + (ref) + ? map{escape ($_).'='.escape ($params -> {$_})} @{$params -> {$_}} + : escape ($_).'='.escape ($params -> {$_}) + } keys %$params + ); + } # Create the redirection header