From 0b661c7d52baae531140aa2cba09294382643dde Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 6 Feb 2011 22:27:25 +0100 Subject: [PATCH] MDL-26256 detect missing collator support and use workaround instead --- lib/textlib.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/textlib.class.php b/lib/textlib.class.php index 0c58538c336..1adceea660b 100644 --- a/lib/textlib.class.php +++ b/lib/textlib.class.php @@ -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); } } -- 2.11.4.GIT