Fix SQL when using operator SIMILAR TO

Fixes #1979
This commit is contained in:
hirata 2011-09-08 10:56:05 +09:00 committed by mark_story
parent 63902ab73f
commit e86ae43796

View file

@ -2239,8 +2239,8 @@ class DboSource extends DataSource {
* @access private
*/
function __parseKey(&$model, $key, $value) {
$operatorMatch = '/^((' . implode(')|(', $this->__sqlOps);
$operatorMatch .= '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is';
$operatorMatch = '/^(((' . implode(')|(', $this->__sqlOps);
$operatorMatch .= ')\\x20?)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is';
$bound = (strpos($key, '?') !== false || (is_array($value) && strpos($key, ':') !== false));
if (!strpos($key, ' ')) {