diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index df7b0f009..7c1935087 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -16,6 +16,7 @@ use File::Basename; use HTML::Entities(); use Socket; use Time::Local; +use Unicode::Normalize; our %color = (); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); @@ -363,6 +364,18 @@ sub escape($) { return HTML::Entities::encode_entities($s); } +sub normalize($) { + my $s = shift; + + # Remove any special characters + $s = &Unicode::Normalize::NFKD($s); + + # Remove any whitespace and replace with dash + $s =~ s/\s+/\-/g; + + return $s; +} + sub cleanhtml { my $outstring =$_[0]; $outstring =~ tr/,/ / if not defined $_[1] or $_[1] ne 'y';