1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-07 14:46:50 +02:00

Sqlite3Driver: for SQLite 3 is not needed to strip [] from column names

This commit is contained in:
David Grudl
2018-04-17 12:24:00 +02:00
parent 8985c71276
commit 1909c98e6d

View File

@@ -401,15 +401,12 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver
{
$row = $this->resultSet->fetchArray($assoc ? SQLITE3_ASSOC : SQLITE3_NUM);
$charset = $this->charset === null ? null : $this->charset . '//TRANSLIT';
if ($row && ($assoc || $charset)) {
$tmp = [];
if ($row && $charset) {
foreach ($row as $k => $v) {
if ($charset !== null && is_string($v)) {
$v = iconv($this->dbcharset, $charset, $v);
if (is_string($v)) {
$row[$k] = iconv($this->dbcharset, $charset, $v);
}
$tmp[str_replace(['[', ']'], '', $k)] = $v;
}
return $tmp;
}
return $row;
}