Skip to content

Commit

Permalink
Item13435: Don't keep overlaying Encoding with CharSet
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed May 25, 2015
1 parent 545165b commit f145101
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/lib/Foswiki/Configure/Load.pm
Expand Up @@ -219,11 +219,14 @@ GOLLYGOSH
delete $Foswiki::cfg{StoreImpl};
}
foreach my $el ( keys %remap ) {

# Only remap if the old key extsts, and the new key does NOT exist
if ( ( eval("exists \$Foswiki::cfg$el") ) ) {
eval( <<CODE );
\$Foswiki::cfg$remap{$el}=\$Foswiki::cfg$el;
\$Foswiki::cfg$remap{$el}=\$Foswiki::cfg$el unless ( exists \$Foswiki::cfg$remap{$el} );
delete \$Foswiki::cfg$el;
CODE
print STDERR "REMAP failed $@" if ($@);
}
}

Expand All @@ -248,8 +251,9 @@ CODE
# Alias TWiki cfg to Foswiki cfg for plugins and contribs
*TWiki::cfg = \%Foswiki::cfg;

# Add explicit {Site}{CharSet} for older extensions.
$Foswiki::cfg{Site}{CharSet} = 'utf-8';
# Add explicit {Site}{CharSet} for older extensions. And if not present, default to utf-8.
# Smell, it was just deleted a few lines back, when the remap is applied.
$Foswiki::cfg{Site}{CharSet} = $Foswiki::cfg{Store}{Encoding} || 'utf-8';

# Explicit return true if we've completed the load
return $validLSC;
Expand Down

0 comments on commit f145101

Please sign in to comment.