mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding fix for misquoted SQL functions (Ticket #2199)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4861 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
97aa991f2d
commit
86d32e4313
1 changed files with 2 additions and 2 deletions
|
@ -270,10 +270,10 @@ class DboMssql extends DboSource {
|
|||
$dot = strrpos($fields[$i], '.');
|
||||
$fieldAlias = count($this->__fieldMappings);
|
||||
|
||||
if ($dot === false) {
|
||||
if ($dot === false && !preg_match('/\s+AS\s+/i', $fields[$i])) {
|
||||
$this->__fieldMappings[$alias . '__' . $fieldAlias] = $alias . '.' . $fields[$i];
|
||||
$fields[$i] = $this->name($alias) . '.' . $this->name($fields[$i]) . ' AS ' . $this->name($alias . '__' . $fieldAlias);
|
||||
} elseif (!preg_match('/\]\.\[[^\s]+ AS \[/', $fields[$i])) {
|
||||
} elseif (!preg_match('/\s+AS\s+/i', $fields[$i])) {
|
||||
$build = explode('.', $fields[$i]);
|
||||
$this->__fieldMappings[$build[0] . '__' . $fieldAlias] = $build[0] . '.' . $build[1];
|
||||
$fields[$i] = $this->name($build[0]) . '.' . $this->name($build[1]) . ' AS ' . $this->name($build[0] . '__' . $fieldAlias);
|
||||
|
|
Loading…
Add table
Reference in a new issue