summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config/Common.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config/Common.pm')
-rw-r--r--Bugzilla/Config/Common.pm14
1 files changed, 13 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');