put all url validation in WebGUI::Session::Url instead of i18n
This commit is contained in:
parent
cc7b3fe3ef
commit
30ed305b62
2 changed files with 12 additions and 14 deletions
|
|
@ -11,16 +11,8 @@ our $LANGUAGE = {
|
|||
};
|
||||
|
||||
sub makeUrlCompliant {
|
||||
my $value = shift;
|
||||
$value =~ s/\s+$//; #removes trailing whitespace
|
||||
$value =~ s/^\s+//; #removes leading whitespace
|
||||
$value =~ s/ /-/g; #replaces whitespace with hyphens
|
||||
$value =~ s/\.$//; #removes trailing period
|
||||
$value =~ s/[^\w\-\.\_\/]//g; #removes characters that would interfere with the url
|
||||
$value =~ s/^\///; #removes a leading /
|
||||
$value =~ s/\/$//; #removes a trailing /
|
||||
$value =~ s/\/\//\//g; #removes double /
|
||||
return $value;
|
||||
my $url = shift;
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue