added internationalized url handling
This commit is contained in:
parent
a56ccd9b9e
commit
90419bb59a
3 changed files with 62 additions and 15 deletions
|
|
@ -1,9 +1,26 @@
|
|||
package WebGUI::i18n::English;
|
||||
|
||||
$LANGUAGE = {
|
||||
use strict;
|
||||
|
||||
|
||||
our $LANGUAGE = {
|
||||
label => 'English',
|
||||
charset => 'UTF-8',
|
||||
toolbar => 'metal'
|
||||
};
|
||||
|
||||
sub makeUrlCompliant {
|
||||
my $value = shift;
|
||||
$value =~ s/\s+$//; #removes trailing whitespace
|
||||
$value =~ s/^\s+//; #removes leading whitespace
|
||||
$value =~ s/^\\//; #removes leading slash
|
||||
$value =~ s/ /_/g; #replaces whitespace with underscores
|
||||
$value =~ s/\.$//; #removes trailing period
|
||||
$value =~ s/[^A-Za-z0-9\-\.\_\/]//g; #removes all funky characters
|
||||
$value =~ s/^\///; #removes a preceeding /
|
||||
$value =~ s/\/\//\//g; #removes double /
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue