File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1073,17 +1073,17 @@ function ( Snippet $snippet ) {
1073
1073
private function get_sort_direction ( $ a_data , $ b_data ) {
1074
1074
1075
1075
// If the data is numeric, then calculate the ordering directly.
1076
- if ( is_numeric ( $ a_data ) ) {
1076
+ if ( is_numeric ( $ a_data ) && is_numeric ( $ b_data ) ) {
1077
1077
return $ a_data - $ b_data ;
1078
1078
}
1079
1079
1080
1080
// If only one of the data points is empty, then place it before the one which is not.
1081
- if ( '' === $ a_data xor '' === $ b_data ) {
1082
- return '' === $ a_data ? 1 : -1 ;
1081
+ if ( empty ( $ a_data ) xor empty ( $ b_data ) ) {
1082
+ return empty ( $ a_data ) ? 1 : -1 ;
1083
1083
}
1084
1084
1085
1085
// Sort using the default string sort order if possible.
1086
- if ( is_string ( $ a_data ) ) {
1086
+ if ( is_string ( $ a_data ) && is_string ( $ b_data ) ) {
1087
1087
return strcasecmp ( $ a_data , $ b_data );
1088
1088
}
1089
1089
You can’t perform that action at this time.
0 commit comments