Permalink
Browse files

fix compliancy with more elaborate ORDER syntax, such as "DESC NULLS …

…FIRST" in postgresql, in DboSource::order()
  • Loading branch information...
Dieter Plaetinck authored and lorenzo committed Feb 24, 2010
1 parent bed4027 commit a79ff508a63082905853dd134649a9b3526855b6
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/model/datasources/dbo_source.php
@@ -2333,9 +2333,9 @@ function order($keys, $direction = 'ASC', $model = null) {
continue;
}
- if (preg_match('/\\x20ASC|\\x20DESC/i', $key, $_dir)) {
+ if (preg_match('/\\x20(ASC|DESC).*/i', $key, $_dir)) {
$dir = $_dir[0];
- $key = preg_replace('/\\x20ASC|\\x20DESC/i', '', $key);
+ $key = preg_replace('/\\x20(ASC|DESC).*/i', '', $key);
}
if (strpos($key, '.')) {

0 comments on commit a79ff50

Please sign in to comment.