改进parseKey方法

This commit is contained in:
thinkphp
2016-10-07 11:43:08 +08:00
parent 7af500de84
commit 14f4302156

View File

@@ -34,7 +34,7 @@ class Mysql extends Builder
// JSON字段支持
list($field, $name) = explode('$.', $key);
$key = 'json_extract(' . $field . ', \'$.' . $name . '\')';
} elseif (strpos($key, '.')) {
} elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) {
list($table, $key) = explode('.', $key, 2);
if (isset($options['alias'][$table])) {
$table = $options['alias'][$table];