Browse Source

Fixes #13594: Fixes insufficient quoting in `yii\db\QueryBuilder::prepareInsertSelectSubQuery()`

tags/2.0.12
Sergey Makinen 8 years ago committed by Alexander Makarov
parent
commit
209fb7d94b
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/db/QueryBuilder.php

1
framework/CHANGELOG.md

@ -14,6 +14,7 @@ Yii Framework 2 Change Log
- Bug #11404: `yii\base\Model::loadMultiple()` returns true even if `yii\base\Model::load()` returns false (zvook)
- Bug #13513: Fixed RBAC migration to work correctly on Oracle DBMS (silverfire)
- Enh #13550: Refactored unset call order in `yii\di\ServiceLocator::set()` (Lanrik)
- Bug #13594: Fixes insufficient quoting in `yii\db\QueryBuilder::prepareInsertSelectSubQuery()` (sergeymakinen)
- Enh #13576: Added support of `srcset` to `yii\helpers\Html::img()` (Kolyunya)

2
framework/db/QueryBuilder.php

@ -205,7 +205,7 @@ class QueryBuilder extends \yii\base\Object
$values = ' ' . $values;
foreach ($columns->select as $title => $field) {
if (is_string($title)) {
$names[] = $title;
$names[] = $schema->quoteColumnName($title);
} else if (preg_match('/^(.*?)(?i:\s+as\s+|\s+)([\w\-_\.]+)$/', $field, $matches)) {
$names[] = $schema->quoteColumnName($matches[2]);
} else {

Loading…
Cancel
Save