[4483] Safely lowercase strings for case insensitive comparison (#4499)

This commit is contained in:
Michael Rogers 2021-12-07 16:01:27 -06:00 committed by GitHub
parent 159563ce5c
commit 6bdea20f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,21 +435,25 @@ export default {
sortNameDescending(a, b) {
// sorting tree children items
if (!(a.name && b.name)) {
if (a.object.name > b.object.name) {
if (a.object.name.toLowerCase()
> b.object.name.toLowerCase()) {
return 1;
}
if (b.object.name > a.object.name) {
if (b.object.name.toLowerCase()
> a.object.name.toLowerCase()) {
return -1;
}
}
// sorting compositon items
if (a.name > b.name) {
// sorting composition items
if (a.name.toLowerCase()
> b.name.toLowerCase()) {
return 1;
}
if (b.name > a.name) {
if (b.name.toLowerCase()
> a.name.toLowerCase()) {
return -1;
}