Use empty instead ?? because dbname is '' sometimes

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2018-09-23 18:25:48 +02:00
parent 0ee191bf44
commit 9d7e51fd56
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 7 additions and 2 deletions

View File

@ -44,8 +44,13 @@ class Sqlite extends AbstractDatabase {
* in connection factory configuration is obtained from config.php.
*/
$this->dbName = $config['dbname'] ?? ConnectionFactory::DEFAULT_DBNAME;
$this->tablePrefix = $config['dbtableprefix'] ?? ConnectionFactory::DEFAULT_DBTABLEPREFIX;
$this->dbName = empty($config['dbname'])
? ConnectionFactory::DEFAULT_DBNAME
: $config['dbname'];
$this->tablePrefix = empty($config['dbtableprefix'])
? ConnectionFactory::DEFAULT_DBTABLEPREFIX
: $config['dbtableprefix'];
if ($this->dbName !== ConnectionFactory::DEFAULT_DBNAME) {
$this->config->setValue('dbname', $this->dbName);