Author: HaraldJoerg
Date: 2017-05-25 22:56:59 +0000 (Thu, 25 May 2017)
New Revision: 30336
Trac url: http://develop.twiki.org/trac/changeset/30336
Modified:
twiki/trunk/core/lib/TWiki/I18N.pm
Log:
Item7799: allow undefined language in _normalize
Modified: twiki/trunk/core/lib/TWiki/I18N.pm
===================================================================
--- twiki/trunk/core/lib/TWiki/I18N.pm 2017-05-25 22:52:47 UTC (rev 30335)
+++ twiki/trunk/core/lib/TWiki/I18N.pm 2017-05-25 22:56:59 UTC (rev 30336)
@@ -58,10 +58,10 @@
}
# utility function: normalize language tags like ab_CD to ab-cd
-# also renove any character there is not a letter [a-z] or a hyphen.
+# also remove any character which is not a letter [a-z] nor a hyphen.
sub _normalize_language_tag {
- my $tag = shift;
- $tag = lc($tag);;
+ my $tag = shift || "";
+ $tag = lc($tag);
$tag =~ s/\_/-/g;
$tag =~ s/[^a-z-]//g;
return $tag;
|