Skip to content

Commit

Permalink
Make check more strict to respect existing queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdriel committed Jul 26, 2016
1 parent d6e4513 commit c01525f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Cake/Model/Datasource/Database/Mysql.php
Expand Up @@ -438,8 +438,9 @@ public function delete(Model $model, $conditions = null) {
$alias = $joins = false;
}
$complexConditions = false;
$fields = array_keys($this->describe($model));
foreach ((array)$conditions as $key => $value) {
if (strpos($key, '.') !== false && strpos($key, $model->alias) === false) {
if (strpos($key, $model->alias) === false && !in_array($key, $fields, true)) {
$complexConditions = true;
break;
}
Expand Down

0 comments on commit c01525f

Please sign in to comment.