aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-02-19 20:20:33 +0100
committerArthurHoaro <arthur@hoa.ro>2016-02-19 20:20:33 +0100
commit7eb0a832018621b3662f9fb5c45c0a67f5936088 (patch)
treeb5c83e131a07ca925950b127c3f375a1915abdf0 /index.php
parent7b63e4ca09f58b3b056bd2b8f2d8a4157537f274 (diff)
downloadShaarli-7eb0a832018621b3662f9fb5c45c0a67f5936088.tar.gz
Shaarli-7eb0a832018621b3662f9fb5c45c0a67f5936088.tar.zst
Shaarli-7eb0a832018621b3662f9fb5c45c0a67f5936088.zip
Fixes #481: tag cloud fatal error
Only send LC_COLLATE to Collator and check that no error occured.
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.php b/index.php
index 30e49cbb..231b63f6 100644
--- a/index.php
+++ b/index.php
@@ -1218,11 +1218,12 @@ function renderPage()
1218 uksort($tags, function($a, $b) { 1218 uksort($tags, function($a, $b) {
1219 // Collator is part of PHP intl. 1219 // Collator is part of PHP intl.
1220 if (class_exists('Collator')) { 1220 if (class_exists('Collator')) {
1221 $c = new Collator(setlocale(LC_ALL, 0)); 1221 $c = new Collator(setlocale(LC_COLLATE, 0));
1222 return $c->compare($a, $b); 1222 if (!intl_is_failure(intl_get_error_code())) {
1223 } else { 1223 return $c->compare($a, $b);
1224 return strcasecmp($a, $b); 1224 }
1225 } 1225 }
1226 return strcasecmp($a, $b);
1226 }); 1227 });
1227 1228
1228 $tagList=array(); 1229 $tagList=array();