This commit is contained in:
Jake Dallimore 2019-11-21 11:55:07 +08:00
commit e9b0505720
2 changed files with 3 additions and 3 deletions

View file

@ -234,7 +234,7 @@ function block_blog_tags_sort($a, $b) {
} }
if (is_numeric($a->$tagsort)) { if (is_numeric($a->$tagsort)) {
return ($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort) ? 1 : -1; return (($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort)) ? 1 : -1;
} elseif (is_string($a->$tagsort)) { } elseif (is_string($a->$tagsort)) {
return strcmp($a->$tagsort, $b->$tagsort); //TODO: this is not compatible with UTF-8!! return strcmp($a->$tagsort, $b->$tagsort); //TODO: this is not compatible with UTF-8!!
} else { } else {

View file

@ -408,11 +408,11 @@ class core_tag_collection {
$tagsort = self::$cloudsortfield ?: 'name'; $tagsort = self::$cloudsortfield ?: 'name';
if (is_numeric($a->$tagsort)) { if (is_numeric($a->$tagsort)) {
return ($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort) ? 1 : -1; return (($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort)) ? 1 : -1;
} else if (is_string($a->$tagsort)) { } else if (is_string($a->$tagsort)) {
return strcmp($a->$tagsort, $b->$tagsort); return strcmp($a->$tagsort, $b->$tagsort);
} else { } else {
return 0; return 0;
} }
} }
} }