From 18147bc2540eddc38e767d8efb85cc8f2e5ee7e2 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Mon, 16 Jan 2006 06:35:58 +0000 Subject: [PATCH] lib/datalib.php - fixed missing return and global $CFG Tidyup after merging Tim Hunt's patches. --- lib/datalib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 6f2fe1dd95c..df54f8fff0d 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -715,15 +715,13 @@ function get_recordset_select($table, $select='', $sort='', $fields='*', $limitf */ function get_recordset_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') { - global $CFG; - if ($field) { $select = "$field IN ($values)"; } else { $select = ''; } - get_recordset_select($table, $select, $sort, $fields, $limitfrom, $limitnum); + return get_recordset_select($table, $select, $sort, $fields, $limitfrom, $limitnum); } /** @@ -953,6 +951,7 @@ function get_records_sql_menu($sql) { */ function get_field($table, $return, $field1, $value1, $field2='', $value2='', $field3='', $value3='') { + global $CFG; $select = where_clause($field1, $value1, $field2, $value2, $field3, $value3); $rs = get_recordset_sql('SELECT ' . $return . ' FROM ' . $CFG->prefix . $table . ' ' . $select);