Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixes helpers.buildSqlOrder when order fields are not trimmed

This was found by the unit tests
  • Loading branch information...
commit e8d7adf6d74bba75bce75029fa4610fe7d8a97d2 1 parent 3ff9173
Diogo Resende authored June 15, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/databases/helpers.js
2  lib/databases/helpers.js
@@ -32,7 +32,7 @@ module.exports = {
32 32
 	buildSqlOrder: function (order, escapeCb) {
33 33
 		var orders = [], i = 0;
34 34
 
35  
-		order = order.split(/\s+/);
  35
+		order = order.replace(/\s+$/, '').replace(/^\s+/, '').split(/\s+/);
36 36
 
37 37
 		for (; i < order.length; i++) {
38 38
 			if (i < order.length - 1 && re_order_mode.test(order[i + 1])) {

0 notes on commit e8d7adf

Please sign in to comment.
Something went wrong with that request. Please try again.