From: Andrew Nicols Date: Wed, 16 Mar 2016 02:42:52 +0000 (+0800) Subject: MDL-52574 core: Remove ASC/DESC when adding params from sort X-Git-Tag: v3.1.0-beta~340 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=83fc2cbd0d5a24e71c3742e344a2ed466d60ccfc MDL-52574 core: Remove ASC/DESC when adding params from sort --- diff --git a/lib/accesslib.php b/lib/accesslib.php index ae3936d1e78..32362d1e6b7 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -4213,6 +4213,8 @@ function get_role_users($roleid, context $context, $parent = false, $fields = '' $fieldsarray = preg_split('/,\s*/', $fields); $addedfields = array(); foreach ($sortarray as $sortfield) { + // Throw away any additional arguments to the sort (e.g. ASC/DESC). + list ($sortfield) = explode(' ', $sortfield); if (!in_array($sortfield, $fieldsarray)) { $fieldsarray[] = $sortfield; $addedfields[] = $sortfield;