MDL-26256 detect missing collator support and use workaround instead

This commit is contained in:
Petr Skoda
2011-02-06 22:27:25 +01:00
parent 54b7b5993f
commit 0b661c7d52
+5 -4
View File
@@ -474,10 +474,11 @@ class textlib {
*/
function asort(array &$arr) {
if (function_exists('collator_asort')) {
$coll = collator_create(get_string('locale', 'langconfig'));
collator_asort($coll, $arr);
} else {
asort($arr, SORT_LOCALE_STRING);
if ($coll = collator_create(get_string('locale', 'langconfig'))) {
collator_asort($coll, $arr);
return;
}
}
asort($arr, SORT_LOCALE_STRING);
}
}