|
|
@@ -81,7 +81,7 @@ class Zend_Db_Select
|
|
|
const SQL_ASC = 'ASC';
|
|
|
const SQL_DESC = 'DESC';
|
|
|
|
|
|
- const REGEX_COLUMN_EXPR = '/^([\w]*\(([^\(\)]|(?1))*\))$/';
|
|
|
+ const REGEX_COLUMN_EXPR = '/^([\w]*\s*\(([^\(\)]|(?1))*\))$/';
|
|
|
|
|
|
/**
|
|
|
* Bind variables for query
|
|
|
@@ -940,7 +940,7 @@ class Zend_Db_Select
|
|
|
$currentCorrelationName = $correlationName;
|
|
|
if (is_string($col)) {
|
|
|
// Check for a column matching "<column> AS <alias>" and extract the alias name
|
|
|
- $col = str_replace("\n",' ',$col);
|
|
|
+ $col = trim(str_replace("\n",' ',$col));
|
|
|
if (preg_match('/^(.+)\s+' . self::SQL_AS . '\s+(.+)$/i', $col, $m)) {
|
|
|
$col = $m[1];
|
|
|
$alias = $m[2];
|