mirror of https://github.com/MISP/MISP
fix: Just force utf8 encoding if it's not set
parent
ffd087ba38
commit
d39a4857b7
|
@ -82,6 +82,11 @@ class AppController extends Controller {
|
|||
public function beforeFilter() {
|
||||
// check for a supported datasource configuration
|
||||
$dataSourceConfig = ConnectionManager::getDataSource('default')->config;
|
||||
if (!isset($dataSourceConfig['encoding'])) {
|
||||
$db = ConnectionManager::getDataSource('default');
|
||||
$db->setConfig(array('encoding' => 'utf8'));
|
||||
ConnectionManager::create('default', $db->config);
|
||||
}
|
||||
$dataSource = $dataSourceConfig['datasource'];
|
||||
if ($dataSource != 'Database/Mysql' && $dataSource != 'Database/Postgres') {
|
||||
throw new Exception('datasource not supported: ' . $dataSource);
|
||||
|
|
Loading…
Reference in New Issue