From fe396410894f9fcf430e31216312f70db800d96e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 17 Dec 2008 19:28:26 +0000 Subject: Update Kohana code to r3799 from their svn head. All tests pass. Resolved upstream tickets: http://dev.kohanaphp.com/ticket/972 Command: svn merge -c19275 vendor/kohana/modified/kohana trunk/kohana --- kohana/libraries/Database.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'kohana/libraries/Database.php') diff --git a/kohana/libraries/Database.php b/kohana/libraries/Database.php index ca4f6512..fd1ae3fa 100644 --- a/kohana/libraries/Database.php +++ b/kohana/libraries/Database.php @@ -621,6 +621,12 @@ class Database_Core { if ($val != '') { + // Add the table prefix if we are using table.column names + if(strpos($val, '.')) + { + $val = $this->config['table_prefix'].$val; + } + $this->groupby[] = $this->driver->escape_column($val); } } @@ -674,11 +680,18 @@ class Database_Core { { $direction = strtoupper(trim($direction)); + // Add a direction if the provided one isn't valid if ( ! in_array($direction, array('ASC', 'DESC', 'RAND()', 'RANDOM()', 'NULL'))) { $direction = 'ASC'; } + // Add the table prefix if a table.column was passed + if (strpos($column, '.')) + { + $column = $this->config['table_prefix'].$column; + } + $this->orderby[] = $this->driver->escape_column($column).' '.$direction; } -- cgit v1.2.3