From f66b5fe289720c5ad777a4b7cf996af542ab154b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Feb 2016 21:45:38 +0100 Subject: [PATCH] ConfigForm: enforce utf8 encoding --- application/forms/ConfigForm.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/forms/ConfigForm.php b/application/forms/ConfigForm.php index 848bf931..12b4d862 100644 --- a/application/forms/ConfigForm.php +++ b/application/forms/ConfigForm.php @@ -79,6 +79,15 @@ class ConfigForm extends QuickForm } if ($resourceName) { + $resourceConfig = ResourceFactory::getResourceConfig($resourceName); + if (! isset($resourceConfig->charset) + || $resourceConfig->charset !== 'utf8' + ) { + $this->getElement('resource') + ->addError('Please change the encodig for the director database to utf8') + ->removeDecorator('description'); + } + $resource = ResourceFactory::create($resourceName); $db = $resource->getDbAdapter();