Lines 351-360
sub parametrized_url {
Link Here
|
351 |
my $vars = shift || {}; # ie { LANG => en } |
351 |
my $vars = shift || {}; # ie { LANG => en } |
352 |
my $ret = $url; |
352 |
my $ret = $url; |
353 |
while ( my ($key,$val) = each %$vars) { |
353 |
while ( my ($key,$val) = each %$vars) { |
354 |
my $val_url = URI::Escape::uri_escape_utf8($val); |
354 |
my $val_url = URI::Escape::uri_escape_utf8( $val // q{} ); |
355 |
$ret =~ s/\{$key\}/$val_url/g; |
355 |
$ret =~ s/\{$key\}/$val_url/g; |
356 |
} |
356 |
} |
357 |
$ret =~ s/\{[^\{]*\}//g; # remove not defined vars |
357 |
$ret =~ s/\{[^\{]*\}//g; # remove remaining vars |
358 |
return $ret; |
358 |
return $ret; |
359 |
} |
359 |
} |
360 |
|
360 |
|