From ff6657041b3a648d7d2e9d32776950f528b00051 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 27 Dec 2011 15:53:01 +0100 Subject: [PATCH] Minor fix in the Database::select function due the recent parse_conditions "order" changes --- main/inc/lib/database.lib.php | 4 ++-- main/inc/lib/database.mysqli.lib.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index c3af22e4fa..2d2b76a86f 100644 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -1241,8 +1241,8 @@ class Database { $order_array = $condition_data; if (!empty($order_array)) { - if (count($order_array) >= 1 && !empty($order_array[0])) { - $order_array = self::escape_string($order_array[0]); + if (is_array($order_array) && count($order_array) >= 1 && !empty($order_array[0])) { + $order_array = self::escape_string($order_array[0]); $new_order_array = explode(',', $order_array); diff --git a/main/inc/lib/database.mysqli.lib.php b/main/inc/lib/database.mysqli.lib.php index fd4564b791..6ad133b4a4 100644 --- a/main/inc/lib/database.mysqli.lib.php +++ b/main/inc/lib/database.mysqli.lib.php @@ -1159,7 +1159,7 @@ class Database { $order_array = $condition_data; if (!empty($order_array)) { - if (count($order_array) >= 1 && !empty($order_array[0])) { + if (is_array($order_array) && count($order_array) >= 1 && !empty($order_array[0])) { $order_array = self::escape_string($order_array[0]); $new_order_array = explode(',', $order_array);