summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config')
-rw-r--r--Bugzilla/Config/Common.pm14
-rw-r--r--Bugzilla/Config/Core.pm1
2 files changed, 14 insertions, 1 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 8b94220f8..a609936c0 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -48,7 +48,7 @@ use base qw(Exporter);
check_opsys check_shadowdb check_urlbase check_webdotbase
check_netmask check_user_verify_class check_image_converter
check_languages check_mail_delivery_method check_notification
- check_timezone
+ check_timezone check_utf8
);
# Checking functions for the various values
@@ -114,6 +114,18 @@ sub check_sslbase {
return "";
}
+sub check_utf8 {
+ my $utf8 = shift;
+ # You cannot turn off the UTF-8 parameter if you've already converted
+ # your tables to utf-8.
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->isa('Bugzilla::DB::Mysql') && $dbh->bz_db_is_utf8 && !$utf8) {
+ return "You cannot disable UTF-8 support, because your MySQL database"
+ . " is encoded in UTF-8";
+ }
+ return "";
+}
+
sub check_priority {
my ($value) = (@_);
my $legal_priorities = get_legal_field_values('priority');
diff --git a/Bugzilla/Config/Core.pm b/Bugzilla/Config/Core.pm
index 5688e5c8c..33eb46ac5 100644
--- a/Bugzilla/Config/Core.pm
+++ b/Bugzilla/Config/Core.pm
@@ -98,6 +98,7 @@ sub get_param_list {
name => 'utf8',
type => 'b',
default => '0',
+ checker => \&check_utf8
},
{