ConfigForm: enforce utf8 encoding

This commit is contained in:
Thomas Gelf 2016-02-02 21:45:38 +01:00
parent 0b36b39cf7
commit f66b5fe289
1 changed files with 9 additions and 0 deletions

View File

@ -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();