File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/opnsense/mvc/app/controllers/OPNsense/Core/Api Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -684,9 +684,7 @@ public function infoAction()
684
684
if ($ plugin [0 ] == 'os ' ) {
685
685
if ($ type == 'local ' || ($ type == 'remote ' &&
686
686
($ devel || end ($ plugin ) != 'devel ' ))) {
687
- /* flip install status and prepend to search key to list them first */
688
- $ sortkey = ($ translated ['installed ' ] ? '0 ' : '1 ' ) . $ translated ['name ' ];
689
- $ plugins [$ sortkey ] = $ translated ;
687
+ $ plugins [$ translated ['name ' ]] = $ translated ;
690
688
}
691
689
}
692
690
}
@@ -702,8 +700,11 @@ public function infoAction()
702
700
$ response ['package ' ][] = $ package ;
703
701
}
704
702
705
- uksort ($ plugins , function ($ a , $ b ) {
706
- return strnatcasecmp ($ a , $ b );
703
+ uasort ($ plugins , function ($ a , $ b ) {
704
+ return strnatcasecmp (
705
+ ($ a ['installed ' ] ? '0 ' : '1 ' ) . $ a ['name ' ],
706
+ ($ b ['installed ' ] ? '0 ' : '1 ' ) . $ b ['name ' ]
707
+ );
707
708
});
708
709
709
710
$ response ['plugin ' ] = array ();
You can’t perform that action at this time.
0 commit comments