MDL-23899 fixed asort to modify parameter instead of returning array - it now matches standard asort()

This commit is contained in:
Petr Skoda
2010-09-05 12:57:59 +00:00
parent 0f21a964a5
commit 3650b83d9e
2 changed files with 8 additions and 9 deletions
+3 -4
View File
@@ -470,15 +470,14 @@ class textlib {
* Locale aware sorting, the key associations are kept, values are sorted alphabetically.
* @param array $arr array to be sorted
* @param string $lang moodle language
* @return array
* @return void, modifies parameter
*/
function asort(array $arr) {
function asort(array &$arr) {
if (function_exists('collator_asort')) {
$coll = collator_create(get_string('locale', 'langconfig'));
collator_asort($coll, $arr);
} else {
asort($arr);
asort($arr, SORT_LOCALE_STRING);
}
return $arr;
}
}