diff options
author | AltamashShaikh <altamash@innocraft.com> | 2021-10-13 06:50:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 06:50:23 +0300 |
commit | 68674d8fdf1464e0342f8413372ae702e7b7bc43 (patch) | |
tree | f334fc35788b4481e0d158160a444c311b8fcae2 /plugins | |
parent | dc47c2dc90f6bb009512742c2a8ac5201865b3ca (diff) |
Fixed in place sorting order bug for PHP version >= 8 (#18131)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/API/Glossary.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/API/Glossary.php b/plugins/API/Glossary.php index 144fcd4389..d76dcfdaa2 100644 --- a/plugins/API/Glossary.php +++ b/plugins/API/Glossary.php @@ -119,9 +119,11 @@ class Glossary ); } } - + usort($metrics, function ($a, $b) { - return strcmp($a['name'], $b['name']); + $key = ($a['name'] === $b['name'] ? 'id' : 'name'); + + return strcmp($a[$key], $b[$key]); }); return $metrics; } |