Skip to content

Commit

Permalink
fix compliancy with more elaborate ORDER syntax, such as "DESC NULLS …
Browse files Browse the repository at this point in the history
…FIRST" in postgresql, in DboSource::order()
  • Loading branch information
Dieter Plaetinck authored and lorenzo committed Mar 9, 2010
1 parent bed4027 commit a79ff50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -2333,9 +2333,9 @@ function order($keys, $direction = 'ASC', $model = null) {
continue; continue;
} }


if (preg_match('/\\x20ASC|\\x20DESC/i', $key, $_dir)) { if (preg_match('/\\x20(ASC|DESC).*/i', $key, $_dir)) {
$dir = $_dir[0]; $dir = $_dir[0];
$key = preg_replace('/\\x20ASC|\\x20DESC/i', '', $key); $key = preg_replace('/\\x20(ASC|DESC).*/i', '', $key);
} }


if (strpos($key, '.')) { if (strpos($key, '.')) {
Expand Down

0 comments on commit a79ff50

Please sign in to comment.