Skip to content

Commit

Permalink
Item13315: Unnecessary errors on {Store}{Encoding}
Browse files Browse the repository at this point in the history
if UseLocale is not enabled, it makes no sense to use {Site}{Locale}
to validate the {Store}{Encoding}. It's just noise for a field that
isn't used for anything.
  • Loading branch information
gac410 committed Jun 9, 2015
1 parent d9394f7 commit fa78794
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions core/lib/Foswiki/Configure/Checkers/Store/Encoding.pm
Expand Up @@ -36,22 +36,26 @@ HERE
);
}

# Extract the character set from locale for consistency check
my $charset;
$Foswiki::cfg{Site}{Locale} =~ m/\.([a-z0-9_-]+)$/i;
$charset = $1 || ''; # no guess?
$charset =~ s/^utf8$/utf-8/i;
$charset =~ s/^eucjp$/euc-jp/i;
$charset = lc($charset);

if ( $charset && ( lc( $Foswiki::cfg{Store}{Encoding} ) ne $charset ) )
{
$reporter->ERROR(
<<HERE
if ( $Foswiki::cfg{UseLocale} ) {

# Extract the character set from locale for consistency check
my $charset;
$Foswiki::cfg{Site}{Locale} =~ m/\.([a-z0-9_-]+)$/i;
$charset = $1 || ''; # no guess?
$charset =~ s/^utf8$/utf-8/i;
$charset =~ s/^eucjp$/euc-jp/i;
$charset = lc($charset);

if ( $charset
&& ( lc( $Foswiki::cfg{Store}{Encoding} ) ne $charset ) )
{
$reporter->ERROR(
<<HERE
The Character set determined by the configured Locale, and this character set,
are inconsistent. Recommended setting: =$charset=
HERE
);
);
}
}
}

Expand Down

0 comments on commit fa78794

Please sign in to comment.