Adding fix for #1928

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4393 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-02-01 23:43:56 +00:00
parent c0c5a3e28c
commit 03d15ff892

View file

@ -1348,14 +1348,16 @@ class DboSource extends DataSource {
for($i = 0; $i < $pregCount; $i++) {
if (!empty($match['1'][$i]) && !is_numeric($match['1'][$i])) {
$conditions = preg_replace('/^' . $match['0'][$i] . '/', ' '.$this->name($match['1'][$i]), $conditions);
$conditions = $conditions . ' ';
$conditions = preg_replace('/^' . $match['0'][$i] . '(?=[^\\w])/', ' '.$this->name($match['1'][$i]), $conditions);
if (strpos($conditions, '(' . $match['0'][$i]) === false) {
$conditions = preg_replace('/[^\w]' . $match['0'][$i] . '/', ' '.$this->name($match['1'][$i]), $conditions);
$conditions = preg_replace('/[^\w]' . $match['0'][$i] . '(?=[^\\w])/', ' '.$this->name($match['1'][$i]), $conditions);
} else {
$conditions = preg_replace('/' . $match['0'][$i] . '/', ' '.$this->name($match['1'][$i]), $conditions);
$conditions = preg_replace('/' . $match['0'][$i] . '(?=[^\\w])/', ' '.$this->name($match['1'][$i]), $conditions);
}
}
}
$conditions = rtrim($conditions);
}
}
return $clause . $conditions;