Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…FIRST" in postgresql, in DboSource::order()
  • Loading branch information...
commit a79ff508a63082905853dd134649a9b3526855b6 1 parent bed4027
Dieter Plaetinck authored lorenzo committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/model/datasources/dbo_source.php
4 cake/libs/model/datasources/dbo_source.php
View
@@ -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, '.')) {
Please sign in to comment.
Something went wrong with that request. Please try again.