Fixes #481: tag cloud fatal error
Only send LC_COLLATE to Collator and check that no error occured.
This commit is contained in:
parent
7b63e4ca09
commit
7eb0a83201
1 changed files with 5 additions and 4 deletions
|
@ -1218,11 +1218,12 @@ function renderPage()
|
|||
uksort($tags, function($a, $b) {
|
||||
// Collator is part of PHP intl.
|
||||
if (class_exists('Collator')) {
|
||||
$c = new Collator(setlocale(LC_ALL, 0));
|
||||
$c = new Collator(setlocale(LC_COLLATE, 0));
|
||||
if (!intl_is_failure(intl_get_error_code())) {
|
||||
return $c->compare($a, $b);
|
||||
} else {
|
||||
return strcasecmp($a, $b);
|
||||
}
|
||||
}
|
||||
return strcasecmp($a, $b);
|
||||
});
|
||||
|
||||
$tagList=array();
|
||||
|
|
Loading…
Reference in a new issue